diff options
author | Johannes Berg <johannes.berg@intel.com> | 2012-03-06 16:30:58 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-03-07 13:56:32 -0500 |
commit | 4bd14dd5f77bbe3c51f50f4e86d3b8960e6a518c (patch) | |
tree | 0dbf32e6fbf047035389a09b7b1124ca769a5551 /drivers/net/wireless/iwlwifi/iwl-agn-rx.c | |
parent | f47208934b2aba432722baeb86a72fcbfd26b593 (diff) |
iwlwifi: abstract out notification wait support
This will be sharable, but needs to live in the
op_mode as it is dependent on command processing.
Make a library out of the notification wait code.
Since I wrote all of the code originally and only
Intel employees changed it, we can also relicense
it to dual BSD/GPL.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-agn-rx.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn-rx.c | 24 |
1 files changed, 2 insertions, 22 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rx.c b/drivers/net/wireless/iwlwifi/iwl-agn-rx.c index 5c9c88b8609..f17142bb5df 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-rx.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-rx.c | |||
@@ -1142,9 +1142,7 @@ void iwl_setup_rx_handlers(struct iwl_priv *priv) | |||
1142 | priv->rx_handlers[REPLY_TX] = iwlagn_rx_reply_tx; | 1142 | priv->rx_handlers[REPLY_TX] = iwlagn_rx_reply_tx; |
1143 | 1143 | ||
1144 | /* set up notification wait support */ | 1144 | /* set up notification wait support */ |
1145 | spin_lock_init(&priv->shrd->notif_wait_lock); | 1145 | iwl_notification_wait_init(&priv->notif_wait); |
1146 | INIT_LIST_HEAD(&priv->shrd->notif_waits); | ||
1147 | init_waitqueue_head(&priv->shrd->notif_waitq); | ||
1148 | 1146 | ||
1149 | /* Set up BT Rx handlers */ | 1147 | /* Set up BT Rx handlers */ |
1150 | if (cfg(priv)->lib->bt_rx_handler_setup) | 1148 | if (cfg(priv)->lib->bt_rx_handler_setup) |
@@ -1164,25 +1162,7 @@ int iwl_rx_dispatch(struct iwl_op_mode *op_mode, struct iwl_rx_cmd_buffer *rxb, | |||
1164 | * even if the RX handler consumes the RXB we have | 1162 | * even if the RX handler consumes the RXB we have |
1165 | * access to it in the notification wait entry. | 1163 | * access to it in the notification wait entry. |
1166 | */ | 1164 | */ |
1167 | if (!list_empty(&priv->shrd->notif_waits)) { | 1165 | iwl_notification_wait_notify(&priv->notif_wait, pkt); |
1168 | struct iwl_notification_wait *w; | ||
1169 | |||
1170 | spin_lock(&priv->shrd->notif_wait_lock); | ||
1171 | list_for_each_entry(w, &priv->shrd->notif_waits, list) { | ||
1172 | if (w->cmd != pkt->hdr.cmd) | ||
1173 | continue; | ||
1174 | IWL_DEBUG_RX(priv, | ||
1175 | "Notif: %s, 0x%02x - wake the callers up\n", | ||
1176 | get_cmd_string(pkt->hdr.cmd), | ||
1177 | pkt->hdr.cmd); | ||
1178 | w->triggered = true; | ||
1179 | if (w->fn) | ||
1180 | w->fn(priv, pkt, w->fn_data); | ||
1181 | } | ||
1182 | spin_unlock(&priv->shrd->notif_wait_lock); | ||
1183 | |||
1184 | wake_up_all(&priv->shrd->notif_waitq); | ||
1185 | } | ||
1186 | 1166 | ||
1187 | if (priv->pre_rx_handler && | 1167 | if (priv->pre_rx_handler && |
1188 | priv->shrd->ucode_owner == IWL_OWNERSHIP_TM) | 1168 | priv->shrd->ucode_owner == IWL_OWNERSHIP_TM) |