diff options
author | Kalle Valo <kalle.valo@iki.fi> | 2009-12-23 07:15:47 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-12-28 16:55:10 -0500 |
commit | e1781ed33a8809c58ad6c3b6d432d656446efa43 (patch) | |
tree | 4d272bc5bf25263a67b8431e7cfac6f9bbbcb690 /include/net/mac80211.h | |
parent | 095d5ef608b58ece49f4131925700d27314ecdd8 (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>
Diffstat (limited to 'include/net/mac80211.h')
-rw-r--r-- | include/net/mac80211.h | 43 |
1 files changed, 31 insertions, 12 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 | */ |
1526 | struct ieee80211_ops { | 1545 | struct ieee80211_ops { |
1527 | int (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb); | 1546 | int (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb); |