Commit 203afeca authored by Marc Yang's avatar Marc Yang Committed by John W. Linville

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: default avatarMarc Yang <yangyang@marvell.com>
Signed-off-by: default avatarBing Zhao <bzhao@marvell.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 0022801c
...@@ -1055,11 +1055,10 @@ mwifiex_cfg80211_assoc(struct mwifiex_private *priv, size_t ssid_len, u8 *ssid, ...@@ -1055,11 +1055,10 @@ mwifiex_cfg80211_assoc(struct mwifiex_private *priv, size_t ssid_len, u8 *ssid,
* scan. The cfg80211 does not give us the encryption * scan. The cfg80211 does not give us the encryption
* mode at this stage so just setting it to WEP here. * mode at this stage so just setting it to WEP here.
*/ */
wpa_enabled = 0; priv->sec_info.encryption_mode =
auth_type = MWIFIEX_AUTH_MODE_OPEN; MWIFIEX_ENCRYPTION_MODE_WEP104;
ret = mwifiex_set_auth(priv, priv->sec_info.authentication_mode =
MWIFIEX_ENCRYPTION_MODE_WEP104, MWIFIEX_AUTH_MODE_OPEN;
auth_type, wpa_enabled);
} }
goto done; goto done;
...@@ -1075,15 +1074,15 @@ mwifiex_cfg80211_assoc(struct mwifiex_private *priv, size_t ssid_len, u8 *ssid, ...@@ -1075,15 +1074,15 @@ mwifiex_cfg80211_assoc(struct mwifiex_private *priv, size_t ssid_len, u8 *ssid,
if (sme->crypto.n_ciphers_pairwise) { if (sme->crypto.n_ciphers_pairwise) {
pairwise_encrypt_mode = mwifiex_get_mwifiex_cipher(sme->crypto. pairwise_encrypt_mode = mwifiex_get_mwifiex_cipher(sme->crypto.
ciphers_pairwise[0], &wpa_enabled); ciphers_pairwise[0], &wpa_enabled);
ret = mwifiex_set_auth(priv, pairwise_encrypt_mode, auth_type, priv->sec_info.encryption_mode = pairwise_encrypt_mode;
wpa_enabled); priv->sec_info.authentication_mode = auth_type;
} }
if (sme->crypto.cipher_group) { if (sme->crypto.cipher_group) {
group_encrypt_mode = mwifiex_get_mwifiex_cipher(sme->crypto. group_encrypt_mode = mwifiex_get_mwifiex_cipher(sme->crypto.
cipher_group, &wpa_enabled); cipher_group, &wpa_enabled);
ret = mwifiex_set_auth(priv, group_encrypt_mode, auth_type, priv->sec_info.encryption_mode = group_encrypt_mode;
wpa_enabled); priv->sec_info.authentication_mode = auth_type;
} }
if (sme->ie) if (sme->ie)
ret = mwifiex_set_gen_ie(priv, sme->ie, sme->ie_len); ret = mwifiex_set_gen_ie(priv, sme->ie, sme->ie_len);
......
...@@ -277,8 +277,6 @@ struct mwifiex_debug_info { ...@@ -277,8 +277,6 @@ struct mwifiex_debug_info {
enum { enum {
MWIFIEX_AUTH_MODE_OPEN = 0x00, MWIFIEX_AUTH_MODE_OPEN = 0x00,
MWIFIEX_AUTH_MODE_SHARED = 0x01, MWIFIEX_AUTH_MODE_SHARED = 0x01,
MWIFIEX_AUTH_MODE_NETWORKEAP = 0x80,
MWIFIEX_AUTH_MODE_AUTO = 0xFF,
}; };
enum { enum {
......
...@@ -441,20 +441,17 @@ int mwifiex_cmd_802_11_associate(struct mwifiex_private *priv, ...@@ -441,20 +441,17 @@ int mwifiex_cmd_802_11_associate(struct mwifiex_private *priv,
dev_dbg(priv->adapter->dev, "info: ASSOC_CMD: rates size = %d\n", dev_dbg(priv->adapter->dev, "info: ASSOC_CMD: rates size = %d\n",
rates_size); rates_size);
/* Add the Authentication type to be used for Auth frames if needed */ /* Add the Authentication type to be used for Auth frames */
if (priv->sec_info.authentication_mode != MWIFIEX_AUTH_MODE_AUTO) { auth_tlv = (struct mwifiex_ie_types_auth_type *) pos;
auth_tlv = (struct mwifiex_ie_types_auth_type *) pos; auth_tlv->header.type = cpu_to_le16(TLV_TYPE_AUTH_TYPE);
auth_tlv->header.type = cpu_to_le16(TLV_TYPE_AUTH_TYPE); auth_tlv->header.len = cpu_to_le16(sizeof(auth_tlv->auth_type));
auth_tlv->header.len = cpu_to_le16(sizeof(auth_tlv->auth_type)); if (priv->sec_info.wep_status == MWIFIEX_802_11_WEP_ENABLED)
if (priv->sec_info.wep_status == MWIFIEX_802_11_WEP_ENABLED) auth_tlv->auth_type = cpu_to_le16(
auth_tlv->auth_type = cpu_to_le16((u16) priv->sec_info. (u16) priv->sec_info.authentication_mode);
authentication_mode); else
else auth_tlv->auth_type = cpu_to_le16(MWIFIEX_AUTH_MODE_OPEN);
auth_tlv->auth_type =
cpu_to_le16(MWIFIEX_AUTH_MODE_OPEN); pos += sizeof(auth_tlv->header) + le16_to_cpu(auth_tlv->header.len);
pos += sizeof(auth_tlv->header) +
le16_to_cpu(auth_tlv->header.len);
}
if (IS_SUPPORT_MULTI_BANDS(priv->adapter) if (IS_SUPPORT_MULTI_BANDS(priv->adapter)
&& !(ISSUPP_11NENABLED(priv->adapter->fw_cap_info) && !(ISSUPP_11NENABLED(priv->adapter->fw_cap_info)
......
...@@ -994,11 +994,6 @@ int mwifiex_get_channel_list(struct mwifiex_private *priv, ...@@ -994,11 +994,6 @@ int mwifiex_get_channel_list(struct mwifiex_private *priv,
int mwifiex_get_scan_table(struct mwifiex_private *priv, int mwifiex_get_scan_table(struct mwifiex_private *priv,
u8 wait_option, u8 wait_option,
struct mwifiex_scan_resp *scanresp); struct mwifiex_scan_resp *scanresp);
int mwifiex_get_auth_mode(struct mwifiex_private *priv,
u8 wait_option, u32 *auth_mode);
int mwifiex_get_encrypt_mode(struct mwifiex_private *priv,
u8 wait_option,
u32 *encrypt_mode);
int mwifiex_enable_wep_key(struct mwifiex_private *priv, u8 wait_option); int mwifiex_enable_wep_key(struct mwifiex_private *priv, u8 wait_option);
int mwifiex_find_best_bss(struct mwifiex_private *priv, u8 wait_option, int mwifiex_find_best_bss(struct mwifiex_private *priv, u8 wait_option,
struct mwifiex_ssid_bssid *ssid_bssid); struct mwifiex_ssid_bssid *ssid_bssid);
...@@ -1014,9 +1009,6 @@ int mwifiex_drv_get_mode(struct mwifiex_private *priv, u8 wait_option); ...@@ -1014,9 +1009,6 @@ int mwifiex_drv_get_mode(struct mwifiex_private *priv, u8 wait_option);
int mwifiex_drv_change_adhoc_chan(struct mwifiex_private *priv, int channel); int mwifiex_drv_change_adhoc_chan(struct mwifiex_private *priv, int channel);
int mwifiex_set_auth(struct mwifiex_private *priv, int encrypt_mode,
int auth_mode, int wpa_enabled);
int mwifiex_set_encode(struct mwifiex_private *priv, const u8 *key, int mwifiex_set_encode(struct mwifiex_private *priv, const u8 *key,
int key_len, u8 key_index, int disable); int key_len, u8 key_index, int disable);
......
...@@ -1690,20 +1690,6 @@ static int mwifiex_sec_ioctl_set_wapi_key(struct mwifiex_adapter *adapter, ...@@ -1690,20 +1690,6 @@ static int mwifiex_sec_ioctl_set_wapi_key(struct mwifiex_adapter *adapter,
return ret; return ret;
} }
/*
* IOCTL request handler to set/get authentication mode.
*/
static int mwifiex_set_auth_mode(struct mwifiex_private *priv, u32 auth_mode)
{
int ret = 0;
priv->sec_info.authentication_mode = auth_mode;
if (priv->sec_info.authentication_mode == MWIFIEX_AUTH_MODE_NETWORKEAP)
ret = mwifiex_set_wpa_ie_helper(priv, NULL, 0);
return ret;
}
/* /*
* IOCTL request handler to set WEP network key. * IOCTL request handler to set WEP network key.
* *
...@@ -1998,36 +1984,6 @@ int mwifiex_get_signal_info(struct mwifiex_private *priv, u8 wait_option, ...@@ -1998,36 +1984,6 @@ int mwifiex_get_signal_info(struct mwifiex_private *priv, u8 wait_option,
return status; return status;
} }
/*
* Sends IOCTL request to set encryption mode.
*
* This function allocates the IOCTL request buffer, fills it
* with requisite parameters and calls the IOCTL handler.
*/
static int mwifiex_set_encrypt_mode(struct mwifiex_private *priv,
u8 wait_option, u32 encrypt_mode)
{
priv->sec_info.encryption_mode = encrypt_mode;
return 0;
}
/*
* This function set the authentication parameters. It sets both encryption
* mode and authentication mode, and also enables WPA if required.
*/
int
mwifiex_set_auth(struct mwifiex_private *priv, int encrypt_mode,
int auth_mode, int wpa_enabled)
{
if (mwifiex_set_encrypt_mode(priv, MWIFIEX_IOCTL_WAIT, encrypt_mode))
return -EFAULT;
if (mwifiex_set_auth_mode(priv, auth_mode))
return -EFAULT;
return 0;
}
/* /*
* Sends IOCTL request to set encoding parameters. * Sends IOCTL request to set encoding parameters.
* *
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment