aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorAmitkumar Karwar <akarwar@marvell.com>2011-12-21 02:47:21 -0500
committerJohn W. Linville <linville@tuxdriver.com>2011-12-21 15:06:13 -0500
commit21c3ba346486c3df39d23a2a085fcdfc7a59a853 (patch)
tree72666ea6b2098f9cf234ba16263832f69875fb59 /drivers/net
parent43906cdb916a9059c34d02831d293fbd4105ed8f (diff)
mwifiex: use IEEE80211_HT_PARAM_CHA_SEC_* macros
Replace driver specific macros with the corresponding IEEE80211_HT_PARAM_CHA_SEC_* macros defined in ieee80211.h. Also, rename 'adapter->chan_offset' to 'adapter->sec_chan_offset' for consistency. Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/mwifiex/cfg80211.c48
-rw-r--r--drivers/net/wireless/mwifiex/fw.h2
-rw-r--r--drivers/net/wireless/mwifiex/init.c2
-rw-r--r--drivers/net/wireless/mwifiex/ioctl.h4
-rw-r--r--drivers/net/wireless/mwifiex/join.c14
-rw-r--r--drivers/net/wireless/mwifiex/main.h2
-rw-r--r--drivers/net/wireless/mwifiex/sta_cmd.c2
7 files changed, 35 insertions, 39 deletions
diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c
index 64bf64051aa9..0723f610694f 100644
--- a/drivers/net/wireless/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/mwifiex/cfg80211.c
@@ -24,26 +24,26 @@
24 * This function maps the nl802.11 channel type into driver channel type. 24 * This function maps the nl802.11 channel type into driver channel type.
25 * 25 *
26 * The mapping is as follows - 26 * The mapping is as follows -
27 * NL80211_CHAN_NO_HT -> NO_SEC_CHANNEL 27 * NL80211_CHAN_NO_HT -> IEEE80211_HT_PARAM_CHA_SEC_NONE
28 * NL80211_CHAN_HT20 -> NO_SEC_CHANNEL 28 * NL80211_CHAN_HT20 -> IEEE80211_HT_PARAM_CHA_SEC_NONE
29 * NL80211_CHAN_HT40PLUS -> SEC_CHANNEL_ABOVE 29 * NL80211_CHAN_HT40PLUS -> IEEE80211_HT_PARAM_CHA_SEC_ABOVE
30 * NL80211_CHAN_HT40MINUS -> SEC_CHANNEL_BELOW 30 * NL80211_CHAN_HT40MINUS -> IEEE80211_HT_PARAM_CHA_SEC_BELOW
31 * Others -> NO_SEC_CHANNEL 31 * Others -> IEEE80211_HT_PARAM_CHA_SEC_NONE
32 */ 32 */
33static int 33static u8
34mwifiex_cfg80211_channel_type_to_mwifiex_channels(enum nl80211_channel_type 34mwifiex_cfg80211_channel_type_to_sec_chan_offset(enum nl80211_channel_type
35 channel_type) 35 channel_type)
36{ 36{
37 switch (channel_type) { 37 switch (channel_type) {
38 case NL80211_CHAN_NO_HT: 38 case NL80211_CHAN_NO_HT:
39 case NL80211_CHAN_HT20: 39 case NL80211_CHAN_HT20:
40 return NO_SEC_CHANNEL; 40 return IEEE80211_HT_PARAM_CHA_SEC_NONE;
41 case NL80211_CHAN_HT40PLUS: 41 case NL80211_CHAN_HT40PLUS:
42 return SEC_CHANNEL_ABOVE; 42 return IEEE80211_HT_PARAM_CHA_SEC_ABOVE;
43 case NL80211_CHAN_HT40MINUS: 43 case NL80211_CHAN_HT40MINUS:
44 return SEC_CHANNEL_BELOW; 44 return IEEE80211_HT_PARAM_CHA_SEC_BELOW;
45 default: 45 default:
46 return NO_SEC_CHANNEL; 46 return IEEE80211_HT_PARAM_CHA_SEC_NONE;
47 } 47 }
48} 48}
49 49
@@ -51,20 +51,20 @@ mwifiex_cfg80211_channel_type_to_mwifiex_channels(enum nl80211_channel_type
51 * This function maps the driver channel type into nl802.11 channel type. 51 * This function maps the driver channel type into nl802.11 channel type.
52 * 52 *
53 * The mapping is as follows - 53 * The mapping is as follows -
54 * NO_SEC_CHANNEL -> NL80211_CHAN_HT20 54 * IEEE80211_HT_PARAM_CHA_SEC_NONE -> NL80211_CHAN_HT20
55 * SEC_CHANNEL_ABOVE -> NL80211_CHAN_HT40PLUS 55 * IEEE80211_HT_PARAM_CHA_SEC_ABOVE -> NL80211_CHAN_HT40PLUS
56 * SEC_CHANNEL_BELOW -> NL80211_CHAN_HT40MINUS 56 * IEEE80211_HT_PARAM_CHA_SEC_BELOW -> NL80211_CHAN_HT40MINUS
57 * Others -> NL80211_CHAN_HT20 57 * Others -> NL80211_CHAN_HT20
58 */ 58 */
59static enum nl80211_channel_type 59static enum nl80211_channel_type
60mwifiex_channels_to_cfg80211_channel_type(int channel_type) 60mwifiex_channels_to_cfg80211_channel_type(int channel_type)
61{ 61{
62 switch (channel_type) { 62 switch (channel_type) {
63 case NO_SEC_CHANNEL: 63 case IEEE80211_HT_PARAM_CHA_SEC_NONE:
64 return NL80211_CHAN_HT20; 64 return NL80211_CHAN_HT20;
65 case SEC_CHANNEL_ABOVE: 65 case IEEE80211_HT_PARAM_CHA_SEC_ABOVE:
66 return NL80211_CHAN_HT40PLUS; 66 return NL80211_CHAN_HT40PLUS;
67 case SEC_CHANNEL_BELOW: 67 case IEEE80211_HT_PARAM_CHA_SEC_BELOW:
68 return NL80211_CHAN_HT40MINUS; 68 return NL80211_CHAN_HT40MINUS;
69 default: 69 default:
70 return NL80211_CHAN_HT20; 70 return NL80211_CHAN_HT20;
@@ -354,15 +354,15 @@ mwifiex_set_rf_channel(struct mwifiex_private *priv,
354 adapter->adhoc_11n_enabled = false; 354 adapter->adhoc_11n_enabled = false;
355 } 355 }
356 } 356 }
357 adapter->chan_offset = 357 adapter->sec_chan_offset =
358 mwifiex_cfg80211_channel_type_to_mwifiex_channels 358 mwifiex_cfg80211_channel_type_to_sec_chan_offset
359 (channel_type); 359 (channel_type);
360 360
361 mwifiex_send_domain_info_cmd_fw(wiphy); 361 mwifiex_send_domain_info_cmd_fw(wiphy);
362 } 362 }
363 363
364 wiphy_dbg(wiphy, "info: setting band %d, channel offset %d and " 364 wiphy_dbg(wiphy, "info: setting band %d, channel offset %d and "
365 "mode %d\n", config_bands, adapter->chan_offset, 365 "mode %d\n", config_bands, adapter->sec_chan_offset,
366 priv->bss_mode); 366 priv->bss_mode);
367 if (!chan) 367 if (!chan)
368 return 0; 368 return 0;
@@ -729,7 +729,7 @@ static int mwifiex_cfg80211_set_bitrate_mask(struct wiphy *wiphy,
729 adapter->adhoc_11n_enabled = false; 729 adapter->adhoc_11n_enabled = false;
730 } 730 }
731 } 731 }
732 adapter->chan_offset = NO_SEC_CHANNEL; 732 adapter->sec_chan_offset = IEEE80211_HT_PARAM_CHA_SEC_NONE;
733 733
734 wiphy_debug(wiphy, "info: device configured in 802.11%s%s mode\n", 734 wiphy_debug(wiphy, "info: device configured in 802.11%s%s mode\n",
735 (mode & BAND_B) ? "b" : "", 735 (mode & BAND_B) ? "b" : "",
@@ -850,7 +850,7 @@ mwifiex_cfg80211_assoc(struct mwifiex_private *priv, size_t ssid_len, u8 *ssid,
850 if (channel) 850 if (channel)
851 ret = mwifiex_set_rf_channel(priv, channel, 851 ret = mwifiex_set_rf_channel(priv, channel,
852 mwifiex_channels_to_cfg80211_channel_type 852 mwifiex_channels_to_cfg80211_channel_type
853 (priv->adapter->chan_offset)); 853 (priv->adapter->sec_chan_offset));
854 854
855 ret = mwifiex_set_encode(priv, NULL, 0, 0, 1); /* Disable keys */ 855 ret = mwifiex_set_encode(priv, NULL, 0, 0, 1); /* Disable keys */
856 856
diff --git a/drivers/net/wireless/mwifiex/fw.h b/drivers/net/wireless/mwifiex/fw.h
index 62b863907698..51c5417c569c 100644
--- a/drivers/net/wireless/mwifiex/fw.h
+++ b/drivers/net/wireless/mwifiex/fw.h
@@ -376,8 +376,6 @@ enum mwifiex_chan_scan_mode_bitmasks {
376 MWIFIEX_DISABLE_CHAN_FILT = BIT(1), 376 MWIFIEX_DISABLE_CHAN_FILT = BIT(1),
377}; 377};
378 378
379#define SECOND_CHANNEL_BELOW 0x30
380#define SECOND_CHANNEL_ABOVE 0x10
381struct mwifiex_chan_scan_param_set { 379struct mwifiex_chan_scan_param_set {
382 u8 radio_type; 380 u8 radio_type;
383 u8 chan_number; 381 u8 chan_number;
diff --git a/drivers/net/wireless/mwifiex/init.c b/drivers/net/wireless/mwifiex/init.c
index 244c728ef9dc..e05b417a3fae 100644
--- a/drivers/net/wireless/mwifiex/init.c
+++ b/drivers/net/wireless/mwifiex/init.c
@@ -246,7 +246,7 @@ static void mwifiex_init_adapter(struct mwifiex_adapter *adapter)
246 memset(adapter->event_body, 0, sizeof(adapter->event_body)); 246 memset(adapter->event_body, 0, sizeof(adapter->event_body));
247 adapter->hw_dot_11n_dev_cap = 0; 247 adapter->hw_dot_11n_dev_cap = 0;
248 adapter->hw_dev_mcs_support = 0; 248 adapter->hw_dev_mcs_support = 0;
249 adapter->chan_offset = 0; 249 adapter->sec_chan_offset = 0;
250 adapter->adhoc_11n_enabled = false; 250 adapter->adhoc_11n_enabled = false;
251 251
252 mwifiex_wmm_init(adapter); 252 mwifiex_wmm_init(adapter);
diff --git a/drivers/net/wireless/mwifiex/ioctl.h b/drivers/net/wireless/mwifiex/ioctl.h
index eb76b7b749ad..d5d81f1fe41c 100644
--- a/drivers/net/wireless/mwifiex/ioctl.h
+++ b/drivers/net/wireless/mwifiex/ioctl.h
@@ -62,10 +62,6 @@ enum {
62 BAND_AN = 16, 62 BAND_AN = 16,
63}; 63};
64 64
65#define NO_SEC_CHANNEL 0
66#define SEC_CHANNEL_ABOVE 1
67#define SEC_CHANNEL_BELOW 3
68
69enum { 65enum {
70 ADHOC_IDLE, 66 ADHOC_IDLE,
71 ADHOC_STARTED, 67 ADHOC_STARTED,
diff --git a/drivers/net/wireless/mwifiex/join.c b/drivers/net/wireless/mwifiex/join.c
index 1c4981367e50..0b0eb5efba9d 100644
--- a/drivers/net/wireless/mwifiex/join.c
+++ b/drivers/net/wireless/mwifiex/join.c
@@ -885,12 +885,14 @@ mwifiex_cmd_802_11_ad_hoc_start(struct mwifiex_private *priv,
885 = mwifiex_band_to_radio_type(priv->curr_bss_params.band); 885 = mwifiex_band_to_radio_type(priv->curr_bss_params.band);
886 if (adapter->adhoc_start_band & BAND_GN 886 if (adapter->adhoc_start_band & BAND_GN
887 || adapter->adhoc_start_band & BAND_AN) { 887 || adapter->adhoc_start_band & BAND_AN) {
888 if (adapter->chan_offset == SEC_CHANNEL_ABOVE) 888 if (adapter->sec_chan_offset ==
889 IEEE80211_HT_PARAM_CHA_SEC_ABOVE)
889 chan_tlv->chan_scan_param[0].radio_type |= 890 chan_tlv->chan_scan_param[0].radio_type |=
890 SECOND_CHANNEL_ABOVE; 891 (IEEE80211_HT_PARAM_CHA_SEC_ABOVE << 4);
891 else if (adapter->chan_offset == SEC_CHANNEL_BELOW) 892 else if (adapter->sec_chan_offset ==
893 IEEE80211_HT_PARAM_CHA_SEC_ABOVE)
892 chan_tlv->chan_scan_param[0].radio_type |= 894 chan_tlv->chan_scan_param[0].radio_type |=
893 SECOND_CHANNEL_BELOW; 895 (IEEE80211_HT_PARAM_CHA_SEC_BELOW << 4);
894 } 896 }
895 dev_dbg(adapter->dev, "info: ADHOC_S_CMD: TLV Band = %d\n", 897 dev_dbg(adapter->dev, "info: ADHOC_S_CMD: TLV Band = %d\n",
896 chan_tlv->chan_scan_param[0].radio_type); 898 chan_tlv->chan_scan_param[0].radio_type);
@@ -936,8 +938,8 @@ mwifiex_cmd_802_11_ad_hoc_start(struct mwifiex_private *priv,
936 938
937 ht_info->ht_info.control_chan = 939 ht_info->ht_info.control_chan =
938 (u8) priv->curr_bss_params.bss_descriptor.channel; 940 (u8) priv->curr_bss_params.bss_descriptor.channel;
939 if (adapter->chan_offset) { 941 if (adapter->sec_chan_offset) {
940 ht_info->ht_info.ht_param = adapter->chan_offset; 942 ht_info->ht_info.ht_param = adapter->sec_chan_offset;
941 ht_info->ht_info.ht_param |= 943 ht_info->ht_info.ht_param |=
942 IEEE80211_HT_PARAM_CHAN_WIDTH_ANY; 944 IEEE80211_HT_PARAM_CHAN_WIDTH_ANY;
943 } 945 }
diff --git a/drivers/net/wireless/mwifiex/main.h b/drivers/net/wireless/mwifiex/main.h
index d659650a1379..2287643b5f87 100644
--- a/drivers/net/wireless/mwifiex/main.h
+++ b/drivers/net/wireless/mwifiex/main.h
@@ -640,7 +640,7 @@ struct mwifiex_adapter {
640 u32 hw_dot_11n_dev_cap; 640 u32 hw_dot_11n_dev_cap;
641 u8 hw_dev_mcs_support; 641 u8 hw_dev_mcs_support;
642 u8 adhoc_11n_enabled; 642 u8 adhoc_11n_enabled;
643 u8 chan_offset; 643 u8 sec_chan_offset;
644 struct mwifiex_dbg dbg; 644 struct mwifiex_dbg dbg;
645 u8 arp_filter[ARP_FILTER_MAX_BUF_SIZE]; 645 u8 arp_filter[ARP_FILTER_MAX_BUF_SIZE];
646 u32 arp_filter_size; 646 u32 arp_filter_size;
diff --git a/drivers/net/wireless/mwifiex/sta_cmd.c b/drivers/net/wireless/mwifiex/sta_cmd.c
index ea6518d1c9e3..6e443ffa0465 100644
--- a/drivers/net/wireless/mwifiex/sta_cmd.c
+++ b/drivers/net/wireless/mwifiex/sta_cmd.c
@@ -748,7 +748,7 @@ static int mwifiex_cmd_802_11_rf_channel(struct mwifiex_private *priv,
748 cpu_to_le16(HostCmd_SCAN_RADIO_TYPE_A); 748 cpu_to_le16(HostCmd_SCAN_RADIO_TYPE_A);
749 749
750 rf_type = le16_to_cpu(rf_chan->rf_type); 750 rf_type = le16_to_cpu(rf_chan->rf_type);
751 SET_SECONDARYCHAN(rf_type, priv->adapter->chan_offset); 751 SET_SECONDARYCHAN(rf_type, priv->adapter->sec_chan_offset);
752 rf_chan->current_channel = cpu_to_le16(*channel); 752 rf_chan->current_channel = cpu_to_le16(*channel);
753 } 753 }
754 rf_chan->action = cpu_to_le16(cmd_action); 754 rf_chan->action = cpu_to_le16(cmd_action);