Skip to content

Commit

Permalink
wireless: rename ht_info to ht_operation
Browse files Browse the repository at this point in the history
Since some of the HT code pre-dates 802.11n-2009
some names are wrong. The one that bothers me most
is that "HT operation" is called "HT information"
in our code and that causes confusion.

Rename "HT information" to "HT operation" and also
the control_chan field to primary_chan to match
the name used in the spec.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Acked-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Johannes Berg authored and John W. Linville committed Apr 9, 2012
1 parent f69b9c7 commit 074d46d
Show file tree
Hide file tree
Showing 16 changed files with 102 additions and 106 deletions.
17 changes: 9 additions & 8 deletions drivers/net/wireless/mwifiex/11n.c
Original file line number Diff line number Diff line change
Expand Up @@ -350,25 +350,26 @@ mwifiex_cmd_append_11n_tlv(struct mwifiex_private *priv,
ret_len += sizeof(struct mwifiex_ie_types_htcap);
}

if (bss_desc->bcn_ht_info) {
if (bss_desc->bcn_ht_oper) {
if (priv->bss_mode == NL80211_IFTYPE_ADHOC) {
ht_info = (struct mwifiex_ie_types_htinfo *) *buffer;
memset(ht_info, 0,
sizeof(struct mwifiex_ie_types_htinfo));
ht_info->header.type =
cpu_to_le16(WLAN_EID_HT_INFORMATION);
cpu_to_le16(WLAN_EID_HT_OPERATION);
ht_info->header.len =
cpu_to_le16(sizeof(struct ieee80211_ht_info));
cpu_to_le16(
sizeof(struct ieee80211_ht_operation));

memcpy((u8 *) ht_info +
sizeof(struct mwifiex_ie_types_header),
(u8 *) bss_desc->bcn_ht_info +
(u8 *) bss_desc->bcn_ht_oper +
sizeof(struct ieee_types_header),
le16_to_cpu(ht_info->header.len));

if (!(sband->ht_cap.cap &
IEEE80211_HT_CAP_SUP_WIDTH_20_40))
ht_info->ht_info.ht_param &=
ht_info->ht_oper.ht_param &=
~(IEEE80211_HT_PARAM_CHAN_WIDTH_ANY |
IEEE80211_HT_PARAM_CHA_SEC_OFFSET);

Expand All @@ -385,16 +386,16 @@ mwifiex_cmd_append_11n_tlv(struct mwifiex_private *priv,
sizeof(struct mwifiex_ie_types_chan_list_param_set) -
sizeof(struct mwifiex_ie_types_header));
chan_list->chan_scan_param[0].chan_number =
bss_desc->bcn_ht_info->control_chan;
bss_desc->bcn_ht_oper->primary_chan;
chan_list->chan_scan_param[0].radio_type =
mwifiex_band_to_radio_type((u8) bss_desc->bss_band);

if (sband->ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40 &&
bss_desc->bcn_ht_info->ht_param &
bss_desc->bcn_ht_oper->ht_param &
IEEE80211_HT_PARAM_CHAN_WIDTH_ANY)
SET_SECONDARYCHAN(chan_list->chan_scan_param[0].
radio_type,
(bss_desc->bcn_ht_info->ht_param &
(bss_desc->bcn_ht_oper->ht_param &
IEEE80211_HT_PARAM_CHA_SEC_OFFSET));

*buffer += sizeof(struct mwifiex_ie_types_chan_list_param_set);
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/mwifiex/fw.h
Original file line number Diff line number Diff line change
Expand Up @@ -1045,7 +1045,7 @@ struct mwifiex_ie_types_htcap {

struct mwifiex_ie_types_htinfo {
struct mwifiex_ie_types_header header;
struct ieee80211_ht_info ht_info;
struct ieee80211_ht_operation ht_oper;
} __packed;

struct mwifiex_ie_types_2040bssco {
Expand Down
14 changes: 7 additions & 7 deletions drivers/net/wireless/mwifiex/join.c
Original file line number Diff line number Diff line change
Expand Up @@ -932,20 +932,20 @@ mwifiex_cmd_802_11_ad_hoc_start(struct mwifiex_private *priv,
/* Fill HT INFORMATION */
ht_info = (struct mwifiex_ie_types_htinfo *) pos;
memset(ht_info, 0, sizeof(struct mwifiex_ie_types_htinfo));
ht_info->header.type = cpu_to_le16(WLAN_EID_HT_INFORMATION);
ht_info->header.type = cpu_to_le16(WLAN_EID_HT_OPERATION);
ht_info->header.len =
cpu_to_le16(sizeof(struct ieee80211_ht_info));
cpu_to_le16(sizeof(struct ieee80211_ht_operation));

ht_info->ht_info.control_chan =
ht_info->ht_oper.primary_chan =
(u8) priv->curr_bss_params.bss_descriptor.channel;
if (adapter->sec_chan_offset) {
ht_info->ht_info.ht_param = adapter->sec_chan_offset;
ht_info->ht_info.ht_param |=
ht_info->ht_oper.ht_param = adapter->sec_chan_offset;
ht_info->ht_oper.ht_param |=
IEEE80211_HT_PARAM_CHAN_WIDTH_ANY;
}
ht_info->ht_info.operation_mode =
ht_info->ht_oper.operation_mode =
cpu_to_le16(IEEE80211_HT_OP_MODE_NON_GF_STA_PRSNT);
ht_info->ht_info.basic_set[0] = 0xff;
ht_info->ht_oper.basic_set[0] = 0xff;
pos += sizeof(struct mwifiex_ie_types_htinfo);
cmd_append_size +=
sizeof(struct mwifiex_ie_types_htinfo);
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/mwifiex/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ struct mwifiex_bssdescriptor {
u8 disable_11n;
struct ieee80211_ht_cap *bcn_ht_cap;
u16 ht_cap_offset;
struct ieee80211_ht_info *bcn_ht_info;
struct ieee80211_ht_operation *bcn_ht_oper;
u16 ht_info_offset;
u8 *bcn_bss_co_2040;
u16 bss_co_2040_offset;
Expand Down
12 changes: 6 additions & 6 deletions drivers/net/wireless/mwifiex/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -1221,9 +1221,9 @@ mwifiex_update_bss_desc_with_ie(struct mwifiex_adapter *adapter,
sizeof(struct ieee_types_header) -
bss_entry->beacon_buf);
break;
case WLAN_EID_HT_INFORMATION:
bss_entry->bcn_ht_info = (struct ieee80211_ht_info *)
(current_ptr +
case WLAN_EID_HT_OPERATION:
bss_entry->bcn_ht_oper =
(struct ieee80211_ht_operation *)(current_ptr +
sizeof(struct ieee_types_header));
bss_entry->ht_info_offset = (u16) (current_ptr +
sizeof(struct ieee_types_header) -
Expand Down Expand Up @@ -1493,7 +1493,7 @@ mwifiex_update_curr_bss_params(struct mwifiex_private *priv, u8 *bssid,
priv->curr_bss_params.bss_descriptor.bcn_ht_cap = NULL;
priv->curr_bss_params.bss_descriptor.ht_cap_offset =
0;
priv->curr_bss_params.bss_descriptor.bcn_ht_info = NULL;
priv->curr_bss_params.bss_descriptor.bcn_ht_oper = NULL;
priv->curr_bss_params.bss_descriptor.ht_info_offset =
0;
priv->curr_bss_params.bss_descriptor.bcn_bss_co_2040 =
Expand Down Expand Up @@ -2019,8 +2019,8 @@ mwifiex_save_curr_bcn(struct mwifiex_private *priv)
(curr_bss->beacon_buf +
curr_bss->ht_cap_offset);

if (curr_bss->bcn_ht_info)
curr_bss->bcn_ht_info = (struct ieee80211_ht_info *)
if (curr_bss->bcn_ht_oper)
curr_bss->bcn_ht_oper = (struct ieee80211_ht_operation *)
(curr_bss->beacon_buf +
curr_bss->ht_info_offset);

Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/wl12xx/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ static struct conf_drv_settings default_conf = {
.rule = CONF_BCN_RULE_PASS_ON_APPEARANCE,
},
[1] = {
.ie = WLAN_EID_HT_INFORMATION,
.ie = WLAN_EID_HT_OPERATION,
.rule = CONF_BCN_RULE_PASS_ON_CHANGE,
},
},
Expand Down
14 changes: 6 additions & 8 deletions include/linux/ieee80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -1007,13 +1007,13 @@ enum ieee80211_min_mpdu_spacing {
};

/**
* struct ieee80211_ht_info - HT information
* struct ieee80211_ht_operation - HT operation IE
*
* This structure is the "HT information element" as
* described in 802.11n D5.0 7.3.2.58
* This structure is the "HT operation element" as
* described in 802.11n-2009 7.3.2.57
*/
struct ieee80211_ht_info {
u8 control_chan;
struct ieee80211_ht_operation {
u8 primary_chan;
u8 ht_param;
__le16 operation_mode;
__le16 stbc_param;
Expand All @@ -1027,8 +1027,6 @@ struct ieee80211_ht_info {
#define IEEE80211_HT_PARAM_CHA_SEC_BELOW 0x03
#define IEEE80211_HT_PARAM_CHAN_WIDTH_ANY 0x04
#define IEEE80211_HT_PARAM_RIFS_MODE 0x08
#define IEEE80211_HT_PARAM_SPSMP_SUPPORT 0x10
#define IEEE80211_HT_PARAM_SERV_INTERVAL_GRAN 0xE0

/* for operation_mode */
#define IEEE80211_HT_OP_MODE_PROTECTION 0x0003
Expand Down Expand Up @@ -1301,7 +1299,7 @@ enum ieee80211_eid {
WLAN_EID_EXT_SUPP_RATES = 50,

WLAN_EID_HT_CAPABILITY = 45,
WLAN_EID_HT_INFORMATION = 61,
WLAN_EID_HT_OPERATION = 61,

WLAN_EID_RSN = 48,
WLAN_EID_MMIE = 76,
Expand Down
2 changes: 1 addition & 1 deletion include/net/mac80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ enum ieee80211_rssi_event {
* @channel_type: Channel type for this BSS -- the hardware might be
* configured for HT40+ while this BSS only uses no-HT, for
* example.
* @ht_operation_mode: HT operation mode (like in &struct ieee80211_ht_info).
* @ht_operation_mode: HT operation mode like in &struct ieee80211_ht_operation.
* This field is only valid when the channel type is one of the HT types.
* @cqm_rssi_thold: Connection quality monitor RSSI threshold, a zero value
* implies disabled
Expand Down
16 changes: 7 additions & 9 deletions net/mac80211/ibss.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,13 +160,11 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
if (channel_type && sband->ht_cap.ht_supported) {
pos = skb_put(skb, 4 +
sizeof(struct ieee80211_ht_cap) +
sizeof(struct ieee80211_ht_info));
sizeof(struct ieee80211_ht_operation));
pos = ieee80211_ie_build_ht_cap(pos, &sband->ht_cap,
sband->ht_cap.cap);
pos = ieee80211_ie_build_ht_info(pos,
&sband->ht_cap,
chan,
channel_type);
pos = ieee80211_ie_build_ht_oper(pos, &sband->ht_cap,
chan, channel_type);
}

if (local->hw.queues >= 4) {
Expand Down Expand Up @@ -441,13 +439,13 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata,
if (sta && elems->wmm_info)
set_sta_flag(sta, WLAN_STA_WME);

if (sta && elems->ht_info_elem && elems->ht_cap_elem &&
if (sta && elems->ht_operation && elems->ht_cap_elem &&
sdata->u.ibss.channel_type != NL80211_CHAN_NO_HT) {
/* we both use HT */
struct ieee80211_sta_ht_cap sta_ht_cap_new;
enum nl80211_channel_type channel_type =
ieee80211_ht_info_to_channel_type(
elems->ht_info_elem);
ieee80211_ht_oper_to_channel_type(
elems->ht_operation);

ieee80211_ht_cap_ie_to_sta_ht_cap(sdata, sband,
elems->ht_cap_elem,
Expand Down Expand Up @@ -1063,7 +1061,7 @@ int ieee80211_ibss_join(struct ieee80211_sub_if_data *sdata,
4 /* IBSS params */ +
2 + (IEEE80211_MAX_SUPP_RATES - 8) +
2 + sizeof(struct ieee80211_ht_cap) +
2 + sizeof(struct ieee80211_ht_info) +
2 + sizeof(struct ieee80211_ht_operation) +
params->ie_len);
if (!skb)
return -ENOMEM;
Expand Down
13 changes: 6 additions & 7 deletions net/mac80211/ieee80211_i.h
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ struct ieee80211_mgd_auth_data {
struct ieee80211_mgd_assoc_data {
struct cfg80211_bss *bss;
const u8 *supp_rates;
const u8 *ht_information_ie;
const u8 *ht_operation_ie;

unsigned long timeout;
int tries;
Expand Down Expand Up @@ -1117,7 +1117,7 @@ struct ieee802_11_elems {
u8 *wmm_info;
u8 *wmm_param;
struct ieee80211_ht_cap *ht_cap_elem;
struct ieee80211_ht_info *ht_info_elem;
struct ieee80211_ht_operation *ht_operation;
struct ieee80211_meshconf_ie *mesh_config;
u8 *mesh_id;
u8 *peering;
Expand Down Expand Up @@ -1470,10 +1470,9 @@ size_t ieee80211_ie_split(const u8 *ies, size_t ielen,
size_t ieee80211_ie_split_vendor(const u8 *ies, size_t ielen, size_t offset);
u8 *ieee80211_ie_build_ht_cap(u8 *pos, struct ieee80211_sta_ht_cap *ht_cap,
u16 cap);
u8 *ieee80211_ie_build_ht_info(u8 *pos,
struct ieee80211_sta_ht_cap *ht_cap,
struct ieee80211_channel *channel,
enum nl80211_channel_type channel_type);
u8 *ieee80211_ie_build_ht_oper(u8 *pos, struct ieee80211_sta_ht_cap *ht_cap,
struct ieee80211_channel *channel,
enum nl80211_channel_type channel_type);

/* internal work items */
void ieee80211_work_init(struct ieee80211_local *local);
Expand Down Expand Up @@ -1501,7 +1500,7 @@ bool ieee80211_set_channel_type(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
enum nl80211_channel_type chantype);
enum nl80211_channel_type
ieee80211_ht_info_to_channel_type(struct ieee80211_ht_info *ht_info);
ieee80211_ht_oper_to_channel_type(struct ieee80211_ht_operation *ht_oper);
enum nl80211_channel_type ieee80211_get_tx_channel_type(
struct ieee80211_local *local,
enum nl80211_channel_type channel_type);
Expand Down
12 changes: 6 additions & 6 deletions net/mac80211/mesh.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ bool mesh_matches_local(struct ieee802_11_elems *ie, struct ieee80211_sub_if_dat
goto mismatch;

/* disallow peering with mismatched channel types for now */
if (ie->ht_info_elem &&
if (ie->ht_operation &&
(local->_oper_channel_type !=
ieee80211_ht_info_to_channel_type(ie->ht_info_elem)))
ieee80211_ht_oper_to_channel_type(ie->ht_operation)))
goto mismatch;

return true;
Expand Down Expand Up @@ -371,7 +371,7 @@ int mesh_add_ht_cap_ie(struct sk_buff *skb,
return 0;
}

int mesh_add_ht_info_ie(struct sk_buff *skb,
int mesh_add_ht_oper_ie(struct sk_buff *skb,
struct ieee80211_sub_if_data *sdata)
{
struct ieee80211_local *local = sdata->local;
Expand All @@ -385,11 +385,11 @@ int mesh_add_ht_info_ie(struct sk_buff *skb,
if (!ht_cap->ht_supported || channel_type == NL80211_CHAN_NO_HT)
return 0;

if (skb_tailroom(skb) < 2 + sizeof(struct ieee80211_ht_info))
if (skb_tailroom(skb) < 2 + sizeof(struct ieee80211_ht_operation))
return -ENOMEM;

pos = skb_put(skb, 2 + sizeof(struct ieee80211_ht_info));
ieee80211_ie_build_ht_info(pos, ht_cap, channel, channel_type);
pos = skb_put(skb, 2 + sizeof(struct ieee80211_ht_operation));
ieee80211_ie_build_ht_oper(pos, ht_cap, channel, channel_type);

return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion net/mac80211/mesh.h
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ int mesh_add_ds_params_ie(struct sk_buff *skb,
struct ieee80211_sub_if_data *sdata);
int mesh_add_ht_cap_ie(struct sk_buff *skb,
struct ieee80211_sub_if_data *sdata);
int mesh_add_ht_info_ie(struct sk_buff *skb,
int mesh_add_ht_oper_ie(struct sk_buff *skb,
struct ieee80211_sub_if_data *sdata);
void mesh_rmc_free(struct ieee80211_sub_if_data *sdata);
int mesh_rmc_init(struct ieee80211_sub_if_data *sdata);
Expand Down
4 changes: 2 additions & 2 deletions net/mac80211/mesh_plink.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ static int mesh_plink_frame_tx(struct ieee80211_sub_if_data *sdata,
2 + sdata->u.mesh.mesh_id_len +
2 + sizeof(struct ieee80211_meshconf_ie) +
2 + sizeof(struct ieee80211_ht_cap) +
2 + sizeof(struct ieee80211_ht_info) +
2 + sizeof(struct ieee80211_ht_operation) +
2 + 8 + /* peering IE */
sdata->u.mesh.ie_len);
if (!skb)
Expand Down Expand Up @@ -263,7 +263,7 @@ static int mesh_plink_frame_tx(struct ieee80211_sub_if_data *sdata,

if (action != WLAN_SP_MESH_PEERING_CLOSE) {
if (mesh_add_ht_cap_ie(skb, sdata) ||
mesh_add_ht_info_ie(skb, sdata))
mesh_add_ht_oper_ie(skb, sdata))
return -1;
}

Expand Down
Loading

0 comments on commit 074d46d

Please sign in to comment.