diff options
author | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2011-07-07 10:59:02 -0400 |
---|---|---|
committer | Wey-Yi Guy <wey-yi.w.guy@intel.com> | 2011-07-16 10:37:06 -0400 |
commit | 1ab9f6c11b003d086ae4890ea202cc3c66f5a17a (patch) | |
tree | 36296b54edf0e3d8ee2b2c671d730b4de1f215e0 /drivers/net/wireless/iwlwifi/iwl-rx.c | |
parent | a27367d25da06c24e0379ad4489542016ff11dbb (diff) |
iwlagn: move the Rx dispatching to the upper layer
The upper layer receives a pointer to an iwl_rx_mem_buffer. I would prefer the
upper layer to receive a pointer to an iwl_rx_packet, but this is impossible
since the Rx path needs to add the address of the page to the skb.
I may find a solution later.
All the pre_rx_handler and notification code has been moved to the upper layer.
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-rx.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-rx.c | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-rx.c b/drivers/net/wireless/iwlwifi/iwl-rx.c index f3f3efe38ce2..c5eb379246ff 100644 --- a/drivers/net/wireless/iwlwifi/iwl-rx.c +++ b/drivers/net/wireless/iwlwifi/iwl-rx.c | |||
@@ -1105,3 +1105,49 @@ void iwl_setup_rx_handlers(struct iwl_priv *priv) | |||
1105 | /* Set up hardware specific Rx handlers */ | 1105 | /* Set up hardware specific Rx handlers */ |
1106 | priv->cfg->ops->lib->rx_handler_setup(priv); | 1106 | priv->cfg->ops->lib->rx_handler_setup(priv); |
1107 | } | 1107 | } |
1108 | |||
1109 | void iwl_rx_dispatch(struct iwl_priv *priv, struct iwl_rx_mem_buffer *rxb) | ||
1110 | { | ||
1111 | struct iwl_rx_packet *pkt = rxb_addr(rxb); | ||
1112 | |||
1113 | /* | ||
1114 | * Do the notification wait before RX handlers so | ||
1115 | * even if the RX handler consumes the RXB we have | ||
1116 | * access to it in the notification wait entry. | ||
1117 | */ | ||
1118 | if (!list_empty(&priv->_agn.notif_waits)) { | ||
1119 | struct iwl_notification_wait *w; | ||
1120 | |||
1121 | spin_lock(&priv->_agn.notif_wait_lock); | ||
1122 | list_for_each_entry(w, &priv->_agn.notif_waits, list) { | ||
1123 | if (w->cmd != pkt->hdr.cmd) | ||
1124 | continue; | ||
1125 | IWL_DEBUG_RX(priv, | ||
1126 | "Notif: %s, 0x%02x - wake the callers up\n", | ||
1127 | get_cmd_string(pkt->hdr.cmd), | ||
1128 | pkt->hdr.cmd); | ||
1129 | w->triggered = true; | ||
1130 | if (w->fn) | ||
1131 | w->fn(priv, pkt, w->fn_data); | ||
1132 | } | ||
1133 | spin_unlock(&priv->_agn.notif_wait_lock); | ||
1134 | |||
1135 | wake_up_all(&priv->_agn.notif_waitq); | ||
1136 | } | ||
1137 | |||
1138 | if (priv->pre_rx_handler) | ||
1139 | priv->pre_rx_handler(priv, rxb); | ||
1140 | |||
1141 | /* Based on type of command response or notification, | ||
1142 | * handle those that need handling via function in | ||
1143 | * rx_handlers table. See iwl_setup_rx_handlers() */ | ||
1144 | if (priv->rx_handlers[pkt->hdr.cmd]) { | ||
1145 | priv->isr_stats.rx_handlers[pkt->hdr.cmd]++; | ||
1146 | priv->rx_handlers[pkt->hdr.cmd] (priv, rxb); | ||
1147 | } else { | ||
1148 | /* No handling needed */ | ||
1149 | IWL_DEBUG_RX(priv, | ||
1150 | "No handler needed for %s, 0x%02x\n", | ||
1151 | get_cmd_string(pkt->hdr.cmd), pkt->hdr.cmd); | ||
1152 | } | ||
1153 | } | ||