aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/util.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2012-03-15 14:45:16 -0400
committerJohn W. Linville <linville@tuxdriver.com>2012-04-09 16:05:55 -0400
commit074d46d1d23f27488a3f314e29cae2453541f17d (patch)
treec6abb99637c808f6eb9da722c3197cc980ce1a98 /net/mac80211/util.c
parentf69b9c79c99b607a8d6b1d9e1913861154af8c63 (diff)
wireless: rename ht_info to ht_operation
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>
Diffstat (limited to 'net/mac80211/util.c')
-rw-r--r--net/mac80211/util.c43
1 files changed, 21 insertions, 22 deletions
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index 32f7a3b3d43c..5e23cf6389d0 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -684,9 +684,9 @@ u32 ieee802_11_parse_elems_crc(u8 *start, size_t len,
684 else 684 else
685 elem_parse_failed = true; 685 elem_parse_failed = true;
686 break; 686 break;
687 case WLAN_EID_HT_INFORMATION: 687 case WLAN_EID_HT_OPERATION:
688 if (elen >= sizeof(struct ieee80211_ht_info)) 688 if (elen >= sizeof(struct ieee80211_ht_operation))
689 elems->ht_info_elem = (void *)pos; 689 elems->ht_operation = (void *)pos;
690 else 690 else
691 elem_parse_failed = true; 691 elem_parse_failed = true;
692 break; 692 break;
@@ -1611,57 +1611,56 @@ u8 *ieee80211_ie_build_ht_cap(u8 *pos, struct ieee80211_sta_ht_cap *ht_cap,
1611 return pos; 1611 return pos;
1612} 1612}
1613 1613
1614u8 *ieee80211_ie_build_ht_info(u8 *pos, 1614u8 *ieee80211_ie_build_ht_oper(u8 *pos, struct ieee80211_sta_ht_cap *ht_cap,
1615 struct ieee80211_sta_ht_cap *ht_cap,
1616 struct ieee80211_channel *channel, 1615 struct ieee80211_channel *channel,
1617 enum nl80211_channel_type channel_type) 1616 enum nl80211_channel_type channel_type)
1618{ 1617{
1619 struct ieee80211_ht_info *ht_info; 1618 struct ieee80211_ht_operation *ht_oper;
1620 /* Build HT Information */ 1619 /* Build HT Information */
1621 *pos++ = WLAN_EID_HT_INFORMATION; 1620 *pos++ = WLAN_EID_HT_OPERATION;
1622 *pos++ = sizeof(struct ieee80211_ht_info); 1621 *pos++ = sizeof(struct ieee80211_ht_operation);
1623 ht_info = (struct ieee80211_ht_info *)pos; 1622 ht_oper = (struct ieee80211_ht_operation *)pos;
1624 ht_info->control_chan = 1623 ht_oper->primary_chan =
1625 ieee80211_frequency_to_channel(channel->center_freq); 1624 ieee80211_frequency_to_channel(channel->center_freq);
1626 switch (channel_type) { 1625 switch (channel_type) {
1627 case NL80211_CHAN_HT40MINUS: 1626 case NL80211_CHAN_HT40MINUS:
1628 ht_info->ht_param = IEEE80211_HT_PARAM_CHA_SEC_BELOW; 1627 ht_oper->ht_param = IEEE80211_HT_PARAM_CHA_SEC_BELOW;
1629 break; 1628 break;
1630 case NL80211_CHAN_HT40PLUS: 1629 case NL80211_CHAN_HT40PLUS:
1631 ht_info->ht_param = IEEE80211_HT_PARAM_CHA_SEC_ABOVE; 1630 ht_oper->ht_param = IEEE80211_HT_PARAM_CHA_SEC_ABOVE;
1632 break; 1631 break;
1633 case NL80211_CHAN_HT20: 1632 case NL80211_CHAN_HT20:
1634 default: 1633 default:
1635 ht_info->ht_param = IEEE80211_HT_PARAM_CHA_SEC_NONE; 1634 ht_oper->ht_param = IEEE80211_HT_PARAM_CHA_SEC_NONE;
1636 break; 1635 break;
1637 } 1636 }
1638 if (ht_cap->cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40) 1637 if (ht_cap->cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40)
1639 ht_info->ht_param |= IEEE80211_HT_PARAM_CHAN_WIDTH_ANY; 1638 ht_oper->ht_param |= IEEE80211_HT_PARAM_CHAN_WIDTH_ANY;
1640 1639
1641 /* 1640 /*
1642 * Note: According to 802.11n-2009 9.13.3.1, HT Protection field and 1641 * Note: According to 802.11n-2009 9.13.3.1, HT Protection field and
1643 * RIFS Mode are reserved in IBSS mode, therefore keep them at 0 1642 * RIFS Mode are reserved in IBSS mode, therefore keep them at 0
1644 */ 1643 */
1645 ht_info->operation_mode = 0x0000; 1644 ht_oper->operation_mode = 0x0000;
1646 ht_info->stbc_param = 0x0000; 1645 ht_oper->stbc_param = 0x0000;
1647 1646
1648 /* It seems that Basic MCS set and Supported MCS set 1647 /* It seems that Basic MCS set and Supported MCS set
1649 are identical for the first 10 bytes */ 1648 are identical for the first 10 bytes */
1650 memset(&ht_info->basic_set, 0, 16); 1649 memset(&ht_oper->basic_set, 0, 16);
1651 memcpy(&ht_info->basic_set, &ht_cap->mcs, 10); 1650 memcpy(&ht_oper->basic_set, &ht_cap->mcs, 10);
1652 1651
1653 return pos + sizeof(struct ieee80211_ht_info); 1652 return pos + sizeof(struct ieee80211_ht_operation);
1654} 1653}
1655 1654
1656enum nl80211_channel_type 1655enum nl80211_channel_type
1657ieee80211_ht_info_to_channel_type(struct ieee80211_ht_info *ht_info) 1656ieee80211_ht_oper_to_channel_type(struct ieee80211_ht_operation *ht_oper)
1658{ 1657{
1659 enum nl80211_channel_type channel_type; 1658 enum nl80211_channel_type channel_type;
1660 1659
1661 if (!ht_info) 1660 if (!ht_oper)
1662 return NL80211_CHAN_NO_HT; 1661 return NL80211_CHAN_NO_HT;
1663 1662
1664 switch (ht_info->ht_param & IEEE80211_HT_PARAM_CHA_SEC_OFFSET) { 1663 switch (ht_oper->ht_param & IEEE80211_HT_PARAM_CHA_SEC_OFFSET) {
1665 case IEEE80211_HT_PARAM_CHA_SEC_NONE: 1664 case IEEE80211_HT_PARAM_CHA_SEC_NONE:
1666 channel_type = NL80211_CHAN_HT20; 1665 channel_type = NL80211_CHAN_HT20;
1667 break; 1666 break;