aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mwifiex
diff options
context:
space:
mode:
authorMarc Yang <yangyang@marvell.com>2011-03-24 23:49:39 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-04-04 16:20:00 -0400
commit203afecaa320fa8c541ce130aed449ff53f5b4aa (patch)
treed52aedcfe5ff7cb3faf913e6ff8321874f7d1d99 /drivers/net/wireless/mwifiex
parent0022801c893e953ebff8e0ad00cc22716055babf (diff)
mwifiex: remove unnecessary _set_auth functions
mwifiex_set_encrypt_mode() mwifiex_set_auth_mode() mwifiex_set_auth() These functions are confusing and misleading. And they are really not needed at all. Some unused definitions are also removed. Signed-off-by: Marc Yang <yangyang@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')
-rw-r--r--drivers/net/wireless/mwifiex/cfg80211.c17
-rw-r--r--drivers/net/wireless/mwifiex/ioctl.h2
-rw-r--r--drivers/net/wireless/mwifiex/join.c25
-rw-r--r--drivers/net/wireless/mwifiex/main.h8
-rw-r--r--drivers/net/wireless/mwifiex/sta_ioctl.c44
5 files changed, 19 insertions, 77 deletions
diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c
index 80f367f27efc..84e33f1f0ffe 100644
--- a/drivers/net/wireless/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/mwifiex/cfg80211.c
@@ -1055,11 +1055,10 @@ mwifiex_cfg80211_assoc(struct mwifiex_private *priv, size_t ssid_len, u8 *ssid,
1055 * scan. The cfg80211 does not give us the encryption 1055 * scan. The cfg80211 does not give us the encryption
1056 * mode at this stage so just setting it to WEP here. 1056 * mode at this stage so just setting it to WEP here.
1057 */ 1057 */
1058 wpa_enabled = 0; 1058 priv->sec_info.encryption_mode =
1059 auth_type = MWIFIEX_AUTH_MODE_OPEN; 1059 MWIFIEX_ENCRYPTION_MODE_WEP104;
1060 ret = mwifiex_set_auth(priv, 1060 priv->sec_info.authentication_mode =
1061 MWIFIEX_ENCRYPTION_MODE_WEP104, 1061 MWIFIEX_AUTH_MODE_OPEN;
1062 auth_type, wpa_enabled);
1063 } 1062 }
1064 1063
1065 goto done; 1064 goto done;
@@ -1075,15 +1074,15 @@ mwifiex_cfg80211_assoc(struct mwifiex_private *priv, size_t ssid_len, u8 *ssid,
1075 if (sme->crypto.n_ciphers_pairwise) { 1074 if (sme->crypto.n_ciphers_pairwise) {
1076 pairwise_encrypt_mode = mwifiex_get_mwifiex_cipher(sme->crypto. 1075 pairwise_encrypt_mode = mwifiex_get_mwifiex_cipher(sme->crypto.
1077 ciphers_pairwise[0], &wpa_enabled); 1076 ciphers_pairwise[0], &wpa_enabled);
1078 ret = mwifiex_set_auth(priv, pairwise_encrypt_mode, auth_type, 1077 priv->sec_info.encryption_mode = pairwise_encrypt_mode;
1079 wpa_enabled); 1078 priv->sec_info.authentication_mode = auth_type;
1080 } 1079 }
1081 1080
1082 if (sme->crypto.cipher_group) { 1081 if (sme->crypto.cipher_group) {
1083 group_encrypt_mode = mwifiex_get_mwifiex_cipher(sme->crypto. 1082 group_encrypt_mode = mwifiex_get_mwifiex_cipher(sme->crypto.
1084 cipher_group, &wpa_enabled); 1083 cipher_group, &wpa_enabled);
1085 ret = mwifiex_set_auth(priv, group_encrypt_mode, auth_type, 1084 priv->sec_info.encryption_mode = group_encrypt_mode;
1086 wpa_enabled); 1085 priv->sec_info.authentication_mode = auth_type;
1087 } 1086 }
1088 if (sme->ie) 1087 if (sme->ie)
1089 ret = mwifiex_set_gen_ie(priv, sme->ie, sme->ie_len); 1088 ret = mwifiex_set_gen_ie(priv, sme->ie, sme->ie_len);
diff --git a/drivers/net/wireless/mwifiex/ioctl.h b/drivers/net/wireless/mwifiex/ioctl.h
index d6babfb1495c..b7e457110b4f 100644
--- a/drivers/net/wireless/mwifiex/ioctl.h
+++ b/drivers/net/wireless/mwifiex/ioctl.h
@@ -277,8 +277,6 @@ struct mwifiex_debug_info {
277enum { 277enum {
278 MWIFIEX_AUTH_MODE_OPEN = 0x00, 278 MWIFIEX_AUTH_MODE_OPEN = 0x00,
279 MWIFIEX_AUTH_MODE_SHARED = 0x01, 279 MWIFIEX_AUTH_MODE_SHARED = 0x01,
280 MWIFIEX_AUTH_MODE_NETWORKEAP = 0x80,
281 MWIFIEX_AUTH_MODE_AUTO = 0xFF,
282}; 280};
283 281
284enum { 282enum {
diff --git a/drivers/net/wireless/mwifiex/join.c b/drivers/net/wireless/mwifiex/join.c
index d06f4c2d1d30..98d76d8c2656 100644
--- a/drivers/net/wireless/mwifiex/join.c
+++ b/drivers/net/wireless/mwifiex/join.c
@@ -441,20 +441,17 @@ int mwifiex_cmd_802_11_associate(struct mwifiex_private *priv,
441 dev_dbg(priv->adapter->dev, "info: ASSOC_CMD: rates size = %d\n", 441 dev_dbg(priv->adapter->dev, "info: ASSOC_CMD: rates size = %d\n",
442 rates_size); 442 rates_size);
443 443
444 /* Add the Authentication type to be used for Auth frames if needed */ 444 /* Add the Authentication type to be used for Auth frames */
445 if (priv->sec_info.authentication_mode != MWIFIEX_AUTH_MODE_AUTO) { 445 auth_tlv = (struct mwifiex_ie_types_auth_type *) pos;
446 auth_tlv = (struct mwifiex_ie_types_auth_type *) pos; 446 auth_tlv->header.type = cpu_to_le16(TLV_TYPE_AUTH_TYPE);
447 auth_tlv->header.type = cpu_to_le16(TLV_TYPE_AUTH_TYPE); 447 auth_tlv->header.len = cpu_to_le16(sizeof(auth_tlv->auth_type));
448 auth_tlv->header.len = cpu_to_le16(sizeof(auth_tlv->auth_type)); 448 if (priv->sec_info.wep_status == MWIFIEX_802_11_WEP_ENABLED)
449 if (priv->sec_info.wep_status == MWIFIEX_802_11_WEP_ENABLED) 449 auth_tlv->auth_type = cpu_to_le16(
450 auth_tlv->auth_type = cpu_to_le16((u16) priv->sec_info. 450 (u16) priv->sec_info.authentication_mode);
451 authentication_mode); 451 else
452 else 452 auth_tlv->auth_type = cpu_to_le16(MWIFIEX_AUTH_MODE_OPEN);
453 auth_tlv->auth_type = 453
454 cpu_to_le16(MWIFIEX_AUTH_MODE_OPEN); 454 pos += sizeof(auth_tlv->header) + le16_to_cpu(auth_tlv->header.len);
455 pos += sizeof(auth_tlv->header) +
456 le16_to_cpu(auth_tlv->header.len);
457 }
458 455
459 if (IS_SUPPORT_MULTI_BANDS(priv->adapter) 456 if (IS_SUPPORT_MULTI_BANDS(priv->adapter)
460 && !(ISSUPP_11NENABLED(priv->adapter->fw_cap_info) 457 && !(ISSUPP_11NENABLED(priv->adapter->fw_cap_info)
diff --git a/drivers/net/wireless/mwifiex/main.h b/drivers/net/wireless/mwifiex/main.h
index 2b0ad8e3d6e2..f6fe1054a65c 100644
--- a/drivers/net/wireless/mwifiex/main.h
+++ b/drivers/net/wireless/mwifiex/main.h
@@ -994,11 +994,6 @@ int mwifiex_get_channel_list(struct mwifiex_private *priv,
994int mwifiex_get_scan_table(struct mwifiex_private *priv, 994int mwifiex_get_scan_table(struct mwifiex_private *priv,
995 u8 wait_option, 995 u8 wait_option,
996 struct mwifiex_scan_resp *scanresp); 996 struct mwifiex_scan_resp *scanresp);
997int mwifiex_get_auth_mode(struct mwifiex_private *priv,
998 u8 wait_option, u32 *auth_mode);
999int mwifiex_get_encrypt_mode(struct mwifiex_private *priv,
1000 u8 wait_option,
1001 u32 *encrypt_mode);
1002int mwifiex_enable_wep_key(struct mwifiex_private *priv, u8 wait_option); 997int mwifiex_enable_wep_key(struct mwifiex_private *priv, u8 wait_option);
1003int mwifiex_find_best_bss(struct mwifiex_private *priv, u8 wait_option, 998int mwifiex_find_best_bss(struct mwifiex_private *priv, u8 wait_option,
1004 struct mwifiex_ssid_bssid *ssid_bssid); 999 struct mwifiex_ssid_bssid *ssid_bssid);
@@ -1014,9 +1009,6 @@ int mwifiex_drv_get_mode(struct mwifiex_private *priv, u8 wait_option);
1014 1009
1015int mwifiex_drv_change_adhoc_chan(struct mwifiex_private *priv, int channel); 1010int mwifiex_drv_change_adhoc_chan(struct mwifiex_private *priv, int channel);
1016 1011
1017int mwifiex_set_auth(struct mwifiex_private *priv, int encrypt_mode,
1018 int auth_mode, int wpa_enabled);
1019
1020int mwifiex_set_encode(struct mwifiex_private *priv, const u8 *key, 1012int mwifiex_set_encode(struct mwifiex_private *priv, const u8 *key,
1021 int key_len, u8 key_index, int disable); 1013 int key_len, u8 key_index, int disable);
1022 1014
diff --git a/drivers/net/wireless/mwifiex/sta_ioctl.c b/drivers/net/wireless/mwifiex/sta_ioctl.c
index 665a519b1403..362301f417a4 100644
--- a/drivers/net/wireless/mwifiex/sta_ioctl.c
+++ b/drivers/net/wireless/mwifiex/sta_ioctl.c
@@ -1691,20 +1691,6 @@ static int mwifiex_sec_ioctl_set_wapi_key(struct mwifiex_adapter *adapter,
1691} 1691}
1692 1692
1693/* 1693/*
1694 * IOCTL request handler to set/get authentication mode.
1695 */
1696static int mwifiex_set_auth_mode(struct mwifiex_private *priv, u32 auth_mode)
1697{
1698 int ret = 0;
1699
1700 priv->sec_info.authentication_mode = auth_mode;
1701 if (priv->sec_info.authentication_mode == MWIFIEX_AUTH_MODE_NETWORKEAP)
1702 ret = mwifiex_set_wpa_ie_helper(priv, NULL, 0);
1703
1704 return ret;
1705}
1706
1707/*
1708 * IOCTL request handler to set WEP network key. 1694 * IOCTL request handler to set WEP network key.
1709 * 1695 *
1710 * This function prepares the correct firmware command and 1696 * This function prepares the correct firmware command and
@@ -1999,36 +1985,6 @@ int mwifiex_get_signal_info(struct mwifiex_private *priv, u8 wait_option,
1999} 1985}
2000 1986
2001/* 1987/*
2002 * Sends IOCTL request to set encryption mode.
2003 *
2004 * This function allocates the IOCTL request buffer, fills it
2005 * with requisite parameters and calls the IOCTL handler.
2006 */
2007static int mwifiex_set_encrypt_mode(struct mwifiex_private *priv,
2008 u8 wait_option, u32 encrypt_mode)
2009{
2010 priv->sec_info.encryption_mode = encrypt_mode;
2011 return 0;
2012}
2013
2014/*
2015 * This function set the authentication parameters. It sets both encryption
2016 * mode and authentication mode, and also enables WPA if required.
2017 */
2018int
2019mwifiex_set_auth(struct mwifiex_private *priv, int encrypt_mode,
2020 int auth_mode, int wpa_enabled)
2021{
2022 if (mwifiex_set_encrypt_mode(priv, MWIFIEX_IOCTL_WAIT, encrypt_mode))
2023 return -EFAULT;
2024
2025 if (mwifiex_set_auth_mode(priv, auth_mode))
2026 return -EFAULT;
2027
2028 return 0;
2029}
2030
2031/*
2032 * Sends IOCTL request to set encoding parameters. 1988 * Sends IOCTL request to set encoding parameters.
2033 * 1989 *
2034 * This function allocates the IOCTL request buffer, fills it 1990 * This function allocates the IOCTL request buffer, fills it