Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5eb02e44 authored by Amitkumar Karwar's avatar Amitkumar Karwar Committed by John W. Linville
Browse files

mwifiex: remove unnecessary enum MWIFIEX_802_11_WEP_STATUS



Instead of defining an 'enum', we can simply use 'u8' flag for WEP
status. Rename 'wep_status' to 'wep_enabled' to match with
'wpa_enabled' and 'wpa2_enabled'.

Signed-off-by: default avatarAmitkumar Karwar <akarwar@marvell.com>
Signed-off-by: default avatarBing Zhao <bzhao@marvell.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 1a907b74
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -146,7 +146,7 @@ mwifiex_cfg80211_set_default_key(struct wiphy *wiphy, struct net_device *netdev,
	struct mwifiex_private *priv = mwifiex_netdev_get_priv(netdev);
	struct mwifiex_private *priv = mwifiex_netdev_get_priv(netdev);


	/* Return if WEP key not configured */
	/* Return if WEP key not configured */
	if (priv->sec_info.wep_status == MWIFIEX_802_11_WEP_DISABLED)
	if (!priv->sec_info.wep_enabled)
		return 0;
		return 0;


	if (mwifiex_set_encode(priv, NULL, 0, key_index, 0)) {
	if (mwifiex_set_encode(priv, NULL, 0, key_index, 0)) {
+0 −5
Original line number Original line Diff line number Diff line
@@ -86,11 +86,6 @@ enum MWIFIEX_802_11_PRIVACY_FILTER {
	MWIFIEX_802_11_PRIV_FILTER_8021X_WEP
	MWIFIEX_802_11_PRIV_FILTER_8021X_WEP
};
};


enum MWIFIEX_802_11_WEP_STATUS {
	MWIFIEX_802_11_WEP_ENABLED,
	MWIFIEX_802_11_WEP_DISABLED,
};

#define CAL_SNR(RSSI, NF)		((s16)((s16)(RSSI)-(s16)(NF)))
#define CAL_SNR(RSSI, NF)		((s16)((s16)(RSSI)-(s16)(NF)))


#define PROPRIETARY_TLV_BASE_ID                 0x0100
#define PROPRIETARY_TLV_BASE_ID                 0x0100
+1 −1
Original line number Original line Diff line number Diff line
@@ -82,7 +82,7 @@ static int mwifiex_init_priv(struct mwifiex_private *priv)
	priv->bcn_avg_factor = DEFAULT_BCN_AVG_FACTOR;
	priv->bcn_avg_factor = DEFAULT_BCN_AVG_FACTOR;
	priv->data_avg_factor = DEFAULT_DATA_AVG_FACTOR;
	priv->data_avg_factor = DEFAULT_DATA_AVG_FACTOR;


	priv->sec_info.wep_status = MWIFIEX_802_11_WEP_DISABLED;
	priv->sec_info.wep_enabled = 0;
	priv->sec_info.authentication_mode = NL80211_AUTHTYPE_OPEN_SYSTEM;
	priv->sec_info.authentication_mode = NL80211_AUTHTYPE_OPEN_SYSTEM;
	priv->sec_info.encryption_mode = 0;
	priv->sec_info.encryption_mode = 0;
	for (i = 0; i < ARRAY_SIZE(priv->wep_key); i++)
	for (i = 0; i < ARRAY_SIZE(priv->wep_key); i++)
+2 −3
Original line number Original line Diff line number Diff line
@@ -417,7 +417,7 @@ int mwifiex_cmd_802_11_associate(struct mwifiex_private *priv,
	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_enabled)
		auth_tlv->auth_type = cpu_to_le16(
		auth_tlv->auth_type = cpu_to_le16(
				(u16) priv->sec_info.authentication_mode);
				(u16) priv->sec_info.authentication_mode);
	else
	else
@@ -1069,8 +1069,7 @@ mwifiex_cmd_802_11_ad_hoc_join(struct mwifiex_private *priv,
	priv->curr_bss_params.bss_descriptor.channel = bss_desc->channel;
	priv->curr_bss_params.bss_descriptor.channel = bss_desc->channel;
	priv->curr_bss_params.band = (u8) bss_desc->bss_band;
	priv->curr_bss_params.band = (u8) bss_desc->bss_band;


	if (priv->sec_info.wep_status == MWIFIEX_802_11_WEP_ENABLED
	if (priv->sec_info.wep_enabled || priv->sec_info.wpa_enabled)
	    || priv->sec_info.wpa_enabled)
		tmp_cap |= WLAN_CAPABILITY_PRIVACY;
		tmp_cap |= WLAN_CAPABILITY_PRIVACY;


	if (IS_SUPPORT_MULTI_BANDS(priv->adapter)) {
	if (IS_SUPPORT_MULTI_BANDS(priv->adapter)) {
+1 −1
Original line number Original line Diff line number Diff line
@@ -217,7 +217,7 @@ struct mwifiex_802_11_security {
	u8 wpa2_enabled;
	u8 wpa2_enabled;
	u8 wapi_enabled;
	u8 wapi_enabled;
	u8 wapi_key_on;
	u8 wapi_key_on;
	enum MWIFIEX_802_11_WEP_STATUS wep_status;
	u8 wep_enabled;
	u32 authentication_mode;
	u32 authentication_mode;
	u32 encryption_mode;
	u32 encryption_mode;
};
};
Loading