aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2009-12-30 16:51:29 -0500
committerDavid S. Miller <davem@davemloft.net>2009-12-30 16:51:29 -0500
commit3a999e6eb5d277cd6a321dcda3fc43c3d9e4e4b8 (patch)
treeb0ad8d03710ee556e97515ba1c949233859391ce /include
parent6cd9b49d7328c4656bfc17fcb47fb814955d40d2 (diff)
parent891dc5e73783eeabd2a704a9425e2a199b39c9f9 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6
Diffstat (limited to 'include')
-rw-r--r--include/linux/ieee80211.h39
-rw-r--r--include/linux/nl80211.h36
-rw-r--r--include/net/cfg80211.h59
-rw-r--r--include/net/mac80211.h105
4 files changed, 175 insertions, 64 deletions
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index d62edc7df3ae..aeea282bd2fe 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -1085,12 +1085,12 @@ enum ieee80211_eid {
1085 WLAN_EID_TIM = 5, 1085 WLAN_EID_TIM = 5,
1086 WLAN_EID_IBSS_PARAMS = 6, 1086 WLAN_EID_IBSS_PARAMS = 6,
1087 WLAN_EID_CHALLENGE = 16, 1087 WLAN_EID_CHALLENGE = 16,
1088 /* 802.11d */ 1088
1089 WLAN_EID_COUNTRY = 7, 1089 WLAN_EID_COUNTRY = 7,
1090 WLAN_EID_HP_PARAMS = 8, 1090 WLAN_EID_HP_PARAMS = 8,
1091 WLAN_EID_HP_TABLE = 9, 1091 WLAN_EID_HP_TABLE = 9,
1092 WLAN_EID_REQUEST = 10, 1092 WLAN_EID_REQUEST = 10,
1093 /* 802.11e */ 1093
1094 WLAN_EID_QBSS_LOAD = 11, 1094 WLAN_EID_QBSS_LOAD = 11,
1095 WLAN_EID_EDCA_PARAM_SET = 12, 1095 WLAN_EID_EDCA_PARAM_SET = 12,
1096 WLAN_EID_TSPEC = 13, 1096 WLAN_EID_TSPEC = 13,
@@ -1113,7 +1113,7 @@ enum ieee80211_eid {
1113 WLAN_EID_PREP = 69, 1113 WLAN_EID_PREP = 69,
1114 WLAN_EID_PERR = 70, 1114 WLAN_EID_PERR = 70,
1115 WLAN_EID_RANN = 49, /* compatible with FreeBSD */ 1115 WLAN_EID_RANN = 49, /* compatible with FreeBSD */
1116 /* 802.11h */ 1116
1117 WLAN_EID_PWR_CONSTRAINT = 32, 1117 WLAN_EID_PWR_CONSTRAINT = 32,
1118 WLAN_EID_PWR_CAPABILITY = 33, 1118 WLAN_EID_PWR_CAPABILITY = 33,
1119 WLAN_EID_TPC_REQUEST = 34, 1119 WLAN_EID_TPC_REQUEST = 34,
@@ -1124,20 +1124,41 @@ enum ieee80211_eid {
1124 WLAN_EID_MEASURE_REPORT = 39, 1124 WLAN_EID_MEASURE_REPORT = 39,
1125 WLAN_EID_QUIET = 40, 1125 WLAN_EID_QUIET = 40,
1126 WLAN_EID_IBSS_DFS = 41, 1126 WLAN_EID_IBSS_DFS = 41,
1127 /* 802.11g */ 1127
1128 WLAN_EID_ERP_INFO = 42, 1128 WLAN_EID_ERP_INFO = 42,
1129 WLAN_EID_EXT_SUPP_RATES = 50, 1129 WLAN_EID_EXT_SUPP_RATES = 50,
1130 /* 802.11n */ 1130
1131 WLAN_EID_HT_CAPABILITY = 45, 1131 WLAN_EID_HT_CAPABILITY = 45,
1132 WLAN_EID_HT_INFORMATION = 61, 1132 WLAN_EID_HT_INFORMATION = 61,
1133 /* 802.11i */ 1133
1134 WLAN_EID_RSN = 48, 1134 WLAN_EID_RSN = 48,
1135 WLAN_EID_TIMEOUT_INTERVAL = 56, 1135 WLAN_EID_MMIE = 76,
1136 WLAN_EID_MMIE = 76 /* 802.11w */,
1137 WLAN_EID_WPA = 221, 1136 WLAN_EID_WPA = 221,
1138 WLAN_EID_GENERIC = 221, 1137 WLAN_EID_GENERIC = 221,
1139 WLAN_EID_VENDOR_SPECIFIC = 221, 1138 WLAN_EID_VENDOR_SPECIFIC = 221,
1140 WLAN_EID_QOS_PARAMETER = 222 1139 WLAN_EID_QOS_PARAMETER = 222,
1140
1141 WLAN_EID_AP_CHAN_REPORT = 51,
1142 WLAN_EID_NEIGHBOR_REPORT = 52,
1143 WLAN_EID_RCPI = 53,
1144 WLAN_EID_BSS_AVG_ACCESS_DELAY = 63,
1145 WLAN_EID_ANTENNA_INFO = 64,
1146 WLAN_EID_RSNI = 65,
1147 WLAN_EID_MEASUREMENT_PILOT_TX_INFO = 66,
1148 WLAN_EID_BSS_AVAILABLE_CAPACITY = 67,
1149 WLAN_EID_BSS_AC_ACCESS_DELAY = 68,
1150 WLAN_EID_RRM_ENABLED_CAPABILITIES = 70,
1151 WLAN_EID_MULTIPLE_BSSID = 71,
1152
1153 WLAN_EID_MOBILITY_DOMAIN = 54,
1154 WLAN_EID_FAST_BSS_TRANSITION = 55,
1155 WLAN_EID_TIMEOUT_INTERVAL = 56,
1156 WLAN_EID_RIC_DATA = 57,
1157 WLAN_EID_RIC_DESCRIPTOR = 75,
1158
1159 WLAN_EID_DSE_REGISTERED_LOCATION = 58,
1160 WLAN_EID_SUPPORTED_REGULATORY_CLASSES = 59,
1161 WLAN_EID_EXT_CHANSWITCH_ANN = 60,
1141}; 1162};
1142 1163
1143/* Action category code */ 1164/* Action category code */
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h
index da8ea2e19273..2bfbe88837ef 100644
--- a/include/linux/nl80211.h
+++ b/include/linux/nl80211.h
@@ -270,6 +270,31 @@
270 * @NL80211_CMD_SET_WIPHY_NETNS: Set a wiphy's netns. Note that all devices 270 * @NL80211_CMD_SET_WIPHY_NETNS: Set a wiphy's netns. Note that all devices
271 * associated with this wiphy must be down and will follow. 271 * associated with this wiphy must be down and will follow.
272 * 272 *
273 * @NL80211_CMD_REMAIN_ON_CHANNEL: Request to remain awake on the specified
274 * channel for the specified amount of time. This can be used to do
275 * off-channel operations like transmit a Public Action frame and wait for
276 * a response while being associated to an AP on another channel.
277 * %NL80211_ATTR_WIPHY or %NL80211_ATTR_IFINDEX is used to specify which
278 * radio is used. %NL80211_ATTR_WIPHY_FREQ is used to specify the
279 * frequency for the operation and %NL80211_ATTR_WIPHY_CHANNEL_TYPE may be
280 * optionally used to specify additional channel parameters.
281 * %NL80211_ATTR_DURATION is used to specify the duration in milliseconds
282 * to remain on the channel. This command is also used as an event to
283 * notify when the requested duration starts (it may take a while for the
284 * driver to schedule this time due to other concurrent needs for the
285 * radio).
286 * When called, this operation returns a cookie (%NL80211_ATTR_COOKIE)
287 * that will be included with any events pertaining to this request;
288 * the cookie is also used to cancel the request.
289 * @NL80211_CMD_CANCEL_REMAIN_ON_CHANNEL: This command can be used to cancel a
290 * pending remain-on-channel duration if the desired operation has been
291 * completed prior to expiration of the originally requested duration.
292 * %NL80211_ATTR_WIPHY or %NL80211_ATTR_IFINDEX is used to specify the
293 * radio. The %NL80211_ATTR_COOKIE attribute must be given as well to
294 * uniquely identify the request.
295 * This command is also used as an event to notify when a requested
296 * remain-on-channel duration has expired.
297 *
273 * @NL80211_CMD_MAX: highest used command number 298 * @NL80211_CMD_MAX: highest used command number
274 * @__NL80211_CMD_AFTER_LAST: internal use 299 * @__NL80211_CMD_AFTER_LAST: internal use
275 */ 300 */
@@ -353,6 +378,9 @@ enum nl80211_commands {
353 NL80211_CMD_DEL_PMKSA, 378 NL80211_CMD_DEL_PMKSA,
354 NL80211_CMD_FLUSH_PMKSA, 379 NL80211_CMD_FLUSH_PMKSA,
355 380
381 NL80211_CMD_REMAIN_ON_CHANNEL,
382 NL80211_CMD_CANCEL_REMAIN_ON_CHANNEL,
383
356 /* add new commands above here */ 384 /* add new commands above here */
357 385
358 /* used to define NL80211_CMD_MAX below */ 386 /* used to define NL80211_CMD_MAX below */
@@ -606,6 +634,10 @@ enum nl80211_commands {
606 * @NL80211_ATTR_MAX_NUM_PMKIDS: maximum number of PMKIDs a firmware can 634 * @NL80211_ATTR_MAX_NUM_PMKIDS: maximum number of PMKIDs a firmware can
607 * cache, a wiphy attribute. 635 * cache, a wiphy attribute.
608 * 636 *
637 * @NL80211_ATTR_DURATION: Duration of an operation in milliseconds, u32.
638 *
639 * @NL80211_ATTR_COOKIE: Generic 64-bit cookie to identify objects.
640 *
609 * @NL80211_ATTR_MAX: highest attribute number currently defined 641 * @NL80211_ATTR_MAX: highest attribute number currently defined
610 * @__NL80211_ATTR_AFTER_LAST: internal use 642 * @__NL80211_ATTR_AFTER_LAST: internal use
611 */ 643 */
@@ -743,6 +775,10 @@ enum nl80211_attrs {
743 NL80211_ATTR_PMKID, 775 NL80211_ATTR_PMKID,
744 NL80211_ATTR_MAX_NUM_PMKIDS, 776 NL80211_ATTR_MAX_NUM_PMKIDS,
745 777
778 NL80211_ATTR_DURATION,
779
780 NL80211_ATTR_COOKIE,
781
746 /* add attributes here, update the policy in nl80211.c */ 782 /* add attributes here, update the policy in nl80211.c */
747 783
748 __NL80211_ATTR_AFTER_LAST, 784 __NL80211_ATTR_AFTER_LAST,
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 542a477a94da..add79930f47d 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -988,6 +988,15 @@ struct cfg80211_pmksa {
988 * 988 *
989 * @dump_survey: get site survey information. 989 * @dump_survey: get site survey information.
990 * 990 *
991 * @remain_on_channel: Request the driver to remain awake on the specified
992 * channel for the specified duration to complete an off-channel
993 * operation (e.g., public action frame exchange). When the driver is
994 * ready on the requested channel, it must indicate this with an event
995 * notification by calling cfg80211_ready_on_channel().
996 * @cancel_remain_on_channel: Cancel an on-going remain-on-channel operation.
997 * This allows the operation to be terminated prior to timeout based on
998 * the duration value.
999 *
991 * @testmode_cmd: run a test mode command 1000 * @testmode_cmd: run a test mode command
992 * 1001 *
993 * @set_pmksa: Cache a PMKID for a BSSID. This is mostly useful for fullmac 1002 * @set_pmksa: Cache a PMKID for a BSSID. This is mostly useful for fullmac
@@ -1123,6 +1132,16 @@ struct cfg80211_ops {
1123 struct cfg80211_pmksa *pmksa); 1132 struct cfg80211_pmksa *pmksa);
1124 int (*flush_pmksa)(struct wiphy *wiphy, struct net_device *netdev); 1133 int (*flush_pmksa)(struct wiphy *wiphy, struct net_device *netdev);
1125 1134
1135 int (*remain_on_channel)(struct wiphy *wiphy,
1136 struct net_device *dev,
1137 struct ieee80211_channel *chan,
1138 enum nl80211_channel_type channel_type,
1139 unsigned int duration,
1140 u64 *cookie);
1141 int (*cancel_remain_on_channel)(struct wiphy *wiphy,
1142 struct net_device *dev,
1143 u64 cookie);
1144
1126 /* some temporary stuff to finish wext */ 1145 /* some temporary stuff to finish wext */
1127 int (*set_power_mgmt)(struct wiphy *wiphy, struct net_device *dev, 1146 int (*set_power_mgmt)(struct wiphy *wiphy, struct net_device *dev,
1128 bool enabled, int timeout); 1147 bool enabled, int timeout);
@@ -2147,5 +2166,45 @@ void cfg80211_roamed(struct net_device *dev, const u8 *bssid,
2147void cfg80211_disconnected(struct net_device *dev, u16 reason, 2166void cfg80211_disconnected(struct net_device *dev, u16 reason,
2148 u8 *ie, size_t ie_len, gfp_t gfp); 2167 u8 *ie, size_t ie_len, gfp_t gfp);
2149 2168
2169/**
2170 * cfg80211_ready_on_channel - notification of remain_on_channel start
2171 * @dev: network device
2172 * @cookie: the request cookie
2173 * @chan: The current channel (from remain_on_channel request)
2174 * @channel_type: Channel type
2175 * @duration: Duration in milliseconds that the driver intents to remain on the
2176 * channel
2177 * @gfp: allocation flags
2178 */
2179void cfg80211_ready_on_channel(struct net_device *dev, u64 cookie,
2180 struct ieee80211_channel *chan,
2181 enum nl80211_channel_type channel_type,
2182 unsigned int duration, gfp_t gfp);
2183
2184/**
2185 * cfg80211_remain_on_channel_expired - remain_on_channel duration expired
2186 * @dev: network device
2187 * @cookie: the request cookie
2188 * @chan: The current channel (from remain_on_channel request)
2189 * @channel_type: Channel type
2190 * @gfp: allocation flags
2191 */
2192void cfg80211_remain_on_channel_expired(struct net_device *dev,
2193 u64 cookie,
2194 struct ieee80211_channel *chan,
2195 enum nl80211_channel_type channel_type,
2196 gfp_t gfp);
2197
2198
2199/**
2200 * cfg80211_new_sta - notify userspace about station
2201 *
2202 * @dev: the netdev
2203 * @mac_addr: the station's address
2204 * @sinfo: the station information
2205 * @gfp: allocation flags
2206 */
2207void cfg80211_new_sta(struct net_device *dev, const u8 *mac_addr,
2208 struct station_info *sinfo, gfp_t gfp);
2150 2209
2151#endif /* __NET_CFG80211_H */ 2210#endif /* __NET_CFG80211_H */
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 494ac69ff477..f073a2a50574 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -547,7 +547,6 @@ enum mac80211_rx_flags {
547 * unspecified depending on the hardware capabilities flags 547 * unspecified depending on the hardware capabilities flags
548 * @IEEE80211_HW_SIGNAL_* 548 * @IEEE80211_HW_SIGNAL_*
549 * @noise: noise when receiving this frame, in dBm. 549 * @noise: noise when receiving this frame, in dBm.
550 * @qual: overall signal quality indication, in percent (0-100).
551 * @antenna: antenna used 550 * @antenna: antenna used
552 * @rate_idx: index of data rate into band's supported rates or MCS index if 551 * @rate_idx: index of data rate into band's supported rates or MCS index if
553 * HT rates are use (RX_FLAG_HT) 552 * HT rates are use (RX_FLAG_HT)
@@ -559,7 +558,6 @@ struct ieee80211_rx_status {
559 int freq; 558 int freq;
560 int signal; 559 int signal;
561 int noise; 560 int noise;
562 int __deprecated qual;
563 int antenna; 561 int antenna;
564 int rate_idx; 562 int rate_idx;
565 int flag; 563 int flag;
@@ -702,33 +700,6 @@ static inline bool ieee80211_vif_is_mesh(struct ieee80211_vif *vif)
702} 700}
703 701
704/** 702/**
705 * struct ieee80211_if_init_conf - initial configuration of an interface
706 *
707 * @vif: pointer to a driver-use per-interface structure. The pointer
708 * itself is also used for various functions including
709 * ieee80211_beacon_get() and ieee80211_get_buffered_bc().
710 * @type: one of &enum nl80211_iftype constants. Determines the type of
711 * added/removed interface.
712 * @mac_addr: pointer to MAC address of the interface. This pointer is valid
713 * until the interface is removed (i.e. it cannot be used after
714 * remove_interface() callback was called for this interface).
715 *
716 * This structure is used in add_interface() and remove_interface()
717 * callbacks of &struct ieee80211_hw.
718 *
719 * When you allow multiple interfaces to be added to your PHY, take care
720 * that the hardware can actually handle multiple MAC addresses. However,
721 * also take care that when there's no interface left with mac_addr != %NULL
722 * you remove the MAC address from the device to avoid acknowledging packets
723 * in pure monitor mode.
724 */
725struct ieee80211_if_init_conf {
726 enum nl80211_iftype type;
727 struct ieee80211_vif *vif;
728 void *mac_addr;
729};
730
731/**
732 * enum ieee80211_key_alg - key algorithm 703 * enum ieee80211_key_alg - key algorithm
733 * @ALG_WEP: WEP40 or WEP104 704 * @ALG_WEP: WEP40 or WEP104
734 * @ALG_TKIP: TKIP 705 * @ALG_TKIP: TKIP
@@ -1410,7 +1381,7 @@ enum ieee80211_ampdu_mlme_action {
1410 * When the device is started it should not have a MAC address 1381 * When the device is started it should not have a MAC address
1411 * to avoid acknowledging frames before a non-monitor device 1382 * to avoid acknowledging frames before a non-monitor device
1412 * is added. 1383 * is added.
1413 * Must be implemented. 1384 * Must be implemented and can sleep.
1414 * 1385 *
1415 * @stop: Called after last netdevice attached to the hardware 1386 * @stop: Called after last netdevice attached to the hardware
1416 * is disabled. This should turn off the hardware (at least 1387 * is disabled. This should turn off the hardware (at least
@@ -1418,7 +1389,7 @@ enum ieee80211_ampdu_mlme_action {
1418 * May be called right after add_interface if that rejects 1389 * May be called right after add_interface if that rejects
1419 * an interface. If you added any work onto the mac80211 workqueue 1390 * an interface. If you added any work onto the mac80211 workqueue
1420 * you should ensure to cancel it on this callback. 1391 * you should ensure to cancel it on this callback.
1421 * Must be implemented. 1392 * Must be implemented and can sleep.
1422 * 1393 *
1423 * @add_interface: Called when a netdevice attached to the hardware is 1394 * @add_interface: Called when a netdevice attached to the hardware is
1424 * enabled. Because it is not called for monitor mode devices, @start 1395 * enabled. Because it is not called for monitor mode devices, @start
@@ -1428,7 +1399,7 @@ enum ieee80211_ampdu_mlme_action {
1428 * interface is given in the conf parameter. 1399 * interface is given in the conf parameter.
1429 * The callback may refuse to add an interface by returning a 1400 * The callback may refuse to add an interface by returning a
1430 * negative error code (which will be seen in userspace.) 1401 * negative error code (which will be seen in userspace.)
1431 * Must be implemented. 1402 * Must be implemented and can sleep.
1432 * 1403 *
1433 * @remove_interface: Notifies a driver that an interface is going down. 1404 * @remove_interface: Notifies a driver that an interface is going down.
1434 * The @stop callback is called after this if it is the last interface 1405 * The @stop callback is called after this if it is the last interface
@@ -1437,19 +1408,20 @@ enum ieee80211_ampdu_mlme_action {
1437 * must be cleared so the device no longer acknowledges packets, 1408 * must be cleared so the device no longer acknowledges packets,
1438 * the mac_addr member of the conf structure is, however, set to the 1409 * the mac_addr member of the conf structure is, however, set to the
1439 * MAC address of the device going away. 1410 * MAC address of the device going away.
1440 * Hence, this callback must be implemented. 1411 * Hence, this callback must be implemented. It can sleep.
1441 * 1412 *
1442 * @config: Handler for configuration requests. IEEE 802.11 code calls this 1413 * @config: Handler for configuration requests. IEEE 802.11 code calls this
1443 * function to change hardware configuration, e.g., channel. 1414 * function to change hardware configuration, e.g., channel.
1444 * This function should never fail but returns a negative error code 1415 * This function should never fail but returns a negative error code
1445 * if it does. 1416 * if it does. The callback can sleep.
1446 * 1417 *
1447 * @bss_info_changed: Handler for configuration requests related to BSS 1418 * @bss_info_changed: Handler for configuration requests related to BSS
1448 * parameters that may vary during BSS's lifespan, and may affect low 1419 * parameters that may vary during BSS's lifespan, and may affect low
1449 * level driver (e.g. assoc/disassoc status, erp parameters). 1420 * level driver (e.g. assoc/disassoc status, erp parameters).
1450 * This function should not be used if no BSS has been set, unless 1421 * This function should not be used if no BSS has been set, unless
1451 * for association indication. The @changed parameter indicates which 1422 * for association indication. The @changed parameter indicates which
1452 * of the bss parameters has changed when a call is made. 1423 * of the bss parameters has changed when a call is made. The callback
1424 * can sleep.
1453 * 1425 *
1454 * @prepare_multicast: Prepare for multicast filter configuration. 1426 * @prepare_multicast: Prepare for multicast filter configuration.
1455 * This callback is optional, and its return value is passed 1427 * This callback is optional, and its return value is passed
@@ -1457,20 +1429,22 @@ enum ieee80211_ampdu_mlme_action {
1457 * 1429 *
1458 * @configure_filter: Configure the device's RX filter. 1430 * @configure_filter: Configure the device's RX filter.
1459 * See the section "Frame filtering" for more information. 1431 * See the section "Frame filtering" for more information.
1460 * This callback must be implemented. 1432 * This callback must be implemented and can sleep.
1461 * 1433 *
1462 * @set_tim: Set TIM bit. mac80211 calls this function when a TIM bit 1434 * @set_tim: Set TIM bit. mac80211 calls this function when a TIM bit
1463 * must be set or cleared for a given STA. Must be atomic. 1435 * must be set or cleared for a given STA. Must be atomic.
1464 * 1436 *
1465 * @set_key: See the section "Hardware crypto acceleration" 1437 * @set_key: See the section "Hardware crypto acceleration"
1466 * This callback can sleep, and is only called between add_interface 1438 * This callback is only called between add_interface and
1467 * and remove_interface calls, i.e. while the given virtual interface 1439 * remove_interface calls, i.e. while the given virtual interface
1468 * is enabled. 1440 * is enabled.
1469 * Returns a negative error code if the key can't be added. 1441 * Returns a negative error code if the key can't be added.
1442 * The callback can sleep.
1470 * 1443 *
1471 * @update_tkip_key: See the section "Hardware crypto acceleration" 1444 * @update_tkip_key: See the section "Hardware crypto acceleration"
1472 * This callback will be called in the context of Rx. Called for drivers 1445 * This callback will be called in the context of Rx. Called for drivers
1473 * which set IEEE80211_KEY_FLAG_TKIP_REQ_RX_P1_KEY. 1446 * which set IEEE80211_KEY_FLAG_TKIP_REQ_RX_P1_KEY.
1447 * The callback can sleep.
1474 * 1448 *
1475 * @hw_scan: Ask the hardware to service the scan request, no need to start 1449 * @hw_scan: Ask the hardware to service the scan request, no need to start
1476 * the scan state machine in stack. The scan must honour the channel 1450 * the scan state machine in stack. The scan must honour the channel
@@ -1484,21 +1458,28 @@ enum ieee80211_ampdu_mlme_action {
1484 * When the scan finishes, ieee80211_scan_completed() must be called; 1458 * When the scan finishes, ieee80211_scan_completed() must be called;
1485 * note that it also must be called when the scan cannot finish due to 1459 * note that it also must be called when the scan cannot finish due to
1486 * any error unless this callback returned a negative error code. 1460 * any error unless this callback returned a negative error code.
1461 * The callback can sleep.
1487 * 1462 *
1488 * @sw_scan_start: Notifier function that is called just before a software scan 1463 * @sw_scan_start: Notifier function that is called just before a software scan
1489 * is started. Can be NULL, if the driver doesn't need this notification. 1464 * is started. Can be NULL, if the driver doesn't need this notification.
1465 * The callback can sleep.
1490 * 1466 *
1491 * @sw_scan_complete: Notifier function that is called just after a software scan 1467 * @sw_scan_complete: Notifier function that is called just after a
1492 * finished. Can be NULL, if the driver doesn't need this notification. 1468 * software scan finished. Can be NULL, if the driver doesn't need
1469 * this notification.
1470 * The callback can sleep.
1493 * 1471 *
1494 * @get_stats: Return low-level statistics. 1472 * @get_stats: Return low-level statistics.
1495 * Returns zero if statistics are available. 1473 * Returns zero if statistics are available.
1474 * The callback can sleep.
1496 * 1475 *
1497 * @get_tkip_seq: If your device implements TKIP encryption in hardware this 1476 * @get_tkip_seq: If your device implements TKIP encryption in hardware this
1498 * callback should be provided to read the TKIP transmit IVs (both IV32 1477 * callback should be provided to read the TKIP transmit IVs (both IV32
1499 * and IV16) for the given key from hardware. 1478 * and IV16) for the given key from hardware.
1479 * The callback must be atomic.
1500 * 1480 *
1501 * @set_rts_threshold: Configuration of RTS threshold (if device needs it) 1481 * @set_rts_threshold: Configuration of RTS threshold (if device needs it)
1482 * The callback can sleep.
1502 * 1483 *
1503 * @sta_notify: Notifies low level driver about addition, removal or power 1484 * @sta_notify: Notifies low level driver about addition, removal or power
1504 * state transition of an associated station, AP, IBSS/WDS/mesh peer etc. 1485 * state transition of an associated station, AP, IBSS/WDS/mesh peer etc.
@@ -1507,30 +1488,36 @@ enum ieee80211_ampdu_mlme_action {
1507 * @conf_tx: Configure TX queue parameters (EDCF (aifs, cw_min, cw_max), 1488 * @conf_tx: Configure TX queue parameters (EDCF (aifs, cw_min, cw_max),
1508 * bursting) for a hardware TX queue. 1489 * bursting) for a hardware TX queue.
1509 * Returns a negative error code on failure. 1490 * Returns a negative error code on failure.
1491 * The callback can sleep.
1510 * 1492 *
1511 * @get_tx_stats: Get statistics of the current TX queue status. This is used 1493 * @get_tx_stats: Get statistics of the current TX queue status. This is used
1512 * to get number of currently queued packets (queue length), maximum queue 1494 * to get number of currently queued packets (queue length), maximum queue
1513 * size (limit), and total number of packets sent using each TX queue 1495 * size (limit), and total number of packets sent using each TX queue
1514 * (count). The 'stats' pointer points to an array that has hw->queues 1496 * (count). The 'stats' pointer points to an array that has hw->queues
1515 * items. 1497 * items.
1498 * The callback must be atomic.
1516 * 1499 *
1517 * @get_tsf: Get the current TSF timer value from firmware/hardware. Currently, 1500 * @get_tsf: Get the current TSF timer value from firmware/hardware. Currently,
1518 * this is only used for IBSS mode BSSID merging and debugging. Is not a 1501 * this is only used for IBSS mode BSSID merging and debugging. Is not a
1519 * required function. 1502 * required function.
1503 * The callback can sleep.
1520 * 1504 *
1521 * @set_tsf: Set the TSF timer to the specified value in the firmware/hardware. 1505 * @set_tsf: Set the TSF timer to the specified value in the firmware/hardware.
1522 * Currently, this is only used for IBSS mode debugging. Is not a 1506 * Currently, this is only used for IBSS mode debugging. Is not a
1523 * required function. 1507 * required function.
1508 * The callback can sleep.
1524 * 1509 *
1525 * @reset_tsf: Reset the TSF timer and allow firmware/hardware to synchronize 1510 * @reset_tsf: Reset the TSF timer and allow firmware/hardware to synchronize
1526 * with other STAs in the IBSS. This is only used in IBSS mode. This 1511 * with other STAs in the IBSS. This is only used in IBSS mode. This
1527 * function is optional if the firmware/hardware takes full care of 1512 * function is optional if the firmware/hardware takes full care of
1528 * TSF synchronization. 1513 * TSF synchronization.
1514 * The callback can sleep.
1529 * 1515 *
1530 * @tx_last_beacon: Determine whether the last IBSS beacon was sent by us. 1516 * @tx_last_beacon: Determine whether the last IBSS beacon was sent by us.
1531 * This is needed only for IBSS mode and the result of this function is 1517 * This is needed only for IBSS mode and the result of this function is
1532 * used to determine whether to reply to Probe Requests. 1518 * used to determine whether to reply to Probe Requests.
1533 * Returns non-zero if this device sent the last beacon. 1519 * Returns non-zero if this device sent the last beacon.
1520 * The callback can sleep.
1534 * 1521 *
1535 * @ampdu_action: Perform a certain A-MPDU action 1522 * @ampdu_action: Perform a certain A-MPDU action
1536 * The RA/TID combination determines the destination and TID we want 1523 * The RA/TID combination determines the destination and TID we want
@@ -1539,21 +1526,28 @@ enum ieee80211_ampdu_mlme_action {
1539 * is the first frame we expect to perform the action on. Notice 1526 * is the first frame we expect to perform the action on. Notice
1540 * that TX/RX_STOP can pass NULL for this parameter. 1527 * that TX/RX_STOP can pass NULL for this parameter.
1541 * Returns a negative error code on failure. 1528 * Returns a negative error code on failure.
1529 * The callback must be atomic.
1542 * 1530 *
1543 * @rfkill_poll: Poll rfkill hardware state. If you need this, you also 1531 * @rfkill_poll: Poll rfkill hardware state. If you need this, you also
1544 * need to set wiphy->rfkill_poll to %true before registration, 1532 * need to set wiphy->rfkill_poll to %true before registration,
1545 * and need to call wiphy_rfkill_set_hw_state() in the callback. 1533 * and need to call wiphy_rfkill_set_hw_state() in the callback.
1534 * The callback can sleep.
1546 * 1535 *
1547 * @testmode_cmd: Implement a cfg80211 test mode command. 1536 * @testmode_cmd: Implement a cfg80211 test mode command.
1537 * The callback can sleep.
1538 *
1539 * @flush: Flush all pending frames from the hardware queue, making sure
1540 * that the hardware queues are empty. If the parameter @drop is set
1541 * to %true, pending frames may be dropped. The callback can sleep.
1548 */ 1542 */
1549struct ieee80211_ops { 1543struct ieee80211_ops {
1550 int (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb); 1544 int (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb);
1551 int (*start)(struct ieee80211_hw *hw); 1545 int (*start)(struct ieee80211_hw *hw);
1552 void (*stop)(struct ieee80211_hw *hw); 1546 void (*stop)(struct ieee80211_hw *hw);
1553 int (*add_interface)(struct ieee80211_hw *hw, 1547 int (*add_interface)(struct ieee80211_hw *hw,
1554 struct ieee80211_if_init_conf *conf); 1548 struct ieee80211_vif *vif);
1555 void (*remove_interface)(struct ieee80211_hw *hw, 1549 void (*remove_interface)(struct ieee80211_hw *hw,
1556 struct ieee80211_if_init_conf *conf); 1550 struct ieee80211_vif *vif);
1557 int (*config)(struct ieee80211_hw *hw, u32 changed); 1551 int (*config)(struct ieee80211_hw *hw, u32 changed);
1558 void (*bss_info_changed)(struct ieee80211_hw *hw, 1552 void (*bss_info_changed)(struct ieee80211_hw *hw,
1559 struct ieee80211_vif *vif, 1553 struct ieee80211_vif *vif,
@@ -1601,6 +1595,7 @@ struct ieee80211_ops {
1601#ifdef CONFIG_NL80211_TESTMODE 1595#ifdef CONFIG_NL80211_TESTMODE
1602 int (*testmode_cmd)(struct ieee80211_hw *hw, void *data, int len); 1596 int (*testmode_cmd)(struct ieee80211_hw *hw, void *data, int len);
1603#endif 1597#endif
1598 void (*flush)(struct ieee80211_hw *hw, bool drop);
1604}; 1599};
1605 1600
1606/** 1601/**
@@ -1840,7 +1835,7 @@ void ieee80211_tx_status_irqsafe(struct ieee80211_hw *hw,
1840/** 1835/**
1841 * ieee80211_beacon_get_tim - beacon generation function 1836 * ieee80211_beacon_get_tim - beacon generation function
1842 * @hw: pointer obtained from ieee80211_alloc_hw(). 1837 * @hw: pointer obtained from ieee80211_alloc_hw().
1843 * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. 1838 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
1844 * @tim_offset: pointer to variable that will receive the TIM IE offset. 1839 * @tim_offset: pointer to variable that will receive the TIM IE offset.
1845 * Set to 0 if invalid (in non-AP modes). 1840 * Set to 0 if invalid (in non-AP modes).
1846 * @tim_length: pointer to variable that will receive the TIM IE length, 1841 * @tim_length: pointer to variable that will receive the TIM IE length,
@@ -1868,7 +1863,7 @@ struct sk_buff *ieee80211_beacon_get_tim(struct ieee80211_hw *hw,
1868/** 1863/**
1869 * ieee80211_beacon_get - beacon generation function 1864 * ieee80211_beacon_get - beacon generation function
1870 * @hw: pointer obtained from ieee80211_alloc_hw(). 1865 * @hw: pointer obtained from ieee80211_alloc_hw().
1871 * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. 1866 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
1872 * 1867 *
1873 * See ieee80211_beacon_get_tim(). 1868 * See ieee80211_beacon_get_tim().
1874 */ 1869 */
@@ -1881,7 +1876,7 @@ static inline struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw,
1881/** 1876/**
1882 * ieee80211_rts_get - RTS frame generation function 1877 * ieee80211_rts_get - RTS frame generation function
1883 * @hw: pointer obtained from ieee80211_alloc_hw(). 1878 * @hw: pointer obtained from ieee80211_alloc_hw().
1884 * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. 1879 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
1885 * @frame: pointer to the frame that is going to be protected by the RTS. 1880 * @frame: pointer to the frame that is going to be protected by the RTS.
1886 * @frame_len: the frame length (in octets). 1881 * @frame_len: the frame length (in octets).
1887 * @frame_txctl: &struct ieee80211_tx_info of the frame. 1882 * @frame_txctl: &struct ieee80211_tx_info of the frame.
@@ -1900,7 +1895,7 @@ void ieee80211_rts_get(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
1900/** 1895/**
1901 * ieee80211_rts_duration - Get the duration field for an RTS frame 1896 * ieee80211_rts_duration - Get the duration field for an RTS frame
1902 * @hw: pointer obtained from ieee80211_alloc_hw(). 1897 * @hw: pointer obtained from ieee80211_alloc_hw().
1903 * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. 1898 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
1904 * @frame_len: the length of the frame that is going to be protected by the RTS. 1899 * @frame_len: the length of the frame that is going to be protected by the RTS.
1905 * @frame_txctl: &struct ieee80211_tx_info of the frame. 1900 * @frame_txctl: &struct ieee80211_tx_info of the frame.
1906 * 1901 *
@@ -1915,7 +1910,7 @@ __le16 ieee80211_rts_duration(struct ieee80211_hw *hw,
1915/** 1910/**
1916 * ieee80211_ctstoself_get - CTS-to-self frame generation function 1911 * ieee80211_ctstoself_get - CTS-to-self frame generation function
1917 * @hw: pointer obtained from ieee80211_alloc_hw(). 1912 * @hw: pointer obtained from ieee80211_alloc_hw().
1918 * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. 1913 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
1919 * @frame: pointer to the frame that is going to be protected by the CTS-to-self. 1914 * @frame: pointer to the frame that is going to be protected by the CTS-to-self.
1920 * @frame_len: the frame length (in octets). 1915 * @frame_len: the frame length (in octets).
1921 * @frame_txctl: &struct ieee80211_tx_info of the frame. 1916 * @frame_txctl: &struct ieee80211_tx_info of the frame.
@@ -1935,7 +1930,7 @@ void ieee80211_ctstoself_get(struct ieee80211_hw *hw,
1935/** 1930/**
1936 * ieee80211_ctstoself_duration - Get the duration field for a CTS-to-self frame 1931 * ieee80211_ctstoself_duration - Get the duration field for a CTS-to-self frame
1937 * @hw: pointer obtained from ieee80211_alloc_hw(). 1932 * @hw: pointer obtained from ieee80211_alloc_hw().
1938 * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. 1933 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
1939 * @frame_len: the length of the frame that is going to be protected by the CTS-to-self. 1934 * @frame_len: the length of the frame that is going to be protected by the CTS-to-self.
1940 * @frame_txctl: &struct ieee80211_tx_info of the frame. 1935 * @frame_txctl: &struct ieee80211_tx_info of the frame.
1941 * 1936 *
@@ -1951,7 +1946,7 @@ __le16 ieee80211_ctstoself_duration(struct ieee80211_hw *hw,
1951/** 1946/**
1952 * ieee80211_generic_frame_duration - Calculate the duration field for a frame 1947 * ieee80211_generic_frame_duration - Calculate the duration field for a frame
1953 * @hw: pointer obtained from ieee80211_alloc_hw(). 1948 * @hw: pointer obtained from ieee80211_alloc_hw().
1954 * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. 1949 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
1955 * @frame_len: the length of the frame. 1950 * @frame_len: the length of the frame.
1956 * @rate: the rate at which the frame is going to be transmitted. 1951 * @rate: the rate at which the frame is going to be transmitted.
1957 * 1952 *
@@ -1966,7 +1961,7 @@ __le16 ieee80211_generic_frame_duration(struct ieee80211_hw *hw,
1966/** 1961/**
1967 * ieee80211_get_buffered_bc - accessing buffered broadcast and multicast frames 1962 * ieee80211_get_buffered_bc - accessing buffered broadcast and multicast frames
1968 * @hw: pointer as obtained from ieee80211_alloc_hw(). 1963 * @hw: pointer as obtained from ieee80211_alloc_hw().
1969 * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. 1964 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
1970 * 1965 *
1971 * Function for accessing buffered broadcast and multicast frames. If 1966 * Function for accessing buffered broadcast and multicast frames. If
1972 * hardware/firmware does not implement buffering of broadcast/multicast 1967 * hardware/firmware does not implement buffering of broadcast/multicast
@@ -2134,7 +2129,7 @@ int ieee80211_start_tx_ba_session(struct ieee80211_sta *sta, u16 tid);
2134 2129
2135/** 2130/**
2136 * ieee80211_start_tx_ba_cb - low level driver ready to aggregate. 2131 * ieee80211_start_tx_ba_cb - low level driver ready to aggregate.
2137 * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf 2132 * @vif: &struct ieee80211_vif pointer from the add_interface callback
2138 * @ra: receiver address of the BA session recipient. 2133 * @ra: receiver address of the BA session recipient.
2139 * @tid: the TID to BA on. 2134 * @tid: the TID to BA on.
2140 * 2135 *
@@ -2145,7 +2140,7 @@ void ieee80211_start_tx_ba_cb(struct ieee80211_vif *vif, u8 *ra, u16 tid);
2145 2140
2146/** 2141/**
2147 * ieee80211_start_tx_ba_cb_irqsafe - low level driver ready to aggregate. 2142 * ieee80211_start_tx_ba_cb_irqsafe - low level driver ready to aggregate.
2148 * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf 2143 * @vif: &struct ieee80211_vif pointer from the add_interface callback
2149 * @ra: receiver address of the BA session recipient. 2144 * @ra: receiver address of the BA session recipient.
2150 * @tid: the TID to BA on. 2145 * @tid: the TID to BA on.
2151 * 2146 *
@@ -2173,7 +2168,7 @@ int ieee80211_stop_tx_ba_session(struct ieee80211_sta *sta, u16 tid,
2173 2168
2174/** 2169/**
2175 * ieee80211_stop_tx_ba_cb - low level driver ready to stop aggregate. 2170 * ieee80211_stop_tx_ba_cb - low level driver ready to stop aggregate.
2176 * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf 2171 * @vif: &struct ieee80211_vif pointer from the add_interface callback
2177 * @ra: receiver address of the BA session recipient. 2172 * @ra: receiver address of the BA session recipient.
2178 * @tid: the desired TID to BA on. 2173 * @tid: the desired TID to BA on.
2179 * 2174 *
@@ -2184,7 +2179,7 @@ void ieee80211_stop_tx_ba_cb(struct ieee80211_vif *vif, u8 *ra, u8 tid);
2184 2179
2185/** 2180/**
2186 * ieee80211_stop_tx_ba_cb_irqsafe - low level driver ready to stop aggregate. 2181 * ieee80211_stop_tx_ba_cb_irqsafe - low level driver ready to stop aggregate.
2187 * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf 2182 * @vif: &struct ieee80211_vif pointer from the add_interface callback
2188 * @ra: receiver address of the BA session recipient. 2183 * @ra: receiver address of the BA session recipient.
2189 * @tid: the desired TID to BA on. 2184 * @tid: the desired TID to BA on.
2190 * 2185 *
@@ -2263,7 +2258,7 @@ void ieee80211_sta_block_awake(struct ieee80211_hw *hw,
2263/** 2258/**
2264 * ieee80211_beacon_loss - inform hardware does not receive beacons 2259 * ieee80211_beacon_loss - inform hardware does not receive beacons
2265 * 2260 *
2266 * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. 2261 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
2267 * 2262 *
2268 * When beacon filtering is enabled with IEEE80211_HW_BEACON_FILTERING and 2263 * When beacon filtering is enabled with IEEE80211_HW_BEACON_FILTERING and
2269 * IEEE80211_CONF_PS is set, the driver needs to inform whenever the 2264 * IEEE80211_CONF_PS is set, the driver needs to inform whenever the