Skip to content

Commit 2a38075

Browse files
Alexei Avshalom Lazarjmberg-intel
authored andcommitted
nl80211: Add support for EDMG channels
802.11ay specification defines Enhanced Directional Multi-Gigabit (EDMG) STA and AP which allow channel bonding of 2 channels and more. Introduce new NL attributes that are needed for enabling and configuring EDMG support. Two new attributes are used by kernel to publish driver's EDMG capabilities to the userspace: NL80211_BAND_ATTR_EDMG_CHANNELS - bitmap field that indicates the 2.16 GHz channel(s) that are supported by the driver. When this attribute is not set it means driver does not support EDMG. NL80211_BAND_ATTR_EDMG_BW_CONFIG - represent the channel bandwidth configurations supported by the driver. Additional two new attributes are used by the userspace for connect command and for AP configuration: NL80211_ATTR_WIPHY_EDMG_CHANNELS NL80211_ATTR_WIPHY_EDMG_BW_CONFIG New rate info flag - RATE_INFO_FLAGS_EDMG, can be reported from driver and used for bitrate calculation that will take into account EDMG according to the 802.11ay specification. Signed-off-by: Alexei Avshalom Lazar <ailizaro@codeaurora.org> Link: https://lore.kernel.org/r/1566138918-3823-2-git-send-email-ailizaro@codeaurora.org Signed-off-by: Johannes Berg <johannes.berg@intel.com>
1 parent 5db16ba commit 2a38075

8 files changed

Lines changed: 349 additions & 9 deletions

File tree

