diff options
Diffstat (limited to 'include/net/mac80211.h')
-rw-r--r-- | include/net/mac80211.h | 138 |
1 files changed, 127 insertions, 11 deletions
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 7ceed99a05bc..f4ab2fb4d50c 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
@@ -154,12 +154,14 @@ struct ieee80211_low_level_stats { | |||
154 | * @IEEE80211_CHANCTX_CHANGE_RADAR: radar detection flag changed | 154 | * @IEEE80211_CHANCTX_CHANGE_RADAR: radar detection flag changed |
155 | * @IEEE80211_CHANCTX_CHANGE_CHANNEL: switched to another operating channel, | 155 | * @IEEE80211_CHANCTX_CHANGE_CHANNEL: switched to another operating channel, |
156 | * this is used only with channel switching with CSA | 156 | * this is used only with channel switching with CSA |
157 | * @IEEE80211_CHANCTX_CHANGE_MIN_WIDTH: The min required channel width changed | ||
157 | */ | 158 | */ |
158 | enum ieee80211_chanctx_change { | 159 | enum ieee80211_chanctx_change { |
159 | IEEE80211_CHANCTX_CHANGE_WIDTH = BIT(0), | 160 | IEEE80211_CHANCTX_CHANGE_WIDTH = BIT(0), |
160 | IEEE80211_CHANCTX_CHANGE_RX_CHAINS = BIT(1), | 161 | IEEE80211_CHANCTX_CHANGE_RX_CHAINS = BIT(1), |
161 | IEEE80211_CHANCTX_CHANGE_RADAR = BIT(2), | 162 | IEEE80211_CHANCTX_CHANGE_RADAR = BIT(2), |
162 | IEEE80211_CHANCTX_CHANGE_CHANNEL = BIT(3), | 163 | IEEE80211_CHANCTX_CHANGE_CHANNEL = BIT(3), |
164 | IEEE80211_CHANCTX_CHANGE_MIN_WIDTH = BIT(4), | ||
163 | }; | 165 | }; |
164 | 166 | ||
165 | /** | 167 | /** |
@@ -169,6 +171,7 @@ enum ieee80211_chanctx_change { | |||
169 | * that contains it is visible in mac80211 only. | 171 | * that contains it is visible in mac80211 only. |
170 | * | 172 | * |
171 | * @def: the channel definition | 173 | * @def: the channel definition |
174 | * @min_def: the minimum channel definition currently required. | ||
172 | * @rx_chains_static: The number of RX chains that must always be | 175 | * @rx_chains_static: The number of RX chains that must always be |
173 | * active on the channel to receive MIMO transmissions | 176 | * active on the channel to receive MIMO transmissions |
174 | * @rx_chains_dynamic: The number of RX chains that must be enabled | 177 | * @rx_chains_dynamic: The number of RX chains that must be enabled |
@@ -180,6 +183,7 @@ enum ieee80211_chanctx_change { | |||
180 | */ | 183 | */ |
181 | struct ieee80211_chanctx_conf { | 184 | struct ieee80211_chanctx_conf { |
182 | struct cfg80211_chan_def def; | 185 | struct cfg80211_chan_def def; |
186 | struct cfg80211_chan_def min_def; | ||
183 | 187 | ||
184 | u8 rx_chains_static, rx_chains_dynamic; | 188 | u8 rx_chains_static, rx_chains_dynamic; |
185 | 189 | ||
@@ -1159,6 +1163,19 @@ static inline bool ieee80211_vif_is_mesh(struct ieee80211_vif *vif) | |||
1159 | } | 1163 | } |
1160 | 1164 | ||
1161 | /** | 1165 | /** |
1166 | * wdev_to_ieee80211_vif - return a vif struct from a wdev | ||
1167 | * @wdev: the wdev to get the vif for | ||
1168 | * | ||
1169 | * This can be used by mac80211 drivers with direct cfg80211 APIs | ||
1170 | * (like the vendor commands) that get a wdev. | ||
1171 | * | ||
1172 | * Note that this function may return %NULL if the given wdev isn't | ||
1173 | * associated with a vif that the driver knows about (e.g. monitor | ||
1174 | * or AP_VLAN interfaces.) | ||
1175 | */ | ||
1176 | struct ieee80211_vif *wdev_to_ieee80211_vif(struct wireless_dev *wdev); | ||
1177 | |||
1178 | /** | ||
1162 | * enum ieee80211_key_flags - key flags | 1179 | * enum ieee80211_key_flags - key flags |
1163 | * | 1180 | * |
1164 | * These flags are used for communication about keys between the driver | 1181 | * These flags are used for communication about keys between the driver |
@@ -1229,6 +1246,36 @@ struct ieee80211_key_conf { | |||
1229 | }; | 1246 | }; |
1230 | 1247 | ||
1231 | /** | 1248 | /** |
1249 | * struct ieee80211_cipher_scheme - cipher scheme | ||
1250 | * | ||
1251 | * This structure contains a cipher scheme information defining | ||
1252 | * the secure packet crypto handling. | ||
1253 | * | ||
1254 | * @cipher: a cipher suite selector | ||
1255 | * @iftype: a cipher iftype bit mask indicating an allowed cipher usage | ||
1256 | * @hdr_len: a length of a security header used the cipher | ||
1257 | * @pn_len: a length of a packet number in the security header | ||
1258 | * @pn_off: an offset of pn from the beginning of the security header | ||
1259 | * @key_idx_off: an offset of key index byte in the security header | ||
1260 | * @key_idx_mask: a bit mask of key_idx bits | ||
1261 | * @key_idx_shift: a bit shift needed to get key_idx | ||
1262 | * key_idx value calculation: | ||
1263 | * (sec_header_base[key_idx_off] & key_idx_mask) >> key_idx_shift | ||
1264 | * @mic_len: a mic length in bytes | ||
1265 | */ | ||
1266 | struct ieee80211_cipher_scheme { | ||
1267 | u32 cipher; | ||
1268 | u16 iftype; | ||
1269 | u8 hdr_len; | ||
1270 | u8 pn_len; | ||
1271 | u8 pn_off; | ||
1272 | u8 key_idx_off; | ||
1273 | u8 key_idx_mask; | ||
1274 | u8 key_idx_shift; | ||
1275 | u8 mic_len; | ||
1276 | }; | ||
1277 | |||
1278 | /** | ||
1232 | * enum set_key_cmd - key command | 1279 | * enum set_key_cmd - key command |
1233 | * | 1280 | * |
1234 | * Used with the set_key() callback in &struct ieee80211_ops, this | 1281 | * Used with the set_key() callback in &struct ieee80211_ops, this |
@@ -1566,7 +1613,8 @@ enum ieee80211_hw_flags { | |||
1566 | * @extra_tx_headroom: headroom to reserve in each transmit skb | 1613 | * @extra_tx_headroom: headroom to reserve in each transmit skb |
1567 | * for use by the driver (e.g. for transmit headers.) | 1614 | * for use by the driver (e.g. for transmit headers.) |
1568 | * | 1615 | * |
1569 | * @channel_change_time: time (in microseconds) it takes to change channels. | 1616 | * @extra_beacon_tailroom: tailroom to reserve in each beacon tx skb. |
1617 | * Can be used by drivers to add extra IEs. | ||
1570 | * | 1618 | * |
1571 | * @max_signal: Maximum value for signal (rssi) in RX information, used | 1619 | * @max_signal: Maximum value for signal (rssi) in RX information, used |
1572 | * only when @IEEE80211_HW_SIGNAL_UNSPEC or @IEEE80211_HW_SIGNAL_DB | 1620 | * only when @IEEE80211_HW_SIGNAL_UNSPEC or @IEEE80211_HW_SIGNAL_DB |
@@ -1636,6 +1684,10 @@ enum ieee80211_hw_flags { | |||
1636 | * @uapsd_max_sp_len: maximum number of total buffered frames the WMM AP may | 1684 | * @uapsd_max_sp_len: maximum number of total buffered frames the WMM AP may |
1637 | * deliver to a WMM STA during any Service Period triggered by the WMM STA. | 1685 | * deliver to a WMM STA during any Service Period triggered by the WMM STA. |
1638 | * Use IEEE80211_WMM_IE_STA_QOSINFO_SP_* for correct values. | 1686 | * Use IEEE80211_WMM_IE_STA_QOSINFO_SP_* for correct values. |
1687 | * | ||
1688 | * @n_cipher_schemes: a size of an array of cipher schemes definitions. | ||
1689 | * @cipher_schemes: a pointer to an array of cipher scheme definitions | ||
1690 | * supported by HW. | ||
1639 | */ | 1691 | */ |
1640 | struct ieee80211_hw { | 1692 | struct ieee80211_hw { |
1641 | struct ieee80211_conf conf; | 1693 | struct ieee80211_conf conf; |
@@ -1644,7 +1696,7 @@ struct ieee80211_hw { | |||
1644 | void *priv; | 1696 | void *priv; |
1645 | u32 flags; | 1697 | u32 flags; |
1646 | unsigned int extra_tx_headroom; | 1698 | unsigned int extra_tx_headroom; |
1647 | int channel_change_time; | 1699 | unsigned int extra_beacon_tailroom; |
1648 | int vif_data_size; | 1700 | int vif_data_size; |
1649 | int sta_data_size; | 1701 | int sta_data_size; |
1650 | int chanctx_data_size; | 1702 | int chanctx_data_size; |
@@ -1663,6 +1715,8 @@ struct ieee80211_hw { | |||
1663 | netdev_features_t netdev_features; | 1715 | netdev_features_t netdev_features; |
1664 | u8 uapsd_queues; | 1716 | u8 uapsd_queues; |
1665 | u8 uapsd_max_sp_len; | 1717 | u8 uapsd_max_sp_len; |
1718 | u8 n_cipher_schemes; | ||
1719 | const struct ieee80211_cipher_scheme *cipher_schemes; | ||
1666 | }; | 1720 | }; |
1667 | 1721 | ||
1668 | /** | 1722 | /** |
@@ -2065,6 +2119,11 @@ void ieee80211_free_txskb(struct ieee80211_hw *hw, struct sk_buff *skb); | |||
2065 | * appropriately (only the last frame may have %IEEE80211_TX_STATUS_EOSP) | 2119 | * appropriately (only the last frame may have %IEEE80211_TX_STATUS_EOSP) |
2066 | * and also take care of the EOSP and MORE_DATA bits in the frame. | 2120 | * and also take care of the EOSP and MORE_DATA bits in the frame. |
2067 | * The driver may also use ieee80211_sta_eosp() in this case. | 2121 | * The driver may also use ieee80211_sta_eosp() in this case. |
2122 | * | ||
2123 | * Note that if the driver ever buffers frames other than QoS-data | ||
2124 | * frames, it must take care to never send a non-QoS-data frame as | ||
2125 | * the last frame in a service period, adding a QoS-nulldata frame | ||
2126 | * after a non-QoS-data frame if needed. | ||
2068 | */ | 2127 | */ |
2069 | 2128 | ||
2070 | /** | 2129 | /** |
@@ -2358,9 +2417,6 @@ enum ieee80211_roc_type { | |||
2358 | * See the section "Frame filtering" for more information. | 2417 | * See the section "Frame filtering" for more information. |
2359 | * This callback must be implemented and can sleep. | 2418 | * This callback must be implemented and can sleep. |
2360 | * | 2419 | * |
2361 | * @set_multicast_list: Configure the device's interface specific RX multicast | ||
2362 | * filter. This callback is optional. This callback must be atomic. | ||
2363 | * | ||
2364 | * @set_tim: Set TIM bit. mac80211 calls this function when a TIM bit | 2420 | * @set_tim: Set TIM bit. mac80211 calls this function when a TIM bit |
2365 | * must be set or cleared for a given STA. Must be atomic. | 2421 | * must be set or cleared for a given STA. Must be atomic. |
2366 | * | 2422 | * |
@@ -2445,7 +2501,11 @@ enum ieee80211_roc_type { | |||
2445 | * AP, IBSS/WDS/mesh peer etc. This callback can sleep. | 2501 | * AP, IBSS/WDS/mesh peer etc. This callback can sleep. |
2446 | * | 2502 | * |
2447 | * @sta_remove: Notifies low level driver about removal of an associated | 2503 | * @sta_remove: Notifies low level driver about removal of an associated |
2448 | * station, AP, IBSS/WDS/mesh peer etc. This callback can sleep. | 2504 | * station, AP, IBSS/WDS/mesh peer etc. Note that after the callback |
2505 | * returns it isn't safe to use the pointer, not even RCU protected; | ||
2506 | * no RCU grace period is guaranteed between returning here and freeing | ||
2507 | * the station. See @sta_pre_rcu_remove if needed. | ||
2508 | * This callback can sleep. | ||
2449 | * | 2509 | * |
2450 | * @sta_add_debugfs: Drivers can use this callback to add debugfs files | 2510 | * @sta_add_debugfs: Drivers can use this callback to add debugfs files |
2451 | * when a station is added to mac80211's station list. This callback | 2511 | * when a station is added to mac80211's station list. This callback |
@@ -2464,7 +2524,17 @@ enum ieee80211_roc_type { | |||
2464 | * station (which can be the AP, a client, IBSS/WDS/mesh peer etc.) | 2524 | * station (which can be the AP, a client, IBSS/WDS/mesh peer etc.) |
2465 | * This callback is mutually exclusive with @sta_add/@sta_remove. | 2525 | * This callback is mutually exclusive with @sta_add/@sta_remove. |
2466 | * It must not fail for down transitions but may fail for transitions | 2526 | * It must not fail for down transitions but may fail for transitions |
2467 | * up the list of states. | 2527 | * up the list of states. Also note that after the callback returns it |
2528 | * isn't safe to use the pointer, not even RCU protected - no RCU grace | ||
2529 | * period is guaranteed between returning here and freeing the station. | ||
2530 | * See @sta_pre_rcu_remove if needed. | ||
2531 | * The callback can sleep. | ||
2532 | * | ||
2533 | * @sta_pre_rcu_remove: Notify driver about station removal before RCU | ||
2534 | * synchronisation. This is useful if a driver needs to have station | ||
2535 | * pointers protected using RCU, it can then use this call to clear | ||
2536 | * the pointers instead of waiting for an RCU grace period to elapse | ||
2537 | * in @sta_state. | ||
2468 | * The callback can sleep. | 2538 | * The callback can sleep. |
2469 | * | 2539 | * |
2470 | * @sta_rc_update: Notifies the driver of changes to the bitrates that can be | 2540 | * @sta_rc_update: Notifies the driver of changes to the bitrates that can be |
@@ -2724,10 +2794,6 @@ struct ieee80211_ops { | |||
2724 | unsigned int changed_flags, | 2794 | unsigned int changed_flags, |
2725 | unsigned int *total_flags, | 2795 | unsigned int *total_flags, |
2726 | u64 multicast); | 2796 | u64 multicast); |
2727 | void (*set_multicast_list)(struct ieee80211_hw *hw, | ||
2728 | struct ieee80211_vif *vif, bool allmulti, | ||
2729 | struct netdev_hw_addr_list *mc_list); | ||
2730 | |||
2731 | int (*set_tim)(struct ieee80211_hw *hw, struct ieee80211_sta *sta, | 2797 | int (*set_tim)(struct ieee80211_hw *hw, struct ieee80211_sta *sta, |
2732 | bool set); | 2798 | bool set); |
2733 | int (*set_key)(struct ieee80211_hw *hw, enum set_key_cmd cmd, | 2799 | int (*set_key)(struct ieee80211_hw *hw, enum set_key_cmd cmd, |
@@ -2781,6 +2847,9 @@ struct ieee80211_ops { | |||
2781 | struct ieee80211_sta *sta, | 2847 | struct ieee80211_sta *sta, |
2782 | enum ieee80211_sta_state old_state, | 2848 | enum ieee80211_sta_state old_state, |
2783 | enum ieee80211_sta_state new_state); | 2849 | enum ieee80211_sta_state new_state); |
2850 | void (*sta_pre_rcu_remove)(struct ieee80211_hw *hw, | ||
2851 | struct ieee80211_vif *vif, | ||
2852 | struct ieee80211_sta *sta); | ||
2784 | void (*sta_rc_update)(struct ieee80211_hw *hw, | 2853 | void (*sta_rc_update)(struct ieee80211_hw *hw, |
2785 | struct ieee80211_vif *vif, | 2854 | struct ieee80211_vif *vif, |
2786 | struct ieee80211_sta *sta, | 2855 | struct ieee80211_sta *sta, |
@@ -4585,4 +4654,51 @@ bool ieee80211_tx_prepare_skb(struct ieee80211_hw *hw, | |||
4585 | struct ieee80211_vif *vif, struct sk_buff *skb, | 4654 | struct ieee80211_vif *vif, struct sk_buff *skb, |
4586 | int band, struct ieee80211_sta **sta); | 4655 | int band, struct ieee80211_sta **sta); |
4587 | 4656 | ||
4657 | /** | ||
4658 | * struct ieee80211_noa_data - holds temporary data for tracking P2P NoA state | ||
4659 | * | ||
4660 | * @next_tsf: TSF timestamp of the next absent state change | ||
4661 | * @has_next_tsf: next absent state change event pending | ||
4662 | * | ||
4663 | * @absent: descriptor bitmask, set if GO is currently absent | ||
4664 | * | ||
4665 | * private: | ||
4666 | * | ||
4667 | * @count: count fields from the NoA descriptors | ||
4668 | * @desc: adjusted data from the NoA | ||
4669 | */ | ||
4670 | struct ieee80211_noa_data { | ||
4671 | u32 next_tsf; | ||
4672 | bool has_next_tsf; | ||
4673 | |||
4674 | u8 absent; | ||
4675 | |||
4676 | u8 count[IEEE80211_P2P_NOA_DESC_MAX]; | ||
4677 | struct { | ||
4678 | u32 start; | ||
4679 | u32 duration; | ||
4680 | u32 interval; | ||
4681 | } desc[IEEE80211_P2P_NOA_DESC_MAX]; | ||
4682 | }; | ||
4683 | |||
4684 | /** | ||
4685 | * ieee80211_parse_p2p_noa - initialize NoA tracking data from P2P IE | ||
4686 | * | ||
4687 | * @attr: P2P NoA IE | ||
4688 | * @data: NoA tracking data | ||
4689 | * @tsf: current TSF timestamp | ||
4690 | * | ||
4691 | * Return: number of successfully parsed descriptors | ||
4692 | */ | ||
4693 | int ieee80211_parse_p2p_noa(const struct ieee80211_p2p_noa_attr *attr, | ||
4694 | struct ieee80211_noa_data *data, u32 tsf); | ||
4695 | |||
4696 | /** | ||
4697 | * ieee80211_update_p2p_noa - get next pending P2P GO absent state change | ||
4698 | * | ||
4699 | * @data: NoA tracking data | ||
4700 | * @tsf: current TSF timestamp | ||
4701 | */ | ||
4702 | void ieee80211_update_p2p_noa(struct ieee80211_noa_data *data, u32 tsf); | ||
4703 | |||
4588 | #endif /* MAC80211_H */ | 4704 | #endif /* MAC80211_H */ |