Commit 636c4598 authored by Yogesh Ashok Powar's avatar Yogesh Ashok Powar Committed by John W. Linville

mwifiex: remove redundant local variables and comments

Remove some local variables (mainly function return values)
that are used only once. Also, one dummy function and some
wordy comments are removed.
Signed-off-by: default avatarYogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: default avatarKiran Divekar <dkiran@marvell.com>
Signed-off-by: default avatarBing Zhao <bzhao@marvell.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 7762bb02
...@@ -26,19 +26,6 @@ ...@@ -26,19 +26,6 @@
#include "11n.h" #include "11n.h"
#include "11n_rxreorder.h" #include "11n_rxreorder.h"
/*
* This function processes a received packet and forwards
* it to the kernel/upper layer.
*/
static int mwifiex_11n_dispatch_pkt(struct mwifiex_private *priv, void *payload)
{
int ret = 0;
struct mwifiex_adapter *adapter = priv->adapter;
ret = mwifiex_process_rx_packet(adapter, (struct sk_buff *) payload);
return ret;
}
/* /*
* This function dispatches all packets in the Rx reorder table. * This function dispatches all packets in the Rx reorder table.
* *
...@@ -51,7 +38,7 @@ mwifiex_11n_dispatch_pkt_until_start_win(struct mwifiex_private *priv, ...@@ -51,7 +38,7 @@ mwifiex_11n_dispatch_pkt_until_start_win(struct mwifiex_private *priv,
struct mwifiex_rx_reorder_tbl struct mwifiex_rx_reorder_tbl
*rx_reor_tbl_ptr, int start_win) *rx_reor_tbl_ptr, int start_win)
{ {
int no_pkt_to_send, i, xchg; int no_pkt_to_send, i;
void *rx_tmp_ptr = NULL; void *rx_tmp_ptr = NULL;
unsigned long flags; unsigned long flags;
...@@ -68,7 +55,7 @@ mwifiex_11n_dispatch_pkt_until_start_win(struct mwifiex_private *priv, ...@@ -68,7 +55,7 @@ mwifiex_11n_dispatch_pkt_until_start_win(struct mwifiex_private *priv,
} }
spin_unlock_irqrestore(&priv->rx_pkt_lock, flags); spin_unlock_irqrestore(&priv->rx_pkt_lock, flags);
if (rx_tmp_ptr) if (rx_tmp_ptr)
mwifiex_11n_dispatch_pkt(priv, rx_tmp_ptr); mwifiex_process_rx_packet(priv->adapter, rx_tmp_ptr);
} }
spin_lock_irqsave(&priv->rx_pkt_lock, flags); spin_lock_irqsave(&priv->rx_pkt_lock, flags);
...@@ -76,8 +63,7 @@ mwifiex_11n_dispatch_pkt_until_start_win(struct mwifiex_private *priv, ...@@ -76,8 +63,7 @@ mwifiex_11n_dispatch_pkt_until_start_win(struct mwifiex_private *priv,
* We don't have a circular buffer, hence use rotation to simulate * We don't have a circular buffer, hence use rotation to simulate
* circular buffer * circular buffer
*/ */
xchg = rx_reor_tbl_ptr->win_size - no_pkt_to_send; for (i = 0; i < rx_reor_tbl_ptr->win_size - no_pkt_to_send; ++i) {
for (i = 0; i < xchg; ++i) {
rx_reor_tbl_ptr->rx_reorder_ptr[i] = rx_reor_tbl_ptr->rx_reorder_ptr[i] =
rx_reor_tbl_ptr->rx_reorder_ptr[no_pkt_to_send + i]; rx_reor_tbl_ptr->rx_reorder_ptr[no_pkt_to_send + i];
rx_reor_tbl_ptr->rx_reorder_ptr[no_pkt_to_send + i] = NULL; rx_reor_tbl_ptr->rx_reorder_ptr[no_pkt_to_send + i] = NULL;
...@@ -114,7 +100,7 @@ mwifiex_11n_scan_and_dispatch(struct mwifiex_private *priv, ...@@ -114,7 +100,7 @@ mwifiex_11n_scan_and_dispatch(struct mwifiex_private *priv,
rx_tmp_ptr = rx_reor_tbl_ptr->rx_reorder_ptr[i]; rx_tmp_ptr = rx_reor_tbl_ptr->rx_reorder_ptr[i];
rx_reor_tbl_ptr->rx_reorder_ptr[i] = NULL; rx_reor_tbl_ptr->rx_reorder_ptr[i] = NULL;
spin_unlock_irqrestore(&priv->rx_pkt_lock, flags); spin_unlock_irqrestore(&priv->rx_pkt_lock, flags);
mwifiex_11n_dispatch_pkt(priv, rx_tmp_ptr); mwifiex_process_rx_packet(priv->adapter, rx_tmp_ptr);
} }
spin_lock_irqsave(&priv->rx_pkt_lock, flags); spin_lock_irqsave(&priv->rx_pkt_lock, flags);
...@@ -429,7 +415,7 @@ int mwifiex_11n_rx_reorder_pkt(struct mwifiex_private *priv, ...@@ -429,7 +415,7 @@ int mwifiex_11n_rx_reorder_pkt(struct mwifiex_private *priv,
tid, ta); tid, ta);
if (!rx_reor_tbl_ptr) { if (!rx_reor_tbl_ptr) {
if (pkt_type != PKT_TYPE_BAR) if (pkt_type != PKT_TYPE_BAR)
mwifiex_11n_dispatch_pkt(priv, payload); mwifiex_process_rx_packet(priv->adapter, payload);
return 0; return 0;
} }
start_win = rx_reor_tbl_ptr->start_win; start_win = rx_reor_tbl_ptr->start_win;
......
This diff is collapsed.
...@@ -145,16 +145,12 @@ u8 mwifiex_data_rate_to_index(u32 rate) ...@@ -145,16 +145,12 @@ u8 mwifiex_data_rate_to_index(u32 rate)
*/ */
u32 mwifiex_get_active_data_rates(struct mwifiex_private *priv, u8 *rates) u32 mwifiex_get_active_data_rates(struct mwifiex_private *priv, u8 *rates)
{ {
u32 k;
if (!priv->media_connected) if (!priv->media_connected)
k = mwifiex_get_supported_rates(priv, rates); return mwifiex_get_supported_rates(priv, rates);
else else
k = mwifiex_copy_rates(rates, 0, return mwifiex_copy_rates(rates, 0,
priv->curr_bss_params.data_rates, priv->curr_bss_params.data_rates,
priv->curr_bss_params.num_of_rates); priv->curr_bss_params.num_of_rates);
return k;
} }
/* /*
......
...@@ -71,7 +71,6 @@ static int mwifiex_add_bss_prio_tbl(struct mwifiex_private *priv) ...@@ -71,7 +71,6 @@ static int mwifiex_add_bss_prio_tbl(struct mwifiex_private *priv)
static int mwifiex_init_priv(struct mwifiex_private *priv) static int mwifiex_init_priv(struct mwifiex_private *priv)
{ {
u32 i; u32 i;
int ret = 0;
priv->media_connected = false; priv->media_connected = false;
memset(priv->curr_addr, 0xff, ETH_ALEN); memset(priv->curr_addr, 0xff, ETH_ALEN);
...@@ -139,9 +138,7 @@ static int mwifiex_init_priv(struct mwifiex_private *priv) ...@@ -139,9 +138,7 @@ static int mwifiex_init_priv(struct mwifiex_private *priv)
priv->scan_block = false; priv->scan_block = false;
ret = mwifiex_add_bss_prio_tbl(priv); return mwifiex_add_bss_prio_tbl(priv);
return ret;
} }
/* /*
......
...@@ -749,7 +749,7 @@ int ...@@ -749,7 +749,7 @@ int
mwifiex_cmd_802_11_ad_hoc_start(struct mwifiex_private *priv, mwifiex_cmd_802_11_ad_hoc_start(struct mwifiex_private *priv,
struct host_cmd_ds_command *cmd, void *data_buf) struct host_cmd_ds_command *cmd, void *data_buf)
{ {
int ret = 0, rsn_ie_len = 0; int rsn_ie_len = 0;
struct mwifiex_adapter *adapter = priv->adapter; struct mwifiex_adapter *adapter = priv->adapter;
struct host_cmd_ds_802_11_ad_hoc_start *adhoc_start = struct host_cmd_ds_802_11_ad_hoc_start *adhoc_start =
&cmd->params.adhoc_start; &cmd->params.adhoc_start;
...@@ -879,11 +879,9 @@ mwifiex_cmd_802_11_ad_hoc_start(struct mwifiex_private *priv, ...@@ -879,11 +879,9 @@ mwifiex_cmd_802_11_ad_hoc_start(struct mwifiex_private *priv,
mwifiex_get_active_data_rates(priv, adhoc_start->DataRate); mwifiex_get_active_data_rates(priv, adhoc_start->DataRate);
if ((adapter->adhoc_start_band & BAND_G) && if ((adapter->adhoc_start_band & BAND_G) &&
(priv->curr_pkt_filter & HostCmd_ACT_MAC_ADHOC_G_PROTECTION_ON)) { (priv->curr_pkt_filter & HostCmd_ACT_MAC_ADHOC_G_PROTECTION_ON)) {
ret = mwifiex_send_cmd_async(priv, HostCmd_CMD_MAC_CONTROL, if (mwifiex_send_cmd_async(priv, HostCmd_CMD_MAC_CONTROL,
HostCmd_ACT_GEN_SET, 0, HostCmd_ACT_GEN_SET, 0,
&priv->curr_pkt_filter); &priv->curr_pkt_filter)) {
if (ret) {
dev_err(adapter->dev, dev_err(adapter->dev,
"ADHOC_S_CMD: G Protection config failed\n"); "ADHOC_S_CMD: G Protection config failed\n");
return -1; return -1;
...@@ -1039,7 +1037,7 @@ int ...@@ -1039,7 +1037,7 @@ int
mwifiex_cmd_802_11_ad_hoc_join(struct mwifiex_private *priv, mwifiex_cmd_802_11_ad_hoc_join(struct mwifiex_private *priv,
struct host_cmd_ds_command *cmd, void *data_buf) struct host_cmd_ds_command *cmd, void *data_buf)
{ {
int ret = 0, rsn_ie_len = 0; int rsn_ie_len = 0;
struct host_cmd_ds_802_11_ad_hoc_join *adhoc_join = struct host_cmd_ds_802_11_ad_hoc_join *adhoc_join =
&cmd->params.adhoc_join; &cmd->params.adhoc_join;
struct mwifiex_bssdescriptor *bss_desc = struct mwifiex_bssdescriptor *bss_desc =
...@@ -1060,10 +1058,9 @@ mwifiex_cmd_802_11_ad_hoc_join(struct mwifiex_private *priv, ...@@ -1060,10 +1058,9 @@ mwifiex_cmd_802_11_ad_hoc_join(struct mwifiex_private *priv,
priv-> priv->
curr_pkt_filter | HostCmd_ACT_MAC_ADHOC_G_PROTECTION_ON; curr_pkt_filter | HostCmd_ACT_MAC_ADHOC_G_PROTECTION_ON;
ret = mwifiex_send_cmd_async(priv, HostCmd_CMD_MAC_CONTROL, if (mwifiex_send_cmd_async(priv, HostCmd_CMD_MAC_CONTROL,
HostCmd_ACT_GEN_SET, 0, HostCmd_ACT_GEN_SET, 0,
&curr_pkt_filter); &curr_pkt_filter)) {
if (ret) {
dev_err(priv->adapter->dev, dev_err(priv->adapter->dev,
"ADHOC_J_CMD: G Protection config failed\n"); "ADHOC_J_CMD: G Protection config failed\n");
return -1; return -1;
...@@ -1174,7 +1171,7 @@ mwifiex_cmd_802_11_ad_hoc_join(struct mwifiex_private *priv, ...@@ -1174,7 +1171,7 @@ mwifiex_cmd_802_11_ad_hoc_join(struct mwifiex_private *priv,
adhoc_join->bss_descriptor.cap_info_bitmap = cpu_to_le16(tmp_cap); adhoc_join->bss_descriptor.cap_info_bitmap = cpu_to_le16(tmp_cap);
return ret; return 0;
} }
/* /*
...@@ -1192,15 +1189,13 @@ int mwifiex_ret_802_11_ad_hoc(struct mwifiex_private *priv, ...@@ -1192,15 +1189,13 @@ int mwifiex_ret_802_11_ad_hoc(struct mwifiex_private *priv,
struct mwifiex_adapter *adapter = priv->adapter; struct mwifiex_adapter *adapter = priv->adapter;
struct host_cmd_ds_802_11_ad_hoc_result *adhoc_result; struct host_cmd_ds_802_11_ad_hoc_result *adhoc_result;
struct mwifiex_bssdescriptor *bss_desc; struct mwifiex_bssdescriptor *bss_desc;
u16 command = le16_to_cpu(resp->command);
u16 result = le16_to_cpu(resp->result);
adhoc_result = &resp->params.adhoc_result; adhoc_result = &resp->params.adhoc_result;
bss_desc = priv->attempted_bss_desc; bss_desc = priv->attempted_bss_desc;
/* Join result code 0 --> SUCCESS */ /* Join result code 0 --> SUCCESS */
if (result) { if (le16_to_cpu(resp->result)) {
dev_err(priv->adapter->dev, "ADHOC_RESP: failed\n"); dev_err(priv->adapter->dev, "ADHOC_RESP: failed\n");
if (priv->media_connected) if (priv->media_connected)
mwifiex_reset_connect_state(priv); mwifiex_reset_connect_state(priv);
...@@ -1215,7 +1210,7 @@ int mwifiex_ret_802_11_ad_hoc(struct mwifiex_private *priv, ...@@ -1215,7 +1210,7 @@ int mwifiex_ret_802_11_ad_hoc(struct mwifiex_private *priv,
/* Send a Media Connected event, according to the Spec */ /* Send a Media Connected event, according to the Spec */
priv->media_connected = true; priv->media_connected = true;
if (command == HostCmd_CMD_802_11_AD_HOC_START) { if (le16_to_cpu(resp->command) == HostCmd_CMD_802_11_AD_HOC_START) {
dev_dbg(priv->adapter->dev, "info: ADHOC_S_RESP %s\n", dev_dbg(priv->adapter->dev, "info: ADHOC_S_RESP %s\n",
bss_desc->ssid.ssid); bss_desc->ssid.ssid);
...@@ -1278,7 +1273,6 @@ int mwifiex_ret_802_11_ad_hoc(struct mwifiex_private *priv, ...@@ -1278,7 +1273,6 @@ int mwifiex_ret_802_11_ad_hoc(struct mwifiex_private *priv,
int mwifiex_associate(struct mwifiex_private *priv, int mwifiex_associate(struct mwifiex_private *priv,
struct mwifiex_bssdescriptor *bss_desc) struct mwifiex_bssdescriptor *bss_desc)
{ {
int ret = 0;
u8 current_bssid[ETH_ALEN]; u8 current_bssid[ETH_ALEN];
/* Return error if the adapter or table entry is not marked as infra */ /* Return error if the adapter or table entry is not marked as infra */
...@@ -1294,10 +1288,8 @@ int mwifiex_associate(struct mwifiex_private *priv, ...@@ -1294,10 +1288,8 @@ int mwifiex_associate(struct mwifiex_private *priv,
retrieval */ retrieval */
priv->assoc_rsp_size = 0; priv->assoc_rsp_size = 0;
ret = mwifiex_send_cmd_sync(priv, HostCmd_CMD_802_11_ASSOCIATE, return mwifiex_send_cmd_sync(priv, HostCmd_CMD_802_11_ASSOCIATE,
HostCmd_ACT_GEN_SET, 0, bss_desc); HostCmd_ACT_GEN_SET, 0, bss_desc);
return ret;
} }
/* /*
...@@ -1309,8 +1301,6 @@ int ...@@ -1309,8 +1301,6 @@ int
mwifiex_adhoc_start(struct mwifiex_private *priv, mwifiex_adhoc_start(struct mwifiex_private *priv,
struct mwifiex_802_11_ssid *adhoc_ssid) struct mwifiex_802_11_ssid *adhoc_ssid)
{ {
int ret = 0;
dev_dbg(priv->adapter->dev, "info: Adhoc Channel = %d\n", dev_dbg(priv->adapter->dev, "info: Adhoc Channel = %d\n",
priv->adhoc_channel); priv->adhoc_channel);
dev_dbg(priv->adapter->dev, "info: curr_bss_params.channel = %d\n", dev_dbg(priv->adapter->dev, "info: curr_bss_params.channel = %d\n",
...@@ -1318,10 +1308,8 @@ mwifiex_adhoc_start(struct mwifiex_private *priv, ...@@ -1318,10 +1308,8 @@ mwifiex_adhoc_start(struct mwifiex_private *priv,
dev_dbg(priv->adapter->dev, "info: curr_bss_params.band = %d\n", dev_dbg(priv->adapter->dev, "info: curr_bss_params.band = %d\n",
priv->curr_bss_params.band); priv->curr_bss_params.band);
ret = mwifiex_send_cmd_sync(priv, HostCmd_CMD_802_11_AD_HOC_START, return mwifiex_send_cmd_sync(priv, HostCmd_CMD_802_11_AD_HOC_START,
HostCmd_ACT_GEN_SET, 0, adhoc_ssid); HostCmd_ACT_GEN_SET, 0, adhoc_ssid);
return ret;
} }
/* /*
...@@ -1333,8 +1321,6 @@ mwifiex_adhoc_start(struct mwifiex_private *priv, ...@@ -1333,8 +1321,6 @@ mwifiex_adhoc_start(struct mwifiex_private *priv,
int mwifiex_adhoc_join(struct mwifiex_private *priv, int mwifiex_adhoc_join(struct mwifiex_private *priv,
struct mwifiex_bssdescriptor *bss_desc) struct mwifiex_bssdescriptor *bss_desc)
{ {
int ret = 0;
dev_dbg(priv->adapter->dev, "info: adhoc join: curr_bss ssid =%s\n", dev_dbg(priv->adapter->dev, "info: adhoc join: curr_bss ssid =%s\n",
priv->curr_bss_params.bss_descriptor.ssid.ssid); priv->curr_bss_params.bss_descriptor.ssid.ssid);
dev_dbg(priv->adapter->dev, "info: adhoc join: curr_bss ssid_len =%u\n", dev_dbg(priv->adapter->dev, "info: adhoc join: curr_bss ssid_len =%u\n",
...@@ -1360,10 +1346,8 @@ int mwifiex_adhoc_join(struct mwifiex_private *priv, ...@@ -1360,10 +1346,8 @@ int mwifiex_adhoc_join(struct mwifiex_private *priv,
dev_dbg(priv->adapter->dev, "info: curr_bss_params.band = %c\n", dev_dbg(priv->adapter->dev, "info: curr_bss_params.band = %c\n",
priv->curr_bss_params.band); priv->curr_bss_params.band);
ret = mwifiex_send_cmd_sync(priv, HostCmd_CMD_802_11_AD_HOC_JOIN, return mwifiex_send_cmd_sync(priv, HostCmd_CMD_802_11_AD_HOC_JOIN,
HostCmd_ACT_GEN_SET, 0, bss_desc); HostCmd_ACT_GEN_SET, 0, bss_desc);
return ret;
} }
/* /*
...@@ -1424,21 +1408,15 @@ EXPORT_SYMBOL_GPL(mwifiex_deauthenticate); ...@@ -1424,21 +1408,15 @@ EXPORT_SYMBOL_GPL(mwifiex_deauthenticate);
u8 u8
mwifiex_band_to_radio_type(u8 band) mwifiex_band_to_radio_type(u8 band)
{ {
u8 ret_radio_type;
switch (band) { switch (band) {
case BAND_A: case BAND_A:
case BAND_AN: case BAND_AN:
case BAND_A | BAND_AN: case BAND_A | BAND_AN:
ret_radio_type = HostCmd_SCAN_RADIO_TYPE_A; return HostCmd_SCAN_RADIO_TYPE_A;
break;
case BAND_B: case BAND_B:
case BAND_G: case BAND_G:
case BAND_B | BAND_G: case BAND_B | BAND_G:
default: default:
ret_radio_type = HostCmd_SCAN_RADIO_TYPE_BG; return HostCmd_SCAN_RADIO_TYPE_BG;
break;
} }
return ret_radio_type;
} }
...@@ -68,7 +68,6 @@ static struct mwifiex_drv_mode mwifiex_drv_mode_tbl[] = { ...@@ -68,7 +68,6 @@ static struct mwifiex_drv_mode mwifiex_drv_mode_tbl[] = {
static int mwifiex_register(void *card, struct mwifiex_if_ops *if_ops, static int mwifiex_register(void *card, struct mwifiex_if_ops *if_ops,
struct mwifiex_device *mdevice, void **padapter) struct mwifiex_device *mdevice, void **padapter)
{ {
int ret = 0;
struct mwifiex_adapter *adapter = NULL; struct mwifiex_adapter *adapter = NULL;
u8 i = 0; u8 i = 0;
...@@ -84,8 +83,7 @@ static int mwifiex_register(void *card, struct mwifiex_if_ops *if_ops, ...@@ -84,8 +83,7 @@ static int mwifiex_register(void *card, struct mwifiex_if_ops *if_ops,
memmove(&adapter->if_ops, if_ops, sizeof(struct mwifiex_if_ops)); memmove(&adapter->if_ops, if_ops, sizeof(struct mwifiex_if_ops));
/* card specific initialization has been deferred until now .. */ /* card specific initialization has been deferred until now .. */
ret = adapter->if_ops.init_if(adapter); if (adapter->if_ops.init_if(adapter))
if (ret)
goto error; goto error;
adapter->priv_num = 0; adapter->priv_num = 0;
...@@ -893,7 +891,6 @@ int ...@@ -893,7 +891,6 @@ int
mwifiex_add_card(void *card, struct semaphore *sem, mwifiex_add_card(void *card, struct semaphore *sem,
struct mwifiex_if_ops *if_ops) struct mwifiex_if_ops *if_ops)
{ {
int status = 0;
int i; int i;
struct mwifiex_adapter *adapter = NULL; struct mwifiex_adapter *adapter = NULL;
struct mwifiex_drv_mode *drv_mode_info = &mwifiex_drv_mode_tbl[0]; struct mwifiex_drv_mode *drv_mode_info = &mwifiex_drv_mode_tbl[0];
...@@ -943,12 +940,9 @@ mwifiex_add_card(void *card, struct semaphore *sem, ...@@ -943,12 +940,9 @@ mwifiex_add_card(void *card, struct semaphore *sem,
for (i = 0; i < drv_mode_info->intf_num; i++) { for (i = 0; i < drv_mode_info->intf_num; i++) {
if (!mwifiex_add_interface(adapter, i, if (!mwifiex_add_interface(adapter, i,
adapter->drv_mode->bss_attr[i].bss_type)) { adapter->drv_mode->bss_attr[i].bss_type)) {
status = -1; goto err_add_intf;
break;
} }
} }
if (status)
goto err_add_intf;
up(sem); up(sem);
...@@ -969,8 +963,8 @@ mwifiex_add_card(void *card, struct semaphore *sem, ...@@ -969,8 +963,8 @@ mwifiex_add_card(void *card, struct semaphore *sem,
(adapter->hw_status == MWIFIEX_HW_STATUS_READY)) { (adapter->hw_status == MWIFIEX_HW_STATUS_READY)) {
pr_debug("info: %s: shutdown mwifiex\n", __func__); pr_debug("info: %s: shutdown mwifiex\n", __func__);
adapter->init_wait_q_woken = false; adapter->init_wait_q_woken = false;
status = mwifiex_shutdown_drv(adapter);
if (status == -EINPROGRESS) if (mwifiex_shutdown_drv(adapter) == -EINPROGRESS)
wait_event_interruptible(adapter->init_wait_q, wait_event_interruptible(adapter->init_wait_q,
adapter->init_wait_q_woken); adapter->init_wait_q_woken);
} }
...@@ -999,7 +993,6 @@ EXPORT_SYMBOL_GPL(mwifiex_add_card); ...@@ -999,7 +993,6 @@ EXPORT_SYMBOL_GPL(mwifiex_add_card);
int mwifiex_remove_card(struct mwifiex_adapter *adapter, struct semaphore *sem) int mwifiex_remove_card(struct mwifiex_adapter *adapter, struct semaphore *sem)
{ {
struct mwifiex_private *priv = NULL; struct mwifiex_private *priv = NULL;
int status;
int i; int i;
if (down_interruptible(sem)) if (down_interruptible(sem))
...@@ -1023,8 +1016,8 @@ int mwifiex_remove_card(struct mwifiex_adapter *adapter, struct semaphore *sem) ...@@ -1023,8 +1016,8 @@ int mwifiex_remove_card(struct mwifiex_adapter *adapter, struct semaphore *sem)
dev_dbg(adapter->dev, "cmd: calling mwifiex_shutdown_drv...\n"); dev_dbg(adapter->dev, "cmd: calling mwifiex_shutdown_drv...\n");
adapter->init_wait_q_woken = false; adapter->init_wait_q_woken = false;
status = mwifiex_shutdown_drv(adapter);
if (status == -EINPROGRESS) if (mwifiex_shutdown_drv(adapter) == -EINPROGRESS)
wait_event_interruptible(adapter->init_wait_q, wait_event_interruptible(adapter->init_wait_q,
adapter->init_wait_q_woken); adapter->init_wait_q_woken);
dev_dbg(adapter->dev, "cmd: mwifiex_shutdown_drv done\n"); dev_dbg(adapter->dev, "cmd: mwifiex_shutdown_drv done\n");
......
...@@ -181,7 +181,6 @@ int mwifiex_find_best_bss(struct mwifiex_private *priv, ...@@ -181,7 +181,6 @@ int mwifiex_find_best_bss(struct mwifiex_private *priv,
struct mwifiex_ssid_bssid *ssid_bssid) struct mwifiex_ssid_bssid *ssid_bssid)
{ {
struct mwifiex_ssid_bssid tmp_ssid_bssid; struct mwifiex_ssid_bssid tmp_ssid_bssid;
int ret = 0;
u8 *mac = NULL; u8 *mac = NULL;
if (!ssid_bssid) if (!ssid_bssid)
...@@ -189,17 +188,17 @@ int mwifiex_find_best_bss(struct mwifiex_private *priv, ...@@ -189,17 +188,17 @@ int mwifiex_find_best_bss(struct mwifiex_private *priv,
memcpy(&tmp_ssid_bssid, ssid_bssid, memcpy(&tmp_ssid_bssid, ssid_bssid,
sizeof(struct mwifiex_ssid_bssid)); sizeof(struct mwifiex_ssid_bssid));
ret = mwifiex_bss_ioctl_find_bss(priv, &tmp_ssid_bssid);
if (!ret) { if (!mwifiex_bss_ioctl_find_bss(priv, &tmp_ssid_bssid)) {
memcpy(ssid_bssid, &tmp_ssid_bssid, memcpy(ssid_bssid, &tmp_ssid_bssid,
sizeof(struct mwifiex_ssid_bssid)); sizeof(struct mwifiex_ssid_bssid));
mac = (u8 *) &ssid_bssid->bssid; mac = (u8 *) &ssid_bssid->bssid;
dev_dbg(priv->adapter->dev, "cmd: found network: ssid=%s," dev_dbg(priv->adapter->dev, "cmd: found network: ssid=%s,"
" %pM\n", ssid_bssid->ssid.ssid, mac); " %pM\n", ssid_bssid->ssid.ssid, mac);
return 0;
} }
return ret; return -1;
} }
/* /*
...@@ -2061,19 +2060,13 @@ mwifiex_process_scan_results(struct mwifiex_private *priv) ...@@ -2061,19 +2060,13 @@ mwifiex_process_scan_results(struct mwifiex_private *priv)
static u8 static u8
mwifiex_radio_type_to_band(u8 radio_type) mwifiex_radio_type_to_band(u8 radio_type)
{ {
u8 ret_band;
switch (radio_type) { switch (radio_type) {
case HostCmd_SCAN_RADIO_TYPE_A: case HostCmd_SCAN_RADIO_TYPE_A:
ret_band = BAND_A; return BAND_A;
break;
case HostCmd_SCAN_RADIO_TYPE_BG: case HostCmd_SCAN_RADIO_TYPE_BG:
default: default:
ret_band = BAND_G; return BAND_G;
break;
} }
return ret_band;
} }
/* /*
...@@ -2226,8 +2219,7 @@ static int ...@@ -2226,8 +2219,7 @@ static int
mwifiex_scan_delete_ssid_table_entry(struct mwifiex_private *priv, mwifiex_scan_delete_ssid_table_entry(struct mwifiex_private *priv,
struct mwifiex_802_11_ssid *del_ssid) struct mwifiex_802_11_ssid *del_ssid)
{ {
int ret = -1; s32 table_idx = -1;
s32 table_idx;
dev_dbg(priv->adapter->dev, "info: scan: delete ssid entry: %-32s\n", dev_dbg(priv->adapter->dev, "info: scan: delete ssid entry: %-32s\n",
del_ssid->ssid); del_ssid->ssid);
...@@ -2240,11 +2232,10 @@ mwifiex_scan_delete_ssid_table_entry(struct mwifiex_private *priv, ...@@ -2240,11 +2232,10 @@ mwifiex_scan_delete_ssid_table_entry(struct mwifiex_private *priv,
dev_dbg(priv->adapter->dev, dev_dbg(priv->adapter->dev,
"info: Scan: Delete SSID Entry: Found Idx = %d\n", "info: Scan: Delete SSID Entry: Found Idx = %d\n",
table_idx); table_idx);
ret = 0;
mwifiex_scan_delete_table_entry(priv, table_idx); mwifiex_scan_delete_table_entry(priv, table_idx);
} }
return ret; return table_idx == -1 ? -1 : 0;
} }
/* /*
......
...@@ -347,12 +347,9 @@ static int mwifiex_read_data_sync(struct mwifiex_adapter *adapter, u8 *buffer, ...@@ -347,12 +347,9 @@ static int mwifiex_read_data_sync(struct mwifiex_adapter *adapter, u8 *buffer,
*/ */
static int mwifiex_pm_wakeup_card(struct mwifiex_adapter *adapter) static int mwifiex_pm_wakeup_card(struct mwifiex_adapter *adapter)
{ {
int ret;
dev_dbg(adapter->dev, "event: wakeup device...\n"); dev_dbg(adapter->dev, "event: wakeup device...\n");
ret = mwifiex_write_reg(adapter, CONFIGURATION_REG, HOST_POWER_UP);
return ret; return mwifiex_write_reg(adapter, CONFIGURATION_REG, HOST_POWER_UP);
} }
/* /*
...@@ -362,12 +359,9 @@ static int mwifiex_pm_wakeup_card(struct mwifiex_adapter *adapter) ...@@ -362,12 +359,9 @@ static int mwifiex_pm_wakeup_card(struct mwifiex_adapter *adapter)
*/ */
static int mwifiex_pm_wakeup_card_complete(struct mwifiex_adapter *adapter) static int mwifiex_pm_wakeup_card_complete(struct mwifiex_adapter *adapter)
{ {
int ret;
dev_dbg(adapter->dev, "cmd: wakeup device completed\n"); dev_dbg(adapter->dev, "cmd: wakeup device completed\n");
ret = mwifiex_write_reg(adapter, CONFIGURATION_REG, 0);
return ret; return mwifiex_write_reg(adapter, CONFIGURATION_REG, 0);
} }
/* /*
...@@ -1703,13 +1697,9 @@ static struct mwifiex_if_ops sdio_ops = { ...@@ -1703,13 +1697,9 @@ static struct mwifiex_if_ops sdio_ops = {
static int static int
mwifiex_sdio_init_module(void) mwifiex_sdio_init_module(void)
{ {
int ret;
sema_init(&add_remove_card_sem, 1); sema_init(&add_remove_card_sem, 1);
ret = sdio_register_driver(&mwifiex_sdio); return sdio_register_driver(&mwifiex_sdio);
return ret;
} }
/* /*
......
...@@ -216,7 +216,7 @@ int mwifiex_bss_start(struct mwifiex_private *priv, ...@@ -216,7 +216,7 @@ int mwifiex_bss_start(struct mwifiex_private *priv,
ret = mwifiex_adhoc_join(priv, &adapter->scan_table[i]); ret = mwifiex_adhoc_join(priv, &adapter->scan_table[i]);
if (ret) if (ret)
return ret; return ret;
} else { /* i >= 0 */ } else {
dev_dbg(adapter->dev, "info: Network not found in " dev_dbg(adapter->dev, "info: Network not found in "
"the list, creating adhoc with ssid = %s\n", "the list, creating adhoc with ssid = %s\n",
ssid_bssid->ssid.ssid); ssid_bssid->ssid.ssid);
...@@ -320,16 +320,13 @@ int mwifiex_set_hs_params(struct mwifiex_private *priv, u16 action, ...@@ -320,16 +320,13 @@ int mwifiex_set_hs_params(struct mwifiex_private *priv, u16 action,
*/ */
int mwifiex_cancel_hs(struct mwifiex_private *priv, int cmd_type) int mwifiex_cancel_hs(struct mwifiex_private *priv, int cmd_type)
{ {
int ret = 0;
struct mwifiex_ds_hs_cfg hscfg; struct mwifiex_ds_hs_cfg hscfg;
/* Cancel Host Sleep */
hscfg.conditions = HOST_SLEEP_CFG_CANCEL; hscfg.conditions = HOST_SLEEP_CFG_CANCEL;
hscfg.is_invoke_hostcmd = true; hscfg.is_invoke_hostcmd = true;
ret = mwifiex_set_hs_params(priv, HostCmd_ACT_GEN_SET,
cmd_type, &hscfg);
return ret; return mwifiex_set_hs_params(priv, HostCmd_ACT_GEN_SET,
cmd_type, &hscfg);
} }
EXPORT_SYMBOL_GPL(mwifiex_cancel_hs); EXPORT_SYMBOL_GPL(mwifiex_cancel_hs);
...@@ -348,7 +345,6 @@ int mwifiex_enable_hs(struct mwifiex_adapter *adapter) ...@@ -348,7 +345,6 @@ int mwifiex_enable_hs(struct mwifiex_adapter *adapter)
return true; return true;
} }
/* Enable Host Sleep */
adapter->hs_activate_wait_q_woken = false; adapter->hs_activate_wait_q_woken = false;
memset(&hscfg, 0, sizeof(struct mwifiex_hs_config_param)); memset(&hscfg, 0, sizeof(struct mwifiex_hs_config_param));
...@@ -385,23 +381,17 @@ int mwifiex_get_bss_info(struct mwifiex_private *priv, ...@@ -385,23 +381,17 @@ int mwifiex_get_bss_info(struct mwifiex_private *priv,
if (!info) if (!info)
return -1; return -1;
/* Get current BSS info */
bss_desc = &priv->curr_bss_params.bss_descriptor; bss_desc = &priv->curr_bss_params.bss_descriptor;
/* BSS mode */
info->bss_mode = priv->bss_mode; info->bss_mode = priv->bss_mode;
/* SSID */
memcpy(&info->ssid, &bss_desc->ssid, memcpy(&info->ssid, &bss_desc->ssid,
sizeof(struct mwifiex_802_11_ssid)); sizeof(struct mwifiex_802_11_ssid));
/* BSSID */
memcpy(&info->bssid, &bss_desc->mac_address, ETH_ALEN); memcpy(&info->bssid, &bss_desc->mac_address, ETH_ALEN);
/* Channel */
info->bss_chan = bss_desc->channel; info->bss_chan = bss_desc->channel;
/* Region code */
info->region_code = adapter->region_code; info->region_code = adapter->region_code;
/* Scan table index if connected */ /* Scan table index if connected */
...@@ -415,20 +405,15 @@ int mwifiex_get_bss_info(struct mwifiex_private *priv, ...@@ -415,20 +405,15 @@ int mwifiex_get_bss_info(struct mwifiex_private *priv,
info->scan_table_idx = tbl_idx; info->scan_table_idx = tbl_idx;
} }
/* Connection status */
info->media_connected = priv->media_connected; info->media_connected = priv->media_connected;
/* Tx power information */
info->max_power_level = priv->max_tx_power_level; info->max_power_level = priv->max_tx_power_level;
info->min_power_level = priv->min_tx_power_level; info->min_power_level = priv->min_tx_power_level;
/* AdHoc state */
info->adhoc_state = priv->adhoc_state; info->adhoc_state = priv->adhoc_state;
/* Last beacon NF */
info->bcn_nf_last = priv->bcn_nf_last; info->bcn_nf_last = priv->bcn_nf_last;
/* wep status */
if (priv->sec_info.wep_status == MWIFIEX_802_11_WEP_ENABLED) if (priv->sec_info.wep_status == MWIFIEX_802_11_WEP_ENABLED)
info->wep_status = true; info->wep_status = true;
else else
...@@ -574,22 +559,17 @@ int mwifiex_bss_set_channel(struct mwifiex_private *priv, ...@@ -574,22 +559,17 @@ int mwifiex_bss_set_channel(struct mwifiex_private *priv,
static int mwifiex_bss_ioctl_ibss_channel(struct mwifiex_private *priv, static int mwifiex_bss_ioctl_ibss_channel(struct mwifiex_private *priv,
u16 action, u16 *channel) u16 action, u16 *channel)
{ {
int ret = 0;
if (action == HostCmd_ACT_GEN_GET) { if (action == HostCmd_ACT_GEN_GET) {
if (!priv->media_connected) { if (!priv->media_connected) {
*channel = priv->adhoc_channel; *channel = priv->adhoc_channel;
return ret; return 0;
} }
} else { } else {
priv->adhoc_channel = (u8) *channel; priv->adhoc_channel = (u8) *channel;
} }
/* Send request to firmware */ return mwifiex_send_cmd_sync(priv, HostCmd_CMD_802_11_RF_CHANNEL,
ret = mwifiex_send_cmd_sync(priv, HostCmd_CMD_802_11_RF_CHANNEL,
action, 0, channel); action, 0, channel);
return ret;
} }
/* /*
...@@ -602,7 +582,6 @@ int mwifiex_bss_ioctl_find_bss(struct mwifiex_private *priv, ...@@ -602,7 +582,6 @@ int mwifiex_bss_ioctl_find_bss(struct mwifiex_private *priv,
struct mwifiex_ssid_bssid *ssid_bssid) struct mwifiex_ssid_bssid *ssid_bssid)
{ {
struct mwifiex_adapter *adapter = priv->adapter; struct mwifiex_adapter *adapter = priv->adapter;
int ret = 0;
struct mwifiex_bssdescriptor *bss_desc; struct mwifiex_bssdescriptor *bss_desc;
u8 zero_mac[ETH_ALEN] = { 0, 0, 0, 0, 0, 0 }; u8 zero_mac[ETH_ALEN] = { 0, 0, 0, 0, 0, 0 };
u8 mac[ETH_ALEN]; u8 mac[ETH_ALEN];
...@@ -631,10 +610,10 @@ int mwifiex_bss_ioctl_find_bss(struct mwifiex_private *priv, ...@@ -631,10 +610,10 @@ int mwifiex_bss_ioctl_find_bss(struct mwifiex_private *priv,
bss_desc = &adapter->scan_table[i]; bss_desc = &adapter->scan_table[i];
memcpy(ssid_bssid->bssid, bss_desc->mac_address, ETH_ALEN); memcpy(ssid_bssid->bssid, bss_desc->mac_address, ETH_ALEN);
} else { } else {
ret = mwifiex_find_best_network(priv, ssid_bssid); return mwifiex_find_best_network(priv, ssid_bssid);
} }
return ret; return 0;
} }
/* /*
...@@ -718,7 +697,6 @@ static int mwifiex_rate_ioctl_get_rate_value(struct mwifiex_private *priv, ...@@ -718,7 +697,6 @@ static int mwifiex_rate_ioctl_get_rate_value(struct mwifiex_private *priv,
struct mwifiex_rate_cfg *rate_cfg) struct mwifiex_rate_cfg *rate_cfg)
{ {
struct mwifiex_adapter *adapter = priv->adapter; struct mwifiex_adapter *adapter = priv->adapter;
int ret = 0;
rate_cfg->is_rate_auto = priv->is_data_rate_auto; rate_cfg->is_rate_auto = priv->is_data_rate_auto;
if (!priv->media_connected) { if (!priv->media_connected) {
...@@ -757,13 +735,12 @@ static int mwifiex_rate_ioctl_get_rate_value(struct mwifiex_private *priv, ...@@ -757,13 +735,12 @@ static int mwifiex_rate_ioctl_get_rate_value(struct mwifiex_private *priv,
break; break;
} }
} else { } else {
/* Send request to firmware */ return mwifiex_send_cmd_sync(priv,
ret = mwifiex_send_cmd_sync(priv,
HostCmd_CMD_802_11_TX_RATE_QUERY, HostCmd_CMD_802_11_TX_RATE_QUERY,
HostCmd_ACT_GEN_GET, 0, NULL); HostCmd_ACT_GEN_GET, 0, NULL);
} }
return ret; return 0;
} }
/* /*
...@@ -827,7 +804,6 @@ static int mwifiex_rate_ioctl_set_rate_value(struct mwifiex_private *priv, ...@@ -827,7 +804,6 @@ static int mwifiex_rate_ioctl_set_rate_value(struct mwifiex_private *priv,
} }
} }
/* Send request to firmware */
ret = mwifiex_send_cmd_sync(priv, HostCmd_CMD_TX_RATE_CFG, ret = mwifiex_send_cmd_sync(priv, HostCmd_CMD_TX_RATE_CFG,
HostCmd_ACT_GEN_SET, 0, bitmap_rates); HostCmd_ACT_GEN_SET, 0, bitmap_rates);
...@@ -969,7 +945,6 @@ int mwifiex_set_tx_power(struct mwifiex_private *priv, ...@@ -969,7 +945,6 @@ int mwifiex_set_tx_power(struct mwifiex_private *priv,
pg->power_max = (s8) dbm; pg->power_max = (s8) dbm;
pg->ht_bandwidth = HT_BW_40; pg->ht_bandwidth = HT_BW_40;
} }
/* Send request to firmware */
ret = mwifiex_send_cmd_sync(priv, HostCmd_CMD_TXPWR_CFG, ret = mwifiex_send_cmd_sync(priv, HostCmd_CMD_TXPWR_CFG,
HostCmd_ACT_GEN_SET, 0, buf); HostCmd_ACT_GEN_SET, 0, buf);
...@@ -1088,13 +1063,10 @@ static int mwifiex_set_wapi_ie(struct mwifiex_private *priv, ...@@ -1088,13 +1063,10 @@ static int mwifiex_set_wapi_ie(struct mwifiex_private *priv,
static int mwifiex_sec_ioctl_set_wapi_key(struct mwifiex_private *priv, static int mwifiex_sec_ioctl_set_wapi_key(struct mwifiex_private *priv,
struct mwifiex_ds_encrypt_key *encrypt_key) struct mwifiex_ds_encrypt_key *encrypt_key)
{ {
int ret = 0;
ret = mwifiex_send_cmd_sync(priv, HostCmd_CMD_802_11_KEY_MATERIAL, return mwifiex_send_cmd_sync(priv, HostCmd_CMD_802_11_KEY_MATERIAL,
HostCmd_ACT_GEN_SET, KEY_INFO_ENABLED, HostCmd_ACT_GEN_SET, KEY_INFO_ENABLED,
encrypt_key); encrypt_key);
return ret;
} }
/* /*
...@@ -1128,7 +1100,6 @@ static int mwifiex_sec_ioctl_set_wep_key(struct mwifiex_private *priv, ...@@ -1128,7 +1100,6 @@ static int mwifiex_sec_ioctl_set_wep_key(struct mwifiex_private *priv,
priv->sec_info.wep_status = MWIFIEX_802_11_WEP_ENABLED; priv->sec_info.wep_status = MWIFIEX_802_11_WEP_ENABLED;
} else { } else {
wep_key = &priv->wep_key[index]; wep_key = &priv->wep_key[index];
/* Cleanup */
memset(wep_key, 0, sizeof(struct mwifiex_wep_key)); memset(wep_key, 0, sizeof(struct mwifiex_wep_key));
/* Copy the key in the driver */ /* Copy the key in the driver */
memcpy(wep_key->key_material, memcpy(wep_key->key_material,
...@@ -1151,7 +1122,6 @@ static int mwifiex_sec_ioctl_set_wep_key(struct mwifiex_private *priv, ...@@ -1151,7 +1122,6 @@ static int mwifiex_sec_ioctl_set_wep_key(struct mwifiex_private *priv,
else else
priv->curr_pkt_filter &= ~HostCmd_ACT_MAC_WEP_ENABLE; priv->curr_pkt_filter &= ~HostCmd_ACT_MAC_WEP_ENABLE;
/* Send request to firmware */
ret = mwifiex_send_cmd_sync(priv, HostCmd_CMD_MAC_CONTROL, ret = mwifiex_send_cmd_sync(priv, HostCmd_CMD_MAC_CONTROL,
HostCmd_ACT_GEN_SET, 0, HostCmd_ACT_GEN_SET, 0,
&priv->curr_pkt_filter); &priv->curr_pkt_filter);
...@@ -1216,13 +1186,11 @@ static int mwifiex_sec_ioctl_set_wpa_key(struct mwifiex_private *priv, ...@@ -1216,13 +1186,11 @@ static int mwifiex_sec_ioctl_set_wpa_key(struct mwifiex_private *priv,
encrypt_key->key_index = MWIFIEX_KEY_INDEX_UNICAST; encrypt_key->key_index = MWIFIEX_KEY_INDEX_UNICAST;
if (remove_key) if (remove_key)
/* Send request to firmware */
ret = mwifiex_send_cmd_sync(priv, ret = mwifiex_send_cmd_sync(priv,
HostCmd_CMD_802_11_KEY_MATERIAL, HostCmd_CMD_802_11_KEY_MATERIAL,
HostCmd_ACT_GEN_SET, !(KEY_INFO_ENABLED), HostCmd_ACT_GEN_SET, !(KEY_INFO_ENABLED),
encrypt_key); encrypt_key);
else else
/* Send request to firmware */
ret = mwifiex_send_cmd_sync(priv, ret = mwifiex_send_cmd_sync(priv,
HostCmd_CMD_802_11_KEY_MATERIAL, HostCmd_CMD_802_11_KEY_MATERIAL,
HostCmd_ACT_GEN_SET, KEY_INFO_ENABLED, HostCmd_ACT_GEN_SET, KEY_INFO_ENABLED,
...@@ -1297,7 +1265,6 @@ int mwifiex_get_signal_info(struct mwifiex_private *priv, ...@@ -1297,7 +1265,6 @@ int mwifiex_get_signal_info(struct mwifiex_private *priv,
return -1; return -1;
} }
/* Send request to firmware */
status = mwifiex_send_cmd_sync(priv, HostCmd_CMD_RSSI_INFO, status = mwifiex_send_cmd_sync(priv, HostCmd_CMD_RSSI_INFO,
HostCmd_ACT_GEN_GET, 0, signal); HostCmd_ACT_GEN_GET, 0, signal);
...@@ -1324,7 +1291,6 @@ int mwifiex_set_encode(struct mwifiex_private *priv, const u8 *key, ...@@ -1324,7 +1291,6 @@ int mwifiex_set_encode(struct mwifiex_private *priv, const u8 *key,
int key_len, u8 key_index, int disable) int key_len, u8 key_index, int disable)
{ {
struct mwifiex_ds_encrypt_key encrypt_key; struct mwifiex_ds_encrypt_key encrypt_key;
int ret = 0;
memset(&encrypt_key, 0, sizeof(struct mwifiex_ds_encrypt_key)); memset(&encrypt_key, 0, sizeof(struct mwifiex_ds_encrypt_key));
encrypt_key.key_len = key_len; encrypt_key.key_len = key_len;
...@@ -1336,9 +1302,7 @@ int mwifiex_set_encode(struct mwifiex_private *priv, const u8 *key, ...@@ -1336,9 +1302,7 @@ int mwifiex_set_encode(struct mwifiex_private *priv, const u8 *key,
encrypt_key.key_disable = true; encrypt_key.key_disable = true;
} }
ret = mwifiex_sec_ioctl_encrypt_key(priv, &encrypt_key); return mwifiex_sec_ioctl_encrypt_key(priv, &encrypt_key);
return ret;
} }
/* /*
...@@ -1351,18 +1315,13 @@ int ...@@ -1351,18 +1315,13 @@ int
mwifiex_get_ver_ext(struct mwifiex_private *priv) mwifiex_get_ver_ext(struct mwifiex_private *priv)
{ {
struct mwifiex_ver_ext ver_ext; struct mwifiex_ver_ext ver_ext;
int ret = 0;
/* get fw version */
memset(&ver_ext, 0, sizeof(struct host_cmd_ds_version_ext)); memset(&ver_ext, 0, sizeof(struct host_cmd_ds_version_ext));
/* Send request to firmware */ if (mwifiex_send_cmd_sync(priv, HostCmd_CMD_VERSION_EXT,
ret = mwifiex_send_cmd_sync(priv, HostCmd_CMD_VERSION_EXT, HostCmd_ACT_GEN_GET, 0, &ver_ext))
HostCmd_ACT_GEN_GET, 0, &ver_ext); return -1;
if (ret)
ret = -1;
return ret; return 0;
} }
/* /*
...@@ -1379,7 +1338,6 @@ mwifiex_get_stats_info(struct mwifiex_private *priv, ...@@ -1379,7 +1338,6 @@ mwifiex_get_stats_info(struct mwifiex_private *priv,
struct mwifiex_ds_get_stats get_log; struct mwifiex_ds_get_stats get_log;
memset(&get_log, 0, sizeof(struct mwifiex_ds_get_stats)); memset(&get_log, 0, sizeof(struct mwifiex_ds_get_stats));
/* Send request to firmware */
ret = mwifiex_send_cmd_sync(priv, HostCmd_CMD_802_11_GET_LOG, ret = mwifiex_send_cmd_sync(priv, HostCmd_CMD_802_11_GET_LOG,
HostCmd_ACT_GEN_GET, 0, &get_log); HostCmd_ACT_GEN_GET, 0, &get_log);
...@@ -1412,7 +1370,6 @@ static int mwifiex_reg_mem_ioctl_reg_rw(struct mwifiex_private *priv, ...@@ -1412,7 +1370,6 @@ static int mwifiex_reg_mem_ioctl_reg_rw(struct mwifiex_private *priv,
struct mwifiex_ds_reg_rw *reg_rw, struct mwifiex_ds_reg_rw *reg_rw,
u16 action) u16 action)
{ {
int ret = 0;
u16 cmd_no; u16 cmd_no;
switch (le32_to_cpu(reg_rw->type)) { switch (le32_to_cpu(reg_rw->type)) {
...@@ -1435,10 +1392,8 @@ static int mwifiex_reg_mem_ioctl_reg_rw(struct mwifiex_private *priv, ...@@ -1435,10 +1392,8 @@ static int mwifiex_reg_mem_ioctl_reg_rw(struct mwifiex_private *priv,
return -1; return -1;
} }
/* Send request to firmware */ return mwifiex_send_cmd_sync(priv, cmd_no, action, 0, reg_rw);
ret = mwifiex_send_cmd_sync(priv, cmd_no, action, 0, reg_rw);
return ret;
} }
/* /*
...@@ -1451,15 +1406,13 @@ int ...@@ -1451,15 +1406,13 @@ int
mwifiex_reg_write(struct mwifiex_private *priv, u32 reg_type, mwifiex_reg_write(struct mwifiex_private *priv, u32 reg_type,
u32 reg_offset, u32 reg_value) u32 reg_offset, u32 reg_value)
{ {
int ret = 0;
struct mwifiex_ds_reg_rw reg_rw; struct mwifiex_ds_reg_rw reg_rw;
reg_rw.type = cpu_to_le32(reg_type); reg_rw.type = cpu_to_le32(reg_type);
reg_rw.offset = cpu_to_le32(reg_offset); reg_rw.offset = cpu_to_le32(reg_offset);
reg_rw.value = cpu_to_le32(reg_value); reg_rw.value = cpu_to_le32(reg_value);
ret = mwifiex_reg_mem_ioctl_reg_rw(priv, &reg_rw, HostCmd_ACT_GEN_SET);
return ret; return mwifiex_reg_mem_ioctl_reg_rw(priv, &reg_rw, HostCmd_ACT_GEN_SET);
} }
/* /*
...@@ -1638,7 +1591,6 @@ int ...@@ -1638,7 +1591,6 @@ int
mwifiex_set_gen_ie(struct mwifiex_private *priv, u8 *ie, int ie_len) mwifiex_set_gen_ie(struct mwifiex_private *priv, u8 *ie, int ie_len)
{ {
struct mwifiex_ds_misc_gen_ie gen_ie; struct mwifiex_ds_misc_gen_ie gen_ie;
int status = 0;
if (ie_len > IW_CUSTOM_MAX) if (ie_len > IW_CUSTOM_MAX)
return -EFAULT; return -EFAULT;
...@@ -1646,8 +1598,7 @@ mwifiex_set_gen_ie(struct mwifiex_private *priv, u8 *ie, int ie_len) ...@@ -1646,8 +1598,7 @@ mwifiex_set_gen_ie(struct mwifiex_private *priv, u8 *ie, int ie_len)
gen_ie.type = MWIFIEX_IE_TYPE_GEN_IE; gen_ie.type = MWIFIEX_IE_TYPE_GEN_IE;
gen_ie.len = ie_len; gen_ie.len = ie_len;
memcpy(gen_ie.ie_data, ie, ie_len); memcpy(gen_ie.ie_data, ie, ie_len);
status = mwifiex_misc_ioctl_gen_ie(priv, &gen_ie, HostCmd_ACT_GEN_SET); if (mwifiex_misc_ioctl_gen_ie(priv, &gen_ie, HostCmd_ACT_GEN_SET))
if (status)
return -EFAULT; return -EFAULT;
return 0; return 0;
......
...@@ -180,15 +180,11 @@ mwifiex_check_last_packet_indication(struct mwifiex_private *priv) ...@@ -180,15 +180,11 @@ mwifiex_check_last_packet_indication(struct mwifiex_private *priv)
{ {
struct mwifiex_adapter *adapter = priv->adapter; struct mwifiex_adapter *adapter = priv->adapter;
u8 ret = false; u8 ret = false;
u8 prop_ps = true;
if (!adapter->sleep_period.period) if (!adapter->sleep_period.period)
return ret; return ret;
if (mwifiex_wmm_lists_empty(adapter)) { if (mwifiex_wmm_lists_empty(adapter))
if ((priv->curr_bss_params.wmm_uapsd_enabled &&
priv->wmm_qosinfo) || prop_ps)
ret = true; ret = true;
}
if (ret && !adapter->cmd_sent && !adapter->curr_cmd if (ret && !adapter->cmd_sent && !adapter->curr_cmd
&& !is_command_pending(adapter)) { && !is_command_pending(adapter)) {
......
...@@ -36,7 +36,6 @@ ...@@ -36,7 +36,6 @@
int mwifiex_handle_rx_packet(struct mwifiex_adapter *adapter, int mwifiex_handle_rx_packet(struct mwifiex_adapter *adapter,
struct sk_buff *skb) struct sk_buff *skb)
{ {
int ret = 0;
struct mwifiex_private *priv = struct mwifiex_private *priv =
mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_ANY); mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_ANY);
struct rxpd *local_rx_pd; struct rxpd *local_rx_pd;
...@@ -50,9 +49,8 @@ int mwifiex_handle_rx_packet(struct mwifiex_adapter *adapter, ...@@ -50,9 +49,8 @@ int mwifiex_handle_rx_packet(struct mwifiex_adapter *adapter,
priv = mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_ANY); priv = mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_ANY);
rx_info->bss_index = priv->bss_index; rx_info->bss_index = priv->bss_index;
ret = mwifiex_process_sta_rx_packet(adapter, skb);
return ret; return mwifiex_process_sta_rx_packet(adapter, skb);
} }
EXPORT_SYMBOL_GPL(mwifiex_handle_rx_packet); EXPORT_SYMBOL_GPL(mwifiex_handle_rx_packet);
......
...@@ -61,7 +61,6 @@ int mwifiex_shutdown_fw_complete(struct mwifiex_adapter *adapter) ...@@ -61,7 +61,6 @@ int mwifiex_shutdown_fw_complete(struct mwifiex_adapter *adapter)
int mwifiex_init_shutdown_fw(struct mwifiex_private *priv, int mwifiex_init_shutdown_fw(struct mwifiex_private *priv,
u32 func_init_shutdown) u32 func_init_shutdown)
{ {
int ret;
u16 cmd; u16 cmd;
if (func_init_shutdown == MWIFIEX_FUNC_INIT) { if (func_init_shutdown == MWIFIEX_FUNC_INIT) {
...@@ -73,10 +72,7 @@ int mwifiex_init_shutdown_fw(struct mwifiex_private *priv, ...@@ -73,10 +72,7 @@ int mwifiex_init_shutdown_fw(struct mwifiex_private *priv,
return -1; return -1;
} }
/* Send command to firmware */ return mwifiex_send_cmd_sync(priv, cmd, HostCmd_ACT_GEN_SET, 0, NULL);
ret = mwifiex_send_cmd_sync(priv, cmd, HostCmd_ACT_GEN_SET, 0, NULL);
return ret;
} }
EXPORT_SYMBOL_GPL(mwifiex_init_shutdown_fw); EXPORT_SYMBOL_GPL(mwifiex_init_shutdown_fw);
......
...@@ -973,7 +973,6 @@ mwifiex_send_single_packet(struct mwifiex_private *priv, ...@@ -973,7 +973,6 @@ mwifiex_send_single_packet(struct mwifiex_private *priv,
struct sk_buff *skb, *skb_next; struct sk_buff *skb, *skb_next;
struct mwifiex_tx_param tx_param; struct mwifiex_tx_param tx_param;
struct mwifiex_adapter *adapter = priv->adapter; struct mwifiex_adapter *adapter = priv->adapter;
int status = 0;
struct mwifiex_txinfo *tx_info; struct mwifiex_txinfo *tx_info;
if (skb_queue_empty(&ptr->skb_head)) { if (skb_queue_empty(&ptr->skb_head)) {
...@@ -1000,9 +999,7 @@ mwifiex_send_single_packet(struct mwifiex_private *priv, ...@@ -1000,9 +999,7 @@ mwifiex_send_single_packet(struct mwifiex_private *priv,
tx_param.next_pkt_len = ((skb_next) ? skb_next->len + tx_param.next_pkt_len = ((skb_next) ? skb_next->len +
sizeof(struct txpd) : 0); sizeof(struct txpd) : 0);
status = mwifiex_process_tx(priv, skb, &tx_param); if (mwifiex_process_tx(priv, skb, &tx_param) == -EBUSY) {
if (status == -EBUSY) {
/* Queue the packet back at the head */ /* Queue the packet back at the head */
spin_lock_irqsave(&priv->wmm.ra_list_spinlock, ra_list_flags); spin_lock_irqsave(&priv->wmm.ra_list_spinlock, ra_list_flags);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment