Skip to contentSkip to conversation

mwifiex: remove helper functions for displaying 11n capabilities

PATCH New Bing Zhao 1 participant 2 messages Mar 25, 2011 Networking drivers (wireless)

lore
Share & tools
lore
author
#1 lore raw

PATCH 2/2 mwifiex: remove unnecessary _set_auth functions

In reply to Bing Zhao

From: Marc Yang <[email protected]>

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.

---
 drivers/net/wireless/mwifiex/cfg80211.c  |   17 +++++------
 drivers/net/wireless/mwifiex/ioctl.h     |    2 -
 drivers/net/wireless/mwifiex/join.c      |   25 +++++++---------
 drivers/net/wireless/mwifiex/main.h      |    8 -----
 drivers/net/wireless/mwifiex/sta_ioctl.c |   44 ------------------------------
 5 files changed, 19 insertions(+), 77 deletions(-)
drivers/net/wireless/mwifiex/cfg80211.c +8 -9
index 80f367f..84e33f1 100644
@@ -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
 			 * mode at this stage so just setting it to WEP here.
 			 */
-			wpa_enabled = 0;
-			auth_type = MWIFIEX_AUTH_MODE_OPEN;
-			ret = mwifiex_set_auth(priv,
-						MWIFIEX_ENCRYPTION_MODE_WEP104,
-						auth_type, wpa_enabled);
+			priv->sec_info.encryption_mode =
+					MWIFIEX_ENCRYPTION_MODE_WEP104;
+			priv->sec_info.authentication_mode =
+					MWIFIEX_AUTH_MODE_OPEN;
 		}
 
 		goto done;
@@ -1075,15 +1074,15 @@ mwifiex_cfg80211_assoc(struct mwifiex_private *priv, size_t ssid_len, u8 *ssid,
 	if (sme->crypto.n_ciphers_pairwise) {
 		pairwise_encrypt_mode = mwifiex_get_mwifiex_cipher(sme->crypto.
 					ciphers_pairwise[0], &wpa_enabled);
-		ret = mwifiex_set_auth(priv, pairwise_encrypt_mode, auth_type,
-								wpa_enabled);
+		priv->sec_info.encryption_mode = pairwise_encrypt_mode;
+		priv->sec_info.authentication_mode = auth_type;
 	}
 
 	if (sme->crypto.cipher_group) {
 		group_encrypt_mode = mwifiex_get_mwifiex_cipher(sme->crypto.
 						   cipher_group, &wpa_enabled);
-		ret = mwifiex_set_auth(priv, group_encrypt_mode, auth_type,
-								wpa_enabled);
+		priv->sec_info.encryption_mode = group_encrypt_mode;
+		priv->sec_info.authentication_mode = auth_type;
 	}
 	if (sme->ie)
 		ret = mwifiex_set_gen_ie(priv, sme->ie, sme->ie_len);
drivers/net/wireless/mwifiex/ioctl.h +0 -2
index d6babfb..b7e4571 100644
@@ -277,8 +277,6 @@ struct mwifiex_debug_info {
 enum {
 	MWIFIEX_AUTH_MODE_OPEN = 0x00,
 	MWIFIEX_AUTH_MODE_SHARED = 0x01,
-	MWIFIEX_AUTH_MODE_NETWORKEAP = 0x80,
-	MWIFIEX_AUTH_MODE_AUTO = 0xFF,
 };
 
 enum {
drivers/net/wireless/mwifiex/join.c +11 -14
index d06f4c2..98d76d8 100644
@@ -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",
 					rates_size);
 
-	/* Add the Authentication type to be used for Auth frames if needed */
-	if (priv->sec_info.authentication_mode != MWIFIEX_AUTH_MODE_AUTO) {
-		auth_tlv = (struct mwifiex_ie_types_auth_type *) pos;
-		auth_tlv->header.type = cpu_to_le16(TLV_TYPE_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)
-			auth_tlv->auth_type = cpu_to_le16((u16) priv->sec_info.
-							  authentication_mode);
-		else
-			auth_tlv->auth_type =
-				cpu_to_le16(MWIFIEX_AUTH_MODE_OPEN);
-		pos += sizeof(auth_tlv->header) +
-			le16_to_cpu(auth_tlv->header.len);
-	}
+	/* Add the Authentication type to be used for Auth frames */
+	auth_tlv = (struct mwifiex_ie_types_auth_type *) pos;
+	auth_tlv->header.type = cpu_to_le16(TLV_TYPE_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)
+		auth_tlv->auth_type = cpu_to_le16(
+				(u16) priv->sec_info.authentication_mode);
+	else
+		auth_tlv->auth_type = cpu_to_le16(MWIFIEX_AUTH_MODE_OPEN);
+
+	pos += sizeof(auth_tlv->header) + le16_to_cpu(auth_tlv->header.len);
 
 	if (IS_SUPPORT_MULTI_BANDS(priv->adapter)
 	    && !(ISSUPP_11NENABLED(priv->adapter->fw_cap_info)
drivers/net/wireless/mwifiex/main.h +0 -8
index 2b0ad8e..f6fe105 100644
@@ -994,11 +994,6 @@ int mwifiex_get_channel_list(struct mwifiex_private *priv,
 int mwifiex_get_scan_table(struct mwifiex_private *priv,
 			   u8 wait_option,
 			   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_find_best_bss(struct mwifiex_private *priv, u8 wait_option,
 			  struct mwifiex_ssid_bssid *ssid_bssid);
@@ -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_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 key_len, u8 key_index, int disable);
 
drivers/net/wireless/mwifiex/sta_ioctl.c +0 -44

56 lines not on this page · raw message

Signature · 1 line
1.7.0.2

Bing Zhao

author
#0 lore raw

PATCH 1/2 mwifiex: remove helper functions for displaying 11n capabilities

From: Yogesh Ashok Powar <[email protected]>

'iw list' is sufficient to retrieve the information which was displayed by these functions.

---
 drivers/net/wireless/mwifiex/11n.c    |   96 ---------------------------------
 drivers/net/wireless/mwifiex/11n.h    |    2 -
 drivers/net/wireless/mwifiex/cmdevt.c |    2 -
 drivers/net/wireless/mwifiex/fw.h     |   16 ------
 4 files changed, 0 insertions(+), 116 deletions(-)
drivers/net/wireless/mwifiex/11n.c +0 -96
index 0e04a21..7b7b86d 100644
@@ -140,102 +140,6 @@ mwifiex_fill_cap_info(struct mwifiex_private *priv,
 }
 
 /*
- * Shows HT capability information fields.
- *
- * The following HT capability information fields are supported.
- *      - Maximum AMSDU length (3839 bytes or 7935 bytes)
- *      - Beam forming support
- *      - Greenfield preamble support
- *      - AMPDU support
- *      - MIMO Power Save support
- *      - Rx STBC support
- *      - Tx STBC support
- *      - Short GI for 20 MHz support
- *      - Short GI for 40 MHz support
- *      - LDPC coded packets receive support
- *      - Number of delayed BA streams
- *      - Number of immediate BA streams
- *      - 10 MHz channel width support
- *      - 20 MHz channel width support
- *      - 40 MHz channel width support
- *      - Presence of Tx antenna A/B/C/D
- *      - Presence of Rx antenna A/B/C/D
- */
-void
-mwifiex_show_dot_11n_dev_cap(struct mwifiex_adapter *adapter, u32 cap)
-{
-	dev_dbg(adapter->dev, "info: GET_HW_SPEC: Max MSDU len = %s octets\n",
-	       (ISSUPP_MAXAMSDU(cap) ? "7935" : "3839"));
-	dev_dbg(adapter->dev, "info: GET_HW_SPEC: Beam forming %s\n",
-	       (ISSUPP_BEAMFORMING(cap) ? "supported" : "not supported"));
-	dev_dbg(adapter->dev, "info: GET_HW_SPEC: Greenfield preamble %s\n",
-	       (ISSUPP_GREENFIELD(cap) ? "supported" : "not supported"));
-	dev_dbg(adapter->dev, "info: GET_HW_SPEC: AMPDU %s\n",
-	       (ISSUPP_AMPDU(cap) ? "supported" : "not supported"));
-	dev_dbg(adapter->dev, "info: GET_HW_SPEC: MIMO Power Save %s\n",
-	       (ISSUPP_MIMOPS(cap) ? "supported" : "not supported"));
-	dev_dbg(adapter->dev, "info: GET_HW_SPEC: Rx STBC %s\n",
-	       (ISSUPP_RXSTBC(cap) ? "supported" : "not supported"));
-	dev_dbg(adapter->dev, "info: GET_HW_SPEC: Tx STBC %s\n",
-	       (ISSUPP_TXSTBC(cap) ? "supported" : "not supported"));
-	dev_dbg(adapter->dev, "info: GET_HW_SPEC: Short GI for 40 Mhz %s\n",
-	       (ISSUPP_SHORTGI40(cap) ? "supported" : "not supported"));
-	dev_dbg(adapter->dev, "info: GET_HW_SPEC: Short GI for 20 Mhz %s\n",
-	       (ISSUPP_SHORTGI20(cap) ? "supported" : "not supported"));
-	dev_dbg(adapter->dev, "info: GET_HW_SPEC: LDPC coded packet receive %s\n",
-	       (ISSUPP_RXLDPC(cap) ? "supported" : "not supported"));
-	dev_dbg(adapter->dev,
-		"info: GET_HW_SPEC: Number of Delayed Block Ack streams = %d\n",
-	       GET_DELAYEDBACK(cap));
-	dev_dbg(adapter->dev,
-		"info: GET_HW_SPEC: Number of Immediate Block Ack streams = %d\n",
-	       GET_IMMEDIATEBACK(cap));
-	dev_dbg(adapter->dev, "info: GET_HW_SPEC: 40 Mhz channel width %s\n",
-	       (ISSUPP_CHANWIDTH40(cap) ? "supported" : "not supported"));
-	dev_dbg(adapter->dev, "info: GET_HW_SPEC: 20 Mhz channel width %s\n",
-	       (ISSUPP_CHANWIDTH20(cap) ? "supported" : "not supported"));
-	dev_dbg(adapter->dev, "info: GET_HW_SPEC: 10 Mhz channel width %s\n",
-	       (ISSUPP_CHANWIDTH10(cap) ? "supported" : "not supported"));
-
-	if (ISSUPP_RXANTENNAA(cap))
-		dev_dbg(adapter->dev, "info: GET_HW_SPEC: Prescence of Rx antennea A\n");
-
-	if (ISSUPP_RXANTENNAB(cap))
-		dev_dbg(adapter->dev, "info: GET_HW_SPEC: Prescence of Rx antennea B\n");
-
-	if (ISSUPP_RXANTENNAC(cap))
-		dev_dbg(adapter->dev, "info: GET_HW_SPEC: Prescence of Rx antennea C\n");
-
-	if (ISSUPP_RXANTENNAD(cap))
-		dev_dbg(adapter->dev, "info: GET_HW_SPEC: Prescence of Rx antennea D\n");
-
-	if (ISSUPP_TXANTENNAA(cap))
-		dev_dbg(adapter->dev, "info: GET_HW_SPEC: Prescence of Tx antennea A\n");
-
-	if (ISSUPP_TXANTENNAB(cap))
-		dev_dbg(adapter->dev, "info: GET_HW_SPEC: Prescence of Tx antennea B\n");
-
-	if (ISSUPP_TXANTENNAC(cap))
-		dev_dbg(adapter->dev, "info: GET_HW_SPEC: Prescence of Tx antennea C\n");
-
-	if (ISSUPP_TXANTENNAD(cap))
-		dev_dbg(adapter->dev, "info: GET_HW_SPEC: Prescence of Tx antennea D\n");
-
-	return;
-}
-
-/*
- * Shows HT MCS support field.
- */
-void
-mwifiex_show_dev_mcs_support(struct mwifiex_adapter *adapter, u8 support)
-{
-	dev_dbg(adapter->dev, "info: GET_HW_SPEC: MCSs for %dx%d MIMO\n",
-	       GET_RXMCSSUPP(support), GET_TXMCSSUPP(support));
-	return;
-}
-
-/*
  * This function returns the pointer to an entry in BA Stream
  * table which matches the requested BA status.
  */
drivers/net/wireless/mwifiex/11n.h +0 -2
index 769a27f..71a853e 100644
@@ -24,8 +24,6 @@
 #include "11n_rxreorder.h"
 #include "wmm.h"
 
-void mwifiex_show_dot_11n_dev_cap(struct mwifiex_adapter *adapter, u32 cap);
-void mwifiex_show_dev_mcs_support(struct mwifiex_adapter *adapter, u8 support);
 int mwifiex_ret_11n_delba(struct mwifiex_private *priv,
 			  struct host_cmd_ds_command *resp);
 int mwifiex_ret_11n_addba_req(struct mwifiex_private *priv,
drivers/net/wireless/mwifiex/cmdevt.c +0 -2
index 3a8fe1e..24a3b6b 100644
@@ -1452,8 +1452,6 @@ int mwifiex_ret_get_hw_spec(struct mwifiex_private *priv,
 		DEFAULT_11N_CAP_MASK;
 	adapter->hw_dev_mcs_support = hw_spec->dev_mcs_support;
 	adapter->usr_dev_mcs_support = adapter->hw_dev_mcs_support;
-	mwifiex_show_dot_11n_dev_cap(adapter, adapter->hw_dot_11n_dev_cap);
-	mwifiex_show_dev_mcs_support(adapter, adapter->hw_dev_mcs_support);
 
 	if (adapter->if_ops.update_mp_end_port)
 		adapter->if_ops.update_mp_end_port(adapter,
drivers/net/wireless/mwifiex/fw.h +0 -16
index e5dae45..d1a5a10 100644
@@ -196,30 +196,14 @@ enum MWIFIEX_802_11_WEP_STATUS {
 
 #define DEFAULT_11N_CAP_MASK	(HWSPEC_SHORTGI20_SUPP | HWSPEC_RXSTBC_SUPP)
 #define ISSUPP_11NENABLED(FwCapInfo) (FwCapInfo & BIT(11))
-#define ISSUPP_MAXAMSDU(Dot11nDevCap) (Dot11nDevCap & BIT(31))
-#define ISSUPP_BEAMFORMING(Dot11nDevCap) (Dot11nDevCap & BIT(30))
 #define ISSUPP_GREENFIELD(Dot11nDevCap) (Dot11nDevCap & BIT(29))
-#define ISSUPP_AMPDU(Dot11nDevCap) (Dot11nDevCap & BIT(28))
-#define ISSUPP_MIMOPS(Dot11nDevCap) (Dot11nDevCap & BIT(27))
 #define ISSUPP_RXSTBC(Dot11nDevCap) (Dot11nDevCap & BIT(26))
 #define ISSUPP_TXSTBC(Dot11nDevCap) (Dot11nDevCap & BIT(25))
 #define ISSUPP_SHORTGI40(Dot11nDevCap) (Dot11nDevCap & BIT(24))
 #define ISSUPP_SHORTGI20(Dot11nDevCap) (Dot11nDevCap & BIT(23))
-#define ISSUPP_RXLDPC(Dot11nDevCap) (Dot11nDevCap & BIT(22))
 #define GET_DELAYEDBACK(Dot11nDevCap) (((Dot11nDevCap >> 20) & 0x03))
-#define GET_IMMEDIATEBACK(Dot11nDevCap) (((Dot11nDevCap >> 18) & 0x03))
 #define ISSUPP_CHANWIDTH40(Dot11nDevCap) (Dot11nDevCap & BIT(17))
-#define ISSUPP_CHANWIDTH20(Dot11nDevCap) (Dot11nDevCap & BIT(16))
-#define ISSUPP_CHANWIDTH10(Dot11nDevCap) (Dot11nDevCap & BIT(15))
 #define ISENABLED_40MHZ_INTOLARENT(Dot11nDevCap) (Dot11nDevCap & BIT(8))
-#define ISSUPP_RXANTENNAD(Dot11nDevCap) (Dot11nDevCap & BIT(7))
-#define ISSUPP_RXANTENNAC(Dot11nDevCap) (Dot11nDevCap & BIT(6))
-#define ISSUPP_RXANTENNAB(Dot11nDevCap) (Dot11nDevCap & BIT(5))
-#define ISSUPP_RXANTENNAA(Dot11nDevCap) (Dot11nDevCap & BIT(4))
-#define ISSUPP_TXANTENNAD(Dot11nDevCap) (Dot11nDevCap & BIT(3))
-#define ISSUPP_TXANTENNAC(Dot11nDevCap) (Dot11nDevCap & BIT(2))
-#define ISSUPP_TXANTENNAB(Dot11nDevCap) (Dot11nDevCap & BIT(1))
-#define ISSUPP_TXANTENNAA(Dot11nDevCap) (Dot11nDevCap & BIT(0))
 #define SETSUPP_CHANWIDTH40(Dot11nDevCap) (Dot11nDevCap |= BIT(17))
 #define RESETSUPP_CHANWIDTH40(Dot11nDevCap) (Dot11nDevCap &= ~BIT(17))
 #define GET_TXMCSSUPP(DevMCSSupported) (DevMCSSupported >> 4)
Signature · 1 line
1.7.0.2