mwifiex: change dbg print func to mwifiex_dbg

This patch changes all debug print functions from dev_dbg/dev_err/dev_info
to mwifiex specific debug functions.

Signed-off-by: Zhaoyang Liu <liuzy@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
This commit is contained in:
Zhaoyang Liu 2015-05-12 00:48:20 +05:30 committed by Kalle Valo
parent 868093a9df
commit acebe8c10a
29 changed files with 2115 additions and 1691 deletions

View File

@ -134,8 +134,8 @@ void mwifiex_dfs_cac_work_queue(struct work_struct *work)
chandef = priv->dfs_chandef; chandef = priv->dfs_chandef;
if (priv->wdev.cac_started) { if (priv->wdev.cac_started) {
dev_dbg(priv->adapter->dev, mwifiex_dbg(priv->adapter, MSG,
"CAC timer finished; No radar detected\n"); "CAC timer finished; No radar detected\n");
cfg80211_cac_event(priv->netdev, &chandef, cfg80211_cac_event(priv->netdev, &chandef,
NL80211_RADAR_CAC_FINISHED, NL80211_RADAR_CAC_FINISHED,
GFP_KERNEL); GFP_KERNEL);
@ -161,9 +161,9 @@ int mwifiex_cmd_issue_chan_report_request(struct mwifiex_private *priv,
cr_req->chan_desc.chan_width = radar_params->chandef->width; cr_req->chan_desc.chan_width = radar_params->chandef->width;
cr_req->msec_dwell_time = cpu_to_le32(radar_params->cac_time_ms); cr_req->msec_dwell_time = cpu_to_le32(radar_params->cac_time_ms);
dev_dbg(priv->adapter->dev, mwifiex_dbg(priv->adapter, MSG,
"11h: issuing DFS Radar check for channel=%d\n", "11h: issuing DFS Radar check for channel=%d\n",
radar_params->chandef->chan->hw_value); radar_params->chandef->chan->hw_value);
return 0; return 0;
} }
@ -174,8 +174,8 @@ int mwifiex_cmd_issue_chan_report_request(struct mwifiex_private *priv,
void mwifiex_abort_cac(struct mwifiex_private *priv) void mwifiex_abort_cac(struct mwifiex_private *priv)
{ {
if (priv->wdev.cac_started) { if (priv->wdev.cac_started) {
dev_dbg(priv->adapter->dev, mwifiex_dbg(priv->adapter, MSG,
"Aborting delayed work for CAC.\n"); "Aborting delayed work for CAC.\n");
cancel_delayed_work_sync(&priv->dfs_cac_work); cancel_delayed_work_sync(&priv->dfs_cac_work);
cfg80211_cac_event(priv->netdev, &priv->dfs_chandef, cfg80211_cac_event(priv->netdev, &priv->dfs_chandef,
NL80211_RADAR_CAC_ABORTED, GFP_KERNEL); NL80211_RADAR_CAC_ABORTED, GFP_KERNEL);
@ -199,7 +199,8 @@ int mwifiex_11h_handle_chanrpt_ready(struct mwifiex_private *priv,
sizeof(u32)); sizeof(u32));
if (le32_to_cpu(rpt_event->result) != HostCmd_RESULT_OK) { if (le32_to_cpu(rpt_event->result) != HostCmd_RESULT_OK) {
dev_err(priv->adapter->dev, "Error in channel report event\n"); mwifiex_dbg(priv->adapter, ERROR,
"Error in channel report event\n");
return -1; return -1;
} }
@ -212,8 +213,8 @@ int mwifiex_11h_handle_chanrpt_ready(struct mwifiex_private *priv,
switch (le16_to_cpu(rpt->header.type)) { switch (le16_to_cpu(rpt->header.type)) {
case TLV_TYPE_CHANRPT_11H_BASIC: case TLV_TYPE_CHANRPT_11H_BASIC:
if (rpt->map.radar) { if (rpt->map.radar) {
dev_notice(priv->adapter->dev, mwifiex_dbg(priv->adapter, MSG,
"RADAR Detected on channel %d!\n", "RADAR Detected on channel %d!\n",
priv->dfs_chandef.chan->hw_value); priv->dfs_chandef.chan->hw_value);
cancel_delayed_work_sync(&priv->dfs_cac_work); cancel_delayed_work_sync(&priv->dfs_cac_work);
cfg80211_cac_event(priv->netdev, cfg80211_cac_event(priv->netdev,
@ -242,16 +243,17 @@ int mwifiex_11h_handle_radar_detected(struct mwifiex_private *priv,
rdr_event = (void *)(skb->data + sizeof(u32)); rdr_event = (void *)(skb->data + sizeof(u32));
if (le32_to_cpu(rdr_event->passed)) { if (le32_to_cpu(rdr_event->passed)) {
dev_notice(priv->adapter->dev, mwifiex_dbg(priv->adapter, MSG,
"radar detected; indicating kernel\n"); "radar detected; indicating kernel\n");
cfg80211_radar_event(priv->adapter->wiphy, &priv->dfs_chandef, cfg80211_radar_event(priv->adapter->wiphy, &priv->dfs_chandef,
GFP_KERNEL); GFP_KERNEL);
dev_dbg(priv->adapter->dev, "regdomain: %d\n", mwifiex_dbg(priv->adapter, MSG, "regdomain: %d\n",
rdr_event->reg_domain); rdr_event->reg_domain);
dev_dbg(priv->adapter->dev, "radar detection type: %d\n", mwifiex_dbg(priv->adapter, MSG, "radar detection type: %d\n",
rdr_event->det_type); rdr_event->det_type);
} else { } else {
dev_dbg(priv->adapter->dev, "false radar detection event!\n"); mwifiex_dbg(priv->adapter, ERROR,
"false radar detection event!\n");
} }
return 0; return 0;
@ -276,20 +278,20 @@ void mwifiex_dfs_chan_sw_work_queue(struct work_struct *work)
bss_cfg = &priv->bss_cfg; bss_cfg = &priv->bss_cfg;
if (!bss_cfg->beacon_period) { if (!bss_cfg->beacon_period) {
dev_err(priv->adapter->dev, mwifiex_dbg(priv->adapter, ERROR,
"channel switch: AP already stopped\n"); "channel switch: AP already stopped\n");
return; return;
} }
mwifiex_uap_set_channel(bss_cfg, priv->dfs_chandef); mwifiex_uap_set_channel(bss_cfg, priv->dfs_chandef);
if (mwifiex_config_start_uap(priv, bss_cfg)) { if (mwifiex_config_start_uap(priv, bss_cfg)) {
dev_dbg(priv->adapter->dev, mwifiex_dbg(priv->adapter, ERROR,
"Failed to start AP after channel switch\n"); "Failed to start AP after channel switch\n");
return; return;
} }
dev_notice(priv->adapter->dev, mwifiex_dbg(priv->adapter, MSG,
"indicating channel switch completion to kernel\n"); "indicating channel switch completion to kernel\n");
cfg80211_ch_switch_notify(priv->netdev, &priv->dfs_chandef); cfg80211_ch_switch_notify(priv->netdev, &priv->dfs_chandef);
} }

View File

@ -42,7 +42,7 @@ int mwifiex_fill_cap_info(struct mwifiex_private *priv, u8 radio_type,
priv->wdev.wiphy->bands[radio_type]; priv->wdev.wiphy->bands[radio_type];
if (WARN_ON_ONCE(!sband)) { if (WARN_ON_ONCE(!sband)) {
dev_err(priv->adapter->dev, "Invalid radio type!\n"); mwifiex_dbg(priv->adapter, ERROR, "Invalid radio type!\n");
return -EINVAL; return -EINVAL;
} }
@ -184,7 +184,7 @@ int mwifiex_ret_11n_addba_req(struct mwifiex_private *priv,
tx_ba_tbl = mwifiex_get_ba_tbl(priv, tid, add_ba_rsp->peer_mac_addr); tx_ba_tbl = mwifiex_get_ba_tbl(priv, tid, add_ba_rsp->peer_mac_addr);
if (tx_ba_tbl) { if (tx_ba_tbl) {
dev_dbg(priv->adapter->dev, "info: BA stream complete\n"); mwifiex_dbg(priv->adapter, EVENT, "info: BA stream complete\n");
tx_ba_tbl->ba_status = BA_SETUP_COMPLETE; tx_ba_tbl->ba_status = BA_SETUP_COMPLETE;
if ((block_ack_param_set & BLOCKACKPARAM_AMSDU_SUPP_MASK) && if ((block_ack_param_set & BLOCKACKPARAM_AMSDU_SUPP_MASK) &&
priv->add_ba_param.tx_amsdu && priv->add_ba_param.tx_amsdu &&
@ -197,7 +197,7 @@ int mwifiex_ret_11n_addba_req(struct mwifiex_private *priv,
ra_list->ba_status = BA_SETUP_COMPLETE; ra_list->ba_status = BA_SETUP_COMPLETE;
} }
} else { } else {
dev_err(priv->adapter->dev, "BA stream not created\n"); mwifiex_dbg(priv->adapter, ERROR, "BA stream not created\n");
} }
return 0; return 0;
@ -224,7 +224,8 @@ int mwifiex_cmd_recfg_tx_buf(struct mwifiex_private *priv,
tx_buf->action = cpu_to_le16(action); tx_buf->action = cpu_to_le16(action);
switch (action) { switch (action) {
case HostCmd_ACT_GEN_SET: case HostCmd_ACT_GEN_SET:
dev_dbg(priv->adapter->dev, "cmd: set tx_buf=%d\n", *buf_size); mwifiex_dbg(priv->adapter, CMD,
"cmd: set tx_buf=%d\n", *buf_size);
tx_buf->buff_size = cpu_to_le16(*buf_size); tx_buf->buff_size = cpu_to_le16(*buf_size);
break; break;
case HostCmd_ACT_GEN_GET: case HostCmd_ACT_GEN_GET:
@ -466,7 +467,8 @@ void mwifiex_11n_delete_tx_ba_stream_tbl_entry(struct mwifiex_private *priv,
mwifiex_is_tx_ba_stream_ptr_valid(priv, tx_ba_tsr_tbl)) mwifiex_is_tx_ba_stream_ptr_valid(priv, tx_ba_tsr_tbl))
return; return;
dev_dbg(priv->adapter->dev, "info: tx_ba_tsr_tbl %p\n", tx_ba_tsr_tbl); mwifiex_dbg(priv->adapter, INFO,
"info: tx_ba_tsr_tbl %p\n", tx_ba_tsr_tbl);
list_del(&tx_ba_tsr_tbl->list); list_del(&tx_ba_tsr_tbl->list);
@ -563,7 +565,7 @@ int mwifiex_send_addba(struct mwifiex_private *priv, int tid, u8 *peer_mac)
unsigned long flags; unsigned long flags;
u16 block_ack_param_set; u16 block_ack_param_set;
dev_dbg(priv->adapter->dev, "cmd: %s: tid %d\n", __func__, tid); mwifiex_dbg(priv->adapter, CMD, "cmd: %s: tid %d\n", __func__, tid);
if ((GET_BSS_ROLE(priv) == MWIFIEX_BSS_ROLE_STA) && if ((GET_BSS_ROLE(priv) == MWIFIEX_BSS_ROLE_STA) &&
ISSUPP_TDLS_ENABLED(priv->adapter->fw_cap_info) && ISSUPP_TDLS_ENABLED(priv->adapter->fw_cap_info) &&
@ -575,9 +577,9 @@ int mwifiex_send_addba(struct mwifiex_private *priv, int tid, u8 *peer_mac)
sta_ptr = mwifiex_get_sta_entry(priv, peer_mac); sta_ptr = mwifiex_get_sta_entry(priv, peer_mac);
if (!sta_ptr) { if (!sta_ptr) {
spin_unlock_irqrestore(&priv->sta_list_spinlock, flags); spin_unlock_irqrestore(&priv->sta_list_spinlock, flags);
dev_warn(priv->adapter->dev, mwifiex_dbg(priv->adapter, ERROR,
"BA setup with unknown TDLS peer %pM!\n", "BA setup with unknown TDLS peer %pM!\n",
peer_mac); peer_mac);
return -1; return -1;
} }
if (sta_ptr->is_11ac_enabled) if (sta_ptr->is_11ac_enabled)
@ -706,8 +708,8 @@ int mwifiex_get_tx_ba_stream_tbl(struct mwifiex_private *priv,
spin_lock_irqsave(&priv->tx_ba_stream_tbl_lock, flags); spin_lock_irqsave(&priv->tx_ba_stream_tbl_lock, flags);
list_for_each_entry(tx_ba_tsr_tbl, &priv->tx_ba_stream_tbl_ptr, list) { list_for_each_entry(tx_ba_tsr_tbl, &priv->tx_ba_stream_tbl_ptr, list) {
rx_reo_tbl->tid = (u16) tx_ba_tsr_tbl->tid; rx_reo_tbl->tid = (u16) tx_ba_tsr_tbl->tid;
dev_dbg(priv->adapter->dev, "data: %s tid=%d\n", mwifiex_dbg(priv->adapter, DATA, "data: %s tid=%d\n",
__func__, rx_reo_tbl->tid); __func__, rx_reo_tbl->tid);
memcpy(rx_reo_tbl->ra, tx_ba_tsr_tbl->ra, ETH_ALEN); memcpy(rx_reo_tbl->ra, tx_ba_tsr_tbl->ra, ETH_ALEN);
rx_reo_tbl->amsdu = tx_ba_tsr_tbl->amsdu; rx_reo_tbl->amsdu = tx_ba_tsr_tbl->amsdu;
rx_reo_tbl++; rx_reo_tbl++;

View File

@ -187,7 +187,6 @@ mwifiex_11n_aggregate_pkt(struct mwifiex_private *priv,
skb_aggr = mwifiex_alloc_dma_align_buf(adapter->tx_buf_size, skb_aggr = mwifiex_alloc_dma_align_buf(adapter->tx_buf_size,
GFP_ATOMIC | GFP_DMA); GFP_ATOMIC | GFP_DMA);
if (!skb_aggr) { if (!skb_aggr) {
dev_err(adapter->dev, "%s: alloc skb_aggr\n", __func__);
spin_unlock_irqrestore(&priv->wmm.ra_list_spinlock, spin_unlock_irqrestore(&priv->wmm.ra_list_spinlock,
ra_list_flags); ra_list_flags);
return -1; return -1;
@ -297,13 +296,13 @@ mwifiex_11n_aggregate_pkt(struct mwifiex_private *priv,
tx_info_aggr->flags |= MWIFIEX_BUF_FLAG_REQUEUED_PKT; tx_info_aggr->flags |= MWIFIEX_BUF_FLAG_REQUEUED_PKT;
spin_unlock_irqrestore(&priv->wmm.ra_list_spinlock, spin_unlock_irqrestore(&priv->wmm.ra_list_spinlock,
ra_list_flags); ra_list_flags);
dev_dbg(adapter->dev, "data: -EBUSY is returned\n"); mwifiex_dbg(adapter, ERROR, "data: -EBUSY is returned\n");
break; break;
case -1: case -1:
if (adapter->iface_type != MWIFIEX_PCIE) if (adapter->iface_type != MWIFIEX_PCIE)
adapter->data_sent = false; adapter->data_sent = false;
dev_err(adapter->dev, "%s: host_to_card failed: %#x\n", mwifiex_dbg(adapter, ERROR, "%s: host_to_card failed: %#x\n",
__func__, ret); __func__, ret);
adapter->dbg.num_tx_host_to_card_failure++; adapter->dbg.num_tx_host_to_card_failure++;
mwifiex_write_data_complete(adapter, skb_aggr, 1, ret); mwifiex_write_data_complete(adapter, skb_aggr, 1, ret);
return 0; return 0;

View File

@ -51,8 +51,8 @@ static int mwifiex_11n_dispatch_amsdu_pkt(struct mwifiex_private *priv,
rx_skb = __skb_dequeue(&list); rx_skb = __skb_dequeue(&list);
ret = mwifiex_recv_packet(priv, rx_skb); ret = mwifiex_recv_packet(priv, rx_skb);
if (ret == -1) if (ret == -1)
dev_err(priv->adapter->dev, mwifiex_dbg(priv->adapter, ERROR,
"Rx of A-MSDU failed"); "Rx of A-MSDU failed");
} }
return 0; return 0;
} }
@ -304,7 +304,7 @@ mwifiex_flush_data(unsigned long context)
if (seq_num < 0) if (seq_num < 0)
return; return;
dev_dbg(ctx->priv->adapter->dev, "info: flush data %d\n", seq_num); mwifiex_dbg(ctx->priv->adapter, INFO, "info: flush data %d\n", seq_num);
start_win = (ctx->ptr->start_win + seq_num + 1) & (MAX_TID_VALUE - 1); start_win = (ctx->ptr->start_win + seq_num + 1) & (MAX_TID_VALUE - 1);
mwifiex_11n_dispatch_pkt_until_start_win(ctx->priv, ctx->ptr, mwifiex_11n_dispatch_pkt_until_start_win(ctx->priv, ctx->ptr,
start_win); start_win);
@ -367,8 +367,9 @@ mwifiex_11n_create_rx_reorder_tbl(struct mwifiex_private *priv, u8 *ta,
} }
spin_unlock_irqrestore(&priv->sta_list_spinlock, flags); spin_unlock_irqrestore(&priv->sta_list_spinlock, flags);
dev_dbg(priv->adapter->dev, "info: last_seq=%d start_win=%d\n", mwifiex_dbg(priv->adapter, INFO,
last_seq, new_node->start_win); "info: last_seq=%d start_win=%d\n",
last_seq, new_node->start_win);
if (last_seq != MWIFIEX_DEF_11N_RX_SEQ_NUM && if (last_seq != MWIFIEX_DEF_11N_RX_SEQ_NUM &&
last_seq >= new_node->start_win) { last_seq >= new_node->start_win) {
@ -382,8 +383,8 @@ mwifiex_11n_create_rx_reorder_tbl(struct mwifiex_private *priv, u8 *ta,
GFP_KERNEL); GFP_KERNEL);
if (!new_node->rx_reorder_ptr) { if (!new_node->rx_reorder_ptr) {
kfree((u8 *) new_node); kfree((u8 *) new_node);
dev_err(priv->adapter->dev, mwifiex_dbg(priv->adapter, ERROR,
"%s: failed to alloc reorder_ptr\n", __func__); "%s: failed to alloc reorder_ptr\n", __func__);
return; return;
} }
@ -467,9 +468,9 @@ int mwifiex_cmd_11n_addba_rsp_gen(struct mwifiex_private *priv,
cmd_addba_req->peer_mac_addr); cmd_addba_req->peer_mac_addr);
if (!sta_ptr) { if (!sta_ptr) {
spin_unlock_irqrestore(&priv->sta_list_spinlock, flags); spin_unlock_irqrestore(&priv->sta_list_spinlock, flags);
dev_warn(priv->adapter->dev, mwifiex_dbg(priv->adapter, ERROR,
"BA setup with unknown TDLS peer %pM!\n", "BA setup with unknown TDLS peer %pM!\n",
cmd_addba_req->peer_mac_addr); cmd_addba_req->peer_mac_addr);
return -1; return -1;
} }
if (sta_ptr->is_11ac_enabled) if (sta_ptr->is_11ac_enabled)
@ -573,14 +574,14 @@ int mwifiex_11n_rx_reorder_pkt(struct mwifiex_private *priv,
} }
if (tbl->flags & RXREOR_FORCE_NO_DROP) { if (tbl->flags & RXREOR_FORCE_NO_DROP) {
dev_dbg(priv->adapter->dev, mwifiex_dbg(priv->adapter, INFO,
"RXREOR_FORCE_NO_DROP when HS is activated\n"); "RXREOR_FORCE_NO_DROP when HS is activated\n");
tbl->flags &= ~RXREOR_FORCE_NO_DROP; tbl->flags &= ~RXREOR_FORCE_NO_DROP;
} else if (init_window_shift && seq_num < start_win && } else if (init_window_shift && seq_num < start_win &&
seq_num >= tbl->init_win) { seq_num >= tbl->init_win) {
dev_dbg(priv->adapter->dev, mwifiex_dbg(priv->adapter, INFO,
"Sender TID sequence number reset %d->%d for SSN %d\n", "Sender TID sequence number reset %d->%d for SSN %d\n",
start_win, seq_num, tbl->init_win); start_win, seq_num, tbl->init_win);
tbl->start_win = start_win = seq_num; tbl->start_win = start_win = seq_num;
end_win = ((start_win + win_size) - 1) & (MAX_TID_VALUE - 1); end_win = ((start_win + win_size) - 1) & (MAX_TID_VALUE - 1);
} else { } else {
@ -668,23 +669,23 @@ mwifiex_del_ba_tbl(struct mwifiex_private *priv, int tid, u8 *peer_mac,
else else
cleanup_rx_reorder_tbl = (initiator) ? false : true; cleanup_rx_reorder_tbl = (initiator) ? false : true;
dev_dbg(priv->adapter->dev, "event: DELBA: %pM tid=%d initiator=%d\n", mwifiex_dbg(priv->adapter, EVENT, "event: DELBA: %pM tid=%d initiator=%d\n",
peer_mac, tid, initiator); peer_mac, tid, initiator);
if (cleanup_rx_reorder_tbl) { if (cleanup_rx_reorder_tbl) {
tbl = mwifiex_11n_get_rx_reorder_tbl(priv, tid, tbl = mwifiex_11n_get_rx_reorder_tbl(priv, tid,
peer_mac); peer_mac);
if (!tbl) { if (!tbl) {
dev_dbg(priv->adapter->dev, mwifiex_dbg(priv->adapter, EVENT,
"event: TID, TA not found in table\n"); "event: TID, TA not found in table\n");
return; return;
} }
mwifiex_del_rx_reorder_entry(priv, tbl); mwifiex_del_rx_reorder_entry(priv, tbl);
} else { } else {
ptx_tbl = mwifiex_get_ba_tbl(priv, tid, peer_mac); ptx_tbl = mwifiex_get_ba_tbl(priv, tid, peer_mac);
if (!ptx_tbl) { if (!ptx_tbl) {
dev_dbg(priv->adapter->dev, mwifiex_dbg(priv->adapter, EVENT,
"event: TID, RA not found in table\n"); "event: TID, RA not found in table\n");
return; return;
} }
ra_list = mwifiex_wmm_get_ralist_node(priv, tid, peer_mac); ra_list = mwifiex_wmm_get_ralist_node(priv, tid, peer_mac);
@ -721,8 +722,8 @@ int mwifiex_ret_11n_addba_resp(struct mwifiex_private *priv,
* the stream * the stream
*/ */
if (le16_to_cpu(add_ba_rsp->status_code) != BA_RESULT_SUCCESS) { if (le16_to_cpu(add_ba_rsp->status_code) != BA_RESULT_SUCCESS) {
dev_err(priv->adapter->dev, "ADDBA RSP: failed %pM tid=%d)\n", mwifiex_dbg(priv->adapter, ERROR, "ADDBA RSP: failed %pM tid=%d)\n",
add_ba_rsp->peer_mac_addr, tid); add_ba_rsp->peer_mac_addr, tid);
tbl = mwifiex_11n_get_rx_reorder_tbl(priv, tid, tbl = mwifiex_11n_get_rx_reorder_tbl(priv, tid,
add_ba_rsp->peer_mac_addr); add_ba_rsp->peer_mac_addr);
@ -746,8 +747,8 @@ int mwifiex_ret_11n_addba_resp(struct mwifiex_private *priv,
tbl->amsdu = false; tbl->amsdu = false;
} }
dev_dbg(priv->adapter->dev, mwifiex_dbg(priv->adapter, CMD,
"cmd: ADDBA RSP: %pM tid=%d ssn=%d win_size=%d\n", "cmd: ADDBA RSP: %pM tid=%d ssn=%d win_size=%d\n",
add_ba_rsp->peer_mac_addr, tid, add_ba_rsp->ssn, win_size); add_ba_rsp->peer_mac_addr, tid, add_ba_rsp->ssn, win_size);
return 0; return 0;

File diff suppressed because it is too large Load Diff

View File

@ -327,8 +327,9 @@ mwifiex_get_cfp(struct mwifiex_private *priv, u8 band, u16 channel, u32 freq)
sband = priv->wdev.wiphy->bands[IEEE80211_BAND_5GHZ]; sband = priv->wdev.wiphy->bands[IEEE80211_BAND_5GHZ];
if (!sband) { if (!sband) {
dev_err(priv->adapter->dev, "%s: cannot find cfp by band %d\n", mwifiex_dbg(priv->adapter, ERROR,
__func__, band); "%s: cannot find cfp by band %d\n",
__func__, band);
return cfp; return cfp;
} }
@ -349,9 +350,10 @@ mwifiex_get_cfp(struct mwifiex_private *priv, u8 band, u16 channel, u32 freq)
} }
} }
if (i == sband->n_channels) { if (i == sband->n_channels) {
dev_err(priv->adapter->dev, "%s: cannot find cfp by band %d" mwifiex_dbg(priv->adapter, ERROR,
" & channel=%d freq=%d\n", __func__, band, channel, "%s: cannot find cfp by band %d\t"
freq); "& channel=%d freq=%d\n",
__func__, band, channel, freq);
} else { } else {
if (!ch) if (!ch)
return cfp; return cfp;
@ -431,15 +433,17 @@ u32 mwifiex_get_supported_rates(struct mwifiex_private *priv, u8 *rates)
priv->bss_mode == NL80211_IFTYPE_P2P_CLIENT) { priv->bss_mode == NL80211_IFTYPE_P2P_CLIENT) {
switch (adapter->config_bands) { switch (adapter->config_bands) {
case BAND_B: case BAND_B:
dev_dbg(adapter->dev, "info: infra band=%d " mwifiex_dbg(adapter, INFO, "info: infra band=%d\t"
"supported_rates_b\n", adapter->config_bands); "supported_rates_b\n",
adapter->config_bands);
k = mwifiex_copy_rates(rates, k, supported_rates_b, k = mwifiex_copy_rates(rates, k, supported_rates_b,
sizeof(supported_rates_b)); sizeof(supported_rates_b));
break; break;
case BAND_G: case BAND_G:
case BAND_G | BAND_GN: case BAND_G | BAND_GN:
dev_dbg(adapter->dev, "info: infra band=%d " mwifiex_dbg(adapter, INFO, "info: infra band=%d\t"
"supported_rates_g\n", adapter->config_bands); "supported_rates_g\n",
adapter->config_bands);
k = mwifiex_copy_rates(rates, k, supported_rates_g, k = mwifiex_copy_rates(rates, k, supported_rates_g,
sizeof(supported_rates_g)); sizeof(supported_rates_g));
break; break;
@ -449,15 +453,17 @@ u32 mwifiex_get_supported_rates(struct mwifiex_private *priv, u8 *rates)
case BAND_A | BAND_B | BAND_G | BAND_GN | BAND_AN: case BAND_A | BAND_B | BAND_G | BAND_GN | BAND_AN:
case BAND_A | BAND_B | BAND_G | BAND_GN | BAND_AN | BAND_AAC: case BAND_A | BAND_B | BAND_G | BAND_GN | BAND_AN | BAND_AAC:
case BAND_B | BAND_G | BAND_GN: case BAND_B | BAND_G | BAND_GN:
dev_dbg(adapter->dev, "info: infra band=%d " mwifiex_dbg(adapter, INFO, "info: infra band=%d\t"
"supported_rates_bg\n", adapter->config_bands); "supported_rates_bg\n",
adapter->config_bands);
k = mwifiex_copy_rates(rates, k, supported_rates_bg, k = mwifiex_copy_rates(rates, k, supported_rates_bg,
sizeof(supported_rates_bg)); sizeof(supported_rates_bg));
break; break;
case BAND_A: case BAND_A:
case BAND_A | BAND_G: case BAND_A | BAND_G:
dev_dbg(adapter->dev, "info: infra band=%d " mwifiex_dbg(adapter, INFO, "info: infra band=%d\t"
"supported_rates_a\n", adapter->config_bands); "supported_rates_a\n",
adapter->config_bands);
k = mwifiex_copy_rates(rates, k, supported_rates_a, k = mwifiex_copy_rates(rates, k, supported_rates_a,
sizeof(supported_rates_a)); sizeof(supported_rates_a));
break; break;
@ -466,14 +472,16 @@ u32 mwifiex_get_supported_rates(struct mwifiex_private *priv, u8 *rates)
case BAND_A | BAND_AN | BAND_AAC: case BAND_A | BAND_AN | BAND_AAC:
case BAND_A | BAND_G | BAND_AN | BAND_GN: case BAND_A | BAND_G | BAND_AN | BAND_GN:
case BAND_A | BAND_G | BAND_AN | BAND_GN | BAND_AAC: case BAND_A | BAND_G | BAND_AN | BAND_GN | BAND_AAC:
dev_dbg(adapter->dev, "info: infra band=%d " mwifiex_dbg(adapter, INFO, "info: infra band=%d\t"
"supported_rates_a\n", adapter->config_bands); "supported_rates_a\n",
adapter->config_bands);
k = mwifiex_copy_rates(rates, k, supported_rates_a, k = mwifiex_copy_rates(rates, k, supported_rates_a,
sizeof(supported_rates_a)); sizeof(supported_rates_a));
break; break;
case BAND_GN: case BAND_GN:
dev_dbg(adapter->dev, "info: infra band=%d " mwifiex_dbg(adapter, INFO, "info: infra band=%d\t"
"supported_rates_n\n", adapter->config_bands); "supported_rates_n\n",
adapter->config_bands);
k = mwifiex_copy_rates(rates, k, supported_rates_n, k = mwifiex_copy_rates(rates, k, supported_rates_n,
sizeof(supported_rates_n)); sizeof(supported_rates_n));
break; break;
@ -482,25 +490,25 @@ u32 mwifiex_get_supported_rates(struct mwifiex_private *priv, u8 *rates)
/* Ad-hoc mode */ /* Ad-hoc mode */
switch (adapter->adhoc_start_band) { switch (adapter->adhoc_start_band) {
case BAND_B: case BAND_B:
dev_dbg(adapter->dev, "info: adhoc B\n"); mwifiex_dbg(adapter, INFO, "info: adhoc B\n");
k = mwifiex_copy_rates(rates, k, adhoc_rates_b, k = mwifiex_copy_rates(rates, k, adhoc_rates_b,
sizeof(adhoc_rates_b)); sizeof(adhoc_rates_b));
break; break;
case BAND_G: case BAND_G:
case BAND_G | BAND_GN: case BAND_G | BAND_GN:
dev_dbg(adapter->dev, "info: adhoc G only\n"); mwifiex_dbg(adapter, INFO, "info: adhoc G only\n");
k = mwifiex_copy_rates(rates, k, adhoc_rates_g, k = mwifiex_copy_rates(rates, k, adhoc_rates_g,
sizeof(adhoc_rates_g)); sizeof(adhoc_rates_g));
break; break;
case BAND_B | BAND_G: case BAND_B | BAND_G:
case BAND_B | BAND_G | BAND_GN: case BAND_B | BAND_G | BAND_GN:
dev_dbg(adapter->dev, "info: adhoc BG\n"); mwifiex_dbg(adapter, INFO, "info: adhoc BG\n");
k = mwifiex_copy_rates(rates, k, adhoc_rates_bg, k = mwifiex_copy_rates(rates, k, adhoc_rates_bg,
sizeof(adhoc_rates_bg)); sizeof(adhoc_rates_bg));
break; break;
case BAND_A: case BAND_A:
case BAND_A | BAND_AN: case BAND_A | BAND_AN:
dev_dbg(adapter->dev, "info: adhoc A\n"); mwifiex_dbg(adapter, INFO, "info: adhoc A\n");
k = mwifiex_copy_rates(rates, k, adhoc_rates_a, k = mwifiex_copy_rates(rates, k, adhoc_rates_a,
sizeof(adhoc_rates_a)); sizeof(adhoc_rates_a));
break; break;

View File

@ -62,7 +62,8 @@ mwifiex_get_cmd_node(struct mwifiex_adapter *adapter)
spin_lock_irqsave(&adapter->cmd_free_q_lock, flags); spin_lock_irqsave(&adapter->cmd_free_q_lock, flags);
if (list_empty(&adapter->cmd_free_q)) { if (list_empty(&adapter->cmd_free_q)) {
dev_err(adapter->dev, "GET_CMD_NODE: cmd node not available\n"); mwifiex_dbg(adapter, ERROR,
"GET_CMD_NODE: cmd node not available\n");
spin_unlock_irqrestore(&adapter->cmd_free_q_lock, flags); spin_unlock_irqrestore(&adapter->cmd_free_q_lock, flags);
return NULL; return NULL;
} }
@ -116,7 +117,8 @@ static int mwifiex_cmd_host_cmd(struct mwifiex_private *priv,
{ {
/* Copy the HOST command to command buffer */ /* Copy the HOST command to command buffer */
memcpy(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); mwifiex_dbg(priv->adapter, CMD,
"cmd: host cmd size = %d\n", pcmd_ptr->len);
return 0; return 0;
} }
@ -147,8 +149,9 @@ static int mwifiex_dnld_cmd_to_fw(struct mwifiex_private *priv,
/* Sanity test */ /* Sanity test */
if (host_cmd == NULL || host_cmd->size == 0) { if (host_cmd == NULL || host_cmd->size == 0) {
dev_err(adapter->dev, "DNLD_CMD: host_cmd is null" mwifiex_dbg(adapter, ERROR,
" or cmd size is 0, not sending\n"); "DNLD_CMD: host_cmd is null\t"
"or cmd size is 0, not sending\n");
if (cmd_node->wait_q_enabled) if (cmd_node->wait_q_enabled)
adapter->cmd_wait_q.status = -1; adapter->cmd_wait_q.status = -1;
mwifiex_recycle_cmd_node(adapter, cmd_node); mwifiex_recycle_cmd_node(adapter, cmd_node);
@ -161,8 +164,8 @@ static int mwifiex_dnld_cmd_to_fw(struct mwifiex_private *priv,
if (adapter->hw_status == MWIFIEX_HW_STATUS_RESET && if (adapter->hw_status == MWIFIEX_HW_STATUS_RESET &&
cmd_code != HostCmd_CMD_FUNC_SHUTDOWN && cmd_code != HostCmd_CMD_FUNC_SHUTDOWN &&
cmd_code != HostCmd_CMD_FUNC_INIT) { cmd_code != HostCmd_CMD_FUNC_INIT) {
dev_err(adapter->dev, mwifiex_dbg(adapter, ERROR,
"DNLD_CMD: FW in reset state, ignore cmd %#x\n", "DNLD_CMD: FW in reset state, ignore cmd %#x\n",
cmd_code); cmd_code);
if (cmd_node->wait_q_enabled) if (cmd_node->wait_q_enabled)
mwifiex_complete_cmd(adapter, cmd_node); mwifiex_complete_cmd(adapter, cmd_node);
@ -197,10 +200,11 @@ static int mwifiex_dnld_cmd_to_fw(struct mwifiex_private *priv,
*/ */
skb_put(cmd_node->cmd_skb, cmd_size - cmd_node->cmd_skb->len); skb_put(cmd_node->cmd_skb, cmd_size - cmd_node->cmd_skb->len);
dev_dbg(adapter->dev, mwifiex_dbg(adapter, CMD,
"cmd: DNLD_CMD: %#x, act %#x, len %d, seqno %#x\n", cmd_code, "cmd: DNLD_CMD: %#x, act %#x, len %d, seqno %#x\n",
le16_to_cpu(*(__le16 *) ((u8 *) host_cmd + S_DS_GEN)), cmd_size, cmd_code,
le16_to_cpu(host_cmd->seq_num)); le16_to_cpu(*(__le16 *)((u8 *)host_cmd + S_DS_GEN)),
cmd_size, le16_to_cpu(host_cmd->seq_num));
mwifiex_dbg_dump(adapter, CMD_D, "cmd buffer:", host_cmd, cmd_size); mwifiex_dbg_dump(adapter, CMD_D, "cmd buffer:", host_cmd, cmd_size);
if (adapter->iface_type == MWIFIEX_USB) { if (adapter->iface_type == MWIFIEX_USB) {
@ -222,7 +226,8 @@ static int mwifiex_dnld_cmd_to_fw(struct mwifiex_private *priv,
} }
if (ret == -1) { if (ret == -1) {
dev_err(adapter->dev, "DNLD_CMD: host to card failed\n"); mwifiex_dbg(adapter, ERROR,
"DNLD_CMD: host to card failed\n");
if (adapter->iface_type == MWIFIEX_USB) if (adapter->iface_type == MWIFIEX_USB)
adapter->cmd_sent = false; adapter->cmd_sent = false;
if (cmd_node->wait_q_enabled) if (cmd_node->wait_q_enabled)
@ -281,8 +286,8 @@ static int mwifiex_dnld_sleep_confirm_cmd(struct mwifiex_adapter *adapter)
(adapter->seq_num, priv->bss_num, (adapter->seq_num, priv->bss_num,
priv->bss_type))); priv->bss_type)));
dev_dbg(adapter->dev, mwifiex_dbg(adapter, CMD,
"cmd: DNLD_CMD: %#x, act %#x, len %d, seqno %#x\n", "cmd: DNLD_CMD: %#x, act %#x, len %d, seqno %#x\n",
le16_to_cpu(sleep_cfm_buf->command), le16_to_cpu(sleep_cfm_buf->command),
le16_to_cpu(sleep_cfm_buf->action), le16_to_cpu(sleep_cfm_buf->action),
le16_to_cpu(sleep_cfm_buf->size), le16_to_cpu(sleep_cfm_buf->size),
@ -314,7 +319,7 @@ static int mwifiex_dnld_sleep_confirm_cmd(struct mwifiex_adapter *adapter)
} }
if (ret == -1) { if (ret == -1) {
dev_err(adapter->dev, "SLEEP_CFM: failed\n"); mwifiex_dbg(adapter, ERROR, "SLEEP_CFM: failed\n");
adapter->dbg.num_cmd_sleep_cfm_host_to_card_failure++; adapter->dbg.num_cmd_sleep_cfm_host_to_card_failure++;
return -1; return -1;
} }
@ -365,8 +370,8 @@ int mwifiex_alloc_cmd_buffer(struct mwifiex_adapter *adapter)
for (i = 0; i < MWIFIEX_NUM_OF_CMD_BUFFER; i++) { for (i = 0; i < MWIFIEX_NUM_OF_CMD_BUFFER; i++) {
cmd_array[i].skb = dev_alloc_skb(MWIFIEX_SIZE_OF_CMD_BUFFER); cmd_array[i].skb = dev_alloc_skb(MWIFIEX_SIZE_OF_CMD_BUFFER);
if (!cmd_array[i].skb) { if (!cmd_array[i].skb) {
dev_err(adapter->dev, mwifiex_dbg(adapter, ERROR,
"unable to allocate command buffer\n"); "unable to allocate command buffer\n");
return -ENOMEM; return -ENOMEM;
} }
} }
@ -390,7 +395,8 @@ int mwifiex_free_cmd_buffer(struct mwifiex_adapter *adapter)
/* Need to check if cmd pool is allocated or not */ /* Need to check if cmd pool is allocated or not */
if (!adapter->cmd_pool) { if (!adapter->cmd_pool) {
dev_dbg(adapter->dev, "info: FREE_CMD_BUF: cmd_pool is null\n"); mwifiex_dbg(adapter, FATAL,
"info: FREE_CMD_BUF: cmd_pool is null\n");
return 0; return 0;
} }
@ -399,7 +405,8 @@ int mwifiex_free_cmd_buffer(struct mwifiex_adapter *adapter)
/* Release shared memory buffers */ /* Release shared memory buffers */
for (i = 0; i < MWIFIEX_NUM_OF_CMD_BUFFER; i++) { for (i = 0; i < MWIFIEX_NUM_OF_CMD_BUFFER; i++) {
if (cmd_array[i].skb) { if (cmd_array[i].skb) {
dev_dbg(adapter->dev, "cmd: free cmd buffer %d\n", i); mwifiex_dbg(adapter, CMD,
"cmd: free cmd buffer %d\n", i);
dev_kfree_skb_any(cmd_array[i].skb); dev_kfree_skb_any(cmd_array[i].skb);
} }
if (!cmd_array[i].resp_skb) if (!cmd_array[i].resp_skb)
@ -413,7 +420,8 @@ int mwifiex_free_cmd_buffer(struct mwifiex_adapter *adapter)
} }
/* Release struct cmd_ctrl_node */ /* Release struct cmd_ctrl_node */
if (adapter->cmd_pool) { if (adapter->cmd_pool) {
dev_dbg(adapter->dev, "cmd: free cmd pool\n"); mwifiex_dbg(adapter, CMD,
"cmd: free cmd pool\n");
kfree(adapter->cmd_pool); kfree(adapter->cmd_pool);
adapter->cmd_pool = NULL; adapter->cmd_pool = NULL;
} }
@ -463,7 +471,7 @@ int mwifiex_process_event(struct mwifiex_adapter *adapter)
rx_info->bss_type = priv->bss_type; rx_info->bss_type = priv->bss_type;
} }
dev_dbg(adapter->dev, "EVENT: cause: %#x\n", eventcause); mwifiex_dbg(adapter, EVENT, "EVENT: cause: %#x\n", eventcause);
mwifiex_dbg_dump(adapter, EVT_D, "Event Buf:", skb->data, skb->len); mwifiex_dbg_dump(adapter, EVT_D, "Event Buf:", skb->data, skb->len);
if (priv->bss_role == MWIFIEX_BSS_ROLE_UAP) if (priv->bss_role == MWIFIEX_BSS_ROLE_UAP)
@ -503,28 +511,33 @@ int mwifiex_send_cmd(struct mwifiex_private *priv, u16 cmd_no,
} }
if (adapter->is_suspended) { if (adapter->is_suspended) {
dev_err(adapter->dev, "PREP_CMD: device in suspended state\n"); mwifiex_dbg(adapter, ERROR,
"PREP_CMD: device in suspended state\n");
return -1; return -1;
} }
if (adapter->hs_enabling && cmd_no != HostCmd_CMD_802_11_HS_CFG_ENH) { if (adapter->hs_enabling && cmd_no != HostCmd_CMD_802_11_HS_CFG_ENH) {
dev_err(adapter->dev, "PREP_CMD: host entering sleep state\n"); mwifiex_dbg(adapter, ERROR,
"PREP_CMD: host entering sleep state\n");
return -1; return -1;
} }
if (adapter->surprise_removed) { if (adapter->surprise_removed) {
dev_err(adapter->dev, "PREP_CMD: card is removed\n"); mwifiex_dbg(adapter, ERROR,
"PREP_CMD: card is removed\n");
return -1; return -1;
} }
if (adapter->is_cmd_timedout) { if (adapter->is_cmd_timedout) {
dev_err(adapter->dev, "PREP_CMD: FW is in bad state\n"); mwifiex_dbg(adapter, ERROR,
"PREP_CMD: FW is in bad state\n");
return -1; return -1;
} }
if (adapter->hw_status == MWIFIEX_HW_STATUS_RESET) { if (adapter->hw_status == MWIFIEX_HW_STATUS_RESET) {
if (cmd_no != HostCmd_CMD_FUNC_INIT) { if (cmd_no != HostCmd_CMD_FUNC_INIT) {
dev_err(adapter->dev, "PREP_CMD: FW in reset state\n"); mwifiex_dbg(adapter, ERROR,
"PREP_CMD: FW in reset state\n");
return -1; return -1;
} }
} }
@ -533,7 +546,8 @@ int mwifiex_send_cmd(struct mwifiex_private *priv, u16 cmd_no,
cmd_node = mwifiex_get_cmd_node(adapter); cmd_node = mwifiex_get_cmd_node(adapter);
if (!cmd_node) { if (!cmd_node) {
dev_err(adapter->dev, "PREP_CMD: no free cmd node\n"); mwifiex_dbg(adapter, ERROR,
"PREP_CMD: no free cmd node\n");
return -1; return -1;
} }
@ -541,7 +555,8 @@ int mwifiex_send_cmd(struct mwifiex_private *priv, u16 cmd_no,
mwifiex_init_cmd_node(priv, cmd_node, cmd_oid, data_buf, sync); mwifiex_init_cmd_node(priv, cmd_node, cmd_oid, data_buf, sync);
if (!cmd_node->cmd_skb) { if (!cmd_node->cmd_skb) {
dev_err(adapter->dev, "PREP_CMD: no free cmd buf\n"); mwifiex_dbg(adapter, ERROR,
"PREP_CMD: no free cmd buf\n");
return -1; return -1;
} }
@ -576,7 +591,8 @@ int mwifiex_send_cmd(struct mwifiex_private *priv, u16 cmd_no,
/* Return error, since the command preparation failed */ /* Return error, since the command preparation failed */
if (ret) { if (ret) {
dev_err(adapter->dev, "PREP_CMD: cmd %#x preparation failed\n", mwifiex_dbg(adapter, ERROR,
"PREP_CMD: cmd %#x preparation failed\n",
cmd_no); cmd_no);
mwifiex_insert_cmd_to_free_q(adapter, cmd_node); mwifiex_insert_cmd_to_free_q(adapter, cmd_node);
return -1; return -1;
@ -631,7 +647,8 @@ void mwifiex_recycle_cmd_node(struct mwifiex_adapter *adapter,
mwifiex_insert_cmd_to_free_q(adapter, cmd_node); mwifiex_insert_cmd_to_free_q(adapter, cmd_node);
atomic_dec(&adapter->cmd_pending); atomic_dec(&adapter->cmd_pending);
dev_dbg(adapter->dev, "cmd: FREE_CMD: cmd=%#x, cmd_pending=%d\n", mwifiex_dbg(adapter, CMD,
"cmd: FREE_CMD: cmd=%#x, cmd_pending=%d\n",
le16_to_cpu(host_cmd->command), le16_to_cpu(host_cmd->command),
atomic_read(&adapter->cmd_pending)); atomic_read(&adapter->cmd_pending));
} }
@ -653,7 +670,7 @@ mwifiex_insert_cmd_to_pending_q(struct mwifiex_adapter *adapter,
host_cmd = (struct host_cmd_ds_command *) (cmd_node->cmd_skb->data); host_cmd = (struct host_cmd_ds_command *) (cmd_node->cmd_skb->data);
if (!host_cmd) { if (!host_cmd) {
dev_err(adapter->dev, "QUEUE_CMD: host_cmd is NULL\n"); mwifiex_dbg(adapter, ERROR, "QUEUE_CMD: host_cmd is NULL\n");
return; return;
} }
@ -678,7 +695,8 @@ mwifiex_insert_cmd_to_pending_q(struct mwifiex_adapter *adapter,
spin_unlock_irqrestore(&adapter->cmd_pending_q_lock, flags); spin_unlock_irqrestore(&adapter->cmd_pending_q_lock, flags);
atomic_inc(&adapter->cmd_pending); atomic_inc(&adapter->cmd_pending);
dev_dbg(adapter->dev, "cmd: QUEUE_CMD: cmd=%#x, cmd_pending=%d\n", mwifiex_dbg(adapter, CMD,
"cmd: QUEUE_CMD: cmd=%#x, cmd_pending=%d\n",
command, atomic_read(&adapter->cmd_pending)); command, atomic_read(&adapter->cmd_pending));
} }
@ -704,7 +722,8 @@ int mwifiex_exec_next_cmd(struct mwifiex_adapter *adapter)
/* Check if already in processing */ /* Check if already in processing */
if (adapter->curr_cmd) { if (adapter->curr_cmd) {
dev_err(adapter->dev, "EXEC_NEXT_CMD: cmd in processing\n"); mwifiex_dbg(adapter, FATAL,
"EXEC_NEXT_CMD: cmd in processing\n");
return -1; return -1;
} }
@ -726,8 +745,9 @@ int mwifiex_exec_next_cmd(struct mwifiex_adapter *adapter)
priv = cmd_node->priv; priv = cmd_node->priv;
if (adapter->ps_state != PS_STATE_AWAKE) { if (adapter->ps_state != PS_STATE_AWAKE) {
dev_err(adapter->dev, "%s: cannot send cmd in sleep state," mwifiex_dbg(adapter, ERROR,
" this should not happen\n", __func__); "%s: cannot send cmd in sleep state,\t"
"this should not happen\n", __func__);
spin_unlock_irqrestore(&adapter->mwifiex_cmd_lock, cmd_flags); spin_unlock_irqrestore(&adapter->mwifiex_cmd_lock, cmd_flags);
return ret; return ret;
} }
@ -777,8 +797,9 @@ int mwifiex_process_cmdresp(struct mwifiex_adapter *adapter)
if (!adapter->curr_cmd || !adapter->curr_cmd->resp_skb) { if (!adapter->curr_cmd || !adapter->curr_cmd->resp_skb) {
resp = (struct host_cmd_ds_command *) adapter->upld_buf; resp = (struct host_cmd_ds_command *) adapter->upld_buf;
dev_err(adapter->dev, "CMD_RESP: NULL curr_cmd, %#x\n", mwifiex_dbg(adapter, ERROR,
le16_to_cpu(resp->command)); "CMD_RESP: NULL curr_cmd, %#x\n",
le16_to_cpu(resp->command));
return -1; return -1;
} }
@ -786,8 +807,9 @@ int mwifiex_process_cmdresp(struct mwifiex_adapter *adapter)
resp = (struct host_cmd_ds_command *) adapter->curr_cmd->resp_skb->data; resp = (struct host_cmd_ds_command *) adapter->curr_cmd->resp_skb->data;
if (adapter->curr_cmd->cmd_flag & CMD_F_CANCELED) { if (adapter->curr_cmd->cmd_flag & CMD_F_CANCELED) {
dev_err(adapter->dev, "CMD_RESP: %#x been canceled\n", mwifiex_dbg(adapter, ERROR,
le16_to_cpu(resp->command)); "CMD_RESP: %#x been canceled\n",
le16_to_cpu(resp->command));
mwifiex_recycle_cmd_node(adapter, adapter->curr_cmd); mwifiex_recycle_cmd_node(adapter, adapter->curr_cmd);
spin_lock_irqsave(&adapter->mwifiex_cmd_lock, flags); spin_lock_irqsave(&adapter->mwifiex_cmd_lock, flags);
adapter->curr_cmd = NULL; adapter->curr_cmd = NULL;
@ -799,7 +821,8 @@ int mwifiex_process_cmdresp(struct mwifiex_adapter *adapter)
/* Copy original response back to response buffer */ /* Copy original response back to response buffer */
struct mwifiex_ds_misc_cmd *hostcmd; struct mwifiex_ds_misc_cmd *hostcmd;
uint16_t size = le16_to_cpu(resp->size); uint16_t size = le16_to_cpu(resp->size);
dev_dbg(adapter->dev, "info: host cmd resp size = %d\n", size); mwifiex_dbg(adapter, INFO,
"info: host cmd resp size = %d\n", size);
size = min_t(u16, size, MWIFIEX_SIZE_OF_CMD_BUFFER); size = min_t(u16, size, MWIFIEX_SIZE_OF_CMD_BUFFER);
if (adapter->curr_cmd->data_buf) { if (adapter->curr_cmd->data_buf) {
hostcmd = adapter->curr_cmd->data_buf; hostcmd = adapter->curr_cmd->data_buf;
@ -827,15 +850,15 @@ int mwifiex_process_cmdresp(struct mwifiex_adapter *adapter)
adapter->dbg.last_cmd_resp_id[adapter->dbg.last_cmd_resp_index] = adapter->dbg.last_cmd_resp_id[adapter->dbg.last_cmd_resp_index] =
orig_cmdresp_no; orig_cmdresp_no;
dev_dbg(adapter->dev, mwifiex_dbg(adapter, CMD,
"cmd: CMD_RESP: 0x%x, result %d, len %d, seqno 0x%x\n", "cmd: CMD_RESP: 0x%x, result %d, len %d, seqno 0x%x\n",
orig_cmdresp_no, cmdresp_result, orig_cmdresp_no, cmdresp_result,
le16_to_cpu(resp->size), le16_to_cpu(resp->seq_num)); le16_to_cpu(resp->size), le16_to_cpu(resp->seq_num));
mwifiex_dbg_dump(adapter, CMD_D, "CMD_RESP buffer:", resp, mwifiex_dbg_dump(adapter, CMD_D, "CMD_RESP buffer:", resp,
le16_to_cpu(resp->size)); le16_to_cpu(resp->size));
if (!(orig_cmdresp_no & HostCmd_RET_BIT)) { if (!(orig_cmdresp_no & HostCmd_RET_BIT)) {
dev_err(adapter->dev, "CMD_RESP: invalid cmd resp\n"); mwifiex_dbg(adapter, ERROR, "CMD_RESP: invalid cmd resp\n");
if (adapter->curr_cmd->wait_q_enabled) if (adapter->curr_cmd->wait_q_enabled)
adapter->cmd_wait_q.status = -1; adapter->cmd_wait_q.status = -1;
@ -859,8 +882,9 @@ int mwifiex_process_cmdresp(struct mwifiex_adapter *adapter)
/* Check init command response */ /* Check init command response */
if (adapter->hw_status == MWIFIEX_HW_STATUS_INITIALIZING) { if (adapter->hw_status == MWIFIEX_HW_STATUS_INITIALIZING) {
if (ret) { if (ret) {
dev_err(adapter->dev, "%s: cmd %#x failed during " mwifiex_dbg(adapter, ERROR,
"initialization\n", __func__, cmdresp_no); "%s: cmd %#x failed during\t"
"initialization\n", __func__, cmdresp_no);
mwifiex_init_fw_complete(adapter); mwifiex_init_fw_complete(adapter);
return -1; return -1;
} else if (adapter->last_init_cmd == cmdresp_no) } else if (adapter->last_init_cmd == cmdresp_no)
@ -895,7 +919,8 @@ mwifiex_cmd_timeout_func(unsigned long function_context)
adapter->is_cmd_timedout = 1; adapter->is_cmd_timedout = 1;
if (!adapter->curr_cmd) { if (!adapter->curr_cmd) {
dev_dbg(adapter->dev, "cmd: empty curr_cmd\n"); mwifiex_dbg(adapter, ERROR,
"cmd: empty curr_cmd\n");
return; return;
} }
cmd_node = adapter->curr_cmd; cmd_node = adapter->curr_cmd;
@ -904,47 +929,60 @@ mwifiex_cmd_timeout_func(unsigned long function_context)
adapter->dbg.last_cmd_id[adapter->dbg.last_cmd_index]; adapter->dbg.last_cmd_id[adapter->dbg.last_cmd_index];
adapter->dbg.timeout_cmd_act = adapter->dbg.timeout_cmd_act =
adapter->dbg.last_cmd_act[adapter->dbg.last_cmd_index]; adapter->dbg.last_cmd_act[adapter->dbg.last_cmd_index];
dev_err(adapter->dev, mwifiex_dbg(adapter, MSG,
"%s: Timeout cmd id = %#x, act = %#x\n", __func__, "%s: Timeout cmd id = %#x, act = %#x\n", __func__,
adapter->dbg.timeout_cmd_id, adapter->dbg.timeout_cmd_id,
adapter->dbg.timeout_cmd_act); adapter->dbg.timeout_cmd_act);
dev_err(adapter->dev, "num_data_h2c_failure = %d\n", mwifiex_dbg(adapter, MSG,
adapter->dbg.num_tx_host_to_card_failure); "num_data_h2c_failure = %d\n",
dev_err(adapter->dev, "num_cmd_h2c_failure = %d\n", adapter->dbg.num_tx_host_to_card_failure);
adapter->dbg.num_cmd_host_to_card_failure); mwifiex_dbg(adapter, MSG,
"num_cmd_h2c_failure = %d\n",
adapter->dbg.num_cmd_host_to_card_failure);
dev_err(adapter->dev, "is_cmd_timedout = %d\n", mwifiex_dbg(adapter, MSG,
adapter->is_cmd_timedout); "is_cmd_timedout = %d\n",
dev_err(adapter->dev, "num_tx_timeout = %d\n", adapter->is_cmd_timedout);
adapter->dbg.num_tx_timeout); mwifiex_dbg(adapter, MSG,
"num_tx_timeout = %d\n",
adapter->dbg.num_tx_timeout);
dev_err(adapter->dev, "last_cmd_index = %d\n", mwifiex_dbg(adapter, MSG,
adapter->dbg.last_cmd_index); "last_cmd_index = %d\n",
dev_err(adapter->dev, "last_cmd_id: %*ph\n", adapter->dbg.last_cmd_index);
(int)sizeof(adapter->dbg.last_cmd_id), mwifiex_dbg(adapter, MSG,
adapter->dbg.last_cmd_id); "last_cmd_id: %*ph\n",
dev_err(adapter->dev, "last_cmd_act: %*ph\n", (int)sizeof(adapter->dbg.last_cmd_id),
(int)sizeof(adapter->dbg.last_cmd_act), adapter->dbg.last_cmd_id);
adapter->dbg.last_cmd_act); mwifiex_dbg(adapter, MSG,
"last_cmd_act: %*ph\n",
(int)sizeof(adapter->dbg.last_cmd_act),
adapter->dbg.last_cmd_act);
dev_err(adapter->dev, "last_cmd_resp_index = %d\n", mwifiex_dbg(adapter, MSG,
adapter->dbg.last_cmd_resp_index); "last_cmd_resp_index = %d\n",
dev_err(adapter->dev, "last_cmd_resp_id: %*ph\n", adapter->dbg.last_cmd_resp_index);
(int)sizeof(adapter->dbg.last_cmd_resp_id), mwifiex_dbg(adapter, MSG,
adapter->dbg.last_cmd_resp_id); "last_cmd_resp_id: %*ph\n",
(int)sizeof(adapter->dbg.last_cmd_resp_id),
adapter->dbg.last_cmd_resp_id);
dev_err(adapter->dev, "last_event_index = %d\n", mwifiex_dbg(adapter, MSG,
adapter->dbg.last_event_index); "last_event_index = %d\n",
dev_err(adapter->dev, "last_event: %*ph\n", adapter->dbg.last_event_index);
(int)sizeof(adapter->dbg.last_event), mwifiex_dbg(adapter, MSG,
adapter->dbg.last_event); "last_event: %*ph\n",
(int)sizeof(adapter->dbg.last_event),
adapter->dbg.last_event);
dev_err(adapter->dev, "data_sent=%d cmd_sent=%d\n", mwifiex_dbg(adapter, MSG,
adapter->data_sent, adapter->cmd_sent); "data_sent=%d cmd_sent=%d\n",
adapter->data_sent, adapter->cmd_sent);
dev_err(adapter->dev, "ps_mode=%d ps_state=%d\n", mwifiex_dbg(adapter, MSG,
adapter->ps_mode, adapter->ps_state); "ps_mode=%d ps_state=%d\n",
adapter->ps_mode, adapter->ps_state);
if (cmd_node->wait_q_enabled) { if (cmd_node->wait_q_enabled) {
adapter->cmd_wait_q.status = -ETIMEDOUT; adapter->cmd_wait_q.status = -ETIMEDOUT;
@ -1022,7 +1060,7 @@ mwifiex_cancel_all_pending_cmd(struct mwifiex_adapter *adapter)
if (!priv) if (!priv)
continue; continue;
if (priv->scan_request) { if (priv->scan_request) {
dev_dbg(adapter->dev, "info: aborting scan\n"); mwifiex_dbg(adapter, WARN, "info: aborting scan\n");
cfg80211_scan_done(priv->scan_request, 1); cfg80211_scan_done(priv->scan_request, 1);
priv->scan_request = NULL; priv->scan_request = NULL;
} }
@ -1082,7 +1120,7 @@ mwifiex_cancel_pending_ioctl(struct mwifiex_adapter *adapter)
if (!priv) if (!priv)
continue; continue;
if (priv->scan_request) { if (priv->scan_request) {
dev_dbg(adapter->dev, "info: aborting scan\n"); mwifiex_dbg(adapter, WARN, "info: aborting scan\n");
cfg80211_scan_done(priv->scan_request, 1); cfg80211_scan_done(priv->scan_request, 1);
priv->scan_request = NULL; priv->scan_request = NULL;
} }
@ -1107,11 +1145,11 @@ mwifiex_check_ps_cond(struct mwifiex_adapter *adapter)
!adapter->curr_cmd && !IS_CARD_RX_RCVD(adapter)) !adapter->curr_cmd && !IS_CARD_RX_RCVD(adapter))
mwifiex_dnld_sleep_confirm_cmd(adapter); mwifiex_dnld_sleep_confirm_cmd(adapter);
else else
dev_dbg(adapter->dev, mwifiex_dbg(adapter, CMD,
"cmd: Delay Sleep Confirm (%s%s%s)\n", "cmd: Delay Sleep Confirm (%s%s%s)\n",
(adapter->cmd_sent) ? "D" : "", (adapter->cmd_sent) ? "D" : "",
(adapter->curr_cmd) ? "C" : "", (adapter->curr_cmd) ? "C" : "",
(IS_CARD_RX_RCVD(adapter)) ? "R" : ""); (IS_CARD_RX_RCVD(adapter)) ? "R" : "");
} }
/* /*
@ -1127,15 +1165,18 @@ mwifiex_hs_activated_event(struct mwifiex_private *priv, u8 activated)
priv->adapter->hs_activated = true; priv->adapter->hs_activated = true;
mwifiex_update_rxreor_flags(priv->adapter, mwifiex_update_rxreor_flags(priv->adapter,
RXREOR_FORCE_NO_DROP); RXREOR_FORCE_NO_DROP);
dev_dbg(priv->adapter->dev, "event: hs_activated\n"); mwifiex_dbg(priv->adapter, EVENT,
"event: hs_activated\n");
priv->adapter->hs_activate_wait_q_woken = true; priv->adapter->hs_activate_wait_q_woken = true;
wake_up_interruptible( wake_up_interruptible(
&priv->adapter->hs_activate_wait_q); &priv->adapter->hs_activate_wait_q);
} else { } else {
dev_dbg(priv->adapter->dev, "event: HS not configured\n"); mwifiex_dbg(priv->adapter, EVENT,
"event: HS not configured\n");
} }
} else { } else {
dev_dbg(priv->adapter->dev, "event: hs_deactivated\n"); mwifiex_dbg(priv->adapter, EVENT,
"event: hs_deactivated\n");
priv->adapter->hs_activated = false; priv->adapter->hs_activated = false;
} }
} }
@ -1163,11 +1204,12 @@ int mwifiex_ret_802_11_hs_cfg(struct mwifiex_private *priv,
mwifiex_hs_activated_event(priv, true); mwifiex_hs_activated_event(priv, true);
return 0; return 0;
} else { } else {
dev_dbg(adapter->dev, "cmd: CMD_RESP: HS_CFG cmd reply" mwifiex_dbg(adapter, CMD,
" result=%#x, conditions=0x%x gpio=0x%x gap=0x%x\n", "cmd: CMD_RESP: HS_CFG cmd reply\t"
resp->result, conditions, " result=%#x, conditions=0x%x gpio=0x%x gap=0x%x\n",
phs_cfg->params.hs_config.gpio, resp->result, conditions,
phs_cfg->params.hs_config.gap); phs_cfg->params.hs_config.gpio,
phs_cfg->params.hs_config.gap);
} }
if (conditions != HS_CFG_CANCEL) { if (conditions != HS_CFG_CANCEL) {
adapter->is_hs_configured = true; adapter->is_hs_configured = true;
@ -1189,8 +1231,10 @@ int mwifiex_ret_802_11_hs_cfg(struct mwifiex_private *priv,
void void
mwifiex_process_hs_config(struct mwifiex_adapter *adapter) mwifiex_process_hs_config(struct mwifiex_adapter *adapter)
{ {
dev_dbg(adapter->dev, "info: %s: auto cancelling host sleep" mwifiex_dbg(adapter, INFO,
" since there is interrupt from the firmware\n", __func__); "info: %s: auto cancelling host sleep\t"
"since there is interrupt from the firmware\n",
__func__);
adapter->if_ops.wakeup(adapter); adapter->if_ops.wakeup(adapter);
adapter->hs_activated = false; adapter->hs_activated = false;
@ -1219,13 +1263,14 @@ mwifiex_process_sleep_confirm_resp(struct mwifiex_adapter *adapter,
uint16_t seq_num = le16_to_cpu(cmd->seq_num); uint16_t seq_num = le16_to_cpu(cmd->seq_num);
if (!upld_len) { if (!upld_len) {
dev_err(adapter->dev, "%s: cmd size is 0\n", __func__); mwifiex_dbg(adapter, ERROR,
"%s: cmd size is 0\n", __func__);
return; return;
} }
dev_dbg(adapter->dev, mwifiex_dbg(adapter, CMD,
"cmd: CMD_RESP: 0x%x, result %d, len %d, seqno 0x%x\n", "cmd: CMD_RESP: 0x%x, result %d, len %d, seqno 0x%x\n",
command, result, le16_to_cpu(cmd->size), seq_num); command, result, le16_to_cpu(cmd->size), seq_num);
/* Get BSS number and corresponding priv */ /* Get BSS number and corresponding priv */
priv = mwifiex_get_priv_by_id(adapter, HostCmd_GET_BSS_NO(seq_num), priv = mwifiex_get_priv_by_id(adapter, HostCmd_GET_BSS_NO(seq_num),
@ -1239,15 +1284,16 @@ mwifiex_process_sleep_confirm_resp(struct mwifiex_adapter *adapter,
command &= HostCmd_CMD_ID_MASK; command &= HostCmd_CMD_ID_MASK;
if (command != HostCmd_CMD_802_11_PS_MODE_ENH) { if (command != HostCmd_CMD_802_11_PS_MODE_ENH) {
dev_err(adapter->dev, mwifiex_dbg(adapter, ERROR,
"%s: rcvd unexpected resp for cmd %#x, result = %x\n", "%s: rcvd unexpected resp for cmd %#x, result = %x\n",
__func__, command, result); __func__, command, result);
return; return;
} }
if (result) { if (result) {
dev_err(adapter->dev, "%s: sleep confirm cmd failed\n", mwifiex_dbg(adapter, ERROR,
__func__); "%s: sleep confirm cmd failed\n",
__func__);
adapter->pm_wakeup_card_req = false; adapter->pm_wakeup_card_req = false;
adapter->ps_state = PS_STATE_AWAKE; adapter->ps_state = PS_STATE_AWAKE;
return; return;
@ -1312,7 +1358,8 @@ int mwifiex_cmd_enh_power_mode(struct mwifiex_private *priv,
sizeof(struct mwifiex_ie_types_header)); sizeof(struct mwifiex_ie_types_header));
cmd_size += sizeof(*ps_tlv); cmd_size += sizeof(*ps_tlv);
tlv += sizeof(*ps_tlv); tlv += sizeof(*ps_tlv);
dev_dbg(adapter->dev, "cmd: PS Command: Enter PS\n"); mwifiex_dbg(priv->adapter, CMD,
"cmd: PS Command: Enter PS\n");
ps_mode->null_pkt_interval = ps_mode->null_pkt_interval =
cpu_to_le16(adapter->null_pkt_interval); cpu_to_le16(adapter->null_pkt_interval);
ps_mode->multiple_dtims = ps_mode->multiple_dtims =
@ -1342,8 +1389,8 @@ int mwifiex_cmd_enh_power_mode(struct mwifiex_private *priv,
tlv += sizeof(*auto_ds_tlv); tlv += sizeof(*auto_ds_tlv);
if (auto_ds) if (auto_ds)
idletime = auto_ds->idle_time; idletime = auto_ds->idle_time;
dev_dbg(priv->adapter->dev, mwifiex_dbg(priv->adapter, CMD,
"cmd: PS Command: Enter Auto Deep Sleep\n"); "cmd: PS Command: Enter Auto Deep Sleep\n");
auto_ds_tlv->deep_sleep_timeout = cpu_to_le16(idletime); auto_ds_tlv->deep_sleep_timeout = cpu_to_le16(idletime);
} }
cmd->size = cpu_to_le16(cmd_size); cmd->size = cpu_to_le16(cmd_size);
@ -1370,27 +1417,31 @@ int mwifiex_ret_enh_power_mode(struct mwifiex_private *priv,
uint16_t auto_ps_bitmap = uint16_t auto_ps_bitmap =
le16_to_cpu(ps_mode->params.ps_bitmap); le16_to_cpu(ps_mode->params.ps_bitmap);
dev_dbg(adapter->dev, mwifiex_dbg(adapter, INFO,
"info: %s: PS_MODE cmd reply result=%#x action=%#X\n", "info: %s: PS_MODE cmd reply result=%#x action=%#X\n",
__func__, resp->result, action); __func__, resp->result, action);
if (action == EN_AUTO_PS) { if (action == EN_AUTO_PS) {
if (auto_ps_bitmap & BITMAP_AUTO_DS) { if (auto_ps_bitmap & BITMAP_AUTO_DS) {
dev_dbg(adapter->dev, "cmd: Enabled auto deep sleep\n"); mwifiex_dbg(adapter, CMD,
"cmd: Enabled auto deep sleep\n");
priv->adapter->is_deep_sleep = true; priv->adapter->is_deep_sleep = true;
} }
if (auto_ps_bitmap & BITMAP_STA_PS) { if (auto_ps_bitmap & BITMAP_STA_PS) {
dev_dbg(adapter->dev, "cmd: Enabled STA power save\n"); mwifiex_dbg(adapter, CMD,
"cmd: Enabled STA power save\n");
if (adapter->sleep_period.period) if (adapter->sleep_period.period)
dev_dbg(adapter->dev, mwifiex_dbg(adapter, CMD,
"cmd: set to uapsd/pps mode\n"); "cmd: set to uapsd/pps mode\n");
} }
} else if (action == DIS_AUTO_PS) { } else if (action == DIS_AUTO_PS) {
if (ps_bitmap & BITMAP_AUTO_DS) { if (ps_bitmap & BITMAP_AUTO_DS) {
priv->adapter->is_deep_sleep = false; priv->adapter->is_deep_sleep = false;
dev_dbg(adapter->dev, "cmd: Disabled auto deep sleep\n"); mwifiex_dbg(adapter, CMD,
"cmd: Disabled auto deep sleep\n");
} }
if (ps_bitmap & BITMAP_STA_PS) { if (ps_bitmap & BITMAP_STA_PS) {
dev_dbg(adapter->dev, "cmd: Disabled STA power save\n"); mwifiex_dbg(adapter, CMD,
"cmd: Disabled STA power save\n");
if (adapter->sleep_period.period) { if (adapter->sleep_period.period) {
adapter->delay_null_pkt = false; adapter->delay_null_pkt = false;
adapter->tx_lock_flag = false; adapter->tx_lock_flag = false;
@ -1403,7 +1454,8 @@ int mwifiex_ret_enh_power_mode(struct mwifiex_private *priv,
else else
adapter->ps_mode = MWIFIEX_802_11_POWER_MODE_CAM; adapter->ps_mode = MWIFIEX_802_11_POWER_MODE_CAM;
dev_dbg(adapter->dev, "cmd: ps_bitmap=%#x\n", ps_bitmap); mwifiex_dbg(adapter, CMD,
"cmd: ps_bitmap=%#x\n", ps_bitmap);
if (pm_cfg) { if (pm_cfg) {
/* This section is for get power save mode */ /* This section is for get power save mode */
@ -1540,29 +1592,29 @@ int mwifiex_ret_get_hw_spec(struct mwifiex_private *priv,
api_rev->major_ver; api_rev->major_ver;
adapter->key_api_minor_ver = adapter->key_api_minor_ver =
api_rev->minor_ver; api_rev->minor_ver;
dev_dbg(adapter->dev, mwifiex_dbg(adapter, INFO,
"key_api v%d.%d\n", "key_api v%d.%d\n",
adapter->key_api_major_ver, adapter->key_api_major_ver,
adapter->key_api_minor_ver); adapter->key_api_minor_ver);
break; break;
case FW_API_VER_ID: case FW_API_VER_ID:
adapter->fw_api_ver = adapter->fw_api_ver =
api_rev->major_ver; api_rev->major_ver;
dev_dbg(adapter->dev, mwifiex_dbg(adapter, INFO,
"Firmware api version %d\n", "Firmware api version %d\n",
adapter->fw_api_ver); adapter->fw_api_ver);
break; break;
default: default:
dev_warn(adapter->dev, mwifiex_dbg(adapter, FATAL,
"Unknown api_id: %d\n", "Unknown api_id: %d\n",
api_id); api_id);
break; break;
} }
break; break;
default: default:
dev_warn(adapter->dev, mwifiex_dbg(adapter, FATAL,
"Unknown GET_HW_SPEC TLV type: %#x\n", "Unknown GET_HW_SPEC TLV type: %#x\n",
le16_to_cpu(tlv->type)); le16_to_cpu(tlv->type));
break; break;
} }
parsed_len += le16_to_cpu(tlv->len) + parsed_len += le16_to_cpu(tlv->len) +
@ -1572,14 +1624,16 @@ int mwifiex_ret_get_hw_spec(struct mwifiex_private *priv,
} }
} }
dev_dbg(adapter->dev, "info: GET_HW_SPEC: fw_release_number- %#x\n", mwifiex_dbg(adapter, INFO,
adapter->fw_release_number); "info: GET_HW_SPEC: fw_release_number- %#x\n",
dev_dbg(adapter->dev, "info: GET_HW_SPEC: permanent addr: %pM\n", adapter->fw_release_number);
hw_spec->permanent_addr); mwifiex_dbg(adapter, INFO,
dev_dbg(adapter->dev, "info: GET_HW_SPEC: permanent addr: %pM\n",
"info: GET_HW_SPEC: hw_if_version=%#x version=%#x\n", hw_spec->permanent_addr);
le16_to_cpu(hw_spec->hw_if_version), mwifiex_dbg(adapter, INFO,
le16_to_cpu(hw_spec->version)); "info: GET_HW_SPEC: hw_if_version=%#x version=%#x\n",
le16_to_cpu(hw_spec->hw_if_version),
le16_to_cpu(hw_spec->version));
ether_addr_copy(priv->adapter->perm_addr, hw_spec->permanent_addr); ether_addr_copy(priv->adapter->perm_addr, hw_spec->permanent_addr);
adapter->region_code = le16_to_cpu(hw_spec->region_code); adapter->region_code = le16_to_cpu(hw_spec->region_code);
@ -1592,8 +1646,8 @@ int mwifiex_ret_get_hw_spec(struct mwifiex_private *priv,
/* If it's unidentified region code, use the default (USA) */ /* If it's unidentified region code, use the default (USA) */
if (i >= MWIFIEX_MAX_REGION_CODE) { if (i >= MWIFIEX_MAX_REGION_CODE) {
adapter->region_code = 0x10; adapter->region_code = 0x10;
dev_dbg(adapter->dev, mwifiex_dbg(adapter, WARN,
"cmd: unknown region code, use default (USA)\n"); "cmd: unknown region code, use default (USA)\n");
} }
adapter->hw_dot_11n_dev_cap = le32_to_cpu(hw_spec->dot_11n_dev_cap); adapter->hw_dot_11n_dev_cap = le32_to_cpu(hw_spec->dot_11n_dev_cap);

View File

@ -792,7 +792,8 @@ mwifiex_hscfg_write(struct file *file, const char __user *ubuf,
memset(&hscfg, 0, sizeof(struct mwifiex_ds_hs_cfg)); memset(&hscfg, 0, sizeof(struct mwifiex_ds_hs_cfg));
if (arg_num > 3) { if (arg_num > 3) {
dev_err(priv->adapter->dev, "Too many arguments\n"); mwifiex_dbg(priv->adapter, ERROR,
"Too many arguments\n");
ret = -EINVAL; ret = -EINVAL;
goto done; goto done;
} }

View File

@ -108,7 +108,8 @@ mwifiex_get_dump_data(struct net_device *dev, struct ethtool_dump *dump,
} }
if (adapter->curr_mem_idx == MWIFIEX_FW_DUMP_IDX) { if (adapter->curr_mem_idx == MWIFIEX_FW_DUMP_IDX) {
dev_err(adapter->dev, "firmware dump in progress!!\n"); mwifiex_dbg(adapter, ERROR,
"firmware dump in progress!!\n");
return -EBUSY; return -EBUSY;
} }
@ -140,7 +141,8 @@ static int mwifiex_set_dump(struct net_device *dev, struct ethtool_dump *val)
} }
if (adapter->curr_mem_idx == MWIFIEX_FW_DUMP_IDX) { if (adapter->curr_mem_idx == MWIFIEX_FW_DUMP_IDX) {
dev_err(adapter->dev, "firmware dump in progress!!\n"); mwifiex_dbg(adapter, ERROR,
"firmware dump in progress!!\n");
return -EBUSY; return -EBUSY;
} }

View File

@ -56,7 +56,7 @@ static void wakeup_timer_fn(unsigned long data)
{ {
struct mwifiex_adapter *adapter = (struct mwifiex_adapter *)data; struct mwifiex_adapter *adapter = (struct mwifiex_adapter *)data;
dev_err(adapter->dev, "Firmware wakeup failed\n"); mwifiex_dbg(adapter, ERROR, "Firmware wakeup failed\n");
adapter->hw_status = MWIFIEX_HW_STATUS_RESET; adapter->hw_status = MWIFIEX_HW_STATUS_RESET;
mwifiex_cancel_all_pending_cmd(adapter); mwifiex_cancel_all_pending_cmd(adapter);
@ -172,8 +172,9 @@ static int mwifiex_allocate_adapter(struct mwifiex_adapter *adapter)
/* Allocate command buffer */ /* Allocate command buffer */
ret = mwifiex_alloc_cmd_buffer(adapter); ret = mwifiex_alloc_cmd_buffer(adapter);
if (ret) { if (ret) {
dev_err(adapter->dev, "%s: failed to alloc cmd buffer\n", mwifiex_dbg(adapter, ERROR,
__func__); "%s: failed to alloc cmd buffer\n",
__func__);
return -1; return -1;
} }
@ -182,8 +183,9 @@ static int mwifiex_allocate_adapter(struct mwifiex_adapter *adapter)
+ INTF_HEADER_LEN); + INTF_HEADER_LEN);
if (!adapter->sleep_cfm) { if (!adapter->sleep_cfm) {
dev_err(adapter->dev, "%s: failed to alloc sleep cfm" mwifiex_dbg(adapter, ERROR,
" cmd buffer\n", __func__); "%s: failed to alloc sleep cfm\t"
" cmd buffer\n", __func__);
return -1; return -1;
} }
skb_reserve(adapter->sleep_cfm, INTF_HEADER_LEN); skb_reserve(adapter->sleep_cfm, INTF_HEADER_LEN);
@ -417,7 +419,7 @@ mwifiex_adapter_cleanup(struct mwifiex_adapter *adapter)
mwifiex_free_lock_list(adapter); mwifiex_free_lock_list(adapter);
/* Free command buffer */ /* Free command buffer */
dev_dbg(adapter->dev, "info: free cmd buffer\n"); mwifiex_dbg(adapter, INFO, "info: free cmd buffer\n");
mwifiex_free_cmd_buffer(adapter); mwifiex_free_cmd_buffer(adapter);
for (idx = 0; idx < adapter->num_mem_types; idx++) { for (idx = 0; idx < adapter->num_mem_types; idx++) {
@ -595,10 +597,11 @@ static void mwifiex_delete_bss_prio_tbl(struct mwifiex_private *priv)
for (i = 0; i < adapter->priv_num; ++i) { for (i = 0; i < adapter->priv_num; ++i) {
head = &adapter->bss_prio_tbl[i].bss_prio_head; head = &adapter->bss_prio_tbl[i].bss_prio_head;
lock = &adapter->bss_prio_tbl[i].bss_prio_lock; lock = &adapter->bss_prio_tbl[i].bss_prio_lock;
dev_dbg(adapter->dev, "info: delete BSS priority table," mwifiex_dbg(adapter, INFO,
" bss_type = %d, bss_num = %d, i = %d," "info: delete BSS priority table,\t"
" head = %p\n", "bss_type = %d, bss_num = %d, i = %d,\t"
priv->bss_type, priv->bss_num, i, head); "head = %p\n",
priv->bss_type, priv->bss_num, i, head);
{ {
spin_lock_irqsave(lock, flags); spin_lock_irqsave(lock, flags);
@ -609,9 +612,10 @@ static void mwifiex_delete_bss_prio_tbl(struct mwifiex_private *priv)
list_for_each_entry_safe(bssprio_node, tmp_node, head, list_for_each_entry_safe(bssprio_node, tmp_node, head,
list) { list) {
if (bssprio_node->priv == priv) { if (bssprio_node->priv == priv) {
dev_dbg(adapter->dev, "info: Delete " mwifiex_dbg(adapter, INFO,
"node %p, next = %p\n", "info: Delete\t"
bssprio_node, tmp_node); "node %p, next = %p\n",
bssprio_node, tmp_node);
list_del(&bssprio_node->list); list_del(&bssprio_node->list);
kfree(bssprio_node); kfree(bssprio_node);
} }
@ -659,20 +663,23 @@ mwifiex_shutdown_drv(struct mwifiex_adapter *adapter)
adapter->hw_status = MWIFIEX_HW_STATUS_CLOSING; adapter->hw_status = MWIFIEX_HW_STATUS_CLOSING;
/* wait for mwifiex_process to complete */ /* wait for mwifiex_process to complete */
if (adapter->mwifiex_processing) { if (adapter->mwifiex_processing) {
dev_warn(adapter->dev, "main process is still running\n"); mwifiex_dbg(adapter, WARN,
"main process is still running\n");
return ret; return ret;
} }
/* cancel current command */ /* cancel current command */
if (adapter->curr_cmd) { if (adapter->curr_cmd) {
dev_warn(adapter->dev, "curr_cmd is still in processing\n"); mwifiex_dbg(adapter, WARN,
"curr_cmd is still in processing\n");
del_timer_sync(&adapter->cmd_timer); del_timer_sync(&adapter->cmd_timer);
mwifiex_recycle_cmd_node(adapter, adapter->curr_cmd); mwifiex_recycle_cmd_node(adapter, adapter->curr_cmd);
adapter->curr_cmd = NULL; adapter->curr_cmd = NULL;
} }
/* shut down mwifiex */ /* shut down mwifiex */
dev_dbg(adapter->dev, "info: shutdown mwifiex...\n"); mwifiex_dbg(adapter, MSG,
"info: shutdown mwifiex...\n");
/* Clean up Tx/Rx queues and delete BSS priority table */ /* Clean up Tx/Rx queues and delete BSS priority table */
for (i = 0; i < adapter->priv_num; i++) { for (i = 0; i < adapter->priv_num; i++) {
@ -741,8 +748,8 @@ int mwifiex_dnld_fw(struct mwifiex_adapter *adapter,
/* check if firmware is already running */ /* check if firmware is already running */
ret = adapter->if_ops.check_fw_status(adapter, poll_num); ret = adapter->if_ops.check_fw_status(adapter, poll_num);
if (!ret) { if (!ret) {
dev_notice(adapter->dev, mwifiex_dbg(adapter, MSG,
"WLAN FW already running! Skip FW dnld\n"); "WLAN FW already running! Skip FW dnld\n");
return 0; return 0;
} }
@ -750,8 +757,8 @@ int mwifiex_dnld_fw(struct mwifiex_adapter *adapter,
/* check if we are the winner for downloading FW */ /* check if we are the winner for downloading FW */
if (!adapter->winner) { if (!adapter->winner) {
dev_notice(adapter->dev, mwifiex_dbg(adapter, MSG,
"FW already running! Skip FW dnld\n"); "FW already running! Skip FW dnld\n");
goto poll_fw; goto poll_fw;
} }
} }
@ -760,7 +767,8 @@ int mwifiex_dnld_fw(struct mwifiex_adapter *adapter,
/* Download firmware with helper */ /* Download firmware with helper */
ret = adapter->if_ops.prog_fw(adapter, pmfw); ret = adapter->if_ops.prog_fw(adapter, pmfw);
if (ret) { if (ret) {
dev_err(adapter->dev, "prog_fw failed ret=%#x\n", ret); mwifiex_dbg(adapter, ERROR,
"prog_fw failed ret=%#x\n", ret);
return ret; return ret;
} }
} }
@ -769,7 +777,8 @@ poll_fw:
/* Check if the firmware is downloaded successfully or not */ /* Check if the firmware is downloaded successfully or not */
ret = adapter->if_ops.check_fw_status(adapter, poll_num); ret = adapter->if_ops.check_fw_status(adapter, poll_num);
if (ret) if (ret)
dev_err(adapter->dev, "FW failed to be active in time\n"); mwifiex_dbg(adapter, ERROR,
"FW failed to be active in time\n");
return ret; return ret;
} }

View File

@ -53,9 +53,9 @@ mwifiex_cmd_append_generic_ie(struct mwifiex_private *priv, u8 **buffer)
* parameter buffer pointer. * parameter buffer pointer.
*/ */
if (priv->gen_ie_buf_len) { if (priv->gen_ie_buf_len) {
dev_dbg(priv->adapter->dev, mwifiex_dbg(priv->adapter, INFO,
"info: %s: append generic ie len %d to %p\n", "info: %s: append generic ie len %d to %p\n",
__func__, priv->gen_ie_buf_len, *buffer); __func__, priv->gen_ie_buf_len, *buffer);
/* Wrap the generic IE buffer with a pass through TLV type */ /* Wrap the generic IE buffer with a pass through TLV type */
ie_header.type = cpu_to_le16(TLV_TYPE_PASSTHROUGH); ie_header.type = cpu_to_le16(TLV_TYPE_PASSTHROUGH);
@ -125,9 +125,9 @@ mwifiex_cmd_append_tsf_tlv(struct mwifiex_private *priv, u8 **buffer,
tsf_val = cpu_to_le64(bss_desc->timestamp); tsf_val = cpu_to_le64(bss_desc->timestamp);
dev_dbg(priv->adapter->dev, mwifiex_dbg(priv->adapter, INFO,
"info: %s: TSF offset calc: %016llx - %016llx\n", "info: %s: TSF offset calc: %016llx - %016llx\n",
__func__, bss_desc->timestamp, bss_desc->fw_tsf); __func__, bss_desc->timestamp, bss_desc->fw_tsf);
memcpy(*buffer, &tsf_val, sizeof(tsf_val)); memcpy(*buffer, &tsf_val, sizeof(tsf_val));
*buffer += sizeof(tsf_val); *buffer += sizeof(tsf_val);
@ -152,7 +152,7 @@ static int mwifiex_get_common_rates(struct mwifiex_private *priv, u8 *rate1,
tmp = kmemdup(rate1, rate1_size, GFP_KERNEL); tmp = kmemdup(rate1, rate1_size, GFP_KERNEL);
if (!tmp) { if (!tmp) {
dev_err(priv->adapter->dev, "failed to alloc tmp buf\n"); mwifiex_dbg(priv->adapter, ERROR, "failed to alloc tmp buf\n");
return -ENOMEM; return -ENOMEM;
} }
@ -169,8 +169,8 @@ static int mwifiex_get_common_rates(struct mwifiex_private *priv, u8 *rate1,
} }
} }
dev_dbg(priv->adapter->dev, "info: Tx data rate set to %#x\n", mwifiex_dbg(priv->adapter, INFO, "info: Tx data rate set to %#x\n",
priv->data_rate); priv->data_rate);
if (!priv->is_data_rate_auto) { if (!priv->is_data_rate_auto) {
while (*ptr) { while (*ptr) {
@ -180,9 +180,10 @@ static int mwifiex_get_common_rates(struct mwifiex_private *priv, u8 *rate1,
} }
ptr++; ptr++;
} }
dev_err(priv->adapter->dev, "previously set fixed data rate %#x" mwifiex_dbg(priv->adapter, ERROR,
" is not compatible with the network\n", "previously set fixed data rate %#x\t"
priv->data_rate); "is not compatible with the network\n",
priv->data_rate);
ret = -1; ret = -1;
goto done; goto done;
@ -214,8 +215,9 @@ mwifiex_setup_rates_from_bssdesc(struct mwifiex_private *priv,
if (mwifiex_get_common_rates(priv, out_rates, MWIFIEX_SUPPORTED_RATES, if (mwifiex_get_common_rates(priv, out_rates, MWIFIEX_SUPPORTED_RATES,
card_rates, card_rates_size)) { card_rates, card_rates_size)) {
*out_rates_size = 0; *out_rates_size = 0;
dev_err(priv->adapter->dev, "%s: cannot get common rates\n", mwifiex_dbg(priv->adapter, ERROR,
__func__); "%s: cannot get common rates\n",
__func__);
return -1; return -1;
} }
@ -246,8 +248,9 @@ mwifiex_cmd_append_wps_ie(struct mwifiex_private *priv, u8 **buffer)
* parameter buffer pointer. * parameter buffer pointer.
*/ */
if (priv->wps_ie_len) { if (priv->wps_ie_len) {
dev_dbg(priv->adapter->dev, "cmd: append wps ie %d to %p\n", mwifiex_dbg(priv->adapter, CMD,
priv->wps_ie_len, *buffer); "cmd: append wps ie %d to %p\n",
priv->wps_ie_len, *buffer);
/* Wrap the generic IE buffer with a pass through TLV type */ /* Wrap the generic IE buffer with a pass through TLV type */
ie_header.type = cpu_to_le16(TLV_TYPE_MGMT_IE); ie_header.type = cpu_to_le16(TLV_TYPE_MGMT_IE);
@ -292,8 +295,9 @@ mwifiex_cmd_append_wapi_ie(struct mwifiex_private *priv, u8 **buffer)
* parameter buffer pointer. * parameter buffer pointer.
*/ */
if (priv->wapi_ie_len) { if (priv->wapi_ie_len) {
dev_dbg(priv->adapter->dev, "cmd: append wapi ie %d to %p\n", mwifiex_dbg(priv->adapter, CMD,
priv->wapi_ie_len, *buffer); "cmd: append wapi ie %d to %p\n",
priv->wapi_ie_len, *buffer);
/* Wrap the generic IE buffer with a pass through TLV type */ /* Wrap the generic IE buffer with a pass through TLV type */
ie_header.type = cpu_to_le16(TLV_TYPE_WAPI_IE); ie_header.type = cpu_to_le16(TLV_TYPE_WAPI_IE);
@ -453,8 +457,8 @@ int mwifiex_cmd_802_11_associate(struct mwifiex_private *priv,
rates_tlv->header.len = cpu_to_le16((u16) rates_size); rates_tlv->header.len = cpu_to_le16((u16) rates_size);
memcpy(rates_tlv->rates, rates, rates_size); memcpy(rates_tlv->rates, rates, rates_size);
pos += sizeof(rates_tlv->header) + rates_size; pos += sizeof(rates_tlv->header) + rates_size;
dev_dbg(priv->adapter->dev, "info: ASSOC_CMD: rates size = %d\n", mwifiex_dbg(priv->adapter, INFO, "info: ASSOC_CMD: rates size = %d\n",
rates_size); rates_size);
/* Add the Authentication type to be used for Auth frames */ /* Add the Authentication type to be used for Auth frames */
auth_tlv = (struct mwifiex_ie_types_auth_type *) pos; auth_tlv = (struct mwifiex_ie_types_auth_type *) pos;
@ -487,14 +491,14 @@ int mwifiex_cmd_802_11_associate(struct mwifiex_private *priv,
sizeof(struct mwifiex_chan_scan_param_set)); sizeof(struct mwifiex_chan_scan_param_set));
chan_tlv->chan_scan_param[0].chan_number = chan_tlv->chan_scan_param[0].chan_number =
(bss_desc->phy_param_set.ds_param_set.current_chan); (bss_desc->phy_param_set.ds_param_set.current_chan);
dev_dbg(priv->adapter->dev, "info: Assoc: TLV Chan = %d\n", mwifiex_dbg(priv->adapter, INFO, "info: Assoc: TLV Chan = %d\n",
chan_tlv->chan_scan_param[0].chan_number); chan_tlv->chan_scan_param[0].chan_number);
chan_tlv->chan_scan_param[0].radio_type = chan_tlv->chan_scan_param[0].radio_type =
mwifiex_band_to_radio_type((u8) bss_desc->bss_band); mwifiex_band_to_radio_type((u8) bss_desc->bss_band);
dev_dbg(priv->adapter->dev, "info: Assoc: TLV Band = %d\n", mwifiex_dbg(priv->adapter, INFO, "info: Assoc: TLV Band = %d\n",
chan_tlv->chan_scan_param[0].radio_type); chan_tlv->chan_scan_param[0].radio_type);
pos += sizeof(chan_tlv->header) + pos += sizeof(chan_tlv->header) +
sizeof(struct mwifiex_chan_scan_param_set); sizeof(struct mwifiex_chan_scan_param_set);
} }
@ -544,8 +548,9 @@ int mwifiex_cmd_802_11_associate(struct mwifiex_private *priv,
tmp_cap &= ~WLAN_CAPABILITY_SHORT_SLOT_TIME; tmp_cap &= ~WLAN_CAPABILITY_SHORT_SLOT_TIME;
tmp_cap &= CAPINFO_MASK; tmp_cap &= CAPINFO_MASK;
dev_dbg(priv->adapter->dev, "info: ASSOC_CMD: tmp_cap=%4X CAPINFO_MASK=%4lX\n", mwifiex_dbg(priv->adapter, INFO,
tmp_cap, CAPINFO_MASK); "info: ASSOC_CMD: tmp_cap=%4X CAPINFO_MASK=%4lX\n",
tmp_cap, CAPINFO_MASK);
assoc->cap_info_bitmap = cpu_to_le16(tmp_cap); assoc->cap_info_bitmap = cpu_to_le16(tmp_cap);
return 0; return 0;
@ -645,9 +650,11 @@ int mwifiex_ret_802_11_associate(struct mwifiex_private *priv,
if (status_code) { if (status_code) {
priv->adapter->dbg.num_cmd_assoc_failure++; priv->adapter->dbg.num_cmd_assoc_failure++;
dev_err(priv->adapter->dev, mwifiex_dbg(priv->adapter, ERROR,
"ASSOC_RESP: failed, status code=%d err=%#x a_id=%#x\n", "ASSOC_RESP: failed,\t"
status_code, cap_info, le16_to_cpu(assoc_rsp->a_id)); "status code=%d err=%#x a_id=%#x\n",
status_code, cap_info,
le16_to_cpu(assoc_rsp->a_id));
if (cap_info == MWIFIEX_TIMEOUT_FOR_AP_RESP) { if (cap_info == MWIFIEX_TIMEOUT_FOR_AP_RESP) {
if (status_code == MWIFIEX_STATUS_CODE_AUTH_TIMEOUT) if (status_code == MWIFIEX_STATUS_CODE_AUTH_TIMEOUT)
@ -671,8 +678,8 @@ int mwifiex_ret_802_11_associate(struct mwifiex_private *priv,
/* Set the attempted BSSID Index to current */ /* Set the attempted BSSID Index to current */
bss_desc = priv->attempted_bss_desc; bss_desc = priv->attempted_bss_desc;
dev_dbg(priv->adapter->dev, "info: ASSOC_RESP: %s\n", mwifiex_dbg(priv->adapter, INFO, "info: ASSOC_RESP: %s\n",
bss_desc->ssid.ssid); bss_desc->ssid.ssid);
/* Make a copy of current BSSID descriptor */ /* Make a copy of current BSSID descriptor */
memcpy(&priv->curr_bss_params.bss_descriptor, memcpy(&priv->curr_bss_params.bss_descriptor,
@ -702,8 +709,9 @@ int mwifiex_ret_802_11_associate(struct mwifiex_private *priv,
= ((bss_desc->wmm_ie.qos_info_bitmap & = ((bss_desc->wmm_ie.qos_info_bitmap &
IEEE80211_WMM_IE_AP_QOSINFO_UAPSD) ? 1 : 0); IEEE80211_WMM_IE_AP_QOSINFO_UAPSD) ? 1 : 0);
dev_dbg(priv->adapter->dev, "info: ASSOC_RESP: curr_pkt_filter is %#x\n", mwifiex_dbg(priv->adapter, INFO,
priv->curr_pkt_filter); "info: ASSOC_RESP: curr_pkt_filter is %#x\n",
priv->curr_pkt_filter);
if (priv->sec_info.wpa_enabled || priv->sec_info.wpa2_enabled) if (priv->sec_info.wpa_enabled || priv->sec_info.wpa2_enabled)
priv->wpa_is_gtk_set = false; priv->wpa_is_gtk_set = false;
@ -719,8 +727,8 @@ int mwifiex_ret_802_11_associate(struct mwifiex_private *priv,
} }
if (enable_data) if (enable_data)
dev_dbg(priv->adapter->dev, mwifiex_dbg(priv->adapter, INFO,
"info: post association, re-enabling data flow\n"); "info: post association, re-enabling data flow\n");
/* Reset SNR/NF/RSSI values */ /* Reset SNR/NF/RSSI values */
priv->data_rssi_last = 0; priv->data_rssi_last = 0;
@ -738,7 +746,7 @@ int mwifiex_ret_802_11_associate(struct mwifiex_private *priv,
priv->adapter->dbg.num_cmd_assoc_success++; priv->adapter->dbg.num_cmd_assoc_success++;
dev_dbg(priv->adapter->dev, "info: ASSOC_RESP: associated\n"); mwifiex_dbg(priv->adapter, INFO, "info: ASSOC_RESP: associated\n");
/* Add the ra_list here for infra mode as there will be only 1 ra /* Add the ra_list here for infra mode as there will be only 1 ra
always */ always */
@ -825,8 +833,8 @@ mwifiex_cmd_802_11_ad_hoc_start(struct mwifiex_private *priv,
memcpy(adhoc_start->ssid, req_ssid->ssid, req_ssid->ssid_len); memcpy(adhoc_start->ssid, req_ssid->ssid, req_ssid->ssid_len);
dev_dbg(adapter->dev, "info: ADHOC_S_CMD: SSID = %s\n", mwifiex_dbg(adapter, INFO, "info: ADHOC_S_CMD: SSID = %s\n",
adhoc_start->ssid); adhoc_start->ssid);
memset(bss_desc->ssid.ssid, 0, IEEE80211_MAX_SSID_LEN); memset(bss_desc->ssid.ssid, 0, IEEE80211_MAX_SSID_LEN);
memcpy(bss_desc->ssid.ssid, req_ssid->ssid, req_ssid->ssid_len); memcpy(bss_desc->ssid.ssid, req_ssid->ssid, req_ssid->ssid_len);
@ -858,12 +866,14 @@ mwifiex_cmd_802_11_ad_hoc_start(struct mwifiex_private *priv,
} }
if (!priv->adhoc_channel) { if (!priv->adhoc_channel) {
dev_err(adapter->dev, "ADHOC_S_CMD: adhoc_channel cannot be 0\n"); mwifiex_dbg(adapter, ERROR,
"ADHOC_S_CMD: adhoc_channel cannot be 0\n");
return -1; return -1;
} }
dev_dbg(adapter->dev, "info: ADHOC_S_CMD: creating ADHOC on channel %d\n", mwifiex_dbg(adapter, INFO,
priv->adhoc_channel); "info: ADHOC_S_CMD: creating ADHOC on channel %d\n",
priv->adhoc_channel);
priv->curr_bss_params.bss_descriptor.channel = priv->adhoc_channel; priv->curr_bss_params.bss_descriptor.channel = priv->adhoc_channel;
priv->curr_bss_params.band = adapter->adhoc_start_band; priv->curr_bss_params.band = adapter->adhoc_start_band;
@ -895,13 +905,14 @@ mwifiex_cmd_802_11_ad_hoc_start(struct mwifiex_private *priv,
/* Set up privacy in bss_desc */ /* Set up privacy in bss_desc */
if (priv->sec_info.encryption_mode) { if (priv->sec_info.encryption_mode) {
/* Ad-Hoc capability privacy on */ /* Ad-Hoc capability privacy on */
dev_dbg(adapter->dev, mwifiex_dbg(adapter, INFO,
"info: ADHOC_S_CMD: wep_status set privacy to WEP\n"); "info: ADHOC_S_CMD: wep_status set privacy to WEP\n");
bss_desc->privacy = MWIFIEX_802_11_PRIV_FILTER_8021X_WEP; bss_desc->privacy = MWIFIEX_802_11_PRIV_FILTER_8021X_WEP;
tmp_cap |= WLAN_CAPABILITY_PRIVACY; tmp_cap |= WLAN_CAPABILITY_PRIVACY;
} else { } else {
dev_dbg(adapter->dev, "info: ADHOC_S_CMD: wep_status NOT set," mwifiex_dbg(adapter, INFO,
" setting privacy to ACCEPT ALL\n"); "info: ADHOC_S_CMD: wep_status NOT set,\t"
"setting privacy to ACCEPT ALL\n");
bss_desc->privacy = MWIFIEX_802_11_PRIV_FILTER_ACCEPT_ALL; bss_desc->privacy = MWIFIEX_802_11_PRIV_FILTER_ACCEPT_ALL;
} }
@ -912,8 +923,8 @@ mwifiex_cmd_802_11_ad_hoc_start(struct mwifiex_private *priv,
if (mwifiex_send_cmd(priv, HostCmd_CMD_MAC_CONTROL, if (mwifiex_send_cmd(priv, HostCmd_CMD_MAC_CONTROL,
HostCmd_ACT_GEN_SET, 0, HostCmd_ACT_GEN_SET, 0,
&priv->curr_pkt_filter, false)) { &priv->curr_pkt_filter, false)) {
dev_err(adapter->dev, mwifiex_dbg(adapter, ERROR,
"ADHOC_S_CMD: G Protection config failed\n"); "ADHOC_S_CMD: G Protection config failed\n");
return -1; return -1;
} }
} }
@ -928,10 +939,10 @@ mwifiex_cmd_802_11_ad_hoc_start(struct mwifiex_private *priv,
memcpy(&priv->curr_bss_params.data_rates, memcpy(&priv->curr_bss_params.data_rates,
&adhoc_start->data_rate, priv->curr_bss_params.num_of_rates); &adhoc_start->data_rate, priv->curr_bss_params.num_of_rates);
dev_dbg(adapter->dev, "info: ADHOC_S_CMD: rates=%4ph\n", mwifiex_dbg(adapter, INFO, "info: ADHOC_S_CMD: rates=%4ph\n",
adhoc_start->data_rate); adhoc_start->data_rate);
dev_dbg(adapter->dev, "info: ADHOC_S_CMD: AD-HOC Start command is ready\n"); mwifiex_dbg(adapter, INFO, "info: ADHOC_S_CMD: AD-HOC Start command is ready\n");
if (IS_SUPPORT_MULTI_BANDS(adapter)) { if (IS_SUPPORT_MULTI_BANDS(adapter)) {
/* Append a channel TLV */ /* Append a channel TLV */
@ -945,8 +956,8 @@ mwifiex_cmd_802_11_ad_hoc_start(struct mwifiex_private *priv,
chan_tlv->chan_scan_param[0].chan_number = chan_tlv->chan_scan_param[0].chan_number =
(u8) priv->curr_bss_params.bss_descriptor.channel; (u8) priv->curr_bss_params.bss_descriptor.channel;
dev_dbg(adapter->dev, "info: ADHOC_S_CMD: TLV Chan = %d\n", mwifiex_dbg(adapter, INFO, "info: ADHOC_S_CMD: TLV Chan = %d\n",
chan_tlv->chan_scan_param[0].chan_number); chan_tlv->chan_scan_param[0].chan_number);
chan_tlv->chan_scan_param[0].radio_type chan_tlv->chan_scan_param[0].radio_type
= mwifiex_band_to_radio_type(priv->curr_bss_params.band); = mwifiex_band_to_radio_type(priv->curr_bss_params.band);
@ -961,8 +972,8 @@ mwifiex_cmd_802_11_ad_hoc_start(struct mwifiex_private *priv,
chan_tlv->chan_scan_param[0].radio_type |= chan_tlv->chan_scan_param[0].radio_type |=
(IEEE80211_HT_PARAM_CHA_SEC_BELOW << 4); (IEEE80211_HT_PARAM_CHA_SEC_BELOW << 4);
} }
dev_dbg(adapter->dev, "info: ADHOC_S_CMD: TLV Band = %d\n", mwifiex_dbg(adapter, INFO, "info: ADHOC_S_CMD: TLV Band = %d\n",
chan_tlv->chan_scan_param[0].radio_type); chan_tlv->chan_scan_param[0].radio_type);
pos += sizeof(chan_tlv->header) + pos += sizeof(chan_tlv->header) +
sizeof(struct mwifiex_chan_scan_param_set); sizeof(struct mwifiex_chan_scan_param_set);
cmd_append_size += cmd_append_size +=
@ -1084,8 +1095,8 @@ mwifiex_cmd_802_11_ad_hoc_join(struct mwifiex_private *priv,
if (mwifiex_send_cmd(priv, HostCmd_CMD_MAC_CONTROL, if (mwifiex_send_cmd(priv, HostCmd_CMD_MAC_CONTROL,
HostCmd_ACT_GEN_SET, 0, HostCmd_ACT_GEN_SET, 0,
&curr_pkt_filter, false)) { &curr_pkt_filter, false)) {
dev_err(priv->adapter->dev, mwifiex_dbg(priv->adapter, ERROR,
"ADHOC_J_CMD: G Protection config failed\n"); "ADHOC_J_CMD: G Protection config failed\n");
return -1; return -1;
} }
} }
@ -1116,14 +1127,15 @@ mwifiex_cmd_802_11_ad_hoc_join(struct mwifiex_private *priv,
tmp_cap &= CAPINFO_MASK; tmp_cap &= CAPINFO_MASK;
dev_dbg(priv->adapter->dev, mwifiex_dbg(priv->adapter, INFO,
"info: ADHOC_J_CMD: tmp_cap=%4X CAPINFO_MASK=%4lX\n", "info: ADHOC_J_CMD: tmp_cap=%4X CAPINFO_MASK=%4lX\n",
tmp_cap, CAPINFO_MASK); tmp_cap, CAPINFO_MASK);
/* Information on BSSID descriptor passed to FW */ /* Information on BSSID descriptor passed to FW */
dev_dbg(priv->adapter->dev, "info: ADHOC_J_CMD: BSSID=%pM, SSID='%s'\n", mwifiex_dbg(priv->adapter, INFO,
adhoc_join->bss_descriptor.bssid, "info: ADHOC_J_CMD: BSSID=%pM, SSID='%s'\n",
adhoc_join->bss_descriptor.ssid); adhoc_join->bss_descriptor.bssid,
adhoc_join->bss_descriptor.ssid);
for (i = 0; i < MWIFIEX_SUPPORTED_RATES && for (i = 0; i < MWIFIEX_SUPPORTED_RATES &&
bss_desc->supported_rates[i]; i++) bss_desc->supported_rates[i]; i++)
@ -1159,14 +1171,14 @@ mwifiex_cmd_802_11_ad_hoc_join(struct mwifiex_private *priv,
sizeof(struct mwifiex_chan_scan_param_set)); sizeof(struct mwifiex_chan_scan_param_set));
chan_tlv->chan_scan_param[0].chan_number = chan_tlv->chan_scan_param[0].chan_number =
(bss_desc->phy_param_set.ds_param_set.current_chan); (bss_desc->phy_param_set.ds_param_set.current_chan);
dev_dbg(priv->adapter->dev, "info: ADHOC_J_CMD: TLV Chan=%d\n", mwifiex_dbg(priv->adapter, INFO, "info: ADHOC_J_CMD: TLV Chan=%d\n",
chan_tlv->chan_scan_param[0].chan_number); chan_tlv->chan_scan_param[0].chan_number);
chan_tlv->chan_scan_param[0].radio_type = chan_tlv->chan_scan_param[0].radio_type =
mwifiex_band_to_radio_type((u8) bss_desc->bss_band); mwifiex_band_to_radio_type((u8) bss_desc->bss_band);
dev_dbg(priv->adapter->dev, "info: ADHOC_J_CMD: TLV Band=%d\n", mwifiex_dbg(priv->adapter, INFO, "info: ADHOC_J_CMD: TLV Band=%d\n",
chan_tlv->chan_scan_param[0].radio_type); chan_tlv->chan_scan_param[0].radio_type);
pos += sizeof(chan_tlv->header) + pos += sizeof(chan_tlv->header) +
sizeof(struct mwifiex_chan_scan_param_set); sizeof(struct mwifiex_chan_scan_param_set);
cmd_append_size += sizeof(chan_tlv->header) + cmd_append_size += sizeof(chan_tlv->header) +
@ -1220,7 +1232,7 @@ int mwifiex_ret_802_11_ad_hoc(struct mwifiex_private *priv,
/* Join result code 0 --> SUCCESS */ /* Join result code 0 --> SUCCESS */
reason_code = le16_to_cpu(resp->result); reason_code = le16_to_cpu(resp->result);
if (reason_code) { if (reason_code) {
dev_err(priv->adapter->dev, "ADHOC_RESP: failed\n"); mwifiex_dbg(priv->adapter, ERROR, "ADHOC_RESP: failed\n");
if (priv->media_connected) if (priv->media_connected)
mwifiex_reset_connect_state(priv, reason_code); mwifiex_reset_connect_state(priv, reason_code);
@ -1235,8 +1247,8 @@ int mwifiex_ret_802_11_ad_hoc(struct mwifiex_private *priv,
priv->media_connected = true; priv->media_connected = true;
if (le16_to_cpu(resp->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", mwifiex_dbg(priv->adapter, INFO, "info: ADHOC_S_RESP %s\n",
bss_desc->ssid.ssid); bss_desc->ssid.ssid);
/* Update the created network descriptor with the new BSSID */ /* Update the created network descriptor with the new BSSID */
memcpy(bss_desc->mac_address, memcpy(bss_desc->mac_address,
@ -1248,8 +1260,9 @@ int mwifiex_ret_802_11_ad_hoc(struct mwifiex_private *priv,
* Now the join cmd should be successful. * Now the join cmd should be successful.
* If BSSID has changed use SSID to compare instead of BSSID * If BSSID has changed use SSID to compare instead of BSSID
*/ */
dev_dbg(priv->adapter->dev, "info: ADHOC_J_RESP %s\n", mwifiex_dbg(priv->adapter, INFO,
bss_desc->ssid.ssid); "info: ADHOC_J_RESP %s\n",
bss_desc->ssid.ssid);
/* /*
* Make a copy of current BSSID descriptor, only needed for * Make a copy of current BSSID descriptor, only needed for
@ -1262,10 +1275,10 @@ int mwifiex_ret_802_11_ad_hoc(struct mwifiex_private *priv,
priv->adhoc_state = ADHOC_JOINED; priv->adhoc_state = ADHOC_JOINED;
} }
dev_dbg(priv->adapter->dev, "info: ADHOC_RESP: channel = %d\n", mwifiex_dbg(priv->adapter, INFO, "info: ADHOC_RESP: channel = %d\n",
priv->adhoc_channel); priv->adhoc_channel);
dev_dbg(priv->adapter->dev, "info: ADHOC_RESP: BSSID = %pM\n", mwifiex_dbg(priv->adapter, INFO, "info: ADHOC_RESP: BSSID = %pM\n",
priv->curr_bss_params.bss_descriptor.mac_address); priv->curr_bss_params.bss_descriptor.mac_address);
if (!netif_carrier_ok(priv->netdev)) if (!netif_carrier_ok(priv->netdev))
netif_carrier_on(priv->netdev); netif_carrier_on(priv->netdev);
@ -1327,12 +1340,12 @@ int
mwifiex_adhoc_start(struct mwifiex_private *priv, mwifiex_adhoc_start(struct mwifiex_private *priv,
struct cfg80211_ssid *adhoc_ssid) struct cfg80211_ssid *adhoc_ssid)
{ {
dev_dbg(priv->adapter->dev, "info: Adhoc Channel = %d\n", mwifiex_dbg(priv->adapter, INFO, "info: Adhoc Channel = %d\n",
priv->adhoc_channel); priv->adhoc_channel);
dev_dbg(priv->adapter->dev, "info: curr_bss_params.channel = %d\n", mwifiex_dbg(priv->adapter, INFO, "info: curr_bss_params.channel = %d\n",
priv->curr_bss_params.bss_descriptor.channel); priv->curr_bss_params.bss_descriptor.channel);
dev_dbg(priv->adapter->dev, "info: curr_bss_params.band = %d\n", mwifiex_dbg(priv->adapter, INFO, "info: curr_bss_params.band = %d\n",
priv->curr_bss_params.band); priv->curr_bss_params.band);
if (ISSUPP_11ACENABLED(priv->adapter->fw_cap_info) && if (ISSUPP_11ACENABLED(priv->adapter->fw_cap_info) &&
priv->adapter->config_bands & BAND_AAC) priv->adapter->config_bands & BAND_AAC)
@ -1353,14 +1366,16 @@ 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)
{ {
dev_dbg(priv->adapter->dev, "info: adhoc join: curr_bss ssid =%s\n", mwifiex_dbg(priv->adapter, INFO,
priv->curr_bss_params.bss_descriptor.ssid.ssid); "info: adhoc join: curr_bss ssid =%s\n",
dev_dbg(priv->adapter->dev, "info: adhoc join: curr_bss ssid_len =%u\n", priv->curr_bss_params.bss_descriptor.ssid.ssid);
priv->curr_bss_params.bss_descriptor.ssid.ssid_len); mwifiex_dbg(priv->adapter, INFO,
dev_dbg(priv->adapter->dev, "info: adhoc join: ssid =%s\n", "info: adhoc join: curr_bss ssid_len =%u\n",
bss_desc->ssid.ssid); priv->curr_bss_params.bss_descriptor.ssid.ssid_len);
dev_dbg(priv->adapter->dev, "info: adhoc join: ssid_len =%u\n", mwifiex_dbg(priv->adapter, INFO, "info: adhoc join: ssid =%s\n",
bss_desc->ssid.ssid_len); bss_desc->ssid.ssid);
mwifiex_dbg(priv->adapter, INFO, "info: adhoc join: ssid_len =%u\n",
bss_desc->ssid.ssid_len);
/* Check if the requested SSID is already joined */ /* Check if the requested SSID is already joined */
if (priv->curr_bss_params.bss_descriptor.ssid.ssid_len && if (priv->curr_bss_params.bss_descriptor.ssid.ssid_len &&
@ -1368,8 +1383,9 @@ int mwifiex_adhoc_join(struct mwifiex_private *priv,
&priv->curr_bss_params.bss_descriptor.ssid) && &priv->curr_bss_params.bss_descriptor.ssid) &&
(priv->curr_bss_params.bss_descriptor.bss_mode == (priv->curr_bss_params.bss_descriptor.bss_mode ==
NL80211_IFTYPE_ADHOC)) { NL80211_IFTYPE_ADHOC)) {
dev_dbg(priv->adapter->dev, "info: ADHOC_J_CMD: new ad-hoc SSID" mwifiex_dbg(priv->adapter, INFO,
" is the same as current; not attempting to re-join\n"); "info: ADHOC_J_CMD: new ad-hoc SSID\t"
"is the same as current; not attempting to re-join\n");
return -1; return -1;
} }
@ -1380,10 +1396,12 @@ int mwifiex_adhoc_join(struct mwifiex_private *priv,
else else
mwifiex_set_ba_params(priv); mwifiex_set_ba_params(priv);
dev_dbg(priv->adapter->dev, "info: curr_bss_params.channel = %d\n", mwifiex_dbg(priv->adapter, INFO,
priv->curr_bss_params.bss_descriptor.channel); "info: curr_bss_params.channel = %d\n",
dev_dbg(priv->adapter->dev, "info: curr_bss_params.band = %c\n", priv->curr_bss_params.bss_descriptor.channel);
priv->curr_bss_params.band); mwifiex_dbg(priv->adapter, INFO,
"info: curr_bss_params.band = %c\n",
priv->curr_bss_params.band);
return mwifiex_send_cmd(priv, HostCmd_CMD_802_11_AD_HOC_JOIN, return mwifiex_send_cmd(priv, HostCmd_CMD_802_11_AD_HOC_JOIN,
HostCmd_ACT_GEN_SET, 0, bss_desc, true); HostCmd_ACT_GEN_SET, 0, bss_desc, true);

View File

@ -94,7 +94,8 @@ static int mwifiex_register(void *card, struct mwifiex_if_ops *if_ops,
return 0; return 0;
error: error:
dev_dbg(adapter->dev, "info: leave mwifiex_register with error\n"); mwifiex_dbg(adapter, ERROR,
"info: leave mwifiex_register with error\n");
for (i = 0; i < adapter->priv_num; i++) for (i = 0; i < adapter->priv_num; i++)
kfree(adapter->priv[i]); kfree(adapter->priv[i]);
@ -459,8 +460,8 @@ static void mwifiex_fw_dpc(const struct firmware *firmware, void *context)
struct wireless_dev *wdev; struct wireless_dev *wdev;
if (!firmware) { if (!firmware) {
dev_err(adapter->dev, mwifiex_dbg(adapter, ERROR,
"Failed to get firmware %s\n", adapter->fw_name); "Failed to get firmware %s\n", adapter->fw_name);
goto err_dnld_fw; goto err_dnld_fw;
} }
@ -476,13 +477,13 @@ static void mwifiex_fw_dpc(const struct firmware *firmware, void *context)
if (ret == -1) if (ret == -1)
goto err_dnld_fw; goto err_dnld_fw;
dev_notice(adapter->dev, "WLAN FW is active\n"); mwifiex_dbg(adapter, MSG, "WLAN FW is active\n");
if (cal_data_cfg) { if (cal_data_cfg) {
if ((request_firmware(&adapter->cal_data, cal_data_cfg, if ((request_firmware(&adapter->cal_data, cal_data_cfg,
adapter->dev)) < 0) adapter->dev)) < 0)
dev_err(adapter->dev, mwifiex_dbg(adapter, ERROR,
"Cal data request_firmware() failed\n"); "Cal data request_firmware() failed\n");
} }
/* enable host interrupt after fw dnld is successful */ /* enable host interrupt after fw dnld is successful */
@ -507,12 +508,14 @@ static void mwifiex_fw_dpc(const struct firmware *firmware, void *context)
priv = adapter->priv[MWIFIEX_BSS_ROLE_STA]; priv = adapter->priv[MWIFIEX_BSS_ROLE_STA];
if (mwifiex_register_cfg80211(adapter)) { if (mwifiex_register_cfg80211(adapter)) {
dev_err(adapter->dev, "cannot register with cfg80211\n"); mwifiex_dbg(adapter, ERROR,
"cannot register with cfg80211\n");
goto err_init_fw; goto err_init_fw;
} }
if (mwifiex_init_channel_scan_gap(adapter)) { if (mwifiex_init_channel_scan_gap(adapter)) {
dev_err(adapter->dev, "could not init channel stats table\n"); mwifiex_dbg(adapter, ERROR,
"could not init channel stats table\n");
goto err_init_fw; goto err_init_fw;
} }
@ -526,7 +529,8 @@ static void mwifiex_fw_dpc(const struct firmware *firmware, void *context)
wdev = mwifiex_add_virtual_intf(adapter->wiphy, "mlan%d", NET_NAME_ENUM, wdev = mwifiex_add_virtual_intf(adapter->wiphy, "mlan%d", NET_NAME_ENUM,
NL80211_IFTYPE_STATION, NULL, NULL); NL80211_IFTYPE_STATION, NULL, NULL);
if (IS_ERR(wdev)) { if (IS_ERR(wdev)) {
dev_err(adapter->dev, "cannot create default STA interface\n"); mwifiex_dbg(adapter, ERROR,
"cannot create default STA interface\n");
rtnl_unlock(); rtnl_unlock();
goto err_add_intf; goto err_add_intf;
} }
@ -535,7 +539,8 @@ static void mwifiex_fw_dpc(const struct firmware *firmware, void *context)
wdev = mwifiex_add_virtual_intf(adapter->wiphy, "uap%d", NET_NAME_ENUM, wdev = mwifiex_add_virtual_intf(adapter->wiphy, "uap%d", NET_NAME_ENUM,
NL80211_IFTYPE_AP, NULL, NULL); NL80211_IFTYPE_AP, NULL, NULL);
if (IS_ERR(wdev)) { if (IS_ERR(wdev)) {
dev_err(adapter->dev, "cannot create AP interface\n"); mwifiex_dbg(adapter, ERROR,
"cannot create AP interface\n");
rtnl_unlock(); rtnl_unlock();
goto err_add_intf; goto err_add_intf;
} }
@ -546,8 +551,8 @@ static void mwifiex_fw_dpc(const struct firmware *firmware, void *context)
NL80211_IFTYPE_P2P_CLIENT, NULL, NL80211_IFTYPE_P2P_CLIENT, NULL,
NULL); NULL);
if (IS_ERR(wdev)) { if (IS_ERR(wdev)) {
dev_err(adapter->dev, mwifiex_dbg(adapter, ERROR,
"cannot create p2p client interface\n"); "cannot create p2p client interface\n");
rtnl_unlock(); rtnl_unlock();
goto err_add_intf; goto err_add_intf;
} }
@ -555,7 +560,7 @@ static void mwifiex_fw_dpc(const struct firmware *firmware, void *context)
rtnl_unlock(); rtnl_unlock();
mwifiex_drv_get_driver_version(adapter, fmt, sizeof(fmt) - 1); mwifiex_drv_get_driver_version(adapter, fmt, sizeof(fmt) - 1);
dev_notice(adapter->dev, "driver_version = %s\n", fmt); mwifiex_dbg(adapter, MSG, "driver_version = %s\n", fmt);
goto done; goto done;
err_add_intf: err_add_intf:
@ -565,7 +570,8 @@ err_init_fw:
if (adapter->if_ops.disable_int) if (adapter->if_ops.disable_int)
adapter->if_ops.disable_int(adapter); adapter->if_ops.disable_int(adapter);
err_dnld_fw: err_dnld_fw:
pr_debug("info: %s: unregister device\n", __func__); mwifiex_dbg(adapter, ERROR,
"info: %s: unregister device\n", __func__);
if (adapter->if_ops.unregister_dev) if (adapter->if_ops.unregister_dev)
adapter->if_ops.unregister_dev(adapter); adapter->if_ops.unregister_dev(adapter);
@ -606,8 +612,8 @@ static int mwifiex_init_hw_fw(struct mwifiex_adapter *adapter)
adapter->dev, GFP_KERNEL, adapter, adapter->dev, GFP_KERNEL, adapter,
mwifiex_fw_dpc); mwifiex_fw_dpc);
if (ret < 0) if (ret < 0)
dev_err(adapter->dev, mwifiex_dbg(adapter, ERROR,
"request_firmware_nowait() returned error %d\n", ret); "request_firmware_nowait error %d\n", ret);
return ret; return ret;
} }
@ -633,7 +639,8 @@ mwifiex_close(struct net_device *dev)
struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev); struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev);
if (priv->scan_request) { if (priv->scan_request) {
dev_dbg(priv->adapter->dev, "aborting scan on ndo_stop\n"); mwifiex_dbg(priv->adapter, INFO,
"aborting scan on ndo_stop\n");
cfg80211_scan_done(priv->scan_request, 1); cfg80211_scan_done(priv->scan_request, 1);
priv->scan_request = NULL; priv->scan_request = NULL;
priv->scan_aborting = true; priv->scan_aborting = true;
@ -654,7 +661,8 @@ int mwifiex_queue_tx_pkt(struct mwifiex_private *priv, struct sk_buff *skb)
txq = netdev_get_tx_queue(priv->netdev, index); txq = netdev_get_tx_queue(priv->netdev, index);
if (!netif_tx_queue_stopped(txq)) { if (!netif_tx_queue_stopped(txq)) {
netif_tx_stop_queue(txq); netif_tx_stop_queue(txq);
dev_dbg(priv->adapter->dev, "stop queue: %d\n", index); mwifiex_dbg(priv->adapter, DATA,
"stop queue: %d\n", index);
} }
} }
@ -719,8 +727,9 @@ mwifiex_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
struct mwifiex_txinfo *tx_info; struct mwifiex_txinfo *tx_info;
bool multicast; bool multicast;
dev_dbg(priv->adapter->dev, "data: %lu BSS(%d-%d): Data <= kernel\n", mwifiex_dbg(priv->adapter, DATA,
jiffies, priv->bss_type, priv->bss_num); "data: %lu BSS(%d-%d): Data <= kernel\n",
jiffies, priv->bss_type, priv->bss_num);
if (priv->adapter->surprise_removed) { if (priv->adapter->surprise_removed) {
kfree_skb(skb); kfree_skb(skb);
@ -728,28 +737,31 @@ mwifiex_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
return 0; return 0;
} }
if (!skb->len || (skb->len > ETH_FRAME_LEN)) { if (!skb->len || (skb->len > ETH_FRAME_LEN)) {
dev_err(priv->adapter->dev, "Tx: bad skb len %d\n", skb->len); mwifiex_dbg(priv->adapter, ERROR,
"Tx: bad skb len %d\n", skb->len);
kfree_skb(skb); kfree_skb(skb);
priv->stats.tx_dropped++; priv->stats.tx_dropped++;
return 0; return 0;
} }
if (skb_headroom(skb) < MWIFIEX_MIN_DATA_HEADER_LEN) { if (skb_headroom(skb) < MWIFIEX_MIN_DATA_HEADER_LEN) {
dev_dbg(priv->adapter->dev, mwifiex_dbg(priv->adapter, DATA,
"data: Tx: insufficient skb headroom %d\n", "data: Tx: insufficient skb headroom %d\n",
skb_headroom(skb)); skb_headroom(skb));
/* Insufficient skb headroom - allocate a new skb */ /* Insufficient skb headroom - allocate a new skb */
new_skb = new_skb =
skb_realloc_headroom(skb, MWIFIEX_MIN_DATA_HEADER_LEN); skb_realloc_headroom(skb, MWIFIEX_MIN_DATA_HEADER_LEN);
if (unlikely(!new_skb)) { if (unlikely(!new_skb)) {
dev_err(priv->adapter->dev, "Tx: cannot alloca new_skb\n"); mwifiex_dbg(priv->adapter, ERROR,
"Tx: cannot alloca new_skb\n");
kfree_skb(skb); kfree_skb(skb);
priv->stats.tx_dropped++; priv->stats.tx_dropped++;
return 0; return 0;
} }
kfree_skb(skb); kfree_skb(skb);
skb = new_skb; skb = new_skb;
dev_dbg(priv->adapter->dev, "info: new skb headroomd %d\n", mwifiex_dbg(priv->adapter, INFO,
skb_headroom(skb)); "info: new skb headroomd %d\n",
skb_headroom(skb));
} }
tx_info = MWIFIEX_SKB_TXCB(skb); tx_info = MWIFIEX_SKB_TXCB(skb);
@ -807,8 +819,8 @@ mwifiex_set_mac_address(struct net_device *dev, void *addr)
if (!ret) if (!ret)
memcpy(priv->netdev->dev_addr, priv->curr_addr, ETH_ALEN); memcpy(priv->netdev->dev_addr, priv->curr_addr, ETH_ALEN);
else else
dev_err(priv->adapter->dev, mwifiex_dbg(priv->adapter, ERROR,
"set mac address failed: ret=%d\n", ret); "set mac address failed: ret=%d\n", ret);
memcpy(dev->dev_addr, priv->curr_addr, ETH_ALEN); memcpy(dev->dev_addr, priv->curr_addr, ETH_ALEN);
@ -846,15 +858,17 @@ mwifiex_tx_timeout(struct net_device *dev)
priv->num_tx_timeout++; priv->num_tx_timeout++;
priv->tx_timeout_cnt++; priv->tx_timeout_cnt++;
dev_err(priv->adapter->dev, mwifiex_dbg(priv->adapter, ERROR,
"%lu : Tx timeout(#%d), bss_type-num = %d-%d\n", "%lu : Tx timeout(#%d), bss_type-num = %d-%d\n",
jiffies, priv->tx_timeout_cnt, priv->bss_type, priv->bss_num); jiffies, priv->tx_timeout_cnt, priv->bss_type,
priv->bss_num);
mwifiex_set_trans_start(dev); mwifiex_set_trans_start(dev);
if (priv->tx_timeout_cnt > TX_TIMEOUT_THRESHOLD && if (priv->tx_timeout_cnt > TX_TIMEOUT_THRESHOLD &&
priv->adapter->if_ops.card_reset) { priv->adapter->if_ops.card_reset) {
dev_err(priv->adapter->dev, mwifiex_dbg(priv->adapter, ERROR,
"tx_timeout_cnt exceeds threshold. Triggering card reset!\n"); "tx_timeout_cnt exceeds threshold.\t"
"Triggering card reset!\n");
priv->adapter->if_ops.card_reset(priv->adapter); priv->adapter->if_ops.card_reset(priv->adapter);
} }
} }
@ -875,7 +889,7 @@ void mwifiex_dump_drv_info(struct mwifiex_adapter *adapter)
adapter->drv_info_size = 0; adapter->drv_info_size = 0;
} }
dev_info(adapter->dev, "=== DRIVER INFO DUMP START===\n"); mwifiex_dbg(adapter, MSG, "=== DRIVER INFO DUMP START===\n");
adapter->drv_info_dump = vzalloc(MWIFIEX_DRV_INFO_SIZE_MAX); adapter->drv_info_dump = vzalloc(MWIFIEX_DRV_INFO_SIZE_MAX);
@ -963,7 +977,7 @@ void mwifiex_dump_drv_info(struct mwifiex_adapter *adapter)
} }
adapter->drv_info_size = p - adapter->drv_info_dump; adapter->drv_info_size = p - adapter->drv_info_dump;
dev_info(adapter->dev, "=== DRIVER INFO DUMP END===\n"); mwifiex_dbg(adapter, MSG, "=== DRIVER INFO DUMP END===\n");
} }
EXPORT_SYMBOL_GPL(mwifiex_dump_drv_info); EXPORT_SYMBOL_GPL(mwifiex_dump_drv_info);
@ -1234,21 +1248,24 @@ int mwifiex_remove_card(struct mwifiex_adapter *adapter, struct semaphore *sem)
} }
} }
dev_dbg(adapter->dev, "cmd: calling mwifiex_shutdown_drv...\n"); mwifiex_dbg(adapter, CMD,
"cmd: calling mwifiex_shutdown_drv...\n");
adapter->init_wait_q_woken = false; adapter->init_wait_q_woken = false;
if (mwifiex_shutdown_drv(adapter) == -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"); mwifiex_dbg(adapter, CMD,
"cmd: mwifiex_shutdown_drv done\n");
if (atomic_read(&adapter->rx_pending) || if (atomic_read(&adapter->rx_pending) ||
atomic_read(&adapter->tx_pending) || atomic_read(&adapter->tx_pending) ||
atomic_read(&adapter->cmd_pending)) { atomic_read(&adapter->cmd_pending)) {
dev_err(adapter->dev, "rx_pending=%d, tx_pending=%d, " mwifiex_dbg(adapter, ERROR,
"cmd_pending=%d\n", "rx_pending=%d, tx_pending=%d,\t"
atomic_read(&adapter->rx_pending), "cmd_pending=%d\n",
atomic_read(&adapter->tx_pending), atomic_read(&adapter->rx_pending),
atomic_read(&adapter->cmd_pending)); atomic_read(&adapter->tx_pending),
atomic_read(&adapter->cmd_pending));
} }
for (i = 0; i < adapter->priv_num; i++) { for (i = 0; i < adapter->priv_num; i++) {
@ -1268,11 +1285,13 @@ int mwifiex_remove_card(struct mwifiex_adapter *adapter, struct semaphore *sem)
wiphy_free(adapter->wiphy); wiphy_free(adapter->wiphy);
/* Unregister device */ /* Unregister device */
dev_dbg(adapter->dev, "info: unregister device\n"); mwifiex_dbg(adapter, INFO,
"info: unregister device\n");
if (adapter->if_ops.unregister_dev) if (adapter->if_ops.unregister_dev)
adapter->if_ops.unregister_dev(adapter); adapter->if_ops.unregister_dev(adapter);
/* Free adapter structure */ /* Free adapter structure */
dev_dbg(adapter->dev, "info: free adapter\n"); mwifiex_dbg(adapter, INFO,
"info: free adapter\n");
mwifiex_free_adapter(adapter); mwifiex_free_adapter(adapter);
exit_remove: exit_remove:

File diff suppressed because it is too large Load Diff

View File

@ -241,20 +241,21 @@ mwifiex_is_bss_wpa(struct mwifiex_private *priv,
* LinkSys WRT54G && bss_desc->privacy * LinkSys WRT54G && bss_desc->privacy
*/ */
) { ) {
dev_dbg(priv->adapter->dev, "info: %s: WPA:" mwifiex_dbg(priv->adapter, INFO,
" wpa_ie=%#x wpa2_ie=%#x WEP=%s WPA=%s WPA2=%s " "info: %s: WPA:\t"
"EncMode=%#x privacy=%#x\n", __func__, "wpa_ie=%#x wpa2_ie=%#x WEP=%s WPA=%s WPA2=%s\t"
(bss_desc->bcn_wpa_ie) ? "EncMode=%#x privacy=%#x\n", __func__,
(*(bss_desc->bcn_wpa_ie)). (bss_desc->bcn_wpa_ie) ?
vend_hdr.element_id : 0, (*bss_desc->bcn_wpa_ie).
(bss_desc->bcn_rsn_ie) ? vend_hdr.element_id : 0,
(*(bss_desc->bcn_rsn_ie)). (bss_desc->bcn_rsn_ie) ?
ieee_hdr.element_id : 0, (*bss_desc->bcn_rsn_ie).
(priv->sec_info.wep_enabled) ? "e" : "d", ieee_hdr.element_id : 0,
(priv->sec_info.wpa_enabled) ? "e" : "d", (priv->sec_info.wep_enabled) ? "e" : "d",
(priv->sec_info.wpa2_enabled) ? "e" : "d", (priv->sec_info.wpa_enabled) ? "e" : "d",
priv->sec_info.encryption_mode, (priv->sec_info.wpa2_enabled) ? "e" : "d",
bss_desc->privacy); priv->sec_info.encryption_mode,
bss_desc->privacy);
return true; return true;
} }
return false; return false;
@ -277,20 +278,21 @@ mwifiex_is_bss_wpa2(struct mwifiex_private *priv,
* Privacy bit may NOT be set in some APs like * Privacy bit may NOT be set in some APs like
* LinkSys WRT54G && bss_desc->privacy * LinkSys WRT54G && bss_desc->privacy
*/ */
dev_dbg(priv->adapter->dev, "info: %s: WPA2: " mwifiex_dbg(priv->adapter, INFO,
" wpa_ie=%#x wpa2_ie=%#x WEP=%s WPA=%s WPA2=%s " "info: %s: WPA2:\t"
"EncMode=%#x privacy=%#x\n", __func__, "wpa_ie=%#x wpa2_ie=%#x WEP=%s WPA=%s WPA2=%s\t"
(bss_desc->bcn_wpa_ie) ? "EncMode=%#x privacy=%#x\n", __func__,
(*(bss_desc->bcn_wpa_ie)). (bss_desc->bcn_wpa_ie) ?
vend_hdr.element_id : 0, (*bss_desc->bcn_wpa_ie).
(bss_desc->bcn_rsn_ie) ? vend_hdr.element_id : 0,
(*(bss_desc->bcn_rsn_ie)). (bss_desc->bcn_rsn_ie) ?
ieee_hdr.element_id : 0, (*bss_desc->bcn_rsn_ie).
(priv->sec_info.wep_enabled) ? "e" : "d", ieee_hdr.element_id : 0,
(priv->sec_info.wpa_enabled) ? "e" : "d", (priv->sec_info.wep_enabled) ? "e" : "d",
(priv->sec_info.wpa2_enabled) ? "e" : "d", (priv->sec_info.wpa_enabled) ? "e" : "d",
priv->sec_info.encryption_mode, (priv->sec_info.wpa2_enabled) ? "e" : "d",
bss_desc->privacy); priv->sec_info.encryption_mode,
bss_desc->privacy);
return true; return true;
} }
return false; return false;
@ -333,18 +335,19 @@ mwifiex_is_bss_dynamic_wep(struct mwifiex_private *priv,
((!bss_desc->bcn_rsn_ie) || ((!bss_desc->bcn_rsn_ie) ||
((*(bss_desc->bcn_rsn_ie)).ieee_hdr.element_id != WLAN_EID_RSN)) && ((*(bss_desc->bcn_rsn_ie)).ieee_hdr.element_id != WLAN_EID_RSN)) &&
priv->sec_info.encryption_mode && bss_desc->privacy) { priv->sec_info.encryption_mode && bss_desc->privacy) {
dev_dbg(priv->adapter->dev, "info: %s: dynamic " mwifiex_dbg(priv->adapter, INFO,
"WEP: wpa_ie=%#x wpa2_ie=%#x " "info: %s: dynamic\t"
"EncMode=%#x privacy=%#x\n", "WEP: wpa_ie=%#x wpa2_ie=%#x\t"
__func__, "EncMode=%#x privacy=%#x\n",
(bss_desc->bcn_wpa_ie) ? __func__,
(*(bss_desc->bcn_wpa_ie)). (bss_desc->bcn_wpa_ie) ?
vend_hdr.element_id : 0, (*bss_desc->bcn_wpa_ie).
(bss_desc->bcn_rsn_ie) ? vend_hdr.element_id : 0,
(*(bss_desc->bcn_rsn_ie)). (bss_desc->bcn_rsn_ie) ?
ieee_hdr.element_id : 0, (*bss_desc->bcn_rsn_ie).
priv->sec_info.encryption_mode, ieee_hdr.element_id : 0,
bss_desc->privacy); priv->sec_info.encryption_mode,
bss_desc->privacy);
return true; return true;
} }
return false; return false;
@ -383,19 +386,20 @@ mwifiex_is_network_compatible(struct mwifiex_private *priv,
return 0; return 0;
if (priv->wps.session_enable) { if (priv->wps.session_enable) {
dev_dbg(adapter->dev, mwifiex_dbg(adapter, IOCTL,
"info: return success directly in WPS period\n"); "info: return success directly in WPS period\n");
return 0; return 0;
} }
if (bss_desc->chan_sw_ie_present) { if (bss_desc->chan_sw_ie_present) {
dev_err(adapter->dev, mwifiex_dbg(adapter, INFO,
"Don't connect to AP with WLAN_EID_CHANNEL_SWITCH\n"); "Don't connect to AP with WLAN_EID_CHANNEL_SWITCH\n");
return -1; return -1;
} }
if (mwifiex_is_bss_wapi(priv, bss_desc)) { if (mwifiex_is_bss_wapi(priv, bss_desc)) {
dev_dbg(adapter->dev, "info: return success for WAPI AP\n"); mwifiex_dbg(adapter, INFO,
"info: return success for WAPI AP\n");
return 0; return 0;
} }
@ -405,7 +409,8 @@ mwifiex_is_network_compatible(struct mwifiex_private *priv,
return 0; return 0;
} else if (mwifiex_is_bss_static_wep(priv, bss_desc)) { } else if (mwifiex_is_bss_static_wep(priv, bss_desc)) {
/* Static WEP enabled */ /* Static WEP enabled */
dev_dbg(adapter->dev, "info: Disable 11n in WEP mode.\n"); mwifiex_dbg(adapter, INFO,
"info: Disable 11n in WEP mode.\n");
bss_desc->disable_11n = true; bss_desc->disable_11n = true;
return 0; return 0;
} else if (mwifiex_is_bss_wpa(priv, bss_desc)) { } else if (mwifiex_is_bss_wpa(priv, bss_desc)) {
@ -418,9 +423,9 @@ mwifiex_is_network_compatible(struct mwifiex_private *priv,
if (mwifiex_is_wpa_oui_present if (mwifiex_is_wpa_oui_present
(bss_desc, CIPHER_SUITE_TKIP)) { (bss_desc, CIPHER_SUITE_TKIP)) {
dev_dbg(adapter->dev, mwifiex_dbg(adapter, INFO,
"info: Disable 11n if AES " "info: Disable 11n if AES\t"
"is not supported by AP\n"); "is not supported by AP\n");
bss_desc->disable_11n = true; bss_desc->disable_11n = true;
} else { } else {
return -1; return -1;
@ -437,9 +442,9 @@ mwifiex_is_network_compatible(struct mwifiex_private *priv,
if (mwifiex_is_rsn_oui_present if (mwifiex_is_rsn_oui_present
(bss_desc, CIPHER_SUITE_TKIP)) { (bss_desc, CIPHER_SUITE_TKIP)) {
dev_dbg(adapter->dev, mwifiex_dbg(adapter, INFO,
"info: Disable 11n if AES " "info: Disable 11n if AES\t"
"is not supported by AP\n"); "is not supported by AP\n");
bss_desc->disable_11n = true; bss_desc->disable_11n = true;
} else { } else {
return -1; return -1;
@ -455,17 +460,18 @@ mwifiex_is_network_compatible(struct mwifiex_private *priv,
} }
/* Security doesn't match */ /* Security doesn't match */
dev_dbg(adapter->dev, mwifiex_dbg(adapter, ERROR,
"info: %s: failed: wpa_ie=%#x wpa2_ie=%#x WEP=%s " "info: %s: failed: wpa_ie=%#x wpa2_ie=%#x WEP=%s\t"
"WPA=%s WPA2=%s EncMode=%#x privacy=%#x\n", __func__, "WPA=%s WPA2=%s EncMode=%#x privacy=%#x\n",
(bss_desc->bcn_wpa_ie) ? __func__,
(*(bss_desc->bcn_wpa_ie)).vend_hdr.element_id : 0, (bss_desc->bcn_wpa_ie) ?
(bss_desc->bcn_rsn_ie) ? (*bss_desc->bcn_wpa_ie).vend_hdr.element_id : 0,
(*(bss_desc->bcn_rsn_ie)).ieee_hdr.element_id : 0, (bss_desc->bcn_rsn_ie) ?
(priv->sec_info.wep_enabled) ? "e" : "d", (*bss_desc->bcn_rsn_ie).ieee_hdr.element_id : 0,
(priv->sec_info.wpa_enabled) ? "e" : "d", (priv->sec_info.wep_enabled) ? "e" : "d",
(priv->sec_info.wpa2_enabled) ? "e" : "d", (priv->sec_info.wpa_enabled) ? "e" : "d",
priv->sec_info.encryption_mode, bss_desc->privacy); (priv->sec_info.wpa2_enabled) ? "e" : "d",
priv->sec_info.encryption_mode, bss_desc->privacy);
return -1; return -1;
} }
@ -560,7 +566,8 @@ mwifiex_append_rate_tlv(struct mwifiex_private *priv,
else else
rates_size = mwifiex_get_supported_rates(priv, rates); rates_size = mwifiex_get_supported_rates(priv, rates);
dev_dbg(priv->adapter->dev, "info: SCAN_CMD: Rates size = %d\n", mwifiex_dbg(priv->adapter, CMD,
"info: SCAN_CMD: Rates size = %d\n",
rates_size); rates_size);
rates_tlv = (struct mwifiex_ie_types_rates_param_set *)tlv_pos; rates_tlv = (struct mwifiex_ie_types_rates_param_set *)tlv_pos;
rates_tlv->header.type = cpu_to_le16(WLAN_EID_SUPP_RATES); rates_tlv->header.type = cpu_to_le16(WLAN_EID_SUPP_RATES);
@ -600,9 +607,9 @@ mwifiex_scan_channel_list(struct mwifiex_private *priv,
u8 radio_type; u8 radio_type;
if (!scan_cfg_out || !chan_tlv_out || !scan_chan_list) { if (!scan_cfg_out || !chan_tlv_out || !scan_chan_list) {
dev_dbg(priv->adapter->dev, mwifiex_dbg(priv->adapter, ERROR,
"info: Scan: Null detect: %p, %p, %p\n", "info: Scan: Null detect: %p, %p, %p\n",
scan_cfg_out, chan_tlv_out, scan_chan_list); scan_cfg_out, chan_tlv_out, scan_chan_list);
return -1; return -1;
} }
@ -645,16 +652,16 @@ mwifiex_scan_channel_list(struct mwifiex_private *priv,
} }
radio_type = tmp_chan_list->radio_type; radio_type = tmp_chan_list->radio_type;
dev_dbg(priv->adapter->dev, mwifiex_dbg(priv->adapter, INFO,
"info: Scan: Chan(%3d), Radio(%d)," "info: Scan: Chan(%3d), Radio(%d),\t"
" Mode(%d, %d), Dur(%d)\n", "Mode(%d, %d), Dur(%d)\n",
tmp_chan_list->chan_number, tmp_chan_list->chan_number,
tmp_chan_list->radio_type, tmp_chan_list->radio_type,
tmp_chan_list->chan_scan_mode_bitmap tmp_chan_list->chan_scan_mode_bitmap
& MWIFIEX_PASSIVE_SCAN, & MWIFIEX_PASSIVE_SCAN,
(tmp_chan_list->chan_scan_mode_bitmap (tmp_chan_list->chan_scan_mode_bitmap
& MWIFIEX_DISABLE_CHAN_FILT) >> 1, & MWIFIEX_DISABLE_CHAN_FILT) >> 1,
le16_to_cpu(tmp_chan_list->max_scan_time)); le16_to_cpu(tmp_chan_list->max_scan_time));
/* Copy the current channel TLV to the command being /* Copy the current channel TLV to the command being
prepared */ prepared */
@ -718,9 +725,11 @@ mwifiex_scan_channel_list(struct mwifiex_private *priv,
/* The total scan time should be less than scan command timeout /* The total scan time should be less than scan command timeout
value */ value */
if (total_scan_time > MWIFIEX_MAX_TOTAL_SCAN_TIME) { if (total_scan_time > MWIFIEX_MAX_TOTAL_SCAN_TIME) {
dev_err(priv->adapter->dev, "total scan time %dms" mwifiex_dbg(priv->adapter, ERROR,
" is over limit (%dms), scan skipped\n", "total scan time %dms\t"
total_scan_time, MWIFIEX_MAX_TOTAL_SCAN_TIME); "is over limit (%dms), scan skipped\n",
total_scan_time,
MWIFIEX_MAX_TOTAL_SCAN_TIME);
ret = -1; ret = -1;
break; break;
} }
@ -905,9 +914,10 @@ mwifiex_config_scan(struct mwifiex_private *priv,
tlv_pos += (sizeof(wildcard_ssid_tlv->header) tlv_pos += (sizeof(wildcard_ssid_tlv->header)
+ le16_to_cpu(wildcard_ssid_tlv->header.len)); + le16_to_cpu(wildcard_ssid_tlv->header.len));
dev_dbg(adapter->dev, "info: scan: ssid[%d]: %s, %d\n", mwifiex_dbg(adapter, INFO,
i, wildcard_ssid_tlv->ssid, "info: scan: ssid[%d]: %s, %d\n",
wildcard_ssid_tlv->max_ssid_length); i, wildcard_ssid_tlv->ssid,
wildcard_ssid_tlv->max_ssid_length);
/* Empty wildcard ssid with a maxlen will match many or /* Empty wildcard ssid with a maxlen will match many or
potentially all SSIDs (maxlen == 32), therefore do potentially all SSIDs (maxlen == 32), therefore do
@ -928,8 +938,9 @@ mwifiex_config_scan(struct mwifiex_private *priv,
*filtered_scan = true; *filtered_scan = true;
if (user_scan_in->scan_chan_gap) { if (user_scan_in->scan_chan_gap) {
dev_dbg(adapter->dev, "info: scan: channel gap = %d\n", mwifiex_dbg(adapter, INFO,
user_scan_in->scan_chan_gap); "info: scan: channel gap = %d\n",
user_scan_in->scan_chan_gap);
*max_chan_per_scan = *max_chan_per_scan =
MWIFIEX_MAX_CHANNELS_PER_SPECIFIC_SCAN; MWIFIEX_MAX_CHANNELS_PER_SPECIFIC_SCAN;
@ -961,8 +972,9 @@ mwifiex_config_scan(struct mwifiex_private *priv,
add tlv */ add tlv */
if (num_probes) { if (num_probes) {
dev_dbg(adapter->dev, "info: scan: num_probes = %d\n", mwifiex_dbg(adapter, INFO,
num_probes); "info: scan: num_probes = %d\n",
num_probes);
num_probes_tlv = (struct mwifiex_ie_types_num_probes *) tlv_pos; num_probes_tlv = (struct mwifiex_ie_types_num_probes *) tlv_pos;
num_probes_tlv->header.type = cpu_to_le16(TLV_TYPE_NUMPROBES); num_probes_tlv->header.type = cpu_to_le16(TLV_TYPE_NUMPROBES);
@ -1003,7 +1015,8 @@ mwifiex_config_scan(struct mwifiex_private *priv,
if (user_scan_in && user_scan_in->chan_list[0].chan_number) { if (user_scan_in && user_scan_in->chan_list[0].chan_number) {
dev_dbg(adapter->dev, "info: Scan: Using supplied channel list\n"); mwifiex_dbg(adapter, INFO,
"info: Scan: Using supplied channel list\n");
for (chan_idx = 0; for (chan_idx = 0;
chan_idx < MWIFIEX_USER_SCAN_CHAN_MAX && chan_idx < MWIFIEX_USER_SCAN_CHAN_MAX &&
@ -1056,13 +1069,13 @@ mwifiex_config_scan(struct mwifiex_private *priv,
(user_scan_in->chan_list[0].chan_number == (user_scan_in->chan_list[0].chan_number ==
priv->curr_bss_params.bss_descriptor.channel)) { priv->curr_bss_params.bss_descriptor.channel)) {
*scan_current_only = true; *scan_current_only = true;
dev_dbg(adapter->dev, mwifiex_dbg(adapter, INFO,
"info: Scan: Scanning current channel only\n"); "info: Scan: Scanning current channel only\n");
} }
chan_num = chan_idx; chan_num = chan_idx;
} else { } else {
dev_dbg(adapter->dev, mwifiex_dbg(adapter, INFO,
"info: Scan: Creating full region channel list\n"); "info: Scan: Creating full region channel list\n");
chan_num = mwifiex_scan_create_channel_list(priv, user_scan_in, chan_num = mwifiex_scan_create_channel_list(priv, user_scan_in,
scan_chan_list, scan_chan_list,
*filtered_scan); *filtered_scan);
@ -1094,8 +1107,9 @@ mwifiex_ret_802_11_scan_get_tlv_ptrs(struct mwifiex_adapter *adapter,
tlv_buf_left = tlv_buf_size; tlv_buf_left = tlv_buf_size;
*tlv_data = NULL; *tlv_data = NULL;
dev_dbg(adapter->dev, "info: SCAN_RESP: tlv_buf_size = %d\n", mwifiex_dbg(adapter, INFO,
tlv_buf_size); "info: SCAN_RESP: tlv_buf_size = %d\n",
tlv_buf_size);
while (tlv_buf_left >= sizeof(struct mwifiex_ie_types_header)) { while (tlv_buf_left >= sizeof(struct mwifiex_ie_types_header)) {
@ -1103,26 +1117,31 @@ mwifiex_ret_802_11_scan_get_tlv_ptrs(struct mwifiex_adapter *adapter,
tlv_len = le16_to_cpu(current_tlv->header.len); tlv_len = le16_to_cpu(current_tlv->header.len);
if (sizeof(tlv->header) + tlv_len > tlv_buf_left) { if (sizeof(tlv->header) + tlv_len > tlv_buf_left) {
dev_err(adapter->dev, "SCAN_RESP: TLV buffer corrupt\n"); mwifiex_dbg(adapter, ERROR,
"SCAN_RESP: TLV buffer corrupt\n");
break; break;
} }
if (req_tlv_type == tlv_type) { if (req_tlv_type == tlv_type) {
switch (tlv_type) { switch (tlv_type) {
case TLV_TYPE_TSFTIMESTAMP: case TLV_TYPE_TSFTIMESTAMP:
dev_dbg(adapter->dev, "info: SCAN_RESP: TSF " mwifiex_dbg(adapter, INFO,
"timestamp TLV, len = %d\n", tlv_len); "info: SCAN_RESP: TSF\t"
"timestamp TLV, len = %d\n",
tlv_len);
*tlv_data = current_tlv; *tlv_data = current_tlv;
break; break;
case TLV_TYPE_CHANNELBANDLIST: case TLV_TYPE_CHANNELBANDLIST:
dev_dbg(adapter->dev, "info: SCAN_RESP: channel" mwifiex_dbg(adapter, INFO,
" band list TLV, len = %d\n", tlv_len); "info: SCAN_RESP: channel\t"
"band list TLV, len = %d\n",
tlv_len);
*tlv_data = current_tlv; *tlv_data = current_tlv;
break; break;
default: default:
dev_err(adapter->dev, mwifiex_dbg(adapter, ERROR,
"SCAN_RESP: unhandled TLV = %d\n", "SCAN_RESP: unhandled TLV = %d\n",
tlv_type); tlv_type);
/* Give up, this seems corrupted */ /* Give up, this seems corrupted */
return; return;
} }
@ -1177,8 +1196,9 @@ int mwifiex_update_bss_desc_with_ie(struct mwifiex_adapter *adapter,
total_ie_len = element_len + sizeof(struct ieee_types_header); total_ie_len = element_len + sizeof(struct ieee_types_header);
if (bytes_left < total_ie_len) { if (bytes_left < total_ie_len) {
dev_err(adapter->dev, "err: InterpretIE: in processing" mwifiex_dbg(adapter, ERROR,
" IE, bytes left < IE length\n"); "err: InterpretIE: in processing\t"
"IE, bytes left < IE length\n");
return -1; return -1;
} }
switch (element_id) { switch (element_id) {
@ -1186,9 +1206,9 @@ int mwifiex_update_bss_desc_with_ie(struct mwifiex_adapter *adapter,
bss_entry->ssid.ssid_len = element_len; bss_entry->ssid.ssid_len = element_len;
memcpy(bss_entry->ssid.ssid, (current_ptr + 2), memcpy(bss_entry->ssid.ssid, (current_ptr + 2),
element_len); element_len);
dev_dbg(adapter->dev, mwifiex_dbg(adapter, INFO,
"info: InterpretIE: ssid: %-32s\n", "info: InterpretIE: ssid: %-32s\n",
bss_entry->ssid.ssid); bss_entry->ssid.ssid);
break; break;
case WLAN_EID_SUPP_RATES: case WLAN_EID_SUPP_RATES:
@ -1419,19 +1439,20 @@ int mwifiex_scan_networks(struct mwifiex_private *priv,
unsigned long flags; unsigned long flags;
if (adapter->scan_processing) { if (adapter->scan_processing) {
dev_err(adapter->dev, "cmd: Scan already in process...\n"); mwifiex_dbg(adapter, WARN,
"cmd: Scan already in process...\n");
return -EBUSY; return -EBUSY;
} }
if (priv->scan_block) { if (priv->scan_block) {
dev_err(adapter->dev, mwifiex_dbg(adapter, WARN,
"cmd: Scan is blocked during association...\n"); "cmd: Scan is blocked during association...\n");
return -EBUSY; return -EBUSY;
} }
if (adapter->surprise_removed || adapter->is_cmd_timedout) { if (adapter->surprise_removed || adapter->is_cmd_timedout) {
dev_err(adapter->dev, mwifiex_dbg(adapter, ERROR,
"Ignore scan. Card removed or firmware in bad state\n"); "Ignore scan. Card removed or firmware in bad state\n");
return -EFAULT; return -EFAULT;
} }
@ -1478,7 +1499,8 @@ int mwifiex_scan_networks(struct mwifiex_private *priv,
/* Perform internal scan synchronously */ /* Perform internal scan synchronously */
if (!priv->scan_request) { if (!priv->scan_request) {
dev_dbg(adapter->dev, "wait internal scan\n"); mwifiex_dbg(adapter, INFO,
"wait internal scan\n");
mwifiex_wait_queue_complete(adapter, cmd_node); mwifiex_wait_queue_complete(adapter, cmd_node);
} }
} else { } else {
@ -1553,8 +1575,8 @@ int mwifiex_check_network_compatibility(struct mwifiex_private *priv,
ret = mwifiex_is_network_compatible(priv, bss_desc, ret = mwifiex_is_network_compatible(priv, bss_desc,
priv->bss_mode); priv->bss_mode);
if (ret) if (ret)
dev_err(priv->adapter->dev, mwifiex_dbg(priv->adapter, ERROR,
"Incompatible network settings\n"); "Incompatible network settings\n");
break; break;
default: default:
ret = 0; ret = 0;
@ -1656,7 +1678,8 @@ mwifiex_parse_single_response_buf(struct mwifiex_private *priv, u8 **bss_info,
*/ */
if (curr_bcn_bytes < ETH_ALEN + sizeof(u8) + if (curr_bcn_bytes < ETH_ALEN + sizeof(u8) +
sizeof(struct mwifiex_fixed_bcn_param)) { sizeof(struct mwifiex_fixed_bcn_param)) {
dev_err(adapter->dev, "InterpretIE: not enough bytes left\n"); mwifiex_dbg(adapter, ERROR,
"InterpretIE: not enough bytes left\n");
return -EFAULT; return -EFAULT;
} }
@ -1669,7 +1692,8 @@ mwifiex_parse_single_response_buf(struct mwifiex_private *priv, u8 **bss_info,
rssi = (-rssi) * 100; /* Convert dBm to mBm */ rssi = (-rssi) * 100; /* Convert dBm to mBm */
current_ptr += sizeof(u8); current_ptr += sizeof(u8);
curr_bcn_bytes -= sizeof(u8); curr_bcn_bytes -= sizeof(u8);
dev_dbg(adapter->dev, "info: InterpretIE: RSSI=%d\n", rssi); mwifiex_dbg(adapter, INFO,
"info: InterpretIE: RSSI=%d\n", rssi);
} else { } else {
rssi = rssi_val; rssi = rssi_val;
} }
@ -1682,14 +1706,16 @@ mwifiex_parse_single_response_buf(struct mwifiex_private *priv, u8 **bss_info,
beacon_period = le16_to_cpu(bcn_param->beacon_period); beacon_period = le16_to_cpu(bcn_param->beacon_period);
cap_info_bitmap = le16_to_cpu(bcn_param->cap_info_bitmap); cap_info_bitmap = le16_to_cpu(bcn_param->cap_info_bitmap);
dev_dbg(adapter->dev, "info: InterpretIE: capabilities=0x%X\n", mwifiex_dbg(adapter, INFO,
cap_info_bitmap); "info: InterpretIE: capabilities=0x%X\n",
cap_info_bitmap);
/* Rest of the current buffer are IE's */ /* Rest of the current buffer are IE's */
ie_buf = current_ptr; ie_buf = current_ptr;
ie_len = curr_bcn_bytes; ie_len = curr_bcn_bytes;
dev_dbg(adapter->dev, "info: InterpretIE: IELength for this AP = %d\n", mwifiex_dbg(adapter, INFO,
curr_bcn_bytes); "info: InterpretIE: IELength for this AP = %d\n",
curr_bcn_bytes);
while (curr_bcn_bytes >= sizeof(struct ieee_types_header)) { while (curr_bcn_bytes >= sizeof(struct ieee_types_header)) {
u8 element_id, element_len; u8 element_id, element_len;
@ -1698,8 +1724,8 @@ mwifiex_parse_single_response_buf(struct mwifiex_private *priv, u8 **bss_info,
element_len = *(current_ptr + 1); element_len = *(current_ptr + 1);
if (curr_bcn_bytes < element_len + if (curr_bcn_bytes < element_len +
sizeof(struct ieee_types_header)) { sizeof(struct ieee_types_header)) {
dev_err(adapter->dev, mwifiex_dbg(adapter, ERROR,
"%s: bytes left < IE length\n", __func__); "%s: bytes left < IE length\n", __func__);
return -EFAULT; return -EFAULT;
} }
if (element_id == WLAN_EID_DS_PARAMS) { if (element_id == WLAN_EID_DS_PARAMS) {
@ -1719,8 +1745,8 @@ mwifiex_parse_single_response_buf(struct mwifiex_private *priv, u8 **bss_info,
/* Skip entry if on csa closed channel */ /* Skip entry if on csa closed channel */
if (channel == priv->csa_chan) { if (channel == priv->csa_chan) {
dev_dbg(adapter->dev, mwifiex_dbg(adapter, WARN,
"Dropping entry on csa closed channel\n"); "Dropping entry on csa closed channel\n");
return 0; return 0;
} }
@ -1751,7 +1777,7 @@ mwifiex_parse_single_response_buf(struct mwifiex_private *priv, u8 **bss_info,
cfg80211_put_bss(priv->wdev.wiphy, bss); cfg80211_put_bss(priv->wdev.wiphy, bss);
} }
} else { } else {
dev_dbg(adapter->dev, "missing BSS channel IE\n"); mwifiex_dbg(adapter, WARN, "missing BSS channel IE\n");
} }
return 0; return 0;
@ -1765,7 +1791,8 @@ static void mwifiex_complete_scan(struct mwifiex_private *priv)
if (adapter->curr_cmd->wait_q_enabled) { if (adapter->curr_cmd->wait_q_enabled) {
adapter->cmd_wait_q.status = 0; adapter->cmd_wait_q.status = 0;
if (!priv->scan_request) { if (!priv->scan_request) {
dev_dbg(adapter->dev, "complete internal scan\n"); mwifiex_dbg(adapter, INFO,
"complete internal scan\n");
mwifiex_complete_cmd(adapter, adapter->curr_cmd); mwifiex_complete_cmd(adapter, adapter->curr_cmd);
} }
} }
@ -1788,12 +1815,14 @@ static void mwifiex_check_next_scan_command(struct mwifiex_private *priv)
mwifiex_complete_scan(priv); mwifiex_complete_scan(priv);
if (priv->scan_request) { if (priv->scan_request) {
dev_dbg(adapter->dev, "info: notifying scan done\n"); mwifiex_dbg(adapter, INFO,
"info: notifying scan done\n");
cfg80211_scan_done(priv->scan_request, 0); cfg80211_scan_done(priv->scan_request, 0);
priv->scan_request = NULL; priv->scan_request = NULL;
} else { } else {
priv->scan_aborting = false; priv->scan_aborting = false;
dev_dbg(adapter->dev, "info: scan already aborted\n"); mwifiex_dbg(adapter, INFO,
"info: scan already aborted\n");
} }
} else if ((priv->scan_aborting && !priv->scan_request) || } else if ((priv->scan_aborting && !priv->scan_request) ||
priv->scan_block) { priv->scan_block) {
@ -1809,12 +1838,14 @@ static void mwifiex_check_next_scan_command(struct mwifiex_private *priv)
spin_unlock_irqrestore(&adapter->mwifiex_cmd_lock, flags); spin_unlock_irqrestore(&adapter->mwifiex_cmd_lock, flags);
if (priv->scan_request) { if (priv->scan_request) {
dev_dbg(adapter->dev, "info: aborting scan\n"); mwifiex_dbg(adapter, INFO,
"info: aborting scan\n");
cfg80211_scan_done(priv->scan_request, 1); cfg80211_scan_done(priv->scan_request, 1);
priv->scan_request = NULL; priv->scan_request = NULL;
} else { } else {
priv->scan_aborting = false; priv->scan_aborting = false;
dev_dbg(adapter->dev, "info: scan already aborted\n"); mwifiex_dbg(adapter, INFO,
"info: scan already aborted\n");
} }
} else { } else {
/* Get scan command from scan_pending_q and put to /* Get scan command from scan_pending_q and put to
@ -1877,8 +1908,9 @@ int mwifiex_ret_802_11_scan(struct mwifiex_private *priv,
if (scan_rsp->number_of_sets > MWIFIEX_MAX_AP) { if (scan_rsp->number_of_sets > MWIFIEX_MAX_AP) {
dev_err(adapter->dev, "SCAN_RESP: too many AP returned (%d)\n", mwifiex_dbg(adapter, ERROR,
scan_rsp->number_of_sets); "SCAN_RESP: too many AP returned (%d)\n",
scan_rsp->number_of_sets);
ret = -1; ret = -1;
goto check_next_scan; goto check_next_scan;
} }
@ -1887,14 +1919,15 @@ int mwifiex_ret_802_11_scan(struct mwifiex_private *priv,
mwifiex_11h_get_csa_closed_channel(priv); mwifiex_11h_get_csa_closed_channel(priv);
bytes_left = le16_to_cpu(scan_rsp->bss_descript_size); bytes_left = le16_to_cpu(scan_rsp->bss_descript_size);
dev_dbg(adapter->dev, "info: SCAN_RESP: bss_descript_size %d\n", mwifiex_dbg(adapter, INFO,
bytes_left); "info: SCAN_RESP: bss_descript_size %d\n",
bytes_left);
scan_resp_size = le16_to_cpu(resp->size); scan_resp_size = le16_to_cpu(resp->size);
dev_dbg(adapter->dev, mwifiex_dbg(adapter, INFO,
"info: SCAN_RESP: returned %d APs before parsing\n", "info: SCAN_RESP: returned %d APs before parsing\n",
scan_rsp->number_of_sets); scan_rsp->number_of_sets);
bss_info = scan_rsp->bss_desc_and_tlv_buffer; bss_info = scan_rsp->bss_desc_and_tlv_buffer;
@ -2007,13 +2040,13 @@ mwifiex_update_chan_statistics(struct mwifiex_private *priv,
le16_to_cpu(fw_chan_stats->cca_scan_dur); le16_to_cpu(fw_chan_stats->cca_scan_dur);
chan_stats.cca_busy_dur = chan_stats.cca_busy_dur =
le16_to_cpu(fw_chan_stats->cca_busy_dur); le16_to_cpu(fw_chan_stats->cca_busy_dur);
dev_dbg(adapter->dev, mwifiex_dbg(adapter, INFO,
"chan=%d, noise=%d, total_network=%d scan_duration=%d, busy_duration=%d\n", "chan=%d, noise=%d, total_network=%d scan_duration=%d, busy_duration=%d\n",
chan_stats.chan_num, chan_stats.chan_num,
chan_stats.noise, chan_stats.noise,
chan_stats.total_bss, chan_stats.total_bss,
chan_stats.cca_scan_dur, chan_stats.cca_scan_dur,
chan_stats.cca_busy_dur); chan_stats.cca_busy_dur);
memcpy(&adapter->chan_stats[adapter->survey_idx++], &chan_stats, memcpy(&adapter->chan_stats[adapter->survey_idx++], &chan_stats,
sizeof(struct mwifiex_chan_stats)); sizeof(struct mwifiex_chan_stats));
fw_chan_stats++; fw_chan_stats++;
@ -2035,7 +2068,7 @@ int mwifiex_ret_802_11_scan_ext(struct mwifiex_private *priv,
unsigned long cmd_flags, scan_flags; unsigned long cmd_flags, scan_flags;
bool complete_scan = false; bool complete_scan = false;
dev_dbg(priv->adapter->dev, "info: EXT scan returns successfully\n"); mwifiex_dbg(adapter, INFO, "info: EXT scan returns successfully\n");
ext_scan_resp = &resp->params.ext_scan; ext_scan_resp = &resp->params.ext_scan;
@ -2048,8 +2081,8 @@ int mwifiex_ret_802_11_scan_ext(struct mwifiex_private *priv,
len = le16_to_cpu(tlv->len); len = le16_to_cpu(tlv->len);
if (buf_left < (sizeof(struct mwifiex_ie_types_header) + len)) { if (buf_left < (sizeof(struct mwifiex_ie_types_header) + len)) {
dev_err(adapter->dev, mwifiex_dbg(adapter, ERROR,
"error processing scan response TLVs"); "error processing scan response TLVs");
break; break;
} }
@ -2075,8 +2108,8 @@ int mwifiex_ret_802_11_scan_ext(struct mwifiex_private *priv,
cmd_ptr = (void *)cmd_node->cmd_skb->data; cmd_ptr = (void *)cmd_node->cmd_skb->data;
if (le16_to_cpu(cmd_ptr->command) == if (le16_to_cpu(cmd_ptr->command) ==
HostCmd_CMD_802_11_SCAN_EXT) { HostCmd_CMD_802_11_SCAN_EXT) {
dev_dbg(priv->adapter->dev, mwifiex_dbg(adapter, INFO,
"Scan pending in command pending list"); "Scan pending in command pending list");
complete_scan = false; complete_scan = false;
break; break;
} }
@ -2114,17 +2147,17 @@ int mwifiex_handle_event_ext_scan_report(struct mwifiex_private *priv,
u16 scan_resp_size = le16_to_cpu(event_scan->buf_size); u16 scan_resp_size = le16_to_cpu(event_scan->buf_size);
if (num_of_set > MWIFIEX_MAX_AP) { if (num_of_set > MWIFIEX_MAX_AP) {
dev_err(adapter->dev, mwifiex_dbg(adapter, ERROR,
"EXT_SCAN: Invalid number of AP returned (%d)!!\n", "EXT_SCAN: Invalid number of AP returned (%d)!!\n",
num_of_set); num_of_set);
ret = -1; ret = -1;
goto check_next_scan; goto check_next_scan;
} }
bytes_left = scan_resp_size; bytes_left = scan_resp_size;
dev_dbg(adapter->dev, mwifiex_dbg(adapter, INFO,
"EXT_SCAN: size %d, returned %d APs...", "EXT_SCAN: size %d, returned %d APs...",
scan_resp_size, num_of_set); scan_resp_size, num_of_set);
mwifiex_dbg_dump(adapter, CMD_D, "EXT_SCAN buffer:", buf, mwifiex_dbg_dump(adapter, CMD_D, "EXT_SCAN buffer:", buf,
scan_resp_size + scan_resp_size +
sizeof(struct mwifiex_event_scan_result)); sizeof(struct mwifiex_event_scan_result));
@ -2135,7 +2168,8 @@ int mwifiex_handle_event_ext_scan_report(struct mwifiex_private *priv,
type = le16_to_cpu(tlv->header.type); type = le16_to_cpu(tlv->header.type);
len = le16_to_cpu(tlv->header.len); len = le16_to_cpu(tlv->header.len);
if (bytes_left < sizeof(struct mwifiex_ie_types_header) + len) { if (bytes_left < sizeof(struct mwifiex_ie_types_header) + len) {
dev_err(adapter->dev, "EXT_SCAN: Error bytes left < TLV length\n"); mwifiex_dbg(adapter, ERROR,
"EXT_SCAN: Error bytes left < TLV length\n");
break; break;
} }
scan_rsp_tlv = NULL; scan_rsp_tlv = NULL;
@ -2161,8 +2195,9 @@ int mwifiex_handle_event_ext_scan_report(struct mwifiex_private *priv,
len = le16_to_cpu(tlv->header.len); len = le16_to_cpu(tlv->header.len);
if (bytes_left_for_tlv < if (bytes_left_for_tlv <
sizeof(struct mwifiex_ie_types_header) + len) { sizeof(struct mwifiex_ie_types_header) + len) {
dev_err(adapter->dev, mwifiex_dbg(adapter, ERROR,
"EXT_SCAN: Error in processing TLV, bytes left < TLV length\n"); "EXT_SCAN: Error in processing TLV,\t"
"bytes left < TLV length\n");
scan_rsp_tlv = NULL; scan_rsp_tlv = NULL;
bytes_left_for_tlv = 0; bytes_left_for_tlv = 0;
continue; continue;
@ -2202,8 +2237,8 @@ int mwifiex_handle_event_ext_scan_report(struct mwifiex_private *priv,
if (scan_info_tlv) { if (scan_info_tlv) {
rssi = (s32)(s16)(le16_to_cpu(scan_info_tlv->rssi)); rssi = (s32)(s16)(le16_to_cpu(scan_info_tlv->rssi));
rssi *= 100; /* Convert dBm to mBm */ rssi *= 100; /* Convert dBm to mBm */
dev_dbg(adapter->dev, mwifiex_dbg(adapter, INFO,
"info: InterpretIE: RSSI=%d\n", rssi); "info: InterpretIE: RSSI=%d\n", rssi);
fw_tsf = le64_to_cpu(scan_info_tlv->tsf); fw_tsf = le64_to_cpu(scan_info_tlv->tsf);
radio_type = &scan_info_tlv->radio_type; radio_type = &scan_info_tlv->radio_type;
} else { } else {
@ -2274,13 +2309,14 @@ static int mwifiex_scan_specific_ssid(struct mwifiex_private *priv,
struct mwifiex_user_scan_cfg *scan_cfg; struct mwifiex_user_scan_cfg *scan_cfg;
if (adapter->scan_processing) { if (adapter->scan_processing) {
dev_err(adapter->dev, "cmd: Scan already in process...\n"); mwifiex_dbg(adapter, WARN,
"cmd: Scan already in process...\n");
return -EBUSY; return -EBUSY;
} }
if (priv->scan_block) { if (priv->scan_block) {
dev_err(adapter->dev, mwifiex_dbg(adapter, WARN,
"cmd: Scan is blocked during association...\n"); "cmd: Scan is blocked during association...\n");
return -EBUSY; return -EBUSY;
} }
@ -2312,8 +2348,9 @@ int mwifiex_request_scan(struct mwifiex_private *priv,
int ret; int ret;
if (down_interruptible(&priv->async_sem)) { if (down_interruptible(&priv->async_sem)) {
dev_err(priv->adapter->dev, "%s: acquire semaphore\n", mwifiex_dbg(priv->adapter, ERROR,
__func__); "%s: acquire semaphore fail\n",
__func__);
return -1; return -1;
} }
@ -2403,8 +2440,9 @@ mwifiex_save_curr_bcn(struct mwifiex_private *priv)
memcpy(priv->curr_bcn_buf, curr_bss->beacon_buf, memcpy(priv->curr_bcn_buf, curr_bss->beacon_buf,
curr_bss->beacon_buf_size); curr_bss->beacon_buf_size);
dev_dbg(priv->adapter->dev, "info: current beacon saved %d\n", mwifiex_dbg(priv->adapter, INFO,
priv->curr_bcn_size); "info: current beacon saved %d\n",
priv->curr_bcn_size);
curr_bss->beacon_buf = priv->curr_bcn_buf; curr_bss->beacon_buf = priv->curr_bcn_buf;

View File

@ -166,7 +166,8 @@ static int mwifiex_sdio_resume(struct device *dev)
adapter = card->adapter; adapter = card->adapter;
if (!adapter->is_suspended) { if (!adapter->is_suspended) {
dev_warn(adapter->dev, "device already resumed\n"); mwifiex_dbg(adapter, WARN,
"device already resumed\n");
return 0; return 0;
} }
@ -191,8 +192,6 @@ mwifiex_sdio_remove(struct sdio_func *func)
struct mwifiex_adapter *adapter; struct mwifiex_adapter *adapter;
struct mwifiex_private *priv; struct mwifiex_private *priv;
pr_debug("info: SDIO func num=%d\n", func->num);
card = sdio_get_drvdata(func); card = sdio_get_drvdata(func);
if (!card) if (!card)
return; return;
@ -201,6 +200,8 @@ mwifiex_sdio_remove(struct sdio_func *func)
if (!adapter || !adapter->priv_num) if (!adapter || !adapter->priv_num)
return; return;
mwifiex_dbg(adapter, INFO, "info: SDIO func num=%d\n", func->num);
if (user_rmmod) { if (user_rmmod) {
if (adapter->is_suspended) if (adapter->is_suspended)
mwifiex_sdio_resume(adapter->dev); mwifiex_sdio_resume(adapter->dev);
@ -257,12 +258,14 @@ static int mwifiex_sdio_suspend(struct device *dev)
/* Enable the Host Sleep */ /* Enable the Host Sleep */
if (!mwifiex_enable_hs(adapter)) { if (!mwifiex_enable_hs(adapter)) {
dev_err(adapter->dev, "cmd: failed to suspend\n"); mwifiex_dbg(adapter, ERROR,
"cmd: failed to suspend\n");
adapter->hs_enabling = false; adapter->hs_enabling = false;
return -EFAULT; return -EFAULT;
} }
dev_dbg(adapter->dev, "cmd: suspend with MMC_PM_KEEP_POWER\n"); mwifiex_dbg(adapter, INFO,
"cmd: suspend with MMC_PM_KEEP_POWER\n");
ret = sdio_set_host_pm_flags(func, MMC_PM_KEEP_POWER); ret = sdio_set_host_pm_flags(func, MMC_PM_KEEP_POWER);
/* Indicate device suspended */ /* Indicate device suspended */
@ -386,8 +389,8 @@ mwifiex_write_data_sync(struct mwifiex_adapter *adapter,
u32 ioport = (port & MWIFIEX_SDIO_IO_PORT_MASK); u32 ioport = (port & MWIFIEX_SDIO_IO_PORT_MASK);
if (adapter->is_suspended) { if (adapter->is_suspended) {
dev_err(adapter->dev, mwifiex_dbg(adapter, ERROR,
"%s: not allowed while suspended\n", __func__); "%s: not allowed while suspended\n", __func__);
return -1; return -1;
} }
@ -434,7 +437,8 @@ 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)
{ {
dev_dbg(adapter->dev, "event: wakeup device...\n"); mwifiex_dbg(adapter, EVENT,
"event: wakeup device...\n");
return mwifiex_write_reg(adapter, CONFIGURATION_REG, HOST_POWER_UP); return mwifiex_write_reg(adapter, CONFIGURATION_REG, HOST_POWER_UP);
} }
@ -446,7 +450,8 @@ 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)
{ {
dev_dbg(adapter->dev, "cmd: wakeup device completed\n"); mwifiex_dbg(adapter, EVENT,
"cmd: wakeup device completed\n");
return mwifiex_write_reg(adapter, CONFIGURATION_REG, 0); return mwifiex_write_reg(adapter, CONFIGURATION_REG, 0);
} }
@ -524,7 +529,8 @@ static int mwifiex_init_sdio_ioport(struct mwifiex_adapter *adapter)
else else
return -1; return -1;
cont: cont:
pr_debug("info: SDIO FUNC1 IO port: %#x\n", adapter->ioport); mwifiex_dbg(adapter, INFO,
"info: SDIO FUNC1 IO port: %#x\n", adapter->ioport);
/* Set Host interrupt reset to read to clear */ /* Set Host interrupt reset to read to clear */
if (!mwifiex_read_reg(adapter, card->reg->host_int_rsr_reg, &reg)) if (!mwifiex_read_reg(adapter, card->reg->host_int_rsr_reg, &reg))
@ -556,10 +562,12 @@ static int mwifiex_write_data_to_card(struct mwifiex_adapter *adapter,
ret = mwifiex_write_data_sync(adapter, payload, pkt_len, port); ret = mwifiex_write_data_sync(adapter, payload, pkt_len, port);
if (ret) { if (ret) {
i++; i++;
dev_err(adapter->dev, "host_to_card, write iomem" mwifiex_dbg(adapter, ERROR,
" (%d) failed: %d\n", i, ret); "host_to_card, write iomem\t"
"(%d) failed: %d\n", i, ret);
if (mwifiex_write_reg(adapter, CONFIGURATION_REG, 0x04)) if (mwifiex_write_reg(adapter, CONFIGURATION_REG, 0x04))
dev_err(adapter->dev, "write CFG reg failed\n"); mwifiex_dbg(adapter, ERROR,
"write CFG reg failed\n");
ret = -1; ret = -1;
if (i > MAX_WRITE_IOMEM_RETRY) if (i > MAX_WRITE_IOMEM_RETRY)
@ -584,7 +592,8 @@ static int mwifiex_get_rd_port(struct mwifiex_adapter *adapter, u8 *port)
const struct mwifiex_sdio_card_reg *reg = card->reg; const struct mwifiex_sdio_card_reg *reg = card->reg;
u32 rd_bitmap = card->mp_rd_bitmap; u32 rd_bitmap = card->mp_rd_bitmap;
dev_dbg(adapter->dev, "data: mp_rd_bitmap=0x%08x\n", rd_bitmap); mwifiex_dbg(adapter, DATA,
"data: mp_rd_bitmap=0x%08x\n", rd_bitmap);
if (card->supports_sdio_new_mode) { if (card->supports_sdio_new_mode) {
if (!(rd_bitmap & reg->data_port_mask)) if (!(rd_bitmap & reg->data_port_mask))
@ -598,8 +607,9 @@ static int mwifiex_get_rd_port(struct mwifiex_adapter *adapter, u8 *port)
(card->mp_rd_bitmap & CTRL_PORT_MASK)) { (card->mp_rd_bitmap & CTRL_PORT_MASK)) {
card->mp_rd_bitmap &= (u32) (~CTRL_PORT_MASK); card->mp_rd_bitmap &= (u32) (~CTRL_PORT_MASK);
*port = CTRL_PORT; *port = CTRL_PORT;
dev_dbg(adapter->dev, "data: port=%d mp_rd_bitmap=0x%08x\n", mwifiex_dbg(adapter, DATA,
*port, card->mp_rd_bitmap); "data: port=%d mp_rd_bitmap=0x%08x\n",
*port, card->mp_rd_bitmap);
return 0; return 0;
} }
@ -613,9 +623,9 @@ static int mwifiex_get_rd_port(struct mwifiex_adapter *adapter, u8 *port)
if (++card->curr_rd_port == card->max_ports) if (++card->curr_rd_port == card->max_ports)
card->curr_rd_port = reg->start_rd_port; card->curr_rd_port = reg->start_rd_port;
dev_dbg(adapter->dev, mwifiex_dbg(adapter, DATA,
"data: port=%d mp_rd_bitmap=0x%08x -> 0x%08x\n", "data: port=%d mp_rd_bitmap=0x%08x -> 0x%08x\n",
*port, rd_bitmap, card->mp_rd_bitmap); *port, rd_bitmap, card->mp_rd_bitmap);
return 0; return 0;
} }
@ -633,7 +643,8 @@ static int mwifiex_get_wr_port_data(struct mwifiex_adapter *adapter, u32 *port)
const struct mwifiex_sdio_card_reg *reg = card->reg; const struct mwifiex_sdio_card_reg *reg = card->reg;
u32 wr_bitmap = card->mp_wr_bitmap; u32 wr_bitmap = card->mp_wr_bitmap;
dev_dbg(adapter->dev, "data: mp_wr_bitmap=0x%08x\n", wr_bitmap); mwifiex_dbg(adapter, DATA,
"data: mp_wr_bitmap=0x%08x\n", wr_bitmap);
if (!(wr_bitmap & card->mp_data_port_mask)) { if (!(wr_bitmap & card->mp_data_port_mask)) {
adapter->data_sent = true; adapter->data_sent = true;
@ -651,15 +662,16 @@ static int mwifiex_get_wr_port_data(struct mwifiex_adapter *adapter, u32 *port)
} }
if ((card->has_control_mask) && (*port == CTRL_PORT)) { if ((card->has_control_mask) && (*port == CTRL_PORT)) {
dev_err(adapter->dev, mwifiex_dbg(adapter, ERROR,
"invalid data port=%d cur port=%d mp_wr_bitmap=0x%08x -> 0x%08x\n", "invalid data port=%d cur port=%d mp_wr_bitmap=0x%08x -> 0x%08x\n",
*port, card->curr_wr_port, wr_bitmap, *port, card->curr_wr_port, wr_bitmap,
card->mp_wr_bitmap); card->mp_wr_bitmap);
return -1; return -1;
} }
dev_dbg(adapter->dev, "data: port=%d mp_wr_bitmap=0x%08x -> 0x%08x\n", mwifiex_dbg(adapter, DATA,
*port, wr_bitmap, card->mp_wr_bitmap); "data: port=%d mp_wr_bitmap=0x%08x -> 0x%08x\n",
*port, wr_bitmap, card->mp_wr_bitmap);
return 0; return 0;
} }
@ -683,7 +695,8 @@ mwifiex_sdio_poll_card_status(struct mwifiex_adapter *adapter, u8 bits)
usleep_range(10, 20); usleep_range(10, 20);
} }
dev_err(adapter->dev, "poll card status failed, tries = %d\n", tries); mwifiex_dbg(adapter, ERROR,
"poll card status failed, tries = %d\n", tries);
return -1; return -1;
} }
@ -738,7 +751,7 @@ static void mwifiex_interrupt_status(struct mwifiex_adapter *adapter)
if (mwifiex_read_data_sync(adapter, card->mp_regs, if (mwifiex_read_data_sync(adapter, card->mp_regs,
card->reg->max_mp_regs, card->reg->max_mp_regs,
REG_PORT | MWIFIEX_SDIO_BYTE_MODE_MASK, 0)) { REG_PORT | MWIFIEX_SDIO_BYTE_MODE_MASK, 0)) {
dev_err(adapter->dev, "read mp_regs failed\n"); mwifiex_dbg(adapter, ERROR, "read mp_regs failed\n");
return; return;
} }
@ -751,7 +764,8 @@ static void mwifiex_interrupt_status(struct mwifiex_adapter *adapter)
* UP_LD_CMD_PORT_HOST_INT_STATUS * UP_LD_CMD_PORT_HOST_INT_STATUS
* Clear the interrupt status register * Clear the interrupt status register
*/ */
dev_dbg(adapter->dev, "int: sdio_ireg = %#x\n", sdio_ireg); mwifiex_dbg(adapter, INTR,
"int: sdio_ireg = %#x\n", sdio_ireg);
spin_lock_irqsave(&adapter->int_lock, flags); spin_lock_irqsave(&adapter->int_lock, flags);
adapter->int_status |= sdio_ireg; adapter->int_status |= sdio_ireg;
spin_unlock_irqrestore(&adapter->int_lock, flags); spin_unlock_irqrestore(&adapter->int_lock, flags);
@ -802,7 +816,8 @@ static int mwifiex_sdio_enable_host_int(struct mwifiex_adapter *adapter)
/* Request the SDIO IRQ */ /* Request the SDIO IRQ */
ret = sdio_claim_irq(func, mwifiex_sdio_interrupt); ret = sdio_claim_irq(func, mwifiex_sdio_interrupt);
if (ret) { if (ret) {
dev_err(adapter->dev, "claim irq failed: ret=%d\n", ret); mwifiex_dbg(adapter, ERROR,
"claim irq failed: ret=%d\n", ret);
goto out; goto out;
} }
@ -810,7 +825,8 @@ static int mwifiex_sdio_enable_host_int(struct mwifiex_adapter *adapter)
ret = mwifiex_write_reg_locked(func, card->reg->host_int_mask_reg, ret = mwifiex_write_reg_locked(func, card->reg->host_int_mask_reg,
card->reg->host_int_enable); card->reg->host_int_enable);
if (ret) { if (ret) {
dev_err(adapter->dev, "enable host interrupt failed\n"); mwifiex_dbg(adapter, ERROR,
"enable host interrupt failed\n");
sdio_release_irq(func); sdio_release_irq(func);
} }
@ -830,22 +846,25 @@ static int mwifiex_sdio_card_to_host(struct mwifiex_adapter *adapter,
u32 nb; u32 nb;
if (!buffer) { if (!buffer) {
dev_err(adapter->dev, "%s: buffer is NULL\n", __func__); mwifiex_dbg(adapter, ERROR,
"%s: buffer is NULL\n", __func__);
return -1; return -1;
} }
ret = mwifiex_read_data_sync(adapter, buffer, npayload, ioport, 1); ret = mwifiex_read_data_sync(adapter, buffer, npayload, ioport, 1);
if (ret) { if (ret) {
dev_err(adapter->dev, "%s: read iomem failed: %d\n", __func__, mwifiex_dbg(adapter, ERROR,
"%s: read iomem failed: %d\n", __func__,
ret); ret);
return -1; return -1;
} }
nb = le16_to_cpu(*(__le16 *) (buffer)); nb = le16_to_cpu(*(__le16 *) (buffer));
if (nb > npayload) { if (nb > npayload) {
dev_err(adapter->dev, "%s: invalid packet, nb=%d npayload=%d\n", mwifiex_dbg(adapter, ERROR,
__func__, nb, npayload); "%s: invalid packet, nb=%d npayload=%d\n",
__func__, nb, npayload);
return -1; return -1;
} }
@ -877,13 +896,14 @@ static int mwifiex_prog_fw_w_helper(struct mwifiex_adapter *adapter,
u32 i = 0; u32 i = 0;
if (!firmware_len) { if (!firmware_len) {
dev_err(adapter->dev, mwifiex_dbg(adapter, ERROR,
"firmware image not found! Terminating download\n"); "firmware image not found! Terminating download\n");
return -1; return -1;
} }
dev_dbg(adapter->dev, "info: downloading FW image (%d bytes)\n", mwifiex_dbg(adapter, INFO,
firmware_len); "info: downloading FW image (%d bytes)\n",
firmware_len);
/* Assume that the allocated buffer is 8-byte aligned */ /* Assume that the allocated buffer is 8-byte aligned */
fwbuf = kzalloc(MWIFIEX_UPLD_SIZE, GFP_KERNEL); fwbuf = kzalloc(MWIFIEX_UPLD_SIZE, GFP_KERNEL);
@ -897,8 +917,9 @@ static int mwifiex_prog_fw_w_helper(struct mwifiex_adapter *adapter,
ret = mwifiex_sdio_poll_card_status(adapter, CARD_IO_READY | ret = mwifiex_sdio_poll_card_status(adapter, CARD_IO_READY |
DN_LD_CARD_RDY); DN_LD_CARD_RDY);
if (ret) { if (ret) {
dev_err(adapter->dev, "FW download with helper:" mwifiex_dbg(adapter, ERROR,
" poll status timeout @ %d\n", offset); "FW download with helper:\t"
"poll status timeout @ %d\n", offset);
goto done; goto done;
} }
@ -910,19 +931,19 @@ static int mwifiex_prog_fw_w_helper(struct mwifiex_adapter *adapter,
ret = mwifiex_read_reg(adapter, reg->base_0_reg, ret = mwifiex_read_reg(adapter, reg->base_0_reg,
&base0); &base0);
if (ret) { if (ret) {
dev_err(adapter->dev, mwifiex_dbg(adapter, ERROR,
"dev BASE0 register read failed: " "dev BASE0 register read failed:\t"
"base0=%#04X(%d). Terminating dnld\n", "base0=%#04X(%d). Terminating dnld\n",
base0, base0); base0, base0);
goto done; goto done;
} }
ret = mwifiex_read_reg(adapter, reg->base_1_reg, ret = mwifiex_read_reg(adapter, reg->base_1_reg,
&base1); &base1);
if (ret) { if (ret) {
dev_err(adapter->dev, mwifiex_dbg(adapter, ERROR,
"dev BASE1 register read failed: " "dev BASE1 register read failed:\t"
"base1=%#04X(%d). Terminating dnld\n", "base1=%#04X(%d). Terminating dnld\n",
base1, base1); base1, base1);
goto done; goto done;
} }
len = (u16) (((base1 & 0xff) << 8) | (base0 & 0xff)); len = (u16) (((base1 & 0xff) << 8) | (base0 & 0xff));
@ -936,9 +957,9 @@ static int mwifiex_prog_fw_w_helper(struct mwifiex_adapter *adapter,
if (!len) { if (!len) {
break; break;
} else if (len > MWIFIEX_UPLD_SIZE) { } else if (len > MWIFIEX_UPLD_SIZE) {
dev_err(adapter->dev, mwifiex_dbg(adapter, ERROR,
"FW dnld failed @ %d, invalid length %d\n", "FW dnld failed @ %d, invalid length %d\n",
offset, len); offset, len);
ret = -1; ret = -1;
goto done; goto done;
} }
@ -948,14 +969,15 @@ static int mwifiex_prog_fw_w_helper(struct mwifiex_adapter *adapter,
if (len & BIT(0)) { if (len & BIT(0)) {
i++; i++;
if (i > MAX_WRITE_IOMEM_RETRY) { if (i > MAX_WRITE_IOMEM_RETRY) {
dev_err(adapter->dev, mwifiex_dbg(adapter, ERROR,
"FW dnld failed @ %d, over max retry\n", "FW dnld failed @ %d, over max retry\n",
offset); offset);
ret = -1; ret = -1;
goto done; goto done;
} }
dev_err(adapter->dev, "CRC indicated by the helper:" mwifiex_dbg(adapter, ERROR,
" len = 0x%04X, txlen = %d\n", len, txlen); "CRC indicated by the helper:\t"
"len = 0x%04X, txlen = %d\n", len, txlen);
len &= ~BIT(0); len &= ~BIT(0);
/* Setting this to 0 to resend from same offset */ /* Setting this to 0 to resend from same offset */
txlen = 0; txlen = 0;
@ -978,11 +1000,12 @@ static int mwifiex_prog_fw_w_helper(struct mwifiex_adapter *adapter,
MWIFIEX_SDIO_BLOCK_SIZE, MWIFIEX_SDIO_BLOCK_SIZE,
adapter->ioport); adapter->ioport);
if (ret) { if (ret) {
dev_err(adapter->dev, mwifiex_dbg(adapter, ERROR,
"FW download, write iomem (%d) failed @ %d\n", "FW download, write iomem (%d) failed @ %d\n",
i, offset); i, offset);
if (mwifiex_write_reg(adapter, CONFIGURATION_REG, 0x04)) if (mwifiex_write_reg(adapter, CONFIGURATION_REG, 0x04))
dev_err(adapter->dev, "write CFG reg failed\n"); mwifiex_dbg(adapter, ERROR,
"write CFG reg failed\n");
ret = -1; ret = -1;
goto done; goto done;
@ -991,8 +1014,8 @@ static int mwifiex_prog_fw_w_helper(struct mwifiex_adapter *adapter,
offset += txlen; offset += txlen;
} while (true); } while (true);
dev_notice(adapter->dev, mwifiex_dbg(adapter, MSG,
"info: FW download over, size %d bytes\n", offset); "info: FW download over, size %d bytes\n", offset);
ret = 0; ret = 0;
done: done:
@ -1066,18 +1089,20 @@ static void mwifiex_deaggr_sdio_pkt(struct mwifiex_adapter *adapter,
blk_num = *(data + BLOCK_NUMBER_OFFSET); blk_num = *(data + BLOCK_NUMBER_OFFSET);
blk_size = adapter->sdio_rx_block_size * blk_num; blk_size = adapter->sdio_rx_block_size * blk_num;
if (blk_size > total_pkt_len) { if (blk_size > total_pkt_len) {
dev_err(adapter->dev, "%s: error in pkt,\t" mwifiex_dbg(adapter, ERROR,
"blk_num=%d, blk_size=%d, total_pkt_len=%d\n", "%s: error in blk_size,\t"
__func__, blk_num, blk_size, total_pkt_len); "blk_num=%d, blk_size=%d, total_pkt_len=%d\n",
__func__, blk_num, blk_size, total_pkt_len);
break; break;
} }
pkt_len = le16_to_cpu(*(__le16 *)(data + SDIO_HEADER_OFFSET)); pkt_len = le16_to_cpu(*(__le16 *)(data + SDIO_HEADER_OFFSET));
pkt_type = le16_to_cpu(*(__le16 *)(data + SDIO_HEADER_OFFSET + pkt_type = le16_to_cpu(*(__le16 *)(data + SDIO_HEADER_OFFSET +
2)); 2));
if ((pkt_len + SDIO_HEADER_OFFSET) > blk_size) { if ((pkt_len + SDIO_HEADER_OFFSET) > blk_size) {
dev_err(adapter->dev, "%s: error in pkt,\t" mwifiex_dbg(adapter, ERROR,
"pkt_len=%d, blk_size=%d\n", "%s: error in pkt_len,\t"
__func__, pkt_len, blk_size); "pkt_len=%d, blk_size=%d\n",
__func__, pkt_len, blk_size);
break; break;
} }
skb_deaggr = mwifiex_alloc_dma_align_buf(pkt_len, skb_deaggr = mwifiex_alloc_dma_align_buf(pkt_len,
@ -1116,7 +1141,8 @@ static int mwifiex_decode_rx_packet(struct mwifiex_adapter *adapter,
switch (upld_typ) { switch (upld_typ) {
case MWIFIEX_TYPE_AGGR_DATA: case MWIFIEX_TYPE_AGGR_DATA:
dev_dbg(adapter->dev, "info: --- Rx: Aggr Data packet ---\n"); mwifiex_dbg(adapter, INFO,
"info: --- Rx: Aggr Data packet ---\n");
rx_info = MWIFIEX_SKB_RXCB(skb); rx_info = MWIFIEX_SKB_RXCB(skb);
rx_info->buf_type = MWIFIEX_TYPE_AGGR_DATA; rx_info->buf_type = MWIFIEX_TYPE_AGGR_DATA;
if (adapter->rx_work_enabled) { if (adapter->rx_work_enabled) {
@ -1130,7 +1156,8 @@ static int mwifiex_decode_rx_packet(struct mwifiex_adapter *adapter,
break; break;
case MWIFIEX_TYPE_DATA: case MWIFIEX_TYPE_DATA:
dev_dbg(adapter->dev, "info: --- Rx: Data packet ---\n"); mwifiex_dbg(adapter, DATA,
"info: --- Rx: Data packet ---\n");
if (adapter->rx_work_enabled) { if (adapter->rx_work_enabled) {
skb_queue_tail(&adapter->rx_data_q, skb); skb_queue_tail(&adapter->rx_data_q, skb);
adapter->data_received = true; adapter->data_received = true;
@ -1141,7 +1168,8 @@ static int mwifiex_decode_rx_packet(struct mwifiex_adapter *adapter,
break; break;
case MWIFIEX_TYPE_CMD: case MWIFIEX_TYPE_CMD:
dev_dbg(adapter->dev, "info: --- Rx: Cmd Response ---\n"); mwifiex_dbg(adapter, CMD,
"info: --- Rx: Cmd Response ---\n");
/* take care of curr_cmd = NULL case */ /* take care of curr_cmd = NULL case */
if (!adapter->curr_cmd) { if (!adapter->curr_cmd) {
cmd_buf = adapter->upld_buf; cmd_buf = adapter->upld_buf;
@ -1163,7 +1191,8 @@ static int mwifiex_decode_rx_packet(struct mwifiex_adapter *adapter,
break; break;
case MWIFIEX_TYPE_EVENT: case MWIFIEX_TYPE_EVENT:
dev_dbg(adapter->dev, "info: --- Rx: Event ---\n"); mwifiex_dbg(adapter, EVENT,
"info: --- Rx: Event ---\n");
adapter->event_cause = le32_to_cpu(*(__le32 *) skb->data); adapter->event_cause = le32_to_cpu(*(__le32 *) skb->data);
if ((skb->len > 0) && (skb->len < MAX_EVENT_SIZE)) if ((skb->len > 0) && (skb->len < MAX_EVENT_SIZE))
@ -1178,7 +1207,8 @@ static int mwifiex_decode_rx_packet(struct mwifiex_adapter *adapter,
break; break;
default: default:
dev_err(adapter->dev, "unknown upload type %#x\n", upld_typ); mwifiex_dbg(adapter, ERROR,
"unknown upload type %#x\n", upld_typ);
dev_kfree_skb_any(skb); dev_kfree_skb_any(skb);
break; break;
} }
@ -1210,16 +1240,18 @@ static int mwifiex_sdio_card_to_host_mp_aggr(struct mwifiex_adapter *adapter,
if ((card->has_control_mask) && (port == CTRL_PORT)) { if ((card->has_control_mask) && (port == CTRL_PORT)) {
/* Read the command Resp without aggr */ /* Read the command Resp without aggr */
dev_dbg(adapter->dev, "info: %s: no aggregation for cmd " mwifiex_dbg(adapter, CMD,
"response\n", __func__); "info: %s: no aggregation for cmd\t"
"response\n", __func__);
f_do_rx_cur = 1; f_do_rx_cur = 1;
goto rx_curr_single; goto rx_curr_single;
} }
if (!card->mpa_rx.enabled) { if (!card->mpa_rx.enabled) {
dev_dbg(adapter->dev, "info: %s: rx aggregation disabled\n", mwifiex_dbg(adapter, WARN,
__func__); "info: %s: rx aggregation disabled\n",
__func__);
f_do_rx_cur = 1; f_do_rx_cur = 1;
goto rx_curr_single; goto rx_curr_single;
@ -1230,7 +1262,8 @@ static int mwifiex_sdio_card_to_host_mp_aggr(struct mwifiex_adapter *adapter,
(card->has_control_mask && (card->mp_rd_bitmap & (card->has_control_mask && (card->mp_rd_bitmap &
(~((u32) CTRL_PORT_MASK))))) { (~((u32) CTRL_PORT_MASK))))) {
/* Some more data RX pending */ /* Some more data RX pending */
dev_dbg(adapter->dev, "info: %s: not last packet\n", __func__); mwifiex_dbg(adapter, INFO,
"info: %s: not last packet\n", __func__);
if (MP_RX_AGGR_IN_PROGRESS(card)) { if (MP_RX_AGGR_IN_PROGRESS(card)) {
if (MP_RX_AGGR_BUF_HAS_ROOM(card, rx_len)) { if (MP_RX_AGGR_BUF_HAS_ROOM(card, rx_len)) {
@ -1247,7 +1280,8 @@ static int mwifiex_sdio_card_to_host_mp_aggr(struct mwifiex_adapter *adapter,
} else { } else {
/* No more data RX pending */ /* No more data RX pending */
dev_dbg(adapter->dev, "info: %s: last packet\n", __func__); mwifiex_dbg(adapter, INFO,
"info: %s: last packet\n", __func__);
if (MP_RX_AGGR_IN_PROGRESS(card)) { if (MP_RX_AGGR_IN_PROGRESS(card)) {
f_do_rx_aggr = 1; f_do_rx_aggr = 1;
@ -1262,14 +1296,16 @@ static int mwifiex_sdio_card_to_host_mp_aggr(struct mwifiex_adapter *adapter,
} }
if (f_aggr_cur) { if (f_aggr_cur) {
dev_dbg(adapter->dev, "info: current packet aggregation\n"); mwifiex_dbg(adapter, INFO,
"info: current packet aggregation\n");
/* Curr pkt can be aggregated */ /* Curr pkt can be aggregated */
mp_rx_aggr_setup(card, rx_len, port); mp_rx_aggr_setup(card, rx_len, port);
if (MP_RX_AGGR_PKT_LIMIT_REACHED(card) || if (MP_RX_AGGR_PKT_LIMIT_REACHED(card) ||
mp_rx_aggr_port_limit_reached(card)) { mp_rx_aggr_port_limit_reached(card)) {
dev_dbg(adapter->dev, "info: %s: aggregated packet " mwifiex_dbg(adapter, INFO,
"limit reached\n", __func__); "info: %s: aggregated packet\t"
"limit reached\n", __func__);
/* No more pkts allowed in Aggr buf, rx it */ /* No more pkts allowed in Aggr buf, rx it */
f_do_rx_aggr = 1; f_do_rx_aggr = 1;
} }
@ -1277,8 +1313,9 @@ static int mwifiex_sdio_card_to_host_mp_aggr(struct mwifiex_adapter *adapter,
if (f_do_rx_aggr) { if (f_do_rx_aggr) {
/* do aggr RX now */ /* do aggr RX now */
dev_dbg(adapter->dev, "info: do_rx_aggr: num of packets: %d\n", mwifiex_dbg(adapter, DATA,
card->mpa_rx.pkt_cnt); "info: do_rx_aggr: num of packets: %d\n",
card->mpa_rx.pkt_cnt);
if (card->supports_sdio_new_mode) { if (card->supports_sdio_new_mode) {
int i; int i;
@ -1318,8 +1355,9 @@ static int mwifiex_sdio_card_to_host_mp_aggr(struct mwifiex_adapter *adapter,
GFP_KERNEL | GFP_KERNEL |
GFP_DMA); GFP_DMA);
if (!skb_deaggr) { if (!skb_deaggr) {
dev_err(adapter->dev, "skb allocation failure drop pkt len=%d type=%d\n", mwifiex_dbg(adapter, ERROR, "skb allocation failure\t"
pkt_len, pkt_type); "drop pkt len=%d type=%d\n",
pkt_len, pkt_type);
curr_ptr += len_arr[pind]; curr_ptr += len_arr[pind];
continue; continue;
} }
@ -1339,12 +1377,12 @@ static int mwifiex_sdio_card_to_host_mp_aggr(struct mwifiex_adapter *adapter,
mwifiex_decode_rx_packet(adapter, skb_deaggr, mwifiex_decode_rx_packet(adapter, skb_deaggr,
pkt_type); pkt_type);
} else { } else {
dev_err(adapter->dev, " drop wrong aggr pkt:\t" mwifiex_dbg(adapter, ERROR,
"sdio_single_port_rx_aggr=%d\t" "drop wrong aggr pkt:\t"
"type=%d len=%d max_len=%d\n", "sdio_single_port_rx_aggr=%d\t"
adapter->sdio_rx_aggr_enable, "type=%d len=%d max_len=%d\n",
pkt_type, pkt_len, adapter->sdio_rx_aggr_enable,
len_arr[pind]); pkt_type, pkt_len, len_arr[pind]);
dev_kfree_skb_any(skb_deaggr); dev_kfree_skb_any(skb_deaggr);
} }
curr_ptr += len_arr[pind]; curr_ptr += len_arr[pind];
@ -1354,13 +1392,14 @@ static int mwifiex_sdio_card_to_host_mp_aggr(struct mwifiex_adapter *adapter,
rx_curr_single: rx_curr_single:
if (f_do_rx_cur) { if (f_do_rx_cur) {
dev_dbg(adapter->dev, "info: RX: port: %d, rx_len: %d\n", mwifiex_dbg(adapter, INFO, "info: RX: port: %d, rx_len: %d\n",
port, rx_len); port, rx_len);
skb = mwifiex_alloc_dma_align_buf(rx_len, GFP_KERNEL | GFP_DMA); skb = mwifiex_alloc_dma_align_buf(rx_len, GFP_KERNEL | GFP_DMA);
if (!skb) { if (!skb) {
dev_err(adapter->dev, "single skb allocated fail,\t" mwifiex_dbg(adapter, ERROR,
"drop pkt port=%d len=%d\n", port, rx_len); "single skb allocated fail,\t"
"drop pkt port=%d len=%d\n", port, rx_len);
if (mwifiex_sdio_card_to_host(adapter, &pkt_type, if (mwifiex_sdio_card_to_host(adapter, &pkt_type,
card->mpa_rx.buf, rx_len, card->mpa_rx.buf, rx_len,
adapter->ioport + port)) adapter->ioport + port))
@ -1376,9 +1415,9 @@ rx_curr_single:
goto error; goto error;
if (!adapter->sdio_rx_aggr_enable && if (!adapter->sdio_rx_aggr_enable &&
pkt_type == MWIFIEX_TYPE_AGGR_DATA) { pkt_type == MWIFIEX_TYPE_AGGR_DATA) {
dev_err(adapter->dev, "drop wrong pkt type %d\t" mwifiex_dbg(adapter, ERROR, "drop wrong pkt type %d\t"
"current SDIO RX Aggr not enabled\n", "current SDIO RX Aggr not enabled\n",
pkt_type); pkt_type);
dev_kfree_skb_any(skb); dev_kfree_skb_any(skb);
return 0; return 0;
} }
@ -1386,7 +1425,8 @@ rx_curr_single:
mwifiex_decode_rx_packet(adapter, skb, pkt_type); mwifiex_decode_rx_packet(adapter, skb, pkt_type);
} }
if (f_post_aggr_cur) { if (f_post_aggr_cur) {
dev_dbg(adapter->dev, "info: current packet aggregation\n"); mwifiex_dbg(adapter, INFO,
"info: current packet aggregation\n");
/* Curr pkt can be aggregated */ /* Curr pkt can be aggregated */
mp_rx_aggr_setup(card, rx_len, port); mp_rx_aggr_setup(card, rx_len, port);
} }
@ -1458,7 +1498,7 @@ static int mwifiex_process_int_status(struct mwifiex_adapter *adapter)
MWIFIEX_RX_DATA_BUF_SIZE) MWIFIEX_RX_DATA_BUF_SIZE)
return -1; return -1;
rx_len = (u16) (rx_blocks * MWIFIEX_SDIO_BLOCK_SIZE); rx_len = (u16) (rx_blocks * MWIFIEX_SDIO_BLOCK_SIZE);
dev_dbg(adapter->dev, "info: rx_len = %d\n", rx_len); mwifiex_dbg(adapter, INFO, "info: rx_len = %d\n", rx_len);
skb = mwifiex_alloc_dma_align_buf(rx_len, GFP_KERNEL | GFP_DMA); skb = mwifiex_alloc_dma_align_buf(rx_len, GFP_KERNEL | GFP_DMA);
if (!skb) if (!skb)
@ -1469,17 +1509,17 @@ static int mwifiex_process_int_status(struct mwifiex_adapter *adapter)
if (mwifiex_sdio_card_to_host(adapter, &pkt_type, skb->data, if (mwifiex_sdio_card_to_host(adapter, &pkt_type, skb->data,
skb->len, adapter->ioport | skb->len, adapter->ioport |
CMD_PORT_SLCT)) { CMD_PORT_SLCT)) {
dev_err(adapter->dev, mwifiex_dbg(adapter, ERROR,
"%s: failed to card_to_host", __func__); "%s: failed to card_to_host", __func__);
dev_kfree_skb_any(skb); dev_kfree_skb_any(skb);
goto term_cmd; goto term_cmd;
} }
if ((pkt_type != MWIFIEX_TYPE_CMD) && if ((pkt_type != MWIFIEX_TYPE_CMD) &&
(pkt_type != MWIFIEX_TYPE_EVENT)) (pkt_type != MWIFIEX_TYPE_EVENT))
dev_err(adapter->dev, mwifiex_dbg(adapter, ERROR,
"%s:Received wrong packet on cmd port", "%s:Received wrong packet on cmd port",
__func__); __func__);
mwifiex_decode_rx_packet(adapter, skb, pkt_type); mwifiex_decode_rx_packet(adapter, skb, pkt_type);
} }
@ -1495,12 +1535,13 @@ static int mwifiex_process_int_status(struct mwifiex_adapter *adapter)
} }
card->mp_wr_bitmap = bitmap; card->mp_wr_bitmap = bitmap;
dev_dbg(adapter->dev, "int: DNLD: wr_bitmap=0x%x\n", mwifiex_dbg(adapter, INTR,
card->mp_wr_bitmap); "int: DNLD: wr_bitmap=0x%x\n",
card->mp_wr_bitmap);
if (adapter->data_sent && if (adapter->data_sent &&
(card->mp_wr_bitmap & card->mp_data_port_mask)) { (card->mp_wr_bitmap & card->mp_data_port_mask)) {
dev_dbg(adapter->dev, mwifiex_dbg(adapter, INTR,
"info: <--- Tx DONE Interrupt --->\n"); "info: <--- Tx DONE Interrupt --->\n");
adapter->data_sent = false; adapter->data_sent = false;
} }
} }
@ -1517,8 +1558,8 @@ static int mwifiex_process_int_status(struct mwifiex_adapter *adapter)
adapter->cmd_sent = false; adapter->cmd_sent = false;
} }
dev_dbg(adapter->dev, "info: cmd_sent=%d data_sent=%d\n", mwifiex_dbg(adapter, INTR, "info: cmd_sent=%d data_sent=%d\n",
adapter->cmd_sent, adapter->data_sent); adapter->cmd_sent, adapter->data_sent);
if (sdio_ireg & UP_LD_HOST_INT_STATUS) { if (sdio_ireg & UP_LD_HOST_INT_STATUS) {
bitmap = (u32) card->mp_regs[reg->rd_bitmap_l]; bitmap = (u32) card->mp_regs[reg->rd_bitmap_l];
bitmap |= ((u32) card->mp_regs[reg->rd_bitmap_u]) << 8; bitmap |= ((u32) card->mp_regs[reg->rd_bitmap_u]) << 8;
@ -1529,40 +1570,45 @@ static int mwifiex_process_int_status(struct mwifiex_adapter *adapter)
((u32) card->mp_regs[reg->rd_bitmap_1u]) << 24; ((u32) card->mp_regs[reg->rd_bitmap_1u]) << 24;
} }
card->mp_rd_bitmap = bitmap; card->mp_rd_bitmap = bitmap;
dev_dbg(adapter->dev, "int: UPLD: rd_bitmap=0x%x\n", mwifiex_dbg(adapter, INTR,
card->mp_rd_bitmap); "int: UPLD: rd_bitmap=0x%x\n",
card->mp_rd_bitmap);
while (true) { while (true) {
ret = mwifiex_get_rd_port(adapter, &port); ret = mwifiex_get_rd_port(adapter, &port);
if (ret) { if (ret) {
dev_dbg(adapter->dev, mwifiex_dbg(adapter, INFO,
"info: no more rd_port available\n"); "info: no more rd_port available\n");
break; break;
} }
len_reg_l = reg->rd_len_p0_l + (port << 1); len_reg_l = reg->rd_len_p0_l + (port << 1);
len_reg_u = reg->rd_len_p0_u + (port << 1); len_reg_u = reg->rd_len_p0_u + (port << 1);
rx_len = ((u16) card->mp_regs[len_reg_u]) << 8; rx_len = ((u16) card->mp_regs[len_reg_u]) << 8;
rx_len |= (u16) card->mp_regs[len_reg_l]; rx_len |= (u16) card->mp_regs[len_reg_l];
dev_dbg(adapter->dev, "info: RX: port=%d rx_len=%u\n", mwifiex_dbg(adapter, INFO,
port, rx_len); "info: RX: port=%d rx_len=%u\n",
port, rx_len);
rx_blocks = rx_blocks =
(rx_len + MWIFIEX_SDIO_BLOCK_SIZE - (rx_len + MWIFIEX_SDIO_BLOCK_SIZE -
1) / MWIFIEX_SDIO_BLOCK_SIZE; 1) / MWIFIEX_SDIO_BLOCK_SIZE;
if (rx_len <= INTF_HEADER_LEN || if (rx_len <= INTF_HEADER_LEN ||
(rx_blocks * MWIFIEX_SDIO_BLOCK_SIZE) > (rx_blocks * MWIFIEX_SDIO_BLOCK_SIZE) >
card->mpa_rx.buf_size) { card->mpa_rx.buf_size) {
dev_err(adapter->dev, "invalid rx_len=%d\n", mwifiex_dbg(adapter, ERROR,
rx_len); "invalid rx_len=%d\n",
rx_len);
return -1; return -1;
} }
rx_len = (u16) (rx_blocks * MWIFIEX_SDIO_BLOCK_SIZE); rx_len = (u16) (rx_blocks * MWIFIEX_SDIO_BLOCK_SIZE);
dev_dbg(adapter->dev, "info: rx_len = %d\n", rx_len); mwifiex_dbg(adapter, INFO, "info: rx_len = %d\n",
rx_len);
if (mwifiex_sdio_card_to_host_mp_aggr(adapter, rx_len, if (mwifiex_sdio_card_to_host_mp_aggr(adapter, rx_len,
port)) { port)) {
dev_err(adapter->dev, "card_to_host_mpa failed:" mwifiex_dbg(adapter, ERROR,
" int status=%#x\n", sdio_ireg); "card_to_host_mpa failed: int status=%#x\n",
sdio_ireg);
goto term_cmd; goto term_cmd;
} }
} }
@ -1573,19 +1619,23 @@ static int mwifiex_process_int_status(struct mwifiex_adapter *adapter)
term_cmd: term_cmd:
/* terminate cmd */ /* terminate cmd */
if (mwifiex_read_reg(adapter, CONFIGURATION_REG, &cr)) if (mwifiex_read_reg(adapter, CONFIGURATION_REG, &cr))
dev_err(adapter->dev, "read CFG reg failed\n"); mwifiex_dbg(adapter, ERROR, "read CFG reg failed\n");
else else
dev_dbg(adapter->dev, "info: CFG reg val = %d\n", cr); mwifiex_dbg(adapter, INFO,
"info: CFG reg val = %d\n", cr);
if (mwifiex_write_reg(adapter, CONFIGURATION_REG, (cr | 0x04))) if (mwifiex_write_reg(adapter, CONFIGURATION_REG, (cr | 0x04)))
dev_err(adapter->dev, "write CFG reg failed\n"); mwifiex_dbg(adapter, ERROR,
"write CFG reg failed\n");
else else
dev_dbg(adapter->dev, "info: write success\n"); mwifiex_dbg(adapter, INFO, "info: write success\n");
if (mwifiex_read_reg(adapter, CONFIGURATION_REG, &cr)) if (mwifiex_read_reg(adapter, CONFIGURATION_REG, &cr))
dev_err(adapter->dev, "read CFG reg failed\n"); mwifiex_dbg(adapter, ERROR,
"read CFG reg failed\n");
else else
dev_dbg(adapter->dev, "info: CFG reg val =%x\n", cr); mwifiex_dbg(adapter, INFO,
"info: CFG reg val =%x\n", cr);
return -1; return -1;
} }
@ -1619,8 +1669,9 @@ static int mwifiex_host_to_card_mp_aggr(struct mwifiex_adapter *adapter,
if (!card->mpa_tx.enabled || if (!card->mpa_tx.enabled ||
(card->has_control_mask && (port == CTRL_PORT)) || (card->has_control_mask && (port == CTRL_PORT)) ||
(card->supports_sdio_new_mode && (port == CMD_PORT_SLCT))) { (card->supports_sdio_new_mode && (port == CMD_PORT_SLCT))) {
dev_dbg(adapter->dev, "info: %s: tx aggregation disabled\n", mwifiex_dbg(adapter, WARN,
__func__); "info: %s: tx aggregation disabled\n",
__func__);
f_send_cur_buf = 1; f_send_cur_buf = 1;
goto tx_curr_single; goto tx_curr_single;
@ -1628,8 +1679,9 @@ static int mwifiex_host_to_card_mp_aggr(struct mwifiex_adapter *adapter,
if (next_pkt_len) { if (next_pkt_len) {
/* More pkt in TX queue */ /* More pkt in TX queue */
dev_dbg(adapter->dev, "info: %s: more packets in queue.\n", mwifiex_dbg(adapter, INFO,
__func__); "info: %s: more packets in queue.\n",
__func__);
if (MP_TX_AGGR_IN_PROGRESS(card)) { if (MP_TX_AGGR_IN_PROGRESS(card)) {
if (MP_TX_AGGR_BUF_HAS_ROOM(card, pkt_len)) { if (MP_TX_AGGR_BUF_HAS_ROOM(card, pkt_len)) {
@ -1659,8 +1711,9 @@ static int mwifiex_host_to_card_mp_aggr(struct mwifiex_adapter *adapter,
} }
} else { } else {
/* Last pkt in TX queue */ /* Last pkt in TX queue */
dev_dbg(adapter->dev, "info: %s: Last packet in Tx Queue.\n", mwifiex_dbg(adapter, INFO,
__func__); "info: %s: Last packet in Tx Queue.\n",
__func__);
if (MP_TX_AGGR_IN_PROGRESS(card)) { if (MP_TX_AGGR_IN_PROGRESS(card)) {
/* some packs in Aggr buf already */ /* some packs in Aggr buf already */
@ -1677,8 +1730,9 @@ static int mwifiex_host_to_card_mp_aggr(struct mwifiex_adapter *adapter,
} }
if (f_precopy_cur_buf) { if (f_precopy_cur_buf) {
dev_dbg(adapter->dev, "data: %s: precopy current buffer\n", mwifiex_dbg(adapter, DATA,
__func__); "data: %s: precopy current buffer\n",
__func__);
MP_TX_AGGR_BUF_PUT(card, payload, pkt_len, port); MP_TX_AGGR_BUF_PUT(card, payload, pkt_len, port);
if (MP_TX_AGGR_PKT_LIMIT_REACHED(card) || if (MP_TX_AGGR_PKT_LIMIT_REACHED(card) ||
@ -1688,9 +1742,10 @@ static int mwifiex_host_to_card_mp_aggr(struct mwifiex_adapter *adapter,
} }
if (f_send_aggr_buf) { if (f_send_aggr_buf) {
dev_dbg(adapter->dev, "data: %s: send aggr buffer: %d %d\n", mwifiex_dbg(adapter, DATA,
__func__, "data: %s: send aggr buffer: %d %d\n",
card->mpa_tx.start_port, card->mpa_tx.ports); __func__, card->mpa_tx.start_port,
card->mpa_tx.ports);
if (card->supports_sdio_new_mode) { if (card->supports_sdio_new_mode) {
u32 port_count; u32 port_count;
int i; int i;
@ -1719,15 +1774,17 @@ static int mwifiex_host_to_card_mp_aggr(struct mwifiex_adapter *adapter,
tx_curr_single: tx_curr_single:
if (f_send_cur_buf) { if (f_send_cur_buf) {
dev_dbg(adapter->dev, "data: %s: send current buffer %d\n", mwifiex_dbg(adapter, DATA,
__func__, port); "data: %s: send current buffer %d\n",
__func__, port);
ret = mwifiex_write_data_to_card(adapter, payload, pkt_len, ret = mwifiex_write_data_to_card(adapter, payload, pkt_len,
adapter->ioport + port); adapter->ioport + port);
} }
if (f_postcopy_cur_buf) { if (f_postcopy_cur_buf) {
dev_dbg(adapter->dev, "data: %s: postcopy current buffer\n", mwifiex_dbg(adapter, DATA,
__func__); "data: %s: postcopy current buffer\n",
__func__);
MP_TX_AGGR_BUF_PUT(card, payload, pkt_len, port); MP_TX_AGGR_BUF_PUT(card, payload, pkt_len, port);
} }
@ -1771,8 +1828,9 @@ static int mwifiex_sdio_host_to_card(struct mwifiex_adapter *adapter,
if (type == MWIFIEX_TYPE_DATA) { if (type == MWIFIEX_TYPE_DATA) {
ret = mwifiex_get_wr_port_data(adapter, &port); ret = mwifiex_get_wr_port_data(adapter, &port);
if (ret) { if (ret) {
dev_err(adapter->dev, "%s: no wr_port available\n", mwifiex_dbg(adapter, ERROR,
__func__); "%s: no wr_port available\n",
__func__);
return ret; return ret;
} }
} else { } else {
@ -1781,8 +1839,9 @@ static int mwifiex_sdio_host_to_card(struct mwifiex_adapter *adapter,
if (pkt_len <= INTF_HEADER_LEN || if (pkt_len <= INTF_HEADER_LEN ||
pkt_len > MWIFIEX_UPLD_SIZE) pkt_len > MWIFIEX_UPLD_SIZE)
dev_err(adapter->dev, "%s: payload=%p, nb=%d\n", mwifiex_dbg(adapter, ERROR,
__func__, payload, pkt_len); "%s: payload=%p, nb=%d\n",
__func__, payload, pkt_len);
if (card->supports_sdio_new_mode) if (card->supports_sdio_new_mode)
port = CMD_PORT_SLCT; port = CMD_PORT_SLCT;
@ -1896,7 +1955,8 @@ static int mwifiex_register_dev(struct mwifiex_adapter *adapter)
ret = sdio_set_block_size(card->func, MWIFIEX_SDIO_BLOCK_SIZE); ret = sdio_set_block_size(card->func, MWIFIEX_SDIO_BLOCK_SIZE);
sdio_release_host(func); sdio_release_host(func);
if (ret) { if (ret) {
pr_err("cannot set SDIO block size\n"); mwifiex_dbg(adapter, ERROR,
"cannot set SDIO block size\n");
return ret; return ret;
} }
@ -1977,7 +2037,8 @@ static int mwifiex_init_sdio(struct mwifiex_adapter *adapter)
card->mp_tx_agg_buf_size, card->mp_tx_agg_buf_size,
card->mp_rx_agg_buf_size); card->mp_rx_agg_buf_size);
if (ret) { if (ret) {
dev_err(adapter->dev, "failed to alloc sdio mp-a buffers\n"); mwifiex_dbg(adapter, ERROR,
"failed to alloc sdio mp-a buffers\n");
kfree(card->mp_regs); kfree(card->mp_regs);
return -1; return -1;
} }
@ -2041,8 +2102,9 @@ mwifiex_update_mp_end_port(struct mwifiex_adapter *adapter, u16 port)
card->curr_wr_port = reg->start_wr_port; card->curr_wr_port = reg->start_wr_port;
dev_dbg(adapter->dev, "cmd: mp_end_port %d, data port mask 0x%x\n", mwifiex_dbg(adapter, CMD,
port, card->mp_data_port_mask); "cmd: mp_end_port %d, data port mask 0x%x\n",
port, card->mp_data_port_mask);
} }
static struct mwifiex_adapter *save_adapter; static struct mwifiex_adapter *save_adapter;
@ -2059,7 +2121,7 @@ static void mwifiex_sdio_card_reset_work(struct mwifiex_adapter *adapter)
* We run it in a totally independent workqueue. * We run it in a totally independent workqueue.
*/ */
pr_err("Resetting card...\n"); mwifiex_dbg(adapter, WARN, "Resetting card...\n");
mmc_remove_host(target); mmc_remove_host(target);
/* 200ms delay is based on experiment with sdhci controller */ /* 200ms delay is based on experiment with sdhci controller */
mdelay(200); mdelay(200);
@ -2079,14 +2141,14 @@ rdwr_status mwifiex_sdio_rdwr_firmware(struct mwifiex_adapter *adapter,
sdio_writeb(card->func, FW_DUMP_HOST_READY, card->reg->fw_dump_ctrl, sdio_writeb(card->func, FW_DUMP_HOST_READY, card->reg->fw_dump_ctrl,
&ret); &ret);
if (ret) { if (ret) {
dev_err(adapter->dev, "SDIO Write ERR\n"); mwifiex_dbg(adapter, ERROR, "SDIO Write ERR\n");
return RDWR_STATUS_FAILURE; return RDWR_STATUS_FAILURE;
} }
for (tries = 0; tries < MAX_POLL_TRIES; tries++) { for (tries = 0; tries < MAX_POLL_TRIES; tries++) {
ctrl_data = sdio_readb(card->func, card->reg->fw_dump_ctrl, ctrl_data = sdio_readb(card->func, card->reg->fw_dump_ctrl,
&ret); &ret);
if (ret) { if (ret) {
dev_err(adapter->dev, "SDIO read err\n"); mwifiex_dbg(adapter, ERROR, "SDIO read err\n");
return RDWR_STATUS_FAILURE; return RDWR_STATUS_FAILURE;
} }
if (ctrl_data == FW_DUMP_DONE) if (ctrl_data == FW_DUMP_DONE)
@ -2094,19 +2156,20 @@ rdwr_status mwifiex_sdio_rdwr_firmware(struct mwifiex_adapter *adapter,
if (doneflag && ctrl_data == doneflag) if (doneflag && ctrl_data == doneflag)
return RDWR_STATUS_DONE; return RDWR_STATUS_DONE;
if (ctrl_data != FW_DUMP_HOST_READY) { if (ctrl_data != FW_DUMP_HOST_READY) {
dev_info(adapter->dev, mwifiex_dbg(adapter, WARN,
"The ctrl reg was changed, re-try again!\n"); "The ctrl reg was changed, re-try again!\n");
sdio_writeb(card->func, FW_DUMP_HOST_READY, sdio_writeb(card->func, FW_DUMP_HOST_READY,
card->reg->fw_dump_ctrl, &ret); card->reg->fw_dump_ctrl, &ret);
if (ret) { if (ret) {
dev_err(adapter->dev, "SDIO write err\n"); mwifiex_dbg(adapter, ERROR, "SDIO write err\n");
return RDWR_STATUS_FAILURE; return RDWR_STATUS_FAILURE;
} }
} }
usleep_range(100, 200); usleep_range(100, 200);
} }
if (ctrl_data == FW_DUMP_HOST_READY) { if (ctrl_data == FW_DUMP_HOST_READY) {
dev_err(adapter->dev, "Fail to pull ctrl_data\n"); mwifiex_dbg(adapter, ERROR,
"Fail to pull ctrl_data\n");
return RDWR_STATUS_FAILURE; return RDWR_STATUS_FAILURE;
} }
@ -2142,7 +2205,7 @@ static void mwifiex_sdio_fw_dump_work(struct mwifiex_adapter *adapter)
mwifiex_pm_wakeup_card(adapter); mwifiex_pm_wakeup_card(adapter);
sdio_claim_host(card->func); sdio_claim_host(card->func);
dev_info(adapter->dev, "== mwifiex firmware dump start ==\n"); mwifiex_dbg(adapter, MSG, "== mwifiex firmware dump start ==\n");
stat = mwifiex_sdio_rdwr_firmware(adapter, doneflag); stat = mwifiex_sdio_rdwr_firmware(adapter, doneflag);
if (stat == RDWR_STATUS_FAILURE) if (stat == RDWR_STATUS_FAILURE)
@ -2152,7 +2215,7 @@ static void mwifiex_sdio_fw_dump_work(struct mwifiex_adapter *adapter)
/* Read the number of the memories which will dump */ /* Read the number of the memories which will dump */
dump_num = sdio_readb(card->func, reg, &ret); dump_num = sdio_readb(card->func, reg, &ret);
if (ret) { if (ret) {
dev_err(adapter->dev, "SDIO read memory length err\n"); mwifiex_dbg(adapter, ERROR, "SDIO read memory length err\n");
goto done; goto done;
} }
@ -2169,7 +2232,7 @@ static void mwifiex_sdio_fw_dump_work(struct mwifiex_adapter *adapter)
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
read_reg = sdio_readb(card->func, reg, &ret); read_reg = sdio_readb(card->func, reg, &ret);
if (ret) { if (ret) {
dev_err(adapter->dev, "SDIO read err\n"); mwifiex_dbg(adapter, ERROR, "SDIO read err\n");
goto done; goto done;
} }
memory_size |= (read_reg << i*8); memory_size |= (read_reg << i*8);
@ -2177,25 +2240,26 @@ static void mwifiex_sdio_fw_dump_work(struct mwifiex_adapter *adapter)
} }
if (memory_size == 0) { if (memory_size == 0) {
dev_info(adapter->dev, "Firmware dump Finished!\n"); mwifiex_dbg(adapter, DUMP, "Firmware dump Finished!\n");
break; break;
} }
dev_info(adapter->dev, mwifiex_dbg(adapter, DUMP,
"%s_SIZE=0x%x\n", entry->mem_name, memory_size); "%s_SIZE=0x%x\n", entry->mem_name, memory_size);
entry->mem_ptr = vmalloc(memory_size + 1); entry->mem_ptr = vmalloc(memory_size + 1);
entry->mem_size = memory_size; entry->mem_size = memory_size;
if (!entry->mem_ptr) { if (!entry->mem_ptr) {
dev_err(adapter->dev, "Vmalloc %s failed\n", mwifiex_dbg(adapter, ERROR, "Vmalloc %s failed\n",
entry->mem_name); entry->mem_name);
goto done; goto done;
} }
dbg_ptr = entry->mem_ptr; dbg_ptr = entry->mem_ptr;
end_ptr = dbg_ptr + memory_size; end_ptr = dbg_ptr + memory_size;
doneflag = entry->done_flag; doneflag = entry->done_flag;
dev_info(adapter->dev, "Start %s output, please wait...\n", mwifiex_dbg(adapter, DUMP,
entry->mem_name); "Start %s output, please wait...\n",
entry->mem_name);
do { do {
stat = mwifiex_sdio_rdwr_firmware(adapter, doneflag); stat = mwifiex_sdio_rdwr_firmware(adapter, doneflag);
@ -2207,26 +2271,26 @@ static void mwifiex_sdio_fw_dump_work(struct mwifiex_adapter *adapter)
for (reg = reg_start; reg <= reg_end; reg++) { for (reg = reg_start; reg <= reg_end; reg++) {
*dbg_ptr = sdio_readb(card->func, reg, &ret); *dbg_ptr = sdio_readb(card->func, reg, &ret);
if (ret) { if (ret) {
dev_err(adapter->dev, mwifiex_dbg(adapter, ERROR,
"SDIO read err\n"); "SDIO read err\n");
goto done; goto done;
} }
if (dbg_ptr < end_ptr) if (dbg_ptr < end_ptr)
dbg_ptr++; dbg_ptr++;
else else
dev_err(adapter->dev, mwifiex_dbg(adapter, ERROR,
"Allocated buf not enough\n"); "Allocated buf not enough\n");
} }
if (stat != RDWR_STATUS_DONE) if (stat != RDWR_STATUS_DONE)
continue; continue;
dev_info(adapter->dev, "%s done: size=0x%tx\n", mwifiex_dbg(adapter, DUMP, "%s done: size=0x%tx\n",
entry->mem_name, dbg_ptr - entry->mem_ptr); entry->mem_name, dbg_ptr - entry->mem_ptr);
break; break;
} while (1); } while (1);
} }
dev_info(adapter->dev, "== mwifiex firmware dump end ==\n"); mwifiex_dbg(adapter, MSG, "== mwifiex firmware dump end ==\n");
kobject_uevent_env(&adapter->wiphy->dev.kobj, KOBJ_CHANGE, env); kobject_uevent_env(&adapter->wiphy->dev.kobj, KOBJ_CHANGE, env);
@ -2285,7 +2349,7 @@ mwifiex_sdio_reg_dump(struct mwifiex_adapter *adapter, char *drv_buf)
if (!p) if (!p)
return 0; return 0;
dev_info(adapter->dev, "SDIO register DUMP START\n"); mwifiex_dbg(adapter, MSG, "SDIO register DUMP START\n");
mwifiex_pm_wakeup_card(adapter); mwifiex_pm_wakeup_card(adapter);
@ -2351,13 +2415,13 @@ mwifiex_sdio_reg_dump(struct mwifiex_adapter *adapter, char *drv_buf)
reg++; reg++;
} }
dev_info(adapter->dev, "%s\n", buf); mwifiex_dbg(adapter, MSG, "%s\n", buf);
p += sprintf(p, "%s\n", buf); p += sprintf(p, "%s\n", buf);
} }
sdio_release_host(cardp->func); sdio_release_host(cardp->func);
dev_info(adapter->dev, "SDIO register DUMP END\n"); mwifiex_dbg(adapter, MSG, "SDIO register DUMP END\n");
return p - drv_buf; return p - drv_buf;
} }

View File

@ -77,8 +77,8 @@ static int mwifiex_cmd_mac_control(struct mwifiex_private *priv,
struct host_cmd_ds_mac_control *mac_ctrl = &cmd->params.mac_ctrl; struct host_cmd_ds_mac_control *mac_ctrl = &cmd->params.mac_ctrl;
if (cmd_action != HostCmd_ACT_GEN_SET) { if (cmd_action != HostCmd_ACT_GEN_SET) {
dev_err(priv->adapter->dev, mwifiex_dbg(priv->adapter, ERROR,
"mac_control: only support set cmd\n"); "mac_control: only support set cmd\n");
return -1; return -1;
} }
@ -112,7 +112,8 @@ static int mwifiex_cmd_802_11_snmp_mib(struct mwifiex_private *priv,
{ {
struct host_cmd_ds_802_11_snmp_mib *snmp_mib = &cmd->params.smib; struct host_cmd_ds_802_11_snmp_mib *snmp_mib = &cmd->params.smib;
dev_dbg(priv->adapter->dev, "cmd: SNMP_CMD: cmd_oid = 0x%x\n", cmd_oid); mwifiex_dbg(priv->adapter, CMD,
"cmd: SNMP_CMD: cmd_oid = 0x%x\n", cmd_oid);
cmd->command = cpu_to_le16(HostCmd_CMD_802_11_SNMP_MIB); cmd->command = cpu_to_le16(HostCmd_CMD_802_11_SNMP_MIB);
cmd->size = cpu_to_le16(sizeof(struct host_cmd_ds_802_11_snmp_mib) cmd->size = cpu_to_le16(sizeof(struct host_cmd_ds_802_11_snmp_mib)
- 1 + S_DS_GEN); - 1 + S_DS_GEN);
@ -129,11 +130,11 @@ static int mwifiex_cmd_802_11_snmp_mib(struct mwifiex_private *priv,
le16_add_cpu(&cmd->size, sizeof(u16)); le16_add_cpu(&cmd->size, sizeof(u16));
} }
dev_dbg(priv->adapter->dev, mwifiex_dbg(priv->adapter, CMD,
"cmd: SNMP_CMD: Action=0x%x, OID=0x%x, OIDSize=0x%x," "cmd: SNMP_CMD: Action=0x%x, OID=0x%x,\t"
" Value=0x%x\n", "OIDSize=0x%x, Value=0x%x\n",
cmd_action, cmd_oid, le16_to_cpu(snmp_mib->buf_size), cmd_action, cmd_oid, le16_to_cpu(snmp_mib->buf_size),
le16_to_cpu(*(__le16 *) snmp_mib->value)); le16_to_cpu(*(__le16 *)snmp_mib->value));
return 0; return 0;
} }
@ -356,9 +357,9 @@ mwifiex_cmd_802_11_hs_cfg(struct mwifiex_private *priv,
(hscfg_param->conditions != cpu_to_le32(HS_CFG_CANCEL)) && (hscfg_param->conditions != cpu_to_le32(HS_CFG_CANCEL)) &&
((adapter->arp_filter_size > 0) && ((adapter->arp_filter_size > 0) &&
(adapter->arp_filter_size <= ARP_FILTER_MAX_BUF_SIZE))) { (adapter->arp_filter_size <= ARP_FILTER_MAX_BUF_SIZE))) {
dev_dbg(adapter->dev, mwifiex_dbg(adapter, CMD,
"cmd: Attach %d bytes ArpFilter to HSCfg cmd\n", "cmd: Attach %d bytes ArpFilter to HSCfg cmd\n",
adapter->arp_filter_size); adapter->arp_filter_size);
memcpy(((u8 *) hs_cfg) + memcpy(((u8 *) hs_cfg) +
sizeof(struct host_cmd_ds_802_11_hs_cfg_enh), sizeof(struct host_cmd_ds_802_11_hs_cfg_enh),
adapter->arp_filter, adapter->arp_filter_size); adapter->arp_filter, adapter->arp_filter_size);
@ -378,11 +379,11 @@ mwifiex_cmd_802_11_hs_cfg(struct mwifiex_private *priv,
hs_cfg->params.hs_config.conditions = hscfg_param->conditions; hs_cfg->params.hs_config.conditions = hscfg_param->conditions;
hs_cfg->params.hs_config.gpio = hscfg_param->gpio; hs_cfg->params.hs_config.gpio = hscfg_param->gpio;
hs_cfg->params.hs_config.gap = hscfg_param->gap; hs_cfg->params.hs_config.gap = hscfg_param->gap;
dev_dbg(adapter->dev, mwifiex_dbg(adapter, CMD,
"cmd: HS_CFG_CMD: condition:0x%x gpio:0x%x gap:0x%x\n", "cmd: HS_CFG_CMD: condition:0x%x gpio:0x%x gap:0x%x\n",
hs_cfg->params.hs_config.conditions, hs_cfg->params.hs_config.conditions,
hs_cfg->params.hs_config.gpio, hs_cfg->params.hs_config.gpio,
hs_cfg->params.hs_config.gap); hs_cfg->params.hs_config.gap);
} }
return 0; return 0;
@ -462,7 +463,7 @@ static int mwifiex_cmd_802_11_deauthenticate(struct mwifiex_private *priv,
/* Set AP MAC address */ /* Set AP MAC address */
memcpy(deauth->mac_addr, mac, ETH_ALEN); memcpy(deauth->mac_addr, mac, ETH_ALEN);
dev_dbg(priv->adapter->dev, "cmd: Deauth: %pM\n", deauth->mac_addr); mwifiex_dbg(priv->adapter, CMD, "cmd: Deauth: %pM\n", deauth->mac_addr);
deauth->reason_code = cpu_to_le16(WLAN_REASON_DEAUTH_LEAVING); deauth->reason_code = cpu_to_le16(WLAN_REASON_DEAUTH_LEAVING);
@ -540,9 +541,9 @@ mwifiex_set_keyparamset_wep(struct mwifiex_private *priv,
} else if (!priv->wep_key[i].key_length) { } else if (!priv->wep_key[i].key_length) {
continue; continue;
} else { } else {
dev_err(priv->adapter->dev, mwifiex_dbg(priv->adapter, ERROR,
"key%d Length = %d is incorrect\n", "key%d Length = %d is incorrect\n",
(i + 1), priv->wep_key[i].key_length); (i + 1), priv->wep_key[i].key_length);
return -1; return -1;
} }
} }
@ -562,7 +563,8 @@ static int mwifiex_set_aes_key_v2(struct mwifiex_private *priv,
u16 size, len = KEY_PARAMS_FIXED_LEN; u16 size, len = KEY_PARAMS_FIXED_LEN;
if (enc_key->is_igtk_key) { if (enc_key->is_igtk_key) {
dev_dbg(adapter->dev, "%s: Set CMAC AES Key\n", __func__); mwifiex_dbg(adapter, INFO,
"%s: Set CMAC AES Key\n", __func__);
if (enc_key->is_rx_seq_valid) if (enc_key->is_rx_seq_valid)
memcpy(km->key_param_set.key_params.cmac_aes.ipn, memcpy(km->key_param_set.key_params.cmac_aes.ipn,
enc_key->pn, enc_key->pn_len); enc_key->pn, enc_key->pn_len);
@ -575,7 +577,8 @@ static int mwifiex_set_aes_key_v2(struct mwifiex_private *priv,
enc_key->key_material, enc_key->key_len); enc_key->key_material, enc_key->key_len);
len += sizeof(struct mwifiex_cmac_aes_param); len += sizeof(struct mwifiex_cmac_aes_param);
} else { } else {
dev_dbg(adapter->dev, "%s: Set AES Key\n", __func__); mwifiex_dbg(adapter, INFO,
"%s: Set AES Key\n", __func__);
if (enc_key->is_rx_seq_valid) if (enc_key->is_rx_seq_valid)
memcpy(km->key_param_set.key_params.aes.pn, memcpy(km->key_param_set.key_params.aes.pn,
enc_key->pn, enc_key->pn_len); enc_key->pn, enc_key->pn_len);
@ -619,7 +622,7 @@ mwifiex_cmd_802_11_key_material_v2(struct mwifiex_private *priv,
km->action = cpu_to_le16(cmd_action); km->action = cpu_to_le16(cmd_action);
if (cmd_action == HostCmd_ACT_GEN_GET) { if (cmd_action == HostCmd_ACT_GEN_GET) {
dev_dbg(adapter->dev, "%s: Get key\n", __func__); mwifiex_dbg(adapter, INFO, "%s: Get key\n", __func__);
km->key_param_set.key_idx = km->key_param_set.key_idx =
enc_key->key_index & KEY_INDEX_MASK; enc_key->key_index & KEY_INDEX_MASK;
km->key_param_set.type = cpu_to_le16(TLV_TYPE_KEY_PARAM_V2); km->key_param_set.type = cpu_to_le16(TLV_TYPE_KEY_PARAM_V2);
@ -646,7 +649,7 @@ mwifiex_cmd_802_11_key_material_v2(struct mwifiex_private *priv,
sizeof(struct mwifiex_ie_type_key_param_set_v2)); sizeof(struct mwifiex_ie_type_key_param_set_v2));
if (enc_key->key_disable) { if (enc_key->key_disable) {
dev_dbg(adapter->dev, "%s: Remove key\n", __func__); mwifiex_dbg(adapter, INFO, "%s: Remove key\n", __func__);
km->action = cpu_to_le16(HostCmd_ACT_GEN_REMOVE); km->action = cpu_to_le16(HostCmd_ACT_GEN_REMOVE);
km->key_param_set.type = cpu_to_le16(TLV_TYPE_KEY_PARAM_V2); km->key_param_set.type = cpu_to_le16(TLV_TYPE_KEY_PARAM_V2);
km->key_param_set.len = cpu_to_le16(KEY_PARAMS_FIXED_LEN); km->key_param_set.len = cpu_to_le16(KEY_PARAMS_FIXED_LEN);
@ -667,7 +670,7 @@ mwifiex_cmd_802_11_key_material_v2(struct mwifiex_private *priv,
memcpy(km->key_param_set.mac_addr, mac, ETH_ALEN); memcpy(km->key_param_set.mac_addr, mac, ETH_ALEN);
if (enc_key->key_len <= WLAN_KEY_LEN_WEP104) { if (enc_key->key_len <= WLAN_KEY_LEN_WEP104) {
dev_dbg(adapter->dev, "%s: Set WEP Key\n", __func__); mwifiex_dbg(adapter, INFO, "%s: Set WEP Key\n", __func__);
len += sizeof(struct mwifiex_wep_param); len += sizeof(struct mwifiex_wep_param);
km->key_param_set.len = cpu_to_le16(len); km->key_param_set.len = cpu_to_le16(len);
km->key_param_set.key_type = KEY_TYPE_ID_WEP; km->key_param_set.key_type = KEY_TYPE_ID_WEP;
@ -710,7 +713,7 @@ mwifiex_cmd_802_11_key_material_v2(struct mwifiex_private *priv,
key_info |= KEY_UNICAST | KEY_TX_KEY | KEY_RX_KEY; key_info |= KEY_UNICAST | KEY_TX_KEY | KEY_RX_KEY;
if (enc_key->is_wapi_key) { if (enc_key->is_wapi_key) {
dev_dbg(adapter->dev, "%s: Set WAPI Key\n", __func__); mwifiex_dbg(adapter, INFO, "%s: Set WAPI Key\n", __func__);
km->key_param_set.key_type = KEY_TYPE_ID_WAPI; km->key_param_set.key_type = KEY_TYPE_ID_WAPI;
memcpy(km->key_param_set.key_params.wapi.pn, enc_key->pn, memcpy(km->key_param_set.key_params.wapi.pn, enc_key->pn,
PN_LEN); PN_LEN);
@ -750,7 +753,8 @@ mwifiex_cmd_802_11_key_material_v2(struct mwifiex_private *priv,
return mwifiex_set_aes_key_v2(priv, cmd, enc_key, km); return mwifiex_set_aes_key_v2(priv, cmd, enc_key, km);
if (enc_key->key_len == WLAN_KEY_LEN_TKIP) { if (enc_key->key_len == WLAN_KEY_LEN_TKIP) {
dev_dbg(adapter->dev, "%s: Set TKIP Key\n", __func__); mwifiex_dbg(adapter, INFO,
"%s: Set TKIP Key\n", __func__);
if (enc_key->is_rx_seq_valid) if (enc_key->is_rx_seq_valid)
memcpy(km->key_param_set.key_params.tkip.pn, memcpy(km->key_param_set.key_params.tkip.pn,
enc_key->pn, enc_key->pn_len); enc_key->pn, enc_key->pn_len);
@ -814,7 +818,7 @@ mwifiex_cmd_802_11_key_material_v1(struct mwifiex_private *priv,
memset(&key_material->key_param_set, 0, memset(&key_material->key_param_set, 0,
sizeof(struct mwifiex_ie_type_key_param_set)); sizeof(struct mwifiex_ie_type_key_param_set));
if (enc_key->is_wapi_key) { if (enc_key->is_wapi_key) {
dev_dbg(priv->adapter->dev, "info: Set WAPI Key\n"); mwifiex_dbg(priv->adapter, INFO, "info: Set WAPI Key\n");
key_material->key_param_set.key_type_id = key_material->key_param_set.key_type_id =
cpu_to_le16(KEY_TYPE_ID_WAPI); cpu_to_le16(KEY_TYPE_ID_WAPI);
if (cmd_oid == KEY_INFO_ENABLED) if (cmd_oid == KEY_INFO_ENABLED)
@ -860,7 +864,7 @@ mwifiex_cmd_802_11_key_material_v1(struct mwifiex_private *priv,
} }
if (enc_key->key_len == WLAN_KEY_LEN_CCMP) { if (enc_key->key_len == WLAN_KEY_LEN_CCMP) {
if (enc_key->is_igtk_key) { if (enc_key->is_igtk_key) {
dev_dbg(priv->adapter->dev, "cmd: CMAC_AES\n"); mwifiex_dbg(priv->adapter, CMD, "cmd: CMAC_AES\n");
key_material->key_param_set.key_type_id = key_material->key_param_set.key_type_id =
cpu_to_le16(KEY_TYPE_ID_AES_CMAC); cpu_to_le16(KEY_TYPE_ID_AES_CMAC);
if (cmd_oid == KEY_INFO_ENABLED) if (cmd_oid == KEY_INFO_ENABLED)
@ -873,7 +877,7 @@ mwifiex_cmd_802_11_key_material_v1(struct mwifiex_private *priv,
key_material->key_param_set.key_info |= key_material->key_param_set.key_info |=
cpu_to_le16(KEY_IGTK); cpu_to_le16(KEY_IGTK);
} else { } else {
dev_dbg(priv->adapter->dev, "cmd: WPA_AES\n"); mwifiex_dbg(priv->adapter, CMD, "cmd: WPA_AES\n");
key_material->key_param_set.key_type_id = key_material->key_param_set.key_type_id =
cpu_to_le16(KEY_TYPE_ID_AES); cpu_to_le16(KEY_TYPE_ID_AES);
if (cmd_oid == KEY_INFO_ENABLED) if (cmd_oid == KEY_INFO_ENABLED)
@ -892,7 +896,7 @@ mwifiex_cmd_802_11_key_material_v1(struct mwifiex_private *priv,
cpu_to_le16(KEY_MCAST); cpu_to_le16(KEY_MCAST);
} }
} else if (enc_key->key_len == WLAN_KEY_LEN_TKIP) { } else if (enc_key->key_len == WLAN_KEY_LEN_TKIP) {
dev_dbg(priv->adapter->dev, "cmd: WPA_TKIP\n"); mwifiex_dbg(priv->adapter, CMD, "cmd: WPA_TKIP\n");
key_material->key_param_set.key_type_id = key_material->key_param_set.key_type_id =
cpu_to_le16(KEY_TYPE_ID_TKIP); cpu_to_le16(KEY_TYPE_ID_TKIP);
key_material->key_param_set.key_info = key_material->key_param_set.key_info =
@ -999,7 +1003,8 @@ static int mwifiex_cmd_802_11d_domain_info(struct mwifiex_private *priv,
&domain_info->domain; &domain_info->domain;
u8 no_of_triplet = adapter->domain_reg.no_of_triplet; u8 no_of_triplet = adapter->domain_reg.no_of_triplet;
dev_dbg(adapter->dev, "info: 11D: no_of_triplet=0x%x\n", no_of_triplet); mwifiex_dbg(adapter, INFO,
"info: 11D: no_of_triplet=0x%x\n", no_of_triplet);
cmd->command = cpu_to_le16(HostCmd_CMD_802_11D_DOMAIN_INFO); cmd->command = cpu_to_le16(HostCmd_CMD_802_11D_DOMAIN_INFO);
domain_info->action = cpu_to_le16(cmd_action); domain_info->action = cpu_to_le16(cmd_action);
@ -1235,8 +1240,9 @@ mwifiex_cmd_pcie_host_spec(struct mwifiex_private *priv,
(u32)(card->sleep_cookie_pbase); (u32)(card->sleep_cookie_pbase);
host_spec->sleep_cookie_addr_hi = host_spec->sleep_cookie_addr_hi =
(u32)(((u64)(card->sleep_cookie_pbase)) >> 32); (u32)(((u64)(card->sleep_cookie_pbase)) >> 32);
dev_dbg(priv->adapter->dev, "sleep_cook_lo phy addr: 0x%x\n", mwifiex_dbg(priv->adapter, INFO,
host_spec->sleep_cookie_addr_lo); "sleep_cook_lo phy addr: 0x%x\n",
host_spec->sleep_cookie_addr_lo);
} }
return 0; return 0;
@ -1263,7 +1269,8 @@ mwifiex_cmd_802_11_subsc_evt(struct mwifiex_private *priv,
S_DS_GEN); S_DS_GEN);
subsc_evt->action = cpu_to_le16(subsc_evt_cfg->action); subsc_evt->action = cpu_to_le16(subsc_evt_cfg->action);
dev_dbg(priv->adapter->dev, "cmd: action: %d\n", subsc_evt_cfg->action); mwifiex_dbg(priv->adapter, CMD,
"cmd: action: %d\n", subsc_evt_cfg->action);
/*For query requests, no configuration TLV structures are to be added.*/ /*For query requests, no configuration TLV structures are to be added.*/
if (subsc_evt_cfg->action == HostCmd_ACT_GEN_GET) if (subsc_evt_cfg->action == HostCmd_ACT_GEN_GET)
@ -1272,14 +1279,15 @@ mwifiex_cmd_802_11_subsc_evt(struct mwifiex_private *priv,
subsc_evt->events = cpu_to_le16(subsc_evt_cfg->events); subsc_evt->events = cpu_to_le16(subsc_evt_cfg->events);
event_bitmap = subsc_evt_cfg->events; event_bitmap = subsc_evt_cfg->events;
dev_dbg(priv->adapter->dev, "cmd: event bitmap : %16x\n", mwifiex_dbg(priv->adapter, CMD, "cmd: event bitmap : %16x\n",
event_bitmap); event_bitmap);
if (((subsc_evt_cfg->action == HostCmd_ACT_BITWISE_CLR) || if (((subsc_evt_cfg->action == HostCmd_ACT_BITWISE_CLR) ||
(subsc_evt_cfg->action == HostCmd_ACT_BITWISE_SET)) && (subsc_evt_cfg->action == HostCmd_ACT_BITWISE_SET)) &&
(event_bitmap == 0)) { (event_bitmap == 0)) {
dev_dbg(priv->adapter->dev, "Error: No event specified " mwifiex_dbg(priv->adapter, ERROR,
"for bitwise action type\n"); "Error: No event specified\t"
"for bitwise action type\n");
return -EINVAL; return -EINVAL;
} }
@ -1304,10 +1312,11 @@ mwifiex_cmd_802_11_subsc_evt(struct mwifiex_private *priv,
rssi_tlv->abs_value = subsc_evt_cfg->bcn_l_rssi_cfg.abs_value; rssi_tlv->abs_value = subsc_evt_cfg->bcn_l_rssi_cfg.abs_value;
rssi_tlv->evt_freq = subsc_evt_cfg->bcn_l_rssi_cfg.evt_freq; rssi_tlv->evt_freq = subsc_evt_cfg->bcn_l_rssi_cfg.evt_freq;
dev_dbg(priv->adapter->dev, "Cfg Beacon Low Rssi event, " mwifiex_dbg(priv->adapter, EVENT,
"RSSI:-%d dBm, Freq:%d\n", "Cfg Beacon Low Rssi event,\t"
subsc_evt_cfg->bcn_l_rssi_cfg.abs_value, "RSSI:-%d dBm, Freq:%d\n",
subsc_evt_cfg->bcn_l_rssi_cfg.evt_freq); subsc_evt_cfg->bcn_l_rssi_cfg.abs_value,
subsc_evt_cfg->bcn_l_rssi_cfg.evt_freq);
pos += sizeof(struct mwifiex_ie_types_rssi_threshold); pos += sizeof(struct mwifiex_ie_types_rssi_threshold);
le16_add_cpu(&cmd->size, le16_add_cpu(&cmd->size,
@ -1324,10 +1333,11 @@ mwifiex_cmd_802_11_subsc_evt(struct mwifiex_private *priv,
rssi_tlv->abs_value = subsc_evt_cfg->bcn_h_rssi_cfg.abs_value; rssi_tlv->abs_value = subsc_evt_cfg->bcn_h_rssi_cfg.abs_value;
rssi_tlv->evt_freq = subsc_evt_cfg->bcn_h_rssi_cfg.evt_freq; rssi_tlv->evt_freq = subsc_evt_cfg->bcn_h_rssi_cfg.evt_freq;
dev_dbg(priv->adapter->dev, "Cfg Beacon High Rssi event, " mwifiex_dbg(priv->adapter, EVENT,
"RSSI:-%d dBm, Freq:%d\n", "Cfg Beacon High Rssi event,\t"
subsc_evt_cfg->bcn_h_rssi_cfg.abs_value, "RSSI:-%d dBm, Freq:%d\n",
subsc_evt_cfg->bcn_h_rssi_cfg.evt_freq); subsc_evt_cfg->bcn_h_rssi_cfg.abs_value,
subsc_evt_cfg->bcn_h_rssi_cfg.evt_freq);
pos += sizeof(struct mwifiex_ie_types_rssi_threshold); pos += sizeof(struct mwifiex_ie_types_rssi_threshold);
le16_add_cpu(&cmd->size, le16_add_cpu(&cmd->size,
@ -1483,12 +1493,14 @@ static int mwifiex_cmd_cfg_data(struct mwifiex_private *priv,
data, len); data, len);
if (ret) if (ret)
return ret; return ret;
dev_dbg(adapter->dev, mwifiex_dbg(adapter, INFO,
"download cfg_data from device tree: %s\n", prop->name); "download cfg_data from device tree: %s\n",
prop->name);
} else if (adapter->cal_data->data && adapter->cal_data->size > 0) { } else if (adapter->cal_data->data && adapter->cal_data->size > 0) {
len = mwifiex_parse_cal_cfg((u8 *)adapter->cal_data->data, len = mwifiex_parse_cal_cfg((u8 *)adapter->cal_data->data,
adapter->cal_data->size, data); adapter->cal_data->size, data);
dev_dbg(adapter->dev, "download cfg_data from config file\n"); mwifiex_dbg(adapter, INFO,
"download cfg_data from config file\n");
} else { } else {
return -1; return -1;
} }
@ -1603,9 +1615,9 @@ mwifiex_cmd_tdls_oper(struct mwifiex_private *priv,
tdls_oper->tdls_action = cpu_to_le16(ACT_TDLS_CONFIG); tdls_oper->tdls_action = cpu_to_le16(ACT_TDLS_CONFIG);
if (!params) { if (!params) {
dev_err(priv->adapter->dev, mwifiex_dbg(priv->adapter, ERROR,
"TDLS config params not available for %pM\n", "TDLS config params not available for %pM\n",
oper->peer_mac); oper->peer_mac);
return -ENODATA; return -ENODATA;
} }
@ -1683,7 +1695,7 @@ mwifiex_cmd_tdls_oper(struct mwifiex_private *priv,
break; break;
default: default:
dev_err(priv->adapter->dev, "Unknown TDLS operation\n"); mwifiex_dbg(priv->adapter, ERROR, "Unknown TDLS operation\n");
return -ENOTSUPP; return -ENOTSUPP;
} }
@ -1890,8 +1902,8 @@ int mwifiex_sta_prepare_cmd(struct mwifiex_private *priv, uint16_t cmd_no,
ret = mwifiex_cmd_11n_cfg(priv, cmd_ptr, cmd_action, data_buf); ret = mwifiex_cmd_11n_cfg(priv, cmd_ptr, cmd_action, data_buf);
break; break;
case HostCmd_CMD_WMM_GET_STATUS: case HostCmd_CMD_WMM_GET_STATUS:
dev_dbg(priv->adapter->dev, mwifiex_dbg(priv->adapter, CMD,
"cmd: WMM: WMM_GET_STATUS cmd sent\n"); "cmd: WMM: WMM_GET_STATUS cmd sent\n");
cmd_ptr->command = cpu_to_le16(HostCmd_CMD_WMM_GET_STATUS); cmd_ptr->command = cpu_to_le16(HostCmd_CMD_WMM_GET_STATUS);
cmd_ptr->size = cmd_ptr->size =
cpu_to_le16(sizeof(struct host_cmd_ds_wmm_get_status) + cpu_to_le16(sizeof(struct host_cmd_ds_wmm_get_status) +
@ -1955,8 +1967,8 @@ int mwifiex_sta_prepare_cmd(struct mwifiex_private *priv, uint16_t cmd_no,
data_buf); data_buf);
break; break;
default: default:
dev_err(priv->adapter->dev, mwifiex_dbg(priv->adapter, ERROR,
"PREP_CMD: unknown cmd- %#x\n", cmd_no); "PREP_CMD: unknown cmd- %#x\n", cmd_no);
ret = -1; ret = -1;
break; break;
} }
@ -2047,8 +2059,8 @@ int mwifiex_sta_init_cmd(struct mwifiex_private *priv, u8 first_sta, bool init)
&sdio_sp_rx_aggr_enable, &sdio_sp_rx_aggr_enable,
true); true);
if (ret) { if (ret) {
dev_err(priv->adapter->dev, mwifiex_dbg(priv->adapter, ERROR,
"error while enabling SP aggregation..disable it"); "error while enabling SP aggregation..disable it");
adapter->sdio_rx_aggr_enable = false; adapter->sdio_rx_aggr_enable = false;
} }
} }
@ -2131,8 +2143,8 @@ int mwifiex_sta_init_cmd(struct mwifiex_private *priv, u8 first_sta, bool init)
HostCmd_ACT_GEN_SET, DOT11D_I, HostCmd_ACT_GEN_SET, DOT11D_I,
&state_11d, true); &state_11d, true);
if (ret) if (ret)
dev_err(priv->adapter->dev, mwifiex_dbg(priv->adapter, ERROR,
"11D: failed to enable 11D\n"); "11D: failed to enable 11D\n");
} }
/* Send cmd to FW to configure 11n specific configuration /* Send cmd to FW to configure 11n specific configuration

View File

@ -49,8 +49,9 @@ mwifiex_process_cmdresp_error(struct mwifiex_private *priv,
struct host_cmd_ds_802_11_ps_mode_enh *pm; struct host_cmd_ds_802_11_ps_mode_enh *pm;
unsigned long flags; unsigned long flags;
dev_err(adapter->dev, "CMD_RESP: cmd %#x error, result=%#x\n", mwifiex_dbg(adapter, ERROR,
resp->command, resp->result); "CMD_RESP: cmd %#x error, result=%#x\n",
resp->command, resp->result);
if (adapter->curr_cmd->wait_q_enabled) if (adapter->curr_cmd->wait_q_enabled)
adapter->cmd_wait_q.status = -1; adapter->cmd_wait_q.status = -1;
@ -58,9 +59,9 @@ mwifiex_process_cmdresp_error(struct mwifiex_private *priv,
switch (le16_to_cpu(resp->command)) { switch (le16_to_cpu(resp->command)) {
case HostCmd_CMD_802_11_PS_MODE_ENH: case HostCmd_CMD_802_11_PS_MODE_ENH:
pm = &resp->params.psmode_enh; pm = &resp->params.psmode_enh;
dev_err(adapter->dev, mwifiex_dbg(adapter, ERROR,
"PS_MODE_ENH cmd failed: result=0x%x action=0x%X\n", "PS_MODE_ENH cmd failed: result=0x%x action=0x%X\n",
resp->result, le16_to_cpu(pm->action)); resp->result, le16_to_cpu(pm->action));
/* We do not re-try enter-ps command in ad-hoc mode. */ /* We do not re-try enter-ps command in ad-hoc mode. */
if (le16_to_cpu(pm->action) == EN_AUTO_PS && if (le16_to_cpu(pm->action) == EN_AUTO_PS &&
(le16_to_cpu(pm->params.ps_bitmap) & BITMAP_STA_PS) && (le16_to_cpu(pm->params.ps_bitmap) & BITMAP_STA_PS) &&
@ -91,7 +92,8 @@ mwifiex_process_cmdresp_error(struct mwifiex_private *priv,
break; break;
case HostCmd_CMD_SDIO_SP_RX_AGGR_CFG: case HostCmd_CMD_SDIO_SP_RX_AGGR_CFG:
dev_err(priv->adapter->dev, "SDIO RX single-port aggregation Not support\n"); mwifiex_dbg(adapter, MSG,
"SDIO RX single-port aggregation Not support\n");
break; break;
default: default:
@ -187,29 +189,34 @@ static int mwifiex_ret_802_11_snmp_mib(struct mwifiex_private *priv,
u16 query_type = le16_to_cpu(smib->query_type); u16 query_type = le16_to_cpu(smib->query_type);
u32 ul_temp; u32 ul_temp;
dev_dbg(priv->adapter->dev, "info: SNMP_RESP: oid value = %#x," mwifiex_dbg(priv->adapter, INFO,
" query_type = %#x, buf size = %#x\n", "info: SNMP_RESP: oid value = %#x,\t"
oid, query_type, le16_to_cpu(smib->buf_size)); "query_type = %#x, buf size = %#x\n",
oid, query_type, le16_to_cpu(smib->buf_size));
if (query_type == HostCmd_ACT_GEN_GET) { if (query_type == HostCmd_ACT_GEN_GET) {
ul_temp = le16_to_cpu(*((__le16 *) (smib->value))); ul_temp = le16_to_cpu(*((__le16 *) (smib->value)));
if (data_buf) if (data_buf)
*data_buf = ul_temp; *data_buf = ul_temp;
switch (oid) { switch (oid) {
case FRAG_THRESH_I: case FRAG_THRESH_I:
dev_dbg(priv->adapter->dev, mwifiex_dbg(priv->adapter, INFO,
"info: SNMP_RESP: FragThsd =%u\n", ul_temp); "info: SNMP_RESP: FragThsd =%u\n",
ul_temp);
break; break;
case RTS_THRESH_I: case RTS_THRESH_I:
dev_dbg(priv->adapter->dev, mwifiex_dbg(priv->adapter, INFO,
"info: SNMP_RESP: RTSThsd =%u\n", ul_temp); "info: SNMP_RESP: RTSThsd =%u\n",
ul_temp);
break; break;
case SHORT_RETRY_LIM_I: case SHORT_RETRY_LIM_I:
dev_dbg(priv->adapter->dev, mwifiex_dbg(priv->adapter, INFO,
"info: SNMP_RESP: TxRetryCount=%u\n", ul_temp); "info: SNMP_RESP: TxRetryCount=%u\n",
ul_temp);
break; break;
case DTIM_PERIOD_I: case DTIM_PERIOD_I:
dev_dbg(priv->adapter->dev, mwifiex_dbg(priv->adapter, INFO,
"info: SNMP_RESP: DTIM period=%u\n", ul_temp); "info: SNMP_RESP: DTIM period=%u\n",
ul_temp);
default: default:
break; break;
} }
@ -426,14 +433,15 @@ static int mwifiex_ret_tx_power_cfg(struct mwifiex_private *priv,
priv->tx_power_level = (u16) pg->power_min; priv->tx_power_level = (u16) pg->power_min;
break; break;
default: default:
dev_err(adapter->dev, "CMD_RESP: unknown cmd action %d\n", mwifiex_dbg(adapter, ERROR,
action); "CMD_RESP: unknown cmd action %d\n",
action);
return 0; return 0;
} }
dev_dbg(adapter->dev, mwifiex_dbg(adapter, INFO,
"info: Current TxPower Level = %d, Max Power=%d, Min Power=%d\n", "info: Current TxPower Level = %d, Max Power=%d, Min Power=%d\n",
priv->tx_power_level, priv->max_tx_power_level, priv->tx_power_level, priv->max_tx_power_level,
priv->min_tx_power_level); priv->min_tx_power_level);
return 0; return 0;
} }
@ -454,10 +462,10 @@ static int mwifiex_ret_rf_tx_power(struct mwifiex_private *priv,
priv->min_tx_power_level = txp->min_power; priv->min_tx_power_level = txp->min_power;
} }
dev_dbg(priv->adapter->dev, mwifiex_dbg(priv->adapter, INFO,
"Current TxPower Level=%d, Max Power=%d, Min Power=%d\n", "Current TxPower Level=%d, Max Power=%d, Min Power=%d\n",
priv->tx_power_level, priv->max_tx_power_level, priv->tx_power_level, priv->max_tx_power_level,
priv->min_tx_power_level); priv->min_tx_power_level);
return 0; return 0;
} }
@ -473,18 +481,18 @@ static int mwifiex_ret_rf_antenna(struct mwifiex_private *priv,
struct mwifiex_adapter *adapter = priv->adapter; struct mwifiex_adapter *adapter = priv->adapter;
if (adapter->hw_dev_mcs_support == HT_STREAM_2X2) if (adapter->hw_dev_mcs_support == HT_STREAM_2X2)
dev_dbg(adapter->dev, mwifiex_dbg(adapter, INFO,
"RF_ANT_RESP: Tx action = 0x%x, Tx Mode = 0x%04x" "RF_ANT_RESP: Tx action = 0x%x, Tx Mode = 0x%04x\t"
" Rx action = 0x%x, Rx Mode = 0x%04x\n", "Rx action = 0x%x, Rx Mode = 0x%04x\n",
le16_to_cpu(ant_mimo->action_tx), le16_to_cpu(ant_mimo->action_tx),
le16_to_cpu(ant_mimo->tx_ant_mode), le16_to_cpu(ant_mimo->tx_ant_mode),
le16_to_cpu(ant_mimo->action_rx), le16_to_cpu(ant_mimo->action_rx),
le16_to_cpu(ant_mimo->rx_ant_mode)); le16_to_cpu(ant_mimo->rx_ant_mode));
else else
dev_dbg(adapter->dev, mwifiex_dbg(adapter, INFO,
"RF_ANT_RESP: action = 0x%x, Mode = 0x%04x\n", "RF_ANT_RESP: action = 0x%x, Mode = 0x%04x\n",
le16_to_cpu(ant_siso->action), le16_to_cpu(ant_siso->action),
le16_to_cpu(ant_siso->ant_mode)); le16_to_cpu(ant_siso->ant_mode));
return 0; return 0;
} }
@ -502,8 +510,8 @@ static int mwifiex_ret_802_11_mac_address(struct mwifiex_private *priv,
memcpy(priv->curr_addr, cmd_mac_addr->mac_addr, ETH_ALEN); memcpy(priv->curr_addr, cmd_mac_addr->mac_addr, ETH_ALEN);
dev_dbg(priv->adapter->dev, mwifiex_dbg(priv->adapter, INFO,
"info: set mac address: %pM\n", priv->curr_addr); "info: set mac address: %pM\n", priv->curr_addr);
return 0; return 0;
} }
@ -587,7 +595,8 @@ static int mwifiex_ret_802_11_key_material_v1(struct mwifiex_private *priv,
if (le16_to_cpu(key->action) == HostCmd_ACT_GEN_SET) { if (le16_to_cpu(key->action) == HostCmd_ACT_GEN_SET) {
if ((le16_to_cpu(key->key_param_set.key_info) & KEY_MCAST)) { if ((le16_to_cpu(key->key_param_set.key_info) & KEY_MCAST)) {
dev_dbg(priv->adapter->dev, "info: key: GTK is set\n"); mwifiex_dbg(priv->adapter, INFO,
"info: key: GTK is set\n");
priv->wpa_is_gtk_set = true; priv->wpa_is_gtk_set = true;
priv->scan_block = false; priv->scan_block = false;
} }
@ -617,7 +626,7 @@ static int mwifiex_ret_802_11_key_material_v2(struct mwifiex_private *priv,
key_v2 = &resp->params.key_material_v2; key_v2 = &resp->params.key_material_v2;
if (le16_to_cpu(key_v2->action) == HostCmd_ACT_GEN_SET) { if (le16_to_cpu(key_v2->action) == HostCmd_ACT_GEN_SET) {
if ((le16_to_cpu(key_v2->key_param_set.key_info) & KEY_MCAST)) { if ((le16_to_cpu(key_v2->key_param_set.key_info) & KEY_MCAST)) {
dev_dbg(priv->adapter->dev, "info: key: GTK is set\n"); mwifiex_dbg(priv->adapter, INFO, "info: key: GTK is set\n");
priv->wpa_is_gtk_set = true; priv->wpa_is_gtk_set = true;
priv->scan_block = false; priv->scan_block = false;
} }
@ -663,14 +672,14 @@ static int mwifiex_ret_802_11d_domain_info(struct mwifiex_private *priv,
- IEEE80211_COUNTRY_STRING_LEN) - IEEE80211_COUNTRY_STRING_LEN)
/ sizeof(struct ieee80211_country_ie_triplet)); / sizeof(struct ieee80211_country_ie_triplet));
dev_dbg(priv->adapter->dev, mwifiex_dbg(priv->adapter, INFO,
"info: 11D Domain Info Resp: no_of_triplet=%d\n", "info: 11D Domain Info Resp: no_of_triplet=%d\n",
no_of_triplet); no_of_triplet);
if (no_of_triplet > MWIFIEX_MAX_TRIPLET_802_11D) { if (no_of_triplet > MWIFIEX_MAX_TRIPLET_802_11D) {
dev_warn(priv->adapter->dev, mwifiex_dbg(priv->adapter, FATAL,
"11D: invalid number of triplets %d returned\n", "11D: invalid number of triplets %d returned\n",
no_of_triplet); no_of_triplet);
return -1; return -1;
} }
@ -680,8 +689,8 @@ static int mwifiex_ret_802_11d_domain_info(struct mwifiex_private *priv,
case HostCmd_ACT_GEN_GET: case HostCmd_ACT_GEN_GET:
break; break;
default: default:
dev_err(priv->adapter->dev, mwifiex_dbg(priv->adapter, ERROR,
"11D: invalid action:%d\n", domain_info->action); "11D: invalid action:%d\n", domain_info->action);
return -1; return -1;
} }
@ -843,12 +852,12 @@ static int mwifiex_ret_ibss_coalescing_status(struct mwifiex_private *priv,
if (le16_to_cpu(ibss_coal_resp->action) == HostCmd_ACT_GEN_SET) if (le16_to_cpu(ibss_coal_resp->action) == HostCmd_ACT_GEN_SET)
return 0; return 0;
dev_dbg(priv->adapter->dev, mwifiex_dbg(priv->adapter, INFO,
"info: new BSSID %pM\n", ibss_coal_resp->bssid); "info: new BSSID %pM\n", ibss_coal_resp->bssid);
/* If rsp has NULL BSSID, Just return..... No Action */ /* If rsp has NULL BSSID, Just return..... No Action */
if (is_zero_ether_addr(ibss_coal_resp->bssid)) { if (is_zero_ether_addr(ibss_coal_resp->bssid)) {
dev_warn(priv->adapter->dev, "new BSSID is NULL\n"); mwifiex_dbg(priv->adapter, FATAL, "new BSSID is NULL\n");
return 0; return 0;
} }
@ -884,48 +893,48 @@ static int mwifiex_ret_tdls_oper(struct mwifiex_private *priv,
case ACT_TDLS_DELETE: case ACT_TDLS_DELETE:
if (reason) { if (reason) {
if (!node || reason == TDLS_ERR_LINK_NONEXISTENT) if (!node || reason == TDLS_ERR_LINK_NONEXISTENT)
dev_dbg(priv->adapter->dev, mwifiex_dbg(priv->adapter, ERROR,
"TDLS link delete for %pM failed: reason %d\n", "TDLS link delete for %pM failed: reason %d\n",
cmd_tdls_oper->peer_mac, reason); cmd_tdls_oper->peer_mac, reason);
else else
dev_err(priv->adapter->dev, mwifiex_dbg(priv->adapter, ERROR,
"TDLS link delete for %pM failed: reason %d\n", "TDLS link delete for %pM failed: reason %d\n",
cmd_tdls_oper->peer_mac, reason); cmd_tdls_oper->peer_mac, reason);
} else { } else {
dev_dbg(priv->adapter->dev, mwifiex_dbg(priv->adapter, MSG,
"TDLS link delete for %pM successful\n", "TDLS link delete for %pM successful\n",
cmd_tdls_oper->peer_mac); cmd_tdls_oper->peer_mac);
} }
break; break;
case ACT_TDLS_CREATE: case ACT_TDLS_CREATE:
if (reason) { if (reason) {
dev_err(priv->adapter->dev, mwifiex_dbg(priv->adapter, ERROR,
"TDLS link creation for %pM failed: reason %d", "TDLS link creation for %pM failed: reason %d",
cmd_tdls_oper->peer_mac, reason); cmd_tdls_oper->peer_mac, reason);
if (node && reason != TDLS_ERR_LINK_EXISTS) if (node && reason != TDLS_ERR_LINK_EXISTS)
node->tdls_status = TDLS_SETUP_FAILURE; node->tdls_status = TDLS_SETUP_FAILURE;
} else { } else {
dev_dbg(priv->adapter->dev, mwifiex_dbg(priv->adapter, MSG,
"TDLS link creation for %pM successful", "TDLS link creation for %pM successful",
cmd_tdls_oper->peer_mac); cmd_tdls_oper->peer_mac);
} }
break; break;
case ACT_TDLS_CONFIG: case ACT_TDLS_CONFIG:
if (reason) { if (reason) {
dev_err(priv->adapter->dev, mwifiex_dbg(priv->adapter, ERROR,
"TDLS link config for %pM failed, reason %d\n", "TDLS link config for %pM failed, reason %d\n",
cmd_tdls_oper->peer_mac, reason); cmd_tdls_oper->peer_mac, reason);
if (node) if (node)
node->tdls_status = TDLS_SETUP_FAILURE; node->tdls_status = TDLS_SETUP_FAILURE;
} else { } else {
dev_dbg(priv->adapter->dev, mwifiex_dbg(priv->adapter, MSG,
"TDLS link config for %pM successful\n", "TDLS link config for %pM successful\n",
cmd_tdls_oper->peer_mac); cmd_tdls_oper->peer_mac);
} }
break; break;
default: default:
dev_err(priv->adapter->dev, mwifiex_dbg(priv->adapter, ERROR,
"Unknown TDLS command action response %d", action); "Unknown TDLS command action response %d", action);
return -1; return -1;
} }
@ -942,8 +951,9 @@ static int mwifiex_ret_subsc_evt(struct mwifiex_private *priv,
/* For every subscribe event command (Get/Set/Clear), FW reports the /* For every subscribe event command (Get/Set/Clear), FW reports the
* current set of subscribed events*/ * current set of subscribed events*/
dev_dbg(priv->adapter->dev, "Bitmap of currently subscribed events: %16x\n", mwifiex_dbg(priv->adapter, EVENT,
le16_to_cpu(cmd_sub_event->events)); "Bitmap of currently subscribed events: %16x\n",
le16_to_cpu(cmd_sub_event->events));
return 0; return 0;
} }
@ -953,7 +963,7 @@ static int mwifiex_ret_cfg_data(struct mwifiex_private *priv,
struct host_cmd_ds_command *resp) struct host_cmd_ds_command *resp)
{ {
if (resp->result != HostCmd_RESULT_OK) { if (resp->result != HostCmd_RESULT_OK) {
dev_err(priv->adapter->dev, "Cal data cmd resp failed\n"); mwifiex_dbg(priv->adapter, ERROR, "Cal data cmd resp failed\n");
return -1; return -1;
} }
@ -1021,8 +1031,8 @@ int mwifiex_process_sta_cmdresp(struct mwifiex_private *priv, u16 cmdresp_no,
break; break;
case HostCmd_CMD_802_11_BG_SCAN_QUERY: case HostCmd_CMD_802_11_BG_SCAN_QUERY:
ret = mwifiex_ret_802_11_scan(priv, resp); ret = mwifiex_ret_802_11_scan(priv, resp);
dev_dbg(adapter->dev, mwifiex_dbg(adapter, CMD,
"info: CMD_RESP: BG_SCAN result is ready!\n"); "info: CMD_RESP: BG_SCAN result is ready!\n");
break; break;
case HostCmd_CMD_TXPWR_CFG: case HostCmd_CMD_TXPWR_CFG:
ret = mwifiex_ret_tx_power_cfg(priv, resp); ret = mwifiex_ret_tx_power_cfg(priv, resp);
@ -1101,8 +1111,8 @@ int mwifiex_process_sta_cmdresp(struct mwifiex_private *priv, u16 cmdresp_no,
/ MWIFIEX_SDIO_BLOCK_SIZE) / MWIFIEX_SDIO_BLOCK_SIZE)
* MWIFIEX_SDIO_BLOCK_SIZE; * MWIFIEX_SDIO_BLOCK_SIZE;
adapter->curr_tx_buf_size = adapter->tx_buf_size; adapter->curr_tx_buf_size = adapter->tx_buf_size;
dev_dbg(adapter->dev, "cmd: curr_tx_buf_size=%d\n", mwifiex_dbg(adapter, CMD, "cmd: curr_tx_buf_size=%d\n",
adapter->curr_tx_buf_size); adapter->curr_tx_buf_size);
if (adapter->if_ops.update_mp_end_port) if (adapter->if_ops.update_mp_end_port)
adapter->if_ops.update_mp_end_port(adapter, adapter->if_ops.update_mp_end_port(adapter,
@ -1162,8 +1172,9 @@ int mwifiex_process_sta_cmdresp(struct mwifiex_private *priv, u16 cmdresp_no,
ret = mwifiex_ret_sdio_rx_aggr_cfg(priv, resp); ret = mwifiex_ret_sdio_rx_aggr_cfg(priv, resp);
break; break;
default: default:
dev_err(adapter->dev, "CMD_RESP: unknown cmd response %#x\n", mwifiex_dbg(adapter, ERROR,
resp->command); "CMD_RESP: unknown cmd response %#x\n",
resp->command);
break; break;
} }

View File

@ -48,7 +48,8 @@ mwifiex_reset_connect_state(struct mwifiex_private *priv, u16 reason_code)
if (!priv->media_connected) if (!priv->media_connected)
return; return;
dev_dbg(adapter->dev, "info: handles disconnect event\n"); mwifiex_dbg(adapter, INFO,
"info: handles disconnect event\n");
priv->media_connected = false; priv->media_connected = false;
@ -104,12 +105,14 @@ mwifiex_reset_connect_state(struct mwifiex_private *priv, u16 reason_code)
* it could be used for re-assoc * it could be used for re-assoc
*/ */
dev_dbg(adapter->dev, "info: previous SSID=%s, SSID len=%u\n", mwifiex_dbg(adapter, INFO,
priv->prev_ssid.ssid, priv->prev_ssid.ssid_len); "info: previous SSID=%s, SSID len=%u\n",
priv->prev_ssid.ssid, priv->prev_ssid.ssid_len);
dev_dbg(adapter->dev, "info: current SSID=%s, SSID len=%u\n", mwifiex_dbg(adapter, INFO,
priv->curr_bss_params.bss_descriptor.ssid.ssid, "info: current SSID=%s, SSID len=%u\n",
priv->curr_bss_params.bss_descriptor.ssid.ssid_len); priv->curr_bss_params.bss_descriptor.ssid.ssid,
priv->curr_bss_params.bss_descriptor.ssid.ssid_len);
memcpy(&priv->prev_ssid, memcpy(&priv->prev_ssid,
&priv->curr_bss_params.bss_descriptor.ssid, &priv->curr_bss_params.bss_descriptor.ssid,
@ -127,9 +130,9 @@ mwifiex_reset_connect_state(struct mwifiex_private *priv, u16 reason_code)
if (adapter->is_cmd_timedout && adapter->curr_cmd) if (adapter->is_cmd_timedout && adapter->curr_cmd)
return; return;
priv->media_connected = false; priv->media_connected = false;
dev_dbg(adapter->dev, mwifiex_dbg(adapter, MSG,
"info: successfully disconnected from %pM: reason code %d\n", "info: successfully disconnected from %pM: reason code %d\n",
priv->cfg_bssid, reason_code); priv->cfg_bssid, reason_code);
if (priv->bss_mode == NL80211_IFTYPE_STATION || if (priv->bss_mode == NL80211_IFTYPE_STATION ||
priv->bss_mode == NL80211_IFTYPE_P2P_CLIENT) { priv->bss_mode == NL80211_IFTYPE_P2P_CLIENT) {
cfg80211_disconnected(priv->netdev, reason_code, NULL, 0, cfg80211_disconnected(priv->netdev, reason_code, NULL, 0,
@ -154,13 +157,13 @@ static int mwifiex_parse_tdls_event(struct mwifiex_private *priv,
/* reserved 2 bytes are not mandatory in tdls event */ /* reserved 2 bytes are not mandatory in tdls event */
if (event_skb->len < (sizeof(struct mwifiex_tdls_generic_event) - if (event_skb->len < (sizeof(struct mwifiex_tdls_generic_event) -
sizeof(u16) - sizeof(adapter->event_cause))) { sizeof(u16) - sizeof(adapter->event_cause))) {
dev_err(adapter->dev, "Invalid event length!\n"); mwifiex_dbg(adapter, ERROR, "Invalid event length!\n");
return -1; return -1;
} }
sta_ptr = mwifiex_get_sta_entry(priv, tdls_evt->peer_mac); sta_ptr = mwifiex_get_sta_entry(priv, tdls_evt->peer_mac);
if (!sta_ptr) { if (!sta_ptr) {
dev_err(adapter->dev, "cannot get sta entry!\n"); mwifiex_dbg(adapter, ERROR, "cannot get sta entry!\n");
return -1; return -1;
} }
@ -239,21 +242,21 @@ int mwifiex_process_sta_event(struct mwifiex_private *priv)
switch (eventcause) { switch (eventcause) {
case EVENT_DUMMY_HOST_WAKEUP_SIGNAL: case EVENT_DUMMY_HOST_WAKEUP_SIGNAL:
dev_err(adapter->dev, mwifiex_dbg(adapter, ERROR,
"invalid EVENT: DUMMY_HOST_WAKEUP_SIGNAL, ignore it\n"); "invalid EVENT: DUMMY_HOST_WAKEUP_SIGNAL, ignore it\n");
break; break;
case EVENT_LINK_SENSED: case EVENT_LINK_SENSED:
dev_dbg(adapter->dev, "event: LINK_SENSED\n"); mwifiex_dbg(adapter, EVENT, "event: LINK_SENSED\n");
if (!netif_carrier_ok(priv->netdev)) if (!netif_carrier_ok(priv->netdev))
netif_carrier_on(priv->netdev); netif_carrier_on(priv->netdev);
mwifiex_wake_up_net_dev_queue(priv->netdev, adapter); mwifiex_wake_up_net_dev_queue(priv->netdev, adapter);
break; break;
case EVENT_DEAUTHENTICATED: case EVENT_DEAUTHENTICATED:
dev_dbg(adapter->dev, "event: Deauthenticated\n"); mwifiex_dbg(adapter, EVENT, "event: Deauthenticated\n");
if (priv->wps.session_enable) { if (priv->wps.session_enable) {
dev_dbg(adapter->dev, mwifiex_dbg(adapter, INFO,
"info: receive deauth event in wps session\n"); "info: receive deauth event in wps session\n");
break; break;
} }
adapter->dbg.num_event_deauth++; adapter->dbg.num_event_deauth++;
@ -265,10 +268,10 @@ int mwifiex_process_sta_event(struct mwifiex_private *priv)
break; break;
case EVENT_DISASSOCIATED: case EVENT_DISASSOCIATED:
dev_dbg(adapter->dev, "event: Disassociated\n"); mwifiex_dbg(adapter, EVENT, "event: Disassociated\n");
if (priv->wps.session_enable) { if (priv->wps.session_enable) {
dev_dbg(adapter->dev, mwifiex_dbg(adapter, INFO,
"info: receive disassoc event in wps session\n"); "info: receive disassoc event in wps session\n");
break; break;
} }
adapter->dbg.num_event_disassoc++; adapter->dbg.num_event_disassoc++;
@ -280,7 +283,7 @@ int mwifiex_process_sta_event(struct mwifiex_private *priv)
break; break;
case EVENT_LINK_LOST: case EVENT_LINK_LOST:
dev_dbg(adapter->dev, "event: Link lost\n"); mwifiex_dbg(adapter, EVENT, "event: Link lost\n");
adapter->dbg.num_event_link_lost++; adapter->dbg.num_event_link_lost++;
if (priv->media_connected) { if (priv->media_connected) {
reason_code = reason_code =
@ -290,7 +293,7 @@ int mwifiex_process_sta_event(struct mwifiex_private *priv)
break; break;
case EVENT_PS_SLEEP: case EVENT_PS_SLEEP:
dev_dbg(adapter->dev, "info: EVENT: SLEEP\n"); mwifiex_dbg(adapter, EVENT, "info: EVENT: SLEEP\n");
adapter->ps_state = PS_STATE_PRE_SLEEP; adapter->ps_state = PS_STATE_PRE_SLEEP;
@ -298,12 +301,12 @@ int mwifiex_process_sta_event(struct mwifiex_private *priv)
break; break;
case EVENT_PS_AWAKE: case EVENT_PS_AWAKE:
dev_dbg(adapter->dev, "info: EVENT: AWAKE\n"); mwifiex_dbg(adapter, EVENT, "info: EVENT: AWAKE\n");
if (!adapter->pps_uapsd_mode && if (!adapter->pps_uapsd_mode &&
priv->media_connected && adapter->sleep_period.period) { priv->media_connected && adapter->sleep_period.period) {
adapter->pps_uapsd_mode = true; adapter->pps_uapsd_mode = true;
dev_dbg(adapter->dev, mwifiex_dbg(adapter, EVENT,
"event: PPS/UAPSD mode activated\n"); "event: PPS/UAPSD mode activated\n");
} }
adapter->tx_lock_flag = false; adapter->tx_lock_flag = false;
if (adapter->pps_uapsd_mode && adapter->gen_null_pkt) { if (adapter->pps_uapsd_mode && adapter->gen_null_pkt) {
@ -333,26 +336,26 @@ int mwifiex_process_sta_event(struct mwifiex_private *priv)
case EVENT_DEEP_SLEEP_AWAKE: case EVENT_DEEP_SLEEP_AWAKE:
adapter->if_ops.wakeup_complete(adapter); adapter->if_ops.wakeup_complete(adapter);
dev_dbg(adapter->dev, "event: DS_AWAKE\n"); mwifiex_dbg(adapter, EVENT, "event: DS_AWAKE\n");
if (adapter->is_deep_sleep) if (adapter->is_deep_sleep)
adapter->is_deep_sleep = false; adapter->is_deep_sleep = false;
break; break;
case EVENT_HS_ACT_REQ: case EVENT_HS_ACT_REQ:
dev_dbg(adapter->dev, "event: HS_ACT_REQ\n"); mwifiex_dbg(adapter, EVENT, "event: HS_ACT_REQ\n");
ret = mwifiex_send_cmd(priv, HostCmd_CMD_802_11_HS_CFG_ENH, ret = mwifiex_send_cmd(priv, HostCmd_CMD_802_11_HS_CFG_ENH,
0, 0, NULL, false); 0, 0, NULL, false);
break; break;
case EVENT_MIC_ERR_UNICAST: case EVENT_MIC_ERR_UNICAST:
dev_dbg(adapter->dev, "event: UNICAST MIC ERROR\n"); mwifiex_dbg(adapter, EVENT, "event: UNICAST MIC ERROR\n");
cfg80211_michael_mic_failure(priv->netdev, priv->cfg_bssid, cfg80211_michael_mic_failure(priv->netdev, priv->cfg_bssid,
NL80211_KEYTYPE_PAIRWISE, NL80211_KEYTYPE_PAIRWISE,
-1, NULL, GFP_KERNEL); -1, NULL, GFP_KERNEL);
break; break;
case EVENT_MIC_ERR_MULTICAST: case EVENT_MIC_ERR_MULTICAST:
dev_dbg(adapter->dev, "event: MULTICAST MIC ERROR\n"); mwifiex_dbg(adapter, EVENT, "event: MULTICAST MIC ERROR\n");
cfg80211_michael_mic_failure(priv->netdev, priv->cfg_bssid, cfg80211_michael_mic_failure(priv->netdev, priv->cfg_bssid,
NL80211_KEYTYPE_GROUP, NL80211_KEYTYPE_GROUP,
-1, NULL, GFP_KERNEL); -1, NULL, GFP_KERNEL);
@ -362,7 +365,7 @@ int mwifiex_process_sta_event(struct mwifiex_private *priv)
break; break;
case EVENT_ADHOC_BCN_LOST: case EVENT_ADHOC_BCN_LOST:
dev_dbg(adapter->dev, "event: ADHOC_BCN_LOST\n"); mwifiex_dbg(adapter, EVENT, "event: ADHOC_BCN_LOST\n");
priv->adhoc_is_link_sensed = false; priv->adhoc_is_link_sensed = false;
mwifiex_clean_txrx(priv); mwifiex_clean_txrx(priv);
mwifiex_stop_net_dev_queue(priv->netdev, adapter); mwifiex_stop_net_dev_queue(priv->netdev, adapter);
@ -371,17 +374,17 @@ int mwifiex_process_sta_event(struct mwifiex_private *priv)
break; break;
case EVENT_BG_SCAN_REPORT: case EVENT_BG_SCAN_REPORT:
dev_dbg(adapter->dev, "event: BGS_REPORT\n"); mwifiex_dbg(adapter, EVENT, "event: BGS_REPORT\n");
ret = mwifiex_send_cmd(priv, HostCmd_CMD_802_11_BG_SCAN_QUERY, ret = mwifiex_send_cmd(priv, HostCmd_CMD_802_11_BG_SCAN_QUERY,
HostCmd_ACT_GEN_GET, 0, NULL, false); HostCmd_ACT_GEN_GET, 0, NULL, false);
break; break;
case EVENT_PORT_RELEASE: case EVENT_PORT_RELEASE:
dev_dbg(adapter->dev, "event: PORT RELEASE\n"); mwifiex_dbg(adapter, EVENT, "event: PORT RELEASE\n");
break; break;
case EVENT_EXT_SCAN_REPORT: case EVENT_EXT_SCAN_REPORT:
dev_dbg(adapter->dev, "event: EXT_SCAN Report\n"); mwifiex_dbg(adapter, EVENT, "event: EXT_SCAN Report\n");
if (adapter->ext_scan) if (adapter->ext_scan)
ret = mwifiex_handle_event_ext_scan_report(priv, ret = mwifiex_handle_event_ext_scan_report(priv,
adapter->event_skb->data); adapter->event_skb->data);
@ -389,7 +392,7 @@ int mwifiex_process_sta_event(struct mwifiex_private *priv)
break; break;
case EVENT_WMM_STATUS_CHANGE: case EVENT_WMM_STATUS_CHANGE:
dev_dbg(adapter->dev, "event: WMM status changed\n"); mwifiex_dbg(adapter, EVENT, "event: WMM status changed\n");
ret = mwifiex_send_cmd(priv, HostCmd_CMD_WMM_GET_STATUS, ret = mwifiex_send_cmd(priv, HostCmd_CMD_WMM_GET_STATUS,
0, 0, NULL, false); 0, 0, NULL, false);
break; break;
@ -401,13 +404,13 @@ int mwifiex_process_sta_event(struct mwifiex_private *priv)
mwifiex_send_cmd(priv, HostCmd_CMD_RSSI_INFO, mwifiex_send_cmd(priv, HostCmd_CMD_RSSI_INFO,
HostCmd_ACT_GEN_GET, 0, NULL, false); HostCmd_ACT_GEN_GET, 0, NULL, false);
priv->subsc_evt_rssi_state = RSSI_LOW_RECVD; priv->subsc_evt_rssi_state = RSSI_LOW_RECVD;
dev_dbg(adapter->dev, "event: Beacon RSSI_LOW\n"); mwifiex_dbg(adapter, EVENT, "event: Beacon RSSI_LOW\n");
break; break;
case EVENT_SNR_LOW: case EVENT_SNR_LOW:
dev_dbg(adapter->dev, "event: Beacon SNR_LOW\n"); mwifiex_dbg(adapter, EVENT, "event: Beacon SNR_LOW\n");
break; break;
case EVENT_MAX_FAIL: case EVENT_MAX_FAIL:
dev_dbg(adapter->dev, "event: MAX_FAIL\n"); mwifiex_dbg(adapter, EVENT, "event: MAX_FAIL\n");
break; break;
case EVENT_RSSI_HIGH: case EVENT_RSSI_HIGH:
cfg80211_cqm_rssi_notify(priv->netdev, cfg80211_cqm_rssi_notify(priv->netdev,
@ -416,47 +419,47 @@ int mwifiex_process_sta_event(struct mwifiex_private *priv)
mwifiex_send_cmd(priv, HostCmd_CMD_RSSI_INFO, mwifiex_send_cmd(priv, HostCmd_CMD_RSSI_INFO,
HostCmd_ACT_GEN_GET, 0, NULL, false); HostCmd_ACT_GEN_GET, 0, NULL, false);
priv->subsc_evt_rssi_state = RSSI_HIGH_RECVD; priv->subsc_evt_rssi_state = RSSI_HIGH_RECVD;
dev_dbg(adapter->dev, "event: Beacon RSSI_HIGH\n"); mwifiex_dbg(adapter, EVENT, "event: Beacon RSSI_HIGH\n");
break; break;
case EVENT_SNR_HIGH: case EVENT_SNR_HIGH:
dev_dbg(adapter->dev, "event: Beacon SNR_HIGH\n"); mwifiex_dbg(adapter, EVENT, "event: Beacon SNR_HIGH\n");
break; break;
case EVENT_DATA_RSSI_LOW: case EVENT_DATA_RSSI_LOW:
dev_dbg(adapter->dev, "event: Data RSSI_LOW\n"); mwifiex_dbg(adapter, EVENT, "event: Data RSSI_LOW\n");
break; break;
case EVENT_DATA_SNR_LOW: case EVENT_DATA_SNR_LOW:
dev_dbg(adapter->dev, "event: Data SNR_LOW\n"); mwifiex_dbg(adapter, EVENT, "event: Data SNR_LOW\n");
break; break;
case EVENT_DATA_RSSI_HIGH: case EVENT_DATA_RSSI_HIGH:
dev_dbg(adapter->dev, "event: Data RSSI_HIGH\n"); mwifiex_dbg(adapter, EVENT, "event: Data RSSI_HIGH\n");
break; break;
case EVENT_DATA_SNR_HIGH: case EVENT_DATA_SNR_HIGH:
dev_dbg(adapter->dev, "event: Data SNR_HIGH\n"); mwifiex_dbg(adapter, EVENT, "event: Data SNR_HIGH\n");
break; break;
case EVENT_LINK_QUALITY: case EVENT_LINK_QUALITY:
dev_dbg(adapter->dev, "event: Link Quality\n"); mwifiex_dbg(adapter, EVENT, "event: Link Quality\n");
break; break;
case EVENT_PRE_BEACON_LOST: case EVENT_PRE_BEACON_LOST:
dev_dbg(adapter->dev, "event: Pre-Beacon Lost\n"); mwifiex_dbg(adapter, EVENT, "event: Pre-Beacon Lost\n");
break; break;
case EVENT_IBSS_COALESCED: case EVENT_IBSS_COALESCED:
dev_dbg(adapter->dev, "event: IBSS_COALESCED\n"); mwifiex_dbg(adapter, EVENT, "event: IBSS_COALESCED\n");
ret = mwifiex_send_cmd(priv, ret = mwifiex_send_cmd(priv,
HostCmd_CMD_802_11_IBSS_COALESCING_STATUS, HostCmd_CMD_802_11_IBSS_COALESCING_STATUS,
HostCmd_ACT_GEN_GET, 0, NULL, false); HostCmd_ACT_GEN_GET, 0, NULL, false);
break; break;
case EVENT_ADDBA: case EVENT_ADDBA:
dev_dbg(adapter->dev, "event: ADDBA Request\n"); mwifiex_dbg(adapter, EVENT, "event: ADDBA Request\n");
mwifiex_send_cmd(priv, HostCmd_CMD_11N_ADDBA_RSP, mwifiex_send_cmd(priv, HostCmd_CMD_11N_ADDBA_RSP,
HostCmd_ACT_GEN_SET, 0, HostCmd_ACT_GEN_SET, 0,
adapter->event_body, false); adapter->event_body, false);
break; break;
case EVENT_DELBA: case EVENT_DELBA:
dev_dbg(adapter->dev, "event: DELBA Request\n"); mwifiex_dbg(adapter, EVENT, "event: DELBA Request\n");
mwifiex_11n_delete_ba_stream(priv, adapter->event_body); mwifiex_11n_delete_ba_stream(priv, adapter->event_body);
break; break;
case EVENT_BA_STREAM_TIEMOUT: case EVENT_BA_STREAM_TIEMOUT:
dev_dbg(adapter->dev, "event: BA Stream timeout\n"); mwifiex_dbg(adapter, EVENT, "event: BA Stream timeout\n");
mwifiex_11n_ba_stream_timeout(priv, mwifiex_11n_ba_stream_timeout(priv,
(struct host_cmd_ds_11n_batimeout (struct host_cmd_ds_11n_batimeout
*) *)
@ -464,28 +467,31 @@ int mwifiex_process_sta_event(struct mwifiex_private *priv)
break; break;
case EVENT_AMSDU_AGGR_CTRL: case EVENT_AMSDU_AGGR_CTRL:
ctrl = le16_to_cpu(*(__le16 *)adapter->event_body); ctrl = le16_to_cpu(*(__le16 *)adapter->event_body);
dev_dbg(adapter->dev, "event: AMSDU_AGGR_CTRL %d\n", ctrl); mwifiex_dbg(adapter, EVENT,
"event: AMSDU_AGGR_CTRL %d\n", ctrl);
adapter->tx_buf_size = adapter->tx_buf_size =
min_t(u16, adapter->curr_tx_buf_size, ctrl); min_t(u16, adapter->curr_tx_buf_size, ctrl);
dev_dbg(adapter->dev, "event: tx_buf_size %d\n", mwifiex_dbg(adapter, EVENT, "event: tx_buf_size %d\n",
adapter->tx_buf_size); adapter->tx_buf_size);
break; break;
case EVENT_WEP_ICV_ERR: case EVENT_WEP_ICV_ERR:
dev_dbg(adapter->dev, "event: WEP ICV error\n"); mwifiex_dbg(adapter, EVENT, "event: WEP ICV error\n");
break; break;
case EVENT_BW_CHANGE: case EVENT_BW_CHANGE:
dev_dbg(adapter->dev, "event: BW Change\n"); mwifiex_dbg(adapter, EVENT, "event: BW Change\n");
break; break;
case EVENT_HOSTWAKE_STAIE: case EVENT_HOSTWAKE_STAIE:
dev_dbg(adapter->dev, "event: HOSTWAKE_STAIE %d\n", eventcause); mwifiex_dbg(adapter, EVENT,
"event: HOSTWAKE_STAIE %d\n", eventcause);
break; break;
case EVENT_REMAIN_ON_CHAN_EXPIRED: case EVENT_REMAIN_ON_CHAN_EXPIRED:
dev_dbg(adapter->dev, "event: Remain on channel expired\n"); mwifiex_dbg(adapter, EVENT,
"event: Remain on channel expired\n");
cfg80211_remain_on_channel_expired(&priv->wdev, cfg80211_remain_on_channel_expired(&priv->wdev,
priv->roc_cfg.cookie, priv->roc_cfg.cookie,
&priv->roc_cfg.chan, &priv->roc_cfg.chan,
@ -496,7 +502,7 @@ int mwifiex_process_sta_event(struct mwifiex_private *priv)
break; break;
case EVENT_CHANNEL_SWITCH_ANN: case EVENT_CHANNEL_SWITCH_ANN:
dev_dbg(adapter->dev, "event: Channel Switch Announcement\n"); mwifiex_dbg(adapter, EVENT, "event: Channel Switch Announcement\n");
priv->csa_expire_time = priv->csa_expire_time =
jiffies + msecs_to_jiffies(DFS_CHAN_MOVE_TIME); jiffies + msecs_to_jiffies(DFS_CHAN_MOVE_TIME);
priv->csa_chan = priv->curr_bss_params.bss_descriptor.channel; priv->csa_chan = priv->curr_bss_params.bss_descriptor.channel;
@ -511,23 +517,23 @@ int mwifiex_process_sta_event(struct mwifiex_private *priv)
break; break;
case EVENT_TX_STATUS_REPORT: case EVENT_TX_STATUS_REPORT:
dev_dbg(adapter->dev, "event: TX_STATUS Report\n"); mwifiex_dbg(adapter, EVENT, "event: TX_STATUS Report\n");
mwifiex_parse_tx_status_event(priv, adapter->event_body); mwifiex_parse_tx_status_event(priv, adapter->event_body);
break; break;
case EVENT_CHANNEL_REPORT_RDY: case EVENT_CHANNEL_REPORT_RDY:
dev_dbg(adapter->dev, "event: Channel Report\n"); mwifiex_dbg(adapter, EVENT, "event: Channel Report\n");
ret = mwifiex_11h_handle_chanrpt_ready(priv, ret = mwifiex_11h_handle_chanrpt_ready(priv,
adapter->event_skb); adapter->event_skb);
break; break;
case EVENT_RADAR_DETECTED: case EVENT_RADAR_DETECTED:
dev_dbg(adapter->dev, "event: Radar detected\n"); mwifiex_dbg(adapter, EVENT, "event: Radar detected\n");
ret = mwifiex_11h_handle_radar_detected(priv, ret = mwifiex_11h_handle_radar_detected(priv,
adapter->event_skb); adapter->event_skb);
break; break;
default: default:
dev_dbg(adapter->dev, "event: unknown event id: %#x\n", mwifiex_dbg(adapter, ERROR, "event: unknown event id: %#x\n",
eventcause); eventcause);
break; break;
} }

View File

@ -66,7 +66,8 @@ int mwifiex_wait_queue_complete(struct mwifiex_adapter *adapter,
if (status <= 0) { if (status <= 0) {
if (status == 0) if (status == 0)
status = -ETIMEDOUT; status = -ETIMEDOUT;
dev_err(adapter->dev, "cmd_wait_q terminated: %d\n", status); mwifiex_dbg(adapter, ERROR,
"cmd_wait_q terminated: %d\n", status);
mwifiex_cancel_all_pending_cmd(adapter); mwifiex_cancel_all_pending_cmd(adapter);
return status; return status;
} }
@ -93,7 +94,8 @@ int mwifiex_request_set_multicast_list(struct mwifiex_private *priv,
old_pkt_filter = priv->curr_pkt_filter; old_pkt_filter = priv->curr_pkt_filter;
if (mcast_list->mode == MWIFIEX_PROMISC_MODE) { if (mcast_list->mode == MWIFIEX_PROMISC_MODE) {
dev_dbg(priv->adapter->dev, "info: Enable Promiscuous mode\n"); mwifiex_dbg(priv->adapter, INFO,
"info: Enable Promiscuous mode\n");
priv->curr_pkt_filter |= HostCmd_ACT_MAC_PROMISCUOUS_ENABLE; priv->curr_pkt_filter |= HostCmd_ACT_MAC_PROMISCUOUS_ENABLE;
priv->curr_pkt_filter &= priv->curr_pkt_filter &=
~HostCmd_ACT_MAC_ALL_MULTICAST_ENABLE; ~HostCmd_ACT_MAC_ALL_MULTICAST_ENABLE;
@ -101,16 +103,16 @@ int mwifiex_request_set_multicast_list(struct mwifiex_private *priv,
/* Multicast */ /* Multicast */
priv->curr_pkt_filter &= ~HostCmd_ACT_MAC_PROMISCUOUS_ENABLE; priv->curr_pkt_filter &= ~HostCmd_ACT_MAC_PROMISCUOUS_ENABLE;
if (mcast_list->mode == MWIFIEX_ALL_MULTI_MODE) { if (mcast_list->mode == MWIFIEX_ALL_MULTI_MODE) {
dev_dbg(priv->adapter->dev, mwifiex_dbg(priv->adapter, INFO,
"info: Enabling All Multicast!\n"); "info: Enabling All Multicast!\n");
priv->curr_pkt_filter |= priv->curr_pkt_filter |=
HostCmd_ACT_MAC_ALL_MULTICAST_ENABLE; HostCmd_ACT_MAC_ALL_MULTICAST_ENABLE;
} else { } else {
priv->curr_pkt_filter &= priv->curr_pkt_filter &=
~HostCmd_ACT_MAC_ALL_MULTICAST_ENABLE; ~HostCmd_ACT_MAC_ALL_MULTICAST_ENABLE;
dev_dbg(priv->adapter->dev, mwifiex_dbg(priv->adapter, INFO,
"info: Set multicast list=%d\n", "info: Set multicast list=%d\n",
mcast_list->num_multicast_addr); mcast_list->num_multicast_addr);
/* Send multicast addresses to firmware */ /* Send multicast addresses to firmware */
ret = mwifiex_send_cmd(priv, ret = mwifiex_send_cmd(priv,
HostCmd_CMD_MAC_MULTICAST_ADR, HostCmd_CMD_MAC_MULTICAST_ADR,
@ -118,9 +120,9 @@ int mwifiex_request_set_multicast_list(struct mwifiex_private *priv,
mcast_list, false); mcast_list, false);
} }
} }
dev_dbg(priv->adapter->dev, mwifiex_dbg(priv->adapter, INFO,
"info: old_pkt_filter=%#x, curr_pkt_filter=%#x\n", "info: old_pkt_filter=%#x, curr_pkt_filter=%#x\n",
old_pkt_filter, priv->curr_pkt_filter); old_pkt_filter, priv->curr_pkt_filter);
if (old_pkt_filter != priv->curr_pkt_filter) { if (old_pkt_filter != priv->curr_pkt_filter) {
ret = mwifiex_send_cmd(priv, HostCmd_CMD_MAC_CONTROL, ret = mwifiex_send_cmd(priv, HostCmd_CMD_MAC_CONTROL,
HostCmd_ACT_GEN_SET, HostCmd_ACT_GEN_SET,
@ -153,7 +155,8 @@ int mwifiex_fill_new_bss_desc(struct mwifiex_private *priv,
rcu_read_unlock(); rcu_read_unlock();
if (!beacon_ie) { if (!beacon_ie) {
dev_err(priv->adapter->dev, " failed to alloc beacon_ie\n"); mwifiex_dbg(priv->adapter, ERROR,
" failed to alloc beacon_ie\n");
return -ENOMEM; return -ENOMEM;
} }
@ -167,7 +170,8 @@ int mwifiex_fill_new_bss_desc(struct mwifiex_private *priv,
bss_desc->bss_band = bss_priv->band; bss_desc->bss_band = bss_priv->band;
bss_desc->fw_tsf = bss_priv->fw_tsf; bss_desc->fw_tsf = bss_priv->fw_tsf;
if (bss_desc->cap_info_bitmap & WLAN_CAPABILITY_PRIVACY) { if (bss_desc->cap_info_bitmap & WLAN_CAPABILITY_PRIVACY) {
dev_dbg(priv->adapter->dev, "info: InterpretIE: AP WEP enabled\n"); mwifiex_dbg(priv->adapter, INFO,
"info: InterpretIE: AP WEP enabled\n");
bss_desc->privacy = MWIFIEX_802_11_PRIV_FILTER_8021X_WEP; bss_desc->privacy = MWIFIEX_802_11_PRIV_FILTER_8021X_WEP;
} else { } else {
bss_desc->privacy = MWIFIEX_802_11_PRIV_FILTER_ACCEPT_ALL; bss_desc->privacy = MWIFIEX_802_11_PRIV_FILTER_ACCEPT_ALL;
@ -221,8 +225,8 @@ static int mwifiex_process_country_ie(struct mwifiex_private *priv,
if (!strncmp(priv->adapter->country_code, &country_ie[2], 2)) { if (!strncmp(priv->adapter->country_code, &country_ie[2], 2)) {
rcu_read_unlock(); rcu_read_unlock();
wiphy_dbg(priv->wdev.wiphy, mwifiex_dbg(priv->adapter, INFO,
"11D: skip setting domain info in FW\n"); "11D: skip setting domain info in FW\n");
return 0; return 0;
} }
memcpy(priv->adapter->country_code, &country_ie[2], 2); memcpy(priv->adapter->country_code, &country_ie[2], 2);
@ -243,8 +247,8 @@ static int mwifiex_process_country_ie(struct mwifiex_private *priv,
if (mwifiex_send_cmd(priv, HostCmd_CMD_802_11D_DOMAIN_INFO, if (mwifiex_send_cmd(priv, HostCmd_CMD_802_11D_DOMAIN_INFO,
HostCmd_ACT_GEN_SET, 0, NULL, false)) { HostCmd_ACT_GEN_SET, 0, NULL, false)) {
wiphy_err(priv->adapter->wiphy, mwifiex_dbg(priv->adapter, ERROR,
"11D: setting domain info in FW\n"); "11D: setting domain info in FW fail\n");
return -1; return -1;
} }
@ -306,14 +310,15 @@ int mwifiex_bss_start(struct mwifiex_private *priv, struct cfg80211_bss *bss,
if (mwifiex_11h_get_csa_closed_channel(priv) == if (mwifiex_11h_get_csa_closed_channel(priv) ==
(u8)bss_desc->channel) { (u8)bss_desc->channel) {
dev_err(adapter->dev, mwifiex_dbg(adapter, ERROR,
"Attempt to reconnect on csa closed chan(%d)\n", "Attempt to reconnect on csa closed chan(%d)\n",
bss_desc->channel); bss_desc->channel);
goto done; goto done;
} }
dev_dbg(adapter->dev, "info: SSID found in scan list ... " mwifiex_dbg(adapter, INFO,
"associating...\n"); "info: SSID found in scan list ...\t"
"associating...\n");
mwifiex_stop_net_dev_queue(priv->netdev, adapter); mwifiex_stop_net_dev_queue(priv->netdev, adapter);
if (netif_carrier_ok(priv->netdev)) if (netif_carrier_ok(priv->netdev))
@ -355,15 +360,17 @@ int mwifiex_bss_start(struct mwifiex_private *priv, struct cfg80211_bss *bss,
netif_carrier_off(priv->netdev); netif_carrier_off(priv->netdev);
if (!ret) { if (!ret) {
dev_dbg(adapter->dev, "info: network found in scan" mwifiex_dbg(adapter, INFO,
" list. Joining...\n"); "info: network found in scan\t"
" list. Joining...\n");
ret = mwifiex_adhoc_join(priv, bss_desc); ret = mwifiex_adhoc_join(priv, bss_desc);
if (bss) if (bss)
cfg80211_put_bss(priv->adapter->wiphy, bss); cfg80211_put_bss(priv->adapter->wiphy, bss);
} else { } else {
dev_dbg(adapter->dev, "info: Network not found in " mwifiex_dbg(adapter, INFO,
"the list, creating adhoc with ssid = %s\n", "info: Network not found in\t"
req_ssid->ssid); "the list, creating adhoc with ssid = %s\n",
req_ssid->ssid);
ret = mwifiex_adhoc_start(priv, req_ssid); ret = mwifiex_adhoc_start(priv, req_ssid);
} }
} }
@ -398,8 +405,9 @@ int mwifiex_set_hs_params(struct mwifiex_private *priv, u16 action,
switch (action) { switch (action) {
case HostCmd_ACT_GEN_SET: case HostCmd_ACT_GEN_SET:
if (adapter->pps_uapsd_mode) { if (adapter->pps_uapsd_mode) {
dev_dbg(adapter->dev, "info: Host Sleep IOCTL" mwifiex_dbg(adapter, INFO,
" is blocked in UAPSD/PPS mode\n"); "info: Host Sleep IOCTL\t"
"is blocked in UAPSD/PPS mode\n");
status = -1; status = -1;
break; break;
} }
@ -496,7 +504,8 @@ int mwifiex_enable_hs(struct mwifiex_adapter *adapter)
} }
if (adapter->hs_activated) { if (adapter->hs_activated) {
dev_dbg(adapter->dev, "cmd: HS Already activated\n"); mwifiex_dbg(adapter, CMD,
"cmd: HS Already activated\n");
return true; return true;
} }
@ -512,14 +521,16 @@ int mwifiex_enable_hs(struct mwifiex_adapter *adapter)
MWIFIEX_BSS_ROLE_STA), MWIFIEX_BSS_ROLE_STA),
HostCmd_ACT_GEN_SET, MWIFIEX_SYNC_CMD, HostCmd_ACT_GEN_SET, MWIFIEX_SYNC_CMD,
&hscfg)) { &hscfg)) {
dev_err(adapter->dev, "IOCTL request HS enable failed\n"); mwifiex_dbg(adapter, ERROR,
"IOCTL request HS enable failed\n");
return false; return false;
} }
if (wait_event_interruptible_timeout(adapter->hs_activate_wait_q, if (wait_event_interruptible_timeout(adapter->hs_activate_wait_q,
adapter->hs_activate_wait_q_woken, adapter->hs_activate_wait_q_woken,
(10 * HZ)) <= 0) { (10 * HZ)) <= 0) {
dev_err(adapter->dev, "hs_activate_wait_q terminated\n"); mwifiex_dbg(adapter, ERROR,
"hs_activate_wait_q terminated\n");
return false; return false;
} }
@ -639,10 +650,11 @@ int mwifiex_set_tx_power(struct mwifiex_private *priv,
dbm = (u16) power_cfg->power_level; dbm = (u16) power_cfg->power_level;
if ((dbm < priv->min_tx_power_level) || if ((dbm < priv->min_tx_power_level) ||
(dbm > priv->max_tx_power_level)) { (dbm > priv->max_tx_power_level)) {
dev_err(priv->adapter->dev, "txpower value %d dBm" mwifiex_dbg(priv->adapter, ERROR,
" is out of range (%d dBm-%d dBm)\n", "txpower value %d dBm\t"
dbm, priv->min_tx_power_level, "is out of range (%d dBm-%d dBm)\n",
priv->max_tx_power_level); dbm, priv->min_tx_power_level,
priv->max_tx_power_level);
return -1; return -1;
} }
} }
@ -741,14 +753,15 @@ static int mwifiex_set_wpa_ie_helper(struct mwifiex_private *priv,
{ {
if (ie_len) { if (ie_len) {
if (ie_len > sizeof(priv->wpa_ie)) { if (ie_len > sizeof(priv->wpa_ie)) {
dev_err(priv->adapter->dev, mwifiex_dbg(priv->adapter, ERROR,
"failed to copy WPA IE, too big\n"); "failed to copy WPA IE, too big\n");
return -1; return -1;
} }
memcpy(priv->wpa_ie, ie_data_ptr, ie_len); memcpy(priv->wpa_ie, ie_data_ptr, ie_len);
priv->wpa_ie_len = (u8) ie_len; priv->wpa_ie_len = (u8) ie_len;
dev_dbg(priv->adapter->dev, "cmd: Set Wpa_ie_len=%d IE=%#x\n", mwifiex_dbg(priv->adapter, CMD,
priv->wpa_ie_len, priv->wpa_ie[0]); "cmd: Set Wpa_ie_len=%d IE=%#x\n",
priv->wpa_ie_len, priv->wpa_ie[0]);
if (priv->wpa_ie[0] == WLAN_EID_VENDOR_SPECIFIC) { if (priv->wpa_ie[0] == WLAN_EID_VENDOR_SPECIFIC) {
priv->sec_info.wpa_enabled = true; priv->sec_info.wpa_enabled = true;
@ -761,8 +774,9 @@ static int mwifiex_set_wpa_ie_helper(struct mwifiex_private *priv,
} else { } else {
memset(priv->wpa_ie, 0, sizeof(priv->wpa_ie)); memset(priv->wpa_ie, 0, sizeof(priv->wpa_ie));
priv->wpa_ie_len = 0; priv->wpa_ie_len = 0;
dev_dbg(priv->adapter->dev, "info: reset wpa_ie_len=%d IE=%#x\n", mwifiex_dbg(priv->adapter, INFO,
priv->wpa_ie_len, priv->wpa_ie[0]); "info: reset wpa_ie_len=%d IE=%#x\n",
priv->wpa_ie_len, priv->wpa_ie[0]);
priv->sec_info.wpa_enabled = false; priv->sec_info.wpa_enabled = false;
priv->sec_info.wpa2_enabled = false; priv->sec_info.wpa2_enabled = false;
} }
@ -782,23 +796,24 @@ static int mwifiex_set_wapi_ie(struct mwifiex_private *priv,
{ {
if (ie_len) { if (ie_len) {
if (ie_len > sizeof(priv->wapi_ie)) { if (ie_len > sizeof(priv->wapi_ie)) {
dev_dbg(priv->adapter->dev, mwifiex_dbg(priv->adapter, ERROR,
"info: failed to copy WAPI IE, too big\n"); "info: failed to copy WAPI IE, too big\n");
return -1; return -1;
} }
memcpy(priv->wapi_ie, ie_data_ptr, ie_len); memcpy(priv->wapi_ie, ie_data_ptr, ie_len);
priv->wapi_ie_len = ie_len; priv->wapi_ie_len = ie_len;
dev_dbg(priv->adapter->dev, "cmd: Set wapi_ie_len=%d IE=%#x\n", mwifiex_dbg(priv->adapter, CMD,
priv->wapi_ie_len, priv->wapi_ie[0]); "cmd: Set wapi_ie_len=%d IE=%#x\n",
priv->wapi_ie_len, priv->wapi_ie[0]);
if (priv->wapi_ie[0] == WLAN_EID_BSS_AC_ACCESS_DELAY) if (priv->wapi_ie[0] == WLAN_EID_BSS_AC_ACCESS_DELAY)
priv->sec_info.wapi_enabled = true; priv->sec_info.wapi_enabled = true;
} else { } else {
memset(priv->wapi_ie, 0, sizeof(priv->wapi_ie)); memset(priv->wapi_ie, 0, sizeof(priv->wapi_ie));
priv->wapi_ie_len = ie_len; priv->wapi_ie_len = ie_len;
dev_dbg(priv->adapter->dev, mwifiex_dbg(priv->adapter, INFO,
"info: Reset wapi_ie_len=%d IE=%#x\n", "info: Reset wapi_ie_len=%d IE=%#x\n",
priv->wapi_ie_len, priv->wapi_ie[0]); priv->wapi_ie_len, priv->wapi_ie[0]);
priv->sec_info.wapi_enabled = false; priv->sec_info.wapi_enabled = false;
} }
return 0; return 0;
@ -816,8 +831,8 @@ static int mwifiex_set_wps_ie(struct mwifiex_private *priv,
{ {
if (ie_len) { if (ie_len) {
if (ie_len > MWIFIEX_MAX_VSIE_LEN) { if (ie_len > MWIFIEX_MAX_VSIE_LEN) {
dev_dbg(priv->adapter->dev, mwifiex_dbg(priv->adapter, ERROR,
"info: failed to copy WPS IE, too big\n"); "info: failed to copy WPS IE, too big\n");
return -1; return -1;
} }
@ -827,13 +842,14 @@ static int mwifiex_set_wps_ie(struct mwifiex_private *priv,
memcpy(priv->wps_ie, ie_data_ptr, ie_len); memcpy(priv->wps_ie, ie_data_ptr, ie_len);
priv->wps_ie_len = ie_len; priv->wps_ie_len = ie_len;
dev_dbg(priv->adapter->dev, "cmd: Set wps_ie_len=%d IE=%#x\n", mwifiex_dbg(priv->adapter, CMD,
priv->wps_ie_len, priv->wps_ie[0]); "cmd: Set wps_ie_len=%d IE=%#x\n",
priv->wps_ie_len, priv->wps_ie[0]);
} else { } else {
kfree(priv->wps_ie); kfree(priv->wps_ie);
priv->wps_ie_len = ie_len; priv->wps_ie_len = ie_len;
dev_dbg(priv->adapter->dev, mwifiex_dbg(priv->adapter, INFO,
"info: Reset wps_ie_len=%d\n", priv->wps_ie_len); "info: Reset wps_ie_len=%d\n", priv->wps_ie_len);
} }
return 0; return 0;
} }
@ -877,8 +893,8 @@ static int mwifiex_sec_ioctl_set_wep_key(struct mwifiex_private *priv,
/* Copy the required key as the current key */ /* Copy the required key as the current key */
wep_key = &priv->wep_key[index]; wep_key = &priv->wep_key[index];
if (!wep_key->key_length) { if (!wep_key->key_length) {
dev_err(adapter->dev, mwifiex_dbg(adapter, ERROR,
"key not set, so cannot enable it\n"); "key not set, so cannot enable it\n");
return -1; return -1;
} }
@ -955,7 +971,8 @@ static int mwifiex_sec_ioctl_set_wpa_key(struct mwifiex_private *priv,
/* Current driver only supports key length of up to 32 bytes */ /* Current driver only supports key length of up to 32 bytes */
if (encrypt_key->key_len > WLAN_MAX_KEY_LEN) { if (encrypt_key->key_len > WLAN_MAX_KEY_LEN) {
dev_err(priv->adapter->dev, "key length too long\n"); mwifiex_dbg(priv->adapter, ERROR,
"key length too long\n");
return -1; return -1;
} }
@ -1042,7 +1059,7 @@ mwifiex_drv_get_driver_version(struct mwifiex_adapter *adapter, char *version,
snprintf(version, max_len, driver_version, fw_ver); snprintf(version, max_len, driver_version, fw_ver);
dev_dbg(adapter->dev, "info: MWIFIEX VERSION: %s\n", version); mwifiex_dbg(adapter, MSG, "info: MWIFIEX VERSION: %s\n", version);
return 0; return 0;
} }
@ -1130,7 +1147,8 @@ mwifiex_remain_on_chan_cfg(struct mwifiex_private *priv, u16 action,
} }
if (mwifiex_send_cmd(priv, HostCmd_CMD_REMAIN_ON_CHAN, if (mwifiex_send_cmd(priv, HostCmd_CMD_REMAIN_ON_CHAN,
action, 0, &roc_cfg, true)) { action, 0, &roc_cfg, true)) {
dev_err(priv->adapter->dev, "failed to remain on channel\n"); mwifiex_dbg(priv->adapter, ERROR,
"failed to remain on channel\n");
return -1; return -1;
} }
@ -1315,8 +1333,8 @@ mwifiex_set_gen_ie_helper(struct mwifiex_private *priv, u8 *ie_data_ptr,
if ((pvendor_ie->element_id == WLAN_EID_VENDOR_SPECIFIC) && if ((pvendor_ie->element_id == WLAN_EID_VENDOR_SPECIFIC) &&
(!memcmp(pvendor_ie->oui, wps_oui, sizeof(wps_oui)))) { (!memcmp(pvendor_ie->oui, wps_oui, sizeof(wps_oui)))) {
priv->wps.session_enable = true; priv->wps.session_enable = true;
dev_dbg(priv->adapter->dev, mwifiex_dbg(priv->adapter, INFO,
"info: WPS Session Enabled.\n"); "info: WPS Session Enabled.\n");
ret = mwifiex_set_wps_ie(priv, ie_data_ptr, ie_len); ret = mwifiex_set_wps_ie(priv, ie_data_ptr, ie_len);
} }
@ -1363,7 +1381,8 @@ static int mwifiex_misc_ioctl_gen_ie(struct mwifiex_private *priv,
memset(adapter->arp_filter, 0, sizeof(adapter->arp_filter)); memset(adapter->arp_filter, 0, sizeof(adapter->arp_filter));
if (gen_ie->len > ARP_FILTER_MAX_BUF_SIZE) { if (gen_ie->len > ARP_FILTER_MAX_BUF_SIZE) {
adapter->arp_filter_size = 0; adapter->arp_filter_size = 0;
dev_err(adapter->dev, "invalid ARP filter size\n"); mwifiex_dbg(adapter, ERROR,
"invalid ARP filter size\n");
return -1; return -1;
} else { } else {
memcpy(adapter->arp_filter, gen_ie->ie_data, memcpy(adapter->arp_filter, gen_ie->ie_data,
@ -1372,7 +1391,7 @@ static int mwifiex_misc_ioctl_gen_ie(struct mwifiex_private *priv,
} }
break; break;
default: default:
dev_err(adapter->dev, "invalid IE type\n"); mwifiex_dbg(adapter, ERROR, "invalid IE type\n");
return -1; return -1;
} }
return 0; return 0;

View File

@ -141,7 +141,7 @@ int mwifiex_process_rx_packet(struct mwifiex_private *priv,
if (priv->hs2_enabled && if (priv->hs2_enabled &&
mwifiex_discard_gratuitous_arp(priv, skb)) { mwifiex_discard_gratuitous_arp(priv, skb)) {
dev_dbg(priv->adapter->dev, "Bypassed Gratuitous ARP\n"); mwifiex_dbg(priv->adapter, INFO, "Bypassed Gratuitous ARP\n");
dev_kfree_skb_any(skb); dev_kfree_skb_any(skb);
return 0; return 0;
} }
@ -166,7 +166,8 @@ int mwifiex_process_rx_packet(struct mwifiex_private *priv,
ret = mwifiex_recv_packet(priv, skb); ret = mwifiex_recv_packet(priv, skb);
if (ret == -1) if (ret == -1)
dev_err(priv->adapter->dev, "recv packet failed\n"); mwifiex_dbg(priv->adapter, ERROR,
"recv packet failed\n");
return ret; return ret;
} }
@ -203,9 +204,9 @@ int mwifiex_process_sta_rx_packet(struct mwifiex_private *priv,
rx_pkt_hdr = (void *)local_rx_pd + rx_pkt_offset; rx_pkt_hdr = (void *)local_rx_pd + rx_pkt_offset;
if ((rx_pkt_offset + rx_pkt_length) > (u16) skb->len) { if ((rx_pkt_offset + rx_pkt_length) > (u16) skb->len) {
dev_err(adapter->dev, mwifiex_dbg(adapter, ERROR,
"wrong rx packet: len=%d, rx_pkt_offset=%d, rx_pkt_length=%d\n", "wrong rx packet: len=%d, rx_pkt_offset=%d, rx_pkt_length=%d\n",
skb->len, rx_pkt_offset, rx_pkt_length); skb->len, rx_pkt_offset, rx_pkt_length);
priv->stats.rx_dropped++; priv->stats.rx_dropped++;
dev_kfree_skb_any(skb); dev_kfree_skb_any(skb);
return ret; return ret;
@ -214,7 +215,7 @@ int mwifiex_process_sta_rx_packet(struct mwifiex_private *priv,
if (rx_pkt_type == PKT_TYPE_MGMT) { if (rx_pkt_type == PKT_TYPE_MGMT) {
ret = mwifiex_process_mgmt_packet(priv, skb); ret = mwifiex_process_mgmt_packet(priv, skb);
if (ret) if (ret)
dev_err(adapter->dev, "Rx of mgmt packet failed"); mwifiex_dbg(adapter, ERROR, "Rx of mgmt packet failed");
dev_kfree_skb_any(skb); dev_kfree_skb_any(skb);
return ret; return ret;
} }

View File

@ -53,7 +53,8 @@ void *mwifiex_process_sta_txpd(struct mwifiex_private *priv,
INTF_HEADER_LEN; INTF_HEADER_LEN;
if (!skb->len) { if (!skb->len) {
dev_err(adapter->dev, "Tx: bad packet length: %d\n", skb->len); mwifiex_dbg(adapter, ERROR,
"Tx: bad packet length: %d\n", skb->len);
tx_info->status_code = -1; tx_info->status_code = -1;
return skb->data; return skb->data;
} }
@ -184,21 +185,24 @@ int mwifiex_send_null_packet(struct mwifiex_private *priv, u8 flags)
switch (ret) { switch (ret) {
case -EBUSY: case -EBUSY:
dev_kfree_skb_any(skb); dev_kfree_skb_any(skb);
dev_err(adapter->dev, "%s: host_to_card failed: ret=%d\n", mwifiex_dbg(adapter, ERROR,
__func__, ret); "%s: host_to_card failed: ret=%d\n",
__func__, ret);
adapter->dbg.num_tx_host_to_card_failure++; adapter->dbg.num_tx_host_to_card_failure++;
break; break;
case -1: case -1:
adapter->data_sent = false; adapter->data_sent = false;
dev_kfree_skb_any(skb); dev_kfree_skb_any(skb);
dev_err(adapter->dev, "%s: host_to_card failed: ret=%d\n", mwifiex_dbg(adapter, ERROR,
__func__, ret); "%s: host_to_card failed: ret=%d\n",
__func__, ret);
adapter->dbg.num_tx_host_to_card_failure++; adapter->dbg.num_tx_host_to_card_failure++;
break; break;
case 0: case 0:
dev_kfree_skb_any(skb); dev_kfree_skb_any(skb);
dev_dbg(adapter->dev, "data: %s: host_to_card succeeded\n", mwifiex_dbg(adapter, DATA,
__func__); "data: %s: host_to_card succeeded\n",
__func__);
adapter->tx_lock_flag = true; adapter->tx_lock_flag = true;
break; break;
case -EINPROGRESS: case -EINPROGRESS:

View File

@ -37,7 +37,7 @@ static void mwifiex_restore_tdls_packets(struct mwifiex_private *priv,
u32 tid; u32 tid;
u8 tid_down; u8 tid_down;
dev_dbg(priv->adapter->dev, "%s: %pM\n", __func__, mac); mwifiex_dbg(priv->adapter, DATA, "%s: %pM\n", __func__, mac);
spin_lock_irqsave(&priv->wmm.ra_list_spinlock, flags); spin_lock_irqsave(&priv->wmm.ra_list_spinlock, flags);
skb_queue_walk_safe(&priv->tdls_txq, skb, tmp) { skb_queue_walk_safe(&priv->tdls_txq, skb, tmp) {
@ -94,7 +94,7 @@ static void mwifiex_hold_tdls_packets(struct mwifiex_private *priv,
unsigned long flags; unsigned long flags;
int i; int i;
dev_dbg(priv->adapter->dev, "%s: %pM\n", __func__, mac); mwifiex_dbg(priv->adapter, DATA, "%s: %pM\n", __func__, mac);
spin_lock_irqsave(&priv->wmm.ra_list_spinlock, flags); spin_lock_irqsave(&priv->wmm.ra_list_spinlock, flags);
for (i = 0; i < MAX_NUM_TID; i++) { for (i = 0; i < MAX_NUM_TID; i++) {
@ -132,8 +132,8 @@ mwifiex_tdls_append_rates_ie(struct mwifiex_private *priv,
supp_rates_size = min_t(u16, rates_size, MWIFIEX_TDLS_SUPPORTED_RATES); supp_rates_size = min_t(u16, rates_size, MWIFIEX_TDLS_SUPPORTED_RATES);
if (skb_tailroom(skb) < rates_size + 4) { if (skb_tailroom(skb) < rates_size + 4) {
dev_err(priv->adapter->dev, mwifiex_dbg(priv->adapter, ERROR,
"Insuffient space while adding rates\n"); "Insuffient space while adding rates\n");
return -ENOMEM; return -ENOMEM;
} }
@ -199,8 +199,8 @@ mwifiex_tdls_add_ht_oper(struct mwifiex_private *priv, const u8 *mac,
sta_ptr = mwifiex_get_sta_entry(priv, mac); sta_ptr = mwifiex_get_sta_entry(priv, mac);
if (unlikely(!sta_ptr)) { if (unlikely(!sta_ptr)) {
dev_warn(priv->adapter->dev, mwifiex_dbg(priv->adapter, ERROR,
"TDLS peer station not found in list\n"); "TDLS peer station not found in list\n");
return -1; return -1;
} }
@ -247,15 +247,16 @@ static int mwifiex_tdls_add_vht_oper(struct mwifiex_private *priv,
sta_ptr = mwifiex_get_sta_entry(priv, mac); sta_ptr = mwifiex_get_sta_entry(priv, mac);
if (unlikely(!sta_ptr)) { if (unlikely(!sta_ptr)) {
dev_warn(adapter->dev, "TDLS peer station not found in list\n"); mwifiex_dbg(adapter, ERROR,
"TDLS peer station not found in list\n");
return -1; return -1;
} }
if (!mwifiex_is_bss_in_11ac_mode(priv)) { if (!mwifiex_is_bss_in_11ac_mode(priv)) {
if (sta_ptr->tdls_cap.extcap.ext_capab[7] & if (sta_ptr->tdls_cap.extcap.ext_capab[7] &
WLAN_EXT_CAPA8_TDLS_WIDE_BW_ENABLED) { WLAN_EXT_CAPA8_TDLS_WIDE_BW_ENABLED) {
dev_dbg(adapter->dev, mwifiex_dbg(adapter, WARN,
"TDLS peer doesn't support wider bandwidth\n"); "TDLS peer doesn't support wider bandwidth\n");
return 0; return 0;
} }
} else { } else {
@ -554,7 +555,7 @@ static int mwifiex_prep_tdls_encap_data(struct mwifiex_private *priv,
tf->u.discover_req.dialog_token = dialog_token; tf->u.discover_req.dialog_token = dialog_token;
break; break;
default: default:
dev_err(priv->adapter->dev, "Unknown TDLS frame type.\n"); mwifiex_dbg(priv->adapter, ERROR, "Unknown TDLS frame type.\n");
return -EINVAL; return -EINVAL;
} }
@ -608,8 +609,8 @@ int mwifiex_send_tdls_data_frame(struct mwifiex_private *priv, const u8 *peer,
skb = dev_alloc_skb(skb_len); skb = dev_alloc_skb(skb_len);
if (!skb) { if (!skb) {
dev_err(priv->adapter->dev, mwifiex_dbg(priv->adapter, ERROR,
"allocate skb failed for management frame\n"); "allocate skb failed for management frame\n");
return -ENOMEM; return -ENOMEM;
} }
skb_reserve(skb, MWIFIEX_MIN_DATA_HEADER_LEN); skb_reserve(skb, MWIFIEX_MIN_DATA_HEADER_LEN);
@ -742,7 +743,7 @@ mwifiex_construct_tdls_action_frame(struct mwifiex_private *priv,
mwifiex_tdls_add_qos_capab(skb); mwifiex_tdls_add_qos_capab(skb);
break; break;
default: default:
dev_err(priv->adapter->dev, "Unknown TDLS action frame type\n"); mwifiex_dbg(priv->adapter, ERROR, "Unknown TDLS action frame type\n");
return -EINVAL; return -EINVAL;
} }
@ -781,8 +782,8 @@ int mwifiex_send_tdls_action_frame(struct mwifiex_private *priv, const u8 *peer,
skb = dev_alloc_skb(skb_len); skb = dev_alloc_skb(skb_len);
if (!skb) { if (!skb) {
dev_err(priv->adapter->dev, mwifiex_dbg(priv->adapter, ERROR,
"allocate skb failed for management frame\n"); "allocate skb failed for management frame\n");
return -ENOMEM; return -ENOMEM;
} }
@ -848,8 +849,8 @@ void mwifiex_process_tdls_action_frame(struct mwifiex_private *priv,
peer = buf + ETH_ALEN; peer = buf + ETH_ALEN;
action = *(buf + sizeof(struct ethhdr) + 2); action = *(buf + sizeof(struct ethhdr) + 2);
dev_dbg(priv->adapter->dev, mwifiex_dbg(priv->adapter, DATA,
"rx:tdls action: peer=%pM, action=%d\n", peer, action); "rx:tdls action: peer=%pM, action=%d\n", peer, action);
switch (action) { switch (action) {
case WLAN_TDLS_SETUP_REQUEST: case WLAN_TDLS_SETUP_REQUEST:
@ -880,7 +881,7 @@ void mwifiex_process_tdls_action_frame(struct mwifiex_private *priv,
ie_len = len - sizeof(struct ethhdr) - TDLS_CONFIRM_FIX_LEN; ie_len = len - sizeof(struct ethhdr) - TDLS_CONFIRM_FIX_LEN;
break; break;
default: default:
dev_dbg(priv->adapter->dev, "Unknown TDLS frame type.\n"); mwifiex_dbg(priv->adapter, ERROR, "Unknown TDLS frame type.\n");
return; return;
} }
@ -967,8 +968,8 @@ mwifiex_tdls_process_config_link(struct mwifiex_private *priv, const u8 *peer)
sta_ptr = mwifiex_get_sta_entry(priv, peer); sta_ptr = mwifiex_get_sta_entry(priv, peer);
if (!sta_ptr || sta_ptr->tdls_status == TDLS_SETUP_FAILURE) { if (!sta_ptr || sta_ptr->tdls_status == TDLS_SETUP_FAILURE) {
dev_err(priv->adapter->dev, mwifiex_dbg(priv->adapter, ERROR,
"link absent for peer %pM; cannot config\n", peer); "link absent for peer %pM; cannot config\n", peer);
return -EINVAL; return -EINVAL;
} }
@ -988,8 +989,8 @@ mwifiex_tdls_process_create_link(struct mwifiex_private *priv, const u8 *peer)
sta_ptr = mwifiex_get_sta_entry(priv, peer); sta_ptr = mwifiex_get_sta_entry(priv, peer);
if (sta_ptr && sta_ptr->tdls_status == TDLS_SETUP_INPROGRESS) { if (sta_ptr && sta_ptr->tdls_status == TDLS_SETUP_INPROGRESS) {
dev_dbg(priv->adapter->dev, mwifiex_dbg(priv->adapter, WARN,
"Setup already in progress for peer %pM\n", peer); "Setup already in progress for peer %pM\n", peer);
return 0; return 0;
} }
@ -1046,8 +1047,8 @@ mwifiex_tdls_process_enable_link(struct mwifiex_private *priv, const u8 *peer)
sta_ptr = mwifiex_get_sta_entry(priv, peer); sta_ptr = mwifiex_get_sta_entry(priv, peer);
if (sta_ptr && (sta_ptr->tdls_status != TDLS_SETUP_FAILURE)) { if (sta_ptr && (sta_ptr->tdls_status != TDLS_SETUP_FAILURE)) {
dev_dbg(priv->adapter->dev, mwifiex_dbg(priv->adapter, MSG,
"tdls: enable link %pM success\n", peer); "tdls: enable link %pM success\n", peer);
sta_ptr->tdls_status = TDLS_SETUP_COMPLETE; sta_ptr->tdls_status = TDLS_SETUP_COMPLETE;
@ -1076,8 +1077,8 @@ mwifiex_tdls_process_enable_link(struct mwifiex_private *priv, const u8 *peer)
mwifiex_auto_tdls_update_peer_status(priv, peer, mwifiex_auto_tdls_update_peer_status(priv, peer,
TDLS_SETUP_COMPLETE); TDLS_SETUP_COMPLETE);
} else { } else {
dev_dbg(priv->adapter->dev, mwifiex_dbg(priv->adapter, ERROR,
"tdls: enable link %pM failed\n", peer); "tdls: enable link %pM failed\n", peer);
if (sta_ptr) { if (sta_ptr) {
mwifiex_11n_cleanup_reorder_tbl(priv); mwifiex_11n_cleanup_reorder_tbl(priv);
spin_lock_irqsave(&priv->wmm.ra_list_spinlock, spin_lock_irqsave(&priv->wmm.ra_list_spinlock,
@ -1180,9 +1181,9 @@ void mwifiex_disable_all_tdls_links(struct mwifiex_private *priv)
tdls_oper.tdls_action = MWIFIEX_TDLS_DISABLE_LINK; tdls_oper.tdls_action = MWIFIEX_TDLS_DISABLE_LINK;
if (mwifiex_send_cmd(priv, HostCmd_CMD_TDLS_OPER, if (mwifiex_send_cmd(priv, HostCmd_CMD_TDLS_OPER,
HostCmd_ACT_GEN_SET, 0, &tdls_oper, false)) HostCmd_ACT_GEN_SET, 0, &tdls_oper, false))
dev_warn(priv->adapter->dev, mwifiex_dbg(priv->adapter, ERROR,
"Disable link failed for TDLS peer %pM", "Disable link failed for TDLS peer %pM",
sta_ptr->mac_addr); sta_ptr->mac_addr);
} }
mwifiex_del_all_sta_list(priv); mwifiex_del_all_sta_list(priv);
@ -1204,9 +1205,9 @@ int mwifiex_tdls_check_tx(struct mwifiex_private *priv, struct sk_buff *skb)
(peer->failure_count < (peer->failure_count <
MWIFIEX_TDLS_MAX_FAIL_COUNT)) { MWIFIEX_TDLS_MAX_FAIL_COUNT)) {
peer->tdls_status = TDLS_SETUP_INPROGRESS; peer->tdls_status = TDLS_SETUP_INPROGRESS;
dev_dbg(priv->adapter->dev, mwifiex_dbg(priv->adapter, INFO,
"setup TDLS link, peer=%pM rssi=%d\n", "setup TDLS link, peer=%pM rssi=%d\n",
peer->mac_addr, peer->rssi); peer->mac_addr, peer->rssi);
cfg80211_tdls_oper_request(priv->netdev, cfg80211_tdls_oper_request(priv->netdev,
peer->mac_addr, peer->mac_addr,
@ -1272,8 +1273,8 @@ void mwifiex_add_auto_tdls_peer(struct mwifiex_private *priv, const u8 *mac)
tdls_peer->rssi_jiffies = jiffies; tdls_peer->rssi_jiffies = jiffies;
INIT_LIST_HEAD(&tdls_peer->list); INIT_LIST_HEAD(&tdls_peer->list);
list_add_tail(&tdls_peer->list, &priv->auto_tdls_list); list_add_tail(&tdls_peer->list, &priv->auto_tdls_list);
dev_dbg(priv->adapter->dev, "Add auto TDLS peer= %pM to list\n", mwifiex_dbg(priv->adapter, INFO,
mac); "Add auto TDLS peer= %pM to list\n", mac);
} }
spin_unlock_irqrestore(&priv->auto_tdls_lock, flags); spin_unlock_irqrestore(&priv->auto_tdls_lock, flags);
@ -1341,8 +1342,8 @@ void mwifiex_check_auto_tdls(unsigned long context)
return; return;
if (!priv->auto_tdls_timer_active) { if (!priv->auto_tdls_timer_active) {
dev_dbg(priv->adapter->dev, mwifiex_dbg(priv->adapter, INFO,
"auto TDLS timer inactive; return"); "auto TDLS timer inactive; return");
return; return;
} }
@ -1368,9 +1369,9 @@ void mwifiex_check_auto_tdls(unsigned long context)
!tdls_peer->rssi) && !tdls_peer->rssi) &&
tdls_peer->tdls_status == TDLS_SETUP_COMPLETE) { tdls_peer->tdls_status == TDLS_SETUP_COMPLETE) {
tdls_peer->tdls_status = TDLS_LINK_TEARDOWN; tdls_peer->tdls_status = TDLS_LINK_TEARDOWN;
dev_dbg(priv->adapter->dev, mwifiex_dbg(priv->adapter, MSG,
"teardown TDLS link,peer=%pM rssi=%d\n", "teardown TDLS link,peer=%pM rssi=%d\n",
tdls_peer->mac_addr, -tdls_peer->rssi); tdls_peer->mac_addr, -tdls_peer->rssi);
tdls_peer->do_discover = true; tdls_peer->do_discover = true;
priv->check_tdls_tx = true; priv->check_tdls_tx = true;
cfg80211_tdls_oper_request(priv->netdev, cfg80211_tdls_oper_request(priv->netdev,
@ -1384,9 +1385,10 @@ void mwifiex_check_auto_tdls(unsigned long context)
MWIFIEX_TDLS_MAX_FAIL_COUNT) { MWIFIEX_TDLS_MAX_FAIL_COUNT) {
priv->check_tdls_tx = true; priv->check_tdls_tx = true;
tdls_peer->do_setup = true; tdls_peer->do_setup = true;
dev_dbg(priv->adapter->dev, mwifiex_dbg(priv->adapter, INFO,
"check TDLS with peer=%pM rssi=%d\n", "check TDLS with peer=%pM\t"
tdls_peer->mac_addr, -tdls_peer->rssi); "rssi=%d\n", tdls_peer->mac_addr,
tdls_peer->rssi);
} }
} }
spin_unlock_irqrestore(&priv->auto_tdls_lock, flags); spin_unlock_irqrestore(&priv->auto_tdls_lock, flags);

View File

@ -50,7 +50,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);
if (!priv) { if (!priv) {
dev_err(adapter->dev, "data: priv not found. Drop RX packet\n"); mwifiex_dbg(adapter, ERROR,
"data: priv not found. Drop RX packet\n");
dev_kfree_skb_any(skb); dev_kfree_skb_any(skb);
return -1; return -1;
} }
@ -120,7 +121,7 @@ int mwifiex_process_tx(struct mwifiex_private *priv, struct sk_buff *skb,
switch (ret) { switch (ret) {
case -ENOSR: case -ENOSR:
dev_dbg(adapter->dev, "data: -ENOSR is returned\n"); mwifiex_dbg(adapter, ERROR, "data: -ENOSR is returned\n");
break; break;
case -EBUSY: case -EBUSY:
if ((GET_BSS_ROLE(priv) == MWIFIEX_BSS_ROLE_STA) && if ((GET_BSS_ROLE(priv) == MWIFIEX_BSS_ROLE_STA) &&
@ -129,13 +130,14 @@ int mwifiex_process_tx(struct mwifiex_private *priv, struct sk_buff *skb,
if (local_tx_pd) if (local_tx_pd)
local_tx_pd->flags = 0; local_tx_pd->flags = 0;
} }
dev_dbg(adapter->dev, "data: -EBUSY is returned\n"); mwifiex_dbg(adapter, ERROR, "data: -EBUSY is returned\n");
break; break;
case -1: case -1:
if (adapter->iface_type != MWIFIEX_PCIE) if (adapter->iface_type != MWIFIEX_PCIE)
adapter->data_sent = false; adapter->data_sent = false;
dev_err(adapter->dev, "mwifiex_write_data_async failed: 0x%X\n", mwifiex_dbg(adapter, ERROR,
ret); "mwifiex_write_data_async failed: 0x%X\n",
ret);
adapter->dbg.num_tx_host_to_card_failure++; adapter->dbg.num_tx_host_to_card_failure++;
mwifiex_write_data_complete(adapter, skb, 0, ret); mwifiex_write_data_complete(adapter, skb, 0, ret);
break; break;
@ -167,7 +169,8 @@ static int mwifiex_host_to_card(struct mwifiex_adapter *adapter,
priv = mwifiex_get_priv_by_id(adapter, tx_info->bss_num, priv = mwifiex_get_priv_by_id(adapter, tx_info->bss_num,
tx_info->bss_type); tx_info->bss_type);
if (!priv) { if (!priv) {
dev_err(adapter->dev, "data: priv not found. Drop TX packet\n"); mwifiex_dbg(adapter, ERROR,
"data: priv not found. Drop TX packet\n");
adapter->dbg.num_tx_host_to_card_failure++; adapter->dbg.num_tx_host_to_card_failure++;
mwifiex_write_data_complete(adapter, skb, 0, 0); mwifiex_write_data_complete(adapter, skb, 0, 0);
return ret; return ret;
@ -192,7 +195,7 @@ static int mwifiex_host_to_card(struct mwifiex_adapter *adapter,
} }
switch (ret) { switch (ret) {
case -ENOSR: case -ENOSR:
dev_err(adapter->dev, "data: -ENOSR is returned\n"); mwifiex_dbg(adapter, ERROR, "data: -ENOSR is returned\n");
break; break;
case -EBUSY: case -EBUSY:
if ((GET_BSS_ROLE(priv) == MWIFIEX_BSS_ROLE_STA) && if ((GET_BSS_ROLE(priv) == MWIFIEX_BSS_ROLE_STA) &&
@ -207,13 +210,13 @@ static int mwifiex_host_to_card(struct mwifiex_adapter *adapter,
atomic_add(tx_info->aggr_num, &adapter->tx_queued); atomic_add(tx_info->aggr_num, &adapter->tx_queued);
else else
atomic_inc(&adapter->tx_queued); atomic_inc(&adapter->tx_queued);
dev_dbg(adapter->dev, "data: -EBUSY is returned\n"); mwifiex_dbg(adapter, ERROR, "data: -EBUSY is returned\n");
break; break;
case -1: case -1:
if (adapter->iface_type != MWIFIEX_PCIE) if (adapter->iface_type != MWIFIEX_PCIE)
adapter->data_sent = false; adapter->data_sent = false;
dev_err(adapter->dev, "mwifiex_write_data_async failed: 0x%X\n", mwifiex_dbg(adapter, ERROR,
ret); "mwifiex_write_data_async failed: 0x%X\n", ret);
adapter->dbg.num_tx_host_to_card_failure++; adapter->dbg.num_tx_host_to_card_failure++;
mwifiex_write_data_complete(adapter, skb, 0, ret); mwifiex_write_data_complete(adapter, skb, 0, ret);
break; break;
@ -324,7 +327,7 @@ int mwifiex_write_data_complete(struct mwifiex_adapter *adapter,
txq = netdev_get_tx_queue(priv->netdev, index); txq = netdev_get_tx_queue(priv->netdev, index);
if (netif_tx_queue_stopped(txq)) { if (netif_tx_queue_stopped(txq)) {
netif_tx_wake_queue(txq); netif_tx_wake_queue(txq);
dev_dbg(adapter->dev, "wake queue: %d\n", index); mwifiex_dbg(adapter, DATA, "wake queue: %d\n", index);
} }
} }
done: done:

View File

@ -184,8 +184,8 @@ mwifiex_set_ht_params(struct mwifiex_private *priv,
bss_cfg->ht_cap.mcs.rx_mask[1] = 0xff; bss_cfg->ht_cap.mcs.rx_mask[1] = 0xff;
break; break;
default: default:
dev_warn(priv->adapter->dev, mwifiex_dbg(priv->adapter, WARN,
"Unsupported RX-STBC, default to 2x2\n"); "Unsupported RX-STBC, default to 2x2\n");
bss_cfg->ht_cap.mcs.rx_mask[0] = 0xff; bss_cfg->ht_cap.mcs.rx_mask[0] = 0xff;
bss_cfg->ht_cap.mcs.rx_mask[1] = 0xff; bss_cfg->ht_cap.mcs.rx_mask[1] = 0xff;
break; break;
@ -767,8 +767,8 @@ int mwifiex_uap_prepare_cmd(struct mwifiex_private *priv, u16 cmd_no,
return -1; return -1;
break; break;
default: default:
dev_err(priv->adapter->dev, mwifiex_dbg(priv->adapter, ERROR,
"PREP_CMD: unknown cmd %#x\n", cmd_no); "PREP_CMD: unknown cmd %#x\n", cmd_no);
return -1; return -1;
} }
@ -806,24 +806,28 @@ int mwifiex_config_start_uap(struct mwifiex_private *priv,
struct mwifiex_uap_bss_param *bss_cfg) struct mwifiex_uap_bss_param *bss_cfg)
{ {
if (mwifiex_del_mgmt_ies(priv)) if (mwifiex_del_mgmt_ies(priv))
dev_err(priv->adapter->dev, "Failed to delete mgmt IEs!\n"); mwifiex_dbg(priv->adapter, ERROR,
"Failed to delete mgmt IEs!\n");
if (mwifiex_send_cmd(priv, HostCmd_CMD_UAP_BSS_STOP, if (mwifiex_send_cmd(priv, HostCmd_CMD_UAP_BSS_STOP,
HostCmd_ACT_GEN_SET, 0, NULL, true)) { HostCmd_ACT_GEN_SET, 0, NULL, true)) {
dev_err(priv->adapter->dev, "Failed to stop the BSS\n"); mwifiex_dbg(priv->adapter, ERROR,
"Failed to stop the BSS\n");
return -1; return -1;
} }
if (mwifiex_send_cmd(priv, HostCmd_CMD_UAP_SYS_CONFIG, if (mwifiex_send_cmd(priv, HostCmd_CMD_UAP_SYS_CONFIG,
HostCmd_ACT_GEN_SET, HostCmd_ACT_GEN_SET,
UAP_BSS_PARAMS_I, bss_cfg, false)) { UAP_BSS_PARAMS_I, bss_cfg, false)) {
dev_err(priv->adapter->dev, "Failed to set the SSID\n"); mwifiex_dbg(priv->adapter, ERROR,
"Failed to set the SSID\n");
return -1; return -1;
} }
if (mwifiex_send_cmd(priv, HostCmd_CMD_UAP_BSS_START, if (mwifiex_send_cmd(priv, HostCmd_CMD_UAP_BSS_START,
HostCmd_ACT_GEN_SET, 0, NULL, false)) { HostCmd_ACT_GEN_SET, 0, NULL, false)) {
dev_err(priv->adapter->dev, "Failed to start the BSS\n"); mwifiex_dbg(priv->adapter, ERROR,
"Failed to start the BSS\n");
return -1; return -1;
} }

View File

@ -80,8 +80,8 @@ int mwifiex_process_uap_event(struct mwifiex_private *priv)
node = mwifiex_add_sta_entry(priv, event->sta_addr); node = mwifiex_add_sta_entry(priv, event->sta_addr);
if (!node) { if (!node) {
dev_warn(adapter->dev, mwifiex_dbg(adapter, ERROR,
"could not create station entry!\n"); "could not create station entry!\n");
return -1; return -1;
} }
@ -128,7 +128,8 @@ int mwifiex_process_uap_event(struct mwifiex_private *priv)
mwifiex_wake_up_net_dev_queue(priv->netdev, adapter); mwifiex_wake_up_net_dev_queue(priv->netdev, adapter);
break; break;
case EVENT_UAP_BSS_START: case EVENT_UAP_BSS_START:
dev_dbg(adapter->dev, "AP EVENT: event id: %#x\n", eventcause); mwifiex_dbg(adapter, EVENT,
"AP EVENT: event id: %#x\n", eventcause);
memcpy(priv->netdev->dev_addr, adapter->event_body + 2, memcpy(priv->netdev->dev_addr, adapter->event_body + 2,
ETH_ALEN); ETH_ALEN);
if (priv->hist_data) if (priv->hist_data)
@ -136,50 +137,53 @@ int mwifiex_process_uap_event(struct mwifiex_private *priv)
break; break;
case EVENT_UAP_MIC_COUNTERMEASURES: case EVENT_UAP_MIC_COUNTERMEASURES:
/* For future development */ /* For future development */
dev_dbg(adapter->dev, "AP EVENT: event id: %#x\n", eventcause); mwifiex_dbg(adapter, EVENT,
"AP EVENT: event id: %#x\n", eventcause);
break; break;
case EVENT_AMSDU_AGGR_CTRL: case EVENT_AMSDU_AGGR_CTRL:
ctrl = le16_to_cpu(*(__le16 *)adapter->event_body); ctrl = le16_to_cpu(*(__le16 *)adapter->event_body);
dev_dbg(adapter->dev, "event: AMSDU_AGGR_CTRL %d\n", ctrl); mwifiex_dbg(adapter, EVENT,
"event: AMSDU_AGGR_CTRL %d\n", ctrl);
if (priv->media_connected) { if (priv->media_connected) {
adapter->tx_buf_size = adapter->tx_buf_size =
min_t(u16, adapter->curr_tx_buf_size, ctrl); min_t(u16, adapter->curr_tx_buf_size, ctrl);
dev_dbg(adapter->dev, "event: tx_buf_size %d\n", mwifiex_dbg(adapter, EVENT,
adapter->tx_buf_size); "event: tx_buf_size %d\n",
adapter->tx_buf_size);
} }
break; break;
case EVENT_ADDBA: case EVENT_ADDBA:
dev_dbg(adapter->dev, "event: ADDBA Request\n"); mwifiex_dbg(adapter, EVENT, "event: ADDBA Request\n");
if (priv->media_connected) if (priv->media_connected)
mwifiex_send_cmd(priv, HostCmd_CMD_11N_ADDBA_RSP, mwifiex_send_cmd(priv, HostCmd_CMD_11N_ADDBA_RSP,
HostCmd_ACT_GEN_SET, 0, HostCmd_ACT_GEN_SET, 0,
adapter->event_body, false); adapter->event_body, false);
break; break;
case EVENT_DELBA: case EVENT_DELBA:
dev_dbg(adapter->dev, "event: DELBA Request\n"); mwifiex_dbg(adapter, EVENT, "event: DELBA Request\n");
if (priv->media_connected) if (priv->media_connected)
mwifiex_11n_delete_ba_stream(priv, adapter->event_body); mwifiex_11n_delete_ba_stream(priv, adapter->event_body);
break; break;
case EVENT_BA_STREAM_TIEMOUT: case EVENT_BA_STREAM_TIEMOUT:
dev_dbg(adapter->dev, "event: BA Stream timeout\n"); mwifiex_dbg(adapter, EVENT, "event: BA Stream timeout\n");
if (priv->media_connected) { if (priv->media_connected) {
ba_timeout = (void *)adapter->event_body; ba_timeout = (void *)adapter->event_body;
mwifiex_11n_ba_stream_timeout(priv, ba_timeout); mwifiex_11n_ba_stream_timeout(priv, ba_timeout);
} }
break; break;
case EVENT_EXT_SCAN_REPORT: case EVENT_EXT_SCAN_REPORT:
dev_dbg(adapter->dev, "event: EXT_SCAN Report\n"); mwifiex_dbg(adapter, EVENT, "event: EXT_SCAN Report\n");
if (adapter->ext_scan) if (adapter->ext_scan)
return mwifiex_handle_event_ext_scan_report(priv, return mwifiex_handle_event_ext_scan_report(priv,
adapter->event_skb->data); adapter->event_skb->data);
break; break;
case EVENT_TX_STATUS_REPORT: case EVENT_TX_STATUS_REPORT:
dev_dbg(adapter->dev, "event: TX_STATUS Report\n"); mwifiex_dbg(adapter, EVENT, "event: TX_STATUS Report\n");
mwifiex_parse_tx_status_event(priv, adapter->event_body); mwifiex_parse_tx_status_event(priv, adapter->event_body);
break; break;
case EVENT_PS_SLEEP: case EVENT_PS_SLEEP:
dev_dbg(adapter->dev, "info: EVENT: SLEEP\n"); mwifiex_dbg(adapter, EVENT, "info: EVENT: SLEEP\n");
adapter->ps_state = PS_STATE_PRE_SLEEP; adapter->ps_state = PS_STATE_PRE_SLEEP;
@ -187,12 +191,12 @@ int mwifiex_process_uap_event(struct mwifiex_private *priv)
break; break;
case EVENT_PS_AWAKE: case EVENT_PS_AWAKE:
dev_dbg(adapter->dev, "info: EVENT: AWAKE\n"); mwifiex_dbg(adapter, EVENT, "info: EVENT: AWAKE\n");
if (!adapter->pps_uapsd_mode && if (!adapter->pps_uapsd_mode &&
priv->media_connected && adapter->sleep_period.period) { priv->media_connected && adapter->sleep_period.period) {
adapter->pps_uapsd_mode = true; adapter->pps_uapsd_mode = true;
dev_dbg(adapter->dev, mwifiex_dbg(adapter, EVENT,
"event: PPS/UAPSD mode activated\n"); "event: PPS/UAPSD mode activated\n");
} }
adapter->tx_lock_flag = false; adapter->tx_lock_flag = false;
if (adapter->pps_uapsd_mode && adapter->gen_null_pkt) { if (adapter->pps_uapsd_mode && adapter->gen_null_pkt) {
@ -218,16 +222,16 @@ int mwifiex_process_uap_event(struct mwifiex_private *priv)
break; break;
case EVENT_CHANNEL_REPORT_RDY: case EVENT_CHANNEL_REPORT_RDY:
dev_dbg(adapter->dev, "event: Channel Report\n"); mwifiex_dbg(adapter, EVENT, "event: Channel Report\n");
mwifiex_11h_handle_chanrpt_ready(priv, adapter->event_skb); mwifiex_11h_handle_chanrpt_ready(priv, adapter->event_skb);
break; break;
case EVENT_RADAR_DETECTED: case EVENT_RADAR_DETECTED:
dev_dbg(adapter->dev, "event: Radar detected\n"); mwifiex_dbg(adapter, EVENT, "event: Radar detected\n");
mwifiex_11h_handle_radar_detected(priv, adapter->event_skb); mwifiex_11h_handle_radar_detected(priv, adapter->event_skb);
break; break;
default: default:
dev_dbg(adapter->dev, "event: unknown event id: %#x\n", mwifiex_dbg(adapter, EVENT,
eventcause); "event: unknown event id: %#x\n", eventcause);
break; break;
} }

View File

@ -103,8 +103,8 @@ static void mwifiex_uap_queue_bridged_pkt(struct mwifiex_private *priv,
if ((atomic_read(&adapter->pending_bridged_pkts) >= if ((atomic_read(&adapter->pending_bridged_pkts) >=
MWIFIEX_BRIDGED_PKTS_THR_HIGH)) { MWIFIEX_BRIDGED_PKTS_THR_HIGH)) {
dev_err(priv->adapter->dev, mwifiex_dbg(priv->adapter, ERROR,
"Tx: Bridge packet limit reached. Drop packet!\n"); "Tx: Bridge packet limit reached. Drop packet!\n");
kfree_skb(skb); kfree_skb(skb);
mwifiex_uap_cleanup_tx_queues(priv); mwifiex_uap_cleanup_tx_queues(priv);
return; return;
@ -153,15 +153,15 @@ static void mwifiex_uap_queue_bridged_pkt(struct mwifiex_private *priv,
skb_pull(skb, hdr_chop); skb_pull(skb, hdr_chop);
if (skb_headroom(skb) < MWIFIEX_MIN_DATA_HEADER_LEN) { if (skb_headroom(skb) < MWIFIEX_MIN_DATA_HEADER_LEN) {
dev_dbg(priv->adapter->dev, mwifiex_dbg(priv->adapter, ERROR,
"data: Tx: insufficient skb headroom %d\n", "data: Tx: insufficient skb headroom %d\n",
skb_headroom(skb)); skb_headroom(skb));
/* Insufficient skb headroom - allocate a new skb */ /* Insufficient skb headroom - allocate a new skb */
new_skb = new_skb =
skb_realloc_headroom(skb, MWIFIEX_MIN_DATA_HEADER_LEN); skb_realloc_headroom(skb, MWIFIEX_MIN_DATA_HEADER_LEN);
if (unlikely(!new_skb)) { if (unlikely(!new_skb)) {
dev_err(priv->adapter->dev, mwifiex_dbg(priv->adapter, ERROR,
"Tx: cannot allocate new_skb\n"); "Tx: cannot allocate new_skb\n");
kfree_skb(skb); kfree_skb(skb);
priv->stats.tx_dropped++; priv->stats.tx_dropped++;
return; return;
@ -169,8 +169,9 @@ static void mwifiex_uap_queue_bridged_pkt(struct mwifiex_private *priv,
kfree_skb(skb); kfree_skb(skb);
skb = new_skb; skb = new_skb;
dev_dbg(priv->adapter->dev, "info: new skb headroom %d\n", mwifiex_dbg(priv->adapter, INFO,
skb_headroom(skb)); "info: new skb headroom %d\n",
skb_headroom(skb));
} }
tx_info = MWIFIEX_SKB_TXCB(skb); tx_info = MWIFIEX_SKB_TXCB(skb);
@ -225,7 +226,8 @@ int mwifiex_handle_uap_rx_forward(struct mwifiex_private *priv,
/* don't do packet forwarding in disconnected state */ /* don't do packet forwarding in disconnected state */
if (!priv->media_connected) { if (!priv->media_connected) {
dev_err(adapter->dev, "drop packet in disconnected state.\n"); mwifiex_dbg(adapter, ERROR,
"drop packet in disconnected state.\n");
dev_kfree_skb_any(skb); dev_kfree_skb_any(skb);
return 0; return 0;
} }
@ -275,10 +277,10 @@ int mwifiex_process_uap_rx_packet(struct mwifiex_private *priv,
if ((le16_to_cpu(uap_rx_pd->rx_pkt_offset) + if ((le16_to_cpu(uap_rx_pd->rx_pkt_offset) +
le16_to_cpu(uap_rx_pd->rx_pkt_length)) > (u16) skb->len) { le16_to_cpu(uap_rx_pd->rx_pkt_length)) > (u16) skb->len) {
dev_err(adapter->dev, mwifiex_dbg(adapter, ERROR,
"wrong rx packet: len=%d, offset=%d, length=%d\n", "wrong rx packet: len=%d, offset=%d, length=%d\n",
skb->len, le16_to_cpu(uap_rx_pd->rx_pkt_offset), skb->len, le16_to_cpu(uap_rx_pd->rx_pkt_offset),
le16_to_cpu(uap_rx_pd->rx_pkt_length)); le16_to_cpu(uap_rx_pd->rx_pkt_length));
priv->stats.rx_dropped++; priv->stats.rx_dropped++;
dev_kfree_skb_any(skb); dev_kfree_skb_any(skb);
return 0; return 0;
@ -287,7 +289,8 @@ int mwifiex_process_uap_rx_packet(struct mwifiex_private *priv,
if (rx_pkt_type == PKT_TYPE_MGMT) { if (rx_pkt_type == PKT_TYPE_MGMT) {
ret = mwifiex_process_mgmt_packet(priv, skb); ret = mwifiex_process_mgmt_packet(priv, skb);
if (ret) if (ret)
dev_err(adapter->dev, "Rx of mgmt packet failed"); mwifiex_dbg(adapter, ERROR,
"Rx of mgmt packet failed");
dev_kfree_skb_any(skb); dev_kfree_skb_any(skb);
return ret; return ret;
} }
@ -354,7 +357,8 @@ void *mwifiex_process_uap_txpd(struct mwifiex_private *priv,
INTF_HEADER_LEN; INTF_HEADER_LEN;
if (!skb->len) { if (!skb->len) {
dev_err(adapter->dev, "Tx: bad packet length: %d\n", skb->len); mwifiex_dbg(adapter, ERROR,
"Tx: bad packet length: %d\n", skb->len);
tx_info->status_code = -1; tx_info->status_code = -1;
return skb->data; return skb->data;
} }

View File

@ -60,7 +60,6 @@ static int mwifiex_usb_submit_rx_urb(struct urb_context *ctx, int size);
static int mwifiex_usb_recv(struct mwifiex_adapter *adapter, static int mwifiex_usb_recv(struct mwifiex_adapter *adapter,
struct sk_buff *skb, u8 ep) struct sk_buff *skb, u8 ep)
{ {
struct device *dev = adapter->dev;
u32 recv_type; u32 recv_type;
__le32 tmp; __le32 tmp;
int ret; int ret;
@ -69,13 +68,15 @@ static int mwifiex_usb_recv(struct mwifiex_adapter *adapter,
mwifiex_process_hs_config(adapter); mwifiex_process_hs_config(adapter);
if (skb->len < INTF_HEADER_LEN) { if (skb->len < INTF_HEADER_LEN) {
dev_err(dev, "%s: invalid skb->len\n", __func__); mwifiex_dbg(adapter, ERROR,
"%s: invalid skb->len\n", __func__);
return -1; return -1;
} }
switch (ep) { switch (ep) {
case MWIFIEX_USB_EP_CMD_EVENT: case MWIFIEX_USB_EP_CMD_EVENT:
dev_dbg(dev, "%s: EP_CMD_EVENT\n", __func__); mwifiex_dbg(adapter, EVENT,
"%s: EP_CMD_EVENT\n", __func__);
skb_copy_from_linear_data(skb, &tmp, INTF_HEADER_LEN); skb_copy_from_linear_data(skb, &tmp, INTF_HEADER_LEN);
recv_type = le32_to_cpu(tmp); recv_type = le32_to_cpu(tmp);
skb_pull(skb, INTF_HEADER_LEN); skb_pull(skb, INTF_HEADER_LEN);
@ -83,11 +84,12 @@ static int mwifiex_usb_recv(struct mwifiex_adapter *adapter,
switch (recv_type) { switch (recv_type) {
case MWIFIEX_USB_TYPE_CMD: case MWIFIEX_USB_TYPE_CMD:
if (skb->len > MWIFIEX_SIZE_OF_CMD_BUFFER) { if (skb->len > MWIFIEX_SIZE_OF_CMD_BUFFER) {
dev_err(dev, "CMD: skb->len too large\n"); mwifiex_dbg(adapter, ERROR,
"CMD: skb->len too large\n");
ret = -1; ret = -1;
goto exit_restore_skb; goto exit_restore_skb;
} else if (!adapter->curr_cmd) { } else if (!adapter->curr_cmd) {
dev_dbg(dev, "CMD: no curr_cmd\n"); mwifiex_dbg(adapter, WARN, "CMD: no curr_cmd\n");
if (adapter->ps_state == PS_STATE_SLEEP_CFM) { if (adapter->ps_state == PS_STATE_SLEEP_CFM) {
mwifiex_process_sleep_confirm_resp( mwifiex_process_sleep_confirm_resp(
adapter, skb->data, adapter, skb->data,
@ -104,16 +106,19 @@ static int mwifiex_usb_recv(struct mwifiex_adapter *adapter,
break; break;
case MWIFIEX_USB_TYPE_EVENT: case MWIFIEX_USB_TYPE_EVENT:
if (skb->len < sizeof(u32)) { if (skb->len < sizeof(u32)) {
dev_err(dev, "EVENT: skb->len too small\n"); mwifiex_dbg(adapter, ERROR,
"EVENT: skb->len too small\n");
ret = -1; ret = -1;
goto exit_restore_skb; goto exit_restore_skb;
} }
skb_copy_from_linear_data(skb, &tmp, sizeof(u32)); skb_copy_from_linear_data(skb, &tmp, sizeof(u32));
adapter->event_cause = le32_to_cpu(tmp); adapter->event_cause = le32_to_cpu(tmp);
dev_dbg(dev, "event_cause %#x\n", adapter->event_cause); mwifiex_dbg(adapter, EVENT,
"event_cause %#x\n", adapter->event_cause);
if (skb->len > MAX_EVENT_SIZE) { if (skb->len > MAX_EVENT_SIZE) {
dev_err(dev, "EVENT: event body too large\n"); mwifiex_dbg(adapter, ERROR,
"EVENT: event body too large\n");
ret = -1; ret = -1;
goto exit_restore_skb; goto exit_restore_skb;
} }
@ -125,14 +130,16 @@ static int mwifiex_usb_recv(struct mwifiex_adapter *adapter,
adapter->event_skb = skb; adapter->event_skb = skb;
break; break;
default: default:
dev_err(dev, "unknown recv_type %#x\n", recv_type); mwifiex_dbg(adapter, ERROR,
"unknown recv_type %#x\n", recv_type);
return -1; return -1;
} }
break; break;
case MWIFIEX_USB_EP_DATA: case MWIFIEX_USB_EP_DATA:
dev_dbg(dev, "%s: EP_DATA\n", __func__); mwifiex_dbg(adapter, DATA, "%s: EP_DATA\n", __func__);
if (skb->len > MWIFIEX_RX_DATA_BUF_SIZE) { if (skb->len > MWIFIEX_RX_DATA_BUF_SIZE) {
dev_err(dev, "DATA: skb->len too large\n"); mwifiex_dbg(adapter, ERROR,
"DATA: skb->len too large\n");
return -1; return -1;
} }
@ -141,7 +148,8 @@ static int mwifiex_usb_recv(struct mwifiex_adapter *adapter,
atomic_inc(&adapter->rx_pending); atomic_inc(&adapter->rx_pending);
break; break;
default: default:
dev_err(dev, "%s: unknown endport %#x\n", __func__, ep); mwifiex_dbg(adapter, ERROR,
"%s: unknown endport %#x\n", __func__, ep);
return -1; return -1;
} }
@ -176,8 +184,8 @@ static void mwifiex_usb_rx_complete(struct urb *urb)
if (recv_length) { if (recv_length) {
if (urb->status || (adapter->surprise_removed)) { if (urb->status || (adapter->surprise_removed)) {
dev_err(adapter->dev, mwifiex_dbg(adapter, ERROR,
"URB status is failed: %d\n", urb->status); "URB status is failed: %d\n", urb->status);
/* Do not free skb in case of command ep */ /* Do not free skb in case of command ep */
if (card->rx_cmd_ep != context->ep) if (card->rx_cmd_ep != context->ep)
dev_kfree_skb_any(skb); dev_kfree_skb_any(skb);
@ -190,8 +198,9 @@ static void mwifiex_usb_rx_complete(struct urb *urb)
status = mwifiex_usb_recv(adapter, skb, context->ep); status = mwifiex_usb_recv(adapter, skb, context->ep);
dev_dbg(adapter->dev, "info: recv_length=%d, status=%d\n", mwifiex_dbg(adapter, INFO,
recv_length, status); "info: recv_length=%d, status=%d\n",
recv_length, status);
if (status == -EINPROGRESS) { if (status == -EINPROGRESS) {
mwifiex_queue_main_work(adapter); mwifiex_queue_main_work(adapter);
@ -203,8 +212,8 @@ static void mwifiex_usb_rx_complete(struct urb *urb)
return; return;
} else { } else {
if (status == -1) if (status == -1)
dev_err(adapter->dev, mwifiex_dbg(adapter, ERROR,
"received data processing failed!\n"); "received data processing failed!\n");
/* Do not free skb in case of command ep */ /* Do not free skb in case of command ep */
if (card->rx_cmd_ep != context->ep) if (card->rx_cmd_ep != context->ep)
@ -212,8 +221,8 @@ static void mwifiex_usb_rx_complete(struct urb *urb)
} }
} else if (urb->status) { } else if (urb->status) {
if (!adapter->is_suspended) { if (!adapter->is_suspended) {
dev_warn(adapter->dev, mwifiex_dbg(adapter, FATAL,
"Card is removed: %d\n", urb->status); "Card is removed: %d\n", urb->status);
adapter->surprise_removed = true; adapter->surprise_removed = true;
} }
dev_kfree_skb_any(skb); dev_kfree_skb_any(skb);
@ -249,14 +258,17 @@ static void mwifiex_usb_tx_complete(struct urb *urb)
struct mwifiex_adapter *adapter = context->adapter; struct mwifiex_adapter *adapter = context->adapter;
struct usb_card_rec *card = adapter->card; struct usb_card_rec *card = adapter->card;
dev_dbg(adapter->dev, "%s: status: %d\n", __func__, urb->status); mwifiex_dbg(adapter, INFO,
"%s: status: %d\n", __func__, urb->status);
if (context->ep == card->tx_cmd_ep) { if (context->ep == card->tx_cmd_ep) {
dev_dbg(adapter->dev, "%s: CMD\n", __func__); mwifiex_dbg(adapter, CMD,
"%s: CMD\n", __func__);
atomic_dec(&card->tx_cmd_urb_pending); atomic_dec(&card->tx_cmd_urb_pending);
adapter->cmd_sent = false; adapter->cmd_sent = false;
} else { } else {
dev_dbg(adapter->dev, "%s: DATA\n", __func__); mwifiex_dbg(adapter, DATA,
"%s: DATA\n", __func__);
atomic_dec(&card->tx_data_urb_pending); atomic_dec(&card->tx_data_urb_pending);
mwifiex_write_data_complete(adapter, context->skb, 0, mwifiex_write_data_complete(adapter, context->skb, 0,
urb->status ? -1 : 0); urb->status ? -1 : 0);
@ -275,8 +287,8 @@ static int mwifiex_usb_submit_rx_urb(struct urb_context *ctx, int size)
if (card->rx_cmd_ep != ctx->ep) { if (card->rx_cmd_ep != ctx->ep) {
ctx->skb = dev_alloc_skb(size); ctx->skb = dev_alloc_skb(size);
if (!ctx->skb) { if (!ctx->skb) {
dev_err(adapter->dev, mwifiex_dbg(adapter, ERROR,
"%s: dev_alloc_skb failed\n", __func__); "%s: dev_alloc_skb failed\n", __func__);
return -ENOMEM; return -ENOMEM;
} }
} }
@ -291,7 +303,7 @@ static int mwifiex_usb_submit_rx_urb(struct urb_context *ctx, int size)
atomic_inc(&card->rx_data_urb_pending); atomic_inc(&card->rx_data_urb_pending);
if (usb_submit_urb(ctx->urb, GFP_ATOMIC)) { if (usb_submit_urb(ctx->urb, GFP_ATOMIC)) {
dev_err(adapter->dev, "usb_submit_urb failed\n"); mwifiex_dbg(adapter, ERROR, "usb_submit_urb failed\n");
dev_kfree_skb_any(ctx->skb); dev_kfree_skb_any(ctx->skb);
ctx->skb = NULL; ctx->skb = NULL;
@ -468,7 +480,8 @@ static int mwifiex_usb_suspend(struct usb_interface *intf, pm_message_t message)
adapter = card->adapter; adapter = card->adapter;
if (unlikely(adapter->is_suspended)) if (unlikely(adapter->is_suspended))
dev_warn(adapter->dev, "Device already suspended\n"); mwifiex_dbg(adapter, WARN,
"Device already suspended\n");
mwifiex_enable_hs(adapter); mwifiex_enable_hs(adapter);
@ -519,7 +532,8 @@ static int mwifiex_usb_resume(struct usb_interface *intf)
adapter = card->adapter; adapter = card->adapter;
if (unlikely(!adapter->is_suspended)) { if (unlikely(!adapter->is_suspended)) {
dev_warn(adapter->dev, "Device already resumed\n"); mwifiex_dbg(adapter, WARN,
"Device already resumed\n");
return 0; return 0;
} }
@ -578,7 +592,8 @@ static void mwifiex_usb_disconnect(struct usb_interface *intf)
mwifiex_usb_free(card); mwifiex_usb_free(card);
dev_dbg(adapter->dev, "%s: removing card\n", __func__); mwifiex_dbg(adapter, FATAL,
"%s: removing card\n", __func__);
mwifiex_remove_card(adapter, &add_remove_card_sem); mwifiex_remove_card(adapter, &add_remove_card_sem);
usb_set_intfdata(intf, NULL); usb_set_intfdata(intf, NULL);
@ -608,7 +623,8 @@ static int mwifiex_usb_tx_init(struct mwifiex_adapter *adapter)
card->tx_cmd.urb = usb_alloc_urb(0, GFP_KERNEL); card->tx_cmd.urb = usb_alloc_urb(0, GFP_KERNEL);
if (!card->tx_cmd.urb) { if (!card->tx_cmd.urb) {
dev_err(adapter->dev, "tx_cmd.urb allocation failed\n"); mwifiex_dbg(adapter, ERROR,
"tx_cmd.urb allocation failed\n");
return -ENOMEM; return -ENOMEM;
} }
@ -620,8 +636,8 @@ static int mwifiex_usb_tx_init(struct mwifiex_adapter *adapter)
card->tx_data_list[i].urb = usb_alloc_urb(0, GFP_KERNEL); card->tx_data_list[i].urb = usb_alloc_urb(0, GFP_KERNEL);
if (!card->tx_data_list[i].urb) { if (!card->tx_data_list[i].urb) {
dev_err(adapter->dev, mwifiex_dbg(adapter, ERROR,
"tx_data_list[] urb allocation failed\n"); "tx_data_list[] urb allocation failed\n");
return -ENOMEM; return -ENOMEM;
} }
} }
@ -639,15 +655,13 @@ static int mwifiex_usb_rx_init(struct mwifiex_adapter *adapter)
card->rx_cmd.urb = usb_alloc_urb(0, GFP_KERNEL); card->rx_cmd.urb = usb_alloc_urb(0, GFP_KERNEL);
if (!card->rx_cmd.urb) { if (!card->rx_cmd.urb) {
dev_err(adapter->dev, "rx_cmd.urb allocation failed\n"); mwifiex_dbg(adapter, ERROR, "rx_cmd.urb allocation failed\n");
return -ENOMEM; return -ENOMEM;
} }
card->rx_cmd.skb = dev_alloc_skb(MWIFIEX_RX_CMD_BUF_SIZE); card->rx_cmd.skb = dev_alloc_skb(MWIFIEX_RX_CMD_BUF_SIZE);
if (!card->rx_cmd.skb) { if (!card->rx_cmd.skb)
dev_err(adapter->dev, "rx_cmd.skb allocation failed\n");
return -ENOMEM; return -ENOMEM;
}
if (mwifiex_usb_submit_rx_urb(&card->rx_cmd, MWIFIEX_RX_CMD_BUF_SIZE)) if (mwifiex_usb_submit_rx_urb(&card->rx_cmd, MWIFIEX_RX_CMD_BUF_SIZE))
return -1; return -1;
@ -658,8 +672,8 @@ static int mwifiex_usb_rx_init(struct mwifiex_adapter *adapter)
card->rx_data_list[i].urb = usb_alloc_urb(0, GFP_KERNEL); card->rx_data_list[i].urb = usb_alloc_urb(0, GFP_KERNEL);
if (!card->rx_data_list[i].urb) { if (!card->rx_data_list[i].urb) {
dev_err(adapter->dev, mwifiex_dbg(adapter, ERROR,
"rx_data_list[] urb allocation failed\n"); "rx_data_list[] urb allocation failed\n");
return -1; return -1;
} }
if (mwifiex_usb_submit_rx_urb(&card->rx_data_list[i], if (mwifiex_usb_submit_rx_urb(&card->rx_data_list[i],
@ -683,7 +697,8 @@ static int mwifiex_write_data_sync(struct mwifiex_adapter *adapter, u8 *pbuf,
ret = usb_bulk_msg(card->udev, usb_sndbulkpipe(card->udev, ep), pbuf, ret = usb_bulk_msg(card->udev, usb_sndbulkpipe(card->udev, ep), pbuf,
*len, &actual_length, timeout); *len, &actual_length, timeout);
if (ret) { if (ret) {
dev_err(adapter->dev, "usb_bulk_msg for tx failed: %d\n", ret); mwifiex_dbg(adapter, ERROR,
"usb_bulk_msg for tx failed: %d\n", ret);
return ret; return ret;
} }
@ -702,7 +717,8 @@ static int mwifiex_read_data_sync(struct mwifiex_adapter *adapter, u8 *pbuf,
ret = usb_bulk_msg(card->udev, usb_rcvbulkpipe(card->udev, ep), pbuf, ret = usb_bulk_msg(card->udev, usb_rcvbulkpipe(card->udev, ep), pbuf,
*len, &actual_length, timeout); *len, &actual_length, timeout);
if (ret) { if (ret) {
dev_err(adapter->dev, "usb_bulk_msg for rx failed: %d\n", ret); mwifiex_dbg(adapter, ERROR,
"usb_bulk_msg for rx failed: %d\n", ret);
return ret; return ret;
} }
@ -722,13 +738,13 @@ static int mwifiex_usb_host_to_card(struct mwifiex_adapter *adapter, u8 ep,
struct urb *tx_urb; struct urb *tx_urb;
if (adapter->is_suspended) { if (adapter->is_suspended) {
dev_err(adapter->dev, mwifiex_dbg(adapter, ERROR,
"%s: not allowed while suspended\n", __func__); "%s: not allowed while suspended\n", __func__);
return -1; return -1;
} }
if (adapter->surprise_removed) { if (adapter->surprise_removed) {
dev_err(adapter->dev, "%s: device removed\n", __func__); mwifiex_dbg(adapter, ERROR, "%s: device removed\n", __func__);
return -1; return -1;
} }
@ -737,7 +753,7 @@ static int mwifiex_usb_host_to_card(struct mwifiex_adapter *adapter, u8 ep,
return -EBUSY; return -EBUSY;
} }
dev_dbg(adapter->dev, "%s: ep=%d\n", __func__, ep); mwifiex_dbg(adapter, INFO, "%s: ep=%d\n", __func__, ep);
if (ep == card->tx_cmd_ep) { if (ep == card->tx_cmd_ep) {
context = &card->tx_cmd; context = &card->tx_cmd;
@ -764,7 +780,8 @@ static int mwifiex_usb_host_to_card(struct mwifiex_adapter *adapter, u8 ep,
atomic_inc(&card->tx_data_urb_pending); atomic_inc(&card->tx_data_urb_pending);
if (usb_submit_urb(tx_urb, GFP_ATOMIC)) { if (usb_submit_urb(tx_urb, GFP_ATOMIC)) {
dev_err(adapter->dev, "%s: usb_submit_urb failed\n", __func__); mwifiex_dbg(adapter, ERROR,
"%s: usb_submit_urb failed\n", __func__);
if (ep == card->tx_cmd_ep) { if (ep == card->tx_cmd_ep) {
atomic_dec(&card->tx_cmd_urb_pending); atomic_dec(&card->tx_cmd_urb_pending);
} else { } else {
@ -843,8 +860,8 @@ static int mwifiex_prog_fw_w_helper(struct mwifiex_adapter *adapter,
u8 check_winner = 1; u8 check_winner = 1;
if (!firmware) { if (!firmware) {
dev_err(adapter->dev, mwifiex_dbg(adapter, ERROR,
"No firmware image found! Terminating download\n"); "No firmware image found! Terminating download\n");
ret = -1; ret = -1;
goto fw_exit; goto fw_exit;
} }
@ -889,8 +906,9 @@ static int mwifiex_prog_fw_w_helper(struct mwifiex_adapter *adapter,
MWIFIEX_USB_EP_CMD_EVENT, MWIFIEX_USB_EP_CMD_EVENT,
MWIFIEX_USB_TIMEOUT); MWIFIEX_USB_TIMEOUT);
if (ret) { if (ret) {
dev_err(adapter->dev, mwifiex_dbg(adapter, ERROR,
"write_data_sync: failed: %d\n", ret); "write_data_sync: failed: %d\n",
ret);
continue; continue;
} }
@ -902,8 +920,9 @@ static int mwifiex_prog_fw_w_helper(struct mwifiex_adapter *adapter,
MWIFIEX_USB_EP_CMD_EVENT, MWIFIEX_USB_EP_CMD_EVENT,
MWIFIEX_USB_TIMEOUT); MWIFIEX_USB_TIMEOUT);
if (ret) { if (ret) {
dev_err(adapter->dev, mwifiex_dbg(adapter, ERROR,
"read_data_sync: failed: %d\n", ret); "read_data_sync: failed: %d\n",
ret);
continue; continue;
} }
@ -913,17 +932,17 @@ static int mwifiex_prog_fw_w_helper(struct mwifiex_adapter *adapter,
/* check 1st firmware block resp for highest bit set */ /* check 1st firmware block resp for highest bit set */
if (check_winner) { if (check_winner) {
if (le32_to_cpu(sync_fw.cmd) & 0x80000000) { if (le32_to_cpu(sync_fw.cmd) & 0x80000000) {
dev_warn(adapter->dev, mwifiex_dbg(adapter, WARN,
"USB is not the winner %#x\n", "USB is not the winner %#x\n",
sync_fw.cmd); sync_fw.cmd);
/* returning success */ /* returning success */
ret = 0; ret = 0;
goto cleanup; goto cleanup;
} }
dev_dbg(adapter->dev, mwifiex_dbg(adapter, MSG,
"USB is the winner, start to download FW\n"); "start to download FW...\n");
check_winner = 0; check_winner = 0;
break; break;
@ -931,9 +950,9 @@ static int mwifiex_prog_fw_w_helper(struct mwifiex_adapter *adapter,
/* check the firmware block response for CRC errors */ /* check the firmware block response for CRC errors */
if (sync_fw.cmd) { if (sync_fw.cmd) {
dev_err(adapter->dev, mwifiex_dbg(adapter, ERROR,
"FW received block with CRC %#x\n", "FW received block with CRC %#x\n",
sync_fw.cmd); sync_fw.cmd);
ret = -1; ret = -1;
continue; continue;
} }
@ -945,8 +964,8 @@ static int mwifiex_prog_fw_w_helper(struct mwifiex_adapter *adapter,
} while ((dnld_cmd != FW_HAS_LAST_BLOCK) && retries); } while ((dnld_cmd != FW_HAS_LAST_BLOCK) && retries);
cleanup: cleanup:
dev_notice(adapter->dev, mwifiex_dbg(adapter, MSG,
"info: FW download over, size %d bytes\n", tlen); "info: FW download over, size %d bytes\n", tlen);
kfree(recv_buff); kfree(recv_buff);
kfree(fwdata); kfree(fwdata);

View File

@ -160,7 +160,8 @@ int mwifiex_init_shutdown_fw(struct mwifiex_private *priv,
} else if (func_init_shutdown == MWIFIEX_FUNC_SHUTDOWN) { } else if (func_init_shutdown == MWIFIEX_FUNC_SHUTDOWN) {
cmd = HostCmd_CMD_FUNC_SHUTDOWN; cmd = HostCmd_CMD_FUNC_SHUTDOWN;
} else { } else {
dev_err(priv->adapter->dev, "unsupported parameter\n"); mwifiex_dbg(priv->adapter, ERROR,
"unsupported parameter\n");
return -1; return -1;
} }
@ -339,9 +340,9 @@ mwifiex_parse_mgmt_packet(struct mwifiex_private *priv, u8 *payload, u16 len,
action_code = *(payload + sizeof(struct ieee80211_hdr) + 1); action_code = *(payload + sizeof(struct ieee80211_hdr) + 1);
if (category == WLAN_CATEGORY_PUBLIC && if (category == WLAN_CATEGORY_PUBLIC &&
action_code == WLAN_PUB_ACTION_TDLS_DISCOVER_RES) { action_code == WLAN_PUB_ACTION_TDLS_DISCOVER_RES) {
dev_dbg(priv->adapter->dev, mwifiex_dbg(priv->adapter, INFO,
"TDLS discovery response %pM nf=%d, snr=%d\n", "TDLS discovery response %pM nf=%d, snr=%d\n",
ieee_hdr->addr2, rx_pd->nf, rx_pd->snr); ieee_hdr->addr2, rx_pd->nf, rx_pd->snr);
mwifiex_auto_tdls_update_peer_signal(priv, mwifiex_auto_tdls_update_peer_signal(priv,
ieee_hdr->addr2, ieee_hdr->addr2,
rx_pd->snr, rx_pd->snr,
@ -349,8 +350,8 @@ mwifiex_parse_mgmt_packet(struct mwifiex_private *priv, u8 *payload, u16 len,
} }
break; break;
default: default:
dev_dbg(priv->adapter->dev, mwifiex_dbg(priv->adapter, ERROR,
"unknown mgmt frame subytpe %#x\n", stype); "unknown mgmt frame subytpe %#x\n", stype);
} }
return 0; return 0;
@ -372,8 +373,8 @@ mwifiex_process_mgmt_packet(struct mwifiex_private *priv,
if (!priv->mgmt_frame_mask || if (!priv->mgmt_frame_mask ||
priv->wdev.iftype == NL80211_IFTYPE_UNSPECIFIED) { priv->wdev.iftype == NL80211_IFTYPE_UNSPECIFIED) {
dev_dbg(priv->adapter->dev, mwifiex_dbg(priv->adapter, ERROR,
"do not receive mgmt frames on uninitialized intf"); "do not receive mgmt frames on uninitialized intf");
return -1; return -1;
} }
@ -467,13 +468,14 @@ int mwifiex_recv_packet(struct mwifiex_private *priv, struct sk_buff *skb)
int mwifiex_complete_cmd(struct mwifiex_adapter *adapter, int mwifiex_complete_cmd(struct mwifiex_adapter *adapter,
struct cmd_ctrl_node *cmd_node) struct cmd_ctrl_node *cmd_node)
{ {
dev_dbg(adapter->dev, "cmd completed: status=%d\n", mwifiex_dbg(adapter, CMD,
adapter->cmd_wait_q.status); "cmd completed: status=%d\n",
adapter->cmd_wait_q.status);
*(cmd_node->condition) = true; *(cmd_node->condition) = true;
if (adapter->cmd_wait_q.status == -ETIMEDOUT) if (adapter->cmd_wait_q.status == -ETIMEDOUT)
dev_err(adapter->dev, "cmd timeout\n"); mwifiex_dbg(adapter, ERROR, "cmd timeout\n");
else else
wake_up_interruptible(&adapter->cmd_wait_q.wait); wake_up_interruptible(&adapter->cmd_wait_q.wait);

View File

@ -107,7 +107,7 @@ mwifiex_wmm_allocate_ralist_node(struct mwifiex_adapter *adapter, const u8 *ra)
ra_list->total_pkt_count = 0; ra_list->total_pkt_count = 0;
dev_dbg(adapter->dev, "info: allocated ra_list %p\n", ra_list); mwifiex_dbg(adapter, INFO, "info: allocated ra_list %p\n", ra_list);
return ra_list; return ra_list;
} }
@ -150,7 +150,8 @@ void mwifiex_ralist_add(struct mwifiex_private *priv, const u8 *ra)
for (i = 0; i < MAX_NUM_TID; ++i) { for (i = 0; i < MAX_NUM_TID; ++i) {
ra_list = mwifiex_wmm_allocate_ralist_node(adapter, ra); ra_list = mwifiex_wmm_allocate_ralist_node(adapter, ra);
dev_dbg(adapter->dev, "info: created ra_list %p\n", ra_list); mwifiex_dbg(adapter, INFO,
"info: created ra_list %p\n", ra_list);
if (!ra_list) if (!ra_list)
break; break;
@ -178,8 +179,8 @@ void mwifiex_ralist_add(struct mwifiex_private *priv, const u8 *ra)
spin_unlock_irqrestore(&priv->sta_list_spinlock, flags); spin_unlock_irqrestore(&priv->sta_list_spinlock, flags);
} }
dev_dbg(adapter->dev, "data: ralist %p: is_11n_enabled=%d\n", mwifiex_dbg(adapter, DATA, "data: ralist %p: is_11n_enabled=%d\n",
ra_list, ra_list->is_11n_enabled); ra_list, ra_list->is_11n_enabled);
if (ra_list->is_11n_enabled) { if (ra_list->is_11n_enabled) {
ra_list->ba_pkt_count = 0; ra_list->ba_pkt_count = 0;
@ -241,11 +242,12 @@ mwifiex_wmm_setup_queue_priorities(struct mwifiex_private *priv,
return; return;
} }
dev_dbg(priv->adapter->dev, "info: WMM Parameter IE: version=%d, " mwifiex_dbg(priv->adapter, INFO,
"qos_info Parameter Set Count=%d, Reserved=%#x\n", "info: WMM Parameter IE: version=%d,\t"
wmm_ie->vend_hdr.version, wmm_ie->qos_info_bitmap & "qos_info Parameter Set Count=%d, Reserved=%#x\n",
IEEE80211_WMM_IE_AP_QOSINFO_PARAM_SET_CNT_MASK, wmm_ie->vend_hdr.version, wmm_ie->qos_info_bitmap &
wmm_ie->reserved); IEEE80211_WMM_IE_AP_QOSINFO_PARAM_SET_CNT_MASK,
wmm_ie->reserved);
for (num_ac = 0; num_ac < ARRAY_SIZE(wmm_ie->ac_params); num_ac++) { for (num_ac = 0; num_ac < ARRAY_SIZE(wmm_ie->ac_params); num_ac++) {
u8 ecw = wmm_ie->ac_params[num_ac].ecw_bitmap; u8 ecw = wmm_ie->ac_params[num_ac].ecw_bitmap;
@ -257,10 +259,10 @@ mwifiex_wmm_setup_queue_priorities(struct mwifiex_private *priv,
priv->wmm.queue_priority[ac_idx] = ac_idx; priv->wmm.queue_priority[ac_idx] = ac_idx;
tmp[ac_idx] = avg_back_off; tmp[ac_idx] = avg_back_off;
dev_dbg(priv->adapter->dev, mwifiex_dbg(priv->adapter, INFO,
"info: WMM: CWmax=%d CWmin=%d Avg Back-off=%d\n", "info: WMM: CWmax=%d CWmin=%d Avg Back-off=%d\n",
(1 << ((ecw & MWIFIEX_ECW_MAX) >> 4)) - 1, (1 << ((ecw & MWIFIEX_ECW_MAX) >> 4)) - 1,
cw_min, avg_back_off); cw_min, avg_back_off);
mwifiex_wmm_ac_debug_print(&wmm_ie->ac_params[num_ac]); mwifiex_wmm_ac_debug_print(&wmm_ie->ac_params[num_ac]);
} }
@ -333,8 +335,8 @@ mwifiex_wmm_setup_ac_downgrade(struct mwifiex_private *priv)
{ {
int ac_val; int ac_val;
dev_dbg(priv->adapter->dev, "info: WMM: AC Priorities:" mwifiex_dbg(priv->adapter, INFO, "info: WMM: AC Priorities:\t"
"BK(0), BE(1), VI(2), VO(3)\n"); "BK(0), BE(1), VI(2), VO(3)\n");
if (!priv->wmm_enabled) { if (!priv->wmm_enabled) {
/* WMM is not enabled, default priorities */ /* WMM is not enabled, default priorities */
@ -346,9 +348,10 @@ mwifiex_wmm_setup_ac_downgrade(struct mwifiex_private *priv)
priv->wmm.ac_down_graded_vals[ac_val] priv->wmm.ac_down_graded_vals[ac_val]
= mwifiex_wmm_eval_downgrade_ac(priv, = mwifiex_wmm_eval_downgrade_ac(priv,
(enum mwifiex_wmm_ac_e) ac_val); (enum mwifiex_wmm_ac_e) ac_val);
dev_dbg(priv->adapter->dev, mwifiex_dbg(priv->adapter, INFO,
"info: WMM: AC PRIO %d maps to %d\n", "info: WMM: AC PRIO %d maps to %d\n",
ac_val, priv->wmm.ac_down_graded_vals[ac_val]); ac_val,
priv->wmm.ac_down_graded_vals[ac_val]);
} }
} }
} }
@ -521,8 +524,8 @@ static void mwifiex_wmm_delete_all_ralist(struct mwifiex_private *priv)
int i; int i;
for (i = 0; i < MAX_NUM_TID; ++i) { for (i = 0; i < MAX_NUM_TID; ++i) {
dev_dbg(priv->adapter->dev, mwifiex_dbg(priv->adapter, INFO,
"info: ra_list: freeing buf for tid %d\n", i); "info: ra_list: freeing buf for tid %d\n", i);
list_for_each_entry_safe(ra_list, tmp_node, list_for_each_entry_safe(ra_list, tmp_node,
&priv->wmm.tid_tbl_ptr[i].ra_list, &priv->wmm.tid_tbl_ptr[i].ra_list,
list) { list) {
@ -694,14 +697,15 @@ mwifiex_wmm_add_buf_txqueue(struct mwifiex_private *priv,
if (GET_BSS_ROLE(priv) == MWIFIEX_BSS_ROLE_STA && if (GET_BSS_ROLE(priv) == MWIFIEX_BSS_ROLE_STA &&
ISSUPP_TDLS_ENABLED(adapter->fw_cap_info)) { ISSUPP_TDLS_ENABLED(adapter->fw_cap_info)) {
if (ntohs(eth_hdr->h_proto) == ETH_P_TDLS) if (ntohs(eth_hdr->h_proto) == ETH_P_TDLS)
dev_dbg(adapter->dev, mwifiex_dbg(adapter, DATA,
"TDLS setup packet for %pM. Don't block\n", ra); "TDLS setup packet for %pM.\t"
"Don't block\n", ra);
else if (memcmp(priv->cfg_bssid, ra, ETH_ALEN)) else if (memcmp(priv->cfg_bssid, ra, ETH_ALEN))
tdls_status = mwifiex_get_tdls_link_status(priv, ra); tdls_status = mwifiex_get_tdls_link_status(priv, ra);
} }
if (!priv->media_connected && !mwifiex_is_skb_mgmt_frame(skb)) { if (!priv->media_connected && !mwifiex_is_skb_mgmt_frame(skb)) {
dev_dbg(adapter->dev, "data: drop packet in disconnect\n"); mwifiex_dbg(adapter, DATA, "data: drop packet in disconnect\n");
mwifiex_write_data_complete(adapter, skb, 0, -1); mwifiex_write_data_complete(adapter, skb, 0, -1);
return; return;
} }
@ -782,6 +786,7 @@ int mwifiex_ret_wmm_get_status(struct mwifiex_private *priv,
{ {
u8 *curr = (u8 *) &resp->params.get_wmm_status; u8 *curr = (u8 *) &resp->params.get_wmm_status;
uint16_t resp_len = le16_to_cpu(resp->size), tlv_len; uint16_t resp_len = le16_to_cpu(resp->size), tlv_len;
int mask = IEEE80211_WMM_IE_AP_QOSINFO_PARAM_SET_CNT_MASK;
bool valid = true; bool valid = true;
struct mwifiex_ie_types_data *tlv_hdr; struct mwifiex_ie_types_data *tlv_hdr;
@ -789,8 +794,9 @@ int mwifiex_ret_wmm_get_status(struct mwifiex_private *priv,
struct ieee_types_wmm_parameter *wmm_param_ie = NULL; struct ieee_types_wmm_parameter *wmm_param_ie = NULL;
struct mwifiex_wmm_ac_status *ac_status; struct mwifiex_wmm_ac_status *ac_status;
dev_dbg(priv->adapter->dev, "info: WMM: WMM_GET_STATUS cmdresp received: %d\n", mwifiex_dbg(priv->adapter, INFO,
resp_len); "info: WMM: WMM_GET_STATUS cmdresp received: %d\n",
resp_len);
while ((resp_len >= sizeof(tlv_hdr->header)) && valid) { while ((resp_len >= sizeof(tlv_hdr->header)) && valid) {
tlv_hdr = (struct mwifiex_ie_types_data *) curr; tlv_hdr = (struct mwifiex_ie_types_data *) curr;
@ -804,12 +810,12 @@ int mwifiex_ret_wmm_get_status(struct mwifiex_private *priv,
tlv_wmm_qstatus = tlv_wmm_qstatus =
(struct mwifiex_ie_types_wmm_queue_status *) (struct mwifiex_ie_types_wmm_queue_status *)
tlv_hdr; tlv_hdr;
dev_dbg(priv->adapter->dev, mwifiex_dbg(priv->adapter, CMD,
"info: CMD_RESP: WMM_GET_STATUS:" "info: CMD_RESP: WMM_GET_STATUS:\t"
" QSTATUS TLV: %d, %d, %d\n", "QSTATUS TLV: %d, %d, %d\n",
tlv_wmm_qstatus->queue_index, tlv_wmm_qstatus->queue_index,
tlv_wmm_qstatus->flow_required, tlv_wmm_qstatus->flow_required,
tlv_wmm_qstatus->disabled); tlv_wmm_qstatus->disabled);
ac_status = &priv->wmm.ac_status[tlv_wmm_qstatus-> ac_status = &priv->wmm.ac_status[tlv_wmm_qstatus->
queue_index]; queue_index];
@ -832,11 +838,10 @@ int mwifiex_ret_wmm_get_status(struct mwifiex_private *priv,
wmm_param_ie->vend_hdr.element_id = wmm_param_ie->vend_hdr.element_id =
WLAN_EID_VENDOR_SPECIFIC; WLAN_EID_VENDOR_SPECIFIC;
dev_dbg(priv->adapter->dev, mwifiex_dbg(priv->adapter, CMD,
"info: CMD_RESP: WMM_GET_STATUS:" "info: CMD_RESP: WMM_GET_STATUS:\t"
" WMM Parameter Set Count: %d\n", "WMM Parameter Set Count: %d\n",
wmm_param_ie->qos_info_bitmap & wmm_param_ie->qos_info_bitmap & mask);
IEEE80211_WMM_IE_AP_QOSINFO_PARAM_SET_CNT_MASK);
memcpy((u8 *) &priv->curr_bss_params.bss_descriptor. memcpy((u8 *) &priv->curr_bss_params.bss_descriptor.
wmm_ie, wmm_param_ie, wmm_ie, wmm_param_ie,
@ -884,9 +889,9 @@ mwifiex_wmm_process_association_req(struct mwifiex_private *priv,
if (!wmm_ie) if (!wmm_ie)
return 0; return 0;
dev_dbg(priv->adapter->dev, mwifiex_dbg(priv->adapter, INFO,
"info: WMM: process assoc req: bss->wmm_ie=%#x\n", "info: WMM: process assoc req: bss->wmm_ie=%#x\n",
wmm_ie->vend_hdr.element_id); wmm_ie->vend_hdr.element_id);
if ((priv->wmm_required || if ((priv->wmm_required ||
(ht_cap && (priv->adapter->config_bands & BAND_GN || (ht_cap && (priv->adapter->config_bands & BAND_GN ||
@ -936,8 +941,8 @@ mwifiex_wmm_compute_drv_pkt_delay(struct mwifiex_private *priv,
*/ */
ret_val = (u8) (min(queue_delay, priv->wmm.drv_pkt_delay_max) >> 1); ret_val = (u8) (min(queue_delay, priv->wmm.drv_pkt_delay_max) >> 1);
dev_dbg(priv->adapter->dev, "data: WMM: Pkt Delay: %d ms," mwifiex_dbg(priv->adapter, DATA, "data: WMM: Pkt Delay: %d ms,\t"
" %d ms sent to FW\n", queue_delay, ret_val); "%d ms sent to FW\n", queue_delay, ret_val);
return ret_val; return ret_val;
} }
@ -1091,14 +1096,15 @@ mwifiex_send_single_packet(struct mwifiex_private *priv,
if (skb_queue_empty(&ptr->skb_head)) { if (skb_queue_empty(&ptr->skb_head)) {
spin_unlock_irqrestore(&priv->wmm.ra_list_spinlock, spin_unlock_irqrestore(&priv->wmm.ra_list_spinlock,
ra_list_flags); ra_list_flags);
dev_dbg(adapter->dev, "data: nothing to send\n"); mwifiex_dbg(adapter, DATA, "data: nothing to send\n");
return; return;
} }
skb = skb_dequeue(&ptr->skb_head); skb = skb_dequeue(&ptr->skb_head);
tx_info = MWIFIEX_SKB_TXCB(skb); tx_info = MWIFIEX_SKB_TXCB(skb);
dev_dbg(adapter->dev, "data: dequeuing the packet %p %p\n", ptr, skb); mwifiex_dbg(adapter, DATA,
"data: dequeuing the packet %p %p\n", ptr, skb);
ptr->total_pkt_count--; ptr->total_pkt_count--;
@ -1214,7 +1220,7 @@ mwifiex_send_processed_packet(struct mwifiex_private *priv,
switch (ret) { switch (ret) {
case -EBUSY: case -EBUSY:
dev_dbg(adapter->dev, "data: -EBUSY is returned\n"); mwifiex_dbg(adapter, ERROR, "data: -EBUSY is returned\n");
spin_lock_irqsave(&priv->wmm.ra_list_spinlock, ra_list_flags); spin_lock_irqsave(&priv->wmm.ra_list_spinlock, ra_list_flags);
if (!mwifiex_is_ralist_valid(priv, ptr, ptr_index)) { if (!mwifiex_is_ralist_valid(priv, ptr, ptr_index)) {
@ -1233,7 +1239,7 @@ mwifiex_send_processed_packet(struct mwifiex_private *priv,
case -1: case -1:
if (adapter->iface_type != MWIFIEX_PCIE) if (adapter->iface_type != MWIFIEX_PCIE)
adapter->data_sent = false; adapter->data_sent = false;
dev_err(adapter->dev, "host_to_card failed: %#x\n", ret); mwifiex_dbg(adapter, ERROR, "host_to_card failed: %#x\n", ret);
adapter->dbg.num_tx_host_to_card_failure++; adapter->dbg.num_tx_host_to_card_failure++;
mwifiex_write_data_complete(adapter, skb, 0, ret); mwifiex_write_data_complete(adapter, skb, 0, ret);
break; break;
@ -1272,7 +1278,7 @@ mwifiex_dequeue_tx_packet(struct mwifiex_adapter *adapter)
tid = mwifiex_get_tid(ptr); tid = mwifiex_get_tid(ptr);
dev_dbg(adapter->dev, "data: tid=%d\n", tid); mwifiex_dbg(adapter, DATA, "data: tid=%d\n", tid);
spin_lock_irqsave(&priv->wmm.ra_list_spinlock, flags); spin_lock_irqsave(&priv->wmm.ra_list_spinlock, flags);
if (!mwifiex_is_ralist_valid(priv, ptr, ptr_index)) { if (!mwifiex_is_ralist_valid(priv, ptr, ptr_index)) {