cmd_node->wait_q_enabled = false;
if (cmd_node->resp_skb) {
- mwifiex_recv_complete(adapter, cmd_node->resp_skb, 0);
+ dev_kfree_skb_any(cmd_node->resp_skb);
cmd_node->resp_skb = NULL;
}
-
- return;
}
/*
* main thread.
*/
static int mwifiex_cmd_host_cmd(struct mwifiex_private *priv,
- struct host_cmd_ds_command *cmd, void *data_buf)
+ struct host_cmd_ds_command *cmd,
+ struct mwifiex_ds_misc_cmd *pcmd_ptr)
{
- struct mwifiex_ds_misc_cmd *pcmd_ptr =
- (struct mwifiex_ds_misc_cmd *) data_buf;
-
/* Copy the HOST command to command buffer */
- memcpy((void *) cmd, pcmd_ptr->cmd, pcmd_ptr->len);
+ memcpy(cmd, pcmd_ptr->cmd, pcmd_ptr->len);
dev_dbg(priv->adapter->dev, "cmd: host cmd size = %d\n", pcmd_ptr->len);
return 0;
}
{
struct mwifiex_adapter *adapter = priv->adapter;
- int ret = 0;
+ int ret;
struct host_cmd_ds_command *host_cmd;
uint16_t cmd_code;
uint16_t cmd_size;
*/
static int mwifiex_dnld_sleep_confirm_cmd(struct mwifiex_adapter *adapter)
{
- int ret = 0;
- u16 cmd_len = 0;
+ int ret;
struct mwifiex_private *priv;
- struct mwifiex_opt_sleep_confirm_buffer *sleep_cfm_buf =
- (struct mwifiex_opt_sleep_confirm_buffer *)
+ struct mwifiex_opt_sleep_confirm *sleep_cfm_buf =
+ (struct mwifiex_opt_sleep_confirm *)
adapter->sleep_cfm->data;
- cmd_len = sizeof(struct mwifiex_opt_sleep_confirm);
priv = mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_ANY);
- sleep_cfm_buf->ps_cfm_sleep.seq_num =
+ sleep_cfm_buf->seq_num =
cpu_to_le16((HostCmd_SET_SEQ_NO_BSS_INFO
(adapter->seq_num, priv->bss_num,
priv->bss_type)));
adapter->seq_num++;
+ skb_push(adapter->sleep_cfm, INTF_HEADER_LEN);
ret = adapter->if_ops.host_to_card(adapter, MWIFIEX_TYPE_CMD,
adapter->sleep_cfm->data,
- adapter->sleep_cfm->len +
- INTF_HEADER_LEN, NULL);
+ adapter->sleep_cfm->len, NULL);
+ skb_pull(adapter->sleep_cfm, INTF_HEADER_LEN);
if (ret == -1) {
dev_err(adapter->dev, "SLEEP_CFM: failed\n");
}
if (GET_BSS_ROLE(mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_ANY))
== MWIFIEX_BSS_ROLE_STA) {
- if (!sleep_cfm_buf->ps_cfm_sleep.resp_ctrl)
+ if (!sleep_cfm_buf->resp_ctrl)
/* Response is not needed for sleep
confirm command */
adapter->ps_state = PS_STATE_SLEEP;
else
adapter->ps_state = PS_STATE_SLEEP_CFM;
- if (!sleep_cfm_buf->ps_cfm_sleep.resp_ctrl
+ if (!sleep_cfm_buf->resp_ctrl
&& (adapter->is_hs_configured
&& !adapter->sleep_period.period)) {
adapter->pm_wakeup_card_req = true;
if (!cmd_array) {
dev_err(adapter->dev, "%s: failed to alloc cmd_array\n",
__func__);
- return -1;
+ return -ENOMEM;
}
adapter->cmd_pool = cmd_array;
}
if (!cmd_array[i].resp_skb)
continue;
- mwifiex_recv_complete(adapter, cmd_array[i].resp_skb, 0);
+ dev_kfree_skb_any(cmd_array[i].resp_skb);
}
/* Release struct cmd_ctrl_node */
if (adapter->cmd_pool) {
*/
int mwifiex_process_event(struct mwifiex_adapter *adapter)
{
- int ret = 0;
+ int ret;
struct mwifiex_private *priv =
mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_ANY);
struct sk_buff *skb = adapter->event_skb;
u32 eventcause = adapter->event_cause;
struct timeval tstamp;
- struct mwifiex_rxinfo *rx_info = NULL;
+ struct mwifiex_rxinfo *rx_info;
/* Save the last event to debug log */
adapter->dbg.last_event_index =
adapter->event_cause = 0;
adapter->event_skb = NULL;
- mwifiex_recv_complete(adapter, skb, 0);
+ dev_kfree_skb_any(skb);
return ret;
}
int mwifiex_send_cmd_async(struct mwifiex_private *priv, uint16_t cmd_no,
u16 cmd_action, u32 cmd_oid, void *data_buf)
{
- int ret = 0;
+ int ret;
struct mwifiex_adapter *adapter = priv->adapter;
- struct cmd_ctrl_node *cmd_node = NULL;
- struct host_cmd_ds_command *cmd_ptr = NULL;
+ struct cmd_ctrl_node *cmd_node;
+ struct host_cmd_ds_command *cmd_ptr;
if (!adapter) {
pr_err("PREP_CMD: adapter is NULL\n");
{
unsigned long flags;
- if (cmd_node == NULL)
+ if (!cmd_node)
return;
if (cmd_node->wait_q_enabled)
spin_lock_irqsave(&adapter->cmd_free_q_lock, flags);
list_add_tail(&cmd_node->list, &adapter->cmd_free_q);
spin_unlock_irqrestore(&adapter->cmd_free_q_lock, flags);
-
- return;
}
/*
spin_unlock_irqrestore(&adapter->cmd_pending_q_lock, flags);
dev_dbg(adapter->dev, "cmd: QUEUE_CMD: cmd=%#x is queued\n", command);
-
- return;
}
/*
*/
int mwifiex_exec_next_cmd(struct mwifiex_adapter *adapter)
{
- struct mwifiex_private *priv = NULL;
- struct cmd_ctrl_node *cmd_node = NULL;
+ struct mwifiex_private *priv;
+ struct cmd_ctrl_node *cmd_node;
int ret = 0;
struct host_cmd_ds_command *host_cmd;
unsigned long cmd_flags;
*/
int mwifiex_process_cmdresp(struct mwifiex_adapter *adapter)
{
- struct host_cmd_ds_command *resp = NULL;
+ struct host_cmd_ds_command *resp;
struct mwifiex_private *priv =
mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_ANY);
int ret = 0;
if (adapter->curr_cmd->cmd_flag & CMD_F_HOSTCMD) {
/* Copy original response back to response buffer */
- struct mwifiex_ds_misc_cmd *hostcmd = NULL;
+ struct mwifiex_ds_misc_cmd *hostcmd;
uint16_t size = le16_to_cpu(resp->size);
dev_dbg(adapter->dev, "info: host cmd resp size = %d\n", size);
size = min_t(u16, size, MWIFIEX_SIZE_OF_CMD_BUFFER);
if (adapter->curr_cmd->data_buf) {
- hostcmd = (struct mwifiex_ds_misc_cmd *)
- adapter->curr_cmd->data_buf;
+ hostcmd = adapter->curr_cmd->data_buf;
hostcmd->len = size;
- memcpy(hostcmd->cmd, (void *) resp, size);
+ memcpy(hostcmd->cmd, resp, size);
}
}
orig_cmdresp_no = le16_to_cpu(resp->command);
{
struct mwifiex_adapter *adapter =
(struct mwifiex_adapter *) function_context;
- struct cmd_ctrl_node *cmd_node = NULL;
+ struct cmd_ctrl_node *cmd_node;
struct timeval tstamp;
adapter->num_cmd_timeout++;
}
if (adapter->hw_status == MWIFIEX_HW_STATUS_INITIALIZING)
mwifiex_init_fw_complete(adapter);
-
- return;
}
/*
void
mwifiex_cancel_all_pending_cmd(struct mwifiex_adapter *adapter)
{
- struct cmd_ctrl_node *cmd_node = NULL, *tmp_node = NULL;
+ struct cmd_ctrl_node *cmd_node = NULL, *tmp_node;
unsigned long flags;
/* Cancel current cmd */
}
adapter->cmd_wait_q.status = -1;
mwifiex_complete_cmd(adapter);
-
- return;
}
/*
adapter->is_hs_configured = false;
mwifiex_hs_activated_event(mwifiex_get_priv(adapter,
MWIFIEX_BSS_ROLE_ANY), false);
- return;
}
/*
int mwifiex_cmd_enh_power_mode(struct mwifiex_private *priv,
struct host_cmd_ds_command *cmd,
u16 cmd_action, uint16_t ps_bitmap,
- void *data_buf)
+ struct mwifiex_ds_auto_ds *auto_ds)
{
struct host_cmd_ds_802_11_ps_mode_enh *psmode_enh =
&cmd->params.psmode_enh;
- u8 *tlv = NULL;
+ u8 *tlv;
u16 cmd_size = 0;
cmd->command = cpu_to_le16(HostCmd_CMD_802_11_PS_MODE_ENH);
sizeof(struct mwifiex_ie_types_header));
cmd_size += sizeof(*auto_ds_tlv);
tlv += sizeof(*auto_ds_tlv);
- if (data_buf)
- idletime = ((struct mwifiex_ds_auto_ds *)
- data_buf)->idle_time;
+ if (auto_ds)
+ idletime = auto_ds->idle_time;
dev_dbg(priv->adapter->dev,
"cmd: PS Command: Enter Auto Deep Sleep\n");
auto_ds_tlv->deep_sleep_timeout = cpu_to_le16(idletime);
*/
int mwifiex_ret_enh_power_mode(struct mwifiex_private *priv,
struct host_cmd_ds_command *resp,
- void *data_buf)
+ struct mwifiex_ds_pm_cfg *pm_cfg)
{
struct mwifiex_adapter *adapter = priv->adapter;
struct host_cmd_ds_802_11_ps_mode_enh *ps_mode =
dev_dbg(adapter->dev, "cmd: ps_bitmap=%#x\n", ps_bitmap);
- if (data_buf) {
+ if (pm_cfg) {
/* This section is for get power save mode */
- struct mwifiex_ds_pm_cfg *pm_cfg =
- (struct mwifiex_ds_pm_cfg *)data_buf;
if (ps_bitmap & BITMAP_STA_PS)
pm_cfg->param.ps_mode = 1;
else