Commit 09f18afe authored by Johannes Berg's avatar Johannes Berg Committed by Wey-Yi Guy

iwlagn: extend notification wait function

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: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarWey-Yi Guy <wey-yi.w.guy@intel.com>
parent 3e14c1fd
...@@ -2256,11 +2256,14 @@ int iwl_dump_fh(struct iwl_priv *priv, char **buf, bool display) ...@@ -2256,11 +2256,14 @@ int iwl_dump_fh(struct iwl_priv *priv, char **buf, bool display)
/* notification wait support */ /* notification wait support */
void iwlagn_init_notification_wait(struct iwl_priv *priv, void iwlagn_init_notification_wait(struct iwl_priv *priv,
struct iwl_notification_wait *wait_entry, struct iwl_notification_wait *wait_entry,
u8 cmd,
void (*fn)(struct iwl_priv *priv, void (*fn)(struct iwl_priv *priv,
struct iwl_rx_packet *pkt), struct iwl_rx_packet *pkt,
u8 cmd) void *data),
void *fn_data)
{ {
wait_entry->fn = fn; wait_entry->fn = fn;
wait_entry->fn_data = fn_data;
wait_entry->cmd = cmd; wait_entry->cmd = cmd;
wait_entry->triggered = false; wait_entry->triggered = false;
......
...@@ -58,8 +58,9 @@ static int iwlagn_disable_pan(struct iwl_priv *priv, ...@@ -58,8 +58,9 @@ static int iwlagn_disable_pan(struct iwl_priv *priv,
u8 old_dev_type = send->dev_type; u8 old_dev_type = send->dev_type;
int ret; int ret;
iwlagn_init_notification_wait(priv, &disable_wait, NULL, iwlagn_init_notification_wait(priv, &disable_wait,
REPLY_WIPAN_DEACTIVATION_COMPLETE); REPLY_WIPAN_DEACTIVATION_COMPLETE,
NULL, NULL);
send->filter_flags &= ~RXON_FILTER_ASSOC_MSK; send->filter_flags &= ~RXON_FILTER_ASSOC_MSK;
send->dev_type = RXON_DEV_TYPE_P2P; send->dev_type = RXON_DEV_TYPE_P2P;
......
...@@ -769,7 +769,7 @@ static void iwl_rx_handle(struct iwl_priv *priv) ...@@ -769,7 +769,7 @@ static void iwl_rx_handle(struct iwl_priv *priv)
if (w->cmd == pkt->hdr.cmd) { if (w->cmd == pkt->hdr.cmd) {
w->triggered = true; w->triggered = true;
if (w->fn) if (w->fn)
w->fn(priv, pkt); w->fn(priv, pkt, w->fn_data);
} }
} }
spin_unlock(&priv->_agn.notif_wait_lock); spin_unlock(&priv->_agn.notif_wait_lock);
......
...@@ -338,9 +338,11 @@ void iwlcore_eeprom_release_semaphore(struct iwl_priv *priv); ...@@ -338,9 +338,11 @@ void iwlcore_eeprom_release_semaphore(struct iwl_priv *priv);
void __acquires(wait_entry) void __acquires(wait_entry)
iwlagn_init_notification_wait(struct iwl_priv *priv, iwlagn_init_notification_wait(struct iwl_priv *priv,
struct iwl_notification_wait *wait_entry, struct iwl_notification_wait *wait_entry,
u8 cmd,
void (*fn)(struct iwl_priv *priv, void (*fn)(struct iwl_priv *priv,
struct iwl_rx_packet *pkt), struct iwl_rx_packet *pkt,
u8 cmd); void *data),
void *fn_data);
signed long __releases(wait_entry) signed long __releases(wait_entry)
iwlagn_wait_notification(struct iwl_priv *priv, iwlagn_wait_notification(struct iwl_priv *priv,
struct iwl_notification_wait *wait_entry, struct iwl_notification_wait *wait_entry,
......
...@@ -1105,7 +1105,9 @@ struct iwl_force_reset { ...@@ -1105,7 +1105,9 @@ struct iwl_force_reset {
struct iwl_notification_wait { struct iwl_notification_wait {
struct list_head list; 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; u8 cmd;
bool triggered; bool triggered;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment