iwlwifi: Add power level support
[deliverable/linux.git] / drivers / net / wireless / iwlwifi / iwl-core.c
index da51349cbd8b6b989a6ce6ebdc0209618881ce84..c336b1991f1ab8e4b49cf3570f435126cdf80070 100644 (file)
 struct iwl_priv; /* FIXME: remove */
 #include "iwl-debug.h"
 #include "iwl-eeprom.h"
+#include "iwl-4965.h" /* FIXME: remove */
 #include "iwl-core.h"
+#include "iwl-rfkill.h"
+#include "iwl-power.h"
 
-#include "iwl-4965.h" /* FIXME: remove */
 
 MODULE_DESCRIPTION("iwl core");
 MODULE_VERSION(IWLWIFI_VERSION);
@@ -249,3 +251,45 @@ int iwl_setup(struct iwl_priv *priv)
 }
 EXPORT_SYMBOL(iwl_setup);
 
+/* Low level driver call this function to update iwlcore with
+ * driver status.
+ */
+int iwlcore_low_level_notify(struct iwl_priv *priv,
+                             enum iwlcore_card_notify notify)
+{
+       int ret;
+       switch (notify) {
+       case IWLCORE_INIT_EVT:
+               ret = iwl_rfkill_init(priv);
+               if (ret)
+                       IWL_ERROR("Unable to initialize RFKILL system. "
+                                 "Ignoring error: %d\n", ret);
+               iwl_power_initialize(priv);
+               break;
+       case IWLCORE_START_EVT:
+               iwl_power_update_mode(priv, 1);
+               break;
+       case IWLCORE_STOP_EVT:
+               break;
+       case IWLCORE_REMOVE_EVT:
+               iwl_rfkill_unregister(priv);
+               break;
+       }
+
+       return 0;
+}
+EXPORT_SYMBOL(iwlcore_low_level_notify);
+
+int iwl_send_statistics_request(struct iwl_priv *priv, u8 flags)
+{
+       u32 stat_flags = 0;
+       struct iwl_host_cmd cmd = {
+               .id = REPLY_STATISTICS_CMD,
+               .meta.flags = flags,
+               .len = sizeof(stat_flags),
+               .data = (u8 *) &stat_flags,
+       };
+       return iwl_send_cmd(priv, &cmd);
+}
+EXPORT_SYMBOL(iwl_send_statistics_request);
+
This page took 0.026717 seconds and 5 git commands to generate.