‎drivers/net/wireless/ath/wil6210/cfg80211.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ int wil_cid_fill_sinfo(struct wil6210_vif *vif, int cid,
351351
BIT_ULL(NL80211_STA_INFO_RX_DROP_MISC) |
352352
BIT_ULL(NL80211_STA_INFO_TX_FAILED);
353353

354-
sinfo->txrate.flags = RATE_INFO_FLAGS_60G;
354+
sinfo->txrate.flags = RATE_INFO_FLAGS_DMG;
355355
sinfo->txrate.mcs = le16_to_cpu(reply.evt.bf_mcs);
356356
sinfo->rxrate.mcs = stats->last_mcs_rx;
357357
sinfo->rx_bytes = stats->rx_bytes;

‎include/net/cfg80211.h‎

Lines changed: 84 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,60 @@ struct ieee80211_sband_iftype_data {
330330
struct ieee80211_sta_he_cap he_cap;
331331
};
332332

333+
/**
334+
* enum ieee80211_edmg_bw_config - allowed channel bandwidth configurations
335+
*
336+
* @IEEE80211_EDMG_BW_CONFIG_4: 2.16GHz
337+
* @IEEE80211_EDMG_BW_CONFIG_5: 2.16GHz and 4.32GHz
338+
* @IEEE80211_EDMG_BW_CONFIG_6: 2.16GHz, 4.32GHz and 6.48GHz
339+
* @IEEE80211_EDMG_BW_CONFIG_7: 2.16GHz, 4.32GHz, 6.48GHz and 8.64GHz
340+
* @IEEE80211_EDMG_BW_CONFIG_8: 2.16GHz and 2.16GHz + 2.16GHz
341+
* @IEEE80211_EDMG_BW_CONFIG_9: 2.16GHz, 4.32GHz and 2.16GHz + 2.16GHz
342+
* @IEEE80211_EDMG_BW_CONFIG_10: 2.16GHz, 4.32GHz, 6.48GHz and 2.16GHz+2.16GHz
343+
* @IEEE80211_EDMG_BW_CONFIG_11: 2.16GHz, 4.32GHz, 6.48GHz, 8.64GHz and
344+
* 2.16GHz+2.16GHz
345+
* @IEEE80211_EDMG_BW_CONFIG_12: 2.16GHz, 2.16GHz + 2.16GHz and
346+
* 4.32GHz + 4.32GHz
347+
* @IEEE80211_EDMG_BW_CONFIG_13: 2.16GHz, 4.32GHz, 2.16GHz + 2.16GHz and
348+
* 4.32GHz + 4.32GHz
349+
* @IEEE80211_EDMG_BW_CONFIG_14: 2.16GHz, 4.32GHz, 6.48GHz, 2.16GHz + 2.16GHz
350+
* and 4.32GHz + 4.32GHz
351+
* @IEEE80211_EDMG_BW_CONFIG_15: 2.16GHz, 4.32GHz, 6.48GHz, 8.64GHz,
352+
* 2.16GHz + 2.16GHz and 4.32GHz + 4.32GHz
353+
*/
354+
enum ieee80211_edmg_bw_config {
355+
IEEE80211_EDMG_BW_CONFIG_4 = 4,
356+
IEEE80211_EDMG_BW_CONFIG_5 = 5,
357+
IEEE80211_EDMG_BW_CONFIG_6 = 6,
358+
IEEE80211_EDMG_BW_CONFIG_7 = 7,
359+
IEEE80211_EDMG_BW_CONFIG_8 = 8,
360+
IEEE80211_EDMG_BW_CONFIG_9 = 9,
361+
IEEE80211_EDMG_BW_CONFIG_10 = 10,
362+
IEEE80211_EDMG_BW_CONFIG_11 = 11,
363+
IEEE80211_EDMG_BW_CONFIG_12 = 12,
364+
IEEE80211_EDMG_BW_CONFIG_13 = 13,
365+
IEEE80211_EDMG_BW_CONFIG_14 = 14,
366+
IEEE80211_EDMG_BW_CONFIG_15 = 15,
367+
};
368+
369+
/**
370+
* struct ieee80211_edmg - EDMG configuration
371+
*
372+
* This structure describes most essential parameters needed
373+
* to describe 802.11ay EDMG configuration
374+
*
375+
* @channels: bitmap that indicates the 2.16 GHz channel(s)
376+
* that are allowed to be used for transmissions.
377+
* Bit 0 indicates channel 1, bit 1 indicates channel 2, etc.
378+
* Set to 0 indicate EDMG not supported.
379+
* @bw_config: Channel BW Configuration subfield encodes
380+
* the allowed channel bandwidth configurations
381+
*/
382+
struct ieee80211_edmg {
383+
u8 channels;
384+
enum ieee80211_edmg_bw_config bw_config;
385+
};
386+
333387
/**
334388
* struct ieee80211_supported_band - frequency band definition
335389
*
@@ -346,6 +400,7 @@ struct ieee80211_sband_iftype_data {
346400
* @n_bitrates: Number of bitrates in @bitrates
347401
* @ht_cap: HT capabilities in this band
348402
* @vht_cap: VHT capabilities in this band
403+
* @edmg_cap: EDMG capabilities in this band
349404
* @n_iftype_data: number of iftype data entries
350405
* @iftype_data: interface type data entries. Note that the bits in
351406
* @types_mask inside this structure cannot overlap (i.e. only
@@ -360,6 +415,7 @@ struct ieee80211_supported_band {
360415
int n_bitrates;
361416
struct ieee80211_sta_ht_cap ht_cap;
362417
struct ieee80211_sta_vht_cap vht_cap;
418+
struct ieee80211_edmg edmg_cap;
363419
u16 n_iftype_data;
364420
const struct ieee80211_sband_iftype_data *iftype_data;
365421
};
@@ -527,12 +583,17 @@ struct key_params {
527583
* @center_freq1: center frequency of first segment
528584
* @center_freq2: center frequency of second segment
529585
* (only with 80+80 MHz)
586+
* @edmg: define the EDMG channels configuration.
587+
* If edmg is requested (i.e. the .channels member is non-zero),
588+
* chan will define the primary channel and all other
589+
* parameters are ignored.
530590
*/
531591
struct cfg80211_chan_def {
532592
struct ieee80211_channel *chan;
533593
enum nl80211_chan_width width;
534594
u32 center_freq1;
535595
u32 center_freq2;
596+
struct ieee80211_edmg edmg;
536597
};
537598

538599
/**
@@ -590,6 +651,19 @@ cfg80211_chandef_identical(const struct cfg80211_chan_def *chandef1,
590651
chandef1->center_freq2 == chandef2->center_freq2);
591652
}
592653

654+
/**
655+
* cfg80211_chandef_is_edmg - check if chandef represents an EDMG channel
656+
*
657+
* @chandef: the channel definition
658+
*
659+
* Return: %true if EDMG defined, %false otherwise.
660+
*/
661+
static inline bool
662+
cfg80211_chandef_is_edmg(const struct cfg80211_chan_def *chandef)
663+
{
664+
return chandef->edmg.channels || chandef->edmg.bw_config;
665+
}
666+
593667
/**
594668
* cfg80211_chandef_compatible - check if two channel definitions are compatible
595669
* @chandef1: first channel definition
@@ -1177,15 +1251,17 @@ int cfg80211_check_station_change(struct wiphy *wiphy,
11771251
* @RATE_INFO_FLAGS_MCS: mcs field filled with HT MCS
11781252
* @RATE_INFO_FLAGS_VHT_MCS: mcs field filled with VHT MCS
11791253
* @RATE_INFO_FLAGS_SHORT_GI: 400ns guard interval
1180-
* @RATE_INFO_FLAGS_60G: 60GHz MCS
1254+
* @RATE_INFO_FLAGS_DMG: 60GHz MCS
11811255
* @RATE_INFO_FLAGS_HE_MCS: HE MCS information
1256+
* @RATE_INFO_FLAGS_EDMG: 60GHz MCS in EDMG mode
11821257
*/
11831258
enum rate_info_flags {
11841259
RATE_INFO_FLAGS_MCS = BIT(0),
11851260
RATE_INFO_FLAGS_VHT_MCS = BIT(1),
11861261
RATE_INFO_FLAGS_SHORT_GI = BIT(2),
1187-
RATE_INFO_FLAGS_60G = BIT(3),
1262+
RATE_INFO_FLAGS_DMG = BIT(3),
11881263
RATE_INFO_FLAGS_HE_MCS = BIT(4),
1264+
RATE_INFO_FLAGS_EDMG = BIT(5),
11891265
};
11901266

11911267
/**
@@ -1225,6 +1301,7 @@ enum rate_info_bw {
12251301
* @he_dcm: HE DCM value
12261302
* @he_ru_alloc: HE RU allocation (from &enum nl80211_he_ru_alloc,
12271303
* only valid if bw is %RATE_INFO_BW_HE_RU)
1304+
* @n_bonded_ch: In case of EDMG the number of bonded channels (1-4)
12281305
*/
12291306
struct rate_info {
12301307
u8 flags;
@@ -1235,6 +1312,7 @@ struct rate_info {
12351312
u8 he_gi;
12361313
u8 he_dcm;
12371314
u8 he_ru_alloc;
1315+
u8 n_bonded_ch;
12381316
};
12391317

12401318
/**
@@ -2438,6 +2516,9 @@ struct cfg80211_bss_selection {
24382516
* @fils_erp_rrk_len: Length of @fils_erp_rrk in octets.
24392517
* @want_1x: indicates user-space supports and wants to use 802.1X driver
24402518
* offload of 4-way handshake.
2519+
* @edmg: define the EDMG channels.
2520+
* This may specify multiple channels and bonding options for the driver
2521+
* to choose from, based on BSS configuration.
24412522
*/
24422523
struct cfg80211_connect_params {
24432524
struct ieee80211_channel *channel;
@@ -2471,6 +2552,7 @@ struct cfg80211_connect_params {
24712552
const u8 *fils_erp_rrk;
24722553
size_t fils_erp_rrk_len;
24732554
bool want_1x;
2555+
struct ieee80211_edmg edmg;
24742556
};
24752557

24762558
/**

‎include/uapi/linux/nl80211.h‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@
5252
#define NL80211_MULTICAST_GROUP_NAN "nan"
5353
#define NL80211_MULTICAST_GROUP_TESTMODE "testmode"
5454

55+
#define NL80211_EDMG_BW_CONFIG_MIN 4
56+
#define NL80211_EDMG_BW_CONFIG_MAX 15
57+
#define NL80211_EDMG_CHANNELS_MIN 1
58+
#define NL80211_EDMG_CHANNELS_MAX 0x3c /* 0b00111100 */
59+
5560
/**
5661
* DOC: Station handling
5762
*
@@ -2361,6 +2366,13 @@ enum nl80211_commands {
23612366
* @NL80211_ATTR_HE_OBSS_PD: nested attribute for OBSS Packet Detection
23622367
* functionality.
23632368
*
2369+
* @NL80211_ATTR_WIPHY_EDMG_CHANNELS: bitmap that indicates the 2.16 GHz
2370+
* channel(s) that are allowed to be used for EDMG transmissions.
2371+
* Defined by IEEE P802.11ay/D4.0 section 9.4.2.251. (u8 attribute)
2372+
* @NL80211_ATTR_WIPHY_EDMG_BW_CONFIG: Channel BW Configuration subfield encodes
2373+
* the allowed channel bandwidth configurations. (u8 attribute)
2374+
* Defined by IEEE P802.11ay/D4.0 section 9.4.2.251, Table 13.
2375+
*
23642376
* @NUM_NL80211_ATTR: total number of nl80211_attrs available
23652377
* @NL80211_ATTR_MAX: highest attribute number currently defined
23662378
* @__NL80211_ATTR_AFTER_LAST: internal use
@@ -2820,6 +2832,9 @@ enum nl80211_attrs {
28202832

28212833
NL80211_ATTR_HE_OBSS_PD,
28222834

2835+
NL80211_ATTR_WIPHY_EDMG_CHANNELS,
2836+
NL80211_ATTR_WIPHY_EDMG_BW_CONFIG,
2837+
28232838
/* add attributes here, update the policy in nl80211.c */
28242839

28252840
__NL80211_ATTR_AFTER_LAST,
@@ -3431,6 +3446,12 @@ enum nl80211_band_iftype_attr {
34313446
* @NL80211_BAND_ATTR_VHT_CAPA: VHT capabilities, as in the HT information IE
34323447
* @NL80211_BAND_ATTR_IFTYPE_DATA: nested array attribute, with each entry using
34333448
* attributes from &enum nl80211_band_iftype_attr
3449+
* @NL80211_BAND_ATTR_EDMG_CHANNELS: bitmap that indicates the 2.16 GHz
3450+
* channel(s) that are allowed to be used for EDMG transmissions.
3451+
* Defined by IEEE P802.11ay/D4.0 section 9.4.2.251.
3452+
* @NL80211_BAND_ATTR_EDMG_BW_CONFIG: Channel BW Configuration subfield encodes
3453+
* the allowed channel bandwidth configurations.
3454+
* Defined by IEEE P802.11ay/D4.0 section 9.4.2.251, Table 13.
34343455
* @NL80211_BAND_ATTR_MAX: highest band attribute currently defined
34353456
* @__NL80211_BAND_ATTR_AFTER_LAST: internal use
34363457
*/
@@ -3448,6 +3469,9 @@ enum nl80211_band_attr {
34483469
NL80211_BAND_ATTR_VHT_CAPA,
34493470
NL80211_BAND_ATTR_IFTYPE_DATA,
34503471

3472+
NL80211_BAND_ATTR_EDMG_CHANNELS,
3473+
NL80211_BAND_ATTR_EDMG_BW_CONFIG,
3474+
34513475
/* keep last */
34523476
__NL80211_BAND_ATTR_AFTER_LAST,
34533477
NL80211_BAND_ATTR_MAX = __NL80211_BAND_ATTR_AFTER_LAST - 1

‎net/mac80211/mlme.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,10 +158,10 @@ ieee80211_determine_chantype(struct ieee80211_sub_if_data *sdata,
158158
memcpy(&sta_ht_cap, &sband->ht_cap, sizeof(sta_ht_cap));
159159
ieee80211_apply_htcap_overrides(sdata, &sta_ht_cap);
160160

161+
memset(chandef, 0, sizeof(struct cfg80211_chan_def));
161162
chandef->chan = channel;
162163
chandef->width = NL80211_CHAN_WIDTH_20_NOHT;
163164
chandef->center_freq1 = channel->center_freq;
164-
chandef->center_freq2 = 0;
165165

166166
if (!ht_oper || !sta_ht_cap.ht_supported) {
167167
ret = IEEE80211_STA_DISABLE_HT | IEEE80211_STA_DISABLE_VHT;

‎net/mac80211/status.c‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,8 @@ static int ieee80211_tx_radiotap_len(struct ieee80211_tx_info *info,
262262
/* IEEE80211_RADIOTAP_RATE rate */
263263
if (status && status->rate && !(status->rate->flags &
264264
(RATE_INFO_FLAGS_MCS |
265-
RATE_INFO_FLAGS_60G |
265+
RATE_INFO_FLAGS_DMG |
266+
RATE_INFO_FLAGS_EDMG |
266267
RATE_INFO_FLAGS_VHT_MCS |
267268
RATE_INFO_FLAGS_HE_MCS)))
268269
len += 2;
@@ -329,7 +330,8 @@ ieee80211_add_tx_radiotap_header(struct ieee80211_local *local,
329330

330331
if (status && status->rate) {
331332
if (!(status->rate->flags & (RATE_INFO_FLAGS_MCS |
332-
RATE_INFO_FLAGS_60G |
333+
RATE_INFO_FLAGS_DMG |
334+
RATE_INFO_FLAGS_EDMG |
333335
RATE_INFO_FLAGS_VHT_MCS |
334336
RATE_INFO_FLAGS_HE_MCS)))
335337
legacy_rate = status->rate->legacy;

0 commit comments

Comments
 (0)