* [PATCH 01/11] mwifiex: remove txratecfg command from debugfs
2011-03-17 0:09 [PATCH 00/11] remove configuration APIs from debugfs (part 2) Bing Zhao
@ 2011-03-17 0:09 ` Bing Zhao
2011-03-17 0:09 ` [PATCH 02/11] mwifiex: remove httxcfg " Bing Zhao
` (10 subsequent siblings)
11 siblings, 0 replies; 16+ messages in thread
From: Bing Zhao @ 2011-03-17 0:09 UTC (permalink / raw)
To: linux-wireless
Cc: John W. Linville, Johannes Berg, Amitkumar Karwar, Kiran Divekar,
Yogesh Powar, Marc Yang, Frank Huang, Bing Zhao
From: Marc Yang <yangyang@marvell.com>
remove the Tx rate configuration API from debugfs
Signed-off-by: Marc Yang <yangyang@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
---
drivers/net/wireless/mwifiex/README | 45 -------
drivers/net/wireless/mwifiex/debugfs.c | 72 ----------
drivers/net/wireless/mwifiex/decl.h | 4 -
drivers/net/wireless/mwifiex/ioctl.h | 6 -
drivers/net/wireless/mwifiex/main.c | 1 -
drivers/net/wireless/mwifiex/main.h | 1 -
drivers/net/wireless/mwifiex/sta_ioctl.c | 209 +-----------------------------
7 files changed, 7 insertions(+), 331 deletions(-)
diff --git a/drivers/net/wireless/mwifiex/README b/drivers/net/wireless/mwifiex/README
index aa5ce10..374df48 100644
--- a/drivers/net/wireless/mwifiex/README
+++ b/drivers/net/wireless/mwifiex/README
@@ -354,51 +354,6 @@ qoscfg
echo "15" > qoscfg : Set WMM IE QOS info to 0x0f
cat qoscfg : Get WMM IE QOS info
-txratecfg
- This command is used to set/get the transmit data rate.
-
- Note:
- The data rate can be set only after association.
-
- Usage:
- echo "<n> " > txratecfg
- cat txratecfg
-
- Where <n>
- data rate
- Data rate
- 0 1 Mbps
- 1 2 Mbps
- 2 5.5 Mbps
- 3 11 Mbps
- 4 6 Mbps
- 5 9 Mbps
- 6 12 Mbps
- 7 18 Mbps
- 8 24 Mbps
- 9 36 Mbps
- 10 48 Mbps
- 11 54 Mbps
- 12 MCS0
- 13 MCS1
- 14 MCS2
- 15 MCS3
- 16 MCS4
- 17 MCS5
- 18 MCS6
- 19 MCS7
- 44 MCS32
- 0xff Auto
-
- Examples:
- echo "3" > txratecfg : Set fixed Tx rate to 11 Mbps
- echo "11" > txratecfg : Set fixed Tx rate to 54 Mbps
- echo "15" > txratecfg : Set fixed Tx rate to MCS3
- echo "255" > txratecfg : Disable fixed rate and uses auto rate
- cat txratecfg : Read the current data rate setting
-
-
-
regrdwr
This command is used to read/write the adapter register.
diff --git a/drivers/net/wireless/mwifiex/debugfs.c b/drivers/net/wireless/mwifiex/debugfs.c
index 6b3600b..1809c44 100644
--- a/drivers/net/wireless/mwifiex/debugfs.c
+++ b/drivers/net/wireless/mwifiex/debugfs.c
@@ -914,76 +914,6 @@ mwifiex_qoscfg_read(struct file *file, char __user *ubuf,
}
/*
- * Proc txratecfg file write handler.
- *
- * This function is called when the 'txratecfg' file is opened for writing
- *
- * This function can be used to set the Tx rate configuration.
- */
-static ssize_t
-mwifiex_txratecfg_write(struct file *file, const char __user *ubuf,
- size_t count, loff_t *ppos)
-{
- struct mwifiex_private *priv =
- (struct mwifiex_private *) file->private_data;
- unsigned long addr = get_zeroed_page(GFP_KERNEL);
- char *buf = (char *) addr;
- size_t buf_size = min(count, (size_t) (PAGE_SIZE - 1));
- int txrateindex = 0;
- int ret = 0;
-
- if (!buf)
- return -ENOMEM;
-
- if (copy_from_user(buf, ubuf, buf_size)) {
- ret = -EFAULT;
- goto done;
- }
-
- sscanf(buf, "%d", &txrateindex);
-
- ret = mwifiex_set_tx_rate_cfg(priv, txrateindex);
-
- if (!ret)
- ret = count;
-
-done:
- free_page(addr);
- return ret;
-}
-
-/*
- * Proc txratecfg file read handler.
- *
- * This function is called when the 'txratecfg' file is opened for reading
- *
- * This function can be used to get the Tx rate configuration.
- */
-static ssize_t
-mwifiex_txratecfg_read(struct file *file, char __user *ubuf,
- size_t count, loff_t *ppos)
-{
- struct mwifiex_private *priv =
- (struct mwifiex_private *) file->private_data;
- unsigned long addr = get_zeroed_page(GFP_KERNEL);
- char *buf = (char *) addr;
- int pos = 0, ret = 0;
- int txrateindex = 0;
-
- if (!buf)
- return -ENOMEM;
-
- mwifiex_get_tx_rate_cfg(priv, &txrateindex);
-
- pos += snprintf(buf, PAGE_SIZE, "%d\n", txrateindex);
-
- ret = simple_read_from_buffer(ubuf, count, ppos, buf, pos);
-
- free_page(addr);
- return ret;
-}
-
-/*
* Proc httxcfg file write handler.
*
* This function is called when the 'httxcfg' file is opened for writing
@@ -1634,7 +1564,6 @@ MWIFIEX_DFS_FILE_OPS(amsduaggrctrl);
MWIFIEX_DFS_FILE_OPS(sleeppd);
MWIFIEX_DFS_FILE_OPS(mpactrl);
MWIFIEX_DFS_FILE_OPS(qoscfg);
-MWIFIEX_DFS_FILE_OPS(txratecfg);
MWIFIEX_DFS_FILE_OPS(httxcfg);
MWIFIEX_DFS_FILE_READ_OPS(getlog);
MWIFIEX_DFS_FILE_OPS(antcfg);
@@ -1666,7 +1595,6 @@ mwifiex_dev_debugfs_init(struct mwifiex_private *priv)
MWIFIEX_DFS_ADD_FILE(sleeppd);
MWIFIEX_DFS_ADD_FILE(mpactrl);
MWIFIEX_DFS_ADD_FILE(qoscfg);
- MWIFIEX_DFS_ADD_FILE(txratecfg);
MWIFIEX_DFS_ADD_FILE(httxcfg);
MWIFIEX_DFS_ADD_FILE(getlog);
MWIFIEX_DFS_ADD_FILE(antcfg);
diff --git a/drivers/net/wireless/mwifiex/decl.h b/drivers/net/wireless/mwifiex/decl.h
index 37421af..4e1f115 100644
--- a/drivers/net/wireless/mwifiex/decl.h
+++ b/drivers/net/wireless/mwifiex/decl.h
@@ -39,15 +39,11 @@
#define MWIFIEX_AMPDU_DEF_RXWINSIZE 16
#define MWIFIEX_DEFAULT_BLOCK_ACK_TIMEOUT 0xffff
-#define AUTO_RATE 0xff
#define MWIFIEX_RATE_INDEX_HRDSSS0 0
#define MWIFIEX_RATE_INDEX_HRDSSS3 3
#define MWIFIEX_RATE_INDEX_OFDM0 4
#define MWIFIEX_RATE_INDEX_OFDM7 11
#define MWIFIEX_RATE_INDEX_MCS0 12
-#define MWIFIEX_RATE_INDEX_MCS7 19
-#define MWIFIEX_RATE_INDEX_MCS32 44
-#define MWIFIEX_RATE_INDEX_MCS127 139
#define MWIFIEX_RATE_BITMAP_OFDM0 16
#define MWIFIEX_RATE_BITMAP_OFDM7 23
diff --git a/drivers/net/wireless/mwifiex/ioctl.h b/drivers/net/wireless/mwifiex/ioctl.h
index d4e895d..115476a 100644
--- a/drivers/net/wireless/mwifiex/ioctl.h
+++ b/drivers/net/wireless/mwifiex/ioctl.h
@@ -339,15 +339,9 @@ struct mwifiex_ds_esupp_mode {
u32 act_groupcipher;
};
-enum {
- MWIFIEX_RATE_INDEX,
- MWIFIEX_RATE_VALUE
-};
-
struct mwifiex_rate_cfg {
u32 action;
u32 is_rate_auto;
- u32 rate_type;
u32 rate;
};
diff --git a/drivers/net/wireless/mwifiex/main.c b/drivers/net/wireless/mwifiex/main.c
index a5a1d78..7b7f344 100644
--- a/drivers/net/wireless/mwifiex/main.c
+++ b/drivers/net/wireless/mwifiex/main.c
@@ -681,7 +681,6 @@ mwifiex_init_priv_params(struct mwifiex_private *priv, struct net_device *dev)
init_waitqueue_head(&priv->cmd_wait_q);
init_waitqueue_head(&priv->w_stats_wait_q);
priv->current_key_index = 0;
- priv->rate_index = AUTO_RATE;
priv->media_connected = false;
memset(&priv->nick_name, 0, sizeof(priv->nick_name));
priv->num_tx_timeout = 0;
diff --git a/drivers/net/wireless/mwifiex/main.h b/drivers/net/wireless/mwifiex/main.h
index b34e811..f3626fc 100644
--- a/drivers/net/wireless/mwifiex/main.h
+++ b/drivers/net/wireless/mwifiex/main.h
@@ -495,7 +495,6 @@ struct mwifiex_private {
u16 w_stats_wait_q_woken;
wait_queue_head_t w_stats_wait_q;
u16 current_key_index;
- u16 rate_index;
struct semaphore async_sem;
u8 scan_pending_on_block;
u8 report_scan_result;
diff --git a/drivers/net/wireless/mwifiex/sta_ioctl.c b/drivers/net/wireless/mwifiex/sta_ioctl.c
index 0c72371..b880a00 100644
--- a/drivers/net/wireless/mwifiex/sta_ioctl.c
+++ b/drivers/net/wireless/mwifiex/sta_ioctl.c
@@ -1440,94 +1440,6 @@ static int mwifiex_rate_ioctl_set_rate_value(struct mwifiex_private *priv,
}
/*
- * IOCTL request handler to get rate.
- *
- * This function prepares the correct firmware command and
- * issues it to get the data rate index.
- */
-static int mwifiex_rate_ioctl_get_rate_index(struct mwifiex_private *priv,
- struct mwifiex_wait_queue *wait,
- struct mwifiex_rate_cfg *rate_cfg)
-{
- int ret = 0;
-
- /* Send request to firmware */
- ret = mwifiex_prepare_cmd(priv, HostCmd_CMD_TX_RATE_CFG,
- HostCmd_ACT_GEN_GET, 0, wait, rate_cfg);
- if (!ret)
- ret = -EINPROGRESS;
-
- return ret;
-}
-
-/*
- * IOCTL request handler to set rate.
- *
- * This function prepares the correct firmware command and
- * issues it to set the data rate index.
- */
-static int mwifiex_rate_ioctl_set_rate_index(struct mwifiex_private *priv,
- struct mwifiex_wait_queue *wait,
- struct mwifiex_rate_cfg *rate_cfg)
-{
- int rate_index;
- u32 i;
- int ret = 0;
- u16 bitmap_rates[MAX_BITMAP_RATES_SIZE];
-
- rate_index = rate_cfg->rate;
- if (rate_cfg->is_rate_auto) {
- memset(bitmap_rates, 0, sizeof(bitmap_rates));
- /* Support all HR/DSSS rates */
- bitmap_rates[0] = 0x000F;
- /* Support all OFDM rates */
- bitmap_rates[1] = 0x00FF;
- /* Support all HT-MCSs rate */
- for (i = 0; i < ARRAY_SIZE(bitmap_rates) - 3; i++)
- bitmap_rates[i + 2] = 0xFFFF;
- bitmap_rates[9] = 0x3FFF;
- } else {
- dev_dbg(priv->adapter->dev, "info: Rate index is %d\n",
- rate_index);
- memset(bitmap_rates, 0, sizeof(bitmap_rates));
- /* Bitmap of HR/DSSS rates */
- if (rate_index >= MWIFIEX_RATE_INDEX_HRDSSS0 &&
- rate_index <= MWIFIEX_RATE_INDEX_HRDSSS3)
- bitmap_rates[0] = 1 << rate_index;
- /* Bitmap of OFDM rates */
- if (rate_index >= MWIFIEX_RATE_INDEX_OFDM0 &&
- rate_index <= MWIFIEX_RATE_INDEX_OFDM7)
- bitmap_rates[1] =
- 1 << (rate_index - MWIFIEX_RATE_INDEX_OFDM0);
- /* Bitmap of HT-MCSs allowed for initial rate */
- if (rate_index >= MWIFIEX_RATE_INDEX_MCS0 &&
- rate_index <= MWIFIEX_RATE_INDEX_MCS32)
- bitmap_rates[((rate_index -
- MWIFIEX_RATE_INDEX_MCS0) / 16) + 2] =
- 1 << ((rate_index - MWIFIEX_RATE_INDEX_MCS0) %
- 16);
- }
-
- dev_dbg(priv->adapter->dev, "info: RateBitmap="
- "%04x%04x%04x%04x%04x%04x%04x%04x%04x%04x, "
- "IsRateAuto=%d, DataRate=%d\n",
- bitmap_rates[9], bitmap_rates[8],
- bitmap_rates[7], bitmap_rates[6],
- bitmap_rates[5], bitmap_rates[4],
- bitmap_rates[3], bitmap_rates[2],
- bitmap_rates[1], bitmap_rates[0],
- priv->is_data_rate_auto, priv->data_rate);
-
- /* Send request to firmware */
- ret = mwifiex_prepare_cmd(priv, HostCmd_CMD_TX_RATE_CFG,
- HostCmd_ACT_GEN_SET, 0, wait, bitmap_rates);
- if (!ret)
- ret = -EINPROGRESS;
-
- return ret;
-}
-
-/*
* IOCTL request handler to set/get rate.
*
* This function can be used to set/get either the rate value or the
@@ -1541,21 +1453,13 @@ static int mwifiex_rate_ioctl_cfg(struct mwifiex_private *priv,
if (!rate_cfg)
return -1;
- if (rate_cfg->rate_type == MWIFIEX_RATE_VALUE) {
- if (rate_cfg->action == HostCmd_ACT_GEN_GET)
- status = mwifiex_rate_ioctl_get_rate_value(
- priv, wait, rate_cfg);
- else
- status = mwifiex_rate_ioctl_set_rate_value(
- priv, wait, rate_cfg);
- } else {
- if (rate_cfg->action == HostCmd_ACT_GEN_GET)
- status = mwifiex_rate_ioctl_get_rate_index(
- priv, wait, rate_cfg);
- else
- status = mwifiex_rate_ioctl_set_rate_index(
- priv, wait, rate_cfg);
- }
+
+ if (rate_cfg->action == HostCmd_ACT_GEN_GET)
+ status = mwifiex_rate_ioctl_get_rate_value(
+ priv, wait, rate_cfg);
+ else
+ status = mwifiex_rate_ioctl_set_rate_value(
+ priv, wait, rate_cfg);
return status;
}
@@ -1580,7 +1484,6 @@ int mwifiex_drv_get_data_rate(struct mwifiex_private *priv,
memset(rate, 0, sizeof(struct mwifiex_rate_cfg));
rate->action = HostCmd_ACT_GEN_GET;
- rate->rate_type = MWIFIEX_RATE_VALUE;
ret = mwifiex_rate_ioctl_cfg(priv, wait, rate);
ret = mwifiex_request_ioctl(priv, wait, ret, wait_option);
@@ -3018,104 +2921,6 @@ done:
}
/*
- * Sends IOCTL request to set Tx rate configurations.
- *
- * This function allocates the IOCTL request buffer, fills it
- * with requisite parameters and calls the IOCTL handler.
- */
-int
-mwifiex_set_tx_rate_cfg(struct mwifiex_private *priv, int tx_rate_idx)
-{
- int ret = 0;
- struct mwifiex_rate_cfg rate_cfg;
- int status = 0;
- struct mwifiex_wait_queue *wait = NULL;
- u8 wait_option = MWIFIEX_IOCTL_WAIT;
-
- /* Allocate wait buffer */
- wait = mwifiex_alloc_fill_wait_queue(priv, wait_option);
- if (!wait)
- return -ENOMEM;
-
- memset(&rate_cfg, 0, sizeof(struct mwifiex_rate_cfg));
- rate_cfg.action = HostCmd_ACT_GEN_SET;
- rate_cfg.rate_type = MWIFIEX_RATE_INDEX;
- if (tx_rate_idx == AUTO_RATE) {
- rate_cfg.is_rate_auto = 1;
- } else {
- if ((tx_rate_idx != MWIFIEX_RATE_INDEX_MCS32) &&
- ((tx_rate_idx < 0)
- || (tx_rate_idx > MWIFIEX_RATE_INDEX_MCS7))) {
- ret = -EINVAL;
- goto done;
- }
- rate_cfg.rate = tx_rate_idx;
- }
- status = mwifiex_rate_ioctl_cfg(priv, wait, &rate_cfg);
-
- if (mwifiex_request_ioctl(priv, wait, status, wait_option))
- ret = -EFAULT;
-done:
- kfree(wait);
- return ret;
-}
-
-/*
- * Sends IOCTL request to get Tx rate configurations.
- *
- * This function allocates the IOCTL request buffer, fills it
- * with requisite parameters and calls the IOCTL handler.
- */
-int
-mwifiex_get_tx_rate_cfg(struct mwifiex_private *priv, int *tx_rate_idx)
-{
- int ret = 0;
- struct mwifiex_rate_cfg rate_cfg;
- int status = 0;
- struct mwifiex_wait_queue *wait = NULL;
- u8 wait_option = MWIFIEX_IOCTL_WAIT;
-
- /* TX rate configuration can be set only if media connected */
- if (!priv->media_connected) {
- dev_dbg(priv->adapter->dev,
- "info: Can not set txratecfg in disconnected state\n");
- return -1;
- }
-
- wait = mwifiex_alloc_fill_wait_queue(priv, wait_option);
- if (!wait)
- return -ENOMEM;
-
- memset(&rate_cfg, 0, sizeof(struct mwifiex_rate_cfg));
- rate_cfg.action = HostCmd_ACT_GEN_GET;
- rate_cfg.rate_type = MWIFIEX_RATE_INDEX;
- status = mwifiex_rate_ioctl_cfg(priv, wait, &rate_cfg);
-
- if (mwifiex_request_ioctl(priv, wait, status, wait_option)) {
- ret = -EFAULT;
- goto done;
- }
-
- if (priv->tx_htinfo & BIT(0))
- rate_cfg.rate = priv->tx_rate + MWIFIEX_RATE_INDEX_MCS0;
- else
- /* For HostCmd_CMD_802_11_TX_RATE_QUERY
- , there is a hole in rate table
- between HR/DSSS and OFDM rates, so
- minus 1 for OFDM rate index */
- rate_cfg.rate = (priv->tx_rate > MWIFIEX_RATE_INDEX_OFDM0)
- ? priv->tx_rate - 1 : priv->tx_rate;
-
- if (priv->is_data_rate_auto)
- *tx_rate_idx = AUTO_RATE;
- else
- *tx_rate_idx = rate_cfg.rate;
-done:
- kfree(wait);
- return ret;
-}
-
-/*
* Set eWPA mode if passphrase/psk is set
*/
int mwifiex_set_ewpa_mode_from_passphrase(struct mwifiex_private *priv,
--
1.7.0.2
^ permalink raw reply related [flat|nested] 16+ messages in thread* [PATCH 02/11] mwifiex: remove httxcfg command from debugfs
2011-03-17 0:09 [PATCH 00/11] remove configuration APIs from debugfs (part 2) Bing Zhao
2011-03-17 0:09 ` [PATCH 01/11] mwifiex: remove txratecfg command from debugfs Bing Zhao
@ 2011-03-17 0:09 ` Bing Zhao
2011-03-17 0:09 ` [PATCH 03/11] mwifiex: remove mpactrl " Bing Zhao
` (9 subsequent siblings)
11 siblings, 0 replies; 16+ messages in thread
From: Bing Zhao @ 2011-03-17 0:09 UTC (permalink / raw)
To: linux-wireless
Cc: John W. Linville, Johannes Berg, Amitkumar Karwar, Kiran Divekar,
Yogesh Powar, Marc Yang, Frank Huang, Bing Zhao
From: Marc Yang <yangyang@marvell.com>
The default setting is 0x20:
Bit 5: Short GI in 20 MHz enabled
Signed-off-by: Marc Yang <yangyang@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
---
drivers/net/wireless/mwifiex/11n.c | 22 ---------
drivers/net/wireless/mwifiex/11n.h | 4 --
drivers/net/wireless/mwifiex/README | 35 --------------
drivers/net/wireless/mwifiex/debugfs.c | 72 ------------------------------
drivers/net/wireless/mwifiex/sta_ioctl.c | 59 ------------------------
5 files changed, 0 insertions(+), 192 deletions(-)
diff --git a/drivers/net/wireless/mwifiex/11n.c b/drivers/net/wireless/mwifiex/11n.c
index c118669..68de8e7 100644
--- a/drivers/net/wireless/mwifiex/11n.c
+++ b/drivers/net/wireless/mwifiex/11n.c
@@ -49,28 +49,6 @@ int mwifiex_11n_ioctl_amsdu_aggr_ctrl(struct mwifiex_adapter *adapter,
}
/*
- * IOCTL request handler to set/get 11n Tx configuration.
- *
- * This function prepares the correct firmware command and
- * issues it.
- */
-int mwifiex_11n_ioctl_ht_tx_cfg(struct mwifiex_adapter *adapter,
- struct mwifiex_wait_queue *wait_queue,
- struct mwifiex_ds_11n_tx_cfg *tx_cfg,
- u16 action)
-{
- int ret = 0;
- struct mwifiex_private *priv = adapter->priv[wait_queue->bss_index];
-
- ret = mwifiex_prepare_cmd(priv, HostCmd_CMD_11N_CFG, action, 0,
- wait_queue, tx_cfg);
- if (!ret)
- ret = -EINPROGRESS;
-
- return ret;
-}
-
-/*
* Fills HT capability information field, AMPDU Parameters field, HT extended
* capability field, and supported MCS set fields.
*
diff --git a/drivers/net/wireless/mwifiex/11n.h b/drivers/net/wireless/mwifiex/11n.h
index c06e620..d9f03bb 100644
--- a/drivers/net/wireless/mwifiex/11n.h
+++ b/drivers/net/wireless/mwifiex/11n.h
@@ -48,10 +48,6 @@ void mwifiex_cfg_tx_buf(struct mwifiex_private *priv,
struct mwifiex_bssdescriptor *bss_desc);
void mwifiex_fill_cap_info(struct mwifiex_private *,
struct mwifiex_ie_types_htcap *);
-int mwifiex_11n_ioctl_ht_tx_cfg(struct mwifiex_adapter *adapter,
- struct mwifiex_wait_queue *wait_queue,
- struct mwifiex_ds_11n_tx_cfg *tx_cfg,
- u16 action);
int mwifiex_set_get_11n_htcap_cfg(struct mwifiex_private *priv,
u16 action, int *htcap_cfg);
int mwifiex_11n_ioctl_amsdu_aggr_ctrl(struct mwifiex_adapter *adapter,
diff --git a/drivers/net/wireless/mwifiex/README b/drivers/net/wireless/mwifiex/README
index 374df48..366338c 100644
--- a/drivers/net/wireless/mwifiex/README
+++ b/drivers/net/wireless/mwifiex/README
@@ -399,41 +399,6 @@ sleeppd
cat sleeppd : Get sleep period configuration
echo "10" > sleeppd : Set sleep period to 10 ms
-
-httxcfg
- This command is used to configure various 11n specific configration
- for transmit (such as Short GI, Channel BW and Green field support)
- Usage:
-
- echo "<m>" > httxcfg
- cat httxcfg
-
- where <m>
- This is a bitmap and should be used as following
- Bit 15-7: Reserved set to 0
- Bit 6: Short GI in 40 Mhz enable/disable
- Bit 5: Short GI in 20 Mhz enable/disable
- Bit 4: Green field enable/disble
- Bit 3-2: Reserved set to 0
- Bit 1: 20/40 Mhz enable disable.
- Bit 0: Reserved set to 0
-
- When Bit 1 is set then firmware could transmit in 20Mhz or 40Mhz based
- on rate adaptation. When this bit is reset then firmware will only
- transmit in 20Mhz.
-
- echo "0x62" > httxcfg
- This will enable 20/40 and Short GI but will disable Green field.
-
- echo "0x30" > httxcfg
- This will enable Short GI and Green field.
-
- The default value is 0x20
-
- Note:- If 20/40 MHz support is disabled in htcapinfo, device will not transmit
- in 40 MHz even 20/40 MHz is enabled in httxcfg.
-
-
getlog
This command is used to get the statistics available in the station.
Usage:
diff --git a/drivers/net/wireless/mwifiex/debugfs.c b/drivers/net/wireless/mwifiex/debugfs.c
index 1809c44..d01a1fc 100644
--- a/drivers/net/wireless/mwifiex/debugfs.c
+++ b/drivers/net/wireless/mwifiex/debugfs.c
@@ -914,76 +914,6 @@ mwifiex_qoscfg_read(struct file *file, char __user *ubuf,
}
/*
- * Proc httxcfg file write handler.
- *
- * This function is called when the 'httxcfg' file is opened for writing
- *
- * This function can be used to set the HT Tx configuration parameters.
- */
-static ssize_t
-mwifiex_httxcfg_write(struct file *file,
- const char __user *ubuf, size_t count, loff_t *ppos)
-{
- struct mwifiex_private *priv =
- (struct mwifiex_private *) file->private_data;
- unsigned long addr = get_zeroed_page(GFP_KERNEL);
- char *buf = (char *) addr;
- size_t buf_size = min(count, (size_t) (PAGE_SIZE - 1));
- int httxcfg = 0;
- int ret = 0;
-
- if (!buf)
- return -ENOMEM;
-
- if (copy_from_user(buf, ubuf, buf_size)) {
- ret = -EFAULT;
- goto done;
- }
-
- sscanf(buf, "%x", &httxcfg);
-
- ret = mwifiex_set_11n_httx_cfg(priv, httxcfg);
-
- if (!ret)
- ret = count;
-
-done:
- free_page(addr);
- return ret;
-}
-
-/*
- * Proc httxcfg file read handler.
- *
- * This function is called when the 'httxcfg' file is opened for reading
- *
- * This function can be used to get the HT Tx configuration parameters.
- */
-static ssize_t
-mwifiex_httxcfg_read(struct file *file, char __user *ubuf,
- size_t count, loff_t *ppos)
-{
- struct mwifiex_private *priv =
- (struct mwifiex_private *) file->private_data;
- unsigned long addr = get_zeroed_page(GFP_KERNEL);
- char *buf = (char *) addr;
- int pos = 0, ret = 0;
- int httxcfg = 0;
-
- if (!buf)
- return -ENOMEM;
-
- mwifiex_get_11n_httx_cfg(priv, &httxcfg);
-
- pos += snprintf(buf, PAGE_SIZE, "%x\n", httxcfg);
-
- ret = simple_read_from_buffer(ubuf, count, ppos, buf, pos);
-
- free_page(addr);
- return ret;
-}
-
-/*
* Proc antcfg file write handler.
*
* This function is called when the 'antcfg' file is opened for writing
@@ -1564,7 +1494,6 @@ MWIFIEX_DFS_FILE_OPS(amsduaggrctrl);
MWIFIEX_DFS_FILE_OPS(sleeppd);
MWIFIEX_DFS_FILE_OPS(mpactrl);
MWIFIEX_DFS_FILE_OPS(qoscfg);
-MWIFIEX_DFS_FILE_OPS(httxcfg);
MWIFIEX_DFS_FILE_READ_OPS(getlog);
MWIFIEX_DFS_FILE_OPS(antcfg);
MWIFIEX_DFS_FILE_OPS(regrdwr);
@@ -1595,7 +1524,6 @@ mwifiex_dev_debugfs_init(struct mwifiex_private *priv)
MWIFIEX_DFS_ADD_FILE(sleeppd);
MWIFIEX_DFS_ADD_FILE(mpactrl);
MWIFIEX_DFS_ADD_FILE(qoscfg);
- MWIFIEX_DFS_ADD_FILE(httxcfg);
MWIFIEX_DFS_ADD_FILE(getlog);
MWIFIEX_DFS_ADD_FILE(antcfg);
MWIFIEX_DFS_ADD_FILE(regrdwr);
diff --git a/drivers/net/wireless/mwifiex/sta_ioctl.c b/drivers/net/wireless/mwifiex/sta_ioctl.c
index b880a00..3d38e87 100644
--- a/drivers/net/wireless/mwifiex/sta_ioctl.c
+++ b/drivers/net/wireless/mwifiex/sta_ioctl.c
@@ -2862,65 +2862,6 @@ done:
}
/*
- * Sends IOCTL request to set 11n HT Tx configurations.
- *
- * This function allocates the IOCTL request buffer, fills it
- * with requisite parameters and calls the IOCTL handler.
- */
-int
-mwifiex_set_11n_httx_cfg(struct mwifiex_private *priv, int data)
-{
- struct mwifiex_wait_queue *wait = NULL;
- struct mwifiex_ds_11n_tx_cfg tx_cfg;
- int status = 0;
- int ret = 0;
-
- wait = mwifiex_alloc_fill_wait_queue(priv, MWIFIEX_IOCTL_WAIT);
- if (!wait)
- return -ENOMEM;
-
- tx_cfg.tx_htcap = data;
- status = mwifiex_11n_ioctl_ht_tx_cfg(priv->adapter, wait, &tx_cfg,
- HostCmd_ACT_GEN_SET);
-
- ret = mwifiex_request_ioctl(priv, wait, status, MWIFIEX_IOCTL_WAIT);
-
- kfree(wait);
- return ret;
-}
-
-/*
- * Sends IOCTL request to get 11n HT Tx configurations.
- *
- * This function allocates the IOCTL request buffer, fills it
- * with requisite parameters and calls the IOCTL handler.
- */
-int
-mwifiex_get_11n_httx_cfg(struct mwifiex_private *priv, int *data)
-{
- struct mwifiex_wait_queue *wait = NULL;
- struct mwifiex_ds_11n_tx_cfg tx_cfg;
- int status = 0;
- int ret = 0;
-
- wait = mwifiex_alloc_fill_wait_queue(priv, MWIFIEX_IOCTL_WAIT);
- if (!wait)
- return -ENOMEM;
-
- status = mwifiex_11n_ioctl_ht_tx_cfg(priv->adapter, wait, &tx_cfg,
- HostCmd_ACT_GEN_GET);
-
- ret = mwifiex_request_ioctl(priv, wait, status, MWIFIEX_IOCTL_WAIT);
- if (ret)
- goto done;
-
- *data = tx_cfg.tx_htcap;
-done:
- kfree(wait);
- return ret;
-}
-
-/*
* Set eWPA mode if passphrase/psk is set
*/
int mwifiex_set_ewpa_mode_from_passphrase(struct mwifiex_private *priv,
--
1.7.0.2
^ permalink raw reply related [flat|nested] 16+ messages in thread* [PATCH 03/11] mwifiex: remove mpactrl command from debugfs
2011-03-17 0:09 [PATCH 00/11] remove configuration APIs from debugfs (part 2) Bing Zhao
2011-03-17 0:09 ` [PATCH 01/11] mwifiex: remove txratecfg command from debugfs Bing Zhao
2011-03-17 0:09 ` [PATCH 02/11] mwifiex: remove httxcfg " Bing Zhao
@ 2011-03-17 0:09 ` Bing Zhao
2011-03-17 0:09 ` [PATCH 04/11] mwifiex: remove antcfg " Bing Zhao
` (8 subsequent siblings)
11 siblings, 0 replies; 16+ messages in thread
From: Bing Zhao @ 2011-03-17 0:09 UTC (permalink / raw)
To: linux-wireless
Cc: John W. Linville, Johannes Berg, Amitkumar Karwar, Kiran Divekar,
Yogesh Powar, Marc Yang, Frank Huang, Bing Zhao
From: Amitkumar Karwar <akarwar@marvell.com>
The following default settings for SDIO Multiple Port Aggregation
will be used:
1) Default Tx and Rx buffer size is 4096 bytes
2) MP aggregation for Tx/Rx will be disabled
3) Default maximum TX and Rx ports are 8
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
---
drivers/net/wireless/mwifiex/README | 28 --------
drivers/net/wireless/mwifiex/debugfs.c | 105 ----------------------------
drivers/net/wireless/mwifiex/main.h | 1 -
drivers/net/wireless/mwifiex/sdio.c | 119 --------------------------------
4 files changed, 0 insertions(+), 253 deletions(-)
diff --git a/drivers/net/wireless/mwifiex/README b/drivers/net/wireless/mwifiex/README
index 366338c..d51830a 100644
--- a/drivers/net/wireless/mwifiex/README
+++ b/drivers/net/wireless/mwifiex/README
@@ -163,34 +163,6 @@ info
3) FOR DRIVER CONFIGURATION
-mpactrl
- This command is used to set/get the Tx, Rx SDIO aggregation parameters
- Note: The parameters can be set only in disconnected state.
-
- The following parameters are provided in /debugfs/mwifiex/mlanX/mpactrl:
- Usage:
-
- echo "[tx_ena][rx_ena][tx_size][rx_size][tx_ports][rx_ports]" > mpactrl
- where
-
- [tx_ena] - Enable MP aggregation for Tx
- [rx_ena] - Enable MP aggregation for Rx
- [tx_size] - Set Tx buffer size
- [rx_size] - Set Rx buffer size
- [tx_ports]- Maximum Tx ports,
- [rx_ports]- Maximum Rx ports,
-
- Examples:
- cat mpactrl : Get MP aggregation parameters
- echo "0 0" > mpactrl
- : Disable MP aggregation for Tx, Rx respectively
- echo "1 1 2048 2048 5 7" > mpactrl
- : Enable MP aggregation for Tx, Rx
- : Set Tx, Rx buffer size to 2048 bytes
- : Set maximum Tx ports to 5 and maximum Rx ports to 7
-
- Default values are 0 0 4096 4096 8 8. Enable MP-A for throughput tests.
-
antcfg
This command is used to set/get the mode of Tx/Rx antenna.
Usage:
diff --git a/drivers/net/wireless/mwifiex/debugfs.c b/drivers/net/wireless/mwifiex/debugfs.c
index d01a1fc..f5ad86e 100644
--- a/drivers/net/wireless/mwifiex/debugfs.c
+++ b/drivers/net/wireless/mwifiex/debugfs.c
@@ -740,109 +740,6 @@ mwifiex_sleeppd_read(struct file *file, char __user *ubuf,
}
/*
- * Proc mpactrl file write handler.
- *
- * This function is called when the 'mpactrl' file is opened for writing
- *
- * This function can be used to set the mpa control parameters.
- */
-static ssize_t
-mwifiex_mpactrl_write(struct file *file,
- const char __user *ubuf, size_t count, loff_t *ppos)
-{
- struct mwifiex_private *priv =
- (struct mwifiex_private *) file->private_data;
- unsigned long addr = get_zeroed_page(GFP_KERNEL);
- char *buf = (char *) addr;
- size_t buf_size = min(count, (size_t) (PAGE_SIZE - 1));
- int ret = 0, length = 0;
- int *data = NULL;
- char *p = NULL;
-
- if (!priv->adapter->if_ops.sdio_mpa_ctrl) {
- ret = -EFAULT;
- goto done;
- }
-
- data = kzalloc((sizeof(int) * 6), GFP_KERNEL);
- if (!data) {
- ret = -ENOMEM;
- goto done;
- }
-
- if (!buf) {
- ret = -ENOMEM;
- goto done;
- }
-
- if (copy_from_user(buf, ubuf, buf_size)) {
- ret = -EFAULT;
- goto done;
- }
-
- while (buf) {
- p = strsep(&buf, "\t ");
- if (!p)
- break;
- sscanf(p, "%d", (data + length));
- length++;
- }
-
- ret = priv->adapter->if_ops.sdio_mpa_ctrl(priv, 1, data, length);
-
- if (!ret)
- ret = count;
-done:
- kfree(data);
- free_page(addr);
- return ret;
-}
-
-/*
- * Proc mpactrl file read handler.
- *
- * This function is called when the 'mpactrl' file is opened for reading
- *
- * This function can be used to get the mpa control parameters.
- */
-static ssize_t
-mwifiex_mpactrl_read(struct file *file, char __user *ubuf,
- size_t count, loff_t *ppos)
-{
- struct mwifiex_private *priv =
- (struct mwifiex_private *) file->private_data;
- unsigned long addr = get_zeroed_page(GFP_KERNEL);
- char *buf = (char *) addr;
- int pos = 0, ret = 0, i = 0;
- int *data = kzalloc(sizeof(int) * 6, GFP_KERNEL);
-
- if (!priv->adapter->if_ops.sdio_mpa_ctrl) {
- ret = -EFAULT;
- goto done;
- }
-
- if (!buf || !data) {
- ret = -ENOMEM;
- goto done;
- }
-
- if (priv->adapter->if_ops.sdio_mpa_ctrl(priv, 0, data, count))
- goto done;
-
- for (i = 0; i < 6; i++)
- pos += snprintf(buf + strlen(buf), PAGE_SIZE, "%d ", data[i]);
-
- pos += snprintf(buf + strlen(buf), PAGE_SIZE, "\n");
-
- ret = simple_read_from_buffer(ubuf, count, ppos, buf, pos);
-
-done:
- free_page(addr);
- kfree(data);
- return ret;
-}
-
-/*
* Proc qoscfg file write handler.
*
* This function is called when the 'qoscfg' file is opened for writing
@@ -1492,7 +1389,6 @@ MWIFIEX_DFS_FILE_READ_OPS(debug);
MWIFIEX_DFS_FILE_OPS(hscfg);
MWIFIEX_DFS_FILE_OPS(amsduaggrctrl);
MWIFIEX_DFS_FILE_OPS(sleeppd);
-MWIFIEX_DFS_FILE_OPS(mpactrl);
MWIFIEX_DFS_FILE_OPS(qoscfg);
MWIFIEX_DFS_FILE_READ_OPS(getlog);
MWIFIEX_DFS_FILE_OPS(antcfg);
@@ -1522,7 +1418,6 @@ mwifiex_dev_debugfs_init(struct mwifiex_private *priv)
MWIFIEX_DFS_ADD_FILE(hscfg);
MWIFIEX_DFS_ADD_FILE(amsduaggrctrl);
MWIFIEX_DFS_ADD_FILE(sleeppd);
- MWIFIEX_DFS_ADD_FILE(mpactrl);
MWIFIEX_DFS_ADD_FILE(qoscfg);
MWIFIEX_DFS_ADD_FILE(getlog);
MWIFIEX_DFS_ADD_FILE(antcfg);
diff --git a/drivers/net/wireless/mwifiex/main.h b/drivers/net/wireless/mwifiex/main.h
index f3626fc..3be4101 100644
--- a/drivers/net/wireless/mwifiex/main.h
+++ b/drivers/net/wireless/mwifiex/main.h
@@ -584,7 +584,6 @@ struct mwifiex_if_ops {
int (*wakeup_complete) (struct mwifiex_adapter *);
void (*update_mp_end_port) (struct mwifiex_adapter *, u16);
- int (*sdio_mpa_ctrl) (struct mwifiex_private *, u8, int *, int);
void (*cleanup_mpa_buf) (struct mwifiex_adapter *);
};
diff --git a/drivers/net/wireless/mwifiex/sdio.c b/drivers/net/wireless/mwifiex/sdio.c
index 313cf0a..f21e5cd 100644
--- a/drivers/net/wireless/mwifiex/sdio.c
+++ b/drivers/net/wireless/mwifiex/sdio.c
@@ -1682,124 +1682,6 @@ mwifiex_update_mp_end_port(struct mwifiex_adapter *adapter, u16 port)
port, card->mp_data_port_mask);
}
-/*
- * This function sets/gets the mpa Tx/Rx parameters.
- *
- * For GET operation, the following parameters are returned -
- * - MPA Tx status (enabled or disabled)
- * - MPA Rx status (enabled or disabled)
- * - MPA Tx buffer size
- * - MPA Rx buffer size
- * - MPA Tx packet aggregation limit
- * - MPA Rx packet aggregation limit
- *
- * SET operation can only be performed in disconnected state. In SET,
- * the parameters are saved in the card structure. If MPA Tx/Rx buffer
- * size has changed, the old buffers are discarded and new buffers
- * are allocated of new sizes.
- */
-static int
-mwifiex_sdio_mpactrl(struct mwifiex_private *priv, u8 write, int *data,
- int length)
-{
- struct mwifiex_adapter *adapter = priv->adapter;
- struct sdio_mmc_card *card = adapter->card;
-
- if (!write) {
- data[0] = card->mpa_tx.enabled;
- data[1] = card->mpa_rx.enabled;
- data[2] = card->mpa_tx.buf_size;
- data[3] = card->mpa_rx.buf_size;
- data[4] = card->mpa_tx.pkt_aggr_limit;
- data[5] = card->mpa_rx.pkt_aggr_limit;
-
- dev_dbg(adapter->dev, "info: Get Param: %d %d %d %d %d %d\n",
- data[0], data[1], data[2], data[3], data[4], data[5]);
- } else {
- if (priv->media_connected) {
- dev_err(adapter->dev, "SDIO MPA CTRL: not allowed "
- "in connected state\n");
- return -EINVAL;
- }
-
- if (length > 6)
- return -EINVAL;
-
- /* mpa_tx enabled */
- if (length > 0) {
- if (data[0] > 1)
- return -EINVAL;
- }
-
- /* mpa_rx enabled */
- if (length > 1) {
- if (data[1] > 1)
- return -EINVAL;
- }
-
- /* mpa_tx port limit */
- if (length > 4) {
- if (data[4] > SDIO_MP_AGGR_DEF_PKT_LIMIT)
- return -EINVAL;
- }
-
- /* mpa_rx port limit */
- if (length > 5) {
- if (data[5] > SDIO_MP_AGGR_DEF_PKT_LIMIT)
- return -EINVAL;
- }
-
- if (((length > 2) && data[2]) || ((length > 3) && data[3])) {
- /* free old buffers */
- kfree(card->mpa_tx.buf);
- kfree(card->mpa_rx.buf);
-
- /* mpa_tx buf size */
- if ((length > 2) && data[2])
- card->mpa_tx.buf_size = data[2];
-
- /* mpa_rx buf size */
- if ((length > 3) && data[3])
- card->mpa_rx.buf_size = data[3];
-
- if (mwifiex_alloc_sdio_mpa_buffers(adapter,
- card->mpa_tx.buf_size,
- card->mpa_rx.buf_size)) {
- dev_err(adapter->dev, "failed to alloc "
- "sdio mp-a buffers\n");
- return -EINVAL;
- }
- }
-
- /* We have validated the data. Now we save them in adapter */
- switch (length) {
- case 6:
- card->mpa_rx.pkt_aggr_limit = data[5];
- case 5:
- card->mpa_tx.pkt_aggr_limit = data[4];
- case 4:
- card->mpa_rx.buf_size = data[3];
- case 3:
- card->mpa_tx.buf_size = data[2];
- case 2:
- card->mpa_rx.enabled = data[1];
- case 1:
- card->mpa_tx.enabled = data[0];
- break;
- default:
- return -EINVAL;
- }
-
- dev_dbg(adapter->dev, "info: new param: %d %d %d %d %d %d\n",
- card->mpa_tx.enabled, card->mpa_rx.enabled,
- card->mpa_tx.buf_size, card->mpa_rx.buf_size,
- card->mpa_tx.pkt_aggr_limit,
- card->mpa_rx.pkt_aggr_limit);
- }
-
- return 0;
-}
-
static struct mwifiex_if_ops sdio_ops = {
.init_if = mwifiex_init_sdio,
.cleanup_if = mwifiex_cleanup_sdio,
@@ -1815,7 +1697,6 @@ static struct mwifiex_if_ops sdio_ops = {
/* SDIO specific */
.update_mp_end_port = mwifiex_update_mp_end_port,
- .sdio_mpa_ctrl = mwifiex_sdio_mpactrl,
.cleanup_mpa_buf = mwifiex_cleanup_mpa_buf,
};
--
1.7.0.2
^ permalink raw reply related [flat|nested] 16+ messages in thread* [PATCH 04/11] mwifiex: remove antcfg command from debugfs
2011-03-17 0:09 [PATCH 00/11] remove configuration APIs from debugfs (part 2) Bing Zhao
` (2 preceding siblings ...)
2011-03-17 0:09 ` [PATCH 03/11] mwifiex: remove mpactrl " Bing Zhao
@ 2011-03-17 0:09 ` Bing Zhao
2011-03-17 0:09 ` [PATCH 05/11] mwifiex: remove esuppmode " Bing Zhao
` (7 subsequent siblings)
11 siblings, 0 replies; 16+ messages in thread
From: Bing Zhao @ 2011-03-17 0:09 UTC (permalink / raw)
To: linux-wireless
Cc: John W. Linville, Johannes Berg, Amitkumar Karwar, Kiran Divekar,
Yogesh Powar, Marc Yang, Frank Huang, Bing Zhao
From: Amitkumar Karwar <akarwar@marvell.com>
Mode 1 is selected for using Tx/Rx antenna 1 by default.
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
---
drivers/net/wireless/mwifiex/README | 16 ----
drivers/net/wireless/mwifiex/debugfs.c | 73 -------------------
drivers/net/wireless/mwifiex/fw.h | 7 --
drivers/net/wireless/mwifiex/main.h | 7 --
drivers/net/wireless/mwifiex/sta_cmd.c | 32 --------
drivers/net/wireless/mwifiex/sta_cmdresp.c | 27 -------
drivers/net/wireless/mwifiex/sta_ioctl.c | 106 ----------------------------
7 files changed, 0 insertions(+), 268 deletions(-)
diff --git a/drivers/net/wireless/mwifiex/README b/drivers/net/wireless/mwifiex/README
index d51830a..7f25d1a 100644
--- a/drivers/net/wireless/mwifiex/README
+++ b/drivers/net/wireless/mwifiex/README
@@ -163,22 +163,6 @@ info
3) FOR DRIVER CONFIGURATION
-antcfg
- This command is used to set/get the mode of Tx/Rx antenna.
- Usage:
- echo "[m]" > antcfg
- cat antcfg
-
- where value of m is:
- 1 -- Tx/Rx antenna 1.
- 2 -- Tx/Rx antenna 2.
- 65535 -- Tx/Rx antenna diversity.
-
- Examples:
- cat antcfg : Get Tx/Rx antenna mode
- echo "1" > antcfg : Set Tx/Rx antenna 1
- echo "65535" > antcfg : Set Tx/Rx antenna diversity
-
txbufcfg
This command can be used to set max transmit buffer size of firmware. Increasing this
buffer size is recommended for AMSDU packets. (Default is 2048)
diff --git a/drivers/net/wireless/mwifiex/debugfs.c b/drivers/net/wireless/mwifiex/debugfs.c
index f5ad86e..cccaf93 100644
--- a/drivers/net/wireless/mwifiex/debugfs.c
+++ b/drivers/net/wireless/mwifiex/debugfs.c
@@ -810,77 +810,6 @@ mwifiex_qoscfg_read(struct file *file, char __user *ubuf,
return ret;
}
-/*
- * Proc antcfg file write handler.
- *
- * This function is called when the 'antcfg' file is opened for writing
- *
- * This function can be used to set the antenna configuration.
- */
-static ssize_t
-mwifiex_antcfg_write(struct file *file,
- const char __user *ubuf, size_t count, loff_t *ppos)
-{
- struct mwifiex_private *priv =
- (struct mwifiex_private *) file->private_data;
- unsigned long addr = get_zeroed_page(GFP_KERNEL);
- char *buf = (char *) addr;
- size_t buf_size = min(count, (size_t) (PAGE_SIZE - 1));
- int antcfg = 0;
- int ret = 0;
-
- if (!buf)
- return -ENOMEM;
-
- if (copy_from_user(buf, ubuf, buf_size)) {
- ret = -EFAULT;
- goto done;
- }
-
- sscanf(buf, "%d", &antcfg);
-
- ret = mwifiex_set_tx_rx_ant(priv, antcfg);
-
- if (!ret)
- ret = count;
- else
- ret = -EINVAL;
-done:
- free_page(addr);
- return ret;
-}
-
-/*
- * Proc antcfg file read handler.
- *
- * This function is called when the 'antcfg' file is opened for reading
- *
- * This function can be used to get the antenna configuration.
- */
-static ssize_t
-mwifiex_antcfg_read(struct file *file, char __user *ubuf,
- size_t count, loff_t *ppos)
-{
- struct mwifiex_private *priv =
- (struct mwifiex_private *) file->private_data;
- unsigned long addr = get_zeroed_page(GFP_KERNEL);
- char *buf = (char *) addr;
- int pos = 0, ret = 0;
- int antcfg;
-
- if (!buf)
- return -ENOMEM;
-
- mwifiex_get_tx_rx_ant(priv, &antcfg);
-
- pos += snprintf(buf, PAGE_SIZE, "%d\n", antcfg);
-
- ret = simple_read_from_buffer(ubuf, count, ppos, buf, pos);
-
- free_page(addr);
- return ret;
-}
-
static u32 saved_reg_type, saved_reg_offset, saved_reg_value;
/*
@@ -1391,7 +1320,6 @@ MWIFIEX_DFS_FILE_OPS(amsduaggrctrl);
MWIFIEX_DFS_FILE_OPS(sleeppd);
MWIFIEX_DFS_FILE_OPS(qoscfg);
MWIFIEX_DFS_FILE_READ_OPS(getlog);
-MWIFIEX_DFS_FILE_OPS(antcfg);
MWIFIEX_DFS_FILE_OPS(regrdwr);
MWIFIEX_DFS_FILE_OPS(rdeeprom);
MWIFIEX_DFS_FILE_OPS(txbufcfg);
@@ -1420,7 +1348,6 @@ mwifiex_dev_debugfs_init(struct mwifiex_private *priv)
MWIFIEX_DFS_ADD_FILE(sleeppd);
MWIFIEX_DFS_ADD_FILE(qoscfg);
MWIFIEX_DFS_ADD_FILE(getlog);
- MWIFIEX_DFS_ADD_FILE(antcfg);
MWIFIEX_DFS_ADD_FILE(regrdwr);
MWIFIEX_DFS_ADD_FILE(rdeeprom);
MWIFIEX_DFS_ADD_FILE(txbufcfg);
diff --git a/drivers/net/wireless/mwifiex/fw.h b/drivers/net/wireless/mwifiex/fw.h
index eeb2c07..11d2539 100644
--- a/drivers/net/wireless/mwifiex/fw.h
+++ b/drivers/net/wireless/mwifiex/fw.h
@@ -305,7 +305,6 @@ enum MWIFIEX_802_11_WEP_STATUS {
#define HostCmd_CMD_RF_REG_ACCESS 0x001b
#define HostCmd_CMD_PMIC_REG_ACCESS 0x00ad
#define HostCmd_CMD_802_11_RF_CHANNEL 0x001d
-#define HostCmd_CMD_802_11_RF_ANTENNA 0x0020
#define HostCmd_CMD_802_11_DEAUTHENTICATE 0x0024
#define HostCmd_CMD_MAC_CONTROL 0x0028
#define HostCmd_CMD_802_11_AD_HOC_START 0x002b
@@ -1386,11 +1385,6 @@ struct host_cmd_ds_version_ext {
char version_str[128];
} __packed;
-struct host_cmd_ds_802_11_rf_antenna {
- __le16 action;
- __le16 antenna_mode;
-} __packed;
-
struct host_cmd_ds_802_11_ibss_status {
__le16 action;
__le16 enable;
@@ -1426,7 +1420,6 @@ struct host_cmd_ds_command {
struct host_cmd_ds_tx_rate_cfg tx_rate_cfg;
struct host_cmd_ds_txpwr_cfg txp_cfg;
struct host_cmd_ds_802_11_ps_mode_enh psmode_enh;
- struct host_cmd_ds_802_11_rf_antenna antenna;
struct host_cmd_ds_802_11_hs_cfg_enh opt_hs_cfg;
struct host_cmd_ds_802_11_scan scan;
struct host_cmd_ds_802_11_scan_rsp scan_resp;
diff --git a/drivers/net/wireless/mwifiex/main.h b/drivers/net/wireless/mwifiex/main.h
index 3be4101..7f29708 100644
--- a/drivers/net/wireless/mwifiex/main.h
+++ b/drivers/net/wireless/mwifiex/main.h
@@ -117,9 +117,6 @@ struct mwifiex_drv_mode {
#define MWIFIEX_OUI_NOT_PRESENT 0
#define MWIFIEX_OUI_PRESENT 1
-#define RF_ANTENNA_1 0x1
-#define RF_ANTENNA_AUTO 0xFFFF
-
#define IS_CARD_RX_RCVD(adapter) (adapter->cmd_resp_received || \
adapter->event_received || \
adapter->data_received)
@@ -1036,10 +1033,6 @@ int mwifiex_set_gen_ie(struct mwifiex_private *priv, u8 *ie, int ie_len);
int mwifiex_get_ver_ext(struct mwifiex_private *priv);
-int mwifiex_set_tx_rx_ant(struct mwifiex_private *priv, int antenna);
-
-int mwifiex_get_tx_rx_ant(struct mwifiex_private *priv, int *antenna);
-
int mwifiex_get_stats_info(struct mwifiex_private *priv,
struct mwifiex_ds_get_stats *log);
diff --git a/drivers/net/wireless/mwifiex/sta_cmd.c b/drivers/net/wireless/mwifiex/sta_cmd.c
index 546f361..1d12fc9 100644
--- a/drivers/net/wireless/mwifiex/sta_cmd.c
+++ b/drivers/net/wireless/mwifiex/sta_cmd.c
@@ -933,34 +933,6 @@ static int mwifiex_cmd_802_11_rf_channel(struct mwifiex_private *priv,
}
/*
- * This function prepares command to set/get RF antenna.
- *
- * Preparation includes -
- * - Setting command ID, action and proper size
- * - Setting antenna mode (for SET only)
- * - Ensuring correct endian-ness
- */
-static int mwifiex_cmd_802_11_rf_antenna(struct mwifiex_private *priv,
- struct host_cmd_ds_command *cmd,
- u16 cmd_action, void *data_buf)
-{
- struct host_cmd_ds_802_11_rf_antenna *antenna = &cmd->params.antenna;
-
- cmd->command = cpu_to_le16(HostCmd_CMD_802_11_RF_ANTENNA);
- cmd->size = cpu_to_le16(sizeof(struct host_cmd_ds_802_11_rf_antenna) +
- S_DS_GEN);
-
- if (cmd_action == HostCmd_ACT_GEN_SET) {
- antenna->action = cpu_to_le16(HostCmd_ACT_SET_BOTH);
- antenna->antenna_mode = cpu_to_le16(*(u16 *)data_buf);
- } else {
- antenna->action = cpu_to_le16(HostCmd_ACT_GET_BOTH);
- }
-
- return 0;
-}
-
-/*
* This function prepares command to set/get IBSS coalescing status.
*
* Preparation includes -
@@ -1148,10 +1120,6 @@ int mwifiex_sta_prepare_cmd(struct mwifiex_private *priv, uint16_t cmd_no,
ret = mwifiex_cmd_tx_power_cfg(priv, cmd_ptr, cmd_action,
data_buf);
break;
- case HostCmd_CMD_802_11_RF_ANTENNA:
- ret = mwifiex_cmd_802_11_rf_antenna(priv, cmd_ptr, cmd_action,
- data_buf);
- break;
case HostCmd_CMD_802_11_PS_MODE_ENH:
ret = mwifiex_cmd_enh_power_mode(priv, cmd_ptr, cmd_action,
(uint16_t)cmd_oid, data_buf);
diff --git a/drivers/net/wireless/mwifiex/sta_cmdresp.c b/drivers/net/wireless/mwifiex/sta_cmdresp.c
index 26e9f1c..6850ea8 100644
--- a/drivers/net/wireless/mwifiex/sta_cmdresp.c
+++ b/drivers/net/wireless/mwifiex/sta_cmdresp.c
@@ -866,30 +866,6 @@ static int mwifiex_ret_802_11_rf_channel(struct mwifiex_private *priv,
}
/*
- * This function handles the command response of get RF antenna.
- *
- * Handling includes changing the header fields into CPU format
- * and forwarding the antenna mode to application.
- */
-static int mwifiex_ret_802_11_rf_antenna(struct mwifiex_private *priv,
- struct host_cmd_ds_command *resp,
- void *data_buf)
-{
- struct host_cmd_ds_802_11_rf_antenna *antenna = &resp->params.antenna;
- u32 *ant = (u32 *)data_buf;
-
- dev_dbg(priv->adapter->dev,
- "info: RF_ANT_RESP: action = 0x%x, Mode = 0x%04x\n",
- le16_to_cpu(antenna->action),
- le16_to_cpu(antenna->antenna_mode));
-
- if (data_buf)
- *ant = (u32)le16_to_cpu(antenna->antenna_mode);
-
- return 0;
-}
-
-/*
* This function handles the command response of get extended version.
*
* Handling includes forming the extended version string and sending it
@@ -1146,9 +1122,6 @@ int mwifiex_process_sta_cmdresp(struct mwifiex_private *priv,
case HostCmd_CMD_802_11_RF_CHANNEL:
ret = mwifiex_ret_802_11_rf_channel(priv, resp, data_buf);
break;
- case HostCmd_CMD_802_11_RF_ANTENNA:
- ret = mwifiex_ret_802_11_rf_antenna(priv, resp, data_buf);
- break;
case HostCmd_CMD_VERSION_EXT:
ret = mwifiex_ret_ver_ext(priv, resp, data_buf);
break;
diff --git a/drivers/net/wireless/mwifiex/sta_ioctl.c b/drivers/net/wireless/mwifiex/sta_ioctl.c
index 3d38e87..5bf005c 100644
--- a/drivers/net/wireless/mwifiex/sta_ioctl.c
+++ b/drivers/net/wireless/mwifiex/sta_ioctl.c
@@ -949,46 +949,6 @@ int mwifiex_radio_ioctl_band_cfg(struct mwifiex_private *priv,
}
/*
- * IOCTL request handler to set/get antenna configurations.
- *
- * This function prepares the correct firmware command and
- * issues it. In addition, it performs validity checking on
- * user input data.
- */
-static int mwifiex_radio_ioctl_ant_cfg(struct mwifiex_private *priv,
- struct mwifiex_wait_queue *wait,
- u16 action, u32 *antenna)
-{
- int ret = 0;
- struct mwifiex_adapter *adapter = priv->adapter;
- u16 antenna_mode;
-
- if (action == HostCmd_ACT_GEN_SET) {
- /* User input validation */
- if ((*antenna < RF_ANTENNA_1 || *antenna >=
- (u16) (RF_ANTENNA_1 + adapter->number_of_antenna))
- && (*antenna != RF_ANTENNA_AUTO
- || adapter->number_of_antenna <= 1)) {
- dev_err(adapter->dev, "invalid antenna setting\n");
- return -1;
- }
- }
-
- /* Cast it to u16, antenna mode for command
- HostCmd_CMD_802_11_RF_ANTENNA requires 2 bytes */
- antenna_mode = (u16) *antenna;
-
- /* Send request to firmware */
- ret = mwifiex_prepare_cmd(priv, HostCmd_CMD_802_11_RF_ANTENNA,
- action, 0, wait, &antenna_mode);
-
- if (!ret)
- ret = -EINPROGRESS;
-
- return ret;
-}
-
-/*
* IOCTL request handler to set/get active channel.
*
* This function performs validity checking on channel/frequency
@@ -2585,72 +2545,6 @@ mwifiex_get_ver_ext(struct mwifiex_private *priv)
}
/*
- * Sends IOCTL request to set Tx and Rx antennas.
- *
- * This function allocates the IOCTL request buffer, fills it
- * with requisite parameters and calls the IOCTL handler.
- */
-int
-mwifiex_set_tx_rx_ant(struct mwifiex_private *priv, int antenna)
-{
- int ret = 0;
- u32 ant;
- int status = 0;
- struct mwifiex_wait_queue *wait = NULL;
- u8 wait_option = MWIFIEX_IOCTL_WAIT;
-
- wait = mwifiex_alloc_fill_wait_queue(priv, wait_option);
- if (!wait)
- return -ENOMEM;
-
- ant = antenna;
- status = mwifiex_radio_ioctl_ant_cfg(priv, wait, HostCmd_ACT_GEN_SET,
- &ant);
-
- ret = mwifiex_request_ioctl(priv, wait, status, wait_option);
- if (ret)
- ret = -EFAULT;
-
- kfree(wait);
- return ret;
-}
-
-/*
- * Sends IOCTL request to get Tx and Rx antennas.
- *
- * This function allocates the IOCTL request buffer, fills it
- * with requisite parameters and calls the IOCTL handler.
- */
-int
-mwifiex_get_tx_rx_ant(struct mwifiex_private *priv, int *antenna)
-{
- int ret = 0;
- int status = 0;
- u32 ant;
- struct mwifiex_wait_queue *wait = NULL;
- u8 wait_option = MWIFIEX_IOCTL_WAIT;
-
- wait = mwifiex_alloc_fill_wait_queue(priv, wait_option);
- if (!wait)
- return -ENOMEM;
-
- status = mwifiex_radio_ioctl_ant_cfg(priv, wait, HostCmd_ACT_GEN_GET,
- &ant);
-
- ret = mwifiex_request_ioctl(priv, wait, status, wait_option);
- if (ret) {
- ret = -EFAULT;
- goto done;
- }
-
- *antenna = ant;
-
-done:
- kfree(wait);
- return ret;
-}
-
-/*
* Sends IOCTL request to get statistics information.
*
* This function allocates the IOCTL request buffer, fills it
--
1.7.0.2
^ permalink raw reply related [flat|nested] 16+ messages in thread* [PATCH 05/11] mwifiex: remove esuppmode command from debugfs
2011-03-17 0:09 [PATCH 00/11] remove configuration APIs from debugfs (part 2) Bing Zhao
` (3 preceding siblings ...)
2011-03-17 0:09 ` [PATCH 04/11] mwifiex: remove antcfg " Bing Zhao
@ 2011-03-17 0:09 ` Bing Zhao
2011-03-17 0:09 ` [PATCH 06/11] mwifiex: remove passphrase " Bing Zhao
` (6 subsequent siblings)
11 siblings, 0 replies; 16+ messages in thread
From: Bing Zhao @ 2011-03-17 0:09 UTC (permalink / raw)
To: linux-wireless
Cc: John W. Linville, Johannes Berg, Amitkumar Karwar, Kiran Divekar,
Yogesh Powar, Marc Yang, Frank Huang, Bing Zhao
From: Amitkumar Karwar <akarwar@marvell.com>
The command was used to get current security configuration
when embedded supplicant is enabled. As we are removing embedded
supplicant support, the command is no longer useful.
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
---
drivers/net/wireless/mwifiex/README | 27 ------------
drivers/net/wireless/mwifiex/debugfs.c | 46 --------------------
drivers/net/wireless/mwifiex/fw.h | 51 ----------------------
drivers/net/wireless/mwifiex/ioctl.h | 6 ---
drivers/net/wireless/mwifiex/main.h | 3 -
drivers/net/wireless/mwifiex/sta_cmd.c | 27 ------------
drivers/net/wireless/mwifiex/sta_cmdresp.c | 63 ----------------------------
drivers/net/wireless/mwifiex/sta_ioctl.c | 59 --------------------------
8 files changed, 0 insertions(+), 282 deletions(-)
diff --git a/drivers/net/wireless/mwifiex/README b/drivers/net/wireless/mwifiex/README
index 7f25d1a..bd79765 100644
--- a/drivers/net/wireless/mwifiex/README
+++ b/drivers/net/wireless/mwifiex/README
@@ -402,31 +402,4 @@ passphrase
echo "2;ssid=Mrvl" > passphrase
echo "2" > passphrase : Clear all profiles and disable embedded supplicant
-esuppmode
- This command is used to get the current RSN mode and active pairwise/group
- cipher for WPA/WPA2 mode.
- Note: This command is available only when STA is connected.
-
- These are bits settings used to indicate each RSN mode.
- Bit 0 : No RSN
- Bit 1-2 : RFU
- Bit 3 : WPA
- Bit 4 : WPA-NONE
- Bit 5 : WPA2
- Bit 6 : AES CCKM
- Bit 7-15 : RFU
-
- These are bits settings used to indicate each pairwise and group cipher.
- Bit 0 : RFU
- Bit 1 : RFU
- Bit 2 : TKIP
- Bit 3 : AES CCKM
- Bit 2-7 : RFU
-
- Example:
- cat esuppmode : Get RSN mode and pairwise/group cipher
- 8 4 4
- (The current RSN mode is WPA, active pairwise cipher is TKIP and
- active group cipher is TKIP.)
-
===============================================================================
diff --git a/drivers/net/wireless/mwifiex/debugfs.c b/drivers/net/wireless/mwifiex/debugfs.c
index cccaf93..35786a7 100644
--- a/drivers/net/wireless/mwifiex/debugfs.c
+++ b/drivers/net/wireless/mwifiex/debugfs.c
@@ -1243,50 +1243,6 @@ mwifiex_passphrase_read(struct file *file, char __user *ubuf,
return ret;
}
-/*
- * Proc esuppmode file read handler.
- *
- * This function is called when the 'esuppmode' file is opened for reading
- * It prints following security information -
- * - RSN mode
- * - active pairwise cipher
- * - active groupwise cipher
- */
-static ssize_t
-mwifiex_esuppmode_read(struct file *file, char __user *ubuf,
- size_t count, loff_t *ppos)
-{
- struct mwifiex_private *priv =
- (struct mwifiex_private *) file->private_data;
- unsigned long page = get_zeroed_page(GFP_KERNEL);
- char *p = (char *) page;
- ssize_t ret = 0;
- struct mwifiex_ds_esupp_mode esupp_mode;
-
- if (!p)
- return -ENOMEM;
-
- memset(&esupp_mode, 0, sizeof(struct mwifiex_ds_esupp_mode));
- ret = mwifiex_get_esupp_mode(priv, &esupp_mode);
- if (ret)
- goto free_and_exit;
-
- p += sprintf(p, "\n"
- "RSN mode %u\n"
- "active pairwise cipher %u\n"
- "active group cipher %u\n",
- esupp_mode.rsn_mode,
- esupp_mode.act_paircipher,
- esupp_mode.act_groupcipher);
-
- ret = simple_read_from_buffer(ubuf, count, ppos, (char *) page,
- (unsigned long) p - page);
-
-free_and_exit:
- free_page(page);
- return ret;
-}
-
#define MWIFIEX_DFS_ADD_FILE(name) do { \
if (!debugfs_create_file(#name, 0644, priv->dfs_dev_dir, \
priv, &mwifiex_dfs_##name##_fops)) \
@@ -1324,7 +1280,6 @@ MWIFIEX_DFS_FILE_OPS(regrdwr);
MWIFIEX_DFS_FILE_OPS(rdeeprom);
MWIFIEX_DFS_FILE_OPS(txbufcfg);
MWIFIEX_DFS_FILE_OPS(passphrase);
-MWIFIEX_DFS_FILE_READ_OPS(esuppmode);
/*
* This function creates the debug FS directory structure and the files.
@@ -1352,7 +1307,6 @@ mwifiex_dev_debugfs_init(struct mwifiex_private *priv)
MWIFIEX_DFS_ADD_FILE(rdeeprom);
MWIFIEX_DFS_ADD_FILE(txbufcfg);
MWIFIEX_DFS_ADD_FILE(passphrase);
- MWIFIEX_DFS_ADD_FILE(esuppmode);
return;
}
diff --git a/drivers/net/wireless/mwifiex/fw.h b/drivers/net/wireless/mwifiex/fw.h
index 11d2539..e3b62bb 100644
--- a/drivers/net/wireless/mwifiex/fw.h
+++ b/drivers/net/wireless/mwifiex/fw.h
@@ -154,8 +154,6 @@ enum MWIFIEX_802_11_WEP_STATUS {
#define TLV_TYPE_CHANNELBANDLIST (PROPRIETARY_TLV_BASE_ID + 42)
#define TLV_TYPE_WAPI_IE (PROPRIETARY_TLV_BASE_ID + 94)
-#define TLV_TYPE_ENCRYPTION_PROTO (PROPRIETARY_TLV_BASE_ID + 64)
-#define TLV_TYPE_CIPHER (PROPRIETARY_TLV_BASE_ID + 66)
#define TLV_TYPE_PMK (PROPRIETARY_TLV_BASE_ID + 68)
#define TLV_TYPE_PASSPHRASE (PROPRIETARY_TLV_BASE_ID + 60)
#define TLV_TYPE_BSSID (PROPRIETARY_TLV_BASE_ID + 35)
@@ -323,7 +321,6 @@ enum MWIFIEX_802_11_WEP_STATUS {
#define HostCmd_CMD_FUNC_INIT 0x00a9
#define HostCmd_CMD_FUNC_SHUTDOWN 0x00aa
#define HostCmd_CMD_SUPPLICANT_PMK 0x00c4
-#define HostCmd_CMD_SUPPLICANT_PROFILE 0x00c5
#define HostCmd_CMD_11N_CFG 0x00cd
#define HostCmd_CMD_11N_ADDBA_REQ 0x00ce
#define HostCmd_CMD_11N_ADDBA_RSP 0x00cf
@@ -352,7 +349,6 @@ enum ENH_PS_MODES {
#define HostCmd_RET_BIT 0x8000
#define HostCmd_ACT_GEN_GET 0x0000
#define HostCmd_ACT_GEN_SET 0x0001
-#define HostCmd_ACT_GEN_GET_CURRENT 0x0003
#define HostCmd_ACT_GEN_REMOVE 0x0004
#define HostCmd_ACT_SET_BOTH 0x0003
#define HostCmd_ACT_GET_BOTH 0x000c
@@ -1270,39 +1266,6 @@ struct mwifiex_ie_types_passphrase {
char passphrase[1];
} __packed;
-/* unicastcipher:
- * Bit 0 : RFU
- * Bit 1 : RFU
- * Bit 2 : TKIP
- * Bit 3 : AES CCKM
- * Bit 2-7 : RFU
- * multicastcipher:
- * Bit 0 : WEP40
- * Bit 1 : WEP104
- * Bit 2 : TKIP
- * Bit 3 : AES
- * Bit 4-7 : Reserved for now
- */
-struct mwifiex_ie_types_cipher {
- struct mwifiex_ie_types_header header;
- u8 pair_cipher;
- u8 group_cipher;
-} __packed;
-
-/* rsnMode:
- * Bit 0 : No RSN
- * Bit 1-2 : RFU
- * Bit 3 : WPA
- * Bit 4 : WPA-NONE
- * Bit 5 : WPA2
- * Bit 6 : AES CCKM
- * Bit 7-15 : RFU
- */
-struct mwifiex_ie_types_encrproto {
- struct mwifiex_ie_types_header header;
- __le16 rsn_mode;
-} __packed;
-
struct mwifiex_ie_types_bssid {
struct mwifiex_ie_types_header header;
u8 bssid[ETH_ALEN];
@@ -1324,19 +1287,6 @@ struct host_cmd_ds_802_11_supplicant_pmk {
*/
} __packed;
-/*
- * This struct will GET the Supplicant supported bitmaps
- * The GET_CURRENT action will get the network profile used
- * for the current assocation.
- * Define data structure for host_cmd_ds_802_11_supplicant_profile
- */
-struct host_cmd_ds_802_11_supplicant_profile {
- __le16 action; /* GET/SET/GET_CURRENT */
- __le16 reserved;
- u8 tlv_buf[1];
- /* mwifiex_ie_types_encrproto */
-} __packed;
-
struct host_cmd_ds_mac_reg_access {
__le16 action;
__le16 offset;
@@ -1442,7 +1392,6 @@ struct host_cmd_ds_command {
struct host_cmd_ds_wmm_get_status get_wmm_status;
struct host_cmd_ds_802_11_key_material key_material;
struct host_cmd_ds_802_11_supplicant_pmk esupp_psk;
- struct host_cmd_ds_802_11_supplicant_profile esupp_profile;
struct host_cmd_ds_version_ext verext;
struct host_cmd_ds_802_11_ibss_status ibss_coalescing;
struct host_cmd_ds_mac_reg_access mac_reg;
diff --git a/drivers/net/wireless/mwifiex/ioctl.h b/drivers/net/wireless/mwifiex/ioctl.h
index 115476a..0f61791 100644
--- a/drivers/net/wireless/mwifiex/ioctl.h
+++ b/drivers/net/wireless/mwifiex/ioctl.h
@@ -333,12 +333,6 @@ struct mwifiex_ds_passphrase {
} psk;
};
-struct mwifiex_ds_esupp_mode {
- u32 rsn_mode;
- u32 act_paircipher;
- u32 act_groupcipher;
-};
-
struct mwifiex_rate_cfg {
u32 action;
u32 is_rate_auto;
diff --git a/drivers/net/wireless/mwifiex/main.h b/drivers/net/wireless/mwifiex/main.h
index 7f29708..e6016b1 100644
--- a/drivers/net/wireless/mwifiex/main.h
+++ b/drivers/net/wireless/mwifiex/main.h
@@ -1083,9 +1083,6 @@ int mwifiex_main_process(struct mwifiex_adapter *);
int mwifiex_set_passphrase(struct mwifiex_private *priv, int action,
struct mwifiex_ds_passphrase *ds_passphrase);
-int mwifiex_get_esupp_mode(struct mwifiex_private *priv,
- struct mwifiex_ds_esupp_mode *esupp_mode);
-
int mwifiex_bss_ioctl_mode(struct mwifiex_private *,
struct mwifiex_wait_queue *,
u16 action, int *mode);
diff --git a/drivers/net/wireless/mwifiex/sta_cmd.c b/drivers/net/wireless/mwifiex/sta_cmd.c
index 1d12fc9..db87b7d 100644
--- a/drivers/net/wireless/mwifiex/sta_cmd.c
+++ b/drivers/net/wireless/mwifiex/sta_cmd.c
@@ -823,29 +823,6 @@ mwifiex_cmd_802_11_supplicant_pmk(struct mwifiex_private *priv,
}
/*
- * This function prepares supplicant profile command.
- *
- * Preparation includes -
- * - Setting command ID and proper size
- * - Ensuring correct endian-ness
- */
-static int mwifiex_cmd_802_11_supplicant_profile(
- struct mwifiex_private *priv,
- struct host_cmd_ds_command *cmd,
- u16 cmd_action)
-{
- struct host_cmd_ds_802_11_supplicant_profile *sup_profile =
- &cmd->params.esupp_profile;
-
- cmd->size = cpu_to_le16(
- sizeof(struct host_cmd_ds_802_11_supplicant_profile) +
- S_DS_GEN - 1);
- cmd->command = cpu_to_le16(HostCmd_CMD_SUPPLICANT_PROFILE);
- sup_profile->action = cpu_to_le16(cmd_action);
- return 0;
-}
-
-/*
* This function prepares command to set/get 11d domain information.
*
* Preparation includes -
@@ -1221,10 +1198,6 @@ int mwifiex_sta_prepare_cmd(struct mwifiex_private *priv, uint16_t cmd_no,
ret = mwifiex_cmd_802_11_supplicant_pmk(priv, cmd_ptr,
cmd_action, data_buf);
break;
- case HostCmd_CMD_SUPPLICANT_PROFILE:
- ret = mwifiex_cmd_802_11_supplicant_profile(priv, cmd_ptr,
- cmd_action);
- break;
case HostCmd_CMD_802_11D_DOMAIN_INFO:
ret = mwifiex_cmd_802_11d_domain_info(priv, cmd_ptr,
cmd_action);
diff --git a/drivers/net/wireless/mwifiex/sta_cmdresp.c b/drivers/net/wireless/mwifiex/sta_cmdresp.c
index 6850ea8..f94439d 100644
--- a/drivers/net/wireless/mwifiex/sta_cmdresp.c
+++ b/drivers/net/wireless/mwifiex/sta_cmdresp.c
@@ -740,65 +740,6 @@ static int mwifiex_ret_802_11_supplicant_pmk(struct mwifiex_private *priv,
}
/*
- * This function handles the command response of get supllicant profile
- *
- * Handling includes saving following supllicant profile information in
- * driver
- * - RSN mode
- * - pairwise cipher
- * - group cipher
- */
-static int mwifiex_ret_802_11_supplicant_profile(struct mwifiex_private *priv,
- struct host_cmd_ds_command
- *resp, void *data_buf)
-{
- struct host_cmd_ds_802_11_supplicant_profile *psup_profile =
- &resp->params.esupp_profile;
- struct mwifiex_ie_types_header *head;
- struct mwifiex_ie_types_encrproto *encr_proto_tlv = NULL;
- struct mwifiex_ie_types_cipher *pcipher_tlv = NULL;
- struct mwifiex_ds_esupp_mode *esupp_mode = NULL;
- u8 *tlv;
- int len;
-
- len = le16_to_cpu(resp->size) - S_DS_GEN - sizeof(u16);
- tlv = psup_profile->tlv_buf;
- if (data_buf) {
- esupp_mode = (struct mwifiex_ds_esupp_mode *)data_buf;
- while (len > 0) {
- head = (struct mwifiex_ie_types_header *) tlv;
- switch (le16_to_cpu(head->type)) {
- case TLV_TYPE_ENCRYPTION_PROTO:
- encr_proto_tlv =
- (struct mwifiex_ie_types_encrproto *)
- head;
- esupp_mode->rsn_mode =
- le16_to_cpu(encr_proto_tlv->rsn_mode);
- dev_dbg(priv->adapter->dev, "info: rsn_mode=0x%x\n",
- esupp_mode->rsn_mode);
- break;
- case TLV_TYPE_CIPHER:
- pcipher_tlv =
- (struct mwifiex_ie_types_cipher *)head;
- esupp_mode->act_paircipher =
- pcipher_tlv->pair_cipher;
- esupp_mode->act_groupcipher =
- pcipher_tlv->group_cipher;
- dev_dbg(priv->adapter->dev,
- "info: paircipher=0x%x, groupcipher=0x%x\n",
- esupp_mode->act_paircipher,
- esupp_mode->act_groupcipher);
- break;
- }
- len -= (le16_to_cpu(head->len) - sizeof(*head));
- tlv = tlv + (le16_to_cpu(head->len) + sizeof(*head));
- }
- }
-
- return 0;
-}
-
-/*
* This function handles the command response of get 11d domain information.
*/
static int mwifiex_ret_802_11d_domain_info(struct mwifiex_private *priv,
@@ -1134,10 +1075,6 @@ int mwifiex_process_sta_cmdresp(struct mwifiex_private *priv,
case HostCmd_CMD_SUPPLICANT_PMK:
ret = mwifiex_ret_802_11_supplicant_pmk(priv, resp, data_buf);
break;
- case HostCmd_CMD_SUPPLICANT_PROFILE:
- ret = mwifiex_ret_802_11_supplicant_profile(priv, resp,
- data_buf);
- break;
case HostCmd_CMD_802_11D_DOMAIN_INFO:
ret = mwifiex_ret_802_11d_domain_info(priv, resp);
break;
diff --git a/drivers/net/wireless/mwifiex/sta_ioctl.c b/drivers/net/wireless/mwifiex/sta_ioctl.c
index 5bf005c..605dd37 100644
--- a/drivers/net/wireless/mwifiex/sta_ioctl.c
+++ b/drivers/net/wireless/mwifiex/sta_ioctl.c
@@ -2035,32 +2035,6 @@ int mwifiex_sec_ioctl_passphrase(struct mwifiex_private *priv,
}
/*
- * IOCTL request handler to get esupplicant mode.
- *
- * This function prepares corresponding firmware command and
- * issues it.
- */
-static int
-mwifiex_sec_ioctl_esupp_mode(struct mwifiex_private *priv,
- struct mwifiex_wait_queue *wait,
- struct mwifiex_ds_esupp_mode *esupp_mode)
-{
- int ret = 0;
-
- if (priv->media_connected != true)
- return -1;
-
- /* Send request to firmware */
- ret = mwifiex_prepare_cmd(priv, HostCmd_CMD_SUPPLICANT_PROFILE,
- HostCmd_ACT_GEN_GET_CURRENT, 0,
- wait, esupp_mode);
- if (!ret)
- ret = -EINPROGRESS;
-
- return ret;
-}
-
-/*
* Sends IOCTL request to set host sleep configurations.
*
* This function allocates the IOCTL request buffer, fills it
@@ -2802,39 +2776,6 @@ int mwifiex_set_passphrase(struct mwifiex_private *priv, int action,
}
/*
- * Sends IOCTL request to get esupplicant mode.
- *
- * This function allocates the IOCTL request buffer, fills it
- * with requisite parameters and calls the IOCTL handler.
- */
-int mwifiex_get_esupp_mode(struct mwifiex_private *priv,
- struct mwifiex_ds_esupp_mode *esupp_mode)
-{
- int ret = 0;
- int status = 0;
- struct mwifiex_ds_esupp_mode esuppmode;
- struct mwifiex_wait_queue *wait = NULL;
-
- wait = mwifiex_alloc_fill_wait_queue(priv, MWIFIEX_IOCTL_WAIT);
- if (!wait)
- return -ENOMEM;
- status = mwifiex_sec_ioctl_esupp_mode(priv, wait, &esuppmode);
-
- if (mwifiex_request_ioctl(priv, wait, status, MWIFIEX_IOCTL_WAIT)) {
- ret = -EFAULT;
- goto done;
- }
-
- if (esupp_mode)
- memcpy(esupp_mode, &esuppmode,
- sizeof(struct mwifiex_ds_esupp_mode));
-
-done:
- kfree(wait);
- return ret;
-}
-
-/*
* This function sets a generic IE. In addition to generic IE, it can
* also handle WPA, WPA2 and WAPI IEs.
*/
--
1.7.0.2
^ permalink raw reply related [flat|nested] 16+ messages in thread* [PATCH 06/11] mwifiex: remove passphrase command from debugfs
2011-03-17 0:09 [PATCH 00/11] remove configuration APIs from debugfs (part 2) Bing Zhao
` (4 preceding siblings ...)
2011-03-17 0:09 ` [PATCH 05/11] mwifiex: remove esuppmode " Bing Zhao
@ 2011-03-17 0:09 ` Bing Zhao
2011-03-17 0:09 ` [PATCH 07/11] mwifiex: remove unnecessary flag ewpa_enabled Bing Zhao
` (5 subsequent siblings)
11 siblings, 0 replies; 16+ messages in thread
From: Bing Zhao @ 2011-03-17 0:09 UTC (permalink / raw)
To: linux-wireless
Cc: John W. Linville, Johannes Berg, Amitkumar Karwar, Kiran Divekar,
Yogesh Powar, Marc Yang, Frank Huang, Bing Zhao
From: Amitkumar Karwar <akarwar@marvell.com>
and get rid of all remaining embedded supplicant related code.
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
---
drivers/net/wireless/mwifiex/README | 41 -------
drivers/net/wireless/mwifiex/debugfs.c | 173 ----------------------------
drivers/net/wireless/mwifiex/fw.h | 35 ------
drivers/net/wireless/mwifiex/init.c | 1 -
drivers/net/wireless/mwifiex/ioctl.h | 29 -----
drivers/net/wireless/mwifiex/main.c | 112 ------------------
drivers/net/wireless/mwifiex/main.h | 15 ---
drivers/net/wireless/mwifiex/scan.c | 33 +-----
drivers/net/wireless/mwifiex/sta_cmd.c | 117 -------------------
drivers/net/wireless/mwifiex/sta_cmdresp.c | 112 ------------------
drivers/net/wireless/mwifiex/sta_ioctl.c | 100 ----------------
11 files changed, 5 insertions(+), 763 deletions(-)
diff --git a/drivers/net/wireless/mwifiex/README b/drivers/net/wireless/mwifiex/README
index bd79765..91fe1f9 100644
--- a/drivers/net/wireless/mwifiex/README
+++ b/drivers/net/wireless/mwifiex/README
@@ -361,45 +361,4 @@ getlog
cat getlog
-passphrase
- This command is used to set/get passphrase for WPA-PSK/WPA2-PSK mode.
- echo "<m>" > passphrase
- cat passphrase
-
- Where <m>
- ASCII string for ssid/passphrase/psk.
-
- 1) "0;<ssid=valid ssid>" - This will get the passphrase, AKMP
- for specified ssid. "cat passphrase" will show the get results.
-
- Example:
- echo "0;ssid=Mrvl" > passphrase
- cat passphrase
-
- 2) "1;<psk=64 byte hexpsk>;<passphrase=1-63 byte passphare>
- <ssid=valid ssid>" - Passphrase and psk cannot be provided for the same SSID.
- This command takes only one SSID at a time, If ssid= is present it should contain
- a passphrase or psk. If no arguments are provided then AKMP=802.1x, and passphrase
- should be provided after association.
- End of each parameter should be followed by a ';'(except for the last parameter)
- as the delimiter. If ';' or '/' has to be used in an SSID then a '/' should be preceded
- to ';' or '/' as a escape.
-
- Examples:
- echo "1;ssid=mrvlAP;passphrase=abcdefgd" > passphrase
- echo "1;ssid=mrvl AP;psk=<64 bytes hexpsk>" > passphrase
-
- If user wants to input the ssid as "mrvl; AP" then command has to be
- echo "1;ssid=Mrvl/; AP;passphrase=abcdefgh" > passphrase
-
- If user wants to input the ssid as "//;" then command has to be
- echo "1;ssid=/////;;passphrase=abcdefgh" > passphrase
-
- 3) "2;<ssid=valid ssid>" - This will clear the passphrase
- for specified ssid, if none specified then it will clear all.
-
- Examples:
- echo "2;ssid=Mrvl" > passphrase
- echo "2" > passphrase : Clear all profiles and disable embedded supplicant
-
===============================================================================
diff --git a/drivers/net/wireless/mwifiex/debugfs.c b/drivers/net/wireless/mwifiex/debugfs.c
index 35786a7..48e3f72 100644
--- a/drivers/net/wireless/mwifiex/debugfs.c
+++ b/drivers/net/wireless/mwifiex/debugfs.c
@@ -1072,177 +1072,6 @@ mwifiex_txbufcfg_read(struct file *file, char __user *ubuf,
return ret;
}
-static struct mwifiex_ds_passphrase saved_ds_passphrase;
-
-/*
- * Proc passphrase file write handler.
- *
- * This function is called when the 'passphrase' file is opened for writing
- *
- * This function can be used to get/set/clear passphrase/psk for specified SSID.
- */
-static ssize_t
-mwifiex_passphrase_write(struct file *file,
- const char __user *ubuf, size_t count, loff_t *ppos)
-{
- struct mwifiex_private *priv =
- (struct mwifiex_private *) file->private_data;
- unsigned long addr = get_zeroed_page(GFP_KERNEL);
- char *buf = (char *) addr;
- size_t buf_size = min(count, (size_t) (PAGE_SIZE - 1));
- int action = -1, ret = 0;
- char *begin, *end, *opt;
- struct mwifiex_ds_passphrase ds_passphrase;
-
- if (!buf)
- return -ENOMEM;
-
- memset(&ds_passphrase, 0, sizeof(struct mwifiex_ds_passphrase));
-
- if (copy_from_user(buf, ubuf, buf_size)) {
- ret = -EFAULT;
- goto done;
- }
- /* Overwrite last charactor '\n' in buf by '\0' */
- buf[buf_size - 1] = '\0';
-
- /* Parse the buf to get the cmd_action */
- begin = buf;
- end = mwifiex_strsep(&begin, ';', '/');
- if (end)
- action = mwifiex_atox(end);
-
- if (action < 0 || action > 2 || end[1] != '\0') {
- dev_err(priv->adapter->dev,
- "invalid action argument %s\n", end);
- ret = -EINVAL;
- goto done;
- }
- while (begin) {
- end = mwifiex_strsep(&begin, ';', '/');
- opt = mwifiex_strsep(&end, '=', '/');
- if (!opt || !end || !end[0]) {
- dev_err(priv->adapter->dev, "invalid option\n");
- ret = -EINVAL;
- break;
- } else if (!strnicmp(opt, "ssid", strlen(opt))) {
- if (strlen(end) > IEEE80211_MAX_SSID_LEN) {
- dev_err(priv->adapter->dev, "SSID length "
- "exceeds max length\n");
- ret = -EFAULT;
- break;
- }
- ds_passphrase.ssid.ssid_len = strlen(end);
- strcpy((char *)ds_passphrase.ssid.ssid, end);
- dev_dbg(priv->adapter->dev, "info: ssid=%s, len=%d\n",
- ds_passphrase.ssid.ssid,
- (int)ds_passphrase.ssid.ssid_len);
- } else if (!strnicmp(opt, "bssid", strlen(opt))) {
- mwifiex_mac2u8((u8 *)&ds_passphrase.bssid, end);
- } else if (!strnicmp(opt, "psk", strlen(opt))) {
- if (strlen(end) != (MWIFIEX_MAX_PMK_LENGTH * 2)) {
- dev_err(priv->adapter->dev, "invalid PMK length\n");
- ret = -EINVAL;
- break;
- }
- mwifiex_ascii2hex(ds_passphrase.psk.pmk.pmk, end,
- MWIFIEX_MAX_PMK_LENGTH * 2);
- ds_passphrase.psk_type = MWIFIEX_PSK_PMK;
- } else if (!strnicmp(opt, "passphrase", strlen(opt))) {
- if (strlen(end) < MWIFIEX_MIN_PASSPHRASE_LENGTH ||
- strlen(end) > MWIFIEX_MAX_PASSPHRASE_LENGTH) {
- dev_err(priv->adapter->dev,
- "invalid passphrase length\n");
- ret = -EINVAL;
- break;
- }
- ds_passphrase.psk_type = MWIFIEX_PSK_PASSPHRASE;
- strcpy(ds_passphrase.psk.passphrase.passphrase, end);
- ds_passphrase.psk.passphrase.passphrase_len =
- strlen(end);
- dev_dbg(priv->adapter->dev, "info: passphrase=%s, len=%d\n",
- ds_passphrase.psk.passphrase.passphrase,
- (int)ds_passphrase.psk.passphrase
- .passphrase_len);
- } else {
- dev_err(priv->adapter->dev, "invalid option %s\n", opt);
- ret = -EINVAL;
- break;
- }
- }
- if (ret)
- goto done;
-
- if (action == 2)
- ds_passphrase.psk_type = MWIFIEX_PSK_CLEAR;
-
- ret = mwifiex_set_passphrase(priv, action, &ds_passphrase);
- if (ret)
- goto done;
-
- ret = count;
-
- if (action == 0)
- memcpy(&saved_ds_passphrase, &ds_passphrase,
- sizeof(struct mwifiex_ds_passphrase));
-
-done:
- free_page(addr);
- return ret;
-}
-
-/*
- * Proc passphrase file read handler.
- *
- * This function is called when the 'passphrase' file is opened for reading
- *
- * This function can be used to get passphrase for specific SSID
- */
-static ssize_t
-mwifiex_passphrase_read(struct file *file, char __user *ubuf,
- size_t count, loff_t *ppos)
-{
- unsigned long addr = get_zeroed_page(GFP_KERNEL);
- char *buf = (char *) addr;
- int i, ret = 0, len = 0;
- char zero_mac[] = {0, 0, 0, 0, 0, 0 };
- char *mac = NULL;
-
- if (!buf)
- return -ENOMEM;
-
- memset(buf, 0, sizeof(buf));
- if (saved_ds_passphrase.ssid.ssid_len) {
- len += sprintf(buf+len, "ssid:");
- memcpy(buf+len, saved_ds_passphrase.ssid.ssid,
- saved_ds_passphrase.ssid.ssid_len);
- len += saved_ds_passphrase.ssid.ssid_len;
- len += sprintf(buf+len, " ");
- }
- if (memcmp(&saved_ds_passphrase.bssid, zero_mac, sizeof(zero_mac))) {
- mac = (u8 *)&saved_ds_passphrase.bssid;
- len += sprintf(buf+len, "bssid:");
- for (i = 0; i < ETH_ALEN-1; ++i)
- len += sprintf(buf+len, "%02x:", mac[i]);
- len += sprintf(buf+len, "%02x ", mac[i]);
- }
- if (saved_ds_passphrase.psk_type == MWIFIEX_PSK_PMK) {
- len += sprintf(buf+len, "psk:");
- for (i = 0; i < MWIFIEX_MAX_PMK_LENGTH; ++i)
- len += sprintf(buf+len, "%02x",
- saved_ds_passphrase.psk.pmk.pmk[i]);
- len += sprintf(buf+len, "\n");
- }
- if (saved_ds_passphrase.psk_type == MWIFIEX_PSK_PASSPHRASE)
- len += sprintf(buf+len, "passphrase:%s\n",
- saved_ds_passphrase.psk.passphrase.passphrase);
-
- ret = simple_read_from_buffer(ubuf, count, ppos, buf, len);
-
- free_page(addr);
- return ret;
-}
-
#define MWIFIEX_DFS_ADD_FILE(name) do { \
if (!debugfs_create_file(#name, 0644, priv->dfs_dev_dir, \
priv, &mwifiex_dfs_##name##_fops)) \
@@ -1279,7 +1108,6 @@ MWIFIEX_DFS_FILE_READ_OPS(getlog);
MWIFIEX_DFS_FILE_OPS(regrdwr);
MWIFIEX_DFS_FILE_OPS(rdeeprom);
MWIFIEX_DFS_FILE_OPS(txbufcfg);
-MWIFIEX_DFS_FILE_OPS(passphrase);
/*
* This function creates the debug FS directory structure and the files.
@@ -1306,7 +1134,6 @@ mwifiex_dev_debugfs_init(struct mwifiex_private *priv)
MWIFIEX_DFS_ADD_FILE(regrdwr);
MWIFIEX_DFS_ADD_FILE(rdeeprom);
MWIFIEX_DFS_ADD_FILE(txbufcfg);
- MWIFIEX_DFS_ADD_FILE(passphrase);
return;
}
diff --git a/drivers/net/wireless/mwifiex/fw.h b/drivers/net/wireless/mwifiex/fw.h
index e3b62bb..49d76fd 100644
--- a/drivers/net/wireless/mwifiex/fw.h
+++ b/drivers/net/wireless/mwifiex/fw.h
@@ -154,8 +154,6 @@ enum MWIFIEX_802_11_WEP_STATUS {
#define TLV_TYPE_CHANNELBANDLIST (PROPRIETARY_TLV_BASE_ID + 42)
#define TLV_TYPE_WAPI_IE (PROPRIETARY_TLV_BASE_ID + 94)
-#define TLV_TYPE_PMK (PROPRIETARY_TLV_BASE_ID + 68)
-#define TLV_TYPE_PASSPHRASE (PROPRIETARY_TLV_BASE_ID + 60)
#define TLV_TYPE_BSSID (PROPRIETARY_TLV_BASE_ID + 35)
#define MWIFIEX_TX_DATA_BUF_SIZE_2K 2048
@@ -320,7 +318,6 @@ enum MWIFIEX_802_11_WEP_STATUS {
#define HostCmd_CMD_RSSI_INFO 0x00a4
#define HostCmd_CMD_FUNC_INIT 0x00a9
#define HostCmd_CMD_FUNC_SHUTDOWN 0x00aa
-#define HostCmd_CMD_SUPPLICANT_PMK 0x00c4
#define HostCmd_CMD_11N_CFG 0x00cd
#define HostCmd_CMD_11N_ADDBA_REQ 0x00ce
#define HostCmd_CMD_11N_ADDBA_RSP 0x00cf
@@ -1256,37 +1253,6 @@ struct mwifiex_ie_types_extcap {
u8 ext_cap;
} __packed;
-struct mwifiex_ie_types_pmk {
- struct mwifiex_ie_types_header header;
- u8 pmk[1];
-} __packed;
-
-struct mwifiex_ie_types_passphrase {
- struct mwifiex_ie_types_header header;
- char passphrase[1];
-} __packed;
-
-struct mwifiex_ie_types_bssid {
- struct mwifiex_ie_types_header header;
- u8 bssid[ETH_ALEN];
-} __packed;
-
-/*
- * This struct will handle GET,SET,CLEAR function for embedded
- * supplicant.
- * Define data structure for host_cmd_ds_802_11_supplicant_pmk
- */
-struct host_cmd_ds_802_11_supplicant_pmk {
- __le16 action; /* GET/SET/CLEAR */
- __le16 cache_result; /* initialized to 0 */
- u8 tlv_buffer[1];
- /* mwifiex_ie_types_ssid_param_set ssid_param_set;
- * mwifiex_ie_types_pmk pmk;
- * mwifiex_ie_types_passphrase passphrase;
- * mwifiex_ie_types_bssid bssid;
- */
-} __packed;
-
struct host_cmd_ds_mac_reg_access {
__le16 action;
__le16 offset;
@@ -1391,7 +1357,6 @@ struct host_cmd_ds_command {
struct host_cmd_ds_11n_cfg htcfg;
struct host_cmd_ds_wmm_get_status get_wmm_status;
struct host_cmd_ds_802_11_key_material key_material;
- struct host_cmd_ds_802_11_supplicant_pmk esupp_psk;
struct host_cmd_ds_version_ext verext;
struct host_cmd_ds_802_11_ibss_status ibss_coalescing;
struct host_cmd_ds_mac_reg_access mac_reg;
diff --git a/drivers/net/wireless/mwifiex/init.c b/drivers/net/wireless/mwifiex/init.c
index 0dfc147..07ebc97 100644
--- a/drivers/net/wireless/mwifiex/init.c
+++ b/drivers/net/wireless/mwifiex/init.c
@@ -90,7 +90,6 @@ static int mwifiex_init_priv(struct mwifiex_private *priv)
for (i = 0; i < ARRAY_SIZE(priv->wep_key); i++)
memset(&priv->wep_key[i], 0, sizeof(struct mwifiex_wep_key));
priv->wep_key_curr_index = 0;
- priv->ewpa_query = false;
priv->curr_pkt_filter = HostCmd_ACT_MAC_RX_ON | HostCmd_ACT_MAC_TX_ON |
HostCmd_ACT_MAC_ETHERNETII_ENABLE;
diff --git a/drivers/net/wireless/mwifiex/ioctl.h b/drivers/net/wireless/mwifiex/ioctl.h
index 0f61791..f4227dd 100644
--- a/drivers/net/wireless/mwifiex/ioctl.h
+++ b/drivers/net/wireless/mwifiex/ioctl.h
@@ -289,19 +289,9 @@ enum {
MWIFIEX_ENCRYPTION_MODE_WEP104 = 4,
};
-enum {
- MWIFIEX_PSK_PASSPHRASE = 1,
- MWIFIEX_PSK_PMK,
- MWIFIEX_PSK_CLEAR,
- MWIFIEX_PSK_QUERY,
-};
-
#define MWIFIEX_KEY_INDEX_UNICAST 0x40000000
#define MWIFIEX_MAX_KEY_LENGTH 32
#define WAPI_RXPN_LEN 16
-#define MWIFIEX_MIN_PASSPHRASE_LENGTH 8
-#define MWIFIEX_MAX_PASSPHRASE_LENGTH 63
-#define MWIFIEX_MAX_PMK_LENGTH 32
struct mwifiex_ds_encrypt_key {
u32 key_disable;
@@ -314,25 +304,6 @@ struct mwifiex_ds_encrypt_key {
u8 wapi_rxpn[WAPI_RXPN_LEN];
};
-struct mwifiex_passphrase {
- u32 passphrase_len;
- u8 passphrase[MWIFIEX_MAX_PASSPHRASE_LENGTH];
-};
-
-struct mwifiex_pmk {
- u8 pmk[MWIFIEX_MAX_PMK_LENGTH];
-};
-
-struct mwifiex_ds_passphrase {
- struct mwifiex_802_11_ssid ssid;
- u8 bssid[ETH_ALEN];
- u16 psk_type;
- union {
- struct mwifiex_passphrase passphrase;
- struct mwifiex_pmk pmk;
- } psk;
-};
-
struct mwifiex_rate_cfg {
u32 action;
u32 is_rate_auto;
diff --git a/drivers/net/wireless/mwifiex/main.c b/drivers/net/wireless/mwifiex/main.c
index 7b7f344..ed89ca4 100644
--- a/drivers/net/wireless/mwifiex/main.c
+++ b/drivers/net/wireless/mwifiex/main.c
@@ -834,118 +834,6 @@ int mwifiex_shutdown_fw(struct mwifiex_private *priv, u8 wait_option)
EXPORT_SYMBOL_GPL(mwifiex_shutdown_fw);
/*
- * The function converts ascii string to Hex integer
- */
-int mwifiex_ascii2hex(u8 *d, char *s, u32 dlen)
-{
- unsigned int i;
- u8 n;
-
- memset(d, 0x00, dlen);
-
- for (i = 0; i < dlen * 2; i++) {
- if ((s[i] >= 48) && (s[i] <= 57))
- n = s[i] - 48;
- else if ((s[i] >= 65) && (s[i] <= 70))
- n = s[i] - 55;
- else if ((s[i] >= 97) && (s[i] <= 102))
- n = s[i] - 87;
- else
- break;
- if (!(i % 2))
- n = n * 16;
- d[i / 2] += n;
- }
-
- return i;
-}
-
-/*
- * The function gives hex value of a give character
- */
-static int mwifiex_hexval(char chr)
-{
- if (chr >= '0' && chr <= '9')
- return chr - '0';
- if (chr >= 'A' && chr <= 'F')
- return chr - 'A' + 10;
- if (chr >= 'a' && chr <= 'f')
- return chr - 'a' + 10;
-
- return 0;
-}
-
-/*
- * The function gives hex value of a given ascii string
- */
-int mwifiex_atox(char *a)
-{
- int i = 0;
-
- while (isxdigit(*a))
- i = i*16 + mwifiex_hexval(*a++);
-
- return i;
-}
-
-/*
- * This function is an extension of strsep lib command. The function will also
- * take care of an escape character
- */
-char *mwifiex_strsep(char **s, char delim, char esc)
-{
- char *se = *s, *sb;
-
- if (!(*s) || (*se == '\0'))
- return NULL;
-
- for (sb = *s; *sb != '\0'; ++sb) {
- if (*sb == esc && *(sb+1) == esc) {
- /*
- * We get a esc + esc seq then keep the one esc
- * and chop off the other esc character
- */
- memmove(sb, sb+1, strlen(sb));
- continue;
- }
- if (*sb == esc && *(sb+1) == delim) {
- /*
- * We get a delim + esc seq then keep the delim
- * and chop off the esc character
- */
- memmove(sb, sb+1, strlen(sb));
- continue;
- }
- if (*sb == delim)
- break;
- }
-
- if (*sb == '\0')
- sb = NULL;
- else
- *sb++ = '\0';
-
- *s = sb;
-
- return se;
-}
-
-/*
- * The function converts mac address from string to u8 buffer.
- */
-void mwifiex_mac2u8(u8 *mac_addr, char *buf)
-{
- char *begin = buf, *end;
- int i;
-
- for (i = 0; i < ETH_ALEN; ++i) {
- end = mwifiex_strsep(&begin, ':', '/');
- if (end)
- mac_addr[i] = mwifiex_atox(end);
- }
-}
-
-/*
* This function check if command is pending.
*/
int is_command_pending(struct mwifiex_adapter *adapter)
diff --git a/drivers/net/wireless/mwifiex/main.h b/drivers/net/wireless/mwifiex/main.h
index e6016b1..f074f5c 100644
--- a/drivers/net/wireless/mwifiex/main.h
+++ b/drivers/net/wireless/mwifiex/main.h
@@ -436,7 +436,6 @@ struct mwifiex_private {
struct mwifiex_802_11_security sec_info;
struct mwifiex_wep_key wep_key[NUM_WEP_KEYS];
u16 wep_key_curr_index;
- u8 ewpa_query;
u8 wpa_ie[256];
u8 wpa_ie_len;
u8 wpa_is_gtk_set;
@@ -737,8 +736,6 @@ int mwifiex_misc_ioctl_init_shutdown(struct mwifiex_adapter *adapter,
int mwifiex_get_debug_info(struct mwifiex_private *,
struct mwifiex_debug_info *);
-int mwifiex_set_ewpa_mode_from_passphrase(struct mwifiex_private *priv,
- struct mwifiex_ds_passphrase *);
int mwifiex_alloc_cmd_buffer(struct mwifiex_adapter *adapter);
int mwifiex_free_cmd_buffer(struct mwifiex_adapter *adapter);
void mwifiex_cancel_all_pending_cmd(struct mwifiex_adapter *adapter);
@@ -964,11 +961,6 @@ struct mwifiex_private *mwifiex_bss_index_to_priv(struct mwifiex_adapter
*adapter, u8 bss_index);
int mwifiex_shutdown_fw(struct mwifiex_private *, u8);
-char *mwifiex_strsep(char **s, char delim, char esc);
-int mwifiex_atox(char *a);
-void mwifiex_mac2u8(u8 *mac_addr, char *buf);
-int mwifiex_ascii2hex(u8 *d, char *s, u32 dlen);
-
int mwifiex_add_card(void *, struct semaphore *, struct mwifiex_if_ops *);
int mwifiex_remove_card(struct mwifiex_adapter *, struct semaphore *);
@@ -1080,9 +1072,6 @@ int mwifiex_set_tx_power(struct mwifiex_private *priv, int type, int dbm);
int mwifiex_main_process(struct mwifiex_adapter *);
-int mwifiex_set_passphrase(struct mwifiex_private *priv, int action,
- struct mwifiex_ds_passphrase *ds_passphrase);
-
int mwifiex_bss_ioctl_mode(struct mwifiex_private *,
struct mwifiex_wait_queue *,
u16 action, int *mode);
@@ -1100,10 +1089,6 @@ int mwifiex_snmp_mib_ioctl(struct mwifiex_private *,
u32 cmd_oid, u16 action, u32 *value);
int mwifiex_get_bss_info(struct mwifiex_private *,
struct mwifiex_bss_info *);
-int mwifiex_sec_ioctl_passphrase(struct mwifiex_private *,
- struct mwifiex_wait_queue *,
- struct mwifiex_ds_passphrase *,
- u16 action);
#ifdef CONFIG_DEBUG_FS
void mwifiex_debugfs_init(void);
diff --git a/drivers/net/wireless/mwifiex/scan.c b/drivers/net/wireless/mwifiex/scan.c
index ea86762..c0d5823 100644
--- a/drivers/net/wireless/mwifiex/scan.c
+++ b/drivers/net/wireless/mwifiex/scan.c
@@ -180,43 +180,22 @@ mwifiex_ssid_cmp(struct mwifiex_802_11_ssid *ssid1,
int mwifiex_find_best_bss(struct mwifiex_private *priv,
u8 wait_option, struct mwifiex_ssid_bssid *ssid_bssid)
{
- struct mwifiex_wait_queue *wait1 = NULL, *wait2 = NULL;
+ struct mwifiex_wait_queue *wait = NULL;
struct mwifiex_ssid_bssid tmp_ssid_bssid;
- struct mwifiex_ds_passphrase passphrase;
int ret = 0;
u8 *mac = NULL;
if (!ssid_bssid)
return -1;
- if (priv->ewpa_query) {
- /* Allocate wait request buffer */
- wait1 = mwifiex_alloc_fill_wait_queue(priv, wait_option);
- if (!wait1)
- return -ENOMEM;
-
- memset(&passphrase, 0, sizeof(passphrase));
- passphrase.psk_type = MWIFIEX_PSK_QUERY;
- memcpy(&passphrase.ssid, &ssid_bssid->ssid,
- sizeof(struct mwifiex_802_11_ssid));
- memcpy(passphrase.bssid, ssid_bssid->bssid, ETH_ALEN);
- ret = mwifiex_sec_ioctl_passphrase(priv, wait1, &passphrase,
- HostCmd_ACT_GEN_GET);
-
- ret = mwifiex_request_ioctl(priv, wait1, ret, wait_option);
- if (ret)
- goto done;
- mwifiex_set_ewpa_mode_from_passphrase(priv, &passphrase);
- }
-
/* Allocate wait request buffer */
- wait2 = mwifiex_alloc_fill_wait_queue(priv, wait_option);
- if (!wait2)
+ wait = mwifiex_alloc_fill_wait_queue(priv, wait_option);
+ if (!wait)
return -ENOMEM;
memcpy(&tmp_ssid_bssid, ssid_bssid,
sizeof(struct mwifiex_ssid_bssid));
- ret = mwifiex_bss_ioctl_find_bss(priv, wait2, &tmp_ssid_bssid);
+ ret = mwifiex_bss_ioctl_find_bss(priv, wait, &tmp_ssid_bssid);
if (!ret) {
memcpy(ssid_bssid, &tmp_ssid_bssid,
@@ -226,9 +205,7 @@ int mwifiex_find_best_bss(struct mwifiex_private *priv,
" %pM\n", ssid_bssid->ssid.ssid, mac);
}
-done:
- kfree(wait1);
- kfree(wait2);
+ kfree(wait);
return ret;
}
diff --git a/drivers/net/wireless/mwifiex/sta_cmd.c b/drivers/net/wireless/mwifiex/sta_cmd.c
index db87b7d..d4befb9 100644
--- a/drivers/net/wireless/mwifiex/sta_cmd.c
+++ b/drivers/net/wireless/mwifiex/sta_cmd.c
@@ -710,119 +710,6 @@ static int mwifiex_cmd_802_11_key_material(struct mwifiex_private *priv,
}
/*
- * This function prepares command of supplicant pmk.
- *
- * Preparation includes -
- * - Setting command ID and proper size
- * - Setting SSID, passphrase and cmd action
- * - Ensuring correct endian-ness
- */
-static int
-mwifiex_cmd_802_11_supplicant_pmk(struct mwifiex_private *priv,
- struct host_cmd_ds_command *cmd,
- u16 cmd_action, void *pdata_buf)
-{
- struct mwifiex_ie_types_pmk *ppmk_tlv = NULL;
- struct mwifiex_ie_types_passphrase *ppassphrase_tlv = NULL;
- struct mwifiex_ie_types_ssid_param_set *pssid_tlv = NULL;
- struct mwifiex_ie_types_bssid *pbssid_tlv = NULL;
- struct host_cmd_ds_802_11_supplicant_pmk *pesupp_psk =
- &cmd->params.esupp_psk;
- u8 *ptlv_buffer = (u8 *)(pesupp_psk->tlv_buffer);
- struct mwifiex_ds_passphrase *psk =
- (struct mwifiex_ds_passphrase *)pdata_buf;
- u8 zero_mac[] = {0, 0, 0, 0, 0, 0 };
-
- /*
- * Parse the rest of the buf here
- * 1) <ssid="valid ssid"> - This will get the passphrase, AKMP
- * for specified ssid, if none specified then it will get all.
- * Eg: echo "0;ssid=marvell" > passphrase
- * 2) <psk="psk">:<passphrase="passphare">:<bssid="00:50:43:ef:
- * 23:f3"> <ssid="valid ssid"> - passphrase and psk cannot be
- * provided to the same SSID, Takes one SSID at a time, If
- * ssid= is present the it should contain a passphrase or psk.
- * If no arguments are provided then AKMP=802.1x, and
- * passphrase should be provided after association. End of each
- * parameter should be followed by a ';'(except for the last
- * parameter) as the delimiter. If ';' has to be used in an
- * SSID then a '/' should be preceded to ';' as a escape.
- * Eg: echo "1;ssid=mrvl AP;psk=abcdefgh" > passphrase
- * echo "1;ssid=mrvl/; AP;psk=abcdefgd" > passphrase
- * echo "1:ssid=mrvlAP:psk=abcdefgd" > passphrase
- * 3) <ssid="valid ssid"> - This will clear the passphrase
- * for specified ssid, if none specified then it will clear
- * all.
- * Eg: echo "2:ssid=marvell" > passphrase
- */
-
- /* -1 is for u8 TlvBuffer[1] as this should not be included */
- cmd->size = cpu_to_le16(sizeof(struct host_cmd_ds_802_11_supplicant_pmk)
- + S_DS_GEN - 1);
- if (psk->ssid.ssid_len) {
- pssid_tlv = (struct mwifiex_ie_types_ssid_param_set *)
- ptlv_buffer;
- pssid_tlv->header.type = cpu_to_le16(WLAN_EID_SSID);
- pssid_tlv->header.len = cpu_to_le16((u16)psk->ssid.ssid_len);
- memcpy((char *)pssid_tlv->ssid, psk->ssid.ssid,
- psk->ssid.ssid_len);
- ptlv_buffer += (le16_to_cpu(pssid_tlv->header.len) +
- sizeof(struct mwifiex_ie_types_header));
- cmd->size = cpu_to_le16(le16_to_cpu(cmd->size) +
- le16_to_cpu(pssid_tlv->header.len) +
- sizeof(struct mwifiex_ie_types_header));
- }
- if (memcmp((u8 *)&psk->bssid, zero_mac, sizeof(zero_mac))) {
- pbssid_tlv = (struct mwifiex_ie_types_bssid *) ptlv_buffer;
- pbssid_tlv->header.type = cpu_to_le16(TLV_TYPE_BSSID);
- pbssid_tlv->header.len = cpu_to_le16(ETH_ALEN);
- memcpy(pbssid_tlv->bssid, (u8 *)&psk->bssid, ETH_ALEN);
- ptlv_buffer += (le16_to_cpu(pbssid_tlv->header.len) +
- sizeof(struct mwifiex_ie_types_header));
- cmd->size = cpu_to_le16(le16_to_cpu(cmd->size) +
- le16_to_cpu(pbssid_tlv->header.len) +
- sizeof(struct mwifiex_ie_types_header));
- }
- if (psk->psk_type == MWIFIEX_PSK_PASSPHRASE) {
- ppassphrase_tlv = (struct mwifiex_ie_types_passphrase *)
- ptlv_buffer;
- ppassphrase_tlv->header.type = cpu_to_le16(TLV_TYPE_PASSPHRASE);
- ppassphrase_tlv->header.len =
- cpu_to_le16((u16)psk->psk.passphrase.passphrase_len);
- memcpy(ppassphrase_tlv->passphrase,
- psk->psk.passphrase.passphrase,
- psk->psk.passphrase.passphrase_len);
- ptlv_buffer += (le16_to_cpu(ppassphrase_tlv->header.len) +
- sizeof(struct mwifiex_ie_types_header));
- cmd->size = cpu_to_le16(le16_to_cpu(cmd->size) +
- le16_to_cpu(ppassphrase_tlv->header.len) +
- sizeof(struct mwifiex_ie_types_header));
- }
- if (psk->psk_type == MWIFIEX_PSK_PMK) {
- ppmk_tlv = (struct mwifiex_ie_types_pmk *) ptlv_buffer;
- ppmk_tlv->header.type = cpu_to_le16(TLV_TYPE_PMK);
- ppmk_tlv->header.len = cpu_to_le16(MWIFIEX_MAX_PMK_LENGTH);
- memcpy(ppmk_tlv->pmk, psk->psk.pmk.pmk, MWIFIEX_MAX_PMK_LENGTH);
- ptlv_buffer += (le16_to_cpu(ppmk_tlv->header.len) +
- sizeof(struct mwifiex_ie_types_header));
- cmd->size = cpu_to_le16(le16_to_cpu(cmd->size) +
- le16_to_cpu(ppmk_tlv->header.len) +
- sizeof(struct mwifiex_ie_types_header));
- }
- if ((cmd_action == HostCmd_ACT_GEN_SET) && ((pssid_tlv || pbssid_tlv)
- && (!ppmk_tlv && !ppassphrase_tlv))) {
- dev_err(priv->adapter->dev,
- "invalid case, ssid/bssid present without"
- " pmk or passphrase\n");
- return -1;
- }
- cmd->command = cpu_to_le16(HostCmd_CMD_SUPPLICANT_PMK);
- pesupp_psk->action = cpu_to_le16(cmd_action);
- pesupp_psk->cache_result = 0;
- return 0;
-}
-
-/*
* This function prepares command to set/get 11d domain information.
*
* Preparation includes -
@@ -1194,10 +1081,6 @@ int mwifiex_sta_prepare_cmd(struct mwifiex_private *priv, uint16_t cmd_no,
cmd_action, cmd_oid,
data_buf);
break;
- case HostCmd_CMD_SUPPLICANT_PMK:
- ret = mwifiex_cmd_802_11_supplicant_pmk(priv, cmd_ptr,
- cmd_action, data_buf);
- break;
case HostCmd_CMD_802_11D_DOMAIN_INFO:
ret = mwifiex_cmd_802_11d_domain_info(priv, cmd_ptr,
cmd_action);
diff --git a/drivers/net/wireless/mwifiex/sta_cmdresp.c b/drivers/net/wireless/mwifiex/sta_cmdresp.c
index f94439d..15a306c 100644
--- a/drivers/net/wireless/mwifiex/sta_cmdresp.c
+++ b/drivers/net/wireless/mwifiex/sta_cmdresp.c
@@ -631,115 +631,6 @@ static int mwifiex_ret_802_11_key_material(struct mwifiex_private *priv,
}
/*
- * This function retrieves passphrase information for specified SSID from
- * command response.
- */
-static int mwifiex_get_passphrase_from_cmdresp(struct mwifiex_private *priv,
- struct host_cmd_ds_command *resp,
- void *data_buf)
-{
- struct host_cmd_ds_802_11_supplicant_pmk *supplicant_pmk_resp =
- &resp->params.esupp_psk;
- struct mwifiex_ds_passphrase *passphrase = NULL;
- struct mwifiex_ie_types_pmk *ppmk_tlv = NULL;
- struct mwifiex_ie_types_passphrase *passphrase_tlv = NULL;
- struct mwifiex_ie_types_ssid_param_set *pssid_tlv = NULL;
- struct mwifiex_ie_types_bssid *pbssid_tlv = NULL;
- u8 *tlv_buf = (u8 *)supplicant_pmk_resp->tlv_buffer;
- int tlv_buf_len = 0;
- u16 tlv;
-
- tlv_buf_len = le16_to_cpu(resp->size) -
- (sizeof(struct host_cmd_ds_802_11_supplicant_pmk) +
- S_DS_GEN-1);
- passphrase = (struct mwifiex_ds_passphrase *)data_buf;
-
- while (tlv_buf_len > 0) {
- tlv = (*tlv_buf) | (*(tlv_buf + 1) << 8);
- if ((tlv != WLAN_EID_SSID) && (tlv != TLV_TYPE_BSSID)
- && (tlv != TLV_TYPE_PASSPHRASE) && (tlv != TLV_TYPE_PMK))
- break;
- switch (tlv) {
- case WLAN_EID_SSID:
- pssid_tlv =
- (struct mwifiex_ie_types_ssid_param_set *)tlv_buf;
- memcpy(passphrase->ssid.ssid, pssid_tlv->ssid,
- le16_to_cpu(pssid_tlv->header.len));
- passphrase->ssid.ssid_len =
- le16_to_cpu(pssid_tlv->header.len);
- tlv_buf += le16_to_cpu(pssid_tlv->header.len) +
- sizeof(struct mwifiex_ie_types_header);
- tlv_buf_len -= (le16_to_cpu(pssid_tlv->header.len)
- + sizeof(struct mwifiex_ie_types_header));
- break;
- case TLV_TYPE_BSSID:
- pbssid_tlv = (struct mwifiex_ie_types_bssid *)tlv_buf;
- memcpy(&passphrase->bssid, pbssid_tlv->bssid, ETH_ALEN);
- tlv_buf += le16_to_cpu(pbssid_tlv->header.len) +
- sizeof(struct mwifiex_ie_types_header);
- tlv_buf_len -= (le16_to_cpu(pbssid_tlv->header.len) +
- sizeof(struct mwifiex_ie_types_header));
- break;
- case TLV_TYPE_PASSPHRASE:
- passphrase_tlv =
- (struct mwifiex_ie_types_passphrase *)tlv_buf;
- passphrase->psk_type = MWIFIEX_PSK_PASSPHRASE;
- passphrase->psk.passphrase.passphrase_len =
- le16_to_cpu(passphrase_tlv->header.len);
- memcpy(passphrase->psk.passphrase.passphrase,
- passphrase_tlv->passphrase,
- le16_to_cpu(passphrase_tlv->header.len));
- tlv_buf += le16_to_cpu(passphrase_tlv->header.len)
- + sizeof(struct mwifiex_ie_types_header);
- tlv_buf_len -= (le16_to_cpu(passphrase_tlv->header.len)
- + sizeof(struct mwifiex_ie_types_header));
- break;
- case TLV_TYPE_PMK:
- ppmk_tlv = (struct mwifiex_ie_types_pmk *)tlv_buf;
- passphrase->psk_type = MWIFIEX_PSK_PMK;
- memcpy(passphrase->psk.pmk.pmk, ppmk_tlv->pmk,
- le16_to_cpu(ppmk_tlv->header.len));
- tlv_buf += le16_to_cpu(ppmk_tlv->header.len)
- + sizeof(struct mwifiex_ie_types_header);
- tlv_buf_len -= (le16_to_cpu(ppmk_tlv->header.len)
- + sizeof(struct mwifiex_ie_types_header));
- break;
-
- }
- }
-return 0;
-}
-
-/*
- * This function handles the command response of set/get passphrase.
- *
- * Handling includes updating driver's private flag 'ewpa_query' (for action
- * SET) and retrieving passphrase (for action GET) for specified
- * SSID
- */
-static int mwifiex_ret_802_11_supplicant_pmk(struct mwifiex_private *priv,
- struct host_cmd_ds_command *resp,
- void *data_buf)
-{
- struct host_cmd_ds_802_11_supplicant_pmk *supplicant_pmk_resp =
- &resp->params.esupp_psk;
- u16 action = le16_to_cpu(supplicant_pmk_resp->action);
-
- if (data_buf) {
- if (action == HostCmd_ACT_GEN_GET) {
- mwifiex_get_passphrase_from_cmdresp(priv, resp,
- data_buf);
- } else if (action == HostCmd_ACT_GEN_SET) {
- dev_dbg(priv->adapter->dev,
- "info: Esupp PMK set: enable ewpa query\n");
- priv->ewpa_query = true;
- }
- }
-
- return 0;
-}
-
-/*
* This function handles the command response of get 11d domain information.
*/
static int mwifiex_ret_802_11d_domain_info(struct mwifiex_private *priv,
@@ -1072,9 +963,6 @@ int mwifiex_process_sta_cmdresp(struct mwifiex_private *priv,
case HostCmd_CMD_802_11_KEY_MATERIAL:
ret = mwifiex_ret_802_11_key_material(priv, resp);
break;
- case HostCmd_CMD_SUPPLICANT_PMK:
- ret = mwifiex_ret_802_11_supplicant_pmk(priv, resp, data_buf);
- break;
case HostCmd_CMD_802_11D_DOMAIN_INFO:
ret = mwifiex_ret_802_11d_domain_info(priv, resp);
break;
diff --git a/drivers/net/wireless/mwifiex/sta_ioctl.c b/drivers/net/wireless/mwifiex/sta_ioctl.c
index 605dd37..d69bb98 100644
--- a/drivers/net/wireless/mwifiex/sta_ioctl.c
+++ b/drivers/net/wireless/mwifiex/sta_ioctl.c
@@ -1981,60 +1981,6 @@ mwifiex_sec_ioctl_encrypt_key(struct mwifiex_private *priv,
}
/*
- * IOCTL request handler to set/get/clear passphrase for esupplicant.
- *
- * This function prepares corresponding firmware command and
- * issues it.
- */
-int mwifiex_sec_ioctl_passphrase(struct mwifiex_private *priv,
- struct mwifiex_wait_queue *wait,
- struct mwifiex_ds_passphrase *passphrase,
- u16 action)
-{
- int ret = 0;
- struct mwifiex_adapter *adapter = priv->adapter;
- struct mwifiex_bssdescriptor *pbss_desc;
- u16 cmd_action = 0;
- int i = 0;
-
- if (action == HostCmd_ACT_GEN_SET) {
- if (passphrase->psk_type == MWIFIEX_PSK_CLEAR)
- cmd_action = HostCmd_ACT_GEN_REMOVE;
- else
- cmd_action = HostCmd_ACT_GEN_SET;
- } else {
- if (passphrase->psk_type == MWIFIEX_PSK_QUERY) {
- if (passphrase->ssid.ssid_len == 0) {
- i = mwifiex_find_bssid_in_list(priv,
- passphrase->bssid,
- MWIFIEX_BSS_MODE_AUTO);
- if (i >= 0) {
- pbss_desc = &adapter->scan_table[i];
- memcpy(&passphrase->ssid,
- &pbss_desc->ssid,
- sizeof(struct mwifiex_802_11_ssid));
- memset(passphrase->bssid, 0, ETH_ALEN);
- dev_dbg(adapter->dev, "info: PSK_QUERY:"
- " found ssid=%s\n",
- passphrase->ssid.ssid);
- }
- } else {
- memset(passphrase->bssid, 0, ETH_ALEN);
- }
- }
- cmd_action = HostCmd_ACT_GEN_GET;
- }
-
- /* Send request to firmware */
- ret = mwifiex_prepare_cmd(priv, HostCmd_CMD_SUPPLICANT_PMK, cmd_action,
- 0, wait, passphrase);
- if (!ret)
- ret = -EINPROGRESS;
-
- return ret;
-}
-
-/*
* Sends IOCTL request to set host sleep configurations.
*
* This function allocates the IOCTL request buffer, fills it
@@ -2730,52 +2676,6 @@ done:
}
/*
- * Set eWPA mode if passphrase/psk is set
- */
-int mwifiex_set_ewpa_mode_from_passphrase(struct mwifiex_private *priv,
- struct mwifiex_ds_passphrase *psec_pp)
-{
- if ((psec_pp->psk_type == MWIFIEX_PSK_PASSPHRASE &&
- psec_pp->psk.passphrase.passphrase_len > 0) ||
- (psec_pp->psk_type == MWIFIEX_PSK_PMK))
- priv->sec_info.ewpa_enabled = true;
- else
- priv->sec_info.ewpa_enabled = false;
-
- dev_dbg(priv->adapter->dev, "info: set ewpa mode = %d\n",
- priv->sec_info.ewpa_enabled);
-
- return 0;
-}
-
-/*
- * Sends IOCTL request to get/set/clear passphrase for specified SSID.
- *
- * This function allocates the IOCTL request buffer, fills it
- * with requisite parameters and calls the IOCTL handler.
- */
-int mwifiex_set_passphrase(struct mwifiex_private *priv, int action,
- struct mwifiex_ds_passphrase *ds_passphrase)
-{
- int ret = 0;
- int status = 0;
- struct mwifiex_wait_queue *wait = NULL;
-
- wait = mwifiex_alloc_fill_wait_queue(priv, MWIFIEX_IOCTL_WAIT);
- if (!wait)
- return -ENOMEM;
-
- status = mwifiex_sec_ioctl_passphrase(priv, wait, ds_passphrase,
- action);
-
- if (mwifiex_request_ioctl(priv, wait, status, MWIFIEX_IOCTL_WAIT))
- ret = -EFAULT;
-
- kfree(wait);
- return ret;
-}
-
-/*
* This function sets a generic IE. In addition to generic IE, it can
* also handle WPA, WPA2 and WAPI IEs.
*/
--
1.7.0.2
^ permalink raw reply related [flat|nested] 16+ messages in thread* [PATCH 07/11] mwifiex: remove unnecessary flag ewpa_enabled
2011-03-17 0:09 [PATCH 00/11] remove configuration APIs from debugfs (part 2) Bing Zhao
` (5 preceding siblings ...)
2011-03-17 0:09 ` [PATCH 06/11] mwifiex: remove passphrase " Bing Zhao
@ 2011-03-17 0:09 ` Bing Zhao
2011-03-17 0:09 ` [PATCH 08/11] mwifiex: remove some redundant WEP key handling Bing Zhao
` (4 subsequent siblings)
11 siblings, 0 replies; 16+ messages in thread
From: Bing Zhao @ 2011-03-17 0:09 UTC (permalink / raw)
To: linux-wireless
Cc: John W. Linville, Johannes Berg, Amitkumar Karwar, Kiran Divekar,
Yogesh Powar, Marc Yang, Frank Huang, Bing Zhao
From: Amitkumar Karwar <akarwar@marvell.com>
'priv->sec_info.ewpa_enabled' flag was used to store embedded
supplicant status. Now remove ewpa_enable from priv->sec_info
since embedded supplicant has already been removed.
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
---
drivers/net/wireless/mwifiex/cfg80211.c | 3 -
drivers/net/wireless/mwifiex/join.c | 97 +----------------------------
drivers/net/wireless/mwifiex/main.h | 1 -
drivers/net/wireless/mwifiex/scan.c | 51 ----------------
drivers/net/wireless/mwifiex/sta_event.c | 1 -
drivers/net/wireless/mwifiex/sta_ioctl.c | 13 +---
drivers/net/wireless/mwifiex/wmm.c | 5 +-
7 files changed, 10 insertions(+), 161 deletions(-)
diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c
index ad95d53..fe03baa 100644
--- a/drivers/net/wireless/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/mwifiex/cfg80211.c
@@ -1046,9 +1046,6 @@ mwifiex_cfg80211_assoc(struct mwifiex_private *priv, size_t ssid_len, u8 *ssid,
mwifiex_channels_to_cfg80211_channel_type
(priv->adapter->chan_offset));
- /* reset eWPA mode */
- priv->sec_info.ewpa_enabled = false;
-
if (!sme && (mode != MWIFIEX_BSS_MODE_IBSS)) {
BUG_ON(sme == NULL);
return ret;
diff --git a/drivers/net/wireless/mwifiex/join.c b/drivers/net/wireless/mwifiex/join.c
index 34623d1..fb189ba 100644
--- a/drivers/net/wireless/mwifiex/join.c
+++ b/drivers/net/wireless/mwifiex/join.c
@@ -334,76 +334,6 @@ static int mwifiex_append_rsn_ie_wpa_wpa2(struct mwifiex_private *priv,
}
/*
- * This function appends rsn ie tlv for embedded supplicant.
- * It is called from the network join command preparation routine.
- */
-static int
-mwifiex_append_rsn_ie_ewpa(struct mwifiex_private *priv, u8 **buffer,
- struct mwifiex_bssdescriptor *bss_desc)
-{
- struct mwifiex_ie_types_rsn_param_set *rsn_ie_tlv;
- int rsn_ie_len = 0;
-
- if (!buffer || !(*buffer))
- return 0;
-
- rsn_ie_tlv = (struct mwifiex_ie_types_rsn_param_set *) (*buffer);
- if (bss_desc->bcn_wpa_ie) {
- rsn_ie_tlv->header.type =
- cpu_to_le16((u16) (*(bss_desc->bcn_wpa_ie))
- .vend_hdr.element_id);
- rsn_ie_tlv->header.type =
- cpu_to_le16(le16_to_cpu(rsn_ie_tlv->header.type)
- & 0x00FF);
- rsn_ie_tlv->header.len =
- cpu_to_le16((u16) (*(bss_desc->bcn_wpa_ie))
- .vend_hdr.len);
- rsn_ie_tlv->header.len =
- cpu_to_le16(le16_to_cpu(rsn_ie_tlv->header.len)
- & 0x00FF);
- if (le16_to_cpu(rsn_ie_tlv->header.len)
- <= (sizeof(priv->wpa_ie)))
- memcpy(rsn_ie_tlv->rsn_ie, &((*(bss_desc->bcn_wpa_ie))
- .vend_hdr.oui[0]),
- le16_to_cpu(rsn_ie_tlv->header.len));
- else
- return -1;
-
- rsn_ie_len += sizeof(rsn_ie_tlv->header) +
- le16_to_cpu(rsn_ie_tlv->header.len);
- *buffer += rsn_ie_len;
- }
- if (bss_desc->bcn_rsn_ie) {
- rsn_ie_tlv = (struct mwifiex_ie_types_rsn_param_set *)
- (*buffer);
- rsn_ie_tlv->header.type =
- cpu_to_le16((u16) (*(bss_desc->bcn_rsn_ie))
- .ieee_hdr.element_id);
- rsn_ie_tlv->header.type =
- cpu_to_le16(le16_to_cpu(rsn_ie_tlv->header.type)
- & 0x00FF);
- rsn_ie_tlv->header.len =
- cpu_to_le16((u16) (*(bss_desc->bcn_rsn_ie))
- .ieee_hdr.len);
- rsn_ie_tlv->header.len =
- cpu_to_le16(le16_to_cpu(rsn_ie_tlv->header.len)
- & 0x00FF);
- if (le16_to_cpu(rsn_ie_tlv->header.len)
- <= (sizeof(priv->wpa_ie)))
- memcpy(rsn_ie_tlv->rsn_ie,
- &((*(bss_desc->bcn_rsn_ie)).data[0]),
- le16_to_cpu(rsn_ie_tlv->header.len));
- else
- return -1;
-
- rsn_ie_len += sizeof(rsn_ie_tlv->header) +
- le16_to_cpu(rsn_ie_tlv->header.len);
- buffer += rsn_ie_len;
- }
- return rsn_ie_len;
-}
-
-/*
* This function prepares command for association.
*
* This sets the following parameters -
@@ -560,9 +490,6 @@ int mwifiex_cmd_802_11_associate(struct mwifiex_private *priv,
if (!priv->wps.session_enable) {
if (priv->sec_info.wpa_enabled || priv->sec_info.wpa2_enabled)
rsn_ie_len = mwifiex_append_rsn_ie_wpa_wpa2(priv, &pos);
- else if (priv->sec_info.ewpa_enabled)
- rsn_ie_len = mwifiex_append_rsn_ie_ewpa(priv, &pos,
- bss_desc);
if (rsn_ie_len == -1)
return -1;
@@ -789,9 +716,7 @@ int mwifiex_ret_802_11_associate(struct mwifiex_private *priv,
if (netif_queue_stopped(priv->netdev))
netif_wake_queue(priv->netdev);
- if (priv->sec_info.ewpa_enabled ||
- priv->sec_info.wpa_enabled ||
- priv->sec_info.wpa2_enabled)
+ if (priv->sec_info.wpa_enabled || priv->sec_info.wpa2_enabled)
priv->scan_block = true;
done:
@@ -846,12 +771,6 @@ mwifiex_cmd_802_11_ad_hoc_start(struct mwifiex_private *priv,
struct mwifiex_ie_types_htcap *ht_cap;
struct mwifiex_ie_types_htinfo *ht_info;
- /* wpa ie for WPA_NONE AES */
- const u8 wpa_ie[24] = { 0xdd, 0x16, 0x00, 0x50, 0xf2,
- 0x01, 0x01, 0x00, 0x00, 0x50, 0xf2, 0x04, 0x01,
- 0x00, 0x00, 0x50, 0xf2, 0x00, 0x01, 0x00, 0x00,
- 0x50, 0xf2, 0x00
- };
u8 *pos = (u8 *) adhoc_start +
sizeof(struct host_cmd_ds_802_11_ad_hoc_start);
@@ -954,8 +873,7 @@ mwifiex_cmd_802_11_ad_hoc_start(struct mwifiex_private *priv,
/* Set up privacy in bss_desc */
if (priv->sec_info.wep_status == MWIFIEX_802_11_WEP_ENABLED
- || priv->sec_info.wpa_enabled
- || priv->sec_info.ewpa_enabled) {
+ || priv->sec_info.wpa_enabled) {
/* Ad-Hoc capability privacy on */
dev_dbg(adapter->dev,
"info: ADHOC_S_CMD: wep_status set privacy to WEP\n");
@@ -1038,12 +956,7 @@ mwifiex_cmd_802_11_ad_hoc_start(struct mwifiex_private *priv,
cmd_append_size += mwifiex_cmd_append_vsie_tlv(priv,
MWIFIEX_VSIE_MASK_ADHOC, &pos);
- if (priv->sec_info.ewpa_enabled) {
- memcpy(priv->wpa_ie, wpa_ie, sizeof(wpa_ie));
- priv->wpa_ie_len = sizeof(wpa_ie);
- }
-
- if (priv->sec_info.wpa_enabled || priv->sec_info.ewpa_enabled) {
+ if (priv->sec_info.wpa_enabled) {
rsn_ie_len = mwifiex_append_rsn_ie_wpa_wpa2(priv, &pos);
if (rsn_ie_len == -1)
return -1;
@@ -1222,7 +1135,7 @@ mwifiex_cmd_802_11_ad_hoc_join(struct mwifiex_private *priv,
priv->curr_bss_params.band = (u8) bss_desc->bss_band;
if (priv->sec_info.wep_status == MWIFIEX_802_11_WEP_ENABLED
- || priv->sec_info.wpa_enabled || priv->sec_info.ewpa_enabled)
+ || priv->sec_info.wpa_enabled)
tmp_cap |= WLAN_CAPABILITY_PRIVACY;
if (IS_SUPPORT_MULTI_BANDS(priv->adapter)) {
@@ -1252,8 +1165,6 @@ mwifiex_cmd_802_11_ad_hoc_join(struct mwifiex_private *priv,
if (priv->sec_info.wpa_enabled)
rsn_ie_len = mwifiex_append_rsn_ie_wpa_wpa2(priv, &pos);
- else if (priv->sec_info.ewpa_enabled)
- rsn_ie_len = mwifiex_append_rsn_ie_ewpa(priv, &pos, bss_desc);
if (rsn_ie_len == -1)
return -1;
cmd_append_size += rsn_ie_len;
diff --git a/drivers/net/wireless/mwifiex/main.h b/drivers/net/wireless/mwifiex/main.h
index f074f5c..f13ae51 100644
--- a/drivers/net/wireless/mwifiex/main.h
+++ b/drivers/net/wireless/mwifiex/main.h
@@ -228,7 +228,6 @@ struct mwifiex_wmm_desc {
struct mwifiex_802_11_security {
u8 wpa_enabled;
- u8 ewpa_enabled;
u8 wpa2_enabled;
u8 wapi_enabled;
u8 wapi_key_on;
diff --git a/drivers/net/wireless/mwifiex/scan.c b/drivers/net/wireless/mwifiex/scan.c
index c0d5823..1152beb 100644
--- a/drivers/net/wireless/mwifiex/scan.c
+++ b/drivers/net/wireless/mwifiex/scan.c
@@ -241,26 +241,6 @@ int mwifiex_set_user_scan_ioctl(struct mwifiex_private *priv,
}
/*
- * This function checks if ewpa is enabled in driver and scanned network is
- * compatible with it.
- */
-static bool
-mwifiex_is_network_compatible_for_ewpa(struct mwifiex_private *priv,
- struct mwifiex_bssdescriptor *bss_desc)
-{
- if (priv->sec_info.ewpa_enabled) {
- if (((bss_desc->bcn_wpa_ie) &&
- ((*(bss_desc->bcn_wpa_ie)).vend_hdr.element_id ==
- WLAN_EID_WPA)) || ((bss_desc->bcn_rsn_ie) &&
- ((*(bss_desc->bcn_rsn_ie)).ieee_hdr.element_id ==
- WLAN_EID_RSN))) {
- return true;
- }
- }
- return false;
-}
-
-/*
* This function checks if wapi is enabled in driver and scanned network is
* compatible with it.
*/
@@ -485,37 +465,6 @@ mwifiex_is_network_compatible(struct mwifiex_private *priv, u32 index, u32 mode)
return index;
}
- if (bss_desc->bss_mode == mode) {
- if (mwifiex_is_network_compatible_for_ewpa(priv, bss_desc)) {
- if (((priv->adapter->config_bands & BAND_GN ||
- priv->adapter->config_bands & BAND_AN) &&
- bss_desc->bcn_ht_cap)
- && !mwifiex_is_wpa_oui_present(bss_desc,
- CIPHER_SUITE_CCMP)
- && !mwifiex_is_rsn_oui_present(bss_desc,
- CIPHER_SUITE_CCMP)) {
-
- if (mwifiex_is_wpa_oui_present(bss_desc,
- CIPHER_SUITE_TKIP) ||
- mwifiex_is_rsn_oui_present(bss_desc,
- CIPHER_SUITE_TKIP)) {
- dev_dbg(adapter->dev,
- "info: disable 11n if AES "
- "is not supported by AP\n");
- bss_desc->disable_11n = true;
-
- } else {
- return -1;
- }
- }
- return index;
- } else if (priv->sec_info.ewpa_enabled) {
- dev_dbg(adapter->dev,
- "info: ewpa_enabled: ignore none WPA/WPA2 AP\n");
- return -1;
- }
- }
-
if (mwifiex_is_network_compatible_for_wapi(priv, bss_desc)) {
dev_dbg(adapter->dev, "info: return success for WAPI AP\n");
return index;
diff --git a/drivers/net/wireless/mwifiex/sta_event.c b/drivers/net/wireless/mwifiex/sta_event.c
index 5af2bc4..d4a5c1f 100644
--- a/drivers/net/wireless/mwifiex/sta_event.c
+++ b/drivers/net/wireless/mwifiex/sta_event.c
@@ -68,7 +68,6 @@ mwifiex_reset_connect_state(struct mwifiex_private *priv)
priv->bcn_nf_avg = 0;
priv->rxpd_rate = 0;
priv->rxpd_htinfo = 0;
- priv->sec_info.ewpa_enabled = false;
priv->sec_info.wpa_enabled = false;
priv->sec_info.wpa2_enabled = false;
priv->wpa_ie_len = 0;
diff --git a/drivers/net/wireless/mwifiex/sta_ioctl.c b/drivers/net/wireless/mwifiex/sta_ioctl.c
index d69bb98..3ca5705 100644
--- a/drivers/net/wireless/mwifiex/sta_ioctl.c
+++ b/drivers/net/wireless/mwifiex/sta_ioctl.c
@@ -1894,7 +1894,6 @@ static int mwifiex_sec_ioctl_get_key(struct mwifiex_adapter *adapter,
if ((priv->sec_info.wep_status == MWIFIEX_802_11_WEP_ENABLED)
|| (priv->sec_info.wep_status == MWIFIEX_802_11_WEP_KEY_ABSENT)
- || priv->sec_info.ewpa_enabled
|| priv->sec_info.wpa_enabled || priv->sec_info.wpa2_enabled)
encrypt_key->key_disable = false;
else
@@ -1912,10 +1911,8 @@ static int mwifiex_sec_ioctl_get_key(struct mwifiex_adapter *adapter,
priv->wep_key[index].key_length);
encrypt_key->key_len =
priv->wep_key[index].key_length;
- } else if ((priv->sec_info.wpa_enabled)
- || (priv->sec_info.ewpa_enabled)
- || (priv->sec_info.wpa2_enabled)
- ) {
+ } else if (priv->sec_info.wpa_enabled
+ || priv->sec_info.wpa2_enabled) {
/* Return WPA enabled */
encrypt_key->key_disable = false;
memcpy(encrypt_key->key_material,
@@ -1935,10 +1932,8 @@ static int mwifiex_sec_ioctl_get_key(struct mwifiex_adapter *adapter,
priv->wep_key[index].key_material,
priv->wep_key[index].key_length);
encrypt_key->key_len = priv->wep_key[index].key_length;
- } else if ((priv->sec_info.wpa_enabled)
- || (priv->sec_info.ewpa_enabled)
- || (priv->sec_info.wpa2_enabled)
- ) {
+ } else if (priv->sec_info.wpa_enabled
+ || priv->sec_info.wpa2_enabled) {
/* Return WPA enabled */
encrypt_key->key_disable = false;
} else {
diff --git a/drivers/net/wireless/mwifiex/wmm.c b/drivers/net/wireless/mwifiex/wmm.c
index 376fede..1cfbc6b 100644
--- a/drivers/net/wireless/mwifiex/wmm.c
+++ b/drivers/net/wireless/mwifiex/wmm.c
@@ -1179,9 +1179,8 @@ mwifiex_dequeue_tx_packet(struct mwifiex_adapter *adapter)
}
if (!ptr->is_11n_enabled || mwifiex_is_ba_stream_setup(priv, ptr, tid)
- || (!priv->sec_info.ewpa_enabled &&
- ((priv->sec_info.wpa_enabled
- || priv->sec_info.wpa2_enabled) && !priv->wpa_is_gtk_set))
+ || ((priv->sec_info.wpa_enabled
+ || priv->sec_info.wpa2_enabled) && !priv->wpa_is_gtk_set)
) {
mwifiex_send_single_packet(priv, ptr, ptr_index, flags);
/* ra_list_spinlock has been freed in
--
1.7.0.2
^ permalink raw reply related [flat|nested] 16+ messages in thread* [PATCH 08/11] mwifiex: remove some redundant WEP key handling
2011-03-17 0:09 [PATCH 00/11] remove configuration APIs from debugfs (part 2) Bing Zhao
` (6 preceding siblings ...)
2011-03-17 0:09 ` [PATCH 07/11] mwifiex: remove unnecessary flag ewpa_enabled Bing Zhao
@ 2011-03-17 0:09 ` Bing Zhao
2011-03-17 0:09 ` [PATCH 09/11] mwifiex: optimize add_key callback function Bing Zhao
` (3 subsequent siblings)
11 siblings, 0 replies; 16+ messages in thread
From: Bing Zhao @ 2011-03-17 0:09 UTC (permalink / raw)
To: linux-wireless
Cc: John W. Linville, Johannes Berg, Amitkumar Karwar, Kiran Divekar,
Yogesh Powar, Marc Yang, Frank Huang, Bing Zhao
From: Amitkumar Karwar <akarwar@marvell.com>
1) mwifiex_sec_ioctl_get_key() is unused
2) is_current_wep_key flag is unused after 1) is removed
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
---
drivers/net/wireless/mwifiex/ioctl.h | 1 -
drivers/net/wireless/mwifiex/sta_ioctl.c | 103 ++++--------------------------
2 files changed, 13 insertions(+), 91 deletions(-)
diff --git a/drivers/net/wireless/mwifiex/ioctl.h b/drivers/net/wireless/mwifiex/ioctl.h
index f4227dd..158664b 100644
--- a/drivers/net/wireless/mwifiex/ioctl.h
+++ b/drivers/net/wireless/mwifiex/ioctl.h
@@ -296,7 +296,6 @@ enum {
struct mwifiex_ds_encrypt_key {
u32 key_disable;
u32 key_index;
- u32 is_current_wep_key;
u32 key_len;
u8 key_material[MWIFIEX_MAX_KEY_LENGTH];
u8 mac_addr[ETH_ALEN];
diff --git a/drivers/net/wireless/mwifiex/sta_ioctl.c b/drivers/net/wireless/mwifiex/sta_ioctl.c
index 3ca5705..bda00dd 100644
--- a/drivers/net/wireless/mwifiex/sta_ioctl.c
+++ b/drivers/net/wireless/mwifiex/sta_ioctl.c
@@ -1744,10 +1744,7 @@ static int mwifiex_sec_ioctl_set_wep_key(struct mwifiex_adapter *adapter,
if (priv->wep_key_curr_index >= NUM_WEP_KEYS)
priv->wep_key_curr_index = 0;
wep_key = &priv->wep_key[priv->wep_key_curr_index];
- if (encrypt_key->is_current_wep_key)
- index = priv->wep_key_curr_index;
- else
- index = encrypt_key->key_index;
+ index = encrypt_key->key_index;
if (encrypt_key->key_disable) {
priv->sec_info.wep_status = MWIFIEX_802_11_WEP_DISABLED;
} else if (!encrypt_key->key_len) {
@@ -1878,73 +1875,6 @@ static int mwifiex_sec_ioctl_set_wpa_key(struct mwifiex_adapter *adapter,
}
/*
- * IOCTL request handler to get network key.
- *
- * This function works with both WEP and WPA keys.
- */
-static int mwifiex_sec_ioctl_get_key(struct mwifiex_adapter *adapter,
- struct mwifiex_wait_queue *wait,
- struct mwifiex_ds_encrypt_key *encrypt_key)
-{
- struct mwifiex_private *priv = adapter->priv[wait->bss_index];
- int index;
-
- if (priv->wep_key_curr_index >= NUM_WEP_KEYS)
- priv->wep_key_curr_index = 0;
-
- if ((priv->sec_info.wep_status == MWIFIEX_802_11_WEP_ENABLED)
- || (priv->sec_info.wep_status == MWIFIEX_802_11_WEP_KEY_ABSENT)
- || priv->sec_info.wpa_enabled || priv->sec_info.wpa2_enabled)
- encrypt_key->key_disable = false;
- else
- encrypt_key->key_disable = true;
-
- if (encrypt_key->is_current_wep_key) {
- if ((priv->wep_key[priv->wep_key_curr_index].key_length) &&
- (priv->sec_info.wep_status ==
- MWIFIEX_802_11_WEP_ENABLED)) {
- index = priv->wep_key_curr_index;
- encrypt_key->key_index =
- priv->wep_key[index].key_index;
- memcpy(encrypt_key->key_material,
- priv->wep_key[index].key_material,
- priv->wep_key[index].key_length);
- encrypt_key->key_len =
- priv->wep_key[index].key_length;
- } else if (priv->sec_info.wpa_enabled
- || priv->sec_info.wpa2_enabled) {
- /* Return WPA enabled */
- encrypt_key->key_disable = false;
- memcpy(encrypt_key->key_material,
- priv->aes_key.key_param_set.key,
- le16_to_cpu(
- priv->aes_key.key_param_set.key_len));
- encrypt_key->key_len = le16_to_cpu(
- priv->aes_key.key_param_set.key_len);
- } else {
- encrypt_key->key_disable = true;
- }
- } else {
- index = encrypt_key->key_index;
- if (priv->wep_key[index].key_length) {
- encrypt_key->key_index = priv->wep_key[index].key_index;
- memcpy(encrypt_key->key_material,
- priv->wep_key[index].key_material,
- priv->wep_key[index].key_length);
- encrypt_key->key_len = priv->wep_key[index].key_length;
- } else if (priv->sec_info.wpa_enabled
- || priv->sec_info.wpa2_enabled) {
- /* Return WPA enabled */
- encrypt_key->key_disable = false;
- } else {
- encrypt_key->key_disable = true;
- }
- }
-
- return 0;
-}
-
-/*
* IOCTL request handler to set/get network keys.
*
* This is a generic key handling function which supports WEP, WPA
@@ -1953,25 +1883,20 @@ static int mwifiex_sec_ioctl_get_key(struct mwifiex_adapter *adapter,
static int
mwifiex_sec_ioctl_encrypt_key(struct mwifiex_private *priv,
struct mwifiex_wait_queue *wait,
- struct mwifiex_ds_encrypt_key *encrypt_key,
- u16 action)
+ struct mwifiex_ds_encrypt_key *encrypt_key)
{
int status = 0;
struct mwifiex_adapter *adapter = priv->adapter;
- if (action == HostCmd_ACT_GEN_SET) {
- if (encrypt_key->is_wapi_key)
- status = mwifiex_sec_ioctl_set_wapi_key(adapter,
- wait, encrypt_key);
- else if (encrypt_key->key_len > WLAN_KEY_LEN_WEP104)
- status = mwifiex_sec_ioctl_set_wpa_key(adapter,
- wait, encrypt_key);
- else
- status = mwifiex_sec_ioctl_set_wep_key(adapter,
- wait, encrypt_key);
- } else {
- status = mwifiex_sec_ioctl_get_key(adapter, wait, encrypt_key);
- }
+ if (encrypt_key->is_wapi_key)
+ status = mwifiex_sec_ioctl_set_wapi_key(adapter, wait,
+ encrypt_key);
+ else if (encrypt_key->key_len > WLAN_KEY_LEN_WEP104)
+ status = mwifiex_sec_ioctl_set_wpa_key(adapter, wait,
+ encrypt_key);
+ else
+ status = mwifiex_sec_ioctl_set_wep_key(adapter, wait,
+ encrypt_key);
return status;
}
@@ -2375,8 +2300,7 @@ mwifiex_set_encode(struct mwifiex_private *priv, u32 cipher, const u8 *key,
if (cipher == WLAN_CIPHER_SUITE_WEP40
|| cipher == WLAN_CIPHER_SUITE_WEP104) {
status = mwifiex_sec_ioctl_encrypt_key(priv, wait,
- &encrypt_key,
- HostCmd_ACT_GEN_SET);
+ &encrypt_key);
if (mwifiex_request_ioctl(priv, wait, status,
MWIFIEX_IOCTL_WAIT)) {
ret = -EFAULT;
@@ -2388,8 +2312,7 @@ mwifiex_set_encode(struct mwifiex_private *priv, u32 cipher, const u8 *key,
encrypt_key.key_disable = true;
}
- status = mwifiex_sec_ioctl_encrypt_key(priv, wait, &encrypt_key,
- HostCmd_ACT_GEN_SET);
+ status = mwifiex_sec_ioctl_encrypt_key(priv, wait, &encrypt_key);
if (mwifiex_request_ioctl(priv, wait, status, MWIFIEX_IOCTL_WAIT))
ret = -EFAULT;
--
1.7.0.2
^ permalink raw reply related [flat|nested] 16+ messages in thread* [PATCH 09/11] mwifiex: optimize add_key callback function
2011-03-17 0:09 [PATCH 00/11] remove configuration APIs from debugfs (part 2) Bing Zhao
` (7 preceding siblings ...)
2011-03-17 0:09 ` [PATCH 08/11] mwifiex: remove some redundant WEP key handling Bing Zhao
@ 2011-03-17 0:09 ` Bing Zhao
2011-03-17 0:09 ` [PATCH 10/11] mwifiex: remove txbufcfg command from debugfs Bing Zhao
` (2 subsequent siblings)
11 siblings, 0 replies; 16+ messages in thread
From: Bing Zhao @ 2011-03-17 0:09 UTC (permalink / raw)
To: linux-wireless
Cc: John W. Linville, Johannes Berg, Amitkumar Karwar, Kiran Divekar,
Yogesh Powar, Marc Yang, Frank Huang, Bing Zhao
From: Amitkumar Karwar <akarwar@marvell.com>
Previously in add_key callback function we used to call
mwifiex_sec_ioctl_encrypt_key() routine twice. First call was to
modify key in driver's database and second was to update default
tx key index.
Now we will be implementing set_default_key handler. So second call
can be skipped.
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
---
drivers/net/wireless/mwifiex/fw.h | 2 --
drivers/net/wireless/mwifiex/sta_ioctl.c | 22 ++--------------------
2 files changed, 2 insertions(+), 22 deletions(-)
diff --git a/drivers/net/wireless/mwifiex/fw.h b/drivers/net/wireless/mwifiex/fw.h
index 49d76fd..a5a9547 100644
--- a/drivers/net/wireless/mwifiex/fw.h
+++ b/drivers/net/wireless/mwifiex/fw.h
@@ -120,8 +120,6 @@ enum MWIFIEX_802_11_PRIVACY_FILTER {
enum MWIFIEX_802_11_WEP_STATUS {
MWIFIEX_802_11_WEP_ENABLED,
MWIFIEX_802_11_WEP_DISABLED,
- MWIFIEX_802_11_WEP_KEY_ABSENT,
- MWIFIEX_802_11_WEP_NOT_SUPPORTED
};
#define CAL_SNR(RSSI, NF) ((s16)((s16)(RSSI)-(s16)(NF)))
diff --git a/drivers/net/wireless/mwifiex/sta_ioctl.c b/drivers/net/wireless/mwifiex/sta_ioctl.c
index bda00dd..0fd24cb 100644
--- a/drivers/net/wireless/mwifiex/sta_ioctl.c
+++ b/drivers/net/wireless/mwifiex/sta_ioctl.c
@@ -1767,14 +1767,7 @@ static int mwifiex_sec_ioctl_set_wep_key(struct mwifiex_adapter *adapter,
encrypt_key->key_len);
wep_key->key_index = index;
wep_key->key_length = encrypt_key->key_len;
- if (priv->sec_info.wep_status != MWIFIEX_802_11_WEP_ENABLED)
- /*
- * The status is set as Key Absent
- * so as to make sure we display the
- * keys when iwlist mwifiexX key is used
- */
- priv->sec_info.wep_status =
- MWIFIEX_802_11_WEP_KEY_ABSENT;
+ priv->sec_info.wep_status = MWIFIEX_802_11_WEP_ENABLED;
}
if (wep_key->key_length) {
/* Send request to firmware */
@@ -2283,6 +2276,7 @@ mwifiex_set_encode(struct mwifiex_private *priv, u32 cipher, const u8 *key,
if (!wait)
return -ENOMEM;
+ memset(&encrypt_key, 0, sizeof(struct mwifiex_ds_encrypt_key));
encrypt_key.key_len = key_len;
if (!disable) {
if (cipher != WLAN_CIPHER_SUITE_WEP40 &&
@@ -2296,18 +2290,6 @@ mwifiex_set_encode(struct mwifiex_private *priv, u32 cipher, const u8 *key,
}
encrypt_key.key_index = key_index;
memcpy(encrypt_key.key_material, key, key_len);
-
- if (cipher == WLAN_CIPHER_SUITE_WEP40
- || cipher == WLAN_CIPHER_SUITE_WEP104) {
- status = mwifiex_sec_ioctl_encrypt_key(priv, wait,
- &encrypt_key);
- if (mwifiex_request_ioctl(priv, wait, status,
- MWIFIEX_IOCTL_WAIT)) {
- ret = -EFAULT;
- goto done;
- }
- encrypt_key.key_len = 0;
- }
} else {
encrypt_key.key_disable = true;
}
--
1.7.0.2
^ permalink raw reply related [flat|nested] 16+ messages in thread* [PATCH 10/11] mwifiex: remove txbufcfg command from debugfs
2011-03-17 0:09 [PATCH 00/11] remove configuration APIs from debugfs (part 2) Bing Zhao
` (8 preceding siblings ...)
2011-03-17 0:09 ` [PATCH 09/11] mwifiex: optimize add_key callback function Bing Zhao
@ 2011-03-17 0:09 ` Bing Zhao
2011-03-17 0:09 ` [PATCH 11/11] mwifiex: remove amsduaggrctrl " Bing Zhao
2011-03-17 9:32 ` [PATCH 00/11] remove configuration APIs from debugfs (part 2) Johannes Berg
11 siblings, 0 replies; 16+ messages in thread
From: Bing Zhao @ 2011-03-17 0:09 UTC (permalink / raw)
To: linux-wireless
Cc: John W. Linville, Johannes Berg, Amitkumar Karwar, Kiran Divekar,
Yogesh Powar, Marc Yang, Frank Huang, Bing Zhao
From: Yogesh Ashok Powar <yogeshp@marvell.com>
The default setting for Tx buffer size is 2K.
Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
---
drivers/net/wireless/mwifiex/README | 23 ---------
drivers/net/wireless/mwifiex/debugfs.c | 72 ------------------------------
drivers/net/wireless/mwifiex/main.h | 6 ---
drivers/net/wireless/mwifiex/sta_ioctl.c | 34 --------------
4 files changed, 0 insertions(+), 135 deletions(-)
diff --git a/drivers/net/wireless/mwifiex/README b/drivers/net/wireless/mwifiex/README
index 91fe1f9..01a17d4 100644
--- a/drivers/net/wireless/mwifiex/README
+++ b/drivers/net/wireless/mwifiex/README
@@ -163,29 +163,6 @@ info
3) FOR DRIVER CONFIGURATION
-txbufcfg
- This command can be used to set max transmit buffer size of firmware. Increasing this
- buffer size is recommended for AMSDU packets. (Default is 2048)
-
- Usage:
- echo "<n>" > txbufcfg
- cat txbufcfg
-
- where <n> is <buffer size in byte>
-
- <buffer size> - This can be 2048/4096/8192.
-
- eg:
- cat txbufcfg - This will display the current buffer size.
- echo "8192" > txbufcfg - This will change the tx buffer size of 8192.
-
- For AMSDU for work for multiple packets we may need the max tx buffer size to be
- 4096/8192.
-
- Note:- This command should be issue in disconnected state.
- Otherwise, new setting will be effected in next time associate.
- The actual tx buf size will depends on AP's capability and max transmit buffer size.
-
amsduaggrctrl
This command could be used to enable/disable a feature where firmware gives feedback to driver
regarding the optimal AMSDU buffer size to use with the current rate. Firmware will use the
diff --git a/drivers/net/wireless/mwifiex/debugfs.c b/drivers/net/wireless/mwifiex/debugfs.c
index 48e3f72..37576b4 100644
--- a/drivers/net/wireless/mwifiex/debugfs.c
+++ b/drivers/net/wireless/mwifiex/debugfs.c
@@ -1001,76 +1001,6 @@ done:
return ret;
}
-/*
- * Proc txbufcfg file write handler.
- *
- * This function is called when the 'txbufcfg' file is opened for writing
- *
- * This function can be used to set the Tx buffer size.
- */
-static ssize_t
-mwifiex_txbufcfg_write(struct file *file, const char __user *ubuf,
- size_t count, loff_t *ppos)
-{
- struct mwifiex_private *priv =
- (struct mwifiex_private *) file->private_data;
- unsigned long addr = get_zeroed_page(GFP_KERNEL);
- char *buf = (char *) addr;
- size_t buf_size = min(count, (size_t) (PAGE_SIZE - 1));
- int txbufcfg = 0;
- int ret = 0;
-
- if (!buf)
- return -ENOMEM;
-
- if (copy_from_user(buf, ubuf, buf_size)) {
- ret = -EFAULT;
- goto done;
- }
-
- ret = sscanf(buf, "%d", &txbufcfg);
-
- ret = mwifiex_set_drv_txbuf_cfg(priv, txbufcfg);
-
- if (!ret)
- ret = count;
- else
- ret = -EINVAL;
-done:
- free_page(addr);
- return ret;
-}
-
-/*
- * Proc txbufcfg file read handler.
- *
- * This function is called when the 'txbufcfg' file is opened for reading
- *
- * This function can be used to get the Tx buffer size.
- */
-static ssize_t
-mwifiex_txbufcfg_read(struct file *file, char __user *ubuf,
- size_t count, loff_t *ppos)
-{
- struct mwifiex_private *priv =
- (struct mwifiex_private *) file->private_data;
- unsigned long addr = get_zeroed_page(GFP_KERNEL);
- char *buf = (char *) addr;
- int pos = 0, ret = 0;
- int txbufcfg;
-
- if (!buf)
- return -ENOMEM;
-
- mwifiex_get_drv_txbuf_cfg(priv, &txbufcfg);
-
- pos += snprintf(buf, PAGE_SIZE, "%d\n", txbufcfg);
-
- ret = simple_read_from_buffer(ubuf, count, ppos, buf, pos);
-
- free_page(addr);
- return ret;
-}
#define MWIFIEX_DFS_ADD_FILE(name) do { \
if (!debugfs_create_file(#name, 0644, priv->dfs_dev_dir, \
@@ -1107,7 +1037,6 @@ MWIFIEX_DFS_FILE_OPS(qoscfg);
MWIFIEX_DFS_FILE_READ_OPS(getlog);
MWIFIEX_DFS_FILE_OPS(regrdwr);
MWIFIEX_DFS_FILE_OPS(rdeeprom);
-MWIFIEX_DFS_FILE_OPS(txbufcfg);
/*
* This function creates the debug FS directory structure and the files.
@@ -1133,7 +1062,6 @@ mwifiex_dev_debugfs_init(struct mwifiex_private *priv)
MWIFIEX_DFS_ADD_FILE(getlog);
MWIFIEX_DFS_ADD_FILE(regrdwr);
MWIFIEX_DFS_ADD_FILE(rdeeprom);
- MWIFIEX_DFS_ADD_FILE(txbufcfg);
return;
}
diff --git a/drivers/net/wireless/mwifiex/main.h b/drivers/net/wireless/mwifiex/main.h
index f13ae51..d2848c8 100644
--- a/drivers/net/wireless/mwifiex/main.h
+++ b/drivers/net/wireless/mwifiex/main.h
@@ -1047,12 +1047,6 @@ int mwifiex_get_tx_rate_cfg(struct mwifiex_private *priv, int *tx_rate_index);
int mwifiex_set_hs_cfg(struct mwifiex_private *priv, int cond, int gap,
int data_length, int invoke_hostcmd);
-int mwifiex_set_drv_txbuf_cfg(struct mwifiex_private *priv,
- int max_tx_buf_size);
-
-int mwifiex_get_drv_txbuf_cfg(struct mwifiex_private *priv,
- int *max_tx_buf_size);
-
int mwifiex_11n_amsdu_aggr_ctrl(struct mwifiex_private *priv, int amsdu_enable);
int mwifiex_11n_get_amsdu_params(struct mwifiex_private *priv,
diff --git a/drivers/net/wireless/mwifiex/sta_ioctl.c b/drivers/net/wireless/mwifiex/sta_ioctl.c
index 0fd24cb..bfe2fd4 100644
--- a/drivers/net/wireless/mwifiex/sta_ioctl.c
+++ b/drivers/net/wireless/mwifiex/sta_ioctl.c
@@ -1997,40 +1997,6 @@ mwifiex_11n_amsdu_aggr_ctrl(struct mwifiex_private *priv, int amsdu_enable)
}
/*
- * Sends IOCTL request to set driver Tx buffer size.
- *
- * This function allocates the IOCTL request buffer, fills it
- * with requisite parameters and calls the IOCTL handler.
- */
-int
-mwifiex_set_drv_txbuf_cfg(struct mwifiex_private *priv, int max_tx_buf_size)
-{
- int status = 0;
-
- if ((max_tx_buf_size == MWIFIEX_TX_DATA_BUF_SIZE_2K) ||
- (max_tx_buf_size == MWIFIEX_TX_DATA_BUF_SIZE_4K) ||
- (max_tx_buf_size == MWIFIEX_TX_DATA_BUF_SIZE_8K))
- priv->adapter->max_tx_buf_size = (u16) max_tx_buf_size;
- else
- status = -1;
-
- return status;
-}
-
-/*
- * Sends IOCTL request to get driver Tx buffer size.
- *
- * This function allocates the IOCTL request buffer, fills it
- * with requisite parameters and calls the IOCTL handler.
- */
-int
-mwifiex_get_drv_txbuf_cfg(struct mwifiex_private *priv, int *max_tx_buf_size)
-{
- *max_tx_buf_size = (u32) priv->adapter->max_tx_buf_size;
- return 0;
-}
-
-/*
* Sends IOCTL request to set sleep period.
*
* This function allocates the IOCTL request buffer, fills it
--
1.7.0.2
^ permalink raw reply related [flat|nested] 16+ messages in thread* [PATCH 11/11] mwifiex: remove amsduaggrctrl command from debugfs
2011-03-17 0:09 [PATCH 00/11] remove configuration APIs from debugfs (part 2) Bing Zhao
` (9 preceding siblings ...)
2011-03-17 0:09 ` [PATCH 10/11] mwifiex: remove txbufcfg command from debugfs Bing Zhao
@ 2011-03-17 0:09 ` Bing Zhao
2011-03-17 9:32 ` [PATCH 00/11] remove configuration APIs from debugfs (part 2) Johannes Berg
11 siblings, 0 replies; 16+ messages in thread
From: Bing Zhao @ 2011-03-17 0:09 UTC (permalink / raw)
To: linux-wireless
Cc: John W. Linville, Johannes Berg, Amitkumar Karwar, Kiran Divekar,
Yogesh Powar, Marc Yang, Frank Huang, Bing Zhao
From: Yogesh Ashok Powar <yogeshp@marvell.com>
Removed amsduaggrctrl command from debugfs and its
corresponding IOCTL helper commands.
Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
---
drivers/net/wireless/mwifiex/11n.c | 23 --------
drivers/net/wireless/mwifiex/11n.h | 4 --
drivers/net/wireless/mwifiex/README | 76 ---------------------------
drivers/net/wireless/mwifiex/debugfs.c | 82 ------------------------------
drivers/net/wireless/mwifiex/main.h | 5 --
drivers/net/wireless/mwifiex/sta_ioctl.c | 71 --------------------------
6 files changed, 0 insertions(+), 261 deletions(-)
diff --git a/drivers/net/wireless/mwifiex/11n.c b/drivers/net/wireless/mwifiex/11n.c
index 68de8e7..0e04a21 100644
--- a/drivers/net/wireless/mwifiex/11n.c
+++ b/drivers/net/wireless/mwifiex/11n.c
@@ -26,29 +26,6 @@
#include "11n.h"
/*
- * IOCTL request handler to set/get AMSDU aggregation control.
- *
- * This function prepares the correct firmware command and
- * issues it.
- */
-int mwifiex_11n_ioctl_amsdu_aggr_ctrl(struct mwifiex_adapter *adapter,
- struct mwifiex_wait_queue *wait_queue,
- struct mwifiex_ds_11n_amsdu_aggr_ctrl
- *amsdu_aggr_ctrl, u16 action)
-{
- int ret = 0;
- struct mwifiex_private *priv = adapter->priv[wait_queue->bss_index];
-
- /* Send request to firmware */
- ret = mwifiex_prepare_cmd(priv, HostCmd_CMD_AMSDU_AGGR_CTRL, action, 0,
- wait_queue, amsdu_aggr_ctrl);
- if (!ret)
- ret = -EINPROGRESS;
-
- return ret;
-}
-
-/*
* Fills HT capability information field, AMPDU Parameters field, HT extended
* capability field, and supported MCS set fields.
*
diff --git a/drivers/net/wireless/mwifiex/11n.h b/drivers/net/wireless/mwifiex/11n.h
index d9f03bb..769a27f 100644
--- a/drivers/net/wireless/mwifiex/11n.h
+++ b/drivers/net/wireless/mwifiex/11n.h
@@ -50,10 +50,6 @@ void mwifiex_fill_cap_info(struct mwifiex_private *,
struct mwifiex_ie_types_htcap *);
int mwifiex_set_get_11n_htcap_cfg(struct mwifiex_private *priv,
u16 action, int *htcap_cfg);
-int mwifiex_11n_ioctl_amsdu_aggr_ctrl(struct mwifiex_adapter *adapter,
- struct mwifiex_wait_queue *wait_queue,
- struct mwifiex_ds_11n_amsdu_aggr_ctrl
- *amsdu_aggr_ctrl, u16 action);
void mwifiex_11n_delete_tx_ba_stream_tbl_entry(struct mwifiex_private *priv,
struct mwifiex_tx_ba_stream_tbl
*tx_tbl);
diff --git a/drivers/net/wireless/mwifiex/README b/drivers/net/wireless/mwifiex/README
index 01a17d4..29bba35 100644
--- a/drivers/net/wireless/mwifiex/README
+++ b/drivers/net/wireless/mwifiex/README
@@ -163,82 +163,6 @@ info
3) FOR DRIVER CONFIGURATION
-amsduaggrctrl
- This command could be used to enable/disable a feature where firmware gives feedback to driver
- regarding the optimal AMSDU buffer size to use with the current rate. Firmware will use the
- current rate to decide the buffer size we could transmit. The max buffer size will still be
- limited by buffer size provided in txbufcfg. (i.e. if the txbufcfg is 4K, then we could only transmit
- 4K/2K AMSDU packets, if the txbufcfg is 8K then we could transmit 8k/4k/2k based on current rate)
-
- Usage:
- echo "<n>" > amsduaggrctrl
- cat amsduaggrctrl
-
- where <n> is 0/1 (for disable/enable)
-
- If enabled AMSDU buffer size at various rates will be as follows
-
- 1. Legacy B/G rate.
- No AMSDU aggregation.
-
- 2. BW20 HT Rate:
- When TX rate goes down,
- MCS 7, 6, 5, 4:
- a 8K aggregation size (if TX buffer size is 8K)
- b 4K aggregation size (if TX buffer size is 4K)
- c 2K aggregation size (if TX buffer size is 2K)
-
- MCS 3, 2:
- a 4K aggregation size (if TX buffer size is 8K/4K)
- b 2K aggregation size (if TX buffer size is 2K)
-
- MCS 1, 0:
- a No aggregation
-
- When TX rate goes up,
- MCS 7, 6, 5:
- a 8K aggregation size (if TX buffer size is 8K)
- b 4K aggregation size (if TX buffer size is 4K)
- c 2K aggregation size (if TX buffer size is 2K)
-
- MCS 4, 3:
- a 4K aggregation size (if TX buffer size is 8K/4K)
- b 2K aggregation size (if TX buffer size is 2K)
-
- MCS 2, 1, 0:
- a No aggregation
-
- 3. BW40 HT Rate:
- When TX rate goes down,
- MCS 7, 6, 5, 4, 3, 2, 1:
- a 8K aggregation size (if TX buffer size is 8K)
- b 4K aggregation size (if TX buffer size is 4K)
- c 2K aggregation size (if TX buffer size is 2K)
-
- MCS 0:
- a No aggregation
-
- When TX rate goes up,
- MCS 7, 6, 5, 4, 3:
- a 8K aggregation size (if TX buffer size is 8K)
- b 4K aggregation size (if TX buffer size is 4K)
- c 2K aggregation size (if TX buffer size is 2K)
-
- MCS 2, 1, 0:
- a No aggregation
-
-
- eg:
- echo "1" > amsduaggrctrl - Enable this feature
- echo "0" > amsduaggrctrl - Disable this feature
- cat amsduaggrctrl (This will get the enable/disable flag
- and the current AMSDU buffer size). The AMSDU buffer size returned is only
- valid after association as before association there is no rate info.
-
- Note:- This command to enable/disable could be given anytime (before/after
- association). This feature is enabled by default by the driver during
- initialization.
-
hscfg
This command is used to configure the host sleep parameters.
diff --git a/drivers/net/wireless/mwifiex/debugfs.c b/drivers/net/wireless/mwifiex/debugfs.c
index 37576b4..72f8b3b 100644
--- a/drivers/net/wireless/mwifiex/debugfs.c
+++ b/drivers/net/wireless/mwifiex/debugfs.c
@@ -492,86 +492,6 @@ free_and_exit:
}
/*
- * Proc amsduaggrctrl file write handler.
- *
- * This function is called when the 'amsduaggrctr' file is opened for writing
- *
- * This function can be used to set the AMSDU aggregation control parameters.
- */
-static ssize_t
-mwifiex_amsduaggrctrl_write(struct file *file, const char __user *ubuf,
- size_t count, loff_t *ppos)
-{
- struct mwifiex_private *priv =
- (struct mwifiex_private *) file->private_data;
- unsigned long addr = get_zeroed_page(GFP_KERNEL);
- char *buf = (char *) addr;
- size_t buf_size = min(count, (size_t) (PAGE_SIZE - 1));
- int amsdu_enable = 0;
- int ret = 0;
-
- if (!buf)
- return -ENOMEM;
-
- if (copy_from_user(buf, ubuf, buf_size)) {
- ret = -EFAULT;
- goto done;
- }
-
- ret = sscanf(buf, "%d", &amsdu_enable);
-
- if (amsdu_enable != 0 && amsdu_enable != 1) {
- ret = -EINVAL;
- goto done;
- }
-
- ret = mwifiex_11n_amsdu_aggr_ctrl(priv, amsdu_enable);
-
-
- if (!ret)
- ret = count;
- else
- ret = -EINVAL;
-done:
- free_page(addr);
- return ret;
-}
-
-/*
- * Proc amsduaggrctrl file read handler.
- *
- * This function is called when the 'amsduaggrctr' file is opened for reading
- *
- * This function can be used to get the AMSDU aggregation control parameters.
- */
-static ssize_t
-mwifiex_amsduaggrctrl_read(struct file *file, char __user *ubuf,
- size_t count, loff_t *ppos)
-{
- struct mwifiex_private *priv =
- (struct mwifiex_private *) file->private_data;
- unsigned long addr = get_zeroed_page(GFP_KERNEL);
- char *buf = (char *) addr;
- int pos = 0, ret = 0;
- int amsdu_enable, curr_buf_size;
-
- if (!buf)
- return -ENOMEM;
-
- ret = mwifiex_11n_get_amsdu_params(priv, &amsdu_enable, &curr_buf_size);
- if (ret)
- goto done;
-
- pos += snprintf(buf, PAGE_SIZE, "%d %d\n", amsdu_enable, curr_buf_size);
-
- ret = simple_read_from_buffer(ubuf, count, ppos, buf, pos);
-
-done:
- free_page(addr);
- return ret;
-}
-
-/*
* Proc hscfg file write handler.
*
* This function is called when the 'hscfg' file is opened for writing
@@ -1031,7 +951,6 @@ static const struct file_operations mwifiex_dfs_##name##_fops = { \
MWIFIEX_DFS_FILE_READ_OPS(info);
MWIFIEX_DFS_FILE_READ_OPS(debug);
MWIFIEX_DFS_FILE_OPS(hscfg);
-MWIFIEX_DFS_FILE_OPS(amsduaggrctrl);
MWIFIEX_DFS_FILE_OPS(sleeppd);
MWIFIEX_DFS_FILE_OPS(qoscfg);
MWIFIEX_DFS_FILE_READ_OPS(getlog);
@@ -1056,7 +975,6 @@ mwifiex_dev_debugfs_init(struct mwifiex_private *priv)
MWIFIEX_DFS_ADD_FILE(info);
MWIFIEX_DFS_ADD_FILE(debug);
MWIFIEX_DFS_ADD_FILE(hscfg);
- MWIFIEX_DFS_ADD_FILE(amsduaggrctrl);
MWIFIEX_DFS_ADD_FILE(sleeppd);
MWIFIEX_DFS_ADD_FILE(qoscfg);
MWIFIEX_DFS_ADD_FILE(getlog);
diff --git a/drivers/net/wireless/mwifiex/main.h b/drivers/net/wireless/mwifiex/main.h
index d2848c8..aee19a9 100644
--- a/drivers/net/wireless/mwifiex/main.h
+++ b/drivers/net/wireless/mwifiex/main.h
@@ -1047,11 +1047,6 @@ int mwifiex_get_tx_rate_cfg(struct mwifiex_private *priv, int *tx_rate_index);
int mwifiex_set_hs_cfg(struct mwifiex_private *priv, int cond, int gap,
int data_length, int invoke_hostcmd);
-int mwifiex_11n_amsdu_aggr_ctrl(struct mwifiex_private *priv, int amsdu_enable);
-
-int mwifiex_11n_get_amsdu_params(struct mwifiex_private *priv,
- int *amsdu_enable, int *curr_buf_size);
-
int mwifiex_drv_set_power(struct mwifiex_private *priv, bool power_on);
int mwifiex_get_sleep_pd(struct mwifiex_private *priv, int *sleeppd);
diff --git a/drivers/net/wireless/mwifiex/sta_ioctl.c b/drivers/net/wireless/mwifiex/sta_ioctl.c
index bfe2fd4..f446a5a 100644
--- a/drivers/net/wireless/mwifiex/sta_ioctl.c
+++ b/drivers/net/wireless/mwifiex/sta_ioctl.c
@@ -1926,77 +1926,6 @@ mwifiex_set_hs_cfg(struct mwifiex_private *priv, int cond, int gap,
}
/*
- * Sends IOCTL request to get AMSDU parameters.
- *
- * This function allocates the IOCTL request buffer, fills it
- * with requisite parameters and calls the IOCTL handler.
- */
-int
-mwifiex_11n_get_amsdu_params(struct mwifiex_private *priv, int *amsdu_enable,
- int *curr_buf_size)
-{
- struct mwifiex_wait_queue *wait = NULL;
- struct mwifiex_ds_11n_amsdu_aggr_ctrl amsdu_aggr_ctrl;
- int status = 0;
- int ret = 0;
-
- wait = mwifiex_alloc_fill_wait_queue(priv, MWIFIEX_IOCTL_WAIT);
- if (!wait)
- return -ENOMEM;
-
- status = mwifiex_11n_ioctl_amsdu_aggr_ctrl(priv->adapter, wait,
- &amsdu_aggr_ctrl,
- HostCmd_ACT_GEN_GET);
-
- ret = mwifiex_request_ioctl(priv, wait, status, MWIFIEX_IOCTL_WAIT);
-
- if (!ret) {
- *amsdu_enable = amsdu_aggr_ctrl.enable;
- *curr_buf_size = amsdu_aggr_ctrl.curr_buf_size;
- }
-
- kfree(wait);
- return ret;
-}
-
-/*
- * Sends IOCTL request to set enable/disable AMSDU aggregation feature.
- *
- * This function allocates the IOCTL request buffer, fills it
- * with requisite parameters and calls the IOCTL handler.
- */
-int
-mwifiex_11n_amsdu_aggr_ctrl(struct mwifiex_private *priv, int amsdu_enable)
-{
- struct mwifiex_wait_queue *wait = NULL;
- struct mwifiex_ds_11n_amsdu_aggr_ctrl amsdu_aggr_ctrl;
- int status = 0;
- int ret = 0;
-
- wait = mwifiex_alloc_fill_wait_queue(priv, MWIFIEX_IOCTL_WAIT);
- if (!wait)
- return -ENOMEM;
-
- amsdu_aggr_ctrl.enable = amsdu_enable;
-
- status = mwifiex_11n_ioctl_amsdu_aggr_ctrl(priv->adapter, wait,
- &amsdu_aggr_ctrl,
- HostCmd_ACT_GEN_SET);
-
- ret = mwifiex_request_ioctl(priv, wait, status, MWIFIEX_IOCTL_WAIT);
-
- if (ret)
- dev_err(priv->adapter->dev,
- "failed enabling amsdu aggr feature\n");
- else
- dev_dbg(priv->adapter->dev,
- "info: Successfully enabled amsdu aggregation feature\n");
-
- kfree(wait);
- return ret;
-}
-
-/*
* Sends IOCTL request to set sleep period.
*
* This function allocates the IOCTL request buffer, fills it
--
1.7.0.2
^ permalink raw reply related [flat|nested] 16+ messages in thread* Re: [PATCH 00/11] remove configuration APIs from debugfs (part 2)
2011-03-17 0:09 [PATCH 00/11] remove configuration APIs from debugfs (part 2) Bing Zhao
` (10 preceding siblings ...)
2011-03-17 0:09 ` [PATCH 11/11] mwifiex: remove amsduaggrctrl " Bing Zhao
@ 2011-03-17 9:32 ` Johannes Berg
2011-03-17 17:53 ` Bing Zhao
11 siblings, 1 reply; 16+ messages in thread
From: Johannes Berg @ 2011-03-17 9:32 UTC (permalink / raw)
To: Bing Zhao
Cc: linux-wireless, John W. Linville, Amitkumar Karwar, Kiran Divekar,
Yogesh Powar, Marc Yang, Frank Huang
On Wed, 2011-03-16 at 17:09 -0700, Bing Zhao wrote:
> This series removes some of the configuration APIs plus some WEP code
> cleanups
I obviously have no issues with this, but you might want to keep the git
history for afterwards for when I suppose you'll start working on actual
APIs for these features?
johannes
^ permalink raw reply [flat|nested] 16+ messages in thread* RE: [PATCH 00/11] remove configuration APIs from debugfs (part 2)
2011-03-17 9:32 ` [PATCH 00/11] remove configuration APIs from debugfs (part 2) Johannes Berg
@ 2011-03-17 17:53 ` Bing Zhao
2011-03-17 18:00 ` Johannes Berg
0 siblings, 1 reply; 16+ messages in thread
From: Bing Zhao @ 2011-03-17 17:53 UTC (permalink / raw)
To: Johannes Berg
Cc: linux-wireless@vger.kernel.org, John W. Linville,
Amitkumar Karwar, Kiran Divekar, Yogesh Powar, Marc Yang,
Frank Huang
SGkgSm9oYW5uZXMsDQoNCj4gLS0tLS1PcmlnaW5hbCBNZXNzYWdlLS0tLS0NCj4gRnJvbTogbGlu
dXgtd2lyZWxlc3Mtb3duZXJAdmdlci5rZXJuZWwub3JnIFttYWlsdG86bGludXgtd2lyZWxlc3Mt
b3duZXJAdmdlci5rZXJuZWwub3JnXSBPbiBCZWhhbGYgT2YNCj4gSm9oYW5uZXMgQmVyZw0KPiBT
ZW50OiBUaHVyc2RheSwgTWFyY2ggMTcsIDIwMTEgMjozMiBBTQ0KPiBUbzogQmluZyBaaGFvDQo+
IENjOiBsaW51eC13aXJlbGVzc0B2Z2VyLmtlcm5lbC5vcmc7IEpvaG4gVy4gTGludmlsbGU7IEFt
aXRrdW1hciBLYXJ3YXI7IEtpcmFuIERpdmVrYXI7IFlvZ2VzaCBQb3dhcjsNCj4gTWFyYyBZYW5n
OyBGcmFuayBIdWFuZw0KPiBTdWJqZWN0OiBSZTogW1BBVENIIDAwLzExXSByZW1vdmUgY29uZmln
dXJhdGlvbiBBUElzIGZyb20gZGVidWdmcyAocGFydCAyKQ0KPiANCj4gT24gV2VkLCAyMDExLTAz
LTE2IGF0IDE3OjA5IC0wNzAwLCBCaW5nIFpoYW8gd3JvdGU6DQo+ID4gVGhpcyBzZXJpZXMgcmVt
b3ZlcyBzb21lIG9mIHRoZSBjb25maWd1cmF0aW9uIEFQSXMgcGx1cyBzb21lIFdFUCBjb2RlDQo+
ID4gY2xlYW51cHMNCj4gDQo+IEkgb2J2aW91c2x5IGhhdmUgbm8gaXNzdWVzIHdpdGggdGhpcywg
YnV0IHlvdSBtaWdodCB3YW50IHRvIGtlZXAgdGhlIGdpdA0KPiBoaXN0b3J5IGZvciBhZnRlcndh
cmRzIGZvciB3aGVuIEkgc3VwcG9zZSB5b3UnbGwgc3RhcnQgd29ya2luZyBvbiBhY3R1YWwNCj4g
QVBJcyBmb3IgdGhlc2UgZmVhdHVyZXM/DQoNClRvIGtlZXAgdGhlIGdpdCBoaXN0b3J5LCBJIGNh
biBzZW5kIGEgJ3B1bGwgcmVxdWVzdCcgdG8gSm9obiBhZnRlciB3ZSBjbGVhbiB1cCB0aGUgZGVi
dWdmcyBBUElzIGFuZCBmaXggdGhlIHNldF9kZWZhdWx0X2tleSgpIGZ1bmN0aW9uLg0KDQpTaG91
bGQgeW91IGhhdmUgYW55IG1vcmUgY29tbWVudHMsIEknbGwgYmUgbW9yZSB0aGFuIGhhcHB5IHRv
IG1ha2UgdGhlIGNoYW5nZXMuDQoNClRoYW5rcywNCg0KQmluZw0KDQo=
^ permalink raw reply [flat|nested] 16+ messages in thread
* RE: [PATCH 00/11] remove configuration APIs from debugfs (part 2)
2011-03-17 17:53 ` Bing Zhao
@ 2011-03-17 18:00 ` Johannes Berg
2011-03-17 18:07 ` Bing Zhao
0 siblings, 1 reply; 16+ messages in thread
From: Johannes Berg @ 2011-03-17 18:00 UTC (permalink / raw)
To: Bing Zhao
Cc: linux-wireless@vger.kernel.org, John W. Linville,
Amitkumar Karwar, Kiran Divekar, Yogesh Powar, Marc Yang,
Frank Huang
Hi,
> > I obviously have no issues with this, but you might want to keep the git
> > history for afterwards for when I suppose you'll start working on actual
> > APIs for these features?
>
> To keep the git history, I can send a 'pull request' to John after we
> clean up the debugfs APIs and fix the set_default_key() function.
I don't think we need to or should keep the history upstream, it'd be
nicer as a smaller patch IMHO, but I'll let John make that call, just
saying that you shouldn't throw it away since I hope you'll work on
having these features exposed "properly" :-)
johannes
^ permalink raw reply [flat|nested] 16+ messages in thread
* RE: [PATCH 00/11] remove configuration APIs from debugfs (part 2)
2011-03-17 18:00 ` Johannes Berg
@ 2011-03-17 18:07 ` Bing Zhao
0 siblings, 0 replies; 16+ messages in thread
From: Bing Zhao @ 2011-03-17 18:07 UTC (permalink / raw)
To: Johannes Berg
Cc: linux-wireless@vger.kernel.org, John W. Linville,
Amitkumar Karwar, Kiran Divekar, Yogesh Powar, Marc Yang,
Frank Huang
SGkgSm9oYW5uZXMsDQoNCj4gLS0tLS1PcmlnaW5hbCBNZXNzYWdlLS0tLS0NCj4gRnJvbTogSm9o
YW5uZXMgQmVyZyBbbWFpbHRvOmpvaGFubmVzQHNpcHNvbHV0aW9ucy5uZXRdDQo+IFNlbnQ6IFRo
dXJzZGF5LCBNYXJjaCAxNywgMjAxMSAxMTowMCBBTQ0KPiBUbzogQmluZyBaaGFvDQo+IENjOiBs
aW51eC13aXJlbGVzc0B2Z2VyLmtlcm5lbC5vcmc7IEpvaG4gVy4gTGludmlsbGU7IEFtaXRrdW1h
ciBLYXJ3YXI7IEtpcmFuIERpdmVrYXI7IFlvZ2VzaCBQb3dhcjsNCj4gTWFyYyBZYW5nOyBGcmFu
ayBIdWFuZw0KPiBTdWJqZWN0OiBSRTogW1BBVENIIDAwLzExXSByZW1vdmUgY29uZmlndXJhdGlv
biBBUElzIGZyb20gZGVidWdmcyAocGFydCAyKQ0KPiANCj4gSGksDQo+IA0KPiA+ID4gSSBvYnZp
b3VzbHkgaGF2ZSBubyBpc3N1ZXMgd2l0aCB0aGlzLCBidXQgeW91IG1pZ2h0IHdhbnQgdG8ga2Vl
cCB0aGUgZ2l0DQo+ID4gPiBoaXN0b3J5IGZvciBhZnRlcndhcmRzIGZvciB3aGVuIEkgc3VwcG9z
ZSB5b3UnbGwgc3RhcnQgd29ya2luZyBvbiBhY3R1YWwNCj4gPiA+IEFQSXMgZm9yIHRoZXNlIGZl
YXR1cmVzPw0KPiA+DQo+ID4gVG8ga2VlcCB0aGUgZ2l0IGhpc3RvcnksIEkgY2FuIHNlbmQgYSAn
cHVsbCByZXF1ZXN0JyB0byBKb2huIGFmdGVyIHdlDQo+ID4gY2xlYW4gdXAgdGhlIGRlYnVnZnMg
QVBJcyBhbmQgZml4IHRoZSBzZXRfZGVmYXVsdF9rZXkoKSBmdW5jdGlvbi4NCj4gDQo+IEkgZG9u
J3QgdGhpbmsgd2UgbmVlZCB0byBvciBzaG91bGQga2VlcCB0aGUgaGlzdG9yeSB1cHN0cmVhbSwg
aXQnZCBiZQ0KPiBuaWNlciBhcyBhIHNtYWxsZXIgcGF0Y2ggSU1ITywgYnV0IEknbGwgbGV0IEpv
aG4gbWFrZSB0aGF0IGNhbGwsIGp1c3QNCj4gc2F5aW5nIHRoYXQgeW91IHNob3VsZG4ndCB0aHJv
dyBpdCBhd2F5IHNpbmNlIEkgaG9wZSB5b3UnbGwgd29yayBvbg0KPiBoYXZpbmcgdGhlc2UgZmVh
dHVyZXMgZXhwb3NlZCAicHJvcGVybHkiIDotKQ0KDQpJIHNlZS4gSSB3aWxsIGtlZXAgdGhlIGhp
c3Rvcnkgb24gbXkgb3duIHJlcG8gYW5kIHN1Ym1pdCBhIHNpbmdsZSBwYXRjaCB0aGVuLg0KDQpU
aGFua3MsDQoNCkJpbmcNCg0KPiANCj4gam9oYW5uZXMNCj4gDQoNCg==
^ permalink raw reply [flat|nested] 16+ messages in thread