diff options
Diffstat (limited to 'include/net/mac80211.h')
-rw-r--r-- | include/net/mac80211.h | 195 |
1 files changed, 154 insertions, 41 deletions
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index b0787a1dea90..9fdf982d1286 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
@@ -149,6 +149,7 @@ struct ieee80211_low_level_stats { | |||
149 | * @BSS_CHANGED_ARP_FILTER: Hardware ARP filter address list or state changed. | 149 | * @BSS_CHANGED_ARP_FILTER: Hardware ARP filter address list or state changed. |
150 | * @BSS_CHANGED_QOS: QoS for this association was enabled/disabled. Note | 150 | * @BSS_CHANGED_QOS: QoS for this association was enabled/disabled. Note |
151 | * that it is only ever disabled for station mode. | 151 | * that it is only ever disabled for station mode. |
152 | * @BSS_CHANGED_IDLE: Idle changed for this BSS/interface. | ||
152 | */ | 153 | */ |
153 | enum ieee80211_bss_change { | 154 | enum ieee80211_bss_change { |
154 | BSS_CHANGED_ASSOC = 1<<0, | 155 | BSS_CHANGED_ASSOC = 1<<0, |
@@ -165,6 +166,7 @@ enum ieee80211_bss_change { | |||
165 | BSS_CHANGED_IBSS = 1<<11, | 166 | BSS_CHANGED_IBSS = 1<<11, |
166 | BSS_CHANGED_ARP_FILTER = 1<<12, | 167 | BSS_CHANGED_ARP_FILTER = 1<<12, |
167 | BSS_CHANGED_QOS = 1<<13, | 168 | BSS_CHANGED_QOS = 1<<13, |
169 | BSS_CHANGED_IDLE = 1<<14, | ||
168 | 170 | ||
169 | /* when adding here, make sure to change ieee80211_reconfig */ | 171 | /* when adding here, make sure to change ieee80211_reconfig */ |
170 | }; | 172 | }; |
@@ -223,6 +225,9 @@ enum ieee80211_bss_change { | |||
223 | * hardware must not perform any ARP filtering. Note, that the filter will | 225 | * hardware must not perform any ARP filtering. Note, that the filter will |
224 | * be enabled also in promiscuous mode. | 226 | * be enabled also in promiscuous mode. |
225 | * @qos: This is a QoS-enabled BSS. | 227 | * @qos: This is a QoS-enabled BSS. |
228 | * @idle: This interface is idle. There's also a global idle flag in the | ||
229 | * hardware config which may be more appropriate depending on what | ||
230 | * your driver/device needs to do. | ||
226 | */ | 231 | */ |
227 | struct ieee80211_bss_conf { | 232 | struct ieee80211_bss_conf { |
228 | const u8 *bssid; | 233 | const u8 *bssid; |
@@ -247,6 +252,7 @@ struct ieee80211_bss_conf { | |||
247 | u8 arp_addr_cnt; | 252 | u8 arp_addr_cnt; |
248 | bool arp_filter_enabled; | 253 | bool arp_filter_enabled; |
249 | bool qos; | 254 | bool qos; |
255 | bool idle; | ||
250 | }; | 256 | }; |
251 | 257 | ||
252 | /** | 258 | /** |
@@ -315,6 +321,9 @@ struct ieee80211_bss_conf { | |||
315 | * @IEEE80211_TX_CTL_LDPC: tells the driver to use LDPC for this frame | 321 | * @IEEE80211_TX_CTL_LDPC: tells the driver to use LDPC for this frame |
316 | * @IEEE80211_TX_CTL_STBC: Enables Space-Time Block Coding (STBC) for this | 322 | * @IEEE80211_TX_CTL_STBC: Enables Space-Time Block Coding (STBC) for this |
317 | * frame and selects the maximum number of streams that it can use. | 323 | * frame and selects the maximum number of streams that it can use. |
324 | * | ||
325 | * Note: If you have to add new flags to the enumeration, then don't | ||
326 | * forget to update %IEEE80211_TX_TEMPORARY_FLAGS when necessary. | ||
318 | */ | 327 | */ |
319 | enum mac80211_tx_control_flags { | 328 | enum mac80211_tx_control_flags { |
320 | IEEE80211_TX_CTL_REQ_TX_STATUS = BIT(0), | 329 | IEEE80211_TX_CTL_REQ_TX_STATUS = BIT(0), |
@@ -344,6 +353,19 @@ enum mac80211_tx_control_flags { | |||
344 | 353 | ||
345 | #define IEEE80211_TX_CTL_STBC_SHIFT 23 | 354 | #define IEEE80211_TX_CTL_STBC_SHIFT 23 |
346 | 355 | ||
356 | /* | ||
357 | * This definition is used as a mask to clear all temporary flags, which are | ||
358 | * set by the tx handlers for each transmission attempt by the mac80211 stack. | ||
359 | */ | ||
360 | #define IEEE80211_TX_TEMPORARY_FLAGS (IEEE80211_TX_CTL_NO_ACK | \ | ||
361 | IEEE80211_TX_CTL_CLEAR_PS_FILT | IEEE80211_TX_CTL_FIRST_FRAGMENT | \ | ||
362 | IEEE80211_TX_CTL_SEND_AFTER_DTIM | IEEE80211_TX_CTL_AMPDU | \ | ||
363 | IEEE80211_TX_STAT_TX_FILTERED | IEEE80211_TX_STAT_ACK | \ | ||
364 | IEEE80211_TX_STAT_AMPDU | IEEE80211_TX_STAT_AMPDU_NO_BACK | \ | ||
365 | IEEE80211_TX_CTL_RATE_CTRL_PROBE | IEEE80211_TX_CTL_PSPOLL_RESPONSE | \ | ||
366 | IEEE80211_TX_CTL_MORE_FRAMES | IEEE80211_TX_CTL_LDPC | \ | ||
367 | IEEE80211_TX_CTL_STBC) | ||
368 | |||
347 | /** | 369 | /** |
348 | * enum mac80211_rate_control_flags - per-rate flags set by the | 370 | * enum mac80211_rate_control_flags - per-rate flags set by the |
349 | * Rate Control algorithm. | 371 | * Rate Control algorithm. |
@@ -559,9 +581,6 @@ ieee80211_tx_info_clear_status(struct ieee80211_tx_info *info) | |||
559 | * @RX_FLAG_HT: HT MCS was used and rate_idx is MCS index | 581 | * @RX_FLAG_HT: HT MCS was used and rate_idx is MCS index |
560 | * @RX_FLAG_40MHZ: HT40 (40 MHz) was used | 582 | * @RX_FLAG_40MHZ: HT40 (40 MHz) was used |
561 | * @RX_FLAG_SHORT_GI: Short guard interval was used | 583 | * @RX_FLAG_SHORT_GI: Short guard interval was used |
562 | * @RX_FLAG_INTERNAL_CMTR: set internally after frame was reported | ||
563 | * on cooked monitor to avoid double-reporting it for multiple | ||
564 | * virtual interfaces | ||
565 | */ | 584 | */ |
566 | enum mac80211_rx_flags { | 585 | enum mac80211_rx_flags { |
567 | RX_FLAG_MMIC_ERROR = 1<<0, | 586 | RX_FLAG_MMIC_ERROR = 1<<0, |
@@ -575,7 +594,6 @@ enum mac80211_rx_flags { | |||
575 | RX_FLAG_HT = 1<<9, | 594 | RX_FLAG_HT = 1<<9, |
576 | RX_FLAG_40MHZ = 1<<10, | 595 | RX_FLAG_40MHZ = 1<<10, |
577 | RX_FLAG_SHORT_GI = 1<<11, | 596 | RX_FLAG_SHORT_GI = 1<<11, |
578 | RX_FLAG_INTERNAL_CMTR = 1<<12, | ||
579 | }; | 597 | }; |
580 | 598 | ||
581 | /** | 599 | /** |
@@ -596,6 +614,7 @@ enum mac80211_rx_flags { | |||
596 | * @rate_idx: index of data rate into band's supported rates or MCS index if | 614 | * @rate_idx: index of data rate into band's supported rates or MCS index if |
597 | * HT rates are use (RX_FLAG_HT) | 615 | * HT rates are use (RX_FLAG_HT) |
598 | * @flag: %RX_FLAG_* | 616 | * @flag: %RX_FLAG_* |
617 | * @rx_flags: internal RX flags for mac80211 | ||
599 | */ | 618 | */ |
600 | struct ieee80211_rx_status { | 619 | struct ieee80211_rx_status { |
601 | u64 mactime; | 620 | u64 mactime; |
@@ -605,6 +624,7 @@ struct ieee80211_rx_status { | |||
605 | int antenna; | 624 | int antenna; |
606 | int rate_idx; | 625 | int rate_idx; |
607 | int flag; | 626 | int flag; |
627 | unsigned int rx_flags; | ||
608 | }; | 628 | }; |
609 | 629 | ||
610 | /** | 630 | /** |
@@ -763,6 +783,8 @@ struct ieee80211_channel_switch { | |||
763 | * @bss_conf: BSS configuration for this interface, either our own | 783 | * @bss_conf: BSS configuration for this interface, either our own |
764 | * or the BSS we're associated to | 784 | * or the BSS we're associated to |
765 | * @addr: address of this interface | 785 | * @addr: address of this interface |
786 | * @p2p: indicates whether this AP or STA interface is a p2p | ||
787 | * interface, i.e. a GO or p2p-sta respectively | ||
766 | * @drv_priv: data area for driver use, will always be aligned to | 788 | * @drv_priv: data area for driver use, will always be aligned to |
767 | * sizeof(void *). | 789 | * sizeof(void *). |
768 | */ | 790 | */ |
@@ -770,6 +792,7 @@ struct ieee80211_vif { | |||
770 | enum nl80211_iftype type; | 792 | enum nl80211_iftype type; |
771 | struct ieee80211_bss_conf bss_conf; | 793 | struct ieee80211_bss_conf bss_conf; |
772 | u8 addr[ETH_ALEN]; | 794 | u8 addr[ETH_ALEN]; |
795 | bool p2p; | ||
773 | /* must be last */ | 796 | /* must be last */ |
774 | u8 drv_priv[0] __attribute__((__aligned__(sizeof(void *)))); | 797 | u8 drv_priv[0] __attribute__((__aligned__(sizeof(void *)))); |
775 | }; | 798 | }; |
@@ -783,20 +806,6 @@ static inline bool ieee80211_vif_is_mesh(struct ieee80211_vif *vif) | |||
783 | } | 806 | } |
784 | 807 | ||
785 | /** | 808 | /** |
786 | * enum ieee80211_key_alg - key algorithm | ||
787 | * @ALG_WEP: WEP40 or WEP104 | ||
788 | * @ALG_TKIP: TKIP | ||
789 | * @ALG_CCMP: CCMP (AES) | ||
790 | * @ALG_AES_CMAC: AES-128-CMAC | ||
791 | */ | ||
792 | enum ieee80211_key_alg { | ||
793 | ALG_WEP, | ||
794 | ALG_TKIP, | ||
795 | ALG_CCMP, | ||
796 | ALG_AES_CMAC, | ||
797 | }; | ||
798 | |||
799 | /** | ||
800 | * enum ieee80211_key_flags - key flags | 809 | * enum ieee80211_key_flags - key flags |
801 | * | 810 | * |
802 | * These flags are used for communication about keys between the driver | 811 | * These flags are used for communication about keys between the driver |
@@ -833,7 +842,7 @@ enum ieee80211_key_flags { | |||
833 | * @hw_key_idx: To be set by the driver, this is the key index the driver | 842 | * @hw_key_idx: To be set by the driver, this is the key index the driver |
834 | * wants to be given when a frame is transmitted and needs to be | 843 | * wants to be given when a frame is transmitted and needs to be |
835 | * encrypted in hardware. | 844 | * encrypted in hardware. |
836 | * @alg: The key algorithm. | 845 | * @cipher: The key's cipher suite selector. |
837 | * @flags: key flags, see &enum ieee80211_key_flags. | 846 | * @flags: key flags, see &enum ieee80211_key_flags. |
838 | * @keyidx: the key index (0-3) | 847 | * @keyidx: the key index (0-3) |
839 | * @keylen: key material length | 848 | * @keylen: key material length |
@@ -846,7 +855,7 @@ enum ieee80211_key_flags { | |||
846 | * @iv_len: The IV length for this key type | 855 | * @iv_len: The IV length for this key type |
847 | */ | 856 | */ |
848 | struct ieee80211_key_conf { | 857 | struct ieee80211_key_conf { |
849 | enum ieee80211_key_alg alg; | 858 | u32 cipher; |
850 | u8 icv_len; | 859 | u8 icv_len; |
851 | u8 iv_len; | 860 | u8 iv_len; |
852 | u8 hw_key_idx; | 861 | u8 hw_key_idx; |
@@ -1032,6 +1041,13 @@ enum ieee80211_tkip_key_type { | |||
1032 | * @IEEE80211_HW_NEED_DTIM_PERIOD: | 1041 | * @IEEE80211_HW_NEED_DTIM_PERIOD: |
1033 | * This device needs to know the DTIM period for the BSS before | 1042 | * This device needs to know the DTIM period for the BSS before |
1034 | * associating. | 1043 | * associating. |
1044 | * | ||
1045 | * @IEEE80211_HW_SUPPORTS_PER_STA_GTK: The device's crypto engine supports | ||
1046 | * per-station GTKs as used by IBSS RSN or during fast transition. If | ||
1047 | * the device doesn't support per-station GTKs, but can be asked not | ||
1048 | * to decrypt group addressed frames, then IBSS RSN support is still | ||
1049 | * possible but software crypto will be used. Advertise the wiphy flag | ||
1050 | * only in that case. | ||
1035 | */ | 1051 | */ |
1036 | enum ieee80211_hw_flags { | 1052 | enum ieee80211_hw_flags { |
1037 | IEEE80211_HW_HAS_RATE_CONTROL = 1<<0, | 1053 | IEEE80211_HW_HAS_RATE_CONTROL = 1<<0, |
@@ -1055,6 +1071,7 @@ enum ieee80211_hw_flags { | |||
1055 | IEEE80211_HW_REPORTS_TX_ACK_STATUS = 1<<18, | 1071 | IEEE80211_HW_REPORTS_TX_ACK_STATUS = 1<<18, |
1056 | IEEE80211_HW_CONNECTION_MONITOR = 1<<19, | 1072 | IEEE80211_HW_CONNECTION_MONITOR = 1<<19, |
1057 | IEEE80211_HW_SUPPORTS_CQM_RSSI = 1<<20, | 1073 | IEEE80211_HW_SUPPORTS_CQM_RSSI = 1<<20, |
1074 | IEEE80211_HW_SUPPORTS_PER_STA_GTK = 1<<21, | ||
1058 | }; | 1075 | }; |
1059 | 1076 | ||
1060 | /** | 1077 | /** |
@@ -1100,8 +1117,15 @@ enum ieee80211_hw_flags { | |||
1100 | * @sta_data_size: size (in bytes) of the drv_priv data area | 1117 | * @sta_data_size: size (in bytes) of the drv_priv data area |
1101 | * within &struct ieee80211_sta. | 1118 | * within &struct ieee80211_sta. |
1102 | * | 1119 | * |
1103 | * @max_rates: maximum number of alternate rate retry stages | 1120 | * @max_rates: maximum number of alternate rate retry stages the hw |
1121 | * can handle. | ||
1122 | * @max_report_rates: maximum number of alternate rate retry stages | ||
1123 | * the hw can report back. | ||
1104 | * @max_rate_tries: maximum number of tries for each stage | 1124 | * @max_rate_tries: maximum number of tries for each stage |
1125 | * | ||
1126 | * @napi_weight: weight used for NAPI polling. You must specify an | ||
1127 | * appropriate value here if a napi_poll operation is provided | ||
1128 | * by your driver. | ||
1105 | */ | 1129 | */ |
1106 | struct ieee80211_hw { | 1130 | struct ieee80211_hw { |
1107 | struct ieee80211_conf conf; | 1131 | struct ieee80211_conf conf; |
@@ -1113,10 +1137,12 @@ struct ieee80211_hw { | |||
1113 | int channel_change_time; | 1137 | int channel_change_time; |
1114 | int vif_data_size; | 1138 | int vif_data_size; |
1115 | int sta_data_size; | 1139 | int sta_data_size; |
1140 | int napi_weight; | ||
1116 | u16 queues; | 1141 | u16 queues; |
1117 | u16 max_listen_interval; | 1142 | u16 max_listen_interval; |
1118 | s8 max_signal; | 1143 | s8 max_signal; |
1119 | u8 max_rates; | 1144 | u8 max_rates; |
1145 | u8 max_report_rates; | ||
1120 | u8 max_rate_tries; | 1146 | u8 max_rate_tries; |
1121 | }; | 1147 | }; |
1122 | 1148 | ||
@@ -1245,8 +1271,8 @@ ieee80211_get_alt_retry_rate(const struct ieee80211_hw *hw, | |||
1245 | * %IEEE80211_CONF_PS flag enabled means that the powersave mode defined in | 1271 | * %IEEE80211_CONF_PS flag enabled means that the powersave mode defined in |
1246 | * IEEE 802.11-2007 section 11.2 is enabled. This is not to be confused | 1272 | * IEEE 802.11-2007 section 11.2 is enabled. This is not to be confused |
1247 | * with hardware wakeup and sleep states. Driver is responsible for waking | 1273 | * with hardware wakeup and sleep states. Driver is responsible for waking |
1248 | * up the hardware before issueing commands to the hardware and putting it | 1274 | * up the hardware before issuing commands to the hardware and putting it |
1249 | * back to sleep at approriate times. | 1275 | * back to sleep at appropriate times. |
1250 | * | 1276 | * |
1251 | * When PS is enabled, hardware needs to wakeup for beacons and receive the | 1277 | * When PS is enabled, hardware needs to wakeup for beacons and receive the |
1252 | * buffered multicast/broadcast frames after the beacon. Also it must be | 1278 | * buffered multicast/broadcast frames after the beacon. Also it must be |
@@ -1267,7 +1293,7 @@ ieee80211_get_alt_retry_rate(const struct ieee80211_hw *hw, | |||
1267 | * there's data traffic and still saving significantly power in idle | 1293 | * there's data traffic and still saving significantly power in idle |
1268 | * periods. | 1294 | * periods. |
1269 | * | 1295 | * |
1270 | * Dynamic powersave is supported by simply mac80211 enabling and disabling | 1296 | * Dynamic powersave is simply supported by mac80211 enabling and disabling |
1271 | * PS based on traffic. Driver needs to only set %IEEE80211_HW_SUPPORTS_PS | 1297 | * PS based on traffic. Driver needs to only set %IEEE80211_HW_SUPPORTS_PS |
1272 | * flag and mac80211 will handle everything automatically. Additionally, | 1298 | * flag and mac80211 will handle everything automatically. Additionally, |
1273 | * hardware having support for the dynamic PS feature may set the | 1299 | * hardware having support for the dynamic PS feature may set the |
@@ -1452,12 +1478,14 @@ ieee80211_get_alt_retry_rate(const struct ieee80211_hw *hw, | |||
1452 | * honour this flag if possible. | 1478 | * honour this flag if possible. |
1453 | * | 1479 | * |
1454 | * @FIF_CONTROL: pass control frames (except for PS Poll), if PROMISC_IN_BSS | 1480 | * @FIF_CONTROL: pass control frames (except for PS Poll), if PROMISC_IN_BSS |
1455 | * is not set then only those addressed to this station. | 1481 | * is not set then only those addressed to this station. |
1456 | * | 1482 | * |
1457 | * @FIF_OTHER_BSS: pass frames destined to other BSSes | 1483 | * @FIF_OTHER_BSS: pass frames destined to other BSSes |
1458 | * | 1484 | * |
1459 | * @FIF_PSPOLL: pass PS Poll frames, if PROMISC_IN_BSS is not set then only | 1485 | * @FIF_PSPOLL: pass PS Poll frames, if PROMISC_IN_BSS is not set then only |
1460 | * those addressed to this station. | 1486 | * those addressed to this station. |
1487 | * | ||
1488 | * @FIF_PROBE_REQ: pass probe request frames | ||
1461 | */ | 1489 | */ |
1462 | enum ieee80211_filter_flags { | 1490 | enum ieee80211_filter_flags { |
1463 | FIF_PROMISC_IN_BSS = 1<<0, | 1491 | FIF_PROMISC_IN_BSS = 1<<0, |
@@ -1468,6 +1496,7 @@ enum ieee80211_filter_flags { | |||
1468 | FIF_CONTROL = 1<<5, | 1496 | FIF_CONTROL = 1<<5, |
1469 | FIF_OTHER_BSS = 1<<6, | 1497 | FIF_OTHER_BSS = 1<<6, |
1470 | FIF_PSPOLL = 1<<7, | 1498 | FIF_PSPOLL = 1<<7, |
1499 | FIF_PROBE_REQ = 1<<8, | ||
1471 | }; | 1500 | }; |
1472 | 1501 | ||
1473 | /** | 1502 | /** |
@@ -1540,6 +1569,12 @@ enum ieee80211_ampdu_mlme_action { | |||
1540 | * negative error code (which will be seen in userspace.) | 1569 | * negative error code (which will be seen in userspace.) |
1541 | * Must be implemented and can sleep. | 1570 | * Must be implemented and can sleep. |
1542 | * | 1571 | * |
1572 | * @change_interface: Called when a netdevice changes type. This callback | ||
1573 | * is optional, but only if it is supported can interface types be | ||
1574 | * switched while the interface is UP. The callback may sleep. | ||
1575 | * Note that while an interface is being switched, it will not be | ||
1576 | * found by the interface iteration callbacks. | ||
1577 | * | ||
1543 | * @remove_interface: Notifies a driver that an interface is going down. | 1578 | * @remove_interface: Notifies a driver that an interface is going down. |
1544 | * The @stop callback is called after this if it is the last interface | 1579 | * The @stop callback is called after this if it is the last interface |
1545 | * and no monitor interfaces are present. | 1580 | * and no monitor interfaces are present. |
@@ -1687,6 +1722,8 @@ enum ieee80211_ampdu_mlme_action { | |||
1687 | * switch operation for CSAs received from the AP may implement this | 1722 | * switch operation for CSAs received from the AP may implement this |
1688 | * callback. They must then call ieee80211_chswitch_done() to indicate | 1723 | * callback. They must then call ieee80211_chswitch_done() to indicate |
1689 | * completion of the channel switch. | 1724 | * completion of the channel switch. |
1725 | * | ||
1726 | * @napi_poll: Poll Rx queue for incoming data frames. | ||
1690 | */ | 1727 | */ |
1691 | struct ieee80211_ops { | 1728 | struct ieee80211_ops { |
1692 | int (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb); | 1729 | int (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb); |
@@ -1694,6 +1731,9 @@ struct ieee80211_ops { | |||
1694 | void (*stop)(struct ieee80211_hw *hw); | 1731 | void (*stop)(struct ieee80211_hw *hw); |
1695 | int (*add_interface)(struct ieee80211_hw *hw, | 1732 | int (*add_interface)(struct ieee80211_hw *hw, |
1696 | struct ieee80211_vif *vif); | 1733 | struct ieee80211_vif *vif); |
1734 | int (*change_interface)(struct ieee80211_hw *hw, | ||
1735 | struct ieee80211_vif *vif, | ||
1736 | enum nl80211_iftype new_type, bool p2p); | ||
1697 | void (*remove_interface)(struct ieee80211_hw *hw, | 1737 | void (*remove_interface)(struct ieee80211_hw *hw, |
1698 | struct ieee80211_vif *vif); | 1738 | struct ieee80211_vif *vif); |
1699 | int (*config)(struct ieee80211_hw *hw, u32 changed); | 1739 | int (*config)(struct ieee80211_hw *hw, u32 changed); |
@@ -1752,6 +1792,7 @@ struct ieee80211_ops { | |||
1752 | void (*flush)(struct ieee80211_hw *hw, bool drop); | 1792 | void (*flush)(struct ieee80211_hw *hw, bool drop); |
1753 | void (*channel_switch)(struct ieee80211_hw *hw, | 1793 | void (*channel_switch)(struct ieee80211_hw *hw, |
1754 | struct ieee80211_channel_switch *ch_switch); | 1794 | struct ieee80211_channel_switch *ch_switch); |
1795 | int (*napi_poll)(struct ieee80211_hw *hw, int budget); | ||
1755 | }; | 1796 | }; |
1756 | 1797 | ||
1757 | /** | 1798 | /** |
@@ -1897,6 +1938,22 @@ void ieee80211_free_hw(struct ieee80211_hw *hw); | |||
1897 | */ | 1938 | */ |
1898 | void ieee80211_restart_hw(struct ieee80211_hw *hw); | 1939 | void ieee80211_restart_hw(struct ieee80211_hw *hw); |
1899 | 1940 | ||
1941 | /** ieee80211_napi_schedule - schedule NAPI poll | ||
1942 | * | ||
1943 | * Use this function to schedule NAPI polling on a device. | ||
1944 | * | ||
1945 | * @hw: the hardware to start polling | ||
1946 | */ | ||
1947 | void ieee80211_napi_schedule(struct ieee80211_hw *hw); | ||
1948 | |||
1949 | /** ieee80211_napi_complete - complete NAPI polling | ||
1950 | * | ||
1951 | * Use this function to finish NAPI polling on a device. | ||
1952 | * | ||
1953 | * @hw: the hardware to stop polling | ||
1954 | */ | ||
1955 | void ieee80211_napi_complete(struct ieee80211_hw *hw); | ||
1956 | |||
1900 | /** | 1957 | /** |
1901 | * ieee80211_rx - receive frame | 1958 | * ieee80211_rx - receive frame |
1902 | * | 1959 | * |
@@ -2252,7 +2309,8 @@ void ieee80211_wake_queues(struct ieee80211_hw *hw); | |||
2252 | * | 2309 | * |
2253 | * When hardware scan offload is used (i.e. the hw_scan() callback is | 2310 | * When hardware scan offload is used (i.e. the hw_scan() callback is |
2254 | * assigned) this function needs to be called by the driver to notify | 2311 | * assigned) this function needs to be called by the driver to notify |
2255 | * mac80211 that the scan finished. | 2312 | * mac80211 that the scan finished. This function can be called from |
2313 | * any context, including hardirq context. | ||
2256 | * | 2314 | * |
2257 | * @hw: the hardware that finished the scan | 2315 | * @hw: the hardware that finished the scan |
2258 | * @aborted: set to true if scan was aborted | 2316 | * @aborted: set to true if scan was aborted |
@@ -2267,6 +2325,7 @@ void ieee80211_scan_completed(struct ieee80211_hw *hw, bool aborted); | |||
2267 | * This function allows the iterator function to sleep, when the iterator | 2325 | * This function allows the iterator function to sleep, when the iterator |
2268 | * function is atomic @ieee80211_iterate_active_interfaces_atomic can | 2326 | * function is atomic @ieee80211_iterate_active_interfaces_atomic can |
2269 | * be used. | 2327 | * be used. |
2328 | * Does not iterate over a new interface during add_interface() | ||
2270 | * | 2329 | * |
2271 | * @hw: the hardware struct of which the interfaces should be iterated over | 2330 | * @hw: the hardware struct of which the interfaces should be iterated over |
2272 | * @iterator: the iterator function to call | 2331 | * @iterator: the iterator function to call |
@@ -2284,6 +2343,7 @@ void ieee80211_iterate_active_interfaces(struct ieee80211_hw *hw, | |||
2284 | * hardware that are currently active and calls the callback for them. | 2343 | * hardware that are currently active and calls the callback for them. |
2285 | * This function requires the iterator callback function to be atomic, | 2344 | * This function requires the iterator callback function to be atomic, |
2286 | * if that is not desired, use @ieee80211_iterate_active_interfaces instead. | 2345 | * if that is not desired, use @ieee80211_iterate_active_interfaces instead. |
2346 | * Does not iterate over a new interface during add_interface() | ||
2287 | * | 2347 | * |
2288 | * @hw: the hardware struct of which the interfaces should be iterated over | 2348 | * @hw: the hardware struct of which the interfaces should be iterated over |
2289 | * @iterator: the iterator function to call, cannot sleep | 2349 | * @iterator: the iterator function to call, cannot sleep |
@@ -2385,25 +2445,28 @@ struct ieee80211_sta *ieee80211_find_sta(struct ieee80211_vif *vif, | |||
2385 | const u8 *addr); | 2445 | const u8 *addr); |
2386 | 2446 | ||
2387 | /** | 2447 | /** |
2388 | * ieee80211_find_sta_by_hw - find a station on hardware | 2448 | * ieee80211_find_sta_by_ifaddr - find a station on hardware |
2389 | * | 2449 | * |
2390 | * @hw: pointer as obtained from ieee80211_alloc_hw() | 2450 | * @hw: pointer as obtained from ieee80211_alloc_hw() |
2391 | * @addr: station's address | 2451 | * @addr: remote station's address |
2452 | * @localaddr: local address (vif->sdata->vif.addr). Use NULL for 'any'. | ||
2392 | * | 2453 | * |
2393 | * This function must be called under RCU lock and the | 2454 | * This function must be called under RCU lock and the |
2394 | * resulting pointer is only valid under RCU lock as well. | 2455 | * resulting pointer is only valid under RCU lock as well. |
2395 | * | 2456 | * |
2396 | * NOTE: This function should not be used! When mac80211 is converted | 2457 | * NOTE: You may pass NULL for localaddr, but then you will just get |
2397 | * internally to properly keep track of stations on multiple | 2458 | * the first STA that matches the remote address 'addr'. |
2398 | * virtual interfaces, it will not always know which station to | 2459 | * We can have multiple STA associated with multiple |
2399 | * return here since a single address might be used by multiple | 2460 | * logical stations (e.g. consider a station connecting to another |
2400 | * logical stations (e.g. consider a station connecting to another | 2461 | * BSSID on the same AP hardware without disconnecting first). |
2401 | * BSSID on the same AP hardware without disconnecting first). | 2462 | * In this case, the result of this method with localaddr NULL |
2463 | * is not reliable. | ||
2402 | * | 2464 | * |
2403 | * DO NOT USE THIS FUNCTION. | 2465 | * DO NOT USE THIS FUNCTION with localaddr NULL if at all possible. |
2404 | */ | 2466 | */ |
2405 | struct ieee80211_sta *ieee80211_find_sta_by_hw(struct ieee80211_hw *hw, | 2467 | struct ieee80211_sta *ieee80211_find_sta_by_ifaddr(struct ieee80211_hw *hw, |
2406 | const u8 *addr); | 2468 | const u8 *addr, |
2469 | const u8 *localaddr); | ||
2407 | 2470 | ||
2408 | /** | 2471 | /** |
2409 | * ieee80211_sta_block_awake - block station from waking up | 2472 | * ieee80211_sta_block_awake - block station from waking up |
@@ -2442,7 +2505,7 @@ void ieee80211_sta_block_awake(struct ieee80211_hw *hw, | |||
2442 | * | 2505 | * |
2443 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. | 2506 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. |
2444 | * | 2507 | * |
2445 | * When beacon filtering is enabled with %IEEE80211_HW_BEACON_FILTERING and | 2508 | * When beacon filtering is enabled with %IEEE80211_HW_BEACON_FILTER and |
2446 | * %IEEE80211_CONF_PS is set, the driver needs to inform whenever the | 2509 | * %IEEE80211_CONF_PS is set, the driver needs to inform whenever the |
2447 | * hardware is not receiving beacons with this function. | 2510 | * hardware is not receiving beacons with this function. |
2448 | */ | 2511 | */ |
@@ -2453,7 +2516,7 @@ void ieee80211_beacon_loss(struct ieee80211_vif *vif); | |||
2453 | * | 2516 | * |
2454 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. | 2517 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. |
2455 | * | 2518 | * |
2456 | * When beacon filtering is enabled with %IEEE80211_HW_BEACON_FILTERING, and | 2519 | * When beacon filtering is enabled with %IEEE80211_HW_BEACON_FILTER, and |
2457 | * %IEEE80211_CONF_PS and %IEEE80211_HW_CONNECTION_MONITOR are set, the driver | 2520 | * %IEEE80211_CONF_PS and %IEEE80211_HW_CONNECTION_MONITOR are set, the driver |
2458 | * needs to inform if the connection to the AP has been lost. | 2521 | * needs to inform if the connection to the AP has been lost. |
2459 | * | 2522 | * |
@@ -2518,6 +2581,34 @@ void ieee80211_cqm_rssi_notify(struct ieee80211_vif *vif, | |||
2518 | */ | 2581 | */ |
2519 | void ieee80211_chswitch_done(struct ieee80211_vif *vif, bool success); | 2582 | void ieee80211_chswitch_done(struct ieee80211_vif *vif, bool success); |
2520 | 2583 | ||
2584 | /** | ||
2585 | * ieee80211_request_smps - request SM PS transition | ||
2586 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. | ||
2587 | * @smps_mode: new SM PS mode | ||
2588 | * | ||
2589 | * This allows the driver to request an SM PS transition in managed | ||
2590 | * mode. This is useful when the driver has more information than | ||
2591 | * the stack about possible interference, for example by bluetooth. | ||
2592 | */ | ||
2593 | void ieee80211_request_smps(struct ieee80211_vif *vif, | ||
2594 | enum ieee80211_smps_mode smps_mode); | ||
2595 | |||
2596 | /** | ||
2597 | * ieee80211_key_removed - disable hw acceleration for key | ||
2598 | * @key_conf: The key hw acceleration should be disabled for | ||
2599 | * | ||
2600 | * This allows drivers to indicate that the given key has been | ||
2601 | * removed from hardware acceleration, due to a new key that | ||
2602 | * was added. Don't use this if the key can continue to be used | ||
2603 | * for TX, if the key restriction is on RX only it is permitted | ||
2604 | * to keep the key for TX only and not call this function. | ||
2605 | * | ||
2606 | * Due to locking constraints, it may only be called during | ||
2607 | * @set_key. This function must be allowed to sleep, and the | ||
2608 | * key it tries to disable may still be used until it returns. | ||
2609 | */ | ||
2610 | void ieee80211_key_removed(struct ieee80211_key_conf *key_conf); | ||
2611 | |||
2521 | /* Rate control API */ | 2612 | /* Rate control API */ |
2522 | 2613 | ||
2523 | /** | 2614 | /** |
@@ -2681,4 +2772,26 @@ conf_is_ht(struct ieee80211_conf *conf) | |||
2681 | return conf->channel_type != NL80211_CHAN_NO_HT; | 2772 | return conf->channel_type != NL80211_CHAN_NO_HT; |
2682 | } | 2773 | } |
2683 | 2774 | ||
2775 | static inline enum nl80211_iftype | ||
2776 | ieee80211_iftype_p2p(enum nl80211_iftype type, bool p2p) | ||
2777 | { | ||
2778 | if (p2p) { | ||
2779 | switch (type) { | ||
2780 | case NL80211_IFTYPE_STATION: | ||
2781 | return NL80211_IFTYPE_P2P_CLIENT; | ||
2782 | case NL80211_IFTYPE_AP: | ||
2783 | return NL80211_IFTYPE_P2P_GO; | ||
2784 | default: | ||
2785 | break; | ||
2786 | } | ||
2787 | } | ||
2788 | return type; | ||
2789 | } | ||
2790 | |||
2791 | static inline enum nl80211_iftype | ||
2792 | ieee80211_vif_type_p2p(struct ieee80211_vif *vif) | ||
2793 | { | ||
2794 | return ieee80211_iftype_p2p(vif->type, vif->p2p); | ||
2795 | } | ||
2796 | |||
2684 | #endif /* MAC80211_H */ | 2797 | #endif /* MAC80211_H */ |