cfg80211: add a helper to identify 6 GHz PSCs
Subsystems (2)
Johannes Berg
maintainerRFC 1/10 cfg80211: add a helper to identify 6 GHz PSCs
From: Johannes Berg <[email protected]>
This allows identifying whether or not a channel is a PSC (preferred scanning channel).
--- include/net/cfg80211.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
include/net/cfg80211.h +15 -0
@@ -5277,6 +5277,21 @@ ieee80211_get_channel(struct wiphy *wiphy, int freq)return ieee80211_get_channel_khz (wiphy,MHZ_TO_KHZ (freq)); } +/** +* cfg80211_channel_is_psc - Check if the channel is a 6 GHz PSC +* @chan: control channel to check +* +* The Preferred Scanning Channels (PSC) are defined in +* Draft IEEE P802.11ax/D5.0, 26.17.2.3.3 +*/ +static inline bool cfg80211_channel_is_psc (struct ieee80211_channel *chan) +{ +if (chan->band !=NL80211_BAND_6GHZ ) +return false; + +return ieee80211_frequency_to_channel (chan->center_freq) %16 ==5 ; +} +/** * ieee80211_get_response_rate - get basic rate for a given rate *
Signature · 1 line
2.26.2
Johannes Berg
maintainerRFC 2/10 ieee80211: definitions for reduced neighbor reports
From: Tova Mussai <[email protected]>
Add the necessary definitions to parse reduced neighbor report elements.
--- include/linux/ieee80211.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+)
include/linux/ieee80211.h +28 -0
@@ -2754,6 +2754,8 @@ enum ieee80211_eid {WLAN_EID_QUIET_CHANNEL =198 ,WLAN_EID_OPMODE_NOTIF =199 , +WLAN_EID_REDUCED_NEIGHBOR_REPORT =201 , +WLAN_EID_S1G_BCN_COMPAT =213 ,WLAN_EID_S1G_SHORT_BCN_INTERVAL =214 , WLAN_EID_S1G_CAPABILITIES = 217,
@@ -3675,4 +3677,30 @@ static inline bool for_each_element_completed(const struct element *element,#define WLAN_RSNX_CAPA_PROTECTED_TWT BIT(4)#define WLAN_RSNX_CAPA_SAE_H2E BIT(5) +/* +* reduced neighbor report, based on Draft P802.11ax_D5.0, +* section 9.4.2.170 +*/ +#define IEEE80211_AP_INFO_TBTT_HDR_TYPE 0x03 +#define IEEE80211_AP_INFO_TBTT_HDR_FILTERED 0x04 +#define IEEE80211_AP_INFO_TBTT_HDR_COLOC 0x08 +#define IEEE80211_AP_INFO_TBTT_HDR_COUNT 0xF0 +#define IEEE80211_TBTT_INFO_OFFSET_BSSID_BSS_PARAM 8 +#define IEEE80211_TBTT_INFO_OFFSET_BSSID_SSSID_BSS_PARAM 12 + +#define IEEE80211_RNR_TBTT_PARAMS_OCT_RECOMMENDED 0x01 +#define IEEE80211_RNR_TBTT_PARAMS_SAME_SSID 0x02 +#define IEEE80211_RNR_TBTT_PARAMS_MULTI_BSSID 0x04 +#define IEEE80211_RNR_TBTT_PARAMS_TRANSMITTED_BSSID 0x08 +#define IEEE80211_RNR_TBTT_PARAMS_COLOC_ESS 0x10 +#define IEEE80211_RNR_TBTT_PARAMS_PROBE_ACTIVE 0x20 +#define IEEE80211_RNR_TBTT_PARAMS_COLOC_AP 0x40 + +struct ieee80211_neighbor_ap_info { +u8 tbtt_info_hdr; +u8 tbtt_info_len; +u8 op_class; +u8 channel; +} __packed; +#endif /* LINUX_IEEE80211_H */
Signature · 1 line
2.26.2
Johannes Berg
maintainerRFC 3/10 ieee80211: add code to obtain and parse 6 GHz operation field
In reply to Johannes BergFrom: Johannes Berg <[email protected]>
Add some code to obtain and parse the 6 GHz operation field inside the HE operation element.
While at it, fix the required length using sizeof() the new struct, which is 5 instead of 4 now.
--- include/linux/ieee80211.h | 52 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 51 insertions(+), 1 deletion(-)
include/linux/ieee80211.h +51 -1
@@ -2209,6 +2209,28 @@ ieee80211_he_ppe_size(u8 ppe_thres_hdr, const u8 *phy_cap_info)#define IEEE80211_HE_OPERATION_PARTIAL_BSS_COLOR 0x40000000#define IEEE80211_HE_OPERATION_BSS_COLOR_DISABLED 0x80000000 +/** +* ieee80211_he_6ghz_oper - HE 6 GHz operation Information field +* @primary: primary channel +* @control: control flags +* @ccfs0: channel center frequency segment 0 +* @ccfs1: channel center frequency segment 1 +* @minrate: minimum rate (in 1 Mbps units) +*/ +struct ieee80211_he_6ghz_oper { +u8 primary; +#define IEEE80211_HE_6GHZ_OPER_CTRL_CHANWIDTH 0x3 +#define IEEE80211_HE_6GHZ_OPER_CTRL_CHANWIDTH_20MHZ 0 +#define IEEE80211_HE_6GHZ_OPER_CTRL_CHANWIDTH_40MHZ 1 +#define IEEE80211_HE_6GHZ_OPER_CTRL_CHANWIDTH_80MHZ 2 +#define IEEE80211_HE_6GHZ_OPER_CTRL_CHANWIDTH_160MHZ 3 +#define IEEE80211_HE_6GHZ_OPER_CTRL_DUP_BEACON 0x4 +u8 control; +u8 ccfs0; +u8 ccfs1; +u8 minrate; +} __packed; +/* * ieee80211_he_oper_size - calculate 802.11ax HE Operations IE size * @he_oper_ie: byte data of the He Operations IE, stating from the byte
@@ -2235,7 +2257,7 @@ ieee80211_he_oper_size(const u8 *he_oper_ie)if (he_oper_params &IEEE80211_HE_OPERATION_CO_HOSTED_BSS ) oper_len++;if (he_oper_params &IEEE80211_HE_OPERATION_6GHZ_OP_INFO ) - oper_len +=4 ; + oper_len +=sizeof (struct ieee80211_he_6ghz_oper );/* Add the first byte (extension ID) to the total length */ oper_len++;
@@ -2359,6 +2381,34 @@ ieee80211_he_spr_size(const u8 *he_spr_ie)#define S1G_CAPAB_B9_LINK_ADAPT_PER_CONTROL_RESPONSE BIT(0) +/** +* ieee80211_he_6ghz_oper - obtain 6 GHz operation field +* @he_oper: HE operation element (must be pre-validated for size) +* but may be %NULL +* +* Return: a pointer to the 6 GHz operation field, or %NULL +*/ +static inline const struct ieee80211_he_6ghz_oper * +ieee80211_he_6ghz_oper (const struct ieee80211_he_operation *he_oper) +{ +const u8 *ret = (void *)&he_oper->optional; +u32 he_oper_params; + +if (!he_oper) +return NULL ; + + he_oper_params =le32_to_cpu (he_oper->he_oper_params); + +if (!(he_oper_params &IEEE80211_HE_OPERATION_6GHZ_OP_INFO )) +return NULL ; +if (he_oper_params &IEEE80211_HE_OPERATION_VHT_OPER_INFO ) + ret +=3 ; +if (he_oper_params &IEEE80211_HE_OPERATION_CO_HOSTED_BSS ) + ret++; + +return (void *)ret; +} +/* Authentication algorithms */ #define WLAN_AUTH_OPEN 0#define WLAN_AUTH_SHARED_KEY 1
Signature · 1 line
2.26.2
Johannes Berg
maintainerRFC 4/10 ieee80211: add HE ext EIDs and 6 GHz capability defines
In reply to Johannes BergFrom: Johannes Berg <[email protected]>
Add the HE extended element IDs and the definitions for the HE 6 GHz band capabilities element, from Draft 5.0.
--- include/linux/ieee80211.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+)
include/linux/ieee80211.h +28 -0
@@ -2839,9 +2839,19 @@ enum ieee80211_eid_ext {WLAN_EID_EXT_UORA =37 ,WLAN_EID_EXT_HE_MU_EDCA =38 ,WLAN_EID_EXT_HE_SPR =39 , +WLAN_EID_EXT_NDP_FEEDBACK_REPORT_PARAMSET =41 , +WLAN_EID_EXT_BSS_COLOR_CHG_ANN =42 , +WLAN_EID_EXT_QUIET_TIME_PERIOD_SETUP =43 , +WLAN_EID_EXT_ESS_REPORT =45 , +WLAN_EID_EXT_OPS =46 , +WLAN_EID_EXT_HE_BSS_LOAD =47 ,WLAN_EID_EXT_MAX_CHANNEL_SWITCH_TIME =52 ,WLAN_EID_EXT_MULTIPLE_BSSID_CONFIGURATION =55 ,WLAN_EID_EXT_NON_INHERITANCE =56 , +WLAN_EID_EXT_KNOWN_BSSID =57 , +WLAN_EID_EXT_SHORT_SSID_LIST =58 , +WLAN_EID_EXT_HE_6GHZ_CAPA =59 , + WLAN_EID_EXT_UL_MU_POWER_CAPA = 60, };/* Action category code */
@@ -3384,6 +3394,24 @@ struct ieee80211_tspec_ie {__le16 medium_time; } __packed; +struct ieee80211_he_6ghz_capa { +/* uses IEEE80211_HE_6GHZ_CAP_* below */ +__le16 capa; +} __packed; + +/* HE 6 GHz band capabilities */ +/* uses enum ieee80211_min_mpdu_spacing values */ +#define IEEE80211_HE_6GHZ_CAP_MIN_MPDU_START 0x0007 +/* uses enum ieee80211_vht_max_ampdu_length_exp values */ +#define IEEE80211_HE_6GHZ_CAP_MAX_AMPDU_LEN_EXP 0x0038 +/* uses IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_* values */ +#define IEEE80211_HE_6GHZ_CAP_MAX_MPDU_LEN 0x00c0 +/* WLAN_HT_CAP_SM_PS_* values */ +#define IEEE80211_HE_6GHZ_CAP_SM_PS 0x0600 +#define IEEE80211_HE_6GHZ_CAP_RD_RESPONDER 0x0800 +#define IEEE80211_HE_6GHZ_CAP_RX_ANTPAT_CONS 0x1000 +#define IEEE80211_HE_6GHZ_CAP_TX_ANTPAT_CONS 0x2000 +/** * ieee80211_get_qos_ctl - get pointer to qos control bytes * @hdr: the frame
Signature · 1 line
2.26.2
Johannes Berg
maintainerRFC 5/10 cfg80211: handle 6 GHz capability of new station
In reply to Johannes BergFrom: Rajkumar Manoharan <[email protected]>
Handle 6 GHz HE capability while adding new station. It will be used later in mac80211 station processing.
[handle nl80211_set_station, require WME,
remove NL80211_HE_6GHZ_CAPABILITY_LEN]
--- include/net/cfg80211.h | 2 ++ include/uapi/linux/nl80211.h | 5 +++++ net/wireless/nl80211.c | 18 +++++++++++++++++- 3 files changed, 24 insertions(+), 1 deletion(-)
include/net/cfg80211.h +2 -0
@@ -1238,6 +1238,7 @@ struct sta_txpwr {* @he_capa_len: the length of the HE capabilities * @airtime_weight: airtime scheduler weight for this station * @txpwr: transmit power for an associated station +* @he_6ghz_capa: HE 6 GHz Band capabilities of station */ struct station_parameters {const u8 *supported_rates;
@@ -1270,6 +1271,7 @@ struct station_parameters {u8 he_capa_len;u16 airtime_weight;struct sta_txpwr txpwr; +const struct ieee80211_he_6ghz_capa *he_6ghz_capa; };/**
include/uapi/linux/nl80211.h +5 -0
@@ -2502,6 +2502,9 @@ enum nl80211_commands {* first channel segment specified in %NL80211_ATTR_CENTER_FREQ1. * @NL80211_ATTR_SCAN_FREQ_KHZ: nested attribute with KHz frequencies * +* @NL80211_ATTR_HE_6GHZ_CAPABILITY: HE 6 GHz Band Capability element (from +* association request when used with NL80211_CMD_NEW_STATION). +* * @NUM_NL80211_ATTR: total number of nl80211_attrs available * @NL80211_ATTR_MAX: highest attribute number currently defined * @__NL80211_ATTR_AFTER_LAST: internal use
@@ -2982,6 +2985,8 @@ enum nl80211_attrs {NL80211_ATTR_CENTER_FREQ1_OFFSET ,NL80211_ATTR_SCAN_FREQ_KHZ , +NL80211_ATTR_HE_6GHZ_CAPABILITY , +/* add attributes here, update the policy in nl80211.c */ __NL80211_ATTR_AFTER_LAST,
net/wireless/nl80211.c +17 -1
@@ -654,6 +654,10 @@ static const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = { [NL80211_ATTR_RECEIVE_MULTICAST] = { .type = NLA_FLAG }, [NL80211_ATTR_WIPHY_FREQ_OFFSET] = NLA_POLICY_RANGE(NLA_U32, 0, 999), [NL80211_ATTR_SCAN_FREQ_KHZ] = { .type = NLA_NESTED }, + [NL80211_ATTR_HE_6GHZ_CAPABILITY ] = { + .type =NLA_EXACT_LEN , + .len =sizeof (struct ieee80211_he_6ghz_capa ), + }, };/* policy for the key attributes */
@@ -5989,6 +5993,10 @@ static int nl80211_set_station(struct sk_buff *skb, struct genl_info *info)nla_get_u8 (info->attrs[NL80211_ATTR_OPMODE_NOTIF ]); } +if (info->attrs[NL80211_ATTR_HE_6GHZ_CAPABILITY ]) + params.he_6ghz_capa = +nla_data (info->attrs[NL80211_ATTR_HE_CAPABILITY ]); +if (info->attrs[NL80211_ATTR_AIRTIME_WEIGHT ]) params.airtime_weight =nla_get_u16 (info->attrs[NL80211_ATTR_AIRTIME_WEIGHT ]);
@@ -6123,6 +6131,10 @@ static int nl80211_new_station(struct sk_buff *skb, struct genl_info *info)return -EINVAL ; } +if (info->attrs[NL80211_ATTR_HE_6GHZ_CAPABILITY ]) + params.he_6ghz_capa = +nla_data (info->attrs[NL80211_ATTR_HE_6GHZ_CAPABILITY ]); +if (info->attrs[NL80211_ATTR_OPMODE_NOTIF ]) { params.opmode_notif_used = true; params.opmode_notif =
@@ -6167,10 +6179,14 @@ static int nl80211_new_station(struct sk_buff *skb, struct genl_info *info) params.vht_capa =NULL ;/* HE requires WME */ -if (params.he_capa_len) +if (params.he_capa_len || params.he_6ghz_capa)return -EINVAL ; } +/* Ensure that HT/VHT capabilities are not set for 6 GHz HE STA */ +if (params.he_6ghz_capa && (params.ht_capa || params.vht_capa)) +return -EINVAL ; +/* When you run into this, adjust the code below for the new flag */ BUILD_BUG_ON (NL80211_STA_FLAG_MAX !=7 );
Signature · 1 line
2.26.2
Johannes Berg
maintainerRFC 6/10 mac80211: add HE 6 GHz Band Capabilities into parse extension
In reply to Johannes BergFrom: Rajkumar Manoharan <[email protected]>
Handle 6 GHz band capability element parsing for association.
--- net/mac80211/ieee80211_i.h | 1 + net/mac80211/util.c | 4 ++++ 2 files changed, 5 insertions(+)
net/mac80211/ieee80211_i.h +1 -0
@@ -1494,6 +1494,7 @@ struct ieee802_11_elems {const struct ieee80211_he_operation *he_operation;const struct ieee80211_he_spr *he_spr;const struct ieee80211_mu_edca_param_set *mu_edca_param_set; +const struct ieee80211_he_6ghz_capa *he_6ghz_capa;const u8 *uora_element;const u8 *mesh_id;const u8 *peering;
net/mac80211/util.c +4 -0
@@ -936,6 +936,10 @@ static void ieee80211_parse_extension_element(u32 *crc, len >= ieee80211_he_spr_size(data)) elems->he_spr = data;break ; +case WLAN_EID_EXT_HE_6GHZ_CAPA : +if (len ==sizeof (*elems->he_6ghz_capa)) + elems->he_6ghz_capa = data; +break ; } }
Signature · 1 line
2.26.2
Johannes Berg
maintainerRFC 7/10 cfg80211: add and expose HE 6 GHz band capabilities
In reply to Johannes BergFrom: Johannes Berg <[email protected]>
These capabilities cover what would otherwise be transported in HT/VHT capabilities, but only a subset thereof that is actually needed on 6 GHz with HE already present. Expose the capabilities to userspace, drivers are expected to set them as using the 6 GHz band (currently) requires HE capability.
--- include/net/cfg80211.h | 3 +++ include/uapi/linux/nl80211.h | 3 +++ net/wireless/nl80211.c | 9 ++++++++- 3 files changed, 14 insertions(+), 1 deletion(-)
include/net/cfg80211.h +3 -0
@@ -354,10 +354,13 @@ struct ieee80211_sta_he_cap {* * @types_mask: interface types mask * @he_cap: holds the HE capabilities +* @he_6ghz_capa: HE 6 GHz capabilities, must be filled in for a +* 6 GHz band channel (and 0 may be valid value). */ struct ieee80211_sband_iftype_data {u16 types_mask;struct ieee80211_sta_he_cap he_cap; +struct ieee80211_he_6ghz_capa he_6ghz_capa; };/**
include/uapi/linux/nl80211.h +3 -0
@@ -3565,6 +3565,8 @@ enum nl80211_mpath_info {* defined in HE capabilities IE * @NL80211_BAND_IFTYPE_ATTR_MAX: highest band HE capability attribute currently * defined +* @NL80211_BAND_IFTYPE_ATTR_HE_6GHZ_CAPA: HE 6GHz band capabilities (u16), +* given for all 6 GHz band channels * @__NL80211_BAND_IFTYPE_ATTR_AFTER_LAST: internal use */ enum nl80211_band_iftype_attr {
@@ -3575,6 +3577,7 @@ enum nl80211_band_iftype_attr {NL80211_BAND_IFTYPE_ATTR_HE_CAP_PHY ,NL80211_BAND_IFTYPE_ATTR_HE_CAP_MCS_SET ,NL80211_BAND_IFTYPE_ATTR_HE_CAP_PPE , +NL80211_BAND_IFTYPE_ATTR_HE_6GHZ_CAPA ,/* keep last */ __NL80211_BAND_IFTYPE_ATTR_AFTER_LAST,
net/wireless/nl80211.c +8 -1
@@ -1562,6 +1562,7 @@ static int nl80211_send_coalesce(struct sk_buff *msg,static int nl80211_send_iftype_data (struct sk_buff *msg, +const struct ieee80211_supported_band *sband,const struct ieee80211_sband_iftype_data *iftdata) {const struct ieee80211_sta_he_cap *he_cap = &iftdata->he_cap;
@@ -1585,6 +1586,12 @@ nl80211_send_iftype_data(struct sk_buff *msg,return -ENOBUFS ; } +if (sband->band ==NL80211_BAND_6GHZ && +nla_put (msg,NL80211_BAND_IFTYPE_ATTR_HE_6GHZ_CAPA , +sizeof (iftdata->he_6ghz_capa), + &iftdata->he_6ghz_capa)) +return -ENOBUFS ; +return 0 ; }
@@ -1633,7 +1640,7 @@ static int nl80211_send_band_rateinfo(struct sk_buff *msg,if (!iftdata)return -ENOBUFS ; - err =nl80211_send_iftype_data (msg, + err =nl80211_send_iftype_data (msg, sband, &sband->iftype_data[i]);if (err)return err;
Signature · 1 line
2.26.2
Johannes Berg
maintainerRFC 8/10 mac80211: add HE 6 GHz Band Capability element
In reply to Johannes BergFrom: Rajkumar Manoharan <[email protected]>
Construct HE 6 GHz band capability element (IEEE 802.11ax/D6.0, 9.4.2.261) for association request and mesh beacon. The 6 GHz capability information is passed by driver through iftypes caps.
[handle SMPS, adjust for previous patches, reserve SKB space properly,
change to handle SKB directly]
--- net/mac80211/ieee80211_i.h | 2 ++ net/mac80211/mesh.c | 9 +++++++ net/mac80211/mesh.h | 2 ++ net/mac80211/mesh_plink.c | 4 +++- net/mac80211/mlme.c | 3 +++ net/mac80211/util.c | 48 ++++++++++++++++++++++++++++++++++++++ 6 files changed, 67 insertions(+), 1 deletion(-)
net/mac80211/ieee80211_i.h +2 -0
@@ -2177,6 +2177,8 @@ u8 ieee80211_ie_len_he_cap(struct ieee80211_sub_if_data *sdata, u8 iftype);u8 *ieee80211_ie_build_he_cap (u8 *pos,const struct ieee80211_sta_he_cap *he_cap,u8 *end); +void ieee80211_ie_build_he_6ghz_cap (struct ieee80211_sub_if_data *sdata, +struct sk_buff *skb);u8 *ieee80211_ie_build_he_oper (u8 *pos); int ieee80211_parse_bitrates(struct cfg80211_chan_def *chandef, const struct ieee80211_supported_band *sband,
net/mac80211/mesh.c +9 -0
@@ -587,6 +587,13 @@ int mesh_add_he_oper_ie(struct ieee80211_sub_if_data *sdata,return 0 ; } +int mesh_add_he_6ghz_cap_ie (struct ieee80211_sub_if_data *sdata, +struct sk_buff *skb) +{ +ieee80211_ie_build_he_6ghz_cap (sdata, skb); +return 0 ; +} +static void ieee80211_mesh_path_timer (struct timer_list *t) { struct ieee80211_sub_if_data *sdata =
@@ -766,6 +773,7 @@ ieee80211_mesh_build_beacon(struct ieee80211_if_mesh *ifmsh)2 +sizeof (struct ieee80211_vht_operation ) + ie_len_he_cap +2 +1 +sizeof (struct ieee80211_he_operation ) + +2 +1 +sizeof (struct ieee80211_he_6ghz_capa ) + ifmsh->ie_len; bcn =kzalloc (sizeof (*bcn) + head_len + tail_len,GFP_KERNEL );
@@ -885,6 +893,7 @@ ieee80211_mesh_build_beacon(struct ieee80211_if_mesh *ifmsh)mesh_add_vht_oper_ie (sdata, skb) ||mesh_add_he_cap_ie (sdata, skb, ie_len_he_cap) ||mesh_add_he_oper_ie (sdata, skb) || +mesh_add_he_6ghz_cap_ie (sdata, skb) || mesh_add_vendor_ies(sdata, skb)) goto out_free;
net/mac80211/mesh.h +2 -0
@@ -222,6 +222,8 @@ int mesh_add_he_cap_ie(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb, u8 ie_len);int mesh_add_he_oper_ie (struct ieee80211_sub_if_data *sdata,struct sk_buff *skb); +int mesh_add_he_6ghz_cap_ie (struct ieee80211_sub_if_data *sdata, +struct sk_buff *skb);void mesh_rmc_free (struct ieee80211_sub_if_data *sdata);int mesh_rmc_init (struct ieee80211_sub_if_data *sdata);void ieee80211s_init (void );
net/mac80211/mesh_plink.c +3 -1
@@ -238,6 +238,7 @@ static int mesh_plink_frame_tx(struct ieee80211_sub_if_data *sdata,2 +sizeof (struct ieee80211_vht_operation ) + ie_len_he_cap +2 +1 +sizeof (struct ieee80211_he_operation ) + +2 +1 +sizeof (struct ieee80211_he_6ghz_capa ) +2 +8 +/* peering IE */ sdata->u.mesh.ie_len);if (!skb)
@@ -328,7 +329,8 @@ static int mesh_plink_frame_tx(struct ieee80211_sub_if_data *sdata,mesh_add_vht_cap_ie (sdata, skb) ||mesh_add_vht_oper_ie (sdata, skb) ||mesh_add_he_cap_ie (sdata, skb, ie_len_he_cap) || - mesh_add_he_oper_ie(sdata, skb)) +mesh_add_he_oper_ie (sdata, skb) || + mesh_add_he_6ghz_cap_ie(sdata, skb)) goto free; }
net/mac80211/mlme.c +3 -0
@@ -658,6 +658,8 @@ static void ieee80211_add_he_ie(struct ieee80211_sub_if_data *sdata, he_cap->he_cap_elem.phy_cap_info); pos =skb_put (skb, he_cap_size);ieee80211_ie_build_he_cap (pos, he_cap, pos + he_cap_size); + +ieee80211_ie_build_he_6ghz_cap (sdata, skb); }static void ieee80211_send_assoc (struct ieee80211_sub_if_data *sdata)
@@ -731,6 +733,7 @@ static void ieee80211_send_assoc(struct ieee80211_sub_if_data *sdata)2 +1 +sizeof (struct ieee80211_he_cap_elem ) +/* HE */ sizeof (struct ieee80211_he_mcs_nss_supp ) +IEEE80211_HE_PPE_THRES_MAX_LEN + +2 +1 +sizeof (struct ieee80211_he_6ghz_capa ) + assoc_data->ie_len +/* extra IEs */ (assoc_data->fils_kek_len ?16 /* AES-SIV */ :0 ) + 9, /* WMM */
net/mac80211/util.c +48 -0
54 lines not on this page · raw message
Signature · 1 line
2.26.2
Johannes Berg
maintainerRe: [RFC 08/10] mac80211: add HE 6 GHz Band Capability element
net/mac80211/util.c u8 *ieee80211_ie_build_he_cap(u8 *pos, · line 2852
Quoted 12 lines · Johannes Berg
net/mac80211/util.c +11
-0+void ieee80211_ie_build_he_6ghz_cap (struct ieee80211_sub_if_data *sdata, +struct sk_buff *skb) +{ +struct ieee80211_local *local = sdata->local; +struct ieee80211_supported_band *sband; +const struct ieee80211_sband_iftype_data *iftd; +enum nl80211_iftype iftype =ieee80211_vif_type_p2p (&sdata->vif); +u8 *pos; +u16 cap; + + sband = local->hw.wiphy->bands[NL80211_BAND_6GHZ ];
Err, no. Of course I need to use ieee80211_get_sband() like you did.
johannes
Johannes Berg
maintainerRFC 9/10 mac80211: build HE operation with 6 GHz oper information
In reply to Johannes BergFrom: Rajkumar Manoharan <[email protected]>
Add 6 GHz operation information (IEEE 802.11ax/D6.0, Figure 9-787k) while building HE operation element for non-HE AP. This field is used to determine channel information in the absence of HT/VHT IEs.
--- net/mac80211/ieee80211_i.h | 2 +- net/mac80211/mesh.c | 12 ++++++-- net/mac80211/mesh_plink.c | 1 + net/mac80211/util.c | 63 +++++++++++++++++++++++++++++++++++--- 4 files changed, 70 insertions(+), 8 deletions(-)
net/mac80211/ieee80211_i.h +1 -1
@@ -2179,7 +2179,7 @@ u8 *ieee80211_ie_build_he_cap(u8 *pos, u8 *end);void ieee80211_ie_build_he_6ghz_cap (struct ieee80211_sub_if_data *sdata,struct sk_buff *skb); -u8 *ieee80211_ie_build_he_oper (u8 *pos); +u8 *ieee80211_ie_build_he_oper (u8 *pos,struct cfg80211_chan_def *chandef);int ieee80211_parse_bitrates (struct cfg80211_chan_def *chandef,const struct ieee80211_supported_band *sband,const u8 *srates,int srates_len,u32 *rates);
net/mac80211/mesh.c +9 -3
@@ -565,6 +565,7 @@ int mesh_add_he_oper_ie(struct ieee80211_sub_if_data *sdata, {const struct ieee80211_sta_he_cap *he_cap;struct ieee80211_supported_band *sband; +u32 len;u8 *pos; sband =ieee80211_get_sband (sdata);
@@ -578,11 +579,15 @@ int mesh_add_he_oper_ie(struct ieee80211_sub_if_data *sdata, sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_10)return 0 ; -if (skb_tailroom (skb) <2 +1 +sizeof (struct ieee80211_he_operation )) + len =2 +1 +sizeof (struct ieee80211_he_operation ); +if (sdata->vif.bss_conf.chandef.chan->band ==NL80211_BAND_6GHZ ) + len +=sizeof (struct ieee80211_he_oper_6ghz_op_info ); + +if (skb_tailroom (skb) < len)return -ENOMEM ; - pos =skb_put (skb,2 +1 +sizeof (struct ieee80211_he_operation )); -ieee80211_ie_build_he_oper (pos); + pos =skb_put (skb, len); +ieee80211_ie_build_he_oper (pos, &sdata->vif.bss_conf.chandef);return 0 ; }
@@ -773,6 +778,7 @@ ieee80211_mesh_build_beacon(struct ieee80211_if_mesh *ifmsh)2 +sizeof (struct ieee80211_vht_operation ) + ie_len_he_cap +2 +1 +sizeof (struct ieee80211_he_operation ) + +sizeof (struct ieee80211_he_oper_6ghz_op_info ) +2 +1 +sizeof (struct ieee80211_he_6ghz_capa ) + ifmsh->ie_len;
net/mac80211/mesh_plink.c +1 -0
@@ -238,6 +238,7 @@ static int mesh_plink_frame_tx(struct ieee80211_sub_if_data *sdata,2 +sizeof (struct ieee80211_vht_operation ) + ie_len_he_cap +2 +1 +sizeof (struct ieee80211_he_operation ) + +sizeof (struct ieee80211_he_oper_6ghz_op_info ) +2 +1 +sizeof (struct ieee80211_he_6ghz_capa ) +2 +8 +/* peering IE */ sdata->u.mesh.ie_len);
net/mac80211/util.c +59 -4
88 lines not on this page · raw message
Signature · 1 line
2.26.2
Johannes Berg
maintainerRFC PATCH v2 1/1 mac80211: build HE operation with 6 GHz oper information
From: Rajkumar Manoharan <[email protected]>
Add 6 GHz operation information (IEEE 802.11ax/D6.0, Figure 9-787k) while building HE operation element for non-HE AP. This field is used to determine channel information in the absence of HT/VHT IEs.
--- net/mac80211/ieee80211_i.h | 2 +- net/mac80211/mesh.c | 12 +++++-- net/mac80211/mesh_plink.c | 1 + net/mac80211/util.c | 65 +++++++++++++++++++++++++++++++++++--- 4 files changed, 72 insertions(+), 8 deletions(-)
net/mac80211/ieee80211_i.h +1 -1
@@ -2179,7 +2179,7 @@ u8 *ieee80211_ie_build_he_cap(u8 *pos, u8 *end);void ieee80211_ie_build_he_6ghz_cap (struct ieee80211_sub_if_data *sdata,struct sk_buff *skb); -u8 *ieee80211_ie_build_he_oper (u8 *pos); +u8 *ieee80211_ie_build_he_oper (u8 *pos,struct cfg80211_chan_def *chandef);int ieee80211_parse_bitrates (struct cfg80211_chan_def *chandef,const struct ieee80211_supported_band *sband,const u8 *srates,int srates_len,u32 *rates);
net/mac80211/mesh.c +9 -3
@@ -565,6 +565,7 @@ int mesh_add_he_oper_ie(struct ieee80211_sub_if_data *sdata, {const struct ieee80211_sta_he_cap *he_cap;struct ieee80211_supported_band *sband; +u32 len;u8 *pos; sband =ieee80211_get_sband (sdata);
@@ -578,11 +579,15 @@ int mesh_add_he_oper_ie(struct ieee80211_sub_if_data *sdata, sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_10)return 0 ; -if (skb_tailroom (skb) <2 +1 +sizeof (struct ieee80211_he_operation )) + len =2 +1 +sizeof (struct ieee80211_he_operation ); +if (sdata->vif.bss_conf.chandef.chan->band ==NL80211_BAND_6GHZ ) + len +=sizeof (struct ieee80211_he_6ghz_oper ); + +if (skb_tailroom (skb) < len)return -ENOMEM ; - pos =skb_put (skb,2 +1 +sizeof (struct ieee80211_he_operation )); -ieee80211_ie_build_he_oper (pos); + pos =skb_put (skb, len); +ieee80211_ie_build_he_oper (pos, &sdata->vif.bss_conf.chandef);return 0 ; }
@@ -773,6 +778,7 @@ ieee80211_mesh_build_beacon(struct ieee80211_if_mesh *ifmsh)2 +sizeof (struct ieee80211_vht_operation ) + ie_len_he_cap +2 +1 +sizeof (struct ieee80211_he_operation ) + +sizeof (struct ieee80211_he_6ghz_oper ) +2 +1 +sizeof (struct ieee80211_he_6ghz_capa ) + ifmsh->ie_len;
net/mac80211/mesh_plink.c +1 -0
@@ -238,6 +238,7 @@ static int mesh_plink_frame_tx(struct ieee80211_sub_if_data *sdata,2 +sizeof (struct ieee80211_vht_operation ) + ie_len_he_cap +2 +1 +sizeof (struct ieee80211_he_operation ) + +sizeof (struct ieee80211_he_6ghz_oper ) +2 +1 +sizeof (struct ieee80211_he_6ghz_capa ) +2 +8 +/* peering IE */ sdata->u.mesh.ie_len);
net/mac80211/util.c +61 -4
90 lines not on this page · raw message
Signature · 1 line
2.26.2
kbuild test robot
build botRe: [RFC 09/10] mac80211: build HE operation with 6 GHz oper information
In reply to Johannes Berg[if your patch is applied to the wrong git tree, please drop us a note to help improve the system. BTW, we also suggest to use '--base' option to specify the base tree in git format-patch, please…
Hi Johannes,
[FYI, it's a private test report for your RFC patch.]
[auto build test ERROR on mac80211-next/master]
[also build test ERROR on next-20200528]
[cannot apply to mac80211/master v5.7-rc7]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system. BTW, we also suggest to use '--base' option to specify the base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/Johannes-Berg/cfg80211-add-a-helper-to-identify-6-GHz-PSCs/20200528-174914 base: https://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next.git master config: x86_64-allyesconfig (attached as .config) compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 2d068e534f1671459e1b135852c1b3c10502e929)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
All errors (new ones prefixed by >>, old ones prefixed by <<):
>> net/mac80211/util.c:3021:13: error: invalid application of 'sizeof' to an incomplete type 'struct ieee80211_he_oper_6ghz_op_info'
ie_len += sizeof(struct ieee80211_he_oper_6ghz_op_info);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~net/mac80211/util.c:3016:9: note: forward declaration of 'struct ieee80211_he_oper_6ghz_op_info' struct ieee80211_he_oper_6ghz_op_info *he_6ghz_op;
^
>> net/mac80211/util.c:3050:12: error: incomplete definition of type 'struct ieee80211_he_oper_6ghz_op_info'
he_6ghz_op->min_rate = 6; /* 6 Mbps */
~~~~~~~~~~^net/mac80211/util.c:3016:9: note: forward declaration of 'struct ieee80211_he_oper_6ghz_op_info' struct ieee80211_he_oper_6ghz_op_info *he_6ghz_op;
^net/mac80211/util.c:3051:12: error: incomplete definition of type 'struct ieee80211_he_oper_6ghz_op_info' he_6ghz_op->primary_chan =
~~~~~~~~~~^net/mac80211/util.c:3016:9: note: forward declaration of 'struct ieee80211_he_oper_6ghz_op_info' struct ieee80211_he_oper_6ghz_op_info *he_6ghz_op;
^net/mac80211/util.c:3053:12: error: incomplete definition of type 'struct ieee80211_he_oper_6ghz_op_info' he_6ghz_op->center_freq_seg0_idx =
~~~~~~~~~~^net/mac80211/util.c:3016:9: note: forward declaration of 'struct ieee80211_he_oper_6ghz_op_info' struct ieee80211_he_oper_6ghz_op_info *he_6ghz_op;
^net/mac80211/util.c:3056:13: error: incomplete definition of type 'struct ieee80211_he_oper_6ghz_op_info' he_6ghz_op->center_freq_seg1_idx =
~~~~~~~~~~^net/mac80211/util.c:3016:9: note: forward declaration of 'struct ieee80211_he_oper_6ghz_op_info' struct ieee80211_he_oper_6ghz_op_info *he_6ghz_op;
^net/mac80211/util.c:3059:13: error: incomplete definition of type 'struct ieee80211_he_oper_6ghz_op_info' he_6ghz_op->center_freq_seg1_idx = 0;
~~~~~~~~~~^net/mac80211/util.c:3016:9: note: forward declaration of 'struct ieee80211_he_oper_6ghz_op_info' struct ieee80211_he_oper_6ghz_op_info *he_6ghz_op;
^net/mac80211/util.c:3066:13: error: incomplete definition of type 'struct ieee80211_he_oper_6ghz_op_info' he_6ghz_op->control =
~~~~~~~~~~^net/mac80211/util.c:3016:9: note: forward declaration of 'struct ieee80211_he_oper_6ghz_op_info' struct ieee80211_he_oper_6ghz_op_info *he_6ghz_op;
^
>> net/mac80211/util.c:3067:4: error: use of undeclared identifier 'IEEE80211_HE_6GHZ_CHANWIDTH_160MHZ_80P80MHZ'; did you mean 'IEEE80211_VHT_CHANWIDTH_80P80MHZ'?
IEEE80211_HE_6GHZ_CHANWIDTH_160MHZ_80P80MHZ;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~IEEE80211_VHT_CHANWIDTH_80P80MHZinclude/linux/ieee80211.h:1692:2: note: 'IEEE80211_VHT_CHANWIDTH_80P80MHZ' declared hereIEEE80211_VHT_CHANWIDTH_80P80MHZ = 3,
^net/mac80211/util.c:3068:13: error: incomplete definition of type 'struct ieee80211_he_oper_6ghz_op_info' he_6ghz_op->center_freq_seg1_idx =
~~~~~~~~~~^net/mac80211/util.c:3016:9: note: forward declaration of 'struct ieee80211_he_oper_6ghz_op_info'
struct ieee80211_he_oper_6ghz_op_info *he_6ghz_op;
^net/mac80211/util.c:3069:14: error: incomplete definition of type 'struct ieee80211_he_oper_6ghz_op_info' he_6ghz_op->center_freq_seg0_idx;
~~~~~~~~~~^net/mac80211/util.c:3016:9: note: forward declaration of 'struct ieee80211_he_oper_6ghz_op_info'
struct ieee80211_he_oper_6ghz_op_info *he_6ghz_op;
^net/mac80211/util.c:3071:14: error: incomplete definition of type 'struct ieee80211_he_oper_6ghz_op_info' he_6ghz_op->center_freq_seg0_idx -= 8;
~~~~~~~~~~^net/mac80211/util.c:3016:9: note: forward declaration of 'struct ieee80211_he_oper_6ghz_op_info'
struct ieee80211_he_oper_6ghz_op_info *he_6ghz_op;
^net/mac80211/util.c:3073:14: error: incomplete definition of type 'struct ieee80211_he_oper_6ghz_op_info' he_6ghz_op->center_freq_seg0_idx += 8;
~~~~~~~~~~^net/mac80211/util.c:3016:9: note: forward declaration of 'struct ieee80211_he_oper_6ghz_op_info'
struct ieee80211_he_oper_6ghz_op_info *he_6ghz_op;
^net/mac80211/util.c:3076:13: error: incomplete definition of type 'struct ieee80211_he_oper_6ghz_op_info'he_6ghz_op->control =
~~~~~~~~~~^net/mac80211/util.c:3016:9: note: forward declaration of 'struct ieee80211_he_oper_6ghz_op_info'
struct ieee80211_he_oper_6ghz_op_info *he_6ghz_op;
^net/mac80211/util.c:3077:4: error: use of undeclared identifier 'IEEE80211_HE_6GHZ_CHANWIDTH_160MHZ_80P80MHZ'; did you mean 'IEEE80211_VHT_CHANWIDTH_80P80MHZ'? IEEE80211_HE_6GHZ_CHANWIDTH_160MHZ_80P80MHZ;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~IEEE80211_VHT_CHANWIDTH_80P80MHZinclude/linux/ieee80211.h:1692:2: note: 'IEEE80211_VHT_CHANWIDTH_80P80MHZ' declared hereIEEE80211_VHT_CHANWIDTH_80P80MHZ = 3,
^net/mac80211/util.c:3080:13: error: incomplete definition of type 'struct ieee80211_he_oper_6ghz_op_info'he_6ghz_op->control = IEEE80211_HE_6GHZ_CHANWIDTH_80MHZ;
~~~~~~~~~~^net/mac80211/util.c:3016:9: note: forward declaration of 'struct ieee80211_he_oper_6ghz_op_info'
struct ieee80211_he_oper_6ghz_op_info *he_6ghz_op;
^
>> net/mac80211/util.c:3080:25: error: use of undeclared identifier 'IEEE80211_HE_6GHZ_CHANWIDTH_80MHZ'; did you mean 'IEEE80211_VHT_CHANWIDTH_80MHZ'?
he_6ghz_op->control = IEEE80211_HE_6GHZ_CHANWIDTH_80MHZ; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~IEEE80211_VHT_CHANWIDTH_80MHZinclude/linux/ieee80211.h:1690:2: note: 'IEEE80211_VHT_CHANWIDTH_80MHZ' declared hereIEEE80211_VHT_CHANWIDTH_80MHZ = 1,
^net/mac80211/util.c:3083:13: error: incomplete definition of type 'struct ieee80211_he_oper_6ghz_op_info' he_6ghz_op->control = IEEE80211_HE_6GHZ_CHANWIDTH_40MHZ;
~~~~~~~~~~^net/mac80211/util.c:3016:9: note: forward declaration of 'struct ieee80211_he_oper_6ghz_op_info' struct ieee80211_he_oper_6ghz_op_info *he_6ghz_op;
^
>> net/mac80211/util.c:3083:25: error: use of undeclared identifier 'IEEE80211_HE_6GHZ_CHANWIDTH_40MHZ'
he_6ghz_op->control = IEEE80211_HE_6GHZ_CHANWIDTH_40MHZ;
^net/mac80211/util.c:3086:13: error: incomplete definition of type 'struct ieee80211_he_oper_6ghz_op_info' he_6ghz_op->control = IEEE80211_HE_6GHZ_CHANWIDTH_20MHZ;
~~~~~~~~~~^net/mac80211/util.c:3016:9: note: forward declaration of 'struct ieee80211_he_oper_6ghz_op_info' struct ieee80211_he_oper_6ghz_op_info *he_6ghz_op;
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
--
>> net/mac80211/mesh.c:584:10: error: invalid application of 'sizeof' to an incomplete type 'struct ieee80211_he_oper_6ghz_op_info'
len += sizeof(struct ieee80211_he_oper_6ghz_op_info);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~net/mac80211/mesh.c:584:24: note: forward declaration of 'struct ieee80211_he_oper_6ghz_op_info'
len += sizeof(struct ieee80211_he_oper_6ghz_op_info);
^net/mac80211/mesh.c:781:7: error: invalid application of 'sizeof' to an incomplete type 'struct ieee80211_he_oper_6ghz_op_info' sizeof(struct ieee80211_he_oper_6ghz_op_info) +
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~net/mac80211/mesh.c:781:21: note: forward declaration of 'struct ieee80211_he_oper_6ghz_op_info' sizeof(struct ieee80211_he_oper_6ghz_op_info) +
^
2 errors generated.
--
>> net/mac80211/mesh_plink.c:241:9: error: invalid application of 'sizeof' to an incomplete type 'struct ieee80211_he_oper_6ghz_op_info'
sizeof(struct ieee80211_he_oper_6ghz_op_info) +
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~net/mac80211/mesh_plink.c:241:23: note: forward declaration of 'struct ieee80211_he_oper_6ghz_op_info' sizeof(struct ieee80211_he_oper_6ghz_op_info) +
^
1 error generated.
vim +3021 net/mac80211/util.c
3012
3013 u8 *ieee80211_ie_build_he_oper(u8 *pos, struct cfg80211_chan_def *chandef)
3014 {
3015 struct ieee80211_he_operation *he_oper;
3016 struct ieee80211_he_oper_6ghz_op_info *he_6ghz_op;
3017 u32 he_oper_params;
3018 u8 ie_len = 1 + sizeof(struct ieee80211_he_operation);
3019
3020 if (chandef->chan->band == NL80211_BAND_6GHZ)
> 3021 ie_len += sizeof(struct ieee80211_he_oper_6ghz_op_info);
3022
3023 *pos++ = WLAN_EID_EXTENSION;
3024 *pos++ = ie_len;
3025 *pos++ = WLAN_EID_EXT_HE_OPERATION;
3026
3027 he_oper_params = 0;
3028 he_oper_params |= u32_encode_bits(1023, /* disabled */
3029 IEEE80211_HE_OPERATION_RTS_THRESHOLD_MASK);
3030 he_oper_params |= u32_encode_bits(1,
3031 IEEE80211_HE_OPERATION_ER_SU_DISABLE);
3032 he_oper_params |= u32_encode_bits(1,
3033 IEEE80211_HE_OPERATION_BSS_COLOR_DISABLED);
3034 if (chandef->chan->band == NL80211_BAND_6GHZ)
3035 he_oper_params |= u32_encode_bits(1,
3036 IEEE80211_HE_OPERATION_6GHZ_OP_INFO);
3037
3038 he_oper = (struct ieee80211_he_operation *)pos;
3039 he_oper->he_oper_params = cpu_to_le32(he_oper_params);
3040
3041 /* don't require special HE peer rates */
3042 he_oper->he_mcs_nss_set = cpu_to_le16(0xffff);
3043 pos += sizeof(struct ieee80211_he_operation);
3044
3045 if (chandef->chan->band != NL80211_BAND_6GHZ)
3046 goto out;
3047
3048 /* TODO add VHT operational */
3049 he_6ghz_op = (struct ieee80211_he_oper_6ghz_op_info *)pos;
> 3050 he_6ghz_op->min_rate = 6; /* 6 Mbps */
3051 he_6ghz_op->primary_chan =
3052 ieee80211_frequency_to_channel(chandef->chan->center_freq);
3053 he_6ghz_op->center_freq_seg0_idx =
3054 ieee80211_frequency_to_channel(chandef->center_freq1);
3055 if (chandef->center_freq2)
3056 he_6ghz_op->center_freq_seg1_idx =
3057 ieee80211_frequency_to_channel(chandef->center_freq2);
3058 else
3059 he_6ghz_op->center_freq_seg1_idx = 0;
3060
3061 switch (chandef->width) {
3062 case NL80211_CHAN_WIDTH_160:
3063 /* Convert 160 MHz channel width to new style as interop
3064 * workaround.
3065 */
3066 he_6ghz_op->control =
> 3067 IEEE80211_HE_6GHZ_CHANWIDTH_160MHZ_80P80MHZ;
3068 he_6ghz_op->center_freq_seg1_idx =
3069 he_6ghz_op->center_freq_seg0_idx;
3070 if (chandef->chan->center_freq < chandef->center_freq1)
3071 he_6ghz_op->center_freq_seg0_idx -= 8;
3072 else
3073 he_6ghz_op->center_freq_seg0_idx += 8;
3074 fallthrough;
3075 case NL80211_CHAN_WIDTH_80P80:
3076 he_6ghz_op->control =
3077 IEEE80211_HE_6GHZ_CHANWIDTH_160MHZ_80P80MHZ;
3078 break;
3079 case NL80211_CHAN_WIDTH_80:
> 3080 he_6ghz_op->control = IEEE80211_HE_6GHZ_CHANWIDTH_80MHZ;
3081 break;
3082 case NL80211_CHAN_WIDTH_40:
> 3083 he_6ghz_op->control = IEEE80211_HE_6GHZ_CHANWIDTH_40MHZ; 3084 break;
3085 default:
3086 he_6ghz_op->control = IEEE80211_HE_6GHZ_CHANWIDTH_20MHZ;
3087 break;
3088 }
3089
3090 pos += sizeof(struct ieee80211_he_oper_6ghz_op_info);
3091
3092 out:
3093 return pos;
3094 }
3095
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
kbuild test robot
build botRe: [RFC 09/10] mac80211: build HE operation with 6 GHz oper information
In reply to Johannes Berg[if your patch is applied to the wrong git tree, please drop us a note to help improve the system. BTW, we also suggest to use '--base' option to specify the base tree in git format-patch, please…
Hi Johannes,
[FYI, it's a private test report for your RFC patch.]
[auto build test ERROR on mac80211-next/master]
[also build test ERROR on next-20200528]
[cannot apply to mac80211/master v5.7-rc7]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system. BTW, we also suggest to use '--base' option to specify the base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/Johannes-Berg/cfg80211-add-a-helper-to-identify-6-GHz-PSCs/20200528-174914 base: https://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next.git master config: h8300-randconfig-r036-20200528 (attached as .config) compiler: h8300-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=h8300
If you fix the issue, kindly add following tag as appropriate
All errors (new ones prefixed by >>, old ones prefixed by <<):
In file included from include/asm-generic/bug.h:5,
from arch/h8300/include/asm/bug.h:8,
from include/linux/bug.h:5,
from include/linux/mmdebug.h:5,
from include/linux/gfp.h:5,
from include/linux/slab.h:15,
from net/mac80211/mesh.c:9:include/linux/scatterlist.h: In function 'sg_set_buf':include/asm-generic/page.h:93:50: warning: ordered comparison of pointer with null pointer [-Wextra]
93 | #define virt_addr_valid(kaddr) (((void *)(kaddr) >= (void *)PAGE_OFFSET) && | ^~include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^include/linux/scatterlist.h:143:2: note: in expansion of macro 'BUG_ON'
143 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~include/linux/scatterlist.h:143:10: note: in expansion of macro 'virt_addr_valid'
143 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~~~~~~~~~~
In file included from arch/h8300/include/asm/bug.h:8,
from include/linux/bug.h:5,
from include/linux/mmdebug.h:5,
from include/linux/gfp.h:5,
from include/linux/slab.h:15,
from net/mac80211/mesh.c:9:include/linux/dma-mapping.h: In function 'dma_map_resource':include/asm-generic/page.h:91:32: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits] 91 | #define pfn_valid(pfn) ((pfn) >= ARCH_PFN_OFFSET && ((pfn) - ARCH_PFN_OFFSET) < max_mapnr)
| ^~include/asm-generic/bug.h:139:27: note: in definition of macro 'WARN_ON_ONCE'
139 | int __ret_warn_once = !!(condition); | ^~~~~~~~~include/linux/dma-mapping.h:352:19: note: in expansion of macro 'pfn_valid'
352 | if (WARN_ON_ONCE(pfn_valid(PHYS_PFN(phys_addr))))
| ^~~~~~~~~net/mac80211/mesh.c: In function 'mesh_add_he_oper_ie':
>> net/mac80211/mesh.c:584:17: error: invalid application of 'sizeof' to incomplete type 'struct ieee80211_he_oper_6ghz_op_info'
584 | len += sizeof(struct ieee80211_he_oper_6ghz_op_info);
| ^~~~~~net/mac80211/mesh.c: In function 'ieee80211_mesh_build_beacon':net/mac80211/mesh.c:781:14: error: invalid application of 'sizeof' to incomplete type 'struct ieee80211_he_oper_6ghz_op_info'
781 | sizeof(struct ieee80211_he_oper_6ghz_op_info) +
| ^~~~~~
--
In file included from include/asm-generic/bug.h:5,
from arch/h8300/include/asm/bug.h:8,
from include/linux/bug.h:5,
from include/linux/mmdebug.h:5,
from include/linux/gfp.h:5,
from net/mac80211/mesh_plink.c:7:include/linux/scatterlist.h: In function 'sg_set_buf':include/asm-generic/page.h:93:50: warning: ordered comparison of pointer with null pointer [-Wextra]
93 | #define virt_addr_valid(kaddr) (((void *)(kaddr) >= (void *)PAGE_OFFSET) && | ^~include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^include/linux/scatterlist.h:143:2: note: in expansion of macro 'BUG_ON'
143 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~include/linux/scatterlist.h:143:10: note: in expansion of macro 'virt_addr_valid'
143 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~~~~~~~~~~
In file included from arch/h8300/include/asm/bug.h:8,
from include/linux/bug.h:5,
from include/linux/mmdebug.h:5,
from include/linux/gfp.h:5,
from net/mac80211/mesh_plink.c:7:include/linux/dma-mapping.h: In function 'dma_map_resource':include/asm-generic/page.h:91:32: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits] 91 | #define pfn_valid(pfn) ((pfn) >= ARCH_PFN_OFFSET && ((pfn) - ARCH_PFN_OFFSET) < max_mapnr)
| ^~include/asm-generic/bug.h:139:27: note: in definition of macro 'WARN_ON_ONCE'
139 | int __ret_warn_once = !!(condition); | ^~~~~~~~~include/linux/dma-mapping.h:352:19: note: in expansion of macro 'pfn_valid'
352 | if (WARN_ON_ONCE(pfn_valid(PHYS_PFN(phys_addr))))
| ^~~~~~~~~net/mac80211/mesh_plink.c: In function 'mesh_plink_frame_tx':
>> net/mac80211/mesh_plink.c:241:16: error: invalid application of 'sizeof' to incomplete type 'struct ieee80211_he_oper_6ghz_op_info'
241 | sizeof(struct ieee80211_he_oper_6ghz_op_info) +
| ^~~~~~
vim +584 net/mac80211/mesh.c
562
563 int mesh_add_he_oper_ie(struct ieee80211_sub_if_data *sdata,
564 struct sk_buff *skb)
565 {
566 const struct ieee80211_sta_he_cap *he_cap;
567 struct ieee80211_supported_band *sband;
568 u32 len;
569 u8 *pos;
570
571 sband = ieee80211_get_sband(sdata);
572 if (!sband)
573 return -EINVAL;
574
575 he_cap = ieee80211_get_he_iftype_cap(sband, NL80211_IFTYPE_MESH_POINT);
576 if (!he_cap ||
577 sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_20_NOHT || 578 sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_5 || 579 sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_10) 580 return 0; 581 582 len = 2 + 1 + sizeof(struct ieee80211_he_operation); 583 if (sdata->vif.bss_conf.chandef.chan->band == NL80211_BAND_6GHZ) > 584 len += sizeof(struct ieee80211_he_oper_6ghz_op_info);
585
586 if (skb_tailroom(skb) < len)
587 return -ENOMEM;
588
589 pos = skb_put(skb, len);
590 ieee80211_ie_build_he_oper(pos, &sdata->vif.bss_conf.chandef);
591
592 return 0;
593 }
594
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
kbuild test robot
build botRe: [RFC 09/10] mac80211: build HE operation with 6 GHz oper information
In reply to Johannes Berg[if your patch is applied to the wrong git tree, please drop us a note to help improve the system. BTW, we also suggest to use '--base' option to specify the base tree in git format-patch, please…
Hi Johannes,
[FYI, it's a private test report for your RFC patch.]
[auto build test ERROR on mac80211-next/master]
[also build test ERROR on next-20200528]
[cannot apply to mac80211/master v5.7-rc7]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system. BTW, we also suggest to use '--base' option to specify the base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/Johannes-Berg/cfg80211-add-a-helper-to-identify-6-GHz-PSCs/20200528-174914 base: https://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next.git master config: ia64-randconfig-r035-20200528 (attached as .config) compiler: ia64-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=ia64
If you fix the issue, kindly add following tag as appropriate
All errors (new ones prefixed by >>, old ones prefixed by <<):
In file included from arch/ia64/include/asm/pgtable.h:154,
from include/linux/mm.h:95,
from include/linux/bvec.h:13,
from include/linux/skbuff.h:17,
from include/linux/if_ether.h:19,
from include/net/mac80211.h:18,
from net/mac80211/util.c:14:arch/ia64/include/asm/mmu_context.h: In function 'reload_context':arch/ia64/include/asm/mmu_context.h:137:41: warning: variable 'old_rr4' set but not used [-Wunused-but-set-variable] 137 | unsigned long rr0, rr1, rr2, rr3, rr4, old_rr4;
| ^~~~~~~net/mac80211/util.c: In function 'ieee80211_ie_build_he_oper':
>> net/mac80211/util.c:3021:20: error: invalid application of 'sizeof' to incomplete type 'struct ieee80211_he_oper_6ghz_op_info' 3021 | ie_len += sizeof(struct ieee80211_he_oper_6ghz_op_info); | ^~~~~~ >> net/mac80211/util.c:3050:12: error: dereferencing pointer to incomplete type 'struct ieee80211_he_oper_6ghz_op_info' 3050 | he_6ghz_op->min_rate = 6; /* 6 Mbps */ | ^~ >> net/mac80211/util.c:3067:4: error: 'IEEE80211_HE_6GHZ_CHANWIDTH_160MHZ_80P80MHZ' undeclared (first use in this function); did you mean 'IEEE80211_VHT_CHANWIDTH_80P80MHZ'? 3067 | IEEE80211_HE_6GHZ_CHANWIDTH_160MHZ_80P80MHZ; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | IEEE80211_VHT_CHANWIDTH_80P80MHZ net/mac80211/util.c:3067:4: note: each undeclared identifier is reported only once for each function it appears in >> net/mac80211/util.c:3080:25: error: 'IEEE80211_HE_6GHZ_CHANWIDTH_80MHZ' undeclared (first use in this function); did you mean 'IEEE80211_VHT_CHANWIDTH_80MHZ'? 3080 | he_6ghz_op->control = IEEE80211_HE_6GHZ_CHANWIDTH_80MHZ; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | IEEE80211_VHT_CHANWIDTH_80MHZ >> net/mac80211/util.c:3083:25: error: 'IEEE80211_HE_6GHZ_CHANWIDTH_40MHZ' undeclared (first use in this function); did you mean 'IEEE80211_VHT_CHANWIDTH_80MHZ'? 3083 | he_6ghz_op->control = IEEE80211_HE_6GHZ_CHANWIDTH_40MHZ; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | IEEE80211_VHT_CHANWIDTH_80MHZ >> net/mac80211/util.c:3086:25: error: 'IEEE80211_HE_6GHZ_CHANWIDTH_20MHZ' undeclared (first use in this function); did you mean 'IEEE80211_HT_CHANWIDTH_20MHZ'? 3086 | he_6ghz_op->control = IEEE80211_HE_6GHZ_CHANWIDTH_20MHZ; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | IEEE80211_HT_CHANWIDTH_20MHZ
net/mac80211/util.c:3090:16: error: invalid application of 'sizeof' to incomplete type 'struct ieee80211_he_oper_6ghz_op_info' 3090 | pos += sizeof(struct ieee80211_he_oper_6ghz_op_info);
| ^~~~~~
vim +3021 net/mac80211/util.c
3012
3013 u8 *ieee80211_ie_build_he_oper(u8 *pos, struct cfg80211_chan_def *chandef)
3014 {
3015 struct ieee80211_he_operation *he_oper;
3016 struct ieee80211_he_oper_6ghz_op_info *he_6ghz_op;
3017 u32 he_oper_params;
3018 u8 ie_len = 1 + sizeof(struct ieee80211_he_operation);
3019
3020 if (chandef->chan->band == NL80211_BAND_6GHZ)
> 3021 ie_len += sizeof(struct ieee80211_he_oper_6ghz_op_info);
3022
3023 *pos++ = WLAN_EID_EXTENSION;
3024 *pos++ = ie_len;
3025 *pos++ = WLAN_EID_EXT_HE_OPERATION;
3026
3027 he_oper_params = 0;
3028 he_oper_params |= u32_encode_bits(1023, /* disabled */
3029 IEEE80211_HE_OPERATION_RTS_THRESHOLD_MASK);
3030 he_oper_params |= u32_encode_bits(1,
3031 IEEE80211_HE_OPERATION_ER_SU_DISABLE);
3032 he_oper_params |= u32_encode_bits(1,
3033 IEEE80211_HE_OPERATION_BSS_COLOR_DISABLED);
3034 if (chandef->chan->band == NL80211_BAND_6GHZ)
3035 he_oper_params |= u32_encode_bits(1,
3036 IEEE80211_HE_OPERATION_6GHZ_OP_INFO);
3037
3038 he_oper = (struct ieee80211_he_operation *)pos;
3039 he_oper->he_oper_params = cpu_to_le32(he_oper_params);
3040
3041 /* don't require special HE peer rates */
3042 he_oper->he_mcs_nss_set = cpu_to_le16(0xffff);
3043 pos += sizeof(struct ieee80211_he_operation);
3044
3045 if (chandef->chan->band != NL80211_BAND_6GHZ)
3046 goto out;
3047
3048 /* TODO add VHT operational */
3049 he_6ghz_op = (struct ieee80211_he_oper_6ghz_op_info *)pos;
> 3050 he_6ghz_op->min_rate = 6; /* 6 Mbps */
3051 he_6ghz_op->primary_chan =
3052 ieee80211_frequency_to_channel(chandef->chan->center_freq);
3053 he_6ghz_op->center_freq_seg0_idx =
3054 ieee80211_frequency_to_channel(chandef->center_freq1);
3055 if (chandef->center_freq2)
3056 he_6ghz_op->center_freq_seg1_idx =
3057 ieee80211_frequency_to_channel(chandef->center_freq2);
3058 else
3059 he_6ghz_op->center_freq_seg1_idx = 0;
3060
3061 switch (chandef->width) {
3062 case NL80211_CHAN_WIDTH_160:
3063 /* Convert 160 MHz channel width to new style as interop
3064 * workaround.
3065 */
3066 he_6ghz_op->control =
> 3067 IEEE80211_HE_6GHZ_CHANWIDTH_160MHZ_80P80MHZ;
3068 he_6ghz_op->center_freq_seg1_idx =
3069 he_6ghz_op->center_freq_seg0_idx;
3070 if (chandef->chan->center_freq < chandef->center_freq1)
3071 he_6ghz_op->center_freq_seg0_idx -= 8;
3072 else
3073 he_6ghz_op->center_freq_seg0_idx += 8;
3074 fallthrough;
3075 case NL80211_CHAN_WIDTH_80P80:
3076 he_6ghz_op->control =
3077 IEEE80211_HE_6GHZ_CHANWIDTH_160MHZ_80P80MHZ;
3078 break;
3079 case NL80211_CHAN_WIDTH_80:
> 3080 he_6ghz_op->control = IEEE80211_HE_6GHZ_CHANWIDTH_80MHZ;
3081 break;
3082 case NL80211_CHAN_WIDTH_40:
> 3083 he_6ghz_op->control = IEEE80211_HE_6GHZ_CHANWIDTH_40MHZ;
3084 break;
3085 default:
> 3086 he_6ghz_op->control = IEEE80211_HE_6GHZ_CHANWIDTH_20MHZ; 3087 break;
3088 }
3089
3090 pos += sizeof(struct ieee80211_he_oper_6ghz_op_info);
3091
3092 out:
3093 return pos;
3094 }
3095
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
Johannes Berg
maintainerRFC 10/10 mac80211: do not allow HT/VHT IEs in 6 GHz mesh mode
In reply to Johannes BergFrom: Rajkumar Manoharan <[email protected]>
As HT/VHT elements are not allowed in 6 GHz band, do not include them in mesh beacon template formation.
--- net/mac80211/mesh.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
net/mac80211/mesh.c +16 -0
@@ -415,6 +415,10 @@ int mesh_add_ht_cap_ie(struct ieee80211_sub_if_data *sdata,if (!sband)return -EINVAL ; +/* HT not allowed in 6 GHz */ +if (sband->band ==NL80211_BAND_6GHZ ) +return 0 ; + if (!sband->ht_cap.ht_supported || sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_20_NOHT || sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_5 ||
@@ -452,6 +456,10 @@ int mesh_add_ht_oper_ie(struct ieee80211_sub_if_data *sdata, sband = local->hw.wiphy->bands[channel->band]; ht_cap = &sband->ht_cap; +/* HT not allowed in 6 GHz */ +if (sband->band ==NL80211_BAND_6GHZ ) +return 0 ; + if (!ht_cap->ht_supported || sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_20_NOHT || sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_5 ||
@@ -479,6 +487,10 @@ int mesh_add_vht_cap_ie(struct ieee80211_sub_if_data *sdata,if (!sband)return -EINVAL ; +/* VHT not allowed in 6 GHz */ +if (sband->band ==NL80211_BAND_6GHZ ) +return 0 ; + if (!sband->vht_cap.vht_supported || sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_20_NOHT || sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_5 ||
@@ -516,6 +528,10 @@ int mesh_add_vht_oper_ie(struct ieee80211_sub_if_data *sdata, sband = local->hw.wiphy->bands[channel->band]; vht_cap = &sband->vht_cap; +/* VHT not allowed in 6 GHz */ +if (sband->band ==NL80211_BAND_6GHZ ) +return 0 ; + if (!vht_cap->vht_supported || sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_20_NOHT || sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_5 ||
Signature · 1 line
2.26.2