aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mwifiex/cfg80211.c
diff options
context:
space:
mode:
authorYogesh Ashok Powar <yogeshp@marvell.com>2012-03-13 22:22:35 -0400
committerJohn W. Linville <linville@tuxdriver.com>2012-03-14 14:39:33 -0400
commitaea0701e221e46c267a68187f9e6e0881e9a6a49 (patch)
tree3125ef17ebd2a99b9cca279f555b028588c4ba96 /drivers/net/wireless/mwifiex/cfg80211.c
parent842668417c13f5fca19d9db29f508500cd621af0 (diff)
mwifiex: fix checkpatch --strict warnings/errors Part 2
For files cfg80211.c, cfp.c, and cmdevt.c Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/mwifiex/cfg80211.c')
-rw-r--r--drivers/net/wireless/mwifiex/cfg80211.c90
1 files changed, 44 insertions, 46 deletions
diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c
index 84508b065265..65050384c42b 100644
--- a/drivers/net/wireless/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/mwifiex/cfg80211.c
@@ -127,8 +127,7 @@ mwifiex_cfg80211_set_power_mgmt(struct wiphy *wiphy,
127 127
128 if (timeout) 128 if (timeout)
129 wiphy_dbg(wiphy, 129 wiphy_dbg(wiphy,
130 "info: ignoring the timeout value" 130 "info: ignore timeout value for IEEE Power Save\n");
131 " for IEEE power save\n");
132 131
133 ps_mode = enabled; 132 ps_mode = enabled;
134 133
@@ -168,7 +167,7 @@ mwifiex_cfg80211_add_key(struct wiphy *wiphy, struct net_device *netdev,
168 struct mwifiex_private *priv = mwifiex_netdev_get_priv(netdev); 167 struct mwifiex_private *priv = mwifiex_netdev_get_priv(netdev);
169 168
170 if (mwifiex_set_encode(priv, params->key, params->key_len, 169 if (mwifiex_set_encode(priv, params->key, params->key_len,
171 key_index, 0)) { 170 key_index, 0)) {
172 wiphy_err(wiphy, "crypto keys added\n"); 171 wiphy_err(wiphy, "crypto keys added\n");
173 return -EFAULT; 172 return -EFAULT;
174 } 173 }
@@ -225,7 +224,7 @@ static int mwifiex_send_domain_info_cmd_fw(struct wiphy *wiphy)
225 } 224 }
226 225
227 if (ch->hw_value == next_chan + 1 && 226 if (ch->hw_value == next_chan + 1 &&
228 ch->max_power == max_pwr) { 227 ch->max_power == max_pwr) {
229 next_chan++; 228 next_chan++;
230 no_of_parsed_chan++; 229 no_of_parsed_chan++;
231 } else { 230 } else {
@@ -252,7 +251,7 @@ static int mwifiex_send_domain_info_cmd_fw(struct wiphy *wiphy)
252 domain_info->no_of_triplet = no_of_triplet; 251 domain_info->no_of_triplet = no_of_triplet;
253 252
254 if (mwifiex_send_cmd_async(priv, HostCmd_CMD_802_11D_DOMAIN_INFO, 253 if (mwifiex_send_cmd_async(priv, HostCmd_CMD_802_11D_DOMAIN_INFO,
255 HostCmd_ACT_GEN_SET, 0, NULL)) { 254 HostCmd_ACT_GEN_SET, 0, NULL)) {
256 wiphy_err(wiphy, "11D: setting domain info in FW\n"); 255 wiphy_err(wiphy, "11D: setting domain info in FW\n");
257 return -1; 256 return -1;
258 } 257 }
@@ -271,7 +270,7 @@ static int mwifiex_send_domain_info_cmd_fw(struct wiphy *wiphy)
271 * - Set bt Country IE 270 * - Set bt Country IE
272 */ 271 */
273static int mwifiex_reg_notifier(struct wiphy *wiphy, 272static int mwifiex_reg_notifier(struct wiphy *wiphy,
274 struct regulatory_request *request) 273 struct regulatory_request *request)
275{ 274{
276 struct mwifiex_private *priv = mwifiex_cfg80211_get_priv(wiphy); 275 struct mwifiex_private *priv = mwifiex_cfg80211_get_priv(wiphy);
277 276
@@ -316,7 +315,7 @@ mwifiex_set_rf_channel(struct mwifiex_private *priv,
316 if (chan->band == IEEE80211_BAND_2GHZ) { 315 if (chan->band == IEEE80211_BAND_2GHZ) {
317 if (channel_type == NL80211_CHAN_NO_HT) 316 if (channel_type == NL80211_CHAN_NO_HT)
318 if (priv->adapter->config_bands == BAND_B || 317 if (priv->adapter->config_bands == BAND_B ||
319 priv->adapter->config_bands == BAND_G) 318 priv->adapter->config_bands == BAND_G)
320 config_bands = 319 config_bands =
321 priv->adapter->config_bands; 320 priv->adapter->config_bands;
322 else 321 else
@@ -336,7 +335,7 @@ mwifiex_set_rf_channel(struct mwifiex_private *priv,
336 if (priv->bss_mode == NL80211_IFTYPE_ADHOC) { 335 if (priv->bss_mode == NL80211_IFTYPE_ADHOC) {
337 adapter->adhoc_start_band = config_bands; 336 adapter->adhoc_start_band = config_bands;
338 if ((config_bands & BAND_GN) || 337 if ((config_bands & BAND_GN) ||
339 (config_bands & BAND_AN)) 338 (config_bands & BAND_AN))
340 adapter->adhoc_11n_enabled = true; 339 adapter->adhoc_11n_enabled = true;
341 else 340 else
342 adapter->adhoc_11n_enabled = false; 341 adapter->adhoc_11n_enabled = false;
@@ -350,9 +349,8 @@ mwifiex_set_rf_channel(struct mwifiex_private *priv,
350 mwifiex_send_domain_info_cmd_fw(wiphy); 349 mwifiex_send_domain_info_cmd_fw(wiphy);
351 } 350 }
352 351
353 wiphy_dbg(wiphy, "info: setting band %d, channel offset %d and " 352 wiphy_dbg(wiphy, "info: setting band %d, chan offset %d, mode %d\n",
354 "mode %d\n", config_bands, adapter->sec_chan_offset, 353 config_bands, adapter->sec_chan_offset, priv->bss_mode);
355 priv->bss_mode);
356 if (!chan) 354 if (!chan)
357 return 0; 355 return 0;
358 356
@@ -403,8 +401,8 @@ mwifiex_set_frag(struct mwifiex_private *priv, u32 frag_thr)
403{ 401{
404 int ret; 402 int ret;
405 403
406 if (frag_thr < MWIFIEX_FRAG_MIN_VALUE 404 if (frag_thr < MWIFIEX_FRAG_MIN_VALUE ||
407 || frag_thr > MWIFIEX_FRAG_MAX_VALUE) 405 frag_thr > MWIFIEX_FRAG_MAX_VALUE)
408 return -EINVAL; 406 return -EINVAL;
409 407
410 /* Send request to firmware */ 408 /* Send request to firmware */
@@ -746,8 +744,7 @@ static int mwifiex_cfg80211_set_bitrate_mask(struct wiphy *wiphy,
746 adapter->channel_type = NL80211_CHAN_NO_HT; 744 adapter->channel_type = NL80211_CHAN_NO_HT;
747 745
748 wiphy_debug(wiphy, "info: device configured in 802.11%s%s mode\n", 746 wiphy_debug(wiphy, "info: device configured in 802.11%s%s mode\n",
749 (mode & BAND_B) ? "b" : "", 747 (mode & BAND_B) ? "b" : "", (mode & BAND_G) ? "g" : "");
750 (mode & BAND_G) ? "g" : "");
751 748
752 return 0; 749 return 0;
753} 750}
@@ -802,8 +799,7 @@ static int mwifiex_cfg80211_inform_ibss_bss(struct mwifiex_private *priv)
802 ie_buf[1] = bss_info.ssid.ssid_len; 799 ie_buf[1] = bss_info.ssid.ssid_len;
803 800
804 memcpy(&ie_buf[sizeof(struct ieee_types_header)], 801 memcpy(&ie_buf[sizeof(struct ieee_types_header)],
805 &bss_info.ssid.ssid, 802 &bss_info.ssid.ssid, bss_info.ssid.ssid_len);
806 bss_info.ssid.ssid_len);
807 ie_len = ie_buf[1] + sizeof(struct ieee_types_header); 803 ie_len = ie_buf[1] + sizeof(struct ieee_types_header);
808 804
809 band = mwifiex_band_to_radio_type(priv->curr_bss_params.band); 805 band = mwifiex_band_to_radio_type(priv->curr_bss_params.band);
@@ -812,8 +808,8 @@ static int mwifiex_cfg80211_inform_ibss_bss(struct mwifiex_private *priv)
812 band)); 808 band));
813 809
814 bss = cfg80211_inform_bss(priv->wdev->wiphy, chan, 810 bss = cfg80211_inform_bss(priv->wdev->wiphy, chan,
815 bss_info.bssid, 0, WLAN_CAPABILITY_IBSS, 811 bss_info.bssid, 0, WLAN_CAPABILITY_IBSS,
816 0, ie_buf, ie_len, 0, GFP_KERNEL); 812 0, ie_buf, ie_len, 0, GFP_KERNEL);
817 cfg80211_put_bss(bss); 813 cfg80211_put_bss(bss);
818 memcpy(priv->cfg_bssid, bss_info.bssid, ETH_ALEN); 814 memcpy(priv->cfg_bssid, bss_info.bssid, ETH_ALEN);
819 815
@@ -952,14 +948,15 @@ done:
952 948
953 if (!bss) { 949 if (!bss) {
954 if (is_scanning_required) { 950 if (is_scanning_required) {
955 dev_warn(priv->adapter->dev, "assoc: requested " 951 dev_warn(priv->adapter->dev,
956 "bss not found in scan results\n"); 952 "assoc: requested bss not found in scan results\n");
957 break; 953 break;
958 } 954 }
959 is_scanning_required = 1; 955 is_scanning_required = 1;
960 } else { 956 } else {
961 dev_dbg(priv->adapter->dev, "info: trying to associate to %s and bssid %pM\n", 957 dev_dbg(priv->adapter->dev,
962 (char *) req_ssid.ssid, bss->bssid); 958 "info: trying to associate to '%s' bssid %pM\n",
959 (char *) req_ssid.ssid, bss->bssid);
963 memcpy(&priv->cfg_bssid, bss->bssid, ETH_ALEN); 960 memcpy(&priv->cfg_bssid, bss->bssid, ETH_ALEN);
964 break; 961 break;
965 } 962 }
@@ -999,7 +996,7 @@ mwifiex_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
999 } 996 }
1000 997
1001 wiphy_dbg(wiphy, "info: Trying to associate to %s and bssid %pM\n", 998 wiphy_dbg(wiphy, "info: Trying to associate to %s and bssid %pM\n",
1002 (char *) sme->ssid, sme->bssid); 999 (char *) sme->ssid, sme->bssid);
1003 1000
1004 ret = mwifiex_cfg80211_assoc(priv, sme->ssid_len, sme->ssid, sme->bssid, 1001 ret = mwifiex_cfg80211_assoc(priv, sme->ssid_len, sme->ssid, sme->bssid,
1005 priv->bss_mode, sme->channel, sme, 0); 1002 priv->bss_mode, sme->channel, sme, 0);
@@ -1041,11 +1038,11 @@ mwifiex_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,
1041 } 1038 }
1042 1039
1043 wiphy_dbg(wiphy, "info: trying to join to %s and bssid %pM\n", 1040 wiphy_dbg(wiphy, "info: trying to join to %s and bssid %pM\n",
1044 (char *) params->ssid, params->bssid); 1041 (char *) params->ssid, params->bssid);
1045 1042
1046 ret = mwifiex_cfg80211_assoc(priv, params->ssid_len, params->ssid, 1043 ret = mwifiex_cfg80211_assoc(priv, params->ssid_len, params->ssid,
1047 params->bssid, priv->bss_mode, 1044 params->bssid, priv->bss_mode,
1048 params->channel, NULL, params->privacy); 1045 params->channel, NULL, params->privacy);
1049done: 1046done:
1050 if (!ret) { 1047 if (!ret) {
1051 cfg80211_ibss_joined(priv->netdev, priv->cfg_bssid, GFP_KERNEL); 1048 cfg80211_ibss_joined(priv->netdev, priv->cfg_bssid, GFP_KERNEL);
@@ -1072,7 +1069,7 @@ mwifiex_cfg80211_leave_ibss(struct wiphy *wiphy, struct net_device *dev)
1072 struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev); 1069 struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev);
1073 1070
1074 wiphy_dbg(wiphy, "info: disconnecting from essid %pM\n", 1071 wiphy_dbg(wiphy, "info: disconnecting from essid %pM\n",
1075 priv->cfg_bssid); 1072 priv->cfg_bssid);
1076 if (mwifiex_deauthenticate(priv, NULL)) 1073 if (mwifiex_deauthenticate(priv, NULL))
1077 return -EFAULT; 1074 return -EFAULT;
1078 1075
@@ -1101,7 +1098,7 @@ mwifiex_cfg80211_scan(struct wiphy *wiphy, struct net_device *dev,
1101 priv->scan_request = request; 1098 priv->scan_request = request;
1102 1099
1103 priv->user_scan_cfg = kzalloc(sizeof(struct mwifiex_user_scan_cfg), 1100 priv->user_scan_cfg = kzalloc(sizeof(struct mwifiex_user_scan_cfg),
1104 GFP_KERNEL); 1101 GFP_KERNEL);
1105 if (!priv->user_scan_cfg) { 1102 if (!priv->user_scan_cfg) {
1106 dev_err(priv->adapter->dev, "failed to alloc scan_req\n"); 1103 dev_err(priv->adapter->dev, "failed to alloc scan_req\n");
1107 return -ENOMEM; 1104 return -ENOMEM;
@@ -1117,10 +1114,10 @@ mwifiex_cfg80211_scan(struct wiphy *wiphy, struct net_device *dev,
1117 1114
1118 if (chan->flags & IEEE80211_CHAN_PASSIVE_SCAN) 1115 if (chan->flags & IEEE80211_CHAN_PASSIVE_SCAN)
1119 priv->user_scan_cfg->chan_list[i].scan_type = 1116 priv->user_scan_cfg->chan_list[i].scan_type =
1120 MWIFIEX_SCAN_TYPE_PASSIVE; 1117 MWIFIEX_SCAN_TYPE_PASSIVE;
1121 else 1118 else
1122 priv->user_scan_cfg->chan_list[i].scan_type = 1119 priv->user_scan_cfg->chan_list[i].scan_type =
1123 MWIFIEX_SCAN_TYPE_ACTIVE; 1120 MWIFIEX_SCAN_TYPE_ACTIVE;
1124 1121
1125 priv->user_scan_cfg->chan_list[i].scan_time = 0; 1122 priv->user_scan_cfg->chan_list[i].scan_time = 0;
1126 } 1123 }
@@ -1191,9 +1188,9 @@ mwifiex_setup_ht_caps(struct ieee80211_sta_ht_cap *ht_info,
1191 memset(mcs, 0xff, rx_mcs_supp); 1188 memset(mcs, 0xff, rx_mcs_supp);
1192 /* Clear all the other values */ 1189 /* Clear all the other values */
1193 memset(&mcs[rx_mcs_supp], 0, 1190 memset(&mcs[rx_mcs_supp], 0,
1194 sizeof(struct ieee80211_mcs_info) - rx_mcs_supp); 1191 sizeof(struct ieee80211_mcs_info) - rx_mcs_supp);
1195 if (priv->bss_mode == NL80211_IFTYPE_STATION || 1192 if (priv->bss_mode == NL80211_IFTYPE_STATION ||
1196 ISSUPP_CHANWIDTH40(adapter->hw_dot_11n_dev_cap)) 1193 ISSUPP_CHANWIDTH40(adapter->hw_dot_11n_dev_cap))
1197 /* Set MCS32 for infra mode or ad-hoc mode with 40MHz support */ 1194 /* Set MCS32 for infra mode or ad-hoc mode with 40MHz support */
1198 SETHT_MCS32(mcs_set.rx_mask); 1195 SETHT_MCS32(mcs_set.rx_mask);
1199 1196
@@ -1206,10 +1203,10 @@ mwifiex_setup_ht_caps(struct ieee80211_sta_ht_cap *ht_info,
1206 * create a new virtual interface with the given name 1203 * create a new virtual interface with the given name
1207 */ 1204 */
1208struct net_device *mwifiex_add_virtual_intf(struct wiphy *wiphy, 1205struct net_device *mwifiex_add_virtual_intf(struct wiphy *wiphy,
1209 char *name, 1206 char *name,
1210 enum nl80211_iftype type, 1207 enum nl80211_iftype type,
1211 u32 *flags, 1208 u32 *flags,
1212 struct vif_params *params) 1209 struct vif_params *params)
1213{ 1210{
1214 struct mwifiex_private *priv = mwifiex_cfg80211_get_priv(wiphy); 1211 struct mwifiex_private *priv = mwifiex_cfg80211_get_priv(wiphy);
1215 struct mwifiex_adapter *adapter; 1212 struct mwifiex_adapter *adapter;
@@ -1367,11 +1364,12 @@ int mwifiex_register_cfg80211(struct mwifiex_private *priv)
1367 int ret; 1364 int ret;
1368 void *wdev_priv; 1365 void *wdev_priv;
1369 struct wireless_dev *wdev; 1366 struct wireless_dev *wdev;
1367 struct ieee80211_sta_ht_cap *ht_info;
1370 1368
1371 wdev = kzalloc(sizeof(struct wireless_dev), GFP_KERNEL); 1369 wdev = kzalloc(sizeof(struct wireless_dev), GFP_KERNEL);
1372 if (!wdev) { 1370 if (!wdev) {
1373 dev_err(priv->adapter->dev, "%s: allocating wireless device\n", 1371 dev_err(priv->adapter->dev, "%s: allocating wireless device\n",
1374 __func__); 1372 __func__);
1375 return -ENOMEM; 1373 return -ENOMEM;
1376 } 1374 }
1377 wdev->wiphy = 1375 wdev->wiphy =
@@ -1383,17 +1381,17 @@ int mwifiex_register_cfg80211(struct mwifiex_private *priv)
1383 } 1381 }
1384 wdev->iftype = NL80211_IFTYPE_STATION; 1382 wdev->iftype = NL80211_IFTYPE_STATION;
1385 wdev->wiphy->max_scan_ssids = 10; 1383 wdev->wiphy->max_scan_ssids = 10;
1386 wdev->wiphy->interface_modes = 1384 wdev->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) |
1387 BIT(NL80211_IFTYPE_STATION) | BIT(NL80211_IFTYPE_ADHOC); 1385 BIT(NL80211_IFTYPE_ADHOC);
1388 1386
1389 wdev->wiphy->bands[IEEE80211_BAND_2GHZ] = &mwifiex_band_2ghz; 1387 wdev->wiphy->bands[IEEE80211_BAND_2GHZ] = &mwifiex_band_2ghz;
1390 mwifiex_setup_ht_caps( 1388 ht_info = &wdev->wiphy->bands[IEEE80211_BAND_2GHZ]->ht_cap;
1391 &wdev->wiphy->bands[IEEE80211_BAND_2GHZ]->ht_cap, priv); 1389 mwifiex_setup_ht_caps(ht_info, priv);
1392 1390
1393 if (priv->adapter->config_bands & BAND_A) { 1391 if (priv->adapter->config_bands & BAND_A) {
1394 wdev->wiphy->bands[IEEE80211_BAND_5GHZ] = &mwifiex_band_5ghz; 1392 wdev->wiphy->bands[IEEE80211_BAND_5GHZ] = &mwifiex_band_5ghz;
1395 mwifiex_setup_ht_caps( 1393 ht_info = &wdev->wiphy->bands[IEEE80211_BAND_5GHZ]->ht_cap;
1396 &wdev->wiphy->bands[IEEE80211_BAND_5GHZ]->ht_cap, priv); 1394 mwifiex_setup_ht_caps(ht_info, priv);
1397 } else { 1395 } else {
1398 wdev->wiphy->bands[IEEE80211_BAND_5GHZ] = NULL; 1396 wdev->wiphy->bands[IEEE80211_BAND_5GHZ] = NULL;
1399 } 1397 }
@@ -1420,13 +1418,13 @@ int mwifiex_register_cfg80211(struct mwifiex_private *priv)
1420 ret = wiphy_register(wdev->wiphy); 1418 ret = wiphy_register(wdev->wiphy);
1421 if (ret < 0) { 1419 if (ret < 0) {
1422 dev_err(priv->adapter->dev, "%s: registering cfg80211 device\n", 1420 dev_err(priv->adapter->dev, "%s: registering cfg80211 device\n",
1423 __func__); 1421 __func__);
1424 wiphy_free(wdev->wiphy); 1422 wiphy_free(wdev->wiphy);
1425 kfree(wdev); 1423 kfree(wdev);
1426 return ret; 1424 return ret;
1427 } else { 1425 } else {
1428 dev_dbg(priv->adapter->dev, 1426 dev_dbg(priv->adapter->dev,
1429 "info: successfully registered wiphy device\n"); 1427 "info: successfully registered wiphy device\n");
1430 } 1428 }
1431 1429
1432 priv->wdev = wdev; 1430 priv->wdev = wdev;