diff options
Diffstat (limited to 'drivers/staging/rtl8723au/core/rtw_mlme_ext.c')
-rw-r--r-- | drivers/staging/rtl8723au/core/rtw_mlme_ext.c | 121 |
1 files changed, 56 insertions, 65 deletions
diff --git a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c index 0e0f73c..196beaf 100644 --- a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c @@ -657,8 +657,8 @@ void mgt_dispatcher23a(struct rtw_adapter *padapter, if (index > 13) { RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, - ("Currently we do not support reserved sub-fr-type =" - "%d\n", index)); + "Currently we do not support reserved sub-fr-type =%d\n", + index); return; } ptable += index; @@ -968,8 +968,7 @@ OnAuth23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame) pstat = rtw_get_stainfo23a(pstapriv, sa); if (!pstat) { /* allocate a new one */ - DBG_8723A("going to alloc stainfo for sa ="MAC_FMT"\n", - MAC_ARG(sa)); + DBG_8723A("going to alloc stainfo for sa =%pM\n", sa); pstat = rtw_alloc_stainfo23a(pstapriv, sa, GFP_ATOMIC); if (!pstat) { DBG_8723A(" Exceed the upper limit of supported " @@ -1396,8 +1395,8 @@ OnAssocReq23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame) /* now parse all ieee802_11 ie to point to elems */ if (rtw_validate_frame_ies(pos, left)) { - DBG_8723A("STA " MAC_FMT " sent invalid association request\n", - MAC_ARG(pstat->hwaddr)); + DBG_8723A("STA %pM sent invalid association request\n", + pstat->hwaddr); status = WLAN_STATUS_UNSPECIFIED_FAILURE; goto OnAssocReq23aFail; } @@ -1407,8 +1406,8 @@ OnAssocReq23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame) p = cfg80211_find_ie(WLAN_EID_SSID, pos, left); if (!p || p[1] == 0) { /* broadcast ssid, however it is not allowed in assocreq */ - DBG_8723A("STA " MAC_FMT " sent invalid association request " - "lacking an SSID\n", MAC_ARG(pstat->hwaddr)); + DBG_8723A("STA %pM sent invalid association request lacking an SSID\n", + pstat->hwaddr); status = WLAN_STATUS_UNSPECIFIED_FAILURE; goto OnAssocReq23aFail; } else { @@ -1537,9 +1536,8 @@ OnAssocReq23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame) int copy_len; if (psecuritypriv->wpa_psk == 0) { - DBG_8723A("STA " MAC_FMT ": WPA/RSN IE in association " - "request, but AP don't support WPA/RSN\n", - MAC_ARG(pstat->hwaddr)); + DBG_8723A("STA %pM: WPA/RSN IE in association request, but AP don't support WPA/RSN\n", + pstat->hwaddr); status = WLAN_STATUS_INVALID_IE; @@ -1614,8 +1612,8 @@ OnAssocReq23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame) else pstat->uapsd_be = 0; + break; } - break; } else { break; } @@ -1645,8 +1643,8 @@ OnAssocReq23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame) if (pstat->flags & WLAN_STA_HT && (pstat->wpa2_pairwise_cipher & WPA_CIPHER_TKIP || pstat->wpa_pairwise_cipher & WPA_CIPHER_TKIP)) { - DBG_8723A("HT: " MAC_FMT " tried to use TKIP with HT " - "association\n", MAC_ARG(pstat->hwaddr)); + DBG_8723A("HT: %pM tried to use TKIP with HT association\n", + pstat->hwaddr); /* status = WLAN_STATUS_CIPHER_REJECTED_PER_POLICY; */ /* goto OnAssocReq23aFail; */ @@ -2687,7 +2685,7 @@ static int _issue_probereq(struct rtw_adapter *padapter, u8 bc_addr[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; RT_TRACE(_module_rtl871x_mlme_c_, _drv_notice_, - ("+%s\n", __func__)); + "+%s\n", __func__); pmgntframe = alloc_mgtxmitframe23a(pxmitpriv); if (!pmgntframe) @@ -2758,7 +2756,7 @@ static int _issue_probereq(struct rtw_adapter *padapter, pattrib->last_txcmdsz = pattrib->pktlen; RT_TRACE(_module_rtl871x_mlme_c_, _drv_notice_, - ("issuing probe_req, tx_len =%d\n", pattrib->last_txcmdsz)); + "issuing probe_req, tx_len =%d\n", pattrib->last_txcmdsz); if (wait_ack) { ret = dump_mgntframe23a_and_wait_ack23a(padapter, pmgntframe); @@ -2806,17 +2804,16 @@ static int issue_probereq_ex(struct rtw_adapter *padapter, if (try_cnt && wait_ms) { if (da) - DBG_8723A("%s(%s): to "MAC_FMT", ch:%u%s, %d/%d " - "in %u ms\n", __func__, - padapter->pnetdev->name, - MAC_ARG(da), rtw_get_oper_ch23a(padapter), - ret == _SUCCESS?", acked":"", i, try_cnt, + DBG_8723A("%s(%s): to %pM, ch:%u%s, %d/%d in %u ms\n", + __func__, padapter->pnetdev->name, + da, rtw_get_oper_ch23a(padapter), + ret == _SUCCESS ? ", acked" : "", i, try_cnt, jiffies_to_msecs(jiffies - start)); else DBG_8723A("%s(%s):, ch:%u%s, %d/%d in %u ms\n", __func__, padapter->pnetdev->name, rtw_get_oper_ch23a(padapter), - ret == _SUCCESS?", acked":"", i, try_cnt, + ret == _SUCCESS ? ", acked" : "", i, try_cnt, jiffies_to_msecs(jiffies - start)); } exit: @@ -3460,17 +3457,16 @@ int issue_nulldata23a(struct rtw_adapter *padapter, unsigned char *da, if (try_cnt && wait_ms) { if (da) - DBG_8723A("%s(%s): to "MAC_FMT", ch:%u%s, %d/%d " - "in %u ms\n", __func__, - padapter->pnetdev->name, - MAC_ARG(da), rtw_get_oper_ch23a(padapter), - ret == _SUCCESS?", acked":"", i, try_cnt, + DBG_8723A("%s(%s): to %pM, ch:%u%s, %d/%d in %u ms\n", + __func__, padapter->pnetdev->name, + da, rtw_get_oper_ch23a(padapter), + ret == _SUCCESS ? ", acked" : "", i, try_cnt, jiffies_to_msecs(jiffies - start)); else DBG_8723A("%s(%s):, ch:%u%s, %d/%d in %u ms\n", __func__, padapter->pnetdev->name, rtw_get_oper_ch23a(padapter), - ret == _SUCCESS?", acked":"", i, try_cnt, + ret == _SUCCESS ? ", acked" : "", i, try_cnt, jiffies_to_msecs(jiffies - start)); } exit: @@ -3587,17 +3583,16 @@ int issue_qos_nulldata23a(struct rtw_adapter *padapter, unsigned char *da, if (try_cnt && wait_ms) { if (da) - DBG_8723A("%s(%s): to "MAC_FMT", ch:%u%s, %d/%d " - "in %u ms\n", __func__, - padapter->pnetdev->name, - MAC_ARG(da), rtw_get_oper_ch23a(padapter), - ret == _SUCCESS?", acked":"", i, try_cnt, + DBG_8723A("%s(%s): to %pM, ch:%u%s, %d/%d in %u ms\n", + __func__, padapter->pnetdev->name, + da, rtw_get_oper_ch23a(padapter), + ret == _SUCCESS ? ", acked" : "", i, try_cnt, jiffies_to_msecs(jiffies - start)); else DBG_8723A("%s(%s):, ch:%u%s, %d/%d in %u ms\n", __func__, padapter->pnetdev->name, rtw_get_oper_ch23a(padapter), - ret == _SUCCESS?", acked":"", i, try_cnt, + ret == _SUCCESS ? ", acked" : "", i, try_cnt, jiffies_to_msecs(jiffies - start)); } exit: @@ -3615,7 +3610,7 @@ static int _issue_deauth(struct rtw_adapter *padapter, unsigned char *da, struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info; int ret = _FAIL; - /* DBG_8723A("%s to "MAC_FMT"\n", __func__, MAC_ARG(da)); */ + /* DBG_8723A("%s to %pM\n", __func__, da); */ pmgntframe = alloc_mgtxmitframe23a(pxmitpriv); if (!pmgntframe) @@ -3660,7 +3655,7 @@ exit: int issue_deauth23a(struct rtw_adapter *padapter, unsigned char *da, unsigned short reason) { - DBG_8723A("%s to "MAC_FMT"\n", __func__, MAC_ARG(da)); + DBG_8723A("%s to %pM\n", __func__, da); return _issue_deauth(padapter, da, reason, false); } @@ -3692,17 +3687,16 @@ static int issue_deauth_ex(struct rtw_adapter *padapter, u8 *da, if (try_cnt && wait_ms) { if (da) - DBG_8723A("%s(%s): to "MAC_FMT", ch:%u%s, %d/%d " - "in %u ms\n", __func__, - padapter->pnetdev->name, - MAC_ARG(da), rtw_get_oper_ch23a(padapter), - ret == _SUCCESS?", acked":"", i, try_cnt, + DBG_8723A("%s(%s): to %pM, ch:%u%s, %d/%d in %u ms\n", + __func__, padapter->pnetdev->name, + da, rtw_get_oper_ch23a(padapter), + ret == _SUCCESS ? ", acked" : "", i, try_cnt, jiffies_to_msecs(jiffies - start)); else DBG_8723A("%s(%s):, ch:%u%s, %d/%d in %u ms\n", __func__, padapter->pnetdev->name, rtw_get_oper_ch23a(padapter), - ret == _SUCCESS?", acked":"", i, try_cnt, + ret == _SUCCESS ? ", acked" : "", i, try_cnt, jiffies_to_msecs(jiffies - start)); } exit: @@ -3719,8 +3713,8 @@ void issue_action_spct_ch_switch23a(struct rtw_adapter *padapter, struct xmit_priv *pxmitpriv = &padapter->xmitpriv; struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; - DBG_8723A("%s(%s): ra ="MAC_FMT", ch:%u, offset:%u\n", __func__, - padapter->pnetdev->name, MAC_ARG(ra), new_ch, ch_offset); + DBG_8723A("%s(%s): ra=%pM, ch:%u, offset:%u\n", + __func__, padapter->pnetdev->name, ra, new_ch, ch_offset); pmgntframe = alloc_mgtxmitframe23a(pxmitpriv); if (!pmgntframe) @@ -3767,7 +3761,6 @@ void issue_action_BA23a(struct rtw_adapter *padapter, { u16 start_seq; u16 BA_para_set; - u16 BA_timeout_value; u16 BA_starting_seqctrl; u16 BA_para; int max_rx_ampdu_factor; @@ -3842,16 +3835,14 @@ void issue_action_BA23a(struct rtw_adapter *padapter, IEEE80211_ADDBA_PARAM_BUF_SIZE_MASK; } else { /* immediate ack & 64 buffer size */ - BA_para_set = (0x1002 | ((status & 0xf) << 2)); + BA_para_set = 0x1002 | ((status & 0xf) << 2); } put_unaligned_le16(BA_para_set, &mgmt->u.action.u.addba_req.capab); - BA_timeout_value = 5000;/* 5ms */ - BA_timeout_value = cpu_to_le16(BA_timeout_value); - put_unaligned_le16(BA_timeout_value, - &mgmt->u.action.u.addba_req.timeout); + /* 5ms */ + put_unaligned_le16(5000, &mgmt->u.action.u.addba_req.timeout); psta = rtw_get_stainfo23a(pstapriv, raddr); if (psta) { @@ -4347,7 +4338,8 @@ static void start_create_ibss(struct rtw_adapter *padapter) /* issue beacon */ if (send_beacon23a(padapter) == _FAIL) { - RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("issuing beacon frame fail....\n")); + RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, + "issuing beacon frame fail....\n"); report_join_res23a(padapter, -1); pmlmeinfo->state = MSR_NOLINK; @@ -4531,7 +4523,7 @@ static void process_80211d(struct rtw_adapter *padapter, p += 3; RT_TRACE(_module_rtl871x_mlme_c_, _drv_notice_, - ("%s: 802.11d country =%s\n", __func__, country)); + "%s: 802.11d country =%s\n", __func__, country); i = 0; while ((ie - p) >= 3) { @@ -4708,9 +4700,8 @@ static void process_80211d(struct rtw_adapter *padapter, chplan_new[i].ScanType = SCAN_ACTIVE; RT_TRACE(_module_rtl871x_mlme_c_, _drv_notice_, - ("%s: change channel %d scan type " - "from passive to active\n", - __func__, channel)); + "%s: change channel %d scan type from passive to active\n", + __func__, channel); } break; } @@ -4745,7 +4736,7 @@ void report_survey_event23a(struct rtw_adapter *padapter, if (!pcmd_obj) return; - cmdsz = (sizeof(struct survey_event) + sizeof(struct C2HEvent_Header)); + cmdsz = sizeof(struct survey_event) + sizeof(struct C2HEvent_Header); pevtcmd = kzalloc(cmdsz, GFP_ATOMIC); if (!pevtcmd) { kfree(pcmd_obj); @@ -4796,7 +4787,7 @@ void report_surveydone_event23a(struct rtw_adapter *padapter) if (!pcmd_obj) return; - cmdsz = (sizeof(struct surveydone_event) + sizeof(struct C2HEvent_Header)); + cmdsz = sizeof(struct surveydone_event) + sizeof(struct C2HEvent_Header); pevtcmd = kzalloc(cmdsz, GFP_ATOMIC); if (!pevtcmd) { kfree(pcmd_obj); @@ -4840,7 +4831,7 @@ void report_join_res23a(struct rtw_adapter *padapter, int res) if (!pcmd_obj) return; - cmdsz = (sizeof(struct joinbss_event) + sizeof(struct C2HEvent_Header)); + cmdsz = sizeof(struct joinbss_event) + sizeof(struct C2HEvent_Header); pevtcmd = kzalloc(cmdsz, GFP_ATOMIC); if (!pevtcmd) { kfree(pcmd_obj); @@ -4890,7 +4881,7 @@ void report_del_sta_event23a(struct rtw_adapter *padapter, if (!pcmd_obj) return; - cmdsz = (sizeof(struct stadel_event) + sizeof(struct C2HEvent_Header)); + cmdsz = sizeof(struct stadel_event) + sizeof(struct C2HEvent_Header); pevtcmd = kzalloc(cmdsz, GFP_ATOMIC); if (!pevtcmd) { kfree(pcmd_obj); @@ -4918,7 +4909,7 @@ void report_del_sta_event23a(struct rtw_adapter *padapter, if (psta) mac_id = (int)psta->mac_id; else - mac_id = (-1); + mac_id = -1; pdel_sta_evt->mac_id = mac_id; @@ -4944,7 +4935,7 @@ void report_add_sta_event23a(struct rtw_adapter *padapter, if (!pcmd_obj) return; - cmdsz = (sizeof(struct stassoc_event) + sizeof(struct C2HEvent_Header)); + cmdsz = sizeof(struct stassoc_event) + sizeof(struct C2HEvent_Header); pevtcmd = kzalloc(cmdsz, GFP_ATOMIC); if (!pevtcmd) { kfree(pcmd_obj); @@ -5951,7 +5942,7 @@ int set_stakey_hdl23a(struct rtw_adapter *padapter, const u8 *pbuf) /* 0~3 for default key, cmd_id = macid + 3, macid = aid+1; */ - cam_id = (psta->mac_id + 3); + cam_id = psta->mac_id + 3; DBG_8723A("Write CAM, mac_addr =%x:%x:%x:%x:%x:%x, " "cam_entry =%d\n", pparm->addr[0], @@ -6066,7 +6057,7 @@ int mlme_evt_hdl23a(struct rtw_adapter *padapter, const u8 *pbuf) /* checking if event code is valid */ if (evt_code >= MAX_C2HEVT) { RT_TRACE(_module_rtl871x_cmd_c_, _drv_err_, - ("\nEvent Code(%d) mismatch!\n", evt_code)); + "Event Code(%d) mismatch!\n", evt_code); goto _abort_event_; } @@ -6074,8 +6065,8 @@ int mlme_evt_hdl23a(struct rtw_adapter *padapter, const u8 *pbuf) if (wlanevents[evt_code].parmsize != 0 && wlanevents[evt_code].parmsize != evt_sz) { RT_TRACE(_module_rtl871x_cmd_c_, _drv_err_, - ("\nEvent(%d) Parm Size mismatch (%d vs %d)!\n", - evt_code, wlanevents[evt_code].parmsize, evt_sz)); + "Event(%d) Parm Size mismatch (%d vs %d)!\n", + evt_code, wlanevents[evt_code].parmsize, evt_sz); goto _abort_event_; } |