diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2008-02-25 10:27:41 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-02-29 15:41:58 -0500 |
commit | 2485f7105f20f85c2dbebc67be6b2cb97175fa7e (patch) | |
tree | c8c620864bb220d8a299d7f45675334879eb742a /include | |
parent | 38c07b430b50172b803fe4c7f76cba580ba9931f (diff) |
mac80211: clarify use of TX status/RX callbacks
This patch clarifies the use of the irqsafe vs. non-irq-safe
functions and their respective locking requirements.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/net/mac80211.h | 37 |
1 files changed, 34 insertions, 3 deletions
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index cd4b1c1a0d48..7a80c3981237 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
@@ -38,7 +38,11 @@ | |||
38 | * called in hardware interrupt context. The low-level driver must not call any | 38 | * called in hardware interrupt context. The low-level driver must not call any |
39 | * other functions in hardware interrupt context. If there is a need for such | 39 | * other functions in hardware interrupt context. If there is a need for such |
40 | * call, the low-level driver should first ACK the interrupt and perform the | 40 | * call, the low-level driver should first ACK the interrupt and perform the |
41 | * IEEE 802.11 code call after this, e.g. from a scheduled workqueue function. | 41 | * IEEE 802.11 code call after this, e.g. from a scheduled workqueue or even |
42 | * tasklet function. | ||
43 | * | ||
44 | * NOTE: If the driver opts to use the _irqsafe() functions, it may not also | ||
45 | * use the non-irqsafe functions! | ||
42 | */ | 46 | */ |
43 | 47 | ||
44 | /** | 48 | /** |
@@ -1204,7 +1208,10 @@ void __ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb, | |||
1204 | * buffer in @skb must start with an IEEE 802.11 header or a radiotap | 1208 | * buffer in @skb must start with an IEEE 802.11 header or a radiotap |
1205 | * header if %RX_FLAG_RADIOTAP is set in the @status flags. | 1209 | * header if %RX_FLAG_RADIOTAP is set in the @status flags. |
1206 | * | 1210 | * |
1207 | * This function may not be called in IRQ context. | 1211 | * This function may not be called in IRQ context. Calls to this function |
1212 | * for a single hardware must be synchronized against each other. Calls | ||
1213 | * to this function and ieee80211_rx_irqsafe() may not be mixed for a | ||
1214 | * single hardware. | ||
1208 | * | 1215 | * |
1209 | * @hw: the hardware this frame came in on | 1216 | * @hw: the hardware this frame came in on |
1210 | * @skb: the buffer to receive, owned by mac80211 after this call | 1217 | * @skb: the buffer to receive, owned by mac80211 after this call |
@@ -1221,7 +1228,10 @@ static inline void ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb, | |||
1221 | * ieee80211_rx_irqsafe - receive frame | 1228 | * ieee80211_rx_irqsafe - receive frame |
1222 | * | 1229 | * |
1223 | * Like ieee80211_rx() but can be called in IRQ context | 1230 | * Like ieee80211_rx() but can be called in IRQ context |
1224 | * (internally defers to a workqueue.) | 1231 | * (internally defers to a tasklet.) |
1232 | * | ||
1233 | * Calls to this function and ieee80211_rx() may not be mixed for a | ||
1234 | * single hardware. | ||
1225 | * | 1235 | * |
1226 | * @hw: the hardware this frame came in on | 1236 | * @hw: the hardware this frame came in on |
1227 | * @skb: the buffer to receive, owned by mac80211 after this call | 1237 | * @skb: the buffer to receive, owned by mac80211 after this call |
@@ -1240,6 +1250,11 @@ void ieee80211_rx_irqsafe(struct ieee80211_hw *hw, | |||
1240 | * transmitted. It is permissible to not call this function for | 1250 | * transmitted. It is permissible to not call this function for |
1241 | * multicast frames but this can affect statistics. | 1251 | * multicast frames but this can affect statistics. |
1242 | * | 1252 | * |
1253 | * This function may not be called in IRQ context. Calls to this function | ||
1254 | * for a single hardware must be synchronized against each other. Calls | ||
1255 | * to this function and ieee80211_tx_status_irqsafe() may not be mixed | ||
1256 | * for a single hardware. | ||
1257 | * | ||
1243 | * @hw: the hardware the frame was transmitted by | 1258 | * @hw: the hardware the frame was transmitted by |
1244 | * @skb: the frame that was transmitted, owned by mac80211 after this call | 1259 | * @skb: the frame that was transmitted, owned by mac80211 after this call |
1245 | * @status: status information for this frame; the status pointer need not | 1260 | * @status: status information for this frame; the status pointer need not |
@@ -1249,6 +1264,22 @@ void ieee80211_rx_irqsafe(struct ieee80211_hw *hw, | |||
1249 | void ieee80211_tx_status(struct ieee80211_hw *hw, | 1264 | void ieee80211_tx_status(struct ieee80211_hw *hw, |
1250 | struct sk_buff *skb, | 1265 | struct sk_buff *skb, |
1251 | struct ieee80211_tx_status *status); | 1266 | struct ieee80211_tx_status *status); |
1267 | |||
1268 | /** | ||
1269 | * ieee80211_tx_status_irqsafe - irq-safe transmit status callback | ||
1270 | * | ||
1271 | * Like ieee80211_tx_status() but can be called in IRQ context | ||
1272 | * (internally defers to a tasklet.) | ||
1273 | * | ||
1274 | * Calls to this function and ieee80211_tx_status() may not be mixed for a | ||
1275 | * single hardware. | ||
1276 | * | ||
1277 | * @hw: the hardware the frame was transmitted by | ||
1278 | * @skb: the frame that was transmitted, owned by mac80211 after this call | ||
1279 | * @status: status information for this frame; the status pointer need not | ||
1280 | * be valid after this function returns and is not freed by mac80211, | ||
1281 | * it is recommended that it points to a stack area | ||
1282 | */ | ||
1252 | void ieee80211_tx_status_irqsafe(struct ieee80211_hw *hw, | 1283 | void ieee80211_tx_status_irqsafe(struct ieee80211_hw *hw, |
1253 | struct sk_buff *skb, | 1284 | struct sk_buff *skb, |
1254 | struct ieee80211_tx_status *status); | 1285 | struct ieee80211_tx_status *status); |