iwlagn: extend notification wait function
authorJohannes Berg <johannes.berg@intel.com>
Wed, 13 Apr 2011 10:14:47 +0000 (03:14 -0700)
committerWey-Yi Guy <wey-yi.w.guy@intel.com>
Fri, 22 Apr 2011 17:02:47 +0000 (10:02 -0700)
A notification wait function is called with the
command, but currently has no way of passing
data back to the caller -- fix that by adding a
void pointer to the function that can be used
between the caller and the function.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
drivers/net/wireless/iwlwifi/iwl-agn-lib.c
drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
drivers/net/wireless/iwlwifi/iwl-agn.c
drivers/net/wireless/iwlwifi/iwl-agn.h
drivers/net/wireless/iwlwifi/iwl-dev.h

index 5e62a089e9ba199da49c88f0a68edf4c0a1ff71e..486a8d3a1f0dc514a4e7d1597468e2772706aff8 100644 (file)
@@ -2256,11 +2256,14 @@ int iwl_dump_fh(struct iwl_priv *priv, char **buf, bool display)
 /* notification wait support */
 void iwlagn_init_notification_wait(struct iwl_priv *priv,
                                   struct iwl_notification_wait *wait_entry,
+                                  u8 cmd,
                                   void (*fn)(struct iwl_priv *priv,
-                                             struct iwl_rx_packet *pkt),
-                                  u8 cmd)
+                                             struct iwl_rx_packet *pkt,
+                                             void *data),
+                                  void *fn_data)
 {
        wait_entry->fn = fn;
+       wait_entry->fn_data = fn_data;
        wait_entry->cmd = cmd;
        wait_entry->triggered = false;
 
index 56f46ee3bacd26d9313d45ee7d85a79ca69b1f69..ee7c5ba9597135c4a65ff222f96b92e47190a353 100644 (file)
@@ -58,8 +58,9 @@ static int iwlagn_disable_pan(struct iwl_priv *priv,
        u8 old_dev_type = send->dev_type;
        int ret;
 
-       iwlagn_init_notification_wait(priv, &disable_wait, NULL,
-                                     REPLY_WIPAN_DEACTIVATION_COMPLETE);
+       iwlagn_init_notification_wait(priv, &disable_wait,
+                                     REPLY_WIPAN_DEACTIVATION_COMPLETE,
+                                     NULL, NULL);
 
        send->filter_flags &= ~RXON_FILTER_ASSOC_MSK;
        send->dev_type = RXON_DEV_TYPE_P2P;
index e99cd9474ba8fd32ad273e3982e107efcde4e0b1..a9204db377a85d2d1a31f590632e9ca45044b87f 100644 (file)
@@ -769,7 +769,7 @@ static void iwl_rx_handle(struct iwl_priv *priv)
                                if (w->cmd == pkt->hdr.cmd) {
                                        w->triggered = true;
                                        if (w->fn)
-                                               w->fn(priv, pkt);
+                                               w->fn(priv, pkt, w->fn_data);
                                }
                        }
                        spin_unlock(&priv->_agn.notif_wait_lock);
index ef1bbd415b1662f202fe6cdd131a6cb364fd804b..b9871c4b3c18cd17584160072c7288a87a3d0e50 100644 (file)
@@ -338,9 +338,11 @@ void iwlcore_eeprom_release_semaphore(struct iwl_priv *priv);
 void __acquires(wait_entry)
 iwlagn_init_notification_wait(struct iwl_priv *priv,
                              struct iwl_notification_wait *wait_entry,
+                             u8 cmd,
                              void (*fn)(struct iwl_priv *priv,
-                                        struct iwl_rx_packet *pkt),
-                             u8 cmd);
+                                        struct iwl_rx_packet *pkt,
+                                        void *data),
+                             void *fn_data);
 signed long __releases(wait_entry)
 iwlagn_wait_notification(struct iwl_priv *priv,
                         struct iwl_notification_wait *wait_entry,
index e84534c4d9560b7374bc00f7605580604a512f75..d8bf11727aacdde1dbc63228c04c7315189c7b10 100644 (file)
@@ -1105,7 +1105,9 @@ struct iwl_force_reset {
 struct iwl_notification_wait {
        struct list_head list;
 
-       void (*fn)(struct iwl_priv *priv, struct iwl_rx_packet *pkt);
+       void (*fn)(struct iwl_priv *priv, struct iwl_rx_packet *pkt,
+                  void *data);
+       void *fn_data;
 
        u8 cmd;
        bool triggered;