aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/ieee80211_i.h
diff options
context:
space:
mode:
Diffstat (limited to 'net/mac80211/ieee80211_i.h')
-rw-r--r--net/mac80211/ieee80211_i.h50
1 files changed, 34 insertions, 16 deletions
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 32e47853f329..5c0d5a6946c1 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -56,6 +56,9 @@ struct ieee80211_local;
56#define TU_TO_JIFFIES(x) (usecs_to_jiffies((x) * 1024)) 56#define TU_TO_JIFFIES(x) (usecs_to_jiffies((x) * 1024))
57#define TU_TO_EXP_TIME(x) (jiffies + TU_TO_JIFFIES(x)) 57#define TU_TO_EXP_TIME(x) (jiffies + TU_TO_JIFFIES(x))
58 58
59/* power level hasn't been configured (or set to automatic) */
60#define IEEE80211_UNSET_POWER_LEVEL INT_MIN
61
59/* 62/*
60 * Some APs experience problems when working with U-APSD. Decrease the 63 * Some APs experience problems when working with U-APSD. Decrease the
61 * probability of that happening by using legacy mode for all ACs but VO. 64 * probability of that happening by using legacy mode for all ACs but VO.
@@ -345,7 +348,6 @@ struct ieee80211_roc_work {
345 struct ieee80211_sub_if_data *sdata; 348 struct ieee80211_sub_if_data *sdata;
346 349
347 struct ieee80211_channel *chan; 350 struct ieee80211_channel *chan;
348 enum nl80211_channel_type chan_type;
349 351
350 bool started, abort, hw_begun, notified; 352 bool started, abort, hw_begun, notified;
351 353
@@ -353,7 +355,7 @@ struct ieee80211_roc_work {
353 355
354 u32 duration, req_duration; 356 u32 duration, req_duration;
355 struct sk_buff *frame; 357 struct sk_buff *frame;
356 u64 mgmt_tx_cookie; 358 u64 cookie, mgmt_tx_cookie;
357}; 359};
358 360
359/* flags used in struct ieee80211_if_managed.flags */ 361/* flags used in struct ieee80211_if_managed.flags */
@@ -361,7 +363,7 @@ enum ieee80211_sta_flags {
361 IEEE80211_STA_BEACON_POLL = BIT(0), 363 IEEE80211_STA_BEACON_POLL = BIT(0),
362 IEEE80211_STA_CONNECTION_POLL = BIT(1), 364 IEEE80211_STA_CONNECTION_POLL = BIT(1),
363 IEEE80211_STA_CONTROL_PORT = BIT(2), 365 IEEE80211_STA_CONTROL_PORT = BIT(2),
364 IEEE80211_STA_DISABLE_11N = BIT(4), 366 IEEE80211_STA_DISABLE_HT = BIT(4),
365 IEEE80211_STA_CSA_RECEIVED = BIT(5), 367 IEEE80211_STA_CSA_RECEIVED = BIT(5),
366 IEEE80211_STA_MFP_ENABLED = BIT(6), 368 IEEE80211_STA_MFP_ENABLED = BIT(6),
367 IEEE80211_STA_UAPSD_ENABLED = BIT(7), 369 IEEE80211_STA_UAPSD_ENABLED = BIT(7),
@@ -470,6 +472,8 @@ struct ieee80211_if_managed {
470 472
471 u8 use_4addr; 473 u8 use_4addr;
472 474
475 u8 p2p_noa_index;
476
473 /* Signal strength from the last Beacon frame in the current BSS. */ 477 /* Signal strength from the last Beacon frame in the current BSS. */
474 int last_beacon_signal; 478 int last_beacon_signal;
475 479
@@ -743,6 +747,9 @@ struct ieee80211_sub_if_data {
743 u8 needed_rx_chains; 747 u8 needed_rx_chains;
744 enum ieee80211_smps_mode smps_mode; 748 enum ieee80211_smps_mode smps_mode;
745 749
750 int user_power_level; /* in dBm */
751 int ap_power_level; /* in dBm */
752
746 /* 753 /*
747 * AP this belongs to: self in AP mode and 754 * AP this belongs to: self in AP mode and
748 * corresponding AP in VLAN mode, NULL for 755 * corresponding AP in VLAN mode, NULL for
@@ -792,7 +799,7 @@ ieee80211_get_sdata_band(struct ieee80211_sub_if_data *sdata)
792 rcu_read_lock(); 799 rcu_read_lock();
793 chanctx_conf = rcu_dereference(sdata->vif.chanctx_conf); 800 chanctx_conf = rcu_dereference(sdata->vif.chanctx_conf);
794 if (!WARN_ON(!chanctx_conf)) 801 if (!WARN_ON(!chanctx_conf))
795 band = chanctx_conf->channel->band; 802 band = chanctx_conf->def.chan->band;
796 rcu_read_unlock(); 803 rcu_read_unlock();
797 804
798 return band; 805 return band;
@@ -1040,7 +1047,6 @@ struct ieee80211_local {
1040 1047
1041 /* Temporary remain-on-channel for off-channel operations */ 1048 /* Temporary remain-on-channel for off-channel operations */
1042 struct ieee80211_channel *tmp_channel; 1049 struct ieee80211_channel *tmp_channel;
1043 enum nl80211_channel_type tmp_channel_type;
1044 1050
1045 /* channel contexts */ 1051 /* channel contexts */
1046 struct list_head chanctx_list; 1052 struct list_head chanctx_list;
@@ -1117,8 +1123,7 @@ struct ieee80211_local {
1117 int dynamic_ps_user_timeout; 1123 int dynamic_ps_user_timeout;
1118 bool disable_dynamic_ps; 1124 bool disable_dynamic_ps;
1119 1125
1120 int user_power_level; /* in dBm */ 1126 int user_power_level; /* in dBm, for all interfaces */
1121 int ap_power_level; /* in dBm */
1122 1127
1123 enum ieee80211_smps_mode smps_mode; 1128 enum ieee80211_smps_mode smps_mode;
1124 1129
@@ -1137,6 +1142,7 @@ struct ieee80211_local {
1137 struct list_head roc_list; 1142 struct list_head roc_list;
1138 struct work_struct hw_roc_start, hw_roc_done; 1143 struct work_struct hw_roc_start, hw_roc_done;
1139 unsigned long hw_roc_start_time; 1144 unsigned long hw_roc_start_time;
1145 u64 roc_cookie_counter;
1140 1146
1141 struct idr ack_status_frames; 1147 struct idr ack_status_frames;
1142 spinlock_t ack_status_lock; 1148 spinlock_t ack_status_lock;
@@ -1150,8 +1156,7 @@ struct ieee80211_local {
1150 1156
1151 /* virtual monitor interface */ 1157 /* virtual monitor interface */
1152 struct ieee80211_sub_if_data __rcu *monitor_sdata; 1158 struct ieee80211_sub_if_data __rcu *monitor_sdata;
1153 struct ieee80211_channel *monitor_channel; 1159 struct cfg80211_chan_def monitor_chandef;
1154 enum nl80211_channel_type monitor_channel_type;
1155}; 1160};
1156 1161
1157static inline struct ieee80211_sub_if_data * 1162static inline struct ieee80211_sub_if_data *
@@ -1251,7 +1256,18 @@ static inline int ieee80211_bssid_match(const u8 *raddr, const u8 *addr)
1251 is_broadcast_ether_addr(raddr); 1256 is_broadcast_ether_addr(raddr);
1252} 1257}
1253 1258
1259static inline bool
1260ieee80211_have_rx_timestamp(struct ieee80211_rx_status *status)
1261{
1262 WARN_ON_ONCE(status->flag & RX_FLAG_MACTIME_START &&
1263 status->flag & RX_FLAG_MACTIME_END);
1264 return status->flag & (RX_FLAG_MACTIME_START | RX_FLAG_MACTIME_END);
1265}
1254 1266
1267u64 ieee80211_calculate_rx_timestamp(struct ieee80211_local *local,
1268 struct ieee80211_rx_status *status,
1269 unsigned int mpdu_len,
1270 unsigned int mpdu_offset);
1255int ieee80211_hw_config(struct ieee80211_local *local, u32 changed); 1271int ieee80211_hw_config(struct ieee80211_local *local, u32 changed);
1256void ieee80211_tx_set_protected(struct ieee80211_tx_data *tx); 1272void ieee80211_tx_set_protected(struct ieee80211_tx_data *tx);
1257void ieee80211_bss_info_change_notify(struct ieee80211_sub_if_data *sdata, 1273void ieee80211_bss_info_change_notify(struct ieee80211_sub_if_data *sdata,
@@ -1365,6 +1381,9 @@ void ieee80211_adjust_monitor_flags(struct ieee80211_sub_if_data *sdata,
1365int ieee80211_do_open(struct wireless_dev *wdev, bool coming_up); 1381int ieee80211_do_open(struct wireless_dev *wdev, bool coming_up);
1366void ieee80211_sdata_stop(struct ieee80211_sub_if_data *sdata); 1382void ieee80211_sdata_stop(struct ieee80211_sub_if_data *sdata);
1367 1383
1384bool __ieee80211_recalc_txpower(struct ieee80211_sub_if_data *sdata);
1385void ieee80211_recalc_txpower(struct ieee80211_sub_if_data *sdata);
1386
1368static inline bool ieee80211_sdata_running(struct ieee80211_sub_if_data *sdata) 1387static inline bool ieee80211_sdata_running(struct ieee80211_sub_if_data *sdata)
1369{ 1388{
1370 return test_bit(SDATA_STATE_RUNNING, &sdata->state); 1389 return test_bit(SDATA_STATE_RUNNING, &sdata->state);
@@ -1496,7 +1515,7 @@ static inline void ieee80211_tx_skb_tid(struct ieee80211_sub_if_data *sdata,
1496 } 1515 }
1497 1516
1498 __ieee80211_tx_skb_tid_band(sdata, skb, tid, 1517 __ieee80211_tx_skb_tid_band(sdata, skb, tid,
1499 chanctx_conf->channel->band); 1518 chanctx_conf->def.chan->band);
1500 rcu_read_unlock(); 1519 rcu_read_unlock();
1501} 1520}
1502 1521
@@ -1585,8 +1604,7 @@ size_t ieee80211_ie_split_vendor(const u8 *ies, size_t ielen, size_t offset);
1585u8 *ieee80211_ie_build_ht_cap(u8 *pos, struct ieee80211_sta_ht_cap *ht_cap, 1604u8 *ieee80211_ie_build_ht_cap(u8 *pos, struct ieee80211_sta_ht_cap *ht_cap,
1586 u16 cap); 1605 u16 cap);
1587u8 *ieee80211_ie_build_ht_oper(u8 *pos, struct ieee80211_sta_ht_cap *ht_cap, 1606u8 *ieee80211_ie_build_ht_oper(u8 *pos, struct ieee80211_sta_ht_cap *ht_cap,
1588 struct ieee80211_channel *channel, 1607 const struct cfg80211_chan_def *chandef,
1589 enum nl80211_channel_type channel_type,
1590 u16 prot_mode); 1608 u16 prot_mode);
1591u8 *ieee80211_ie_build_vht_cap(u8 *pos, struct ieee80211_sta_vht_cap *vht_cap, 1609u8 *ieee80211_ie_build_vht_cap(u8 *pos, struct ieee80211_sta_vht_cap *vht_cap,
1592 u32 cap); 1610 u32 cap);
@@ -1598,13 +1616,13 @@ int ieee80211_add_ext_srates_ie(struct ieee80211_sub_if_data *sdata,
1598 enum ieee80211_band band); 1616 enum ieee80211_band band);
1599 1617
1600/* channel management */ 1618/* channel management */
1601enum nl80211_channel_type 1619void ieee80211_ht_oper_to_chandef(struct ieee80211_channel *control_chan,
1602ieee80211_ht_oper_to_channel_type(struct ieee80211_ht_operation *ht_oper); 1620 struct ieee80211_ht_operation *ht_oper,
1621 struct cfg80211_chan_def *chandef);
1603 1622
1604int __must_check 1623int __must_check
1605ieee80211_vif_use_channel(struct ieee80211_sub_if_data *sdata, 1624ieee80211_vif_use_channel(struct ieee80211_sub_if_data *sdata,
1606 struct ieee80211_channel *channel, 1625 const struct cfg80211_chan_def *chandef,
1607 enum nl80211_channel_type channel_type,
1608 enum ieee80211_chanctx_mode mode); 1626 enum ieee80211_chanctx_mode mode);
1609void ieee80211_vif_release_channel(struct ieee80211_sub_if_data *sdata); 1627void ieee80211_vif_release_channel(struct ieee80211_sub_if_data *sdata);
1610 1628