aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKalle Valo <kalle.valo@iki.fi>2009-12-23 07:15:47 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-12-28 16:55:10 -0500
commite1781ed33a8809c58ad6c3b6d432d656446efa43 (patch)
tree4d272bc5bf25263a67b8431e7cfac6f9bbbcb690
parent095d5ef608b58ece49f4131925700d27314ecdd8 (diff)
mac80211: annotate sleeping driver ops
To make it easier to notice cases of calling sleeping ops in atomic context, annotate driver-ops.h with appropiate might_sleep() calls. At the same time, also document in mac80211.h the op functions with missing contexts. mac80211 doesn't seem to use get_tx_stats anywhere currently. Just to be on the safe side, I documented it to be atomic, but hopefully the op can be removed in the future. Compile-tested only. Signed-off-by: Kalle Valo <kalle.valo@iki.fi> Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--include/net/mac80211.h43
-rw-r--r--net/mac80211/driver-ops.h60
2 files changed, 87 insertions, 16 deletions
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 08d41357dcbe..5ee666ae4c88 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -1383,7 +1383,7 @@ enum ieee80211_ampdu_mlme_action {
1383 * When the device is started it should not have a MAC address 1383 * When the device is started it should not have a MAC address
1384 * to avoid acknowledging frames before a non-monitor device 1384 * to avoid acknowledging frames before a non-monitor device
1385 * is added. 1385 * is added.
1386 * Must be implemented. 1386 * Must be implemented and can sleep.
1387 * 1387 *
1388 * @stop: Called after last netdevice attached to the hardware 1388 * @stop: Called after last netdevice attached to the hardware
1389 * is disabled. This should turn off the hardware (at least 1389 * is disabled. This should turn off the hardware (at least
@@ -1391,7 +1391,7 @@ enum ieee80211_ampdu_mlme_action {
1391 * May be called right after add_interface if that rejects 1391 * May be called right after add_interface if that rejects
1392 * an interface. If you added any work onto the mac80211 workqueue 1392 * an interface. If you added any work onto the mac80211 workqueue
1393 * you should ensure to cancel it on this callback. 1393 * you should ensure to cancel it on this callback.
1394 * Must be implemented. 1394 * Must be implemented and can sleep.
1395 * 1395 *
1396 * @add_interface: Called when a netdevice attached to the hardware is 1396 * @add_interface: Called when a netdevice attached to the hardware is
1397 * enabled. Because it is not called for monitor mode devices, @start 1397 * enabled. Because it is not called for monitor mode devices, @start
@@ -1401,7 +1401,7 @@ enum ieee80211_ampdu_mlme_action {
1401 * interface is given in the conf parameter. 1401 * interface is given in the conf parameter.
1402 * The callback may refuse to add an interface by returning a 1402 * The callback may refuse to add an interface by returning a
1403 * negative error code (which will be seen in userspace.) 1403 * negative error code (which will be seen in userspace.)
1404 * Must be implemented. 1404 * Must be implemented and can sleep.
1405 * 1405 *
1406 * @remove_interface: Notifies a driver that an interface is going down. 1406 * @remove_interface: Notifies a driver that an interface is going down.
1407 * The @stop callback is called after this if it is the last interface 1407 * The @stop callback is called after this if it is the last interface
@@ -1410,19 +1410,20 @@ enum ieee80211_ampdu_mlme_action {
1410 * must be cleared so the device no longer acknowledges packets, 1410 * must be cleared so the device no longer acknowledges packets,
1411 * the mac_addr member of the conf structure is, however, set to the 1411 * the mac_addr member of the conf structure is, however, set to the
1412 * MAC address of the device going away. 1412 * MAC address of the device going away.
1413 * Hence, this callback must be implemented. 1413 * Hence, this callback must be implemented. It can sleep.
1414 * 1414 *
1415 * @config: Handler for configuration requests. IEEE 802.11 code calls this 1415 * @config: Handler for configuration requests. IEEE 802.11 code calls this
1416 * function to change hardware configuration, e.g., channel. 1416 * function to change hardware configuration, e.g., channel.
1417 * This function should never fail but returns a negative error code 1417 * This function should never fail but returns a negative error code
1418 * if it does. 1418 * if it does. The callback can sleep.
1419 * 1419 *
1420 * @bss_info_changed: Handler for configuration requests related to BSS 1420 * @bss_info_changed: Handler for configuration requests related to BSS
1421 * parameters that may vary during BSS's lifespan, and may affect low 1421 * parameters that may vary during BSS's lifespan, and may affect low
1422 * level driver (e.g. assoc/disassoc status, erp parameters). 1422 * level driver (e.g. assoc/disassoc status, erp parameters).
1423 * This function should not be used if no BSS has been set, unless 1423 * This function should not be used if no BSS has been set, unless
1424 * for association indication. The @changed parameter indicates which 1424 * for association indication. The @changed parameter indicates which
1425 * of the bss parameters has changed when a call is made. 1425 * of the bss parameters has changed when a call is made. The callback
1426 * can sleep.
1426 * 1427 *
1427 * @prepare_multicast: Prepare for multicast filter configuration. 1428 * @prepare_multicast: Prepare for multicast filter configuration.
1428 * This callback is optional, and its return value is passed 1429 * This callback is optional, and its return value is passed
@@ -1430,20 +1431,22 @@ enum ieee80211_ampdu_mlme_action {
1430 * 1431 *
1431 * @configure_filter: Configure the device's RX filter. 1432 * @configure_filter: Configure the device's RX filter.
1432 * See the section "Frame filtering" for more information. 1433 * See the section "Frame filtering" for more information.
1433 * This callback must be implemented. 1434 * This callback must be implemented and can sleep.
1434 * 1435 *
1435 * @set_tim: Set TIM bit. mac80211 calls this function when a TIM bit 1436 * @set_tim: Set TIM bit. mac80211 calls this function when a TIM bit
1436 * must be set or cleared for a given STA. Must be atomic. 1437 * must be set or cleared for a given STA. Must be atomic.
1437 * 1438 *
1438 * @set_key: See the section "Hardware crypto acceleration" 1439 * @set_key: See the section "Hardware crypto acceleration"
1439 * This callback can sleep, and is only called between add_interface 1440 * This callback is only called between add_interface and
1440 * and remove_interface calls, i.e. while the given virtual interface 1441 * remove_interface calls, i.e. while the given virtual interface
1441 * is enabled. 1442 * is enabled.
1442 * Returns a negative error code if the key can't be added. 1443 * Returns a negative error code if the key can't be added.
1444 * The callback can sleep.
1443 * 1445 *
1444 * @update_tkip_key: See the section "Hardware crypto acceleration" 1446 * @update_tkip_key: See the section "Hardware crypto acceleration"
1445 * This callback will be called in the context of Rx. Called for drivers 1447 * This callback will be called in the context of Rx. Called for drivers
1446 * which set IEEE80211_KEY_FLAG_TKIP_REQ_RX_P1_KEY. 1448 * which set IEEE80211_KEY_FLAG_TKIP_REQ_RX_P1_KEY.
1449 * The callback can sleep.
1447 * 1450 *
1448 * @hw_scan: Ask the hardware to service the scan request, no need to start 1451 * @hw_scan: Ask the hardware to service the scan request, no need to start
1449 * the scan state machine in stack. The scan must honour the channel 1452 * the scan state machine in stack. The scan must honour the channel
@@ -1457,21 +1460,28 @@ enum ieee80211_ampdu_mlme_action {
1457 * When the scan finishes, ieee80211_scan_completed() must be called; 1460 * When the scan finishes, ieee80211_scan_completed() must be called;
1458 * note that it also must be called when the scan cannot finish due to 1461 * note that it also must be called when the scan cannot finish due to
1459 * any error unless this callback returned a negative error code. 1462 * any error unless this callback returned a negative error code.
1463 * The callback can sleep.
1460 * 1464 *
1461 * @sw_scan_start: Notifier function that is called just before a software scan 1465 * @sw_scan_start: Notifier function that is called just before a software scan
1462 * is started. Can be NULL, if the driver doesn't need this notification. 1466 * is started. Can be NULL, if the driver doesn't need this notification.
1467 * The callback can sleep.
1463 * 1468 *
1464 * @sw_scan_complete: Notifier function that is called just after a software scan 1469 * @sw_scan_complete: Notifier function that is called just after a
1465 * finished. Can be NULL, if the driver doesn't need this notification. 1470 * software scan finished. Can be NULL, if the driver doesn't need
1471 * this notification.
1472 * The callback can sleep.
1466 * 1473 *
1467 * @get_stats: Return low-level statistics. 1474 * @get_stats: Return low-level statistics.
1468 * Returns zero if statistics are available. 1475 * Returns zero if statistics are available.
1476 * The callback can sleep.
1469 * 1477 *
1470 * @get_tkip_seq: If your device implements TKIP encryption in hardware this 1478 * @get_tkip_seq: If your device implements TKIP encryption in hardware this
1471 * callback should be provided to read the TKIP transmit IVs (both IV32 1479 * callback should be provided to read the TKIP transmit IVs (both IV32
1472 * and IV16) for the given key from hardware. 1480 * and IV16) for the given key from hardware.
1481 * The callback must be atomic.
1473 * 1482 *
1474 * @set_rts_threshold: Configuration of RTS threshold (if device needs it) 1483 * @set_rts_threshold: Configuration of RTS threshold (if device needs it)
1484 * The callback can sleep.
1475 * 1485 *
1476 * @sta_notify: Notifies low level driver about addition, removal or power 1486 * @sta_notify: Notifies low level driver about addition, removal or power
1477 * state transition of an associated station, AP, IBSS/WDS/mesh peer etc. 1487 * state transition of an associated station, AP, IBSS/WDS/mesh peer etc.
@@ -1480,30 +1490,36 @@ enum ieee80211_ampdu_mlme_action {
1480 * @conf_tx: Configure TX queue parameters (EDCF (aifs, cw_min, cw_max), 1490 * @conf_tx: Configure TX queue parameters (EDCF (aifs, cw_min, cw_max),
1481 * bursting) for a hardware TX queue. 1491 * bursting) for a hardware TX queue.
1482 * Returns a negative error code on failure. 1492 * Returns a negative error code on failure.
1493 * The callback can sleep.
1483 * 1494 *
1484 * @get_tx_stats: Get statistics of the current TX queue status. This is used 1495 * @get_tx_stats: Get statistics of the current TX queue status. This is used
1485 * to get number of currently queued packets (queue length), maximum queue 1496 * to get number of currently queued packets (queue length), maximum queue
1486 * size (limit), and total number of packets sent using each TX queue 1497 * size (limit), and total number of packets sent using each TX queue
1487 * (count). The 'stats' pointer points to an array that has hw->queues 1498 * (count). The 'stats' pointer points to an array that has hw->queues
1488 * items. 1499 * items.
1500 * The callback must be atomic.
1489 * 1501 *
1490 * @get_tsf: Get the current TSF timer value from firmware/hardware. Currently, 1502 * @get_tsf: Get the current TSF timer value from firmware/hardware. Currently,
1491 * this is only used for IBSS mode BSSID merging and debugging. Is not a 1503 * this is only used for IBSS mode BSSID merging and debugging. Is not a
1492 * required function. 1504 * required function.
1505 * The callback can sleep.
1493 * 1506 *
1494 * @set_tsf: Set the TSF timer to the specified value in the firmware/hardware. 1507 * @set_tsf: Set the TSF timer to the specified value in the firmware/hardware.
1495 * Currently, this is only used for IBSS mode debugging. Is not a 1508 * Currently, this is only used for IBSS mode debugging. Is not a
1496 * required function. 1509 * required function.
1510 * The callback can sleep.
1497 * 1511 *
1498 * @reset_tsf: Reset the TSF timer and allow firmware/hardware to synchronize 1512 * @reset_tsf: Reset the TSF timer and allow firmware/hardware to synchronize
1499 * with other STAs in the IBSS. This is only used in IBSS mode. This 1513 * with other STAs in the IBSS. This is only used in IBSS mode. This
1500 * function is optional if the firmware/hardware takes full care of 1514 * function is optional if the firmware/hardware takes full care of
1501 * TSF synchronization. 1515 * TSF synchronization.
1516 * The callback can sleep.
1502 * 1517 *
1503 * @tx_last_beacon: Determine whether the last IBSS beacon was sent by us. 1518 * @tx_last_beacon: Determine whether the last IBSS beacon was sent by us.
1504 * This is needed only for IBSS mode and the result of this function is 1519 * This is needed only for IBSS mode and the result of this function is
1505 * used to determine whether to reply to Probe Requests. 1520 * used to determine whether to reply to Probe Requests.
1506 * Returns non-zero if this device sent the last beacon. 1521 * Returns non-zero if this device sent the last beacon.
1522 * The callback can sleep.
1507 * 1523 *
1508 * @ampdu_action: Perform a certain A-MPDU action 1524 * @ampdu_action: Perform a certain A-MPDU action
1509 * The RA/TID combination determines the destination and TID we want 1525 * The RA/TID combination determines the destination and TID we want
@@ -1512,16 +1528,19 @@ enum ieee80211_ampdu_mlme_action {
1512 * is the first frame we expect to perform the action on. Notice 1528 * is the first frame we expect to perform the action on. Notice
1513 * that TX/RX_STOP can pass NULL for this parameter. 1529 * that TX/RX_STOP can pass NULL for this parameter.
1514 * Returns a negative error code on failure. 1530 * Returns a negative error code on failure.
1531 * The callback must be atomic.
1515 * 1532 *
1516 * @rfkill_poll: Poll rfkill hardware state. If you need this, you also 1533 * @rfkill_poll: Poll rfkill hardware state. If you need this, you also
1517 * need to set wiphy->rfkill_poll to %true before registration, 1534 * need to set wiphy->rfkill_poll to %true before registration,
1518 * and need to call wiphy_rfkill_set_hw_state() in the callback. 1535 * and need to call wiphy_rfkill_set_hw_state() in the callback.
1536 * The callback can sleep.
1519 * 1537 *
1520 * @testmode_cmd: Implement a cfg80211 test mode command. 1538 * @testmode_cmd: Implement a cfg80211 test mode command.
1539 * The callback can sleep.
1521 * 1540 *
1522 * @flush: Flush all pending frames from the hardware queue, making sure 1541 * @flush: Flush all pending frames from the hardware queue, making sure
1523 * that the hardware queues are empty. If the parameter @drop is set 1542 * that the hardware queues are empty. If the parameter @drop is set
1524 * to %true, pending frames may be dropped. 1543 * to %true, pending frames may be dropped. The callback can sleep.
1525 */ 1544 */
1526struct ieee80211_ops { 1545struct ieee80211_ops {
1527 int (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb); 1546 int (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb);
diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h
index bc7c8f55487a..8757ea73d544 100644
--- a/net/mac80211/driver-ops.h
+++ b/net/mac80211/driver-ops.h
@@ -14,6 +14,8 @@ static inline int drv_start(struct ieee80211_local *local)
14{ 14{
15 int ret; 15 int ret;
16 16
17 might_sleep();
18
17 local->started = true; 19 local->started = true;
18 smp_mb(); 20 smp_mb();
19 ret = local->ops->start(&local->hw); 21 ret = local->ops->start(&local->hw);
@@ -23,6 +25,8 @@ static inline int drv_start(struct ieee80211_local *local)
23 25
24static inline void drv_stop(struct ieee80211_local *local) 26static inline void drv_stop(struct ieee80211_local *local)
25{ 27{
28 might_sleep();
29
26 local->ops->stop(&local->hw); 30 local->ops->stop(&local->hw);
27 trace_drv_stop(local); 31 trace_drv_stop(local);
28 32
@@ -38,7 +42,11 @@ static inline void drv_stop(struct ieee80211_local *local)
38static inline int drv_add_interface(struct ieee80211_local *local, 42static inline int drv_add_interface(struct ieee80211_local *local,
39 struct ieee80211_vif *vif) 43 struct ieee80211_vif *vif)
40{ 44{
41 int ret = local->ops->add_interface(&local->hw, vif); 45 int ret;
46
47 might_sleep();
48
49 ret = local->ops->add_interface(&local->hw, vif);
42 trace_drv_add_interface(local, vif_to_sdata(vif), ret); 50 trace_drv_add_interface(local, vif_to_sdata(vif), ret);
43 return ret; 51 return ret;
44} 52}
@@ -46,13 +54,19 @@ static inline int drv_add_interface(struct ieee80211_local *local,
46static inline void drv_remove_interface(struct ieee80211_local *local, 54static inline void drv_remove_interface(struct ieee80211_local *local,
47 struct ieee80211_vif *vif) 55 struct ieee80211_vif *vif)
48{ 56{
57 might_sleep();
58
49 local->ops->remove_interface(&local->hw, vif); 59 local->ops->remove_interface(&local->hw, vif);
50 trace_drv_remove_interface(local, vif_to_sdata(vif)); 60 trace_drv_remove_interface(local, vif_to_sdata(vif));
51} 61}
52 62
53static inline int drv_config(struct ieee80211_local *local, u32 changed) 63static inline int drv_config(struct ieee80211_local *local, u32 changed)
54{ 64{
55 int ret = local->ops->config(&local->hw, changed); 65 int ret;
66
67 might_sleep();
68
69 ret = local->ops->config(&local->hw, changed);
56 trace_drv_config(local, changed, ret); 70 trace_drv_config(local, changed, ret);
57 return ret; 71 return ret;
58} 72}
@@ -62,6 +76,8 @@ static inline void drv_bss_info_changed(struct ieee80211_local *local,
62 struct ieee80211_bss_conf *info, 76 struct ieee80211_bss_conf *info,
63 u32 changed) 77 u32 changed)
64{ 78{
79 might_sleep();
80
65 if (local->ops->bss_info_changed) 81 if (local->ops->bss_info_changed)
66 local->ops->bss_info_changed(&local->hw, &sdata->vif, info, changed); 82 local->ops->bss_info_changed(&local->hw, &sdata->vif, info, changed);
67 trace_drv_bss_info_changed(local, sdata, info, changed); 83 trace_drv_bss_info_changed(local, sdata, info, changed);
@@ -111,7 +127,11 @@ static inline int drv_set_key(struct ieee80211_local *local,
111 struct ieee80211_sta *sta, 127 struct ieee80211_sta *sta,
112 struct ieee80211_key_conf *key) 128 struct ieee80211_key_conf *key)
113{ 129{
114 int ret = local->ops->set_key(&local->hw, cmd, &sdata->vif, sta, key); 130 int ret;
131
132 might_sleep();
133
134 ret = local->ops->set_key(&local->hw, cmd, &sdata->vif, sta, key);
115 trace_drv_set_key(local, cmd, sdata, sta, key, ret); 135 trace_drv_set_key(local, cmd, sdata, sta, key, ret);
116 return ret; 136 return ret;
117} 137}
@@ -121,6 +141,8 @@ static inline void drv_update_tkip_key(struct ieee80211_local *local,
121 const u8 *address, u32 iv32, 141 const u8 *address, u32 iv32,
122 u16 *phase1key) 142 u16 *phase1key)
123{ 143{
144 might_sleep();
145
124 if (local->ops->update_tkip_key) 146 if (local->ops->update_tkip_key)
125 local->ops->update_tkip_key(&local->hw, conf, address, 147 local->ops->update_tkip_key(&local->hw, conf, address,
126 iv32, phase1key); 148 iv32, phase1key);
@@ -130,13 +152,19 @@ static inline void drv_update_tkip_key(struct ieee80211_local *local,
130static inline int drv_hw_scan(struct ieee80211_local *local, 152static inline int drv_hw_scan(struct ieee80211_local *local,
131 struct cfg80211_scan_request *req) 153 struct cfg80211_scan_request *req)
132{ 154{
133 int ret = local->ops->hw_scan(&local->hw, req); 155 int ret;
156
157 might_sleep();
158
159 ret = local->ops->hw_scan(&local->hw, req);
134 trace_drv_hw_scan(local, req, ret); 160 trace_drv_hw_scan(local, req, ret);
135 return ret; 161 return ret;
136} 162}
137 163
138static inline void drv_sw_scan_start(struct ieee80211_local *local) 164static inline void drv_sw_scan_start(struct ieee80211_local *local)
139{ 165{
166 might_sleep();
167
140 if (local->ops->sw_scan_start) 168 if (local->ops->sw_scan_start)
141 local->ops->sw_scan_start(&local->hw); 169 local->ops->sw_scan_start(&local->hw);
142 trace_drv_sw_scan_start(local); 170 trace_drv_sw_scan_start(local);
@@ -144,6 +172,8 @@ static inline void drv_sw_scan_start(struct ieee80211_local *local)
144 172
145static inline void drv_sw_scan_complete(struct ieee80211_local *local) 173static inline void drv_sw_scan_complete(struct ieee80211_local *local)
146{ 174{
175 might_sleep();
176
147 if (local->ops->sw_scan_complete) 177 if (local->ops->sw_scan_complete)
148 local->ops->sw_scan_complete(&local->hw); 178 local->ops->sw_scan_complete(&local->hw);
149 trace_drv_sw_scan_complete(local); 179 trace_drv_sw_scan_complete(local);
@@ -154,6 +184,8 @@ static inline int drv_get_stats(struct ieee80211_local *local,
154{ 184{
155 int ret = -EOPNOTSUPP; 185 int ret = -EOPNOTSUPP;
156 186
187 might_sleep();
188
157 if (local->ops->get_stats) 189 if (local->ops->get_stats)
158 ret = local->ops->get_stats(&local->hw, stats); 190 ret = local->ops->get_stats(&local->hw, stats);
159 trace_drv_get_stats(local, stats, ret); 191 trace_drv_get_stats(local, stats, ret);
@@ -173,6 +205,9 @@ static inline int drv_set_rts_threshold(struct ieee80211_local *local,
173 u32 value) 205 u32 value)
174{ 206{
175 int ret = 0; 207 int ret = 0;
208
209 might_sleep();
210
176 if (local->ops->set_rts_threshold) 211 if (local->ops->set_rts_threshold)
177 ret = local->ops->set_rts_threshold(&local->hw, value); 212 ret = local->ops->set_rts_threshold(&local->hw, value);
178 trace_drv_set_rts_threshold(local, value, ret); 213 trace_drv_set_rts_threshold(local, value, ret);
@@ -193,6 +228,9 @@ static inline int drv_conf_tx(struct ieee80211_local *local, u16 queue,
193 const struct ieee80211_tx_queue_params *params) 228 const struct ieee80211_tx_queue_params *params)
194{ 229{
195 int ret = -EOPNOTSUPP; 230 int ret = -EOPNOTSUPP;
231
232 might_sleep();
233
196 if (local->ops->conf_tx) 234 if (local->ops->conf_tx)
197 ret = local->ops->conf_tx(&local->hw, queue, params); 235 ret = local->ops->conf_tx(&local->hw, queue, params);
198 trace_drv_conf_tx(local, queue, params, ret); 236 trace_drv_conf_tx(local, queue, params, ret);
@@ -210,6 +248,9 @@ static inline int drv_get_tx_stats(struct ieee80211_local *local,
210static inline u64 drv_get_tsf(struct ieee80211_local *local) 248static inline u64 drv_get_tsf(struct ieee80211_local *local)
211{ 249{
212 u64 ret = -1ULL; 250 u64 ret = -1ULL;
251
252 might_sleep();
253
213 if (local->ops->get_tsf) 254 if (local->ops->get_tsf)
214 ret = local->ops->get_tsf(&local->hw); 255 ret = local->ops->get_tsf(&local->hw);
215 trace_drv_get_tsf(local, ret); 256 trace_drv_get_tsf(local, ret);
@@ -218,6 +259,8 @@ static inline u64 drv_get_tsf(struct ieee80211_local *local)
218 259
219static inline void drv_set_tsf(struct ieee80211_local *local, u64 tsf) 260static inline void drv_set_tsf(struct ieee80211_local *local, u64 tsf)
220{ 261{
262 might_sleep();
263
221 if (local->ops->set_tsf) 264 if (local->ops->set_tsf)
222 local->ops->set_tsf(&local->hw, tsf); 265 local->ops->set_tsf(&local->hw, tsf);
223 trace_drv_set_tsf(local, tsf); 266 trace_drv_set_tsf(local, tsf);
@@ -225,6 +268,8 @@ static inline void drv_set_tsf(struct ieee80211_local *local, u64 tsf)
225 268
226static inline void drv_reset_tsf(struct ieee80211_local *local) 269static inline void drv_reset_tsf(struct ieee80211_local *local)
227{ 270{
271 might_sleep();
272
228 if (local->ops->reset_tsf) 273 if (local->ops->reset_tsf)
229 local->ops->reset_tsf(&local->hw); 274 local->ops->reset_tsf(&local->hw);
230 trace_drv_reset_tsf(local); 275 trace_drv_reset_tsf(local);
@@ -233,6 +278,9 @@ static inline void drv_reset_tsf(struct ieee80211_local *local)
233static inline int drv_tx_last_beacon(struct ieee80211_local *local) 278static inline int drv_tx_last_beacon(struct ieee80211_local *local)
234{ 279{
235 int ret = 1; 280 int ret = 1;
281
282 might_sleep();
283
236 if (local->ops->tx_last_beacon) 284 if (local->ops->tx_last_beacon)
237 ret = local->ops->tx_last_beacon(&local->hw); 285 ret = local->ops->tx_last_beacon(&local->hw);
238 trace_drv_tx_last_beacon(local, ret); 286 trace_drv_tx_last_beacon(local, ret);
@@ -256,12 +304,16 @@ static inline int drv_ampdu_action(struct ieee80211_local *local,
256 304
257static inline void drv_rfkill_poll(struct ieee80211_local *local) 305static inline void drv_rfkill_poll(struct ieee80211_local *local)
258{ 306{
307 might_sleep();
308
259 if (local->ops->rfkill_poll) 309 if (local->ops->rfkill_poll)
260 local->ops->rfkill_poll(&local->hw); 310 local->ops->rfkill_poll(&local->hw);
261} 311}
262 312
263static inline void drv_flush(struct ieee80211_local *local, bool drop) 313static inline void drv_flush(struct ieee80211_local *local, bool drop)
264{ 314{
315 might_sleep();
316
265 trace_drv_flush(local, drop); 317 trace_drv_flush(local, drop);
266 if (local->ops->flush) 318 if (local->ops->flush)
267 local->ops->flush(&local->hw, drop); 319 local->ops->flush(&local->hw, drop);