2022-01-25 08:41:34

by Phillip Potter

[permalink] [raw]
Subject: [PATCH 00/10] Cleanup and removal of DBG_88E macro

This series does a few things in order to effect the removal of the
DBG_88E macro:

(1) It removes previously converted calls for consistency.
(2) It removes all current DBG_88E calls.
(3) It removes all aliased DBG_88E calls.
(4) It removes the GlobalDebugLevel flag and the file that defines it.

By its very nature, it is a large patchset, so I've tried to group as
appropriate. I went by file as I did the work, which led to over 40
patches originally, so I've listed the largest C files as their own
patches and then grouped everything else by subdir which gives closer
sizes for the other patches.

Phillip Potter (10):
staging: r8188eu: remove previously added dev_dbg and netdev_dbg calls
staging: r8188eu: remove smaller sets of DBG_88E calls from core dir
staging: r8188eu: remove DBG_88E calls from core/rtw_mlme_ext.c
staging: r8188eu: remove all DBG_88E calls from hal dir
staging: r8188eu: remove smaller sets of DBG_88E calls from os_dep dir
staging: r8188eu: remove DBG_88E calls from os_dep/ioctl_linux.c
staging: r8188eu: remove DBG_88E call from include/usb_ops.h
staging: r8188eu: remove all remaining aliased DBG_88E calls
staging: r8188eu: remove DBG_88E macro definition
staging: r8188eu: remove GlobalDebugLevel flag

drivers/staging/r8188eu/Makefile | 1 -
drivers/staging/r8188eu/core/rtw_ap.c | 108 +----
drivers/staging/r8188eu/core/rtw_br_ext.c | 59 +--
drivers/staging/r8188eu/core/rtw_cmd.c | 12 +-
drivers/staging/r8188eu/core/rtw_ieee80211.c | 37 +-
drivers/staging/r8188eu/core/rtw_ioctl_set.c | 15 +-
drivers/staging/r8188eu/core/rtw_iol.c | 10 +-
drivers/staging/r8188eu/core/rtw_mlme.c | 54 +--
drivers/staging/r8188eu/core/rtw_mlme_ext.c | 343 +--------------
drivers/staging/r8188eu/core/rtw_p2p.c | 61 +--
drivers/staging/r8188eu/core/rtw_pwrctrl.c | 49 +--
drivers/staging/r8188eu/core/rtw_recv.c | 73 +--
drivers/staging/r8188eu/core/rtw_security.c | 19 +-
drivers/staging/r8188eu/core/rtw_sta_mgt.c | 6 -
drivers/staging/r8188eu/core/rtw_wlan_util.c | 102 +----
drivers/staging/r8188eu/core/rtw_xmit.c | 62 +--
drivers/staging/r8188eu/hal/HalPwrSeqCmd.c | 4 +-
drivers/staging/r8188eu/hal/hal_intf.c | 3 -
drivers/staging/r8188eu/hal/odm_debug.c | 6 -
drivers/staging/r8188eu/hal/rtl8188e_cmd.c | 43 +-
.../staging/r8188eu/hal/rtl8188e_hal_init.c | 95 +---
drivers/staging/r8188eu/hal/rtl8188e_phycfg.c | 3 -
drivers/staging/r8188eu/hal/rtl8188eu_recv.c | 5 -
drivers/staging/r8188eu/hal/rtl8188eu_xmit.c | 8 +-
drivers/staging/r8188eu/hal/usb_halinit.c | 62 +--
drivers/staging/r8188eu/hal/usb_ops_linux.c | 31 +-
drivers/staging/r8188eu/include/rtw_br_ext.h | 5 -
drivers/staging/r8188eu/include/rtw_debug.h | 8 -
drivers/staging/r8188eu/include/usb_ops.h | 5 +-
drivers/staging/r8188eu/os_dep/ioctl_linux.c | 416 +-----------------
drivers/staging/r8188eu/os_dep/mlme_linux.c | 4 -
drivers/staging/r8188eu/os_dep/os_intfs.c | 34 +-
.../staging/r8188eu/os_dep/osdep_service.c | 2 -
drivers/staging/r8188eu/os_dep/usb_intf.c | 84 +---
.../staging/r8188eu/os_dep/usb_ops_linux.c | 18 +-
drivers/staging/r8188eu/os_dep/xmit_linux.c | 6 +-
36 files changed, 166 insertions(+), 1687 deletions(-)
delete mode 100644 drivers/staging/r8188eu/hal/odm_debug.c

--
2.34.1


2022-01-25 08:42:00

by Phillip Potter

[permalink] [raw]
Subject: [PATCH 03/10] staging: r8188eu: remove DBG_88E calls from core/rtw_mlme_ext.c

Remove all DBG_88E calls from core/rtw_mlme_ext.c, including the commented
one, as they do not conform to kernel coding standards and are
superfluous. Also restructure where appropriate to remove no longer needed
code left behind by removal of these calls. This will allow the eventual
removal of the DBG_88E macro itself.

Signed-off-by: Phillip Potter <[email protected]>
---
drivers/staging/r8188eu/core/rtw_mlme_ext.c | 315 ++------------------
1 file changed, 23 insertions(+), 292 deletions(-)

diff --git a/drivers/staging/r8188eu/core/rtw_mlme_ext.c b/drivers/staging/r8188eu/core/rtw_mlme_ext.c
index f99c1bcff1e9..0414b57ff8df 100644
--- a/drivers/staging/r8188eu/core/rtw_mlme_ext.c
+++ b/drivers/staging/r8188eu/core/rtw_mlme_ext.c
@@ -314,10 +314,8 @@ static u8 init_channel_set(struct adapter *padapter, u8 ChannelPlan, struct rt_c

memset(channel_set, 0, sizeof(struct rt_channel_info) * MAX_CHANNEL_NUM);

- if (ChannelPlan >= RT_CHANNEL_DOMAIN_MAX && ChannelPlan != RT_CHANNEL_DOMAIN_REALTEK_DEFINE) {
- DBG_88E("ChannelPlan ID %x error !!!!!\n", ChannelPlan);
+ if (ChannelPlan >= RT_CHANNEL_DOMAIN_MAX && ChannelPlan != RT_CHANNEL_DOMAIN_REALTEK_DEFINE)
return chanset_size;
- }

if (padapter->registrypriv.wireless_mode & WIRELESS_11G) {
b2_4GBand = true;
@@ -434,11 +432,9 @@ void mgt_dispatcher(struct adapter *padapter, struct recv_frame *precv_frame)

if (psta) {
if (GetRetry(pframe)) {
- if (precv_frame->attrib.seq_num == psta->RxMgmtFrameSeqNum) {
+ if (precv_frame->attrib.seq_num == psta->RxMgmtFrameSeqNum)
/* drop the duplicate management frame */
- DBG_88E("Drop duplicate management frame with seq_num=%d.\n", precv_frame->attrib.seq_num);
return;
- }
}
psta->RxMgmtFrameSeqNum = precv_frame->attrib.seq_num;
}
@@ -586,7 +582,6 @@ unsigned int OnProbeRsp(struct adapter *padapter, struct recv_frame *precv_frame
return _SUCCESS;
} else if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_GONEGO_ING)) {
if (pwdinfo->nego_req_info.benable) {
- DBG_88E("[%s] P2P State is GONEGO ING!\n", __func__);
if (!memcmp(pwdinfo->nego_req_info.peerDevAddr, GetAddr2Ptr(pframe), ETH_ALEN)) {
pwdinfo->nego_req_info.benable = false;
issue_p2p_GO_request(padapter, pwdinfo->nego_req_info.peerDevAddr);
@@ -594,7 +589,6 @@ unsigned int OnProbeRsp(struct adapter *padapter, struct recv_frame *precv_frame
}
} else if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_TX_INVITE_REQ)) {
if (pwdinfo->invitereq_info.benable) {
- DBG_88E("[%s] P2P_STATE_TX_INVITE_REQ!\n", __func__);
if (!memcmp(pwdinfo->invitereq_info.peer_macaddr, GetAddr2Ptr(pframe), ETH_ALEN)) {
pwdinfo->invitereq_info.benable = false;
issue_p2p_invitation_request(padapter, pwdinfo->invitereq_info.peer_macaddr);
@@ -718,25 +712,18 @@ unsigned int OnAuth(struct adapter *padapter, struct recv_frame *precv_frame)
if ((pmlmeinfo->state & 0x03) != WIFI_FW_AP_STATE)
return _FAIL;

- DBG_88E("+OnAuth\n");
-
sa = GetAddr2Ptr(pframe);

auth_mode = psecuritypriv->dot11AuthAlgrthm;
seq = le16_to_cpu(*(__le16 *)((size_t)pframe + WLAN_HDR_A3_LEN + 2));
algorithm = le16_to_cpu(*(__le16 *)((size_t)pframe + WLAN_HDR_A3_LEN));

- DBG_88E("auth alg=%x, seq=%X\n", algorithm, seq);
-
if (auth_mode == 2 && psecuritypriv->dot11PrivacyAlgrthm != _WEP40_ &&
psecuritypriv->dot11PrivacyAlgrthm != _WEP104_)
auth_mode = 0;

if ((algorithm > 0 && auth_mode == 0) || /* rx a shared-key auth but shared not enabled */
(algorithm == 0 && auth_mode == 1)) { /* rx a open-system auth but shared-key is enabled */
- DBG_88E("auth rejected due to bad alg [alg=%d, auth_mib=%d] %02X%02X%02X%02X%02X%02X\n",
- algorithm, auth_mode, sa[0], sa[1], sa[2], sa[3], sa[4], sa[5]);
-
status = _STATS_NO_SUPP_ALG_;

goto auth_fail;
@@ -750,10 +737,8 @@ unsigned int OnAuth(struct adapter *padapter, struct recv_frame *precv_frame)
pstat = rtw_get_stainfo(pstapriv, sa);
if (!pstat) {
/* allocate a new one */
- DBG_88E("going to alloc stainfo for sa=%pM\n", sa);
pstat = rtw_alloc_stainfo(pstapriv, sa);
if (!pstat) {
- DBG_88E(" Exceed the upper limit of supported clients...\n");
status = _STATS_UNABLE_HANDLE_STA_;
goto auth_fail;
}
@@ -784,8 +769,6 @@ unsigned int OnAuth(struct adapter *padapter, struct recv_frame *precv_frame)
pstat->expire_to = pstapriv->auth_to;

if ((pstat->auth_seq + 1) != seq) {
- DBG_88E("(1)auth rejected because out of seq [rx_seq=%d, exp_seq=%d]!\n",
- seq, pstat->auth_seq + 1);
status = _STATS_OUT_OF_AUTH_SEQ_;
goto auth_fail;
}
@@ -797,8 +780,6 @@ unsigned int OnAuth(struct adapter *padapter, struct recv_frame *precv_frame)
pstat->expire_to = pstapriv->assoc_to;
pstat->authalg = algorithm;
} else {
- DBG_88E("(2)auth rejected because out of seq [rx_seq=%d, exp_seq=%d]!\n",
- seq, pstat->auth_seq + 1);
status = _STATS_OUT_OF_AUTH_SEQ_;
goto auth_fail;
}
@@ -812,13 +793,10 @@ unsigned int OnAuth(struct adapter *padapter, struct recv_frame *precv_frame)
pstat->auth_seq = 2;
} else if (seq == 3) {
/* checking for challenging txt... */
- DBG_88E("checking for challenging txt...\n");
-
p = rtw_get_ie(pframe + WLAN_HDR_A3_LEN + 4 + _AUTH_IE_OFFSET_, _CHLGETXT_IE_, (int *)&ie_len,
len - WLAN_HDR_A3_LEN - _AUTH_IE_OFFSET_ - 4);

if (!p || ie_len <= 0) {
- DBG_88E("auth rejected because challenge failure!(1)\n");
status = _STATS_CHALLENGE_FAIL_;
goto auth_fail;
}
@@ -829,13 +807,10 @@ unsigned int OnAuth(struct adapter *padapter, struct recv_frame *precv_frame)
/* challenging txt is correct... */
pstat->expire_to = pstapriv->assoc_to;
} else {
- DBG_88E("auth rejected because challenge failure!\n");
status = _STATS_CHALLENGE_FAIL_;
goto auth_fail;
}
} else {
- DBG_88E("(3)auth rejected because out of seq [rx_seq=%d, exp_seq=%d]!\n",
- seq, pstat->auth_seq + 1);
status = _STATS_OUT_OF_AUTH_SEQ_;
goto auth_fail;
}
@@ -875,8 +850,6 @@ unsigned int OnAuthClient(struct adapter *padapter, struct recv_frame *precv_fra
u8 *pframe = precv_frame->rx_data;
uint pkt_len = precv_frame->len;

- DBG_88E("%s\n", __func__);
-
/* check A1 matches or not */
if (memcmp(myid(&padapter->eeprompriv), get_da(pframe), ETH_ALEN))
return _SUCCESS;
@@ -890,7 +863,6 @@ unsigned int OnAuthClient(struct adapter *padapter, struct recv_frame *precv_fra
status = le16_to_cpu(*(__le16 *)((size_t)pframe + WLAN_HDR_A3_LEN + offset + 4));

if (status != 0) {
- DBG_88E("clnt auth fail, status: %d\n", status);
if (status == 13) { /* pmlmeinfo->auth_algo == dot11AuthAlgrthm_Auto) */
if (pmlmeinfo->auth_algo == dot11AuthAlgrthm_Shared)
pmlmeinfo->auth_algo = dot11AuthAlgrthm_Open;
@@ -976,11 +948,8 @@ unsigned int OnAssocReq(struct adapter *padapter, struct recv_frame *precv_frame
ie_offset = _REASOCREQ_IE_OFFSET_;
}

- if (pkt_len < IEEE80211_3ADDR_LEN + ie_offset) {
- DBG_88E("handle_assoc(reassoc=%d) - too short payload (len=%lu)"
- "\n", reassoc, (unsigned long)pkt_len);
+ if (pkt_len < IEEE80211_3ADDR_LEN + ie_offset)
return _FAIL;
- }

pstat = rtw_get_stainfo(pstapriv, GetAddr2Ptr(pframe));
if (pstat == (struct sta_info *)NULL) {
@@ -993,8 +962,6 @@ unsigned int OnAssocReq(struct adapter *padapter, struct recv_frame *precv_frame
left = pkt_len - (IEEE80211_3ADDR_LEN + ie_offset);
pos = pframe + (IEEE80211_3ADDR_LEN + ie_offset);

- DBG_88E("%s\n", __func__);
-
/* check if this stat has been successfully authenticated/assocated */
if (!((pstat->state) & WIFI_FW_AUTH_SUCCESS)) {
if (!((pstat->state) & WIFI_FW_ASSOC_SUCCESS)) {
@@ -1012,8 +979,6 @@ unsigned int OnAssocReq(struct adapter *padapter, struct recv_frame *precv_frame
/* now parse all ieee802_11 ie to point to elems */
if (rtw_ieee802_11_parse_elems(pos, left, &elems, 1) == ParseFailed ||
!elems.ssid) {
- DBG_88E("STA %pM sent invalid association request\n",
- pstat->hwaddr);
status = _STATS_FAILURE_;
goto OnAssocReqFail;
}
@@ -1042,7 +1007,6 @@ unsigned int OnAssocReq(struct adapter *padapter, struct recv_frame *precv_frame
/* check if the supported rate is ok */
p = rtw_get_ie(pframe + WLAN_HDR_A3_LEN + ie_offset, _SUPPORTEDRATES_IE_, &ie_len, pkt_len - WLAN_HDR_A3_LEN - ie_offset);
if (!p) {
- DBG_88E("Rx a sta assoc-req which supported rate is empty!\n");
/* use our own rate set as statoin used */
/* memcpy(supportRate, AP_BSSRATE, AP_BSSRATE_LEN); */
/* supportRateNum = AP_BSSRATE_LEN; */
@@ -1131,20 +1095,13 @@ unsigned int OnAssocReq(struct adapter *padapter, struct recv_frame *precv_frame

pstat->flags &= ~(WLAN_STA_WPS | WLAN_STA_MAYBE_WPS);
if (!wpa_ie) {
- if (elems.wps_ie) {
- DBG_88E("STA included WPS IE in "
- "(Re)Association Request - assume WPS is "
- "used\n");
+ if (elems.wps_ie)
pstat->flags |= WLAN_STA_WPS;
/* wpabuf_free(sta->wps_ie); */
/* sta->wps_ie = wpabuf_alloc_copy(elems.wps_ie + 4, */
/* elems.wps_ie_len - 4); */
- } else {
- DBG_88E("STA did not include WPA/RSN IE "
- "in (Re)Association Request - possible WPS "
- "use\n");
+ else
pstat->flags |= WLAN_STA_MAYBE_WPS;
- }

/* AP support WPA/RSN, and sta is going to do WPS, but AP is not ready */
/* that the selected registrar of AP is _FLASE */
@@ -1155,8 +1112,6 @@ unsigned int OnAssocReq(struct adapter *padapter, struct recv_frame *precv_frame
rtw_get_wps_attr_content(pmlmepriv->wps_beacon_ie, pmlmepriv->wps_beacon_ie_len, WPS_ATTR_SELECTED_REGISTRAR, &selected_registrar, NULL);

if (!selected_registrar) {
- DBG_88E("selected_registrar is false , or AP is not ready to do WPS\n");
-
status = _STATS_UNABLE_HANDLE_STA_;

goto OnAssocReqFail;
@@ -1167,18 +1122,12 @@ unsigned int OnAssocReq(struct adapter *padapter, struct recv_frame *precv_frame
int copy_len;

if (psecuritypriv->wpa_psk == 0) {
- DBG_88E("STA %pM: WPA/RSN IE in association "
- "request, but AP don't support WPA/RSN\n", pstat->hwaddr);
-
status = WLAN_STATUS_INVALID_IE;

goto OnAssocReqFail;
}

if (elems.wps_ie) {
- DBG_88E("STA included WPS IE in "
- "(Re)Association Request - WPS is "
- "used\n");
pstat->flags |= WLAN_STA_WPS;
copy_len = 0;
} else {
@@ -1260,16 +1209,6 @@ unsigned int OnAssocReq(struct adapter *padapter, struct recv_frame *precv_frame
goto OnAssocReqFail;
}

- if ((pstat->flags & WLAN_STA_HT) &&
- ((pstat->wpa2_pairwise_cipher & WPA_CIPHER_TKIP) ||
- (pstat->wpa_pairwise_cipher & WPA_CIPHER_TKIP))) {
- DBG_88E("HT: %pM tried to "
- "use TKIP with HT association\n", pstat->hwaddr);
-
- /* status = WLAN_STATUS_CIPHER_REJECTED_PER_POLICY; */
- /* goto OnAssocReqFail; */
- }
-
pstat->flags |= WLAN_STA_NONERP;
for (i = 0; i < pstat->bssratelen; i++) {
if ((pstat->bssrateset[i] & 0x7f) > 22) {
@@ -1308,9 +1247,7 @@ unsigned int OnAssocReq(struct adapter *padapter, struct recv_frame *precv_frame
/* Customer proprietary IE */

/* get a unique AID */
- if (pstat->aid > 0) {
- DBG_88E(" old AID %d\n", pstat->aid);
- } else {
+ if (pstat->aid == 0) {
for (pstat->aid = 1; pstat->aid <= NUM_STA; pstat->aid++)
if (!pstapriv->sta_aid[pstat->aid - 1])
break;
@@ -1319,14 +1256,11 @@ unsigned int OnAssocReq(struct adapter *padapter, struct recv_frame *precv_frame
if (pstat->aid > pstapriv->max_num_sta) {
pstat->aid = 0;

- DBG_88E(" no room for more AIDs\n");
-
status = WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA;

goto OnAssocReqFail;
} else {
pstapriv->sta_aid[pstat->aid - 1] = pstat;
- DBG_88E("allocate new AID=(%d)\n", pstat->aid);
}
}

@@ -1361,7 +1295,6 @@ unsigned int OnAssocReq(struct adapter *padapter, struct recv_frame *precv_frame
issue_asocrsp(padapter, status, pstat, WIFI_REASSOCRSP);

/* 2 - report to upper layer */
- DBG_88E("indicate_sta_join_event to upper layer - hostapd\n");
rtw_indicate_sta_assoc_event(padapter, pstat);

/* 3-(1) report sta add event */
@@ -1400,8 +1333,6 @@ unsigned int OnAssocRsp(struct adapter *padapter, struct recv_frame *precv_frame
u8 *pframe = precv_frame->rx_data;
uint pkt_len = precv_frame->len;

- DBG_88E("%s\n", __func__);
-
/* check A1 matches or not */
if (memcmp(myid(&padapter->eeprompriv), get_da(pframe), ETH_ALEN))
return _SUCCESS;
@@ -1417,7 +1348,6 @@ unsigned int OnAssocRsp(struct adapter *padapter, struct recv_frame *precv_frame
/* status */
status = le16_to_cpu(*(__le16 *)(pframe + WLAN_HDR_A3_LEN + 2));
if (status > 0) {
- DBG_88E("assoc reject, status code: %d\n", status);
pmlmeinfo->state = WIFI_FW_NULL_STATE;
res = -4;
goto report_assoc_result;
@@ -1497,8 +1427,6 @@ unsigned int OnDeAuth(struct adapter *padapter, struct recv_frame *precv_frame)

reason = le16_to_cpu(*(__le16 *)(pframe + WLAN_HDR_A3_LEN));

- DBG_88E("%s Reason code(%d)\n", __func__, reason);
-
if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) {
struct sta_info *psta;
struct sta_priv *pstapriv = &padapter->stapriv;
@@ -1564,8 +1492,6 @@ unsigned int OnDisassoc(struct adapter *padapter, struct recv_frame *precv_frame

reason = le16_to_cpu(*(__le16 *)(pframe + WLAN_HDR_A3_LEN));

- DBG_88E("%s Reason code(%d)\n", __func__, reason);
-
if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) {
struct sta_info *psta;
struct sta_priv *pstapriv = &padapter->stapriv;
@@ -1595,7 +1521,6 @@ unsigned int OnDisassoc(struct adapter *padapter, struct recv_frame *precv_frame

unsigned int OnAtim(struct adapter *padapter, struct recv_frame *precv_frame)
{
- DBG_88E("%s\n", __func__);
return _SUCCESS;
}

@@ -1609,8 +1534,6 @@ unsigned int on_action_spct(struct adapter *padapter, struct recv_frame *precv_f
u8 category;
u8 action;

- DBG_88E(FUNC_NDEV_FMT"\n", FUNC_NDEV_ARG(padapter->pnetdev));
-
psta = rtw_get_stainfo(pstapriv, GetAddr2Ptr(pframe));

if (!psta)
@@ -1663,8 +1586,6 @@ unsigned int OnAction_back(struct adapter *padapter, struct recv_frame *precv_fr
if (memcmp(myid(&padapter->eeprompriv), GetAddr1Ptr(pframe), ETH_ALEN))/* for if1, sta/ap mode */
return _SUCCESS;

- DBG_88E("%s\n", __func__);
-
if ((pmlmeinfo->state & 0x03) != WIFI_FW_AP_STATE)
if (!(pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS))
return _SUCCESS;
@@ -1682,7 +1603,6 @@ unsigned int OnAction_back(struct adapter *padapter, struct recv_frame *precv_fr
if (!pmlmeinfo->HT_enable)
return _SUCCESS;
action = frame_body[1];
- DBG_88E("%s, action=%d\n", __func__, action);
switch (action) {
case RTW_WLAN_ACTION_ADDBA_REQ: /* ADDBA request */
memcpy(&pmlmeinfo->ADDBA_req, &frame_body[2], sizeof(struct ADDBA_request));
@@ -1697,7 +1617,6 @@ unsigned int OnAction_back(struct adapter *padapter, struct recv_frame *precv_fr
status = get_unaligned_le16(&frame_body[3]);
tid = ((frame_body[5] >> 2) & 0x7);
if (status == 0) { /* successful */
- DBG_88E("agg_enable for TID=%d\n", tid);
psta->htpriv.agg_enable_bitmap |= 1 << tid;
psta->htpriv.candidate_tid_bitmap &= ~BIT(tid);
} else {
@@ -1715,7 +1634,6 @@ unsigned int OnAction_back(struct adapter *padapter, struct recv_frame *precv_fr
preorder_ctrl->enable = false;
preorder_ctrl->indicate_seq = 0xffff;
}
- DBG_88E("%s(): DELBA: %x(%x)\n", __func__, pmlmeinfo->agg_enable_bitmap, reason_code);
/* todo: how to notify the host while receiving DELETE BA */
break;
default:
@@ -1759,7 +1677,6 @@ void issue_p2p_GO_request(struct adapter *padapter, u8 *raddr)
if (!pmgntframe)
return;

- DBG_88E("[%s] In\n", __func__);
/* update attribute */
pattrib = &pmgntframe->attrib;
update_mgntframe_attrib(padapter, pattrib);
@@ -2095,7 +2012,6 @@ static void issue_p2p_GO_response(struct adapter *padapter, u8 *raddr, u8 *frame
if (!pmgntframe)
return;

- DBG_88E("[%s] In, result=%d\n", __func__, result);
/* update attribute */
pattrib = &pmgntframe->attrib;
update_mgntframe_attrib(padapter, pattrib);
@@ -2453,7 +2369,6 @@ static void issue_p2p_GO_confirm(struct adapter *padapter, u8 *raddr, u8 result)
if (!pmgntframe)
return;

- DBG_88E("[%s] In\n", __func__);
/* update attribute */
pattrib = &pmgntframe->attrib;
update_mgntframe_attrib(padapter, pattrib);
@@ -3053,7 +2968,6 @@ void issue_p2p_provision_request(struct adapter *padapter, u8 *pssid, u8 ussidle
if (!pmgntframe)
return;

- DBG_88E("[%s] In\n", __func__);
/* update attribute */
pattrib = &pmgntframe->attrib;
update_mgntframe_attrib(padapter, pattrib);
@@ -3129,16 +3043,9 @@ static u8 is_matched_in_profilelist(u8 *peermacaddr, struct profile_info *profil
{
u8 i, match_result = 0;

- DBG_88E("[%s] peermac=%.2X %.2X %.2X %.2X %.2X %.2X\n", __func__,
- peermacaddr[0], peermacaddr[1], peermacaddr[2], peermacaddr[3], peermacaddr[4], peermacaddr[5]);
-
for (i = 0; i < P2P_MAX_PERSISTENT_GROUP_NUM; i++, profileinfo++) {
- DBG_88E("[%s] profileinfo_mac=%.2X %.2X %.2X %.2X %.2X %.2X\n", __func__,
- profileinfo->peermac[0], profileinfo->peermac[1], profileinfo->peermac[2],
- profileinfo->peermac[3], profileinfo->peermac[4], profileinfo->peermac[5]);
if (!memcmp(peermacaddr, profileinfo->peermac, ETH_ALEN)) {
match_result = 1;
- DBG_88E("[%s] Match!\n", __func__);
break;
}
}
@@ -3689,17 +3596,12 @@ static s32 rtw_action_public_decache(struct recv_frame *recv_frame, s32 token)

if (GetRetry(frame)) {
if (token >= 0) {
- if ((seq_ctrl == mlmeext->action_public_rxseq) && (token == mlmeext->action_public_dialog_token)) {
- DBG_88E(FUNC_ADPT_FMT" seq_ctrl = 0x%x, rxseq = 0x%x, token:%d\n",
- FUNC_ADPT_ARG(adapter), seq_ctrl, mlmeext->action_public_rxseq, token);
+ if ((seq_ctrl == mlmeext->action_public_rxseq) &&
+ (token == mlmeext->action_public_dialog_token))
return _FAIL;
- }
} else {
- if (seq_ctrl == mlmeext->action_public_rxseq) {
- DBG_88E(FUNC_ADPT_FMT" seq_ctrl = 0x%x, rxseq = 0x%x\n",
- FUNC_ADPT_ARG(adapter), seq_ctrl, mlmeext->action_public_rxseq);
+ if (seq_ctrl == mlmeext->action_public_rxseq)
return _FAIL;
- }
}
}

@@ -3740,7 +3642,6 @@ static unsigned int on_action_public_p2p(struct recv_frame *precv_frame)

switch (frame_body[6]) { /* OUI Subtype */
case P2P_GO_NEGO_REQ:
- DBG_88E("[%s] Got GO Nego Req Frame\n", __func__);
memset(&pwdinfo->groupid_info, 0x00, sizeof(struct group_id_info));

if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_RX_PROVISION_DIS_REQ))
@@ -3752,7 +3653,6 @@ static unsigned int on_action_public_p2p(struct recv_frame *precv_frame)
_cancel_timer_ex(&pwdinfo->restore_p2p_state_timer);
/* Restore the previous p2p state */
rtw_p2p_set_state(pwdinfo, rtw_p2p_pre_state(pwdinfo));
- DBG_88E("[%s] Restore the previous p2p state to %d\n", __func__, rtw_p2p_state(pwdinfo));
}

/* Commented by Kurt 20110902 */
@@ -3773,8 +3673,6 @@ static unsigned int on_action_public_p2p(struct recv_frame *precv_frame)
_set_timer(&pwdinfo->restore_p2p_state_timer, 5000);
break;
case P2P_GO_NEGO_RESP:
- DBG_88E("[%s] Got GO Nego Resp Frame\n", __func__);
-
if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_GONEGO_ING)) {
/* Commented by Albert 20110425 */
/* The restore timer is enabled when issuing the nego request frame of rtw_p2p_connect function. */
@@ -3793,12 +3691,9 @@ static unsigned int on_action_public_p2p(struct recv_frame *precv_frame)
pwdinfo->negotiation_dialog_token = 1;
if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_GONEGO_FAIL))
_set_timer(&pwdinfo->restore_p2p_state_timer, 5000);
- } else {
- DBG_88E("[%s] Skipped GO Nego Resp Frame (p2p_state != P2P_STATE_GONEGO_ING)\n", __func__);
}
break;
case P2P_GO_NEGO_CONF:
- DBG_88E("[%s] Got GO Nego Confirm Frame\n", __func__);
result = process_p2p_group_negotation_confirm(pwdinfo, frame_body, len);
if (P2P_STATUS_SUCCESS == result) {
if (rtw_p2p_role(pwdinfo) == P2P_ROLE_CLIENT) {
@@ -3812,7 +3707,6 @@ static unsigned int on_action_public_p2p(struct recv_frame *precv_frame)
/* Added by Albert 2010/10/05 */
/* Received the P2P Invite Request frame. */

- DBG_88E("[%s] Got invite request frame!\n", __func__);
p2p_ie = rtw_get_p2p_ie(frame_body + _PUBLIC_ACTION_IE_OFFSET_, len - _PUBLIC_ACTION_IE_OFFSET_, NULL, &p2p_ielen);
if (p2p_ie) {
/* Parse the necessary information from the P2P Invitation Request frame. */
@@ -3831,13 +3725,6 @@ static unsigned int on_action_public_p2p(struct recv_frame *precv_frame)
/* #> iwpriv wlan0 p2p_get peer_ifa */
/* After having the peer interface address, the sigma can find the correct conf file for wpa_supplicant. */

- if (attr_contentlen) {
- DBG_88E("[%s] GO's BSSID = %.2X %.2X %.2X %.2X %.2X %.2X\n", __func__,
- pwdinfo->p2p_peer_interface_addr[0], pwdinfo->p2p_peer_interface_addr[1],
- pwdinfo->p2p_peer_interface_addr[2], pwdinfo->p2p_peer_interface_addr[3],
- pwdinfo->p2p_peer_interface_addr[4], pwdinfo->p2p_peer_interface_addr[5]);
- }
-
if (invitation_flag & P2P_INVITATION_FLAGS_PERSISTENT) {
/* Re-invoke the persistent group. */

@@ -3883,7 +3770,6 @@ static unsigned int on_action_public_p2p(struct recv_frame *precv_frame)
}
}
} else {
- DBG_88E("[%s] P2P Group ID Attribute NOT FOUND!\n", __func__);
status_code = P2P_STATUS_FAIL_INFO_UNAVAILABLE;
}
} else {
@@ -3909,17 +3795,13 @@ static unsigned int on_action_public_p2p(struct recv_frame *precv_frame)
status_code = P2P_STATUS_SUCCESS;
}
} else {
- DBG_88E("[%s] P2P Group ID Attribute NOT FOUND!\n", __func__);
status_code = P2P_STATUS_FAIL_INFO_UNAVAILABLE;
}
}
} else {
- DBG_88E("[%s] P2P Invitation Flags Attribute NOT FOUND!\n", __func__);
status_code = P2P_STATUS_FAIL_INFO_UNAVAILABLE;
}

- DBG_88E("[%s] status_code = %d\n", __func__, status_code);
-
pwdinfo->inviteresp_info.token = frame_body[7];
issue_p2p_invitation_response(padapter, GetAddr2Ptr(pframe), pwdinfo->inviteresp_info.token, status_code);
}
@@ -3928,14 +3810,12 @@ static unsigned int on_action_public_p2p(struct recv_frame *precv_frame)
u8 attr_content = 0x00;
u32 attr_contentlen = 0;

- DBG_88E("[%s] Got invite response frame!\n", __func__);
_cancel_timer_ex(&pwdinfo->restore_p2p_state_timer);
p2p_ie = rtw_get_p2p_ie(frame_body + _PUBLIC_ACTION_IE_OFFSET_, len - _PUBLIC_ACTION_IE_OFFSET_, NULL, &p2p_ielen);
if (p2p_ie) {
rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_STATUS, &attr_content, &attr_contentlen);

if (attr_contentlen == 1) {
- DBG_88E("[%s] Status = %d\n", __func__, attr_content);
pwdinfo->invitereq_info.benable = false;

if (attr_content == P2P_STATUS_SUCCESS) {
@@ -3969,7 +3849,6 @@ static unsigned int on_action_public_p2p(struct recv_frame *precv_frame)
process_p2p_devdisc_resp(pwdinfo, pframe, len);
break;
case P2P_PROVISION_DISC_REQ:
- DBG_88E("[%s] Got Provisioning Discovery Request Frame\n", __func__);
process_p2p_provdisc_req(pwdinfo, pframe, len);
memcpy(pwdinfo->rx_prov_disc_info.peerDevAddr, GetAddr2Ptr(pframe), ETH_ALEN);

@@ -3984,7 +3863,6 @@ static unsigned int on_action_public_p2p(struct recv_frame *precv_frame)
case P2P_PROVISION_DISC_RESP:
/* Commented by Albert 20110707 */
/* Should we check the pwdinfo->tx_prov_disc_info.bsent flag here?? */
- DBG_88E("[%s] Got Provisioning Discovery Response Frame\n", __func__);
/* Commented by Albert 20110426 */
/* The restore timer is enabled when issuing the provisioing request frame in rtw_p2p_prov_disc function. */
_cancel_timer_ex(&pwdinfo->restore_p2p_state_timer);
@@ -4075,8 +3953,6 @@ unsigned int OnAction_p2p(struct adapter *padapter, struct recv_frame *precv_fra
uint len = precv_frame->len;
struct wifidirect_info *pwdinfo = &padapter->wdinfo;

- DBG_88E("%s\n", __func__);
-
/* check RA matches or not */
if (memcmp(myid(&padapter->eeprompriv), GetAddr1Ptr(pframe), ETH_ALEN))/* for if1, sta/ap mode */
return _SUCCESS;
@@ -4140,14 +4016,11 @@ struct xmit_frame *alloc_mgtxmitframe(struct xmit_priv *pxmitpriv)
struct xmit_buf *pxmitbuf;

pmgntframe = rtw_alloc_xmitframe(pxmitpriv);
- if (!pmgntframe) {
- DBG_88E("%s, alloc xmitframe fail\n", __func__);
+ if (!pmgntframe)
return NULL;
- }

pxmitbuf = rtw_alloc_xmitbuf_ext(pxmitpriv);
if (!pxmitbuf) {
- DBG_88E("%s, alloc xmitbuf fail\n", __func__);
rtw_free_xmitframe(pxmitpriv, pmgntframe);
return NULL;
}
@@ -4169,7 +4042,6 @@ void update_mgnt_tx_rate(struct adapter *padapter, u8 rate)
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;

pmlmeext->tx_rate = rate;
- DBG_88E("%s(): rate = %x\n", __func__, rate);
}

void update_mgntframe_attrib(struct adapter *padapter, struct pkt_attrib *pattrib)
@@ -4305,10 +4177,8 @@ void issue_beacon(struct adapter *padapter, int timeout_ms)
struct wifidirect_info *pwdinfo = &padapter->wdinfo;

pmgntframe = alloc_mgtxmitframe(pxmitpriv);
- if (!pmgntframe) {
- DBG_88E("%s, alloc mgnt frame fail\n", __func__);
+ if (!pmgntframe)
return;
- }
spin_lock_bh(&pmlmepriv->bcn_update_lock);

/* update attribute */
@@ -4488,14 +4358,11 @@ void issue_beacon(struct adapter *padapter, int timeout_ms)

spin_unlock_bh(&pmlmepriv->bcn_update_lock);

- if ((pattrib->pktlen + TXDESC_SIZE) > 512) {
- DBG_88E("beacon frame too large\n");
+ if ((pattrib->pktlen + TXDESC_SIZE) > 512)
return;
- }

pattrib->last_txcmdsz = pattrib->pktlen;

- /* DBG_88E("issue bcn_sz=%d\n", pattrib->last_txcmdsz); */
if (timeout_ms > 0)
dump_mgntframe_and_wait(padapter, pmgntframe, timeout_ms);
else
@@ -4521,10 +4388,8 @@ void issue_probersp(struct adapter *padapter, unsigned char *da, u8 is_valid_p2p
struct wifidirect_info *pwdinfo = &padapter->wdinfo;

pmgntframe = alloc_mgtxmitframe(pxmitpriv);
- if (!pmgntframe) {
- DBG_88E("%s, alloc mgnt frame fail\n", __func__);
+ if (!pmgntframe)
return;
- }

/* update attribute */
pattrib = &pmgntframe->attrib;
@@ -4748,7 +4613,6 @@ int issue_probereq_ex(struct adapter *padapter, struct ndis_802_11_ssid *pssid,
{
int ret;
int i = 0;
- u32 start = jiffies;

do {
ret = _issue_probereq(padapter, pssid, da, wait_ms > 0);
@@ -4767,17 +4631,6 @@ int issue_probereq_ex(struct adapter *padapter, struct ndis_802_11_ssid *pssid,
ret = _SUCCESS;
goto exit;
}
-
- if (try_cnt && wait_ms) {
- if (da)
- DBG_88E(FUNC_ADPT_FMT" to %pM, ch:%u%s, %d/%d in %u ms\n",
- FUNC_ADPT_ARG(padapter), da, rtw_get_oper_ch(padapter),
- ret == _SUCCESS ? ", acked" : "", i, try_cnt, rtw_get_passing_time_ms(start));
- else
- DBG_88E(FUNC_ADPT_FMT", ch:%u%s, %d/%d in %u ms\n",
- FUNC_ADPT_ARG(padapter), rtw_get_oper_ch(padapter),
- ret == _SUCCESS ? ", acked" : "", i, try_cnt, rtw_get_passing_time_ms(start));
- }
exit:
return ret;
}
@@ -4906,7 +4759,6 @@ void issue_auth(struct adapter *padapter, struct sta_info *psta, unsigned short
pattrib->last_txcmdsz = pattrib->pktlen;

rtw_wep_encrypt(padapter, pmgntframe);
- DBG_88E("%s\n", __func__);
dump_mgntframe(padapter, pmgntframe);
}

@@ -4927,8 +4779,6 @@ void issue_asocrsp(struct adapter *padapter, unsigned short status, struct sta_i
__le16 lestatus, leval;
struct wifidirect_info *pwdinfo = &padapter->wdinfo;

- DBG_88E("%s\n", __func__);
-
pmgntframe = alloc_mgtxmitframe(pxmitpriv);
if (!pmgntframe)
return;
@@ -5115,7 +4965,6 @@ void issue_assocreq(struct adapter *padapter)
for (i = 0; i < NDIS_802_11_LENGTH_RATES_EX; i++) {
if (pmlmeinfo->network.SupportedRates[i] == 0)
break;
- DBG_88E("network.SupportedRates[%d]=%02X\n", i, pmlmeinfo->network.SupportedRates[i]);
}

for (i = 0; i < NDIS_802_11_LENGTH_RATES_EX; i++) {
@@ -5130,17 +4979,12 @@ void issue_assocreq(struct adapter *padapter)
break;
}

- if (j == sta_bssrate_len) {
- /* the rate is not supported by STA */
- DBG_88E("%s(): the rate[%d]=%02X is not supported by STA!\n", __func__, i, pmlmeinfo->network.SupportedRates[i]);
- } else {
+ if (j != sta_bssrate_len)
/* the rate is supported by STA */
bssrate[index++] = pmlmeinfo->network.SupportedRates[i];
- }
}

bssrate_len = index;
- DBG_88E("bssrate_len=%d\n", bssrate_len);

if (bssrate_len == 0) {
rtw_free_xmitbuf(pxmitpriv, pmgntframe->pxmitbuf);
@@ -5425,7 +5269,6 @@ int issue_nulldata(struct adapter *padapter, unsigned char *da, unsigned int pow
{
int ret;
int i = 0;
- u32 start = jiffies;
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;

@@ -5449,17 +5292,6 @@ int issue_nulldata(struct adapter *padapter, unsigned char *da, unsigned int pow
ret = _SUCCESS;
goto exit;
}
-
- if (try_cnt && wait_ms) {
- if (da)
- DBG_88E(FUNC_ADPT_FMT" to %pM, ch:%u%s, %d/%d in %u ms\n",
- FUNC_ADPT_ARG(padapter), da, rtw_get_oper_ch(padapter),
- ret == _SUCCESS ? ", acked" : "", i, try_cnt, rtw_get_passing_time_ms(start));
- else
- DBG_88E(FUNC_ADPT_FMT", ch:%u%s, %d/%d in %u ms\n",
- FUNC_ADPT_ARG(padapter), rtw_get_oper_ch(padapter),
- ret == _SUCCESS ? ", acked" : "", i, try_cnt, rtw_get_passing_time_ms(start));
- }
exit:
return ret;
}
@@ -5478,8 +5310,6 @@ static int _issue_qos_nulldata(struct adapter *padapter, unsigned char *da, u16
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;

- DBG_88E("%s\n", __func__);
-
pmgntframe = alloc_mgtxmitframe(pxmitpriv);
if (!pmgntframe)
goto exit;
@@ -5545,7 +5375,6 @@ int issue_qos_nulldata(struct adapter *padapter, unsigned char *da, u16 tid, int
{
int ret;
int i = 0;
- u32 start = jiffies;
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;

@@ -5569,17 +5398,6 @@ int issue_qos_nulldata(struct adapter *padapter, unsigned char *da, u16 tid, int
ret = _SUCCESS;
goto exit;
}
-
- if (try_cnt && wait_ms) {
- if (da)
- DBG_88E(FUNC_ADPT_FMT" to %pM, ch:%u%s, %d/%d in %u ms\n",
- FUNC_ADPT_ARG(padapter), da, rtw_get_oper_ch(padapter),
- ret == _SUCCESS ? ", acked" : "", i, try_cnt, rtw_get_passing_time_ms(start));
- else
- DBG_88E(FUNC_ADPT_FMT", ch:%u%s, %d/%d in %u ms\n",
- FUNC_ADPT_ARG(padapter), rtw_get_oper_ch(padapter),
- ret == _SUCCESS ? ", acked" : "", i, try_cnt, rtw_get_passing_time_ms(start));
- }
exit:
return ret;
}
@@ -5649,7 +5467,6 @@ static int _issue_deauth(struct adapter *padapter, unsigned char *da, unsigned s

int issue_deauth(struct adapter *padapter, unsigned char *da, unsigned short reason)
{
- DBG_88E("%s to %pM\n", __func__, da);
return _issue_deauth(padapter, da, reason, false);
}

@@ -5658,7 +5475,6 @@ int issue_deauth_ex(struct adapter *padapter, u8 *da, unsigned short reason, int
{
int ret;
int i = 0;
- u32 start = jiffies;

do {
ret = _issue_deauth(padapter, da, reason, wait_ms > 0);
@@ -5676,17 +5492,6 @@ int issue_deauth_ex(struct adapter *padapter, u8 *da, unsigned short reason, int
ret = _SUCCESS;
goto exit;
}
-
- if (try_cnt && wait_ms) {
- if (da)
- DBG_88E(FUNC_ADPT_FMT" to %pM, ch:%u%s, %d/%d in %u ms\n",
- FUNC_ADPT_ARG(padapter), da, rtw_get_oper_ch(padapter),
- ret == _SUCCESS ? ", acked" : "", i, try_cnt, rtw_get_passing_time_ms(start));
- else
- DBG_88E(FUNC_ADPT_FMT", ch:%u%s, %d/%d in %u ms\n",
- FUNC_ADPT_ARG(padapter), rtw_get_oper_ch(padapter),
- ret == _SUCCESS ? ", acked" : "", i, try_cnt, rtw_get_passing_time_ms(start));
- }
exit:
return ret;
}
@@ -5713,8 +5518,6 @@ void issue_action_BA(struct adapter *padapter, unsigned char *raddr, unsigned ch
struct sta_priv *pstapriv = &padapter->stapriv;
struct registry_priv *pregpriv = &padapter->registrypriv;

- DBG_88E("%s, category=%d, action=%d, status=%d\n", __func__, category, action, status);
-
pmgntframe = alloc_mgtxmitframe(pxmitpriv);
if (!pmgntframe)
return;
@@ -5766,8 +5569,6 @@ void issue_action_BA(struct adapter *padapter, unsigned char *raddr, unsigned ch
if (psta) {
start_seq = (psta->sta_xmitpriv.txseq_tid[status & 0x07] & 0xfff) + 1;

- DBG_88E("BA_starting_seqctrl=%d for TID=%d\n", start_seq, status & 0x07);
-
psta->BA_starting_seqctrl[status & 0x07] = start_seq;

BA_starting_seqctrl = start_seq << 4;
@@ -5849,8 +5650,6 @@ static void issue_action_BSSCoexistPacket(struct adapter *padapter)
if (pmlmeinfo->bwmode_updated)
return;

- DBG_88E("%s\n", __func__);
-
category = RTW_WLAN_CATEGORY_PUBLIC;
action = ACT_PUBLIC_BSSCOEXIST;

@@ -5975,7 +5774,6 @@ unsigned int send_delba(struct adapter *padapter, u8 initiator, u8 *addr)
if (initiator == 0) { /* recipient */
for (tid = 0; tid < MAXTID; tid++) {
if (psta->recvreorder_ctrl[tid].enable) {
- DBG_88E("rx agg disable tid(%d)\n", tid);
issue_action_BA(padapter, addr, RTW_WLAN_ACTION_DELBA, (((tid << 1) | initiator) & 0x1F));
psta->recvreorder_ctrl[tid].enable = false;
psta->recvreorder_ctrl[tid].indicate_seq = 0xffff;
@@ -5984,7 +5782,6 @@ unsigned int send_delba(struct adapter *padapter, u8 initiator, u8 *addr)
} else if (initiator == 1) { /* originator */
for (tid = 0; tid < MAXTID; tid++) {
if (psta->htpriv.agg_enable_bitmap & BIT(tid)) {
- DBG_88E("tx agg disable tid(%d)\n", tid);
issue_action_BA(padapter, addr, RTW_WLAN_ACTION_DELBA, (((tid << 1) | initiator) & 0x1F));
psta->htpriv.agg_enable_bitmap &= ~BIT(tid);
psta->htpriv.candidate_tid_bitmap &= ~BIT(tid);
@@ -6001,8 +5798,6 @@ unsigned int send_beacon(struct adapter *padapter)
int issue = 0;
int poll = 0;

- u32 start = jiffies;
-
SetHwReg8188EU(padapter, HW_VAR_BCN_VALID, NULL);
do {
issue_beacon(padapter, 100);
@@ -6017,13 +5812,8 @@ unsigned int send_beacon(struct adapter *padapter)
if (padapter->bSurpriseRemoved || padapter->bDriverStopped)
return _FAIL;
if (!bxmitok) {
- DBG_88E("%s fail! %u ms\n", __func__, rtw_get_passing_time_ms(start));
return _FAIL;
} else {
- u32 passing_time = rtw_get_passing_time_ms(start);
-
- if (passing_time > 100 || issue > 3)
- DBG_88E("%s success, issue:%d, poll:%d, %u ms\n", __func__, issue, poll, rtw_get_passing_time_ms(start));
return _SUCCESS;
}
}
@@ -6231,16 +6021,12 @@ u8 collect_bss_info(struct adapter *padapter, struct recv_frame *precv_frame, st

/* checking SSID */
p = rtw_get_ie(bssid->IEs + ie_offset, _SSID_IE_, &len, bssid->IELength - ie_offset);
- if (!p) {
- DBG_88E("marc: cannot find SSID for survey event\n");
+ if (!p)
return _FAIL;
- }

if (*(p + 1)) {
- if (len > NDIS_802_11_LENGTH_SSID) {
- DBG_88E("%s()-%d: IE too long (%d) for survey event\n", __func__, __LINE__, len);
+ if (len > NDIS_802_11_LENGTH_SSID)
return _FAIL;
- }
memcpy(bssid->Ssid.Ssid, (p + 2), *(p + 1));
bssid->Ssid.SsidLength = *(p + 1);
} else {
@@ -6253,20 +6039,16 @@ u8 collect_bss_info(struct adapter *padapter, struct recv_frame *precv_frame, st
i = 0;
p = rtw_get_ie(bssid->IEs + ie_offset, _SUPPORTEDRATES_IE_, &len, bssid->IELength - ie_offset);
if (p) {
- if (len > NDIS_802_11_LENGTH_RATES_EX) {
- DBG_88E("%s()-%d: IE too long (%d) for survey event\n", __func__, __LINE__, len);
+ if (len > NDIS_802_11_LENGTH_RATES_EX)
return _FAIL;
- }
memcpy(bssid->SupportedRates, (p + 2), len);
i = len;
}

p = rtw_get_ie(bssid->IEs + ie_offset, _EXT_SUPPORTEDRATES_IE_, &len, bssid->IELength - ie_offset);
if (p) {
- if (len > (NDIS_802_11_LENGTH_RATES_EX - i)) {
- DBG_88E("%s()-%d: IE too long (%d) for survey event\n", __func__, __LINE__, len);
+ if (len > (NDIS_802_11_LENGTH_RATES_EX - i))
return _FAIL;
- }
memcpy(bssid->SupportedRates + i, (p + 2), len);
}

@@ -6381,7 +6163,6 @@ void start_create_ibss(struct adapter *padapter)
rtw_indicate_connect(padapter);
}
} else {
- DBG_88E("start_create_ibss, invalid cap:%x\n", caps);
return;
}
/* update bc/mc sta_info */
@@ -6495,8 +6276,6 @@ unsigned int receive_disconnect(struct adapter *padapter, unsigned char *MacAddr
if (!(!memcmp(MacAddr, get_my_bssid(&pmlmeinfo->network), ETH_ALEN)))
return _SUCCESS;

- DBG_88E("%s\n", __func__);
-
if ((pmlmeinfo->state & 0x03) == WIFI_FW_STATION_STATE) {
if (pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS) {
pmlmeinfo->state = WIFI_FW_NULL_STATE;
@@ -6754,8 +6533,6 @@ void report_surveydone_event(struct adapter *padapter)
psurveydone_evt = (struct surveydone_event *)(pevtcmd + sizeof(struct C2HEvent_Header));
psurveydone_evt->bss_cnt = pmlmeext->sitesurvey_res.bss_cnt;

- DBG_88E("survey done event(%x)\n", psurveydone_evt->bss_cnt);
-
rtw_enqueue_cmd(pcmdpriv, pcmd_obj);
}

@@ -6800,8 +6577,6 @@ void report_join_res(struct adapter *padapter, int res)
pjoinbss_evt->network.join_res = res;
pjoinbss_evt->network.aid = res;

- DBG_88E("report_join_res(%d)\n", res);
-
rtw_joinbss_event_prehandle(padapter, (u8 *)&pjoinbss_evt->network);

rtw_enqueue_cmd(pcmdpriv, pcmd_obj);
@@ -6856,8 +6631,6 @@ void report_del_sta_event(struct adapter *padapter, unsigned char *MacAddr, unsi

pdel_sta_evt->mac_id = mac_id;

- DBG_88E("report_del_sta_event: delete STA, mac_id =%d\n", mac_id);
-
rtw_enqueue_cmd(pcmdpriv, pcmd_obj);
}

@@ -6900,8 +6673,6 @@ void report_add_sta_event(struct adapter *padapter, unsigned char *MacAddr, int
memcpy((unsigned char *)(&padd_sta_evt->macaddr), MacAddr, ETH_ALEN);
padd_sta_evt->cam_id = cam_idx;

- DBG_88E("report_add_sta_event: add STA\n");
-
rtw_enqueue_cmd(pcmdpriv, pcmd_obj);
}

@@ -6970,7 +6741,7 @@ void mlmeext_joinbss_event_callback(struct adapter *padapter, int join_res)
/* restore to initial setting. */
update_tx_basic_rate(padapter, padapter->registrypriv.wireless_mode);

- goto exit_mlmeext_joinbss_event_callback;
+ return;
}

if ((pmlmeinfo->state & 0x03) == WIFI_FW_ADHOC_STATE) {
@@ -7026,10 +6797,6 @@ void mlmeext_joinbss_event_callback(struct adapter *padapter, int join_res)
correct_TSF(padapter, pmlmeext);
}
rtw_lps_ctrl_wk_cmd(padapter, LPS_CTRL_CONNECT, 0);
-
-exit_mlmeext_joinbss_event_callback:
-
- DBG_88E("=>%s\n", __func__);
}

void mlmeext_sta_add_event_callback(struct adapter *padapter, struct sta_info *psta)
@@ -7038,8 +6805,6 @@ void mlmeext_sta_add_event_callback(struct adapter *padapter, struct sta_info *p
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
u8 join_type;

- DBG_88E("%s\n", __func__);
-
if ((pmlmeinfo->state & 0x03) == WIFI_FW_ADHOC_STATE) {
if (pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS) {/* adhoc master or sta_count>1 */
/* nothing to do */
@@ -7119,7 +6884,6 @@ static void _linked_rx_signal_strength_display(struct adapter *padapter)
GetHalDefVar8188EUsb(padapter, HW_DEF_RA_INFO_DUMP, &mac_id);

GetHalDefVar8188EUsb(padapter, HAL_DEF_UNDERCORATEDSMOOTHEDPWDB, &UndecoratedSmoothedPWDB);
- DBG_88E("UndecoratedSmoothedPWDB:%d\n", UndecoratedSmoothedPWDB);
}

static u8 chk_ap_is_alive(struct adapter *padapter, struct sta_info *psta)
@@ -7141,18 +6905,11 @@ static u8 chk_ap_is_alive(struct adapter *padapter, struct sta_info *psta)
static void rtl8188e_sreset_linked_status_check(struct adapter *padapter)
{
u32 rx_dma_status = rtw_read32(padapter, REG_RXDMA_STATUS);
- u8 fw_status;

- if (rx_dma_status != 0x00) {
- DBG_88E("%s REG_RXDMA_STATUS:0x%08x\n", __func__, rx_dma_status);
+ if (rx_dma_status != 0x00)
rtw_write32(padapter, REG_RXDMA_STATUS, rx_dma_status);
- }

- fw_status = rtw_read8(padapter, REG_FMETHR);
- if (fw_status == 1)
- DBG_88E("%s REG_FW_STATUS (0x%02x), Read_Efuse_Fail !!\n", __func__, fw_status);
- else if (fw_status == 2)
- DBG_88E("%s REG_FW_STATUS (0x%02x), Condition_No_Match !!\n", __func__, fw_status);
+ rtw_read8(padapter, REG_FMETHR);
}

void linked_status_chk(struct adapter *padapter)
@@ -7286,15 +7043,8 @@ void survey_timer_hdl(struct adapter *padapter)
if (!rtw_p2p_chk_state(&padapter->wdinfo, P2P_STATE_NONE)) {
rtw_p2p_findphase_ex_set(pwdinfo, P2P_FINDPHASE_EX_MAX);
pmlmeext->sitesurvey_res.channel_idx = 3;
- DBG_88E("%s idx:%d, cnt:%u\n", __func__
- , pmlmeext->sitesurvey_res.channel_idx
- , pwdinfo->find_phase_state_exchange_cnt
- );
} else {
pmlmeext->sitesurvey_res.channel_idx = pmlmeext->sitesurvey_res.ch_num;
- DBG_88E("%s idx:%d\n", __func__
- , pmlmeext->sitesurvey_res.channel_idx
- );
}

pmlmeext->scan_abort = false;/* reset */
@@ -7324,7 +7074,6 @@ void link_timer_hdl(struct adapter *padapter)
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;

if (pmlmeinfo->state & WIFI_FW_AUTH_NULL) {
- DBG_88E("link_timer_hdl:no beacon while connecting\n");
pmlmeinfo->state = WIFI_FW_NULL_STATE;
report_join_res(padapter, -3);
} else if (pmlmeinfo->state & WIFI_FW_AUTH_STATE) {
@@ -7335,7 +7084,6 @@ void link_timer_hdl(struct adapter *padapter)
return;
}

- DBG_88E("link_timer_hdl: auth timeout and try again\n");
pmlmeinfo->auth_seq = 1;
issue_auth(padapter, NULL, 0);
set_link_timer(pmlmeext, REAUTH_TO);
@@ -7347,7 +7095,6 @@ void link_timer_hdl(struct adapter *padapter)
return;
}

- DBG_88E("link_timer_hdl: assoc timeout and try again\n");
issue_assocreq(padapter);
set_link_timer(pmlmeext, REASSOC_TO);
}
@@ -7536,9 +7283,7 @@ u8 join_cmd_hdl(struct adapter *padapter, u8 *pbuf)
default:
pmlmeext->cur_ch_offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE;
break;
- }
-
- DBG_88E("set ch/bw before connected\n");
+ }
}
}
break;
@@ -7791,24 +7536,15 @@ u8 set_stakey_hdl(struct adapter *padapter, u8 *pbuf)
if (psta) {
ctrl = (BIT(15) | ((pparm->algorithm) << 2));

- DBG_88E("r871x_set_stakey_hdl(): enc_algorithm=%d\n", pparm->algorithm);
-
- if ((psta->mac_id < 1) || (psta->mac_id > (NUM_STA - 4))) {
- DBG_88E("r871x_set_stakey_hdl():set_stakey failed, mac_id(aid)=%d\n", psta->mac_id);
+ if ((psta->mac_id < 1) || (psta->mac_id > (NUM_STA - 4)))
return H2C_REJECTED;
- }

cam_id = (psta->mac_id + 3);/* 0~3 for default key, cmd_id = macid + 3, macid = aid+1; */

- DBG_88E("Write CAM, mac_addr =%x:%x:%x:%x:%x:%x, cam_entry=%d\n", pparm->addr[0],
- pparm->addr[1], pparm->addr[2], pparm->addr[3], pparm->addr[4],
- pparm->addr[5], cam_id);
-
write_cam(padapter, cam_id, ctrl, pparm->addr, pparm->key);

return H2C_SUCCESS_RSP;
} else {
- DBG_88E("r871x_set_stakey_hdl(): sta has been free\n");
return H2C_REJECTED;
}
}
@@ -7932,7 +7668,6 @@ u8 h2c_msg_hdl(struct adapter *padapter, unsigned char *pbuf)
u8 tx_beacon_hdl(struct adapter *padapter, unsigned char *pbuf)
{
if (send_beacon(padapter) == _FAIL) {
- DBG_88E("issue_beacon, fail!\n");
return H2C_PARAMETERS_ERROR;
} else {
/* tx bc/mc frames after update TIM */
@@ -7991,10 +7726,6 @@ u8 set_ch_hdl(struct adapter *padapter, u8 *pbuf)

set_ch_parm = (struct set_ch_parm *)pbuf;

- DBG_88E(FUNC_NDEV_FMT" ch:%u, bw:%u, ch_offset:%u\n",
- FUNC_NDEV_ARG(padapter->pnetdev),
- set_ch_parm->ch, set_ch_parm->bw, set_ch_parm->ch_offset);
-
pmlmeext->cur_channel = set_ch_parm->ch;
pmlmeext->cur_ch_offset = set_ch_parm->ch_offset;
pmlmeext->cur_bwmode = set_ch_parm->bw;
--
2.34.1

2022-01-25 08:48:40

by Phillip Potter

[permalink] [raw]
Subject: [PATCH 10/10] staging: r8188eu: remove GlobalDebugLevel flag

Remove hal/odm_debug.c, to get rid of the GlobalDebugLevel flag,
and remove the two other lines that reference GlobalDebugLevel, as
the last remaining user (DBG_88E) is now gone. Also modify Makefile
to no longer build hal/odm_debug.c.

Signed-off-by: Phillip Potter <[email protected]>
---
drivers/staging/r8188eu/Makefile | 1 -
drivers/staging/r8188eu/hal/odm_debug.c | 6 ------
drivers/staging/r8188eu/include/rtw_debug.h | 2 --
drivers/staging/r8188eu/os_dep/os_intfs.c | 1 -
4 files changed, 10 deletions(-)
delete mode 100644 drivers/staging/r8188eu/hal/odm_debug.c

diff --git a/drivers/staging/r8188eu/Makefile b/drivers/staging/r8188eu/Makefile
index a7a486cc16dd..ecd6fe5bd94c 100644
--- a/drivers/staging/r8188eu/Makefile
+++ b/drivers/staging/r8188eu/Makefile
@@ -10,7 +10,6 @@ r8188eu-y = \
hal/hal_intf.o \
hal/hal_com.o \
hal/odm.o \
- hal/odm_debug.o \
hal/odm_HWConfig.o \
hal/odm_RegConfig8188E.o \
hal/odm_RTL8188E.o \
diff --git a/drivers/staging/r8188eu/hal/odm_debug.c b/drivers/staging/r8188eu/hal/odm_debug.c
deleted file mode 100644
index 7a134229fe39..000000000000
--- a/drivers/staging/r8188eu/hal/odm_debug.c
+++ /dev/null
@@ -1,6 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/* Copyright(c) 2007 - 2011 Realtek Corporation. */
-
-#include "../include/rtw_debug.h"
-
-u32 GlobalDebugLevel;
diff --git a/drivers/staging/r8188eu/include/rtw_debug.h b/drivers/staging/r8188eu/include/rtw_debug.h
index 959fb6bd25ca..01a7d987d6cc 100644
--- a/drivers/staging/r8188eu/include/rtw_debug.h
+++ b/drivers/staging/r8188eu/include/rtw_debug.h
@@ -52,6 +52,4 @@

#define DRIVER_PREFIX "R8188EU: "

-extern u32 GlobalDebugLevel;
-
#endif /* __RTW_DEBUG_H__ */
diff --git a/drivers/staging/r8188eu/os_dep/os_intfs.c b/drivers/staging/r8188eu/os_dep/os_intfs.c
index 17249b4fb7ad..8589de487289 100644
--- a/drivers/staging/r8188eu/os_dep/os_intfs.c
+++ b/drivers/staging/r8188eu/os_dep/os_intfs.c
@@ -155,7 +155,6 @@ static uint loadparam(struct adapter *padapter)
{
struct registry_priv *registry_par = &padapter->registrypriv;

- GlobalDebugLevel = rtw_debug;
registry_par->chip_version = (u8)rtw_chip_version;
registry_par->rfintfs = (u8)rtw_rfintfs;
registry_par->lbkmode = (u8)rtw_lbkmode;
--
2.34.1

2022-01-25 08:48:54

by Phillip Potter

[permalink] [raw]
Subject: [PATCH 08/10] staging: r8188eu: remove all remaining aliased DBG_88E calls

Remove all remaining calls to preprocessor aliases of DBG_88E, as well
as these definitions themselves, so that we can finally remove DBG_88E.
This patch triggers several style related checkpatch warnings due to
line lengths, placement of constants and '+' operators being too
squished together. As these are pre-existing issues, they are better
solved with a separate patch series that is more in scope.

Signed-off-by: Phillip Potter <[email protected]>
---
drivers/staging/r8188eu/core/rtw_br_ext.c | 59 +++-----------------
drivers/staging/r8188eu/core/rtw_xmit.c | 22 ++------
drivers/staging/r8188eu/include/rtw_br_ext.h | 5 --
3 files changed, 13 insertions(+), 73 deletions(-)

diff --git a/drivers/staging/r8188eu/core/rtw_br_ext.c b/drivers/staging/r8188eu/core/rtw_br_ext.c
index 4951f835feaf..5516d35b2c36 100644
--- a/drivers/staging/r8188eu/core/rtw_br_ext.c
+++ b/drivers/staging/r8188eu/core/rtw_br_ext.c
@@ -71,10 +71,8 @@ static int __nat25_add_pppoe_tag(struct sk_buff *skb, struct pppoe_tag *tag)
int data_len;

data_len = tag->tag_len + TAG_HDR_LEN;
- if (skb_tailroom(skb) < data_len) {
- _DEBUG_ERR("skb_tailroom() failed in add SID tag!\n");
+ if (skb_tailroom(skb) < data_len)
return -1;
- }

skb_put(skb, data_len);
/* have a room for new tag */
@@ -163,9 +161,6 @@ static int update_nd_link_layer_addr(unsigned char *data, int len, unsigned char
if (len >= 8) {
mac = scan_tlv(&data[8], len-8, 1, 1);
if (mac) {
- _DEBUG_INFO("Router Solicitation, replace MAC From: %02x:%02x:%02x:%02x:%02x:%02x, To: %02x:%02x:%02x:%02x:%02x:%02x\n",
- mac[0], mac[1], mac[2], mac[3], mac[4], mac[5],
- replace_mac[0], replace_mac[1], replace_mac[2], replace_mac[3], replace_mac[4], replace_mac[5]);
memcpy(mac, replace_mac, 6);
return 1;
}
@@ -174,9 +169,6 @@ static int update_nd_link_layer_addr(unsigned char *data, int len, unsigned char
if (len >= 16) {
mac = scan_tlv(&data[16], len-16, 1, 1);
if (mac) {
- _DEBUG_INFO("Router Advertisement, replace MAC From: %02x:%02x:%02x:%02x:%02x:%02x, To: %02x:%02x:%02x:%02x:%02x:%02x\n",
- mac[0], mac[1], mac[2], mac[3], mac[4], mac[5],
- replace_mac[0], replace_mac[1], replace_mac[2], replace_mac[3], replace_mac[4], replace_mac[5]);
memcpy(mac, replace_mac, 6);
return 1;
}
@@ -185,9 +177,6 @@ static int update_nd_link_layer_addr(unsigned char *data, int len, unsigned char
if (len >= 24) {
mac = scan_tlv(&data[24], len-24, 1, 1);
if (mac) {
- _DEBUG_INFO("Neighbor Solicitation, replace MAC From: %02x:%02x:%02x:%02x:%02x:%02x, To: %02x:%02x:%02x:%02x:%02x:%02x\n",
- mac[0], mac[1], mac[2], mac[3], mac[4], mac[5],
- replace_mac[0], replace_mac[1], replace_mac[2], replace_mac[3], replace_mac[4], replace_mac[5]);
memcpy(mac, replace_mac, 6);
return 1;
}
@@ -196,9 +185,6 @@ static int update_nd_link_layer_addr(unsigned char *data, int len, unsigned char
if (len >= 24) {
mac = scan_tlv(&data[24], len-24, 2, 1);
if (mac) {
- _DEBUG_INFO("Neighbor Advertisement, replace MAC From: %02x:%02x:%02x:%02x:%02x:%02x, To: %02x:%02x:%02x:%02x:%02x:%02x\n",
- mac[0], mac[1], mac[2], mac[3], mac[4], mac[5],
- replace_mac[0], replace_mac[1], replace_mac[2], replace_mac[3], replace_mac[4], replace_mac[5]);
memcpy(mac, replace_mac, 6);
return 1;
}
@@ -207,9 +193,6 @@ static int update_nd_link_layer_addr(unsigned char *data, int len, unsigned char
if (len >= 40) {
mac = scan_tlv(&data[40], len-40, 2, 1);
if (mac) {
- _DEBUG_INFO("Redirect, replace MAC From: %02x:%02x:%02x:%02x:%02x:%02x, To: %02x:%02x:%02x:%02x:%02x:%02x\n",
- mac[0], mac[1], mac[2], mac[3], mac[4], mac[5],
- replace_mac[0], replace_mac[1], replace_mac[2], replace_mac[3], replace_mac[4], replace_mac[5]);
memcpy(mac, replace_mac, 6);
return 1;
}
@@ -404,10 +387,8 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method)
if (protocol == ETH_P_IP) {
struct iphdr *iph = (struct iphdr *)(skb->data + ETH_HLEN);

- if (((unsigned char *)(iph) + (iph->ihl<<2)) >= (skb->data + ETH_HLEN + skb->len)) {
- DEBUG_WARN("NAT25: malformed IP packet !\n");
+ if (((unsigned char *)(iph) + (iph->ihl<<2)) >= (skb->data + ETH_HLEN + skb->len))
return -1;
- }

switch (method) {
case NAT25_CHECK:
@@ -418,7 +399,6 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method)
if (iph->saddr == 0)
return 0;
tmp = be32_to_cpu(iph->saddr);
- DEBUG_INFO("NAT25: Insert IP, SA =%08x, DA =%08x\n", tmp, iph->daddr);
__nat25_generate_ipv4_network_addr(networkAddr, &tmp);
/* record source IP address and , source mac address into db */
__nat25_db_network_insert(priv, skb->data+ETH_ALEN, networkAddr);
@@ -436,18 +416,13 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method)
unsigned char *arp_ptr = (unsigned char *)(arp + 1);
unsigned int *sender;

- if (arp->ar_pro != __constant_htons(ETH_P_IP)) {
- DEBUG_WARN("NAT25: arp protocol unknown (%4x)!\n", be16_to_cpu(arp->ar_pro));
+ if (arp->ar_pro != __constant_htons(ETH_P_IP))
return -1;
- }

switch (method) {
case NAT25_CHECK:
return 0; /* skb_copy for all ARP frame */
case NAT25_INSERT:
- DEBUG_INFO("NAT25: Insert ARP, MAC =%02x%02x%02x%02x%02x%02x\n", arp_ptr[0],
- arp_ptr[1], arp_ptr[2], arp_ptr[3], arp_ptr[4], arp_ptr[5]);
-
/* change to ARP sender mac address to wlan STA address */
memcpy(arp_ptr, GET_MY_HWADDR(priv), ETH_ALEN);
arp_ptr += arp->ar_hln;
@@ -484,18 +459,14 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method)
pOldTag = (struct pppoe_tag *)__nat25_find_pppoe_tag(ph, ntohs(PTT_RELAY_SID));
if (pOldTag) { /* if SID existed, copy old value and delete it */
old_tag_len = ntohs(pOldTag->tag_len);
- if (old_tag_len+TAG_HDR_LEN+MAGIC_CODE_LEN+RTL_RELAY_TAG_LEN > sizeof(tag_buf)) {
- DEBUG_ERR("SID tag length too long!\n");
+ if (old_tag_len+TAG_HDR_LEN+MAGIC_CODE_LEN+RTL_RELAY_TAG_LEN > sizeof(tag_buf))
return -1;
- }

memcpy(tag->tag_data+MAGIC_CODE_LEN+RTL_RELAY_TAG_LEN,
pOldTag->tag_data, old_tag_len);

- if (skb_pull_and_merge(skb, (unsigned char *)pOldTag, TAG_HDR_LEN+old_tag_len) < 0) {
- DEBUG_ERR("call skb_pull_and_merge() failed in PADI/R packet!\n");
+ if (skb_pull_and_merge(skb, (unsigned char *)pOldTag, TAG_HDR_LEN+old_tag_len) < 0)
return -1;
- }
ph->length = htons(ntohs(ph->length)-TAG_HDR_LEN-old_tag_len);
}

@@ -511,14 +482,10 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method)
if (__nat25_add_pppoe_tag(skb, tag) < 0)
return -1;

- DEBUG_INFO("NAT25: Insert PPPoE, forward %s packet\n",
- (ph->code == PADI_CODE ? "PADI" : "PADR"));
} else { /* not add relay tag */
if (priv->pppoe_connection_in_progress &&
- memcmp(skb->data+ETH_ALEN, priv->pppoe_addr, ETH_ALEN)) {
- DEBUG_ERR("Discard PPPoE packet due to another PPPoE connection is in progress!\n");
+ memcmp(skb->data+ETH_ALEN, priv->pppoe_addr, ETH_ALEN))
return -2;
- }

if (priv->pppoe_connection_in_progress == 0)
memcpy(priv->pppoe_addr, skb->data+ETH_ALEN, ETH_ALEN);
@@ -529,8 +496,6 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method)
return -1;
}
} else { /* session phase */
- DEBUG_INFO("NAT25: Insert PPPoE, insert session packet to %s\n", skb->dev->name);
-
__nat25_generate_pppoe_network_addr(networkAddr, skb->data, &ph->sid);

__nat25_db_network_insert(priv, skb->data+ETH_ALEN, networkAddr);
@@ -576,10 +541,8 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method)
/*------------------------------------------------*/
struct ipv6hdr *iph = (struct ipv6hdr *)(skb->data + ETH_HLEN);

- if (sizeof(*iph) >= (skb->len - ETH_HLEN)) {
- DEBUG_WARN("NAT25: malformed IPv6 packet !\n");
+ if (sizeof(*iph) >= (skb->len - ETH_HLEN))
return -1;
- }

switch (method) {
case NAT25_CHECK:
@@ -587,13 +550,6 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method)
return 0;
return -1;
case NAT25_INSERT:
- DEBUG_INFO("NAT25: Insert IP, SA =%4x:%4x:%4x:%4x:%4x:%4x:%4x:%4x,"
- " DA =%4x:%4x:%4x:%4x:%4x:%4x:%4x:%4x\n",
- iph->saddr.s6_addr16[0], iph->saddr.s6_addr16[1], iph->saddr.s6_addr16[2], iph->saddr.s6_addr16[3],
- iph->saddr.s6_addr16[4], iph->saddr.s6_addr16[5], iph->saddr.s6_addr16[6], iph->saddr.s6_addr16[7],
- iph->daddr.s6_addr16[0], iph->daddr.s6_addr16[1], iph->daddr.s6_addr16[2], iph->daddr.s6_addr16[3],
- iph->daddr.s6_addr16[4], iph->daddr.s6_addr16[5], iph->daddr.s6_addr16[6], iph->daddr.s6_addr16[7]);
-
if (memcmp(&iph->saddr, "\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0", 16)) {
__nat25_generate_ipv6_network_addr(networkAddr, (unsigned int *)&iph->saddr);
__nat25_db_network_insert(priv, skb->data+ETH_ALEN, networkAddr);
@@ -669,7 +625,6 @@ void dhcp_flag_bcast(struct adapter *priv, struct sk_buff *skb)
/* if not broadcast */
register int sum = 0;

- DEBUG_INFO("DHCP: change flag of DHCP request to broadcast.\n");
/* or BROADCAST flag */
dhcph->flags |= htons(BROADCAST_FLAG);
/* recalculate checksum */
diff --git a/drivers/staging/r8188eu/core/rtw_xmit.c b/drivers/staging/r8188eu/core/rtw_xmit.c
index eebadb0bee5b..ab6d13aba744 100644
--- a/drivers/staging/r8188eu/core/rtw_xmit.c
+++ b/drivers/staging/r8188eu/core/rtw_xmit.c
@@ -1588,10 +1588,8 @@ static int rtw_br_client_tx(struct adapter *padapter, struct sk_buff **pskb)
}

newskb = skb_copy(skb, GFP_ATOMIC);
- if (!newskb) {
- DEBUG_ERR("TX DROP: skb_copy fail!\n");
+ if (!newskb)
return -1;
- }
dev_kfree_skb_any(skb);

*pskb = skb = newskb;
@@ -1603,21 +1601,15 @@ static int rtw_br_client_tx(struct adapter *padapter, struct sk_buff **pskb)
}
}

- if (skb_is_nonlinear(skb))
- DEBUG_ERR("%s(): skb_is_nonlinear!!\n", __func__);
-
res = skb_linearize(skb);
- if (res < 0) {
- DEBUG_ERR("TX DROP: skb_linearize fail!\n");
+ if (res < 0)
return -1;
- }

res = nat25_db_handle(padapter, skb, NAT25_INSERT);
if (res < 0) {
- if (res == -2) {
- DEBUG_ERR("TX DROP: nat25_db_handle fail!\n");
+ if (res == -2)
return -1;
- }
+
return 0;
}
}
@@ -1636,11 +1628,9 @@ static int rtw_br_client_tx(struct adapter *padapter, struct sk_buff **pskb)
}

/* check if SA is equal to our MAC */
- if (memcmp(skb->data + ETH_ALEN, GET_MY_HWADDR(padapter), ETH_ALEN)) {
- DEBUG_ERR("TX DROP: untransformed frame SA:%02X%02X%02X%02X%02X%02X!\n",
- skb->data[6], skb->data[7], skb->data[8], skb->data[9], skb->data[10], skb->data[11]);
+ if (memcmp(skb->data + ETH_ALEN, GET_MY_HWADDR(padapter), ETH_ALEN))
return -1;
- }
+
return 0;
}

diff --git a/drivers/staging/r8188eu/include/rtw_br_ext.h b/drivers/staging/r8188eu/include/rtw_br_ext.h
index 17a6154e760a..56772af3bec5 100644
--- a/drivers/staging/r8188eu/include/rtw_br_ext.h
+++ b/drivers/staging/r8188eu/include/rtw_br_ext.h
@@ -4,11 +4,6 @@
#ifndef _RTW_BR_EXT_H_
#define _RTW_BR_EXT_H_

-#define _DEBUG_ERR DBG_88E
-#define _DEBUG_INFO DBG_88E
-#define DEBUG_WARN DBG_88E
-#define DEBUG_INFO DBG_88E
-#define DEBUG_ERR DBG_88E
#define GET_MY_HWADDR(padapter) ((padapter)->eeprompriv.mac_addr)

#define NAT25_HASH_BITS 4
--
2.34.1

2022-01-25 08:50:31

by Phillip Potter

[permalink] [raw]
Subject: [PATCH 07/10] staging: r8188eu: remove DBG_88E call from include/usb_ops.h

Remove DBG_88E call from include/usb_ops.h, as it does not conform to
kernel coding standards and is superfluous. This will allow the eventual
removal of the DBG_88E macro itself.

Signed-off-by: Phillip Potter <[email protected]>
---
drivers/staging/r8188eu/include/usb_ops.h | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/staging/r8188eu/include/usb_ops.h b/drivers/staging/r8188eu/include/usb_ops.h
index 0a1155bbc7b8..2b1d50d2b2f2 100644
--- a/drivers/staging/r8188eu/include/usb_ops.h
+++ b/drivers/staging/r8188eu/include/usb_ops.h
@@ -30,11 +30,8 @@ static inline int rtw_inc_and_chk_continual_urb_error(struct dvobj_priv *dvobj)
int ret = false;
int value;
value = atomic_inc_return(&dvobj->continual_urb_error);
- if (value > MAX_CONTINUAL_URB_ERR) {
- DBG_88E("[dvobj:%p][ERROR] continual_urb_error:%d > %d\n",
- dvobj, value, MAX_CONTINUAL_URB_ERR);
+ if (value > MAX_CONTINUAL_URB_ERR)
ret = true;
- }
return ret;
}

--
2.34.1

2022-01-25 08:50:41

by Phillip Potter

[permalink] [raw]
Subject: [PATCH 04/10] staging: r8188eu: remove all DBG_88E calls from hal dir

Remove all DBG_88E calls from the hal directory. These calls do not
conform to kernel coding standards and are superfluous. Also restructure
where appropriate to remove no longer needed code left behind by removal
of these calls. This will allow the eventual removal of the DBG_88E macro
itself.

Signed-off-by: Phillip Potter <[email protected]>
---
drivers/staging/r8188eu/hal/HalPwrSeqCmd.c | 4 +-
drivers/staging/r8188eu/hal/hal_intf.c | 3 -
drivers/staging/r8188eu/hal/rtl8188e_cmd.c | 43 ++-------
.../staging/r8188eu/hal/rtl8188e_hal_init.c | 94 ++++---------------
drivers/staging/r8188eu/hal/rtl8188e_phycfg.c | 3 -
drivers/staging/r8188eu/hal/rtl8188eu_recv.c | 5 -
drivers/staging/r8188eu/hal/rtl8188eu_xmit.c | 8 +-
drivers/staging/r8188eu/hal/usb_halinit.c | 62 +-----------
drivers/staging/r8188eu/hal/usb_ops_linux.c | 31 +-----
9 files changed, 33 insertions(+), 220 deletions(-)

diff --git a/drivers/staging/r8188eu/hal/HalPwrSeqCmd.c b/drivers/staging/r8188eu/hal/HalPwrSeqCmd.c
index 47ad4ea273cc..5b91aec6a7e3 100644
--- a/drivers/staging/r8188eu/hal/HalPwrSeqCmd.c
+++ b/drivers/staging/r8188eu/hal/HalPwrSeqCmd.c
@@ -63,10 +63,8 @@ u8 HalPwrSeqCmdParsing(struct adapter *padapter, struct wl_pwr_cfg pwrseqcmd[])
else
udelay(10);

- if (poll_count++ > max_poll_count) {
- DBG_88E("Fail to polling Offset[%#x]\n", offset);
+ if (poll_count++ > max_poll_count)
return false;
- }
} while (!poll_bit);
break;
case PWR_CMD_DELAY:
diff --git a/drivers/staging/r8188eu/hal/hal_intf.c b/drivers/staging/r8188eu/hal/hal_intf.c
index fee3a598b59d..37935aef71ea 100644
--- a/drivers/staging/r8188eu/hal/hal_intf.c
+++ b/drivers/staging/r8188eu/hal/hal_intf.c
@@ -21,7 +21,6 @@ uint rtw_hal_init(struct adapter *adapt)
hal_notch_filter_8188e(adapt, 1);
} else {
adapt->hw_init_completed = false;
- DBG_88E("rtw_hal_init: hal__init fail\n");
}

return status;
@@ -35,8 +34,6 @@ uint rtw_hal_deinit(struct adapter *adapt)

if (status == _SUCCESS)
adapt->hw_init_completed = false;
- else
- DBG_88E("\n rtw_hal_deinit: hal_init fail\n");

return status;
}
diff --git a/drivers/staging/r8188eu/hal/rtl8188e_cmd.c b/drivers/staging/r8188eu/hal/rtl8188e_cmd.c
index a491c37777df..ba5421daf56d 100644
--- a/drivers/staging/r8188eu/hal/rtl8188e_cmd.c
+++ b/drivers/staging/r8188eu/hal/rtl8188e_cmd.c
@@ -54,10 +54,8 @@ static s32 FillH2CCmd_88E(struct adapter *adapt, u8 ElementID, u32 CmdLen, u8 *p
u32 h2c_cmd = 0;
u32 h2c_cmd_ex = 0;

- if (!adapt->bFWReady) {
- DBG_88E("FillH2CCmd_88E(): return H2C cmd because fw is not ready\n");
+ if (!adapt->bFWReady)
return _FAIL;
- }

if (!pCmdBuffer || CmdLen > RTL88E_MAX_CMD_LEN || adapt->bSurpriseRemoved)
return _FAIL;
@@ -66,10 +64,8 @@ static s32 FillH2CCmd_88E(struct adapter *adapt, u8 ElementID, u32 CmdLen, u8 *p
do {
h2c_box_num = haldata->LastHMEBoxNum;

- if (!_is_fw_read_cmd_down(adapt, h2c_box_num)) {
- DBG_88E(" fw read cmd failed...\n");
+ if (!_is_fw_read_cmd_down(adapt, h2c_box_num))
return _FAIL;
- }

*(u8 *)(&h2c_cmd) = ElementID;

@@ -115,7 +111,6 @@ u8 rtl8188e_set_raid_cmd(struct adapter *adapt, u32 mask)

FillH2CCmd_88E(adapt, H2C_DM_MACID_CFG, 3, buf);
} else {
- DBG_88E("==>%s fw dont support RA\n", __func__);
res = _FAIL;
}

@@ -157,9 +152,6 @@ void rtl8188e_set_FwPwrMode_cmd(struct adapter *adapt, u8 Mode)
struct pwrctrl_priv *pwrpriv = &adapt->pwrctrlpriv;
u8 RLBM = 0; /* 0:Min, 1:Max, 2:User define */

- DBG_88E("%s: Mode=%d SmartPS=%d UAPSD=%d\n", __func__,
- Mode, pwrpriv->smart_ps, adapt->registrypriv.uapsd_enable);
-
switch (Mode) {
case PS_MODE_ACTIVE:
H2CSetPwrMode.Mode = 0;
@@ -205,7 +197,6 @@ void rtl8188e_set_FwMediaStatus_cmd(struct adapter *adapt, __le16 mstatus_rpt)
opmode = (u8)mst_rpt;
macid = (u8)(mst_rpt >> 8);

- DBG_88E("### %s: MStatus=%x MACID=%d\n", __func__, opmode, macid);
FillH2CCmd_88E(adapt, H2C_COM_MEDIA_STATUS_RPT, sizeof(mst_rpt), (u8 *)&mst_rpt);
}

@@ -285,10 +276,8 @@ static void ConstructBeacon(struct adapter *adapt, u8 *pframe, u32 *pLength)

_ConstructBeacon:

- if ((pktlen + TXDESC_SIZE) > 512) {
- DBG_88E("beacon frame too large\n");
+ if ((pktlen + TXDESC_SIZE) > 512)
return;
- }

*pLength = pktlen;
}
@@ -453,12 +442,9 @@ static void SetFwRsvdPagePkt(struct adapter *adapt, bool bDLFinished)
u32 TotalPacketLen;
struct rsvdpage_loc RsvdPageLoc;

- DBG_88E("%s\n", __func__);
ReservedPagePacket = kzalloc(1000, GFP_KERNEL);
- if (!ReservedPagePacket) {
- DBG_88E("%s: alloc ReservedPagePacket fail!\n", __func__);
+ if (!ReservedPagePacket)
return;
- }

pxmitpriv = &adapt->xmitpriv;
pmlmeext = &adapt->mlmeextpriv;
@@ -535,7 +521,6 @@ static void SetFwRsvdPagePkt(struct adapter *adapt, bool bDLFinished)

rtl8188eu_mgnt_xmit(adapt, pmgntframe);

- DBG_88E("%s: Set RSVD page location to Fw\n", __func__);
FillH2CCmd_88E(adapt, H2C_COM_RSVD_PAGE, sizeof(RsvdPageLoc), (u8 *)&RsvdPageLoc);

exit:
@@ -552,8 +537,6 @@ void rtl8188e_set_FwJoinBssReport_cmd(struct adapter *adapt, u8 mstatus)
u8 DLBcnCount = 0;
u32 poll = 0;

- DBG_88E("%s mstatus(%x)\n", __func__, mstatus);
-
if (mstatus == 1) {
/* We should set AID, correct TSF, HW seq enable before set JoinBssReport to Fw in 88/92C. */
/* Suggested by filen. Added by tynli. */
@@ -570,10 +553,8 @@ void rtl8188e_set_FwJoinBssReport_cmd(struct adapter *adapt, u8 mstatus)
rtw_write8(adapt, REG_BCN_CTRL, rtw_read8(adapt, REG_BCN_CTRL) & (~BIT(3)));
rtw_write8(adapt, REG_BCN_CTRL, rtw_read8(adapt, REG_BCN_CTRL) | BIT(4));

- if (haldata->RegFwHwTxQCtrl & BIT(6)) {
- DBG_88E("HalDownloadRSVDPage(): There is an Adapter is sending beacon.\n");
+ if (haldata->RegFwHwTxQCtrl & BIT(6))
bSendBeacon = true;
- }

/* Set FWHW_TXQ_CTRL 0x422[6]=0 to tell Hw the packet is not a real beacon frame. */
rtw_write8(adapt, REG_FWHW_TXQ_CTRL + 2, (haldata->RegFwHwTxQCtrl & (~BIT(6))));
@@ -596,12 +577,6 @@ void rtl8188e_set_FwJoinBssReport_cmd(struct adapter *adapt, u8 mstatus)
} while (!bcn_valid && (poll % 10) != 0 && !adapt->bSurpriseRemoved && !adapt->bDriverStopped);
} while (!bcn_valid && DLBcnCount <= 100 && !adapt->bSurpriseRemoved && !adapt->bDriverStopped);

- if (adapt->bSurpriseRemoved || adapt->bDriverStopped)
- ;
- else if (!bcn_valid)
- DBG_88E("%s: 1 Download RSVD page failed! DLBcnCount:%u, poll:%u\n", __func__, DLBcnCount, poll);
- else
- DBG_88E("%s: 1 Download RSVD success! DLBcnCount:%u, poll:%u\n", __func__, DLBcnCount, poll);
/* */
/* We just can send the reserved page twice during the time that Tx thread is stopped (e.g. pnpsetpower) */
/* because we need to free the Tx BCN Desc which is used by the first reserved page packet. */
@@ -624,10 +599,8 @@ void rtl8188e_set_FwJoinBssReport_cmd(struct adapter *adapt, u8 mstatus)
}

/* Update RSVD page location H2C to Fw. */
- if (bcn_valid) {
+ if (bcn_valid)
SetHwReg8188EU(adapt, HW_VAR_BCN_VALID, NULL);
- DBG_88E("Set RSVD page location to Fw.\n");
- }

/* Do not enable HW DMA BCN or it will cause Pcie interface hang by timing issue. 2011.11.24. by tynli. */
/* Clear CR[8] or beacon packet will not be send to TxBuf anymore. */
@@ -646,11 +619,9 @@ void rtl8188e_set_p2p_ps_offload_cmd(struct adapter *adapt, u8 p2p_ps_state)

switch (p2p_ps_state) {
case P2P_PS_DISABLE:
- DBG_88E("P2P_PS_DISABLE\n");
memset(p2p_ps_offload, 0, 1);
break;
case P2P_PS_ENABLE:
- DBG_88E("P2P_PS_ENABLE\n");
/* update CTWindow value. */
if (pwdinfo->ctwindow > 0) {
p2p_ps_offload->CTWindow_En = 1;
@@ -690,11 +661,9 @@ void rtl8188e_set_p2p_ps_offload_cmd(struct adapter *adapt, u8 p2p_ps_state)
}
break;
case P2P_PS_SCAN:
- DBG_88E("P2P_PS_SCAN\n");
p2p_ps_offload->discovery = 1;
break;
case P2P_PS_SCAN_DONE:
- DBG_88E("P2P_PS_SCAN_DONE\n");
p2p_ps_offload->discovery = 0;
pwdinfo->p2p_ps_state = P2P_PS_ENABLE;
break;
diff --git a/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c b/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c
index b2d1e8c50543..f8b5f09a7fd1 100644
--- a/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c
+++ b/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c
@@ -19,10 +19,8 @@ static void iol_mode_enable(struct adapter *padapter, u8 enable)
reg_0xf0 = rtw_read8(padapter, REG_SYS_CFG);
rtw_write8(padapter, REG_SYS_CFG, reg_0xf0 | SW_OFFLOAD_EN);

- if (!padapter->bFWReady) {
- DBG_88E("bFWReady == false call reset 8051...\n");
+ if (!padapter->bFWReady)
_8051Reset88E(padapter);
- }

} else {
/* disable initial offload */
@@ -77,16 +75,12 @@ efuse_phymap_to_logical(u8 *phymap, u16 _offset, u16 _size_byte, u8 *pbuf)
u8 u1temp = 0;

efuseTbl = kzalloc(EFUSE_MAP_LEN_88E, GFP_KERNEL);
- if (!efuseTbl) {
- DBG_88E("%s: alloc efuseTbl fail!\n", __func__);
+ if (!efuseTbl)
goto exit;
- }

eFuseWord = rtw_malloc2d(EFUSE_MAX_SECTION_88E, EFUSE_MAX_WORD_UNIT, sizeof(u16));
- if (!eFuseWord) {
- DBG_88E("%s: alloc eFuseWord fail!\n", __func__);
+ if (!eFuseWord)
goto exit;
- }

/* 0. Refresh efuse init map as all oxFF. */
for (i = 0; i < EFUSE_MAX_SECTION_88E; i++)
@@ -102,7 +96,6 @@ efuse_phymap_to_logical(u8 *phymap, u16 _offset, u16 _size_byte, u8 *pbuf)
efuse_utilized++;
eFuse_Addr++;
} else {
- DBG_88E("EFUSE is empty efuse_Addr-%d efuse_data =%x\n", eFuse_Addr, rtemp8);
goto exit;
}

@@ -207,8 +200,6 @@ static void efuse_read_phymap_from_txpktbuf(
if (bcnhead < 0) /* if not valid */
bcnhead = rtw_read8(adapter, REG_TDECTRL + 1);

- DBG_88E("%s bcnhead:%d\n", __func__, bcnhead);
-
rtw_write8(adapter, REG_PKT_BUFF_ACCESS_CTRL, TXPKT_BUF_SELECT);

dbg_addr = bcnhead * 128 / 8; /* 8-bytes addressing */
@@ -220,7 +211,6 @@ static void efuse_read_phymap_from_txpktbuf(
start = jiffies;
while (!(reg_0x143 = rtw_read8(adapter, REG_TXPKTBUF_DBG)) &&
(passing_time = rtw_get_passing_time_ms(start)) < 1000) {
- DBG_88E("%s polling reg_0x143:0x%02x, reg_0x106:0x%02x\n", __func__, reg_0x143, rtw_read8(adapter, 0x106));
rtw_usleep_os(100);
}

@@ -229,18 +219,15 @@ static void efuse_read_phymap_from_txpktbuf(
hi32 = cpu_to_le32(rtw_read32(adapter, REG_PKTBUF_DBG_DATA_H));

if (i == 0) {
- /* Although lenc is only used in a debug statement,
- * do not remove it as the rtw_read16() call consumes
+ /* Do not remove this as the rtw_read16() call consumes
* 2 bytes from the EEPROM source.
*/
- u16 lenc = rtw_read16(adapter, REG_PKTBUF_DBG_DATA_L);
+ rtw_read16(adapter, REG_PKTBUF_DBG_DATA_L);

len = le32_to_cpu(lo32) & 0x0000ffff;

limit = (len - 2 < limit) ? len - 2 : limit;

- DBG_88E("%s len:%u, lenc:%u\n", __func__, len, lenc);
-
memcpy(pos, ((u8 *)&lo32) + 2, (limit >= count + 2) ? 2 : limit - count);
count += (limit >= count + 2) ? 2 : limit - count;
pos = content + count;
@@ -261,7 +248,6 @@ static void efuse_read_phymap_from_txpktbuf(
i++;
}
rtw_write8(adapter, REG_PKT_BUFF_ACCESS_CTRL, DISABLE_TRXPKT_BUF_ACCESS);
- DBG_88E("%s read count:%u\n", __func__, count);
*size = count;
}

@@ -285,7 +271,6 @@ s32 rtl8188e_iol_efuse_patch(struct adapter *padapter)
{
s32 result = _SUCCESS;

- DBG_88E("==> %s\n", __func__);
if (rtw_IOL_applied(padapter)) {
iol_mode_enable(padapter, 1);
result = iol_execute(padapter, CMD_READ_EFUSE_MAP);
@@ -465,7 +450,6 @@ void _8051Reset88E(struct adapter *padapter)
u1bTmp = rtw_read8(padapter, REG_SYS_FUNC_EN + 1);
rtw_write8(padapter, REG_SYS_FUNC_EN + 1, u1bTmp & (~BIT(2)));
rtw_write8(padapter, REG_SYS_FUNC_EN + 1, u1bTmp | (BIT(2)));
- DBG_88E("=====> _8051Reset88E(): 8051 reset success .\n");
}

static s32 _FWFreeToGo(struct adapter *padapter)
@@ -480,11 +464,8 @@ static s32 _FWFreeToGo(struct adapter *padapter)
break;
} while (counter++ < POLLING_READY_TIMEOUT_COUNT);

- if (counter >= POLLING_READY_TIMEOUT_COUNT) {
- DBG_88E("%s: chksum report fail! REG_MCUFWDL:0x%08x\n", __func__, value32);
+ if (counter >= POLLING_READY_TIMEOUT_COUNT)
return _FAIL;
- }
- DBG_88E("%s: Checksum report OK! REG_MCUFWDL:0x%08x\n", __func__, value32);

value32 = rtw_read32(padapter, REG_MCUFWDL);
value32 |= MCUFWDL_RDY;
@@ -497,14 +478,11 @@ static s32 _FWFreeToGo(struct adapter *padapter)
counter = 0;
do {
value32 = rtw_read32(padapter, REG_MCUFWDL);
- if (value32 & WINTINI_RDY) {
- DBG_88E("%s: Polling FW ready success!! REG_MCUFWDL:0x%08x\n", __func__, value32);
+ if (value32 & WINTINI_RDY)
return _SUCCESS;
- }
udelay(5);
} while (counter++ < POLLING_READY_TIMEOUT_COUNT);

- DBG_88E("%s: Polling FW ready fail!! REG_MCUFWDL:0x%08x\n", __func__, value32);
return _FAIL;
}

@@ -602,22 +580,14 @@ s32 rtl8188e_FirmwareDownload(struct adapter *padapter)
if (rtStatus == _SUCCESS ||
(rtw_get_passing_time_ms(fwdl_start_time) > 500 && writeFW_retry++ >= 3))
break;
-
- DBG_88E("%s writeFW_retry:%u, time after fwdl_start_time:%ums\n",
- __func__, writeFW_retry, rtw_get_passing_time_ms(fwdl_start_time)
- );
}
_FWDownloadEnable(padapter, false);
- if (_SUCCESS != rtStatus) {
- DBG_88E("DL Firmware failed!\n");
+ if (rtStatus != _SUCCESS)
goto Exit;
- }

rtStatus = _FWFreeToGo(padapter);
- if (_SUCCESS != rtStatus) {
- DBG_88E("DL Firmware failed!\n");
+ if (rtStatus != _SUCCESS)
goto Exit;
- }

Exit:
return rtStatus;
@@ -690,22 +660,16 @@ static void Hal_EfuseReadEFuse88E(struct adapter *Adapter,
/* */
/* Do NOT excess total size of EFuse table. Added by Roger, 2008.11.10. */
/* */
- if ((_offset + _size_byte) > EFUSE_MAP_LEN_88E) {/* total E-Fuse table is 512bytes */
- DBG_88E("Hal_EfuseReadEFuse88E(): Invalid offset(%#x) with read bytes(%#x)!!\n", _offset, _size_byte);
+ if ((_offset + _size_byte) > EFUSE_MAP_LEN_88E) /* total E-Fuse table is 512bytes */
goto exit;
- }

efuseTbl = kzalloc(EFUSE_MAP_LEN_88E, GFP_KERNEL);
- if (!efuseTbl) {
- DBG_88E("%s: alloc efuseTbl fail!\n", __func__);
+ if (!efuseTbl)
goto exit;
- }

eFuseWord = rtw_malloc2d(EFUSE_MAX_SECTION_88E, EFUSE_MAX_WORD_UNIT, sizeof(u16));
- if (!eFuseWord) {
- DBG_88E("%s: alloc eFuseWord fail!\n", __func__);
+ if (!eFuseWord)
goto exit;
- }

/* 0. Refresh efuse init map as all oxFF. */
for (i = 0; i < EFUSE_MAX_SECTION_88E; i++)
@@ -721,7 +685,6 @@ static void Hal_EfuseReadEFuse88E(struct adapter *Adapter,
efuse_utilized++;
eFuse_Addr++;
} else {
- DBG_88E("EFUSE is empty efuse_Addr-%d efuse_data =%x\n", eFuse_Addr, *rtemp8);
goto exit;
}

@@ -851,24 +814,19 @@ void rtl8188e_SetHalODMVar(struct adapter *Adapter, void *pValue1, bool bSet)
struct sta_info *psta = (struct sta_info *)pValue1;

if (bSet) {
- DBG_88E("### Set STA_(%d) info\n", psta->mac_id);
podmpriv->pODM_StaInfo[psta->mac_id] = psta;
ODM_RAInfo_Init(podmpriv, psta->mac_id);
} else {
- DBG_88E("### Clean STA_(%d) info\n", psta->mac_id);
podmpriv->pODM_StaInfo[psta->mac_id] = NULL;
}
}

void hal_notch_filter_8188e(struct adapter *adapter, bool enable)
{
- if (enable) {
- DBG_88E("Enable notch filter\n");
+ if (enable)
rtw_write8(adapter, rOFDM0_RxDSP + 1, rtw_read8(adapter, rOFDM0_RxDSP + 1) | BIT(1));
- } else {
- DBG_88E("Disable notch filter\n");
+ else
rtw_write8(adapter, rOFDM0_RxDSP + 1, rtw_read8(adapter, rOFDM0_RxDSP + 1) & ~BIT(1));
- }
}

u8 GetEEPROMSize8188E(struct adapter *padapter)
@@ -1092,20 +1050,14 @@ static void hal_get_chnl_group_88e(u8 chnl, u8 *group)

void Hal_ReadPowerSavingMode88E(struct adapter *padapter, u8 *hwinfo, bool AutoLoadFail)
{
- if (AutoLoadFail) {
+ if (AutoLoadFail)
padapter->pwrctrlpriv.bSupportRemoteWakeup = false;
- } else {
+ else
/* hw power down mode selection , 0:rf-off / 1:power down */

/* decide hw if support remote wakeup function */
/* if hw supported, 8051 (SIE) will generate WeakUP signal(D+/D- toggle) when autoresume */
padapter->pwrctrlpriv.bSupportRemoteWakeup = (hwinfo[EEPROM_USB_OPTIONAL_FUNCTION0] & BIT(1)) ? true : false;
-
- DBG_88E("%s , bSupportRemoteWakeup(%x)\n", __func__,
- padapter->pwrctrlpriv.bSupportRemoteWakeup);
-
- DBG_88E("### PS params => power_mgnt(%x), usbss_enable(%x) ###\n", padapter->registrypriv.power_mgnt, padapter->registrypriv.usbss_enable);
- }
}

void Hal_ReadTxPowerInfo88E(struct adapter *padapter, u8 *PROMContent, bool AutoLoadFail)
@@ -1125,17 +1077,10 @@ void Hal_ReadTxPowerInfo88E(struct adapter *padapter, u8 *PROMContent, bool Auto
pHalData->Index24G_BW40_Base[ch] = pwrInfo24G.IndexBW40_Base[0][4];
else
pHalData->Index24G_BW40_Base[ch] = pwrInfo24G.IndexBW40_Base[0][group];
-
- DBG_88E("======= Path 0, Channel %d =======\n", ch);
- DBG_88E("Index24G_CCK_Base[%d] = 0x%x\n", ch, pHalData->Index24G_CCK_Base[ch]);
- DBG_88E("Index24G_BW40_Base[%d] = 0x%x\n", ch, pHalData->Index24G_BW40_Base[ch]);
}
for (TxCount = 0; TxCount < MAX_TX_COUNT; TxCount++) {
pHalData->OFDM_24G_Diff[TxCount] = pwrInfo24G.OFDM_Diff[0][TxCount];
pHalData->BW20_24G_Diff[TxCount] = pwrInfo24G.BW20_Diff[0][TxCount];
- DBG_88E("======= TxCount %d =======\n", TxCount);
- DBG_88E("OFDM_24G_Diff[%d] = %d\n", TxCount, pHalData->OFDM_24G_Diff[TxCount]);
- DBG_88E("BW20_24G_Diff[%d] = %d\n", TxCount, pHalData->BW20_24G_Diff[TxCount]);
}

/* 2010/10/19 MH Add Regulator recognize for CU. */
@@ -1146,7 +1091,6 @@ void Hal_ReadTxPowerInfo88E(struct adapter *padapter, u8 *PROMContent, bool Auto
} else {
pHalData->EEPROMRegulatory = 0;
}
- DBG_88E("EEPROMRegulatory = 0x%x\n", pHalData->EEPROMRegulatory);
}

void Hal_EfuseParseXtal_8188E(struct adapter *pAdapter, u8 *hwinfo, bool AutoLoadFail)
@@ -1160,7 +1104,6 @@ void Hal_EfuseParseXtal_8188E(struct adapter *pAdapter, u8 *hwinfo, bool AutoLoa
} else {
pHalData->CrystalCap = EEPROM_Default_CrystalCap_88E;
}
- DBG_88E("CrystalCap: 0x%2x\n", pHalData->CrystalCap);
}

void rtl8188e_EfuseParseChnlPlan(struct adapter *padapter, u8 *hwinfo, bool AutoLoadFail)
@@ -1170,8 +1113,6 @@ void rtl8188e_EfuseParseChnlPlan(struct adapter *padapter, u8 *hwinfo, bool Auto
hwinfo ? hwinfo[EEPROM_ChannelPlan_88E] : 0xFF,
padapter->registrypriv.channel_plan,
RT_CHANNEL_DOMAIN_WORLD_WIDE_13, AutoLoadFail);
-
- DBG_88E("mlmepriv.ChannelPlan = 0x%02x\n", padapter->mlmepriv.ChannelPlan);
}

void Hal_ReadAntennaDiversity88E(struct adapter *pAdapter, u8 *PROMContent, bool AutoLoadFail)
@@ -1203,7 +1144,6 @@ void Hal_ReadAntennaDiversity88E(struct adapter *pAdapter, u8 *PROMContent, bool
} else {
pHalData->AntDivCfg = 0;
}
- DBG_88E("EEPROM : AntDivCfg = %x, TRxAntDivType = %x\n", pHalData->AntDivCfg, pHalData->TRxAntDivType);
}

void Hal_ReadThermalMeter_88E(struct adapter *Adapter, u8 *PROMContent, bool AutoloadFail)
@@ -1218,6 +1158,4 @@ void Hal_ReadThermalMeter_88E(struct adapter *Adapter, u8 *PROMContent, bool Aut

if (pHalData->EEPROMThermalMeter == 0xff || AutoloadFail)
pHalData->EEPROMThermalMeter = EEPROM_Default_ThermalMeter_88E;
-
- DBG_88E("ThermalMeter = 0x%x\n", pHalData->EEPROMThermalMeter);
}
diff --git a/drivers/staging/r8188eu/hal/rtl8188e_phycfg.c b/drivers/staging/r8188eu/hal/rtl8188e_phycfg.c
index 302b15b2874d..c89b9526daf3 100644
--- a/drivers/staging/r8188eu/hal/rtl8188e_phycfg.c
+++ b/drivers/staging/r8188eu/hal/rtl8188e_phycfg.c
@@ -761,9 +761,6 @@ static void _PHY_SwChnl8192C(struct adapter *Adapter, u8 channel)
u32 param1, param2;
struct hal_data_8188e *pHalData = &Adapter->haldata;

- if (Adapter->bNotifyChannelChange)
- DBG_88E("[%s] ch = %d\n", __func__, channel);
-
/* s1. pre common command - CmdID_SetTxPowerLevel */
PHY_SetTxPowerLevel8188E(Adapter, channel);

diff --git a/drivers/staging/r8188eu/hal/rtl8188eu_recv.c b/drivers/staging/r8188eu/hal/rtl8188eu_recv.c
index 8031ac9f9d43..6af72b3e7a7d 100644
--- a/drivers/staging/r8188eu/hal/rtl8188eu_recv.c
+++ b/drivers/staging/r8188eu/hal/rtl8188eu_recv.c
@@ -106,12 +106,7 @@ void rtl8188eu_free_recv_priv(struct adapter *padapter)

kfree(precvpriv->pallocated_recv_buf);

- if (skb_queue_len(&precvpriv->rx_skb_queue))
- DBG_88E(KERN_WARNING "rx_skb_queue not empty\n");
skb_queue_purge(&precvpriv->rx_skb_queue);

- if (skb_queue_len(&precvpriv->free_recv_skb_queue))
- DBG_88E(KERN_WARNING "free_recv_skb_queue not empty, %d\n", skb_queue_len(&precvpriv->free_recv_skb_queue));
-
skb_queue_purge(&precvpriv->free_recv_skb_queue);
}
diff --git a/drivers/staging/r8188eu/hal/rtl8188eu_xmit.c b/drivers/staging/r8188eu/hal/rtl8188eu_xmit.c
index 293541db597d..169c6e5b1769 100644
--- a/drivers/staging/r8188eu/hal/rtl8188eu_xmit.c
+++ b/drivers/staging/r8188eu/hal/rtl8188eu_xmit.c
@@ -264,11 +264,7 @@ static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem, s32 sz, u8 bag
ptxdesc->txdw5 |= cpu_to_le32(0x00300000);/* retry limit = 12 */

ptxdesc->txdw5 |= cpu_to_le32(MRateToHwRate(pmlmeext->tx_rate));
- } else if ((pxmitframe->frame_tag & 0x0f) == TXAGG_FRAMETAG) {
- DBG_88E("pxmitframe->frame_tag == TXAGG_FRAMETAG\n");
- } else {
- DBG_88E("pxmitframe->frame_tag = %d\n", pxmitframe->frame_tag);
-
+ } else if ((pxmitframe->frame_tag & 0x0f) != TXAGG_FRAMETAG) {
/* offset 4 */
ptxdesc->txdw1 |= cpu_to_le32((4) & 0x3f);/* CAM_ID(MAC_ID) */

@@ -567,8 +563,6 @@ static s32 xmitframe_direct(struct adapter *adapt, struct xmit_frame *pxmitframe
res = rtw_xmitframe_coalesce(adapt, pxmitframe->pkt, pxmitframe);
if (res == _SUCCESS)
rtw_dump_xframe(adapt, pxmitframe);
- else
- DBG_88E("==> %s xmitframe_coalsece failed\n", __func__);
return res;
}

diff --git a/drivers/staging/r8188eu/hal/usb_halinit.c b/drivers/staging/r8188eu/hal/usb_halinit.c
index 96db9a8e7667..b89c0befc846 100644
--- a/drivers/staging/r8188eu/hal/usb_halinit.c
+++ b/drivers/staging/r8188eu/hal/usb_halinit.c
@@ -37,7 +37,6 @@ static void _ConfigNormalChipOutEP_8188E(struct adapter *adapt, u8 NumOutPipe)
default:
break;
}
- DBG_88E("%s OutEpQueueSel(0x%02x), OutEpNumber(%d)\n", __func__, haldata->OutEpQueueSel, haldata->OutEpNumber);
}

static bool HalUsbSetQueuePipeMapping8188EUsb(struct adapter *adapt, u8 NumOutPipe)
@@ -77,10 +76,8 @@ u32 rtl8188eu_InitPowerOn(struct adapter *adapt)
if (haldata->bMacPwrCtrlOn)
return _SUCCESS;

- if (!HalPwrSeqCmdParsing(adapt, Rtl8188E_NIC_PWR_ON_FLOW)) {
- DBG_88E(KERN_ERR "%s: run power on flow fail\n", __func__);
+ if (!HalPwrSeqCmdParsing(adapt, Rtl8188E_NIC_PWR_ON_FLOW))
return _FAIL;
- }

/* Enable MAC DMA/WMAC/SCHEDULE/SEC block */
/* Set CR bit10 to enable 32k calibration. Suggested by SD1 Gimmy. Added by tynli. 2011.08.31. */
@@ -559,7 +556,6 @@ static void _InitAntenna_Selection(struct adapter *Adapter)

if (haldata->AntDivCfg == 0)
return;
- DBG_88E("==> %s ....\n", __func__);

rtw_write32(Adapter, REG_LEDCFG0, rtw_read32(Adapter, REG_LEDCFG0) | BIT(23));
rtl8188e_PHY_SetBBReg(Adapter, rFPGA0_XAB_RFParameter, BIT(13), 0x01);
@@ -568,7 +564,6 @@ static void _InitAntenna_Selection(struct adapter *Adapter)
haldata->CurAntenna = Antenna_A;
else
haldata->CurAntenna = Antenna_B;
- DBG_88E("%s,Cur_ant:(%x)%s\n", __func__, haldata->CurAntenna, (haldata->CurAntenna == Antenna_A) ? "Antenna_A" : "Antenna_B");
}

u32 rtl8188eu_hal_init(struct adapter *Adapter)
@@ -580,7 +575,6 @@ u32 rtl8188eu_hal_init(struct adapter *Adapter)
struct hal_data_8188e *haldata = &Adapter->haldata;
struct pwrctrl_priv *pwrctrlpriv = &Adapter->pwrctrlpriv;
struct registry_priv *pregistrypriv = &Adapter->registrypriv;
- u32 init_start_time = jiffies;

if (Adapter->pwrctrlpriv.bkeepfwalive) {
if (haldata->odmpriv.RFCalibrateInfo.bIQKInitialized) {
@@ -628,7 +622,6 @@ u32 rtl8188eu_hal_init(struct adapter *Adapter)
status = rtl8188e_FirmwareDownload(Adapter);

if (status != _SUCCESS) {
- DBG_88E("%s: Download Firmware failed!!\n", __func__);
Adapter->bFWReady = false;
haldata->fw_ractrl = false;
return status;
@@ -640,10 +633,8 @@ u32 rtl8188eu_hal_init(struct adapter *Adapter)

#if (HAL_MAC_ENABLE == 1)
status = PHY_MACConfig8188E(Adapter);
- if (status == _FAIL) {
- DBG_88E(" ### Failed to init MAC ......\n ");
+ if (status == _FAIL)
goto exit;
- }
#endif

/* */
@@ -651,25 +642,19 @@ u32 rtl8188eu_hal_init(struct adapter *Adapter)
/* */
#if (HAL_BB_ENABLE == 1)
status = PHY_BBConfig8188E(Adapter);
- if (status == _FAIL) {
- DBG_88E(" ### Failed to init BB ......\n ");
+ if (status == _FAIL)
goto exit;
- }
#endif

#if (HAL_RF_ENABLE == 1)
status = PHY_RFConfig8188E(Adapter);
- if (status == _FAIL) {
- DBG_88E(" ### Failed to init RF ......\n ");
+ if (status == _FAIL)
goto exit;
- }
#endif

status = rtl8188e_iol_efuse_patch(Adapter);
- if (status == _FAIL) {
- DBG_88E("%s rtl8188e_iol_efuse_patch failed\n", __func__);
+ if (status == _FAIL)
goto exit;
- }

_InitTxBufferBoundary(Adapter, txpktbuf_bndy);

@@ -790,8 +775,6 @@ u32 rtl8188eu_hal_init(struct adapter *Adapter)
rtw_write32(Adapter, REG_FWHW_TXQ_CTRL, rtw_read32(Adapter, REG_FWHW_TXQ_CTRL) | BIT(12));

exit:
- DBG_88E("%s in %dms\n", __func__, rtw_get_passing_time_ms(init_start_time));
-
return status;
}

@@ -853,13 +836,9 @@ static void CardDisableRTL8188EU(struct adapter *Adapter)

u32 rtl8188eu_hal_deinit(struct adapter *Adapter)
{
-
- DBG_88E("==> %s\n", __func__);
-
rtw_write32(Adapter, REG_HIMR_88E, IMR_DISABLED_88E);
rtw_write32(Adapter, REG_HIMRE_88E, IMR_DISABLED_88E);

- DBG_88E("bkeepfwalive(%x)\n", Adapter->pwrctrlpriv.bkeepfwalive);
if (!Adapter->pwrctrlpriv.bkeepfwalive) {
if (Adapter->hw_init_completed) {
CardDisableRTL8188EU(Adapter);
@@ -928,9 +907,6 @@ void ReadAdapterInfo8188EU(struct adapter *Adapter)
eeprom->EepromOrEfuse = (eeValue & BOOT_FROM_EEPROM);
eeprom->bautoload_fail_flag = !(eeValue & EEPROM_EN);

- DBG_88E("Boot from %s, Autoload %s !\n", (eeprom->EepromOrEfuse ? "EEPROM" : "EFUSE"),
- (eeprom->bautoload_fail_flag ? "Fail" : "OK"));
-
if (!is_boot_from_eeprom(Adapter))
EFUSE_ShadowMapUpdate(Adapter);

@@ -991,8 +967,6 @@ static void hw_var_set_opmode(struct adapter *Adapter, u8 variable, u8 *val)
val8 |= mode;
rtw_write8(Adapter, MSR, val8);

- DBG_88E("%s()-%d mode = %d\n", __func__, __LINE__, mode);
-
if ((mode == _HW_STATE_STATION_) || (mode == _HW_STATE_NOLINK_)) {
StopTxBeacon(Adapter);

@@ -1113,7 +1087,6 @@ void SetHwReg8188EU(struct adapter *Adapter, u8 variable, u8 *val)
/* For 8190, we select only 24M, 12M, 6M, 11M, 5.5M, 2M, and 1M from the Basic rate. */
/* We do not use other rates. */
HalSetBrateCfg(Adapter, val, &BrateCfg);
- DBG_88E("HW_VAR_BASIC_RATE: BrateCfg(%#x)\n", BrateCfg);

/* 2011.03.30 add by Luke Lee */
/* CCK 2M ACK should be disabled for some BCM and Atheros AP IOT */
@@ -1410,7 +1383,6 @@ void SetHwReg8188EU(struct adapter *Adapter, u8 variable, u8 *val)
else
AcmCtrl &= (~AcmHw_BeqEn);

- DBG_88E("[HW_VAR_ACM_CTRL] Write 0x%X\n", AcmCtrl);
rtw_write8(Adapter, REG_ACMHWCTRL, AcmCtrl);
}
break;
@@ -1552,8 +1524,6 @@ void SetHwReg8188EU(struct adapter *Adapter, u8 variable, u8 *val)
if (!(rtw_read32(Adapter, REG_RXPKT_NUM) & RXDMA_IDLE))
break;
} while (trycnt--);
- if (trycnt == 0)
- DBG_88E("Stop RX DMA failed......\n");

/* RQPN Load 0 */
rtw_write16(Adapter, REG_RQPN_NPQ, 0x0);
@@ -1564,12 +1534,10 @@ void SetHwReg8188EU(struct adapter *Adapter, u8 variable, u8 *val)
break;
case HW_VAR_APFM_ON_MAC:
haldata->bMacPwrCtrlOn = *val;
- DBG_88E("%s: bMacPwrCtrlOn=%d\n", __func__, haldata->bMacPwrCtrlOn);
break;
case HW_VAR_TX_RPT_MAX_MACID:
{
u8 maxMacid = *val;
- DBG_88E("### MacID(%d),Set Max Tx RPT MID(%d)\n", maxMacid, maxMacid + 1);
rtw_write8(Adapter, REG_TX_RPT_CTRL + 1, maxMacid + 1);
}
break;
@@ -1698,19 +1666,6 @@ u8 GetHalDefVar8188EUsb(struct adapter *Adapter, enum hal_def_variable eVariable
*((u32 *)pValue) = MAX_AMPDU_FACTOR_64K;
break;
case HW_DEF_RA_INFO_DUMP:
- {
- u8 entry_id = *((u8 *)pValue);
- if (check_fwstate(&Adapter->mlmepriv, _FW_LINKED)) {
- DBG_88E("============ RA status check ===================\n");
- DBG_88E("Mac_id:%d , RateID = %d, RAUseRate = 0x%08x, RateSGI = %d, DecisionRate = 0x%02x ,PTStage = %d\n",
- entry_id,
- haldata->odmpriv.RAInfo[entry_id].RateID,
- haldata->odmpriv.RAInfo[entry_id].RAUseRate,
- haldata->odmpriv.RAInfo[entry_id].RateSGI,
- haldata->odmpriv.RAInfo[entry_id].DecisionRate,
- haldata->odmpriv.RAInfo[entry_id].PTStage);
- }
- }
break;
case HAL_DEF_DBG_DUMP_RXPKT:
*((u8 *)pValue) = haldata->bDumpRxPkt;
@@ -1740,15 +1695,12 @@ u8 SetHalDefVar8188EUsb(struct adapter *Adapter, enum hal_def_variable eVariable

if (dm_func == 0) { /* disable all dynamic func */
podmpriv->SupportAbility = DYNAMIC_FUNC_DISABLE;
- DBG_88E("==> Disable all dynamic function...\n");
} else if (dm_func == 1) {/* disable DIG */
podmpriv->SupportAbility &= (~DYNAMIC_BB_DIG);
- DBG_88E("==> Disable DIG...\n");
} else if (dm_func == 2) {/* disable High power */
podmpriv->SupportAbility &= (~DYNAMIC_BB_DYNAMIC_TXPWR);
} else if (dm_func == 3) {/* disable tx power tracking */
podmpriv->SupportAbility &= (~DYNAMIC_RF_CALIBRATION);
- DBG_88E("==> Disable tx power tracking...\n");
} else if (dm_func == 5) {/* disable antenna diversity */
podmpriv->SupportAbility &= (~DYNAMIC_BB_ANT_DIV);
} else if (dm_func == 6) {/* turn on all dynamic func */
@@ -1757,7 +1709,6 @@ u8 SetHalDefVar8188EUsb(struct adapter *Adapter, enum hal_def_variable eVariable
pDigTable->CurIGValue = rtw_read8(Adapter, 0xc50);
}
podmpriv->SupportAbility = DYNAMIC_ALL_FUNC_ENABLE;
- DBG_88E("==> Turn on all dynamic function...\n");
}
}
break;
@@ -1824,8 +1775,6 @@ void UpdateHalRAMask8188EUsb(struct adapter *adapt, u32 mac_id, u8 rssi_level)

rate_bitmap = 0x0fffffff;
rate_bitmap = ODM_Get_Rate_Bitmap(&haldata->odmpriv, mac_id, mask, rssi_level);
- DBG_88E("%s => mac_id:%d, networkType:0x%02x, mask:0x%08x\n\t ==> rssi_level:%d, rate_bitmap:0x%08x\n",
- __func__, mac_id, networkType, mask, rssi_level, rate_bitmap);

mask &= rate_bitmap;

@@ -1839,7 +1788,6 @@ void UpdateHalRAMask8188EUsb(struct adapter *adapt, u32 mac_id, u8 rssi_level)
if (shortGIrate)
arg |= BIT(5);
mask |= ((raid << 28) & 0xf0000000);
- DBG_88E("update raid entry, mask=0x%x, arg=0x%x\n", mask, arg);
psta->ra_mask = mask;
mask |= ((raid << 28) & 0xf0000000);

diff --git a/drivers/staging/r8188eu/hal/usb_ops_linux.c b/drivers/staging/r8188eu/hal/usb_ops_linux.c
index 4a0ab4053e90..5e751336a224 100644
--- a/drivers/staging/r8188eu/hal/usb_ops_linux.c
+++ b/drivers/staging/r8188eu/hal/usb_ops_linux.c
@@ -209,10 +209,8 @@ static int recvbuf2recvframe(struct adapter *adapt, struct sk_buff *pskb)
prxstat = (struct recv_stat *)pbuf;

precvframe = rtw_alloc_recvframe(pfree_recv_queue);
- if (!precvframe) {
- DBG_88E("%s()-%d: rtw_alloc_recvframe() failed! RX Drop!\n", __func__, __LINE__);
+ if (!precvframe)
goto _exit_recvbuf2recvframe;
- }

INIT_LIST_HEAD(&precvframe->list);
precvframe->precvbuf = NULL; /* can't access the precvbuf for new arch. */
@@ -223,8 +221,6 @@ static int recvbuf2recvframe(struct adapter *adapt, struct sk_buff *pskb)
pattrib = &precvframe->attrib;

if ((pattrib->crc_err) || (pattrib->icv_err)) {
- DBG_88E("%s: RX Warning! crc_err=%d icv_err=%d, skip!\n", __func__, pattrib->crc_err, pattrib->icv_err);
-
rtw_free_recvframe(precvframe, pfree_recv_queue);
goto _exit_recvbuf2recvframe;
}
@@ -235,7 +231,6 @@ static int recvbuf2recvframe(struct adapter *adapt, struct sk_buff *pskb)
pkt_offset = RXDESC_SIZE + pattrib->drvinfo_sz + pattrib->shift_sz + pattrib->pkt_len;

if ((pattrib->pkt_len <= 0) || (pkt_offset > transfer_len)) {
- DBG_88E("%s()-%d: RX Warning!,pkt_len<=0 or pkt_offset> transfoer_len\n", __func__, __LINE__);
rtw_free_recvframe(precvframe, pfree_recv_queue);
goto _exit_recvbuf2recvframe;
}
@@ -276,7 +271,6 @@ static int recvbuf2recvframe(struct adapter *adapt, struct sk_buff *pskb)
precvframe->rx_data = pkt_copy->data;
} else {
if ((pattrib->mfrag == 1) && (pattrib->frag_num == 0)) {
- DBG_88E("recvbuf2recvframe: alloc_skb fail , drop frag frame\n");
rtw_free_recvframe(precvframe, pfree_recv_queue);
goto _exit_recvbuf2recvframe;
}
@@ -287,7 +281,6 @@ static int recvbuf2recvframe(struct adapter *adapt, struct sk_buff *pskb)
precvframe->rx_data = precvframe->rx_tail;
precvframe->rx_end = pbuf + pattrib->drvinfo_sz + RXDESC_SIZE + alloc_sz;
} else {
- DBG_88E("recvbuf2recvframe: skb_clone fail\n");
rtw_free_recvframe(precvframe, pfree_recv_queue);
goto _exit_recvbuf2recvframe;
}
@@ -351,7 +344,6 @@ void rtl8188eu_recv_tasklet(unsigned long priv)

while (NULL != (pskb = skb_dequeue(&precvpriv->rx_skb_queue))) {
if ((adapt->bDriverStopped) || (adapt->bSurpriseRemoved)) {
- DBG_88E("recv_tasklet => bDriverStopped or bSurpriseRemoved\n");
dev_kfree_skb_any(pskb);
break;
}
@@ -372,9 +364,6 @@ static void usb_read_port_complete(struct urb *purb, struct pt_regs *regs)

if (adapt->bSurpriseRemoved || adapt->bDriverStopped || adapt->bReadPortCancel) {
precvbuf->reuse = true;
- DBG_88E("%s() RX Warning! bDriverStopped(%d) OR bSurpriseRemoved(%d) bReadPortCancel(%d)\n",
- __func__, adapt->bDriverStopped,
- adapt->bSurpriseRemoved, adapt->bReadPortCancel);
return;
}

@@ -382,7 +371,6 @@ static void usb_read_port_complete(struct urb *purb, struct pt_regs *regs)
if ((purb->actual_length > MAX_RECVBUF_SZ) || (purb->actual_length < RXDESC_SIZE)) {
precvbuf->reuse = true;
rtw_read_port(adapt, (unsigned char *)precvbuf);
- DBG_88E("%s()-%d: RX Warning!\n", __func__, __LINE__);
} else {
rtw_reset_continual_urb_error(adapter_to_dvobj(adapt));

@@ -398,7 +386,6 @@ static void usb_read_port_complete(struct urb *purb, struct pt_regs *regs)
rtw_read_port(adapt, (unsigned char *)precvbuf);
}
} else {
- DBG_88E("###=> usb_read_port_complete => urb status(%d)\n", purb->status);
skb_put(precvbuf->pskb, purb->actual_length);
precvbuf->pskb = NULL;

@@ -418,9 +405,6 @@ static void usb_read_port_complete(struct urb *purb, struct pt_regs *regs)
precvbuf->reuse = true;
rtw_read_port(adapt, (unsigned char *)precvbuf);
break;
- case -EINPROGRESS:
- DBG_88E("ERROR: URB IS IN PROGRESS!/n");
- break;
default:
break;
}
@@ -458,10 +442,8 @@ u32 rtw_read_port(struct adapter *adapter, u8 *rmem)
/* re-assign for linux based on skb */
if (!precvbuf->reuse || !precvbuf->pskb) {
precvbuf->pskb = netdev_alloc_skb(adapter->pnetdev, MAX_RECVBUF_SZ + RECVBUFF_ALIGN_SZ);
- if (!precvbuf->pskb) {
- DBG_88E("#### usb_read_port() alloc_skb fail!#####\n");
+ if (!precvbuf->pskb)
return _FAIL;
- }

tmpaddr = (size_t)precvbuf->pskb->data;
alignment = tmpaddr & (RECVBUFF_ALIGN_SZ - 1);
@@ -496,11 +478,8 @@ u32 rtw_read_port(struct adapter *adapter, u8 *rmem)
precvbuf);/* context is precvbuf */

err = usb_submit_urb(purb, GFP_ATOMIC);
- if ((err) && (err != (-EPERM))) {
- DBG_88E("cannot submit rx in-token(err = 0x%08x),urb_status = %d\n",
- err, purb->status);
+ if ((err) && (err != (-EPERM)))
ret = _FAIL;
- }

return ret;
}
@@ -517,10 +496,8 @@ void rtl8188eu_xmit_tasklet(unsigned long priv)
while (1) {
if ((adapt->bDriverStopped) ||
(adapt->bSurpriseRemoved) ||
- (adapt->bWritePortCancel)) {
- DBG_88E("xmit_tasklet => bDriverStopped or bSurpriseRemoved or bWritePortCancel\n");
+ (adapt->bWritePortCancel))
break;
- }

ret = rtl8188eu_xmitframe_complete(adapt, pxmitpriv, NULL);

--
2.34.1

2022-01-25 08:51:13

by Phillip Potter

[permalink] [raw]
Subject: [PATCH 06/10] staging: r8188eu: remove DBG_88E calls from os_dep/ioctl_linux.c

Remove all DBG_88E calls from os_dep/ioctl_linux.c, as they do not
conform to kernel coding standards and are superfluous. Also restructure
where appropriate to remove no longer needed code left behind by removal
of these calls. This will allow the eventual removal of the DBG_88E macro
itself.

Signed-off-by: Phillip Potter <[email protected]>
---
drivers/staging/r8188eu/os_dep/ioctl_linux.c | 414 +------------------
1 file changed, 10 insertions(+), 404 deletions(-)

diff --git a/drivers/staging/r8188eu/os_dep/ioctl_linux.c b/drivers/staging/r8188eu/os_dep/ioctl_linux.c
index b8ea599fd7cf..51766ba3322b 100644
--- a/drivers/staging/r8188eu/os_dep/ioctl_linux.c
+++ b/drivers/staging/r8188eu/os_dep/ioctl_linux.c
@@ -342,26 +342,20 @@ static int wpa_set_auth_algs(struct net_device *dev, u32 value)
int ret = 0;

if ((value & AUTH_ALG_SHARED_KEY) && (value & AUTH_ALG_OPEN_SYSTEM)) {
- DBG_88E("wpa_set_auth_algs, AUTH_ALG_SHARED_KEY and AUTH_ALG_OPEN_SYSTEM [value:0x%x]\n", value);
padapter->securitypriv.ndisencryptstatus = Ndis802_11Encryption1Enabled;
padapter->securitypriv.ndisauthtype = Ndis802_11AuthModeAutoSwitch;
padapter->securitypriv.dot11AuthAlgrthm = dot11AuthAlgrthm_Auto;
} else if (value & AUTH_ALG_SHARED_KEY) {
- DBG_88E("wpa_set_auth_algs, AUTH_ALG_SHARED_KEY [value:0x%x]\n", value);
padapter->securitypriv.ndisencryptstatus = Ndis802_11Encryption1Enabled;

padapter->securitypriv.ndisauthtype = Ndis802_11AuthModeShared;
padapter->securitypriv.dot11AuthAlgrthm = dot11AuthAlgrthm_Shared;
} else if (value & AUTH_ALG_OPEN_SYSTEM) {
- DBG_88E("wpa_set_auth_algs, AUTH_ALG_OPEN_SYSTEM\n");
if (padapter->securitypriv.ndisauthtype < Ndis802_11AuthModeWPAPSK) {
padapter->securitypriv.ndisauthtype = Ndis802_11AuthModeOpen;
padapter->securitypriv.dot11AuthAlgrthm = dot11AuthAlgrthm_Open;
}
- } else if (value & AUTH_ALG_LEAP) {
- DBG_88E("wpa_set_auth_algs, AUTH_ALG_LEAP\n");
- } else {
- DBG_88E("wpa_set_auth_algs, error!\n");
+ } else if ((value & AUTH_ALG_LEAP) == 0) {
ret = -EINVAL;
}
return ret;
@@ -398,8 +392,6 @@ static int wpa_set_encryption(struct net_device *dev, struct ieee_param *param,
}

if (strcmp(param->u.crypt.alg, "WEP") == 0) {
- DBG_88E("wpa_set_encryption, crypt.alg = WEP\n");
-
padapter->securitypriv.ndisencryptstatus = Ndis802_11Encryption1Enabled;
padapter->securitypriv.dot11PrivacyAlgrthm = _WEP40_;
padapter->securitypriv.dot118021XGrpPrivacy = _WEP40_;
@@ -407,8 +399,6 @@ static int wpa_set_encryption(struct net_device *dev, struct ieee_param *param,
wep_key_idx = param->u.crypt.idx;
wep_key_len = param->u.crypt.key_len;

- DBG_88E("(1)wep_key_idx =%d\n", wep_key_idx);
-
if (wep_key_idx > WEP_KEYS)
return -EINVAL;

@@ -433,11 +423,9 @@ static int wpa_set_encryption(struct net_device *dev, struct ieee_param *param,
pwep->KeyIndex |= 0x80000000;
memcpy(pwep->KeyMaterial, param->u.crypt.key, pwep->KeyLength);
if (param->u.crypt.set_tx) {
- DBG_88E("wep, set_tx = 1\n");
if (rtw_set_802_11_add_wep(padapter, pwep) == (u8)_FAIL)
ret = -EOPNOTSUPP;
} else {
- DBG_88E("wep, set_tx = 0\n");
if (wep_key_idx >= WEP_KEYS) {
ret = -EOPNOTSUPP;
goto exit;
@@ -474,15 +462,12 @@ static int wpa_set_encryption(struct net_device *dev, struct ieee_param *param,
padapter->securitypriv.busetkipkey = false;
}

- DBG_88E(" ~~~~set sta key:unicastkey\n");
-
rtw_setstakey_cmd(padapter, (unsigned char *)psta, true);
} else { /* group key */
memcpy(padapter->securitypriv.dot118021XGrpKey[param->u.crypt.idx].skey, param->u.crypt.key, (param->u.crypt.key_len > 16 ? 16 : param->u.crypt.key_len));
memcpy(padapter->securitypriv.dot118021XGrptxmickey[param->u.crypt.idx].skey, &param->u.crypt.key[16], 8);
memcpy(padapter->securitypriv.dot118021XGrprxmickey[param->u.crypt.idx].skey, &param->u.crypt.key[24], 8);
padapter->securitypriv.binstallGrpkey = true;
- DBG_88E(" ~~~~set sta key:groupkey\n");

padapter->securitypriv.dot118021XGrpKeyid = param->u.crypt.idx;

@@ -535,14 +520,6 @@ static int rtw_set_wpa_ie(struct adapter *padapter, char *pie, unsigned short ie
goto exit;
}

- /* dump */
- {
- int i;
- DBG_88E("\n wpa_ie(length:%d):\n", ielen);
- for (i = 0; i < ielen; i += 8)
- DBG_88E("0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x\n", buf[i], buf[i + 1], buf[i + 2], buf[i + 3], buf[i + 4], buf[i + 5], buf[i + 6], buf[i + 7]);
- }
-
if (ielen < RSN_HEADER_LEN) {
ret = -1;
goto exit;
@@ -614,8 +591,6 @@ static int rtw_set_wpa_ie(struct adapter *padapter, char *pie, unsigned short ie
while (cnt < ielen) {
eid = buf[cnt];
if ((eid == _VENDOR_SPECIFIC_IE_) && (!memcmp(&buf[cnt + 2], wps_oui, 4))) {
- DBG_88E("SET WPS_IE\n");
-
padapter->securitypriv.wps_ie_len = ((buf[cnt + 1] + 2) < (MAX_WPA_IE_LEN << 2)) ? (buf[cnt + 1] + 2) : (MAX_WPA_IE_LEN << 2);

memcpy(padapter->securitypriv.wps_ie, &buf[cnt], padapter->securitypriv.wps_ie_len);
@@ -728,19 +703,15 @@ static int rtw_wx_set_mode(struct net_device *dev, struct iw_request_info *a,
switch (wrqu->mode) {
case IW_MODE_AUTO:
networkType = Ndis802_11AutoUnknown;
- DBG_88E("set_mode = IW_MODE_AUTO\n");
break;
case IW_MODE_ADHOC:
networkType = Ndis802_11IBSS;
- DBG_88E("set_mode = IW_MODE_ADHOC\n");
break;
case IW_MODE_MASTER:
networkType = Ndis802_11APMode;
- DBG_88E("set_mode = IW_MODE_MASTER\n");
break;
case IW_MODE_INFRA:
networkType = Ndis802_11Infrastructure;
- DBG_88E("set_mode = IW_MODE_INFRA\n");
break;
default:
ret = -EINVAL;
@@ -791,7 +762,6 @@ static int rtw_wx_set_pmkid(struct net_device *dev,

memcpy(strIssueBssid, pPMK->bssid.sa_data, ETH_ALEN);
if (pPMK->cmd == IW_PMKSA_ADD) {
- DBG_88E("[rtw_wx_set_pmkid] IW_PMKSA_ADD!\n");
if (!memcmp(strIssueBssid, strZeroMacAddress, ETH_ALEN))
return ret;
else
@@ -802,7 +772,6 @@ static int rtw_wx_set_pmkid(struct net_device *dev,
for (j = 0; j < NUM_PMKID_CACHE; j++) {
if (!memcmp(psecuritypriv->PMKIDList[j].Bssid, strIssueBssid, ETH_ALEN)) {
/* BSSID is matched, the same AP => rewrite with new PMKID. */
- DBG_88E("[rtw_wx_set_pmkid] BSSID exists in the PMKList.\n");
memcpy(psecuritypriv->PMKIDList[j].PMKID, pPMK->pmkid, IW_PMKID_LEN);
psecuritypriv->PMKIDList[j].bUsed = true;
psecuritypriv->PMKIDIndex = j + 1;
@@ -813,9 +782,6 @@ static int rtw_wx_set_pmkid(struct net_device *dev,

if (!blInserted) {
/* Find a new entry */
- DBG_88E("[rtw_wx_set_pmkid] Use the new entry index = %d for this PMKID.\n",
- psecuritypriv->PMKIDIndex);
-
memcpy(psecuritypriv->PMKIDList[psecuritypriv->PMKIDIndex].Bssid, strIssueBssid, ETH_ALEN);
memcpy(psecuritypriv->PMKIDList[psecuritypriv->PMKIDIndex].PMKID, pPMK->pmkid, IW_PMKID_LEN);

@@ -825,7 +791,6 @@ static int rtw_wx_set_pmkid(struct net_device *dev,
psecuritypriv->PMKIDIndex = 0;
}
} else if (pPMK->cmd == IW_PMKSA_REMOVE) {
- DBG_88E("[rtw_wx_set_pmkid] IW_PMKSA_REMOVE!\n");
ret = true;
for (j = 0; j < NUM_PMKID_CACHE; j++) {
if (!memcmp(psecuritypriv->PMKIDList[j].Bssid, strIssueBssid, ETH_ALEN)) {
@@ -836,7 +801,6 @@ static int rtw_wx_set_pmkid(struct net_device *dev,
}
}
} else if (pPMK->cmd == IW_PMKSA_FLUSH) {
- DBG_88E("[rtw_wx_set_pmkid] IW_PMKSA_FLUSH!\n");
memset(&psecuritypriv->PMKIDList[0], 0x00, sizeof(struct rt_pmkid_list) * NUM_PMKID_CACHE);
psecuritypriv->PMKIDIndex = 0;
ret = true;
@@ -1062,12 +1026,8 @@ static int rtw_wx_set_mlme(struct net_device *dev,
if (!mlme)
return -1;

- DBG_88E("%s\n", __func__);
-
reason = mlme->reason_code;

- DBG_88E("%s, cmd =%d, reason =%d\n", __func__, mlme->cmd, reason);
-
switch (mlme->cmd) {
case IW_MLME_DEAUTH:
if (!rtw_set_802_11_disassociate(padapter))
@@ -1099,7 +1059,6 @@ static int rtw_wx_set_scan(struct net_device *dev, struct iw_request_info *a,
}

if (padapter->bDriverStopped) {
- DBG_88E("bDriverStopped =%d\n", padapter->bDriverStopped);
ret = -1;
goto exit;
}
@@ -1149,15 +1108,11 @@ static int rtw_wx_set_scan(struct net_device *dev, struct iw_request_info *a,
memcpy(ssid[0].Ssid, req->essid, len);
ssid[0].SsidLength = len;

- DBG_88E("IW_SCAN_THIS_ESSID, ssid =%s, len =%d\n", req->essid, req->essid_len);
-
spin_lock_bh(&pmlmepriv->lock);

_status = rtw_sitesurvey_cmd(padapter, ssid, 1, NULL, 0);

spin_unlock_bh(&pmlmepriv->lock);
- } else if (req->scan_type == IW_SCAN_TYPE_PASSIVE) {
- DBG_88E("rtw_wx_set_scan, req->scan_type == IW_SCAN_TYPE_PASSIVE\n");
}
} else {
if (wrqu->data.length >= WEXT_CSCAN_HEADER_SIZE &&
@@ -1320,13 +1275,9 @@ static int rtw_wx_set_essid(struct net_device *dev,
}

authmode = padapter->securitypriv.ndisauthtype;
- DBG_88E("=>%s\n", __func__);
if (wrqu->essid.flags && wrqu->essid.length) {
len = (wrqu->essid.length < IW_ESSID_MAX_SIZE) ? wrqu->essid.length : IW_ESSID_MAX_SIZE;

- if (wrqu->essid.length != 33)
- DBG_88E("ssid =%s, len =%d\n", extra, wrqu->essid.length);
-
memset(&ndis_ssid, 0, sizeof(struct ndis_802_11_ssid));
ndis_ssid.SsidLength = len;
memcpy(ndis_ssid.Ssid, extra, len);
@@ -1369,11 +1320,6 @@ static int rtw_wx_set_essid(struct net_device *dev,
}

exit:
-
- DBG_88E("<=%s, ret %d\n", __func__, ret);
-
-
-
return ret;
}

@@ -1513,10 +1459,6 @@ static int rtw_wx_set_rts(struct net_device *dev,
padapter->registrypriv.rts_thresh = wrqu->rts.value;
}

- DBG_88E("%s, rts_thresh =%d\n", __func__, padapter->registrypriv.rts_thresh);
-
-
-
return 0;
}

@@ -1526,16 +1468,10 @@ static int rtw_wx_get_rts(struct net_device *dev,
{
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);

-
-
- DBG_88E("%s, rts_thresh =%d\n", __func__, padapter->registrypriv.rts_thresh);
-
wrqu->rts.value = padapter->registrypriv.rts_thresh;
wrqu->rts.fixed = 0; /* no auto select */
/* wrqu->rts.disabled = (wrqu->rts.value == DEFAULT_RTS_THRESHOLD); */

-
-
return 0;
}

@@ -1545,8 +1481,6 @@ static int rtw_wx_set_frag(struct net_device *dev,
{
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);

-
-
if (wrqu->frag.disabled) {
padapter->xmitpriv.frag_len = MAX_FRAG_THRESHOLD;
} else {
@@ -1557,10 +1491,6 @@ static int rtw_wx_set_frag(struct net_device *dev,
padapter->xmitpriv.frag_len = wrqu->frag.value & ~0x1;
}

- DBG_88E("%s, frag_len =%d\n", __func__, padapter->xmitpriv.frag_len);
-
-
-
return 0;
}

@@ -1570,15 +1500,9 @@ static int rtw_wx_get_frag(struct net_device *dev,
{
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);

-
-
- DBG_88E("%s, frag_len =%d\n", __func__, padapter->xmitpriv.frag_len);
-
wrqu->frag.value = padapter->xmitpriv.frag_len;
wrqu->frag.fixed = 0; /* no auto select */

-
-
return 0;
}

@@ -1605,7 +1529,6 @@ static int rtw_wx_set_enc(struct net_device *dev,
struct iw_point *erq = &wrqu->encoding;
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
struct pwrctrl_priv *pwrpriv = &padapter->pwrctrlpriv;
- DBG_88E("+rtw_wx_set_enc, flags = 0x%x\n", erq->flags);

memset(&wep, 0, sizeof(struct ndis_802_11_wep));

@@ -1614,7 +1537,6 @@ static int rtw_wx_set_enc(struct net_device *dev,


if (erq->flags & IW_ENCODE_DISABLED) {
- DBG_88E("EncryptionDisabled\n");
padapter->securitypriv.ndisencryptstatus = Ndis802_11EncryptionDisabled;
padapter->securitypriv.dot11PrivacyAlgrthm = _NO_PRIVACY_;
padapter->securitypriv.dot118021XGrpPrivacy = _NO_PRIVACY_;
@@ -1633,12 +1555,10 @@ static int rtw_wx_set_enc(struct net_device *dev,
} else {
keyindex_provided = 0;
key = padapter->securitypriv.dot11PrivacyKeyIndex;
- DBG_88E("rtw_wx_set_enc, key =%d\n", key);
}

/* set authentication mode */
if (erq->flags & IW_ENCODE_OPEN) {
- DBG_88E("rtw_wx_set_enc():IW_ENCODE_OPEN\n");
padapter->securitypriv.ndisencryptstatus = Ndis802_11Encryption1Enabled;/* Ndis802_11EncryptionDisabled; */
padapter->securitypriv.dot11AuthAlgrthm = dot11AuthAlgrthm_Open;
padapter->securitypriv.dot11PrivacyAlgrthm = _NO_PRIVACY_;
@@ -1646,7 +1566,6 @@ static int rtw_wx_set_enc(struct net_device *dev,
authmode = Ndis802_11AuthModeOpen;
padapter->securitypriv.ndisauthtype = authmode;
} else if (erq->flags & IW_ENCODE_RESTRICTED) {
- DBG_88E("rtw_wx_set_enc():IW_ENCODE_RESTRICTED\n");
padapter->securitypriv.ndisencryptstatus = Ndis802_11Encryption1Enabled;
padapter->securitypriv.dot11AuthAlgrthm = dot11AuthAlgrthm_Shared;
padapter->securitypriv.dot11PrivacyAlgrthm = _WEP40_;
@@ -1654,8 +1573,6 @@ static int rtw_wx_set_enc(struct net_device *dev,
authmode = Ndis802_11AuthModeShared;
padapter->securitypriv.ndisauthtype = authmode;
} else {
- DBG_88E("rtw_wx_set_enc():erq->flags = 0x%x\n", erq->flags);
-
padapter->securitypriv.ndisencryptstatus = Ndis802_11Encryption1Enabled;/* Ndis802_11EncryptionDisabled; */
padapter->securitypriv.dot11AuthAlgrthm = dot11AuthAlgrthm_Open; /* open system */
padapter->securitypriv.dot11PrivacyAlgrthm = _NO_PRIVACY_;
@@ -1676,8 +1593,6 @@ static int rtw_wx_set_enc(struct net_device *dev,
/* set key_id only, no given KeyMaterial(erq->length == 0). */
padapter->securitypriv.dot11PrivacyKeyIndex = key;

- DBG_88E("(keyindex_provided == 1), keyid =%d, key_len =%d\n", key, padapter->securitypriv.dot11DefKeylen[key]);
-
switch (padapter->securitypriv.dot11DefKeylen[key]) {
case 5:
padapter->securitypriv.dot11PrivacyAlgrthm = _WEP40_;
@@ -1865,7 +1780,6 @@ static int rtw_wx_set_auth(struct net_device *dev,
if (check_fwstate(&padapter->mlmepriv, _FW_LINKED)) {
LeaveAllPowerSaveMode(padapter);
rtw_disassoc_cmd(padapter, 500, false);
- DBG_88E("%s...call rtw_indicate_disconnect\n ", __func__);
rtw_indicate_disconnect(padapter);
rtw_free_assoc_resources(padapter, 1);
}
@@ -2003,11 +1917,9 @@ static int rtw_wx_read32(struct net_device *dev,
sprintf(extra, "0x%08X", data32);
break;
default:
- DBG_88E(KERN_INFO "%s: usage> read [bytes],[address(hex)]\n", __func__);
ret = -EINVAL;
goto err_free_ptmp;
}
- DBG_88E(KERN_INFO "%s: addr = 0x%08X data =%s\n", __func__, addr, extra);

kfree(ptmp);
return 0;
@@ -2035,18 +1947,14 @@ static int rtw_wx_write32(struct net_device *dev,
switch (bytes) {
case 1:
rtw_write8(padapter, addr, (u8)data32);
- DBG_88E(KERN_INFO "%s: addr = 0x%08X data = 0x%02X\n", __func__, addr, (u8)data32);
break;
case 2:
rtw_write16(padapter, addr, (u16)data32);
- DBG_88E(KERN_INFO "%s: addr = 0x%08X data = 0x%04X\n", __func__, addr, (u16)data32);
break;
case 4:
rtw_write32(padapter, addr, data32);
- DBG_88E(KERN_INFO "%s: addr = 0x%08X data = 0x%08X\n", __func__, addr, data32);
break;
default:
- DBG_88E(KERN_INFO "%s: usage> write [bytes],[address(hex)],[data(hex)]\n", __func__);
return -EINVAL;
}

@@ -2093,12 +2001,9 @@ static int rtw_wx_set_channel_plan(struct net_device *dev,
union iwreq_data *wrqu, char *extra)
{
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
- struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
u8 channel_plan_req = (u8)(*((int *)wrqu));

- if (_SUCCESS == rtw_set_chplan_cmd(padapter, channel_plan_req, 1))
- DBG_88E("%s set channel_plan = 0x%02X\n", __func__, pmlmepriv->ChannelPlan);
- else
+ if (rtw_set_chplan_cmd(padapter, channel_plan_req, 1) != _SUCCESS)
return -EPERM;

return 0;
@@ -2120,8 +2025,6 @@ static int rtw_get_ap_info(struct net_device *dev,
struct __queue *queue = &pmlmepriv->scanned_queue;
struct iw_point *pdata = &wrqu->data;

- DBG_88E("+rtw_get_aplist_info\n");
-
if (padapter->bDriverStopped || !pdata) {
ret = -EINVAL;
goto exit;
@@ -2153,15 +2056,12 @@ static int rtw_get_ap_info(struct net_device *dev,
pnetwork = container_of(plist, struct wlan_network, list);

if (!mac_pton(data, bssid)) {
- DBG_88E("Invalid BSSID '%s'.\n", (u8 *)data);
spin_unlock_bh(&pmlmepriv->scanned_queue.lock);
return -EINVAL;
}

if (!memcmp(bssid, pnetwork->network.MacAddress, ETH_ALEN)) {
/* BSSID match, then check if supporting wpa/wpa2 */
- DBG_88E("BSSID:%pM\n", (bssid));
-
pbuf = rtw_get_wpa_ie(&pnetwork->network.IEs[12], &wpa_ielen, pnetwork->network.IELength - 12);
if (pbuf && (wpa_ielen > 0)) {
pdata->flags = 1;
@@ -2210,9 +2110,6 @@ static int rtw_set_pid(struct net_device *dev,
if (selector < 3 && selector >= 0) {
padapter->pid[selector] = *(pdata + 1);
ui_pid[selector] = *(pdata + 1);
- DBG_88E("%s set pid[%d] =%d\n", __func__, selector, padapter->pid[selector]);
- } else {
- DBG_88E("%s selector %d error\n", __func__, selector);
}
exit:
return ret;
@@ -2243,8 +2140,6 @@ static int rtw_wps_start(struct net_device *dev,
if (u32wps_start == 0)
u32wps_start = *extra;

- DBG_88E("[%s] wps_start = %d\n", __func__, u32wps_start);
-
if (u32wps_start == 1) /* WPS Start */
rtw_led_control(padapter, LED_CTL_START_WPS);
else if (u32wps_start == 2) /* WPS Stop because of wps success */
@@ -2314,7 +2209,6 @@ static int rtw_p2p_set_go_nego_ssid(struct net_device *dev,
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
struct wifidirect_info *pwdinfo = &padapter->wdinfo;

- DBG_88E("[%s] ssid = %s, len = %zu\n", __func__, extra, strlen(extra));
memcpy(pwdinfo->nego_ssid, extra, strlen(extra));
pwdinfo->nego_ssidlen = strlen(extra);

@@ -2342,7 +2236,6 @@ static int rtw_p2p_set_intent(struct net_device *dev,
pwdinfo->intent = intent;
else
ret = -1;
- DBG_88E("[%s] intent = %d\n", __func__, intent);
return ret;
}

@@ -2371,8 +2264,6 @@ static int rtw_p2p_set_listen_ch(struct net_device *dev,
ret = -1;
}

- DBG_88E("[%s] listen_ch = %d\n", __func__, pwdinfo->listen_channel);
-
return ret;
}

@@ -2402,8 +2293,6 @@ static int rtw_p2p_set_op_ch(struct net_device *dev,
else
ret = -1;

- DBG_88E("[%s] op_ch = %d\n", __func__, pwdinfo->operating_channel);
-
return ret;
}

@@ -2425,8 +2314,6 @@ static int rtw_p2p_profilefound(struct net_device *dev,
/* YY => SSID Length */
/* SSID => SSID for persistence group */

- DBG_88E("[%s] In value = %s, len = %d\n", __func__, extra, wrqu->data.length - 1);
-
/* The upper application should pass the SSID to driver by using this rtw_p2p_profilefound function. */
if (!rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE)) {
if (extra[0] == '0') {
@@ -2462,7 +2349,6 @@ static int rtw_p2p_setDN(struct net_device *dev,
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
struct wifidirect_info *pwdinfo = &padapter->wdinfo;

- DBG_88E("[%s] %s %d\n", __func__, extra, wrqu->data.length - 1);
memset(pwdinfo->device_name, 0x00, WPS_MAX_DEVICE_NAME_LEN);
memcpy(pwdinfo->device_name, extra, wrqu->data.length - 1);
pwdinfo->device_name_len = wrqu->data.length - 1;
@@ -2478,11 +2364,6 @@ static int rtw_p2p_get_status(struct net_device *dev,
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
struct wifidirect_info *pwdinfo = &padapter->wdinfo;

- if (padapter->bShowGetP2PState)
- DBG_88E("[%s] Role = %d, Status = %d, peer addr = %.2X:%.2X:%.2X:%.2X:%.2X:%.2X\n", __func__, rtw_p2p_role(pwdinfo), rtw_p2p_state(pwdinfo),
- pwdinfo->p2p_peer_interface_addr[0], pwdinfo->p2p_peer_interface_addr[1], pwdinfo->p2p_peer_interface_addr[2],
- pwdinfo->p2p_peer_interface_addr[3], pwdinfo->p2p_peer_interface_addr[4], pwdinfo->p2p_peer_interface_addr[5]);
-
/* Commented by Albert 2010/10/12 */
/* Because of the output size limitation, I had removed the "Role" information. */
/* About the "Role" information, we will use the new private IOCTL to get the "Role" information. */
@@ -2518,10 +2399,6 @@ static int rtw_p2p_get_role(struct net_device *dev,
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
struct wifidirect_info *pwdinfo = &padapter->wdinfo;

- DBG_88E("[%s] Role = %d, Status = %d, peer addr = %.2X:%.2X:%.2X:%.2X:%.2X:%.2X\n", __func__, rtw_p2p_role(pwdinfo), rtw_p2p_state(pwdinfo),
- pwdinfo->p2p_peer_interface_addr[0], pwdinfo->p2p_peer_interface_addr[1], pwdinfo->p2p_peer_interface_addr[2],
- pwdinfo->p2p_peer_interface_addr[3], pwdinfo->p2p_peer_interface_addr[4], pwdinfo->p2p_peer_interface_addr[5]);
-
sprintf(extra, "\n\nRole =%.2d\n", rtw_p2p_role(pwdinfo));
wrqu->data.length = strlen(extra);
return ret;
@@ -2535,9 +2412,6 @@ static int rtw_p2p_get_peer_ifaddr(struct net_device *dev,
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
struct wifidirect_info *pwdinfo = &padapter->wdinfo;

- DBG_88E("[%s] Role = %d, Status = %d, peer addr = %pM\n", __func__,
- rtw_p2p_role(pwdinfo), rtw_p2p_state(pwdinfo),
- pwdinfo->p2p_peer_interface_addr);
sprintf(extra, "\nMAC %pM",
pwdinfo->p2p_peer_interface_addr);
wrqu->data.length = strlen(extra);
@@ -2553,9 +2427,6 @@ static int rtw_p2p_get_peer_devaddr(struct net_device *dev,
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
struct wifidirect_info *pwdinfo = &padapter->wdinfo;

- DBG_88E("[%s] Role = %d, Status = %d, peer addr = %pM\n", __func__,
- rtw_p2p_role(pwdinfo), rtw_p2p_state(pwdinfo),
- pwdinfo->rx_prov_disc_info.peerDevAddr);
sprintf(extra, "\n%pM",
pwdinfo->rx_prov_disc_info.peerDevAddr);
wrqu->data.length = strlen(extra);
@@ -2571,9 +2442,6 @@ static int rtw_p2p_get_peer_devaddr_by_invitation(struct net_device *dev,
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
struct wifidirect_info *pwdinfo = &padapter->wdinfo;

- DBG_88E("[%s] Role = %d, Status = %d, peer addr = %pM\n",
- __func__, rtw_p2p_role(pwdinfo), rtw_p2p_state(pwdinfo),
- pwdinfo->p2p_peer_device_addr);
sprintf(extra, "\nMAC %pM",
pwdinfo->p2p_peer_device_addr);
wrqu->data.length = strlen(extra);
@@ -2607,8 +2475,6 @@ static int rtw_p2p_get_op_ch(struct net_device *dev,
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
struct wifidirect_info *pwdinfo = &padapter->wdinfo;

- DBG_88E("[%s] Op_ch = %02x\n", __func__, pwdinfo->operating_channel);
-
sprintf(extra, "\n\nOp_ch =%.2d\n", pwdinfo->operating_channel);
wrqu->data.length = strlen(extra);
return ret;
@@ -2638,7 +2504,6 @@ static int rtw_p2p_get_wps_configmethod(struct net_device *dev,
/* After knowing its WPS config method, the application can decide the config method for provisioning discovery. */
/* Format: iwpriv wlanx p2p_get_wpsCM 00:E0:4C:00:00:05 */

- DBG_88E("[%s] data = %s\n", __func__, (char *)extra);
if (copy_from_user(peerMACStr, wrqu->data.pointer + 6, 17))
return -EFAULT;

@@ -2707,7 +2572,6 @@ static int rtw_p2p_get_go_device_address(struct net_device *dev,
/* The input data is the GO's interface address which the application wants to know its device address. */
/* Format: iwpriv wlanx p2p_get2 go_devadd = 00:E0:4C:00:00:05 */

- DBG_88E("[%s] data = %s\n", __func__, (char *)extra);
if (copy_from_user(peerMACStr, wrqu->data.pointer + 10, 17))
return -EFAULT;

@@ -2788,7 +2652,6 @@ static int rtw_p2p_get_device_type(struct net_device *dev,
/* Such user interface could know the device type. */
/* Format: iwpriv wlanx p2p_get2 dev_type = 00:E0:4C:00:00:05 */

- DBG_88E("[%s] data = %s\n", __func__, (char *)extra);
if (copy_from_user(peerMACStr, wrqu->data.pointer + 9, 17))
return -EFAULT;

@@ -2864,7 +2727,6 @@ static int rtw_p2p_get_device_name(struct net_device *dev,
/* Such user interface could show peer device's device name instead of ssid. */
/* Format: iwpriv wlanx p2p_get2 devN = 00:E0:4C:00:00:05 */

- DBG_88E("[%s] data = %s\n", __func__, (char *)extra);
if (copy_from_user(peerMACStr, wrqu->data.pointer + 5, 17))
return -EFAULT;

@@ -2932,7 +2794,6 @@ static int rtw_p2p_get_invitation_procedure(struct net_device *dev,
/* The application wants to know P2P initiation procedure is supported or not. */
/* Format: iwpriv wlanx p2p_get2 InvProc = 00:E0:4C:00:00:05 */

- DBG_88E("[%s] data = %s\n", __func__, (char *)extra);
if (copy_from_user(peerMACStr, wrqu->data.pointer + 8, 17))
return -EFAULT;

@@ -3005,12 +2866,8 @@ static int rtw_p2p_connect(struct net_device *dev,
/* Format: 00:E0:4C:00:00:05 */
/* Format: 00:E0:4C:00:00:05 */

- DBG_88E("[%s] data = %s\n", __func__, extra);
-
- if (pwdinfo->p2p_state == P2P_STATE_NONE) {
- DBG_88E("[%s] WiFi Direct is disable!\n", __func__);
+ if (pwdinfo->p2p_state == P2P_STATE_NONE)
return ret;
- }

if (pwdinfo->ui_got_wps_info == P2P_NO_WPSINFO)
return -1;
@@ -3052,11 +2909,9 @@ static int rtw_p2p_connect(struct net_device *dev,
rtw_p2p_set_pre_state(pwdinfo, rtw_p2p_state(pwdinfo));
rtw_p2p_set_state(pwdinfo, P2P_STATE_GONEGO_ING);

- DBG_88E("[%s] Start PreTx Procedure!\n", __func__);
_set_timer(&pwdinfo->pre_tx_scan_timer, P2P_TX_PRESCAN_TIMEOUT);
_set_timer(&pwdinfo->restore_p2p_state_timer, P2P_GO_NEGO_TIMEOUT);
} else {
- DBG_88E("[%s] Not Found in Scanning Queue~\n", __func__);
ret = -1;
}
return ret;
@@ -3086,15 +2941,10 @@ static int rtw_p2p_invite_req(struct net_device *dev,
/* Command line sample: iwpriv wlan0 p2p_set invite ="00:11:22:33:44:55 00:E0:4C:00:00:05 DIRECT-xy" */
/* Format: 00:11:22:33:44:55 00:E0:4C:00:00:05 DIRECT-xy */

- DBG_88E("[%s] data = %s\n", __func__, extra);
-
- if (wrqu->data.length <= 37) {
- DBG_88E("[%s] Wrong format!\n", __func__);
+ if (wrqu->data.length <= 37)
return ret;
- }

if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE)) {
- DBG_88E("[%s] WiFi Direct is disable!\n", __func__);
return ret;
} else {
/* Reset the content of struct tx_invite_req_info */
@@ -3165,8 +3015,6 @@ static int rtw_p2p_invite_req(struct net_device *dev,
_set_timer(&pwdinfo->pre_tx_scan_timer, P2P_TX_PRESCAN_TIMEOUT);

_set_timer(&pwdinfo->restore_p2p_state_timer, P2P_INVITE_TIMEOUT);
- } else {
- DBG_88E("[%s] NOT Found in the Scanning Queue!\n", __func__);
}
return ret;
}
@@ -3183,10 +3031,7 @@ static int rtw_p2p_set_persistent(struct net_device *dev,
/* 0: disable persistent group functionality */
/* 1: enable persistent group founctionality */

- DBG_88E("[%s] data = %s\n", __func__, extra);
-
if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE)) {
- DBG_88E("[%s] WiFi Direct is disable!\n", __func__);
return ret;
} else {
if (extra[0] == '0') /* Disable the persistent group function. */
@@ -3226,10 +3071,7 @@ static int rtw_p2p_prov_disc(struct net_device *dev,
/* Format: 00:E0:4C:00:00:05_pbc */
/* Format: 00:E0:4C:00:00:05_label */

- DBG_88E("[%s] data = %s\n", __func__, extra);
-
if (pwdinfo->p2p_state == P2P_STATE_NONE) {
- DBG_88E("[%s] WiFi Direct is disable!\n", __func__);
return ret;
} else {
/* Reset the content of struct tx_provdisc_req_info excluded the wps_config_method_request. */
@@ -3253,7 +3095,6 @@ static int rtw_p2p_prov_disc(struct net_device *dev,
} else if (!memcmp(&extra[18], "label", 5)) {
pwdinfo->tx_prov_disc_info.wps_config_method_request = WPS_CM_LABEL;
} else {
- DBG_88E("[%s] Unknown WPS config methodn", __func__);
return ret;
}

@@ -3303,7 +3144,6 @@ static int rtw_p2p_prov_disc(struct net_device *dev,
spin_unlock_bh(&pmlmepriv->scanned_queue.lock);

if (peer_channel) {
- DBG_88E("[%s] peer channel: %d!\n", __func__, peer_channel);
memcpy(pwdinfo->tx_prov_disc_info.peerIFAddr, pnetwork->network.MacAddress, ETH_ALEN);
memcpy(pwdinfo->tx_prov_disc_info.peerDevAddr, peerMAC, ETH_ALEN);
pwdinfo->tx_prov_disc_info.peer_channel_num[0] = (u16)peer_channel;
@@ -3323,8 +3163,6 @@ static int rtw_p2p_prov_disc(struct net_device *dev,
_set_timer(&pwdinfo->pre_tx_scan_timer, P2P_TX_PRESCAN_TIMEOUT);

_set_timer(&pwdinfo->restore_p2p_state_timer, P2P_PROVISION_TIMEOUT);
- } else {
- DBG_88E("[%s] NOT Found in the Scanning Queue!\n", __func__);
}
return ret;
}
@@ -3340,7 +3178,6 @@ static int rtw_p2p_got_wpsinfo(struct net_device *dev,
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
struct wifidirect_info *pwdinfo = &padapter->wdinfo;

- DBG_88E("[%s] data = %s\n", __func__, extra);
/* Added by Albert 20110328 */
/* if the input data is P2P_NO_WPSINFO -> reset the wpsinfo */
/* if the input data is P2P_GOT_WPSINFO_PEER_DISPLAY_PIN -> the utility just input the PIN code got from the peer P2P device. */
@@ -3366,7 +3203,6 @@ static int rtw_p2p_set(struct net_device *dev,
{
int ret = 0;

- DBG_88E("[%s] extra = %s\n", __func__, extra);
if (!memcmp(extra, "enable =", 7)) {
rtw_wext_p2p_enable(dev, info, wrqu, &extra[7]);
} else if (!memcmp(extra, "setDN =", 6)) {
@@ -3422,10 +3258,6 @@ static int rtw_p2p_get(struct net_device *dev,
{
int ret = 0;

- struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
-
- if (padapter->bShowGetP2PState)
- DBG_88E("[%s] extra = %s\n", __func__, (char *)wrqu->data.pointer);
if (!memcmp(wrqu->data.pointer, "status", 6)) {
rtw_p2p_get_status(dev, info, wrqu, extra);
} else if (!memcmp(wrqu->data.pointer, "role", 4)) {
@@ -3454,7 +3286,6 @@ static int rtw_p2p_get2(struct net_device *dev,
{
int ret = 0;

- DBG_88E("[%s] extra = %s\n", __func__, (char *)wrqu->data.pointer);
if (!memcmp(extra, "wpsCM =", 6)) {
wrqu->data.length -= 6;
rtw_p2p_get_wps_configmethod(dev, info, wrqu, &extra[6]);
@@ -3501,7 +3332,6 @@ static int rtw_rereg_nd_name(struct net_device *dev,
if (0 == strcmp(rereg_priv->old_ifname, new_ifname))
return ret;

- DBG_88E("%s new_ifname:%s\n", __func__, new_ifname);
ret = rtw_change_ifname(padapter, new_ifname);
if (0 != ret)
goto exit;
@@ -3516,7 +3346,6 @@ static int rtw_rereg_nd_name(struct net_device *dev,
rereg_priv->old_ifname[IFNAMSIZ - 1] = 0;

if (!memcmp(new_ifname, "disable%d", 9)) {
- DBG_88E("%s disable\n", __func__);
/* free network queue for Android's timming issue */
rtw_free_network_queue(padapter, true);

@@ -3594,14 +3423,9 @@ static int rtw_dbg_port(struct net_device *dev,
u16 arg;
s32 extra_arg;
u32 *pdata, val32;
- struct sta_info *psta;
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
- struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
- struct security_priv *psecuritypriv = &padapter->securitypriv;
- struct wlan_network *cur_network = &pmlmepriv->cur_network;
- struct sta_priv *pstapriv = &padapter->stapriv;

pdata = (u32 *)&wrqu->data;

@@ -3613,48 +3437,24 @@ static int rtw_dbg_port(struct net_device *dev,
extra_arg = *(pdata + 1);

switch (major_cmd) {
- case 0x70:/* read_reg */
- switch (minor_cmd) {
- case 1:
- DBG_88E("rtw_read8(0x%x) = 0x%02x\n", arg, rtw_read8(padapter, arg));
- break;
- case 2:
- DBG_88E("rtw_read16(0x%x) = 0x%04x\n", arg, rtw_read16(padapter, arg));
- break;
- case 4:
- DBG_88E("rtw_read32(0x%x) = 0x%08x\n", arg, rtw_read32(padapter, arg));
- break;
- }
- break;
case 0x71:/* write_reg */
switch (minor_cmd) {
case 1:
rtw_write8(padapter, arg, extra_arg);
- DBG_88E("rtw_write8(0x%x) = 0x%02x\n", arg, rtw_read8(padapter, arg));
break;
case 2:
rtw_write16(padapter, arg, extra_arg);
- DBG_88E("rtw_write16(0x%x) = 0x%04x\n", arg, rtw_read16(padapter, arg));
break;
case 4:
rtw_write32(padapter, arg, extra_arg);
- DBG_88E("rtw_write32(0x%x) = 0x%08x\n", arg, rtw_read32(padapter, arg));
break;
}
break;
- case 0x72:/* read_bb */
- DBG_88E("read_bbreg(0x%x) = 0x%x\n", arg, rtl8188e_PHY_QueryBBReg(padapter, arg, 0xffffffff));
- break;
case 0x73:/* write_bb */
rtl8188e_PHY_SetBBReg(padapter, arg, 0xffffffff, extra_arg);
- DBG_88E("write_bbreg(0x%x) = 0x%x\n", arg, rtl8188e_PHY_QueryBBReg(padapter, arg, 0xffffffff));
- break;
- case 0x74:/* read_rf */
- DBG_88E("read RF_reg path(0x%02x), offset(0x%x), value(0x%08x)\n", minor_cmd, arg, rtl8188e_PHY_QueryRFReg(padapter, minor_cmd, arg, 0xffffffff));
break;
case 0x75:/* write_rf */
rtl8188e_PHY_SetRFReg(padapter, minor_cmd, arg, 0xffffffff, extra_arg);
- DBG_88E("write RF_reg path(0x%02x), offset(0x%x), value(0x%08x)\n", minor_cmd, arg, rtl8188e_PHY_QueryRFReg(padapter, minor_cmd, arg, 0xffffffff));
break;

case 0x76:
@@ -3717,7 +3517,6 @@ static int rtw_dbg_port(struct net_device *dev,
u16 start_value = 0;
u32 write_num = extra_arg;
int i;
- u8 final;
struct xmit_frame *xmit_frame;

xmit_frame = rtw_IOL_accquire_xmit_frame(padapter);
@@ -3731,11 +3530,7 @@ static int rtw_dbg_port(struct net_device *dev,
if (rtl8188e_IOL_exec_cmds_sync(padapter, xmit_frame, 5000, 0) != _SUCCESS)
ret = -EPERM;

- final = rtw_read8(padapter, reg);
- if (start_value + write_num - 1 == final)
- DBG_88E("continuous IOL_CMD_WB_REG to 0x%x %u times Success, start:%u, final:%u\n", reg, write_num, start_value, final);
- else
- DBG_88E("continuous IOL_CMD_WB_REG to 0x%x %u times Fail, start:%u, final:%u\n", reg, write_num, start_value, final);
+ rtw_read8(padapter, reg);
}
break;

@@ -3746,7 +3541,6 @@ static int rtw_dbg_port(struct net_device *dev,
u32 write_num = extra_arg;

int i;
- u16 final;
struct xmit_frame *xmit_frame;

xmit_frame = rtw_IOL_accquire_xmit_frame(padapter);
@@ -3760,11 +3554,7 @@ static int rtw_dbg_port(struct net_device *dev,
if (rtl8188e_IOL_exec_cmds_sync(padapter, xmit_frame, 5000, 0) != _SUCCESS)
ret = -EPERM;

- final = rtw_read16(padapter, reg);
- if (start_value + write_num - 1 == final)
- DBG_88E("continuous IOL_CMD_WW_REG to 0x%x %u times Success, start:%u, final:%u\n", reg, write_num, start_value, final);
- else
- DBG_88E("continuous IOL_CMD_WW_REG to 0x%x %u times Fail, start:%u, final:%u\n", reg, write_num, start_value, final);
+ rtw_read16(padapter, reg);
}
break;
case 0x08: /* continuous write dword test */
@@ -3774,7 +3564,6 @@ static int rtw_dbg_port(struct net_device *dev,
u32 write_num = extra_arg;

int i;
- u32 final;
struct xmit_frame *xmit_frame;

xmit_frame = rtw_IOL_accquire_xmit_frame(padapter);
@@ -3788,13 +3577,7 @@ static int rtw_dbg_port(struct net_device *dev,
if (rtl8188e_IOL_exec_cmds_sync(padapter, xmit_frame, 5000, 0) != _SUCCESS)
ret = -EPERM;

- final = rtw_read32(padapter, reg);
- if (start_value + write_num - 1 == final)
- DBG_88E("continuous IOL_CMD_WD_REG to 0x%x %u times Success, start:%u, final:%u\n",
- reg, write_num, start_value, final);
- else
- DBG_88E("continuous IOL_CMD_WD_REG to 0x%x %u times Fail, start:%u, final:%u\n",
- reg, write_num, start_value, final);
+ rtw_read32(padapter, reg);
}
break;
}
@@ -3809,8 +3592,6 @@ static int rtw_dbg_port(struct net_device *dev,
u8 sign = minor_cmd;
u16 write_value = 0;

- DBG_88E("%s set RESP_TXAGC to %s %u\n", __func__, sign ? "minus" : "plus", value);
-
if (sign)
value = value | 0x10;

@@ -3824,140 +3605,23 @@ static int rtw_dbg_port(struct net_device *dev,
break;
case 0x7F:
switch (minor_cmd) {
- case 0x0:
- DBG_88E("fwstate = 0x%x\n", get_fwstate(pmlmepriv));
- break;
- case 0x01:
- DBG_88E("auth_alg = 0x%x, enc_alg = 0x%x, auth_type = 0x%x, enc_type = 0x%x\n",
- psecuritypriv->dot11AuthAlgrthm, psecuritypriv->dot11PrivacyAlgrthm,
- psecuritypriv->ndisauthtype, psecuritypriv->ndisencryptstatus);
- break;
- case 0x02:
- DBG_88E("pmlmeinfo->state = 0x%x\n", pmlmeinfo->state);
- break;
- case 0x03:
- DBG_88E("qos_option =%d\n", pmlmepriv->qospriv.qos_option);
- DBG_88E("ht_option =%d\n", pmlmepriv->htpriv.ht_option);
- break;
- case 0x04:
- DBG_88E("cur_ch =%d\n", pmlmeext->cur_channel);
- DBG_88E("cur_bw =%d\n", pmlmeext->cur_bwmode);
- DBG_88E("cur_ch_off =%d\n", pmlmeext->cur_ch_offset);
- break;
- case 0x05:
- psta = rtw_get_stainfo(pstapriv, cur_network->network.MacAddress);
- if (psta) {
- int i;
- struct recv_reorder_ctrl *preorder_ctrl;
-
- DBG_88E("SSID =%s\n", cur_network->network.Ssid.Ssid);
- DBG_88E("sta's macaddr: %pM\n", psta->hwaddr);
- DBG_88E("cur_channel =%d, cur_bwmode =%d, cur_ch_offset =%d\n", pmlmeext->cur_channel, pmlmeext->cur_bwmode, pmlmeext->cur_ch_offset);
- DBG_88E("rtsen =%d, cts2slef =%d\n", psta->rtsen, psta->cts2self);
- DBG_88E("state = 0x%x, aid =%d, macid =%d, raid =%d\n", psta->state, psta->aid, psta->mac_id, psta->raid);
- DBG_88E("qos_en =%d, ht_en =%d, init_rate =%d\n", psta->qos_option, psta->htpriv.ht_option, psta->init_rate);
- DBG_88E("bwmode =%d, ch_offset =%d, sgi =%d\n", psta->htpriv.bwmode, psta->htpriv.ch_offset, psta->htpriv.sgi);
- DBG_88E("ampdu_enable = %d\n", psta->htpriv.ampdu_enable);
- DBG_88E("agg_enable_bitmap =%x, candidate_tid_bitmap =%x\n", psta->htpriv.agg_enable_bitmap, psta->htpriv.candidate_tid_bitmap);
- for (i = 0; i < 16; i++) {
- preorder_ctrl = &psta->recvreorder_ctrl[i];
- if (preorder_ctrl->enable)
- DBG_88E("tid =%d, indicate_seq =%d\n", i, preorder_ctrl->indicate_seq);
- }
- } else {
- DBG_88E("can't get sta's macaddr, cur_network's macaddr:%pM\n", (cur_network->network.MacAddress));
- }
- break;
case 0x06:
{
u32 ODMFlag;
GetHwReg8188EU(padapter, HW_VAR_DM_FLAG, (u8 *)(&ODMFlag));
- DBG_88E("(B)DMFlag = 0x%x, arg = 0x%x\n", ODMFlag, arg);
ODMFlag = (u32)(0x0f & arg);
- DBG_88E("(A)DMFlag = 0x%x\n", ODMFlag);
SetHwReg8188EU(padapter, HW_VAR_DM_FLAG, (u8 *)(&ODMFlag));
}
break;
- case 0x07:
- DBG_88E("bSurpriseRemoved =%d, bDriverStopped =%d\n",
- padapter->bSurpriseRemoved, padapter->bDriverStopped);
- break;
- case 0x08:
- {
- struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
- struct recv_priv *precvpriv = &padapter->recvpriv;
-
- DBG_88E("free_xmitbuf_cnt =%d, free_xmitframe_cnt =%d, free_xmit_extbuf_cnt =%d\n",
- pxmitpriv->free_xmitbuf_cnt, pxmitpriv->free_xmitframe_cnt, pxmitpriv->free_xmit_extbuf_cnt);
- DBG_88E("rx_urb_pending_cn =%d\n", precvpriv->rx_pending_cnt);
- }
- break;
- case 0x09:
- {
- int i, j;
- struct list_head *plist, *phead;
- struct recv_reorder_ctrl *preorder_ctrl;
-
- DBG_88E("sta_dz_bitmap = 0x%x, tim_bitmap = 0x%x\n", pstapriv->sta_dz_bitmap, pstapriv->tim_bitmap);
- spin_lock_bh(&pstapriv->sta_hash_lock);
-
- for (i = 0; i < NUM_STA; i++) {
- phead = &pstapriv->sta_hash[i];
- plist = phead->next;
-
- while (phead != plist) {
- psta = container_of(plist, struct sta_info, hash_list);
-
- plist = plist->next;
-
- if (extra_arg == psta->aid) {
- DBG_88E("sta's macaddr:%pM\n", (psta->hwaddr));
- DBG_88E("rtsen =%d, cts2slef =%d\n", psta->rtsen, psta->cts2self);
- DBG_88E("state = 0x%x, aid =%d, macid =%d, raid =%d\n", psta->state, psta->aid, psta->mac_id, psta->raid);
- DBG_88E("qos_en =%d, ht_en =%d, init_rate =%d\n", psta->qos_option, psta->htpriv.ht_option, psta->init_rate);
- DBG_88E("bwmode =%d, ch_offset =%d, sgi =%d\n", psta->htpriv.bwmode, psta->htpriv.ch_offset, psta->htpriv.sgi);
- DBG_88E("ampdu_enable = %d\n", psta->htpriv.ampdu_enable);
- DBG_88E("agg_enable_bitmap =%x, candidate_tid_bitmap =%x\n", psta->htpriv.agg_enable_bitmap, psta->htpriv.candidate_tid_bitmap);
-
- DBG_88E("capability = 0x%x\n", psta->capability);
- DBG_88E("flags = 0x%x\n", psta->flags);
- DBG_88E("wpa_psk = 0x%x\n", psta->wpa_psk);
- DBG_88E("wpa2_group_cipher = 0x%x\n", psta->wpa2_group_cipher);
- DBG_88E("wpa2_pairwise_cipher = 0x%x\n", psta->wpa2_pairwise_cipher);
- DBG_88E("qos_info = 0x%x\n", psta->qos_info);
- DBG_88E("dot118021XPrivacy = 0x%x\n", psta->dot118021XPrivacy);
-
- for (j = 0; j < 16; j++) {
- preorder_ctrl = &psta->recvreorder_ctrl[j];
- if (preorder_ctrl->enable)
- DBG_88E("tid =%d, indicate_seq =%d\n", j, preorder_ctrl->indicate_seq);
- }
- }
- }
- }
- spin_unlock_bh(&pstapriv->sta_hash_lock);
- }
- break;
case 0x0c:/* dump rx/tx packet */
- if (arg == 0) {
- DBG_88E("dump rx packet (%d)\n", extra_arg);
+ if (arg == 0)
SetHalDefVar8188EUsb(padapter, HAL_DEF_DBG_DUMP_RXPKT, &extra_arg);
- } else if (arg == 1) {
- DBG_88E("dump tx packet (%d)\n", extra_arg);
+ else if (arg == 1)
SetHalDefVar8188EUsb(padapter, HAL_DEF_DBG_DUMP_TXPKT, &extra_arg);
- }
- break;
- case 0x15:
- {
- struct pwrctrl_priv *pwrpriv = &padapter->pwrctrlpriv;
- DBG_88E("==>silent resete cnts:%d\n", pwrpriv->ips_enter_cnts);
- }
break;
case 0x10:/* driver version display */
- DBG_88E("rtw driver version =%s\n", DRIVERVERSION);
break;
case 0x11:
- DBG_88E("turn %s Rx RSSI display function\n", (extra_arg == 1) ? "on" : "off");
padapter->bRxRSSIDisplay = extra_arg;
break;
case 0x12: /* set rx_stbc */
@@ -3970,9 +3634,6 @@ static int rtw_dbg_port(struct net_device *dev,
extra_arg == 2 ||
extra_arg == 3) {
pregpriv->rx_stbc = extra_arg;
- DBG_88E("set rx_stbc =%d\n", pregpriv->rx_stbc);
- } else {
- DBG_88E("get rx_stbc =%d\n", pregpriv->rx_stbc);
}
}
break;
@@ -3982,24 +3643,13 @@ static int rtw_dbg_port(struct net_device *dev,
/* 0: disable, 0x1:enable (but wifi_spec should be 0), 0x2: force enable (don't care wifi_spec) */
if (extra_arg >= 0 && extra_arg < 3) {
pregpriv->ampdu_enable = extra_arg;
- DBG_88E("set ampdu_enable =%d\n", pregpriv->ampdu_enable);
- } else {
- DBG_88E("get ampdu_enable =%d\n", pregpriv->ampdu_enable);
}
}
break;
- case 0x14: /* get wifi_spec */
- {
- struct registry_priv *pregpriv = &padapter->registrypriv;
- DBG_88E("get wifi_spec =%d\n", pregpriv->wifi_spec);
- }
- break;
case 0x23:
- DBG_88E("turn %s the bNotifyChannelChange Variable\n", (extra_arg == 1) ? "on" : "off");
padapter->bNotifyChannelChange = extra_arg;
break;
case 0x24:
- DBG_88E("turn %s the bShowGetP2PState Variable\n", (extra_arg == 1) ? "on" : "off");
padapter->bShowGetP2PState = extra_arg;
break;
case 0xdd:/* registers dump, 0 for mac reg, 1 for bb reg, 2 for rf reg */
@@ -4014,16 +3664,8 @@ static int rtw_dbg_port(struct net_device *dev,
{
u32 odm_flag;

- if (0xf == extra_arg) {
+ if (extra_arg == 0xf) {
GetHalDefVar8188EUsb(padapter, HAL_DEF_DBG_DM_FUNC, &odm_flag);
- DBG_88E(" === DMFlag(0x%08x) ===\n", odm_flag);
- DBG_88E("extra_arg = 0 - disable all dynamic func\n");
- DBG_88E("extra_arg = 1 - disable DIG- BIT(0)\n");
- DBG_88E("extra_arg = 2 - disable High power - BIT(1)\n");
- DBG_88E("extra_arg = 3 - disable tx power tracking - BIT(2)\n");
- DBG_88E("extra_arg = 4 - disable BT coexistence - BIT(3)\n");
- DBG_88E("extra_arg = 5 - disable antenna diversity - BIT(4)\n");
- DBG_88E("extra_arg = 6 - enable all dynamic func\n");
} else {
/* extra_arg = 0 - disable all dynamic func
extra_arg = 1 - disable DIG
@@ -4032,51 +3674,17 @@ static int rtw_dbg_port(struct net_device *dev,
*/
SetHalDefVar8188EUsb(padapter, HAL_DEF_DBG_DM_FUNC, &extra_arg);
GetHalDefVar8188EUsb(padapter, HAL_DEF_DBG_DM_FUNC, &odm_flag);
- DBG_88E(" === DMFlag(0x%08x) ===\n", odm_flag);
}
}
break;

case 0xfd:
rtw_write8(padapter, 0xc50, arg);
- DBG_88E("wr(0xc50) = 0x%x\n", rtw_read8(padapter, 0xc50));
rtw_write8(padapter, 0xc58, arg);
- DBG_88E("wr(0xc58) = 0x%x\n", rtw_read8(padapter, 0xc58));
- break;
- case 0xfe:
- DBG_88E("rd(0xc50) = 0x%x\n", rtw_read8(padapter, 0xc50));
- DBG_88E("rd(0xc58) = 0x%x\n", rtw_read8(padapter, 0xc58));
- break;
- case 0xff:
- DBG_88E("dbg(0x210) = 0x%x\n", rtw_read32(padapter, 0x210));
- DBG_88E("dbg(0x608) = 0x%x\n", rtw_read32(padapter, 0x608));
- DBG_88E("dbg(0x280) = 0x%x\n", rtw_read32(padapter, 0x280));
- DBG_88E("dbg(0x284) = 0x%x\n", rtw_read32(padapter, 0x284));
- DBG_88E("dbg(0x288) = 0x%x\n", rtw_read32(padapter, 0x288));
-
- DBG_88E("dbg(0x664) = 0x%x\n", rtw_read32(padapter, 0x664));
-
- DBG_88E("\n");
-
- DBG_88E("dbg(0x430) = 0x%x\n", rtw_read32(padapter, 0x430));
- DBG_88E("dbg(0x438) = 0x%x\n", rtw_read32(padapter, 0x438));
-
- DBG_88E("dbg(0x440) = 0x%x\n", rtw_read32(padapter, 0x440));
-
- DBG_88E("dbg(0x458) = 0x%x\n", rtw_read32(padapter, 0x458));
-
- DBG_88E("dbg(0x484) = 0x%x\n", rtw_read32(padapter, 0x484));
- DBG_88E("dbg(0x488) = 0x%x\n", rtw_read32(padapter, 0x488));
-
- DBG_88E("dbg(0x444) = 0x%x\n", rtw_read32(padapter, 0x444));
- DBG_88E("dbg(0x448) = 0x%x\n", rtw_read32(padapter, 0x448));
- DBG_88E("dbg(0x44c) = 0x%x\n", rtw_read32(padapter, 0x44c));
- DBG_88E("dbg(0x450) = 0x%x\n", rtw_read32(padapter, 0x450));
break;
}
break;
default:
- DBG_88E("error dbg cmd!\n");
break;
}
return ret;
@@ -4153,8 +3761,6 @@ static int rtw_pm_set(struct net_device *dev,
unsigned mode = 0;
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);

- DBG_88E("[%s] extra = %s\n", __func__, extra);
-
if (!memcmp(extra, "lps =", 4)) {
sscanf(extra + 4, "%u", &mode);
ret = rtw_pm_set_lps(padapter, mode);
--
2.34.1

2022-01-25 08:51:19

by Phillip Potter

[permalink] [raw]
Subject: [PATCH 09/10] staging: r8188eu: remove DBG_88E macro definition

Remove DBG_88E macro definition as it has no remaining callers within
the driver. This is part of the ongoing effort to cleanup the driver to
use standard debug mechanisms where appropriate.

Signed-off-by: Phillip Potter <[email protected]>
---
drivers/staging/r8188eu/include/rtw_debug.h | 6 ------
1 file changed, 6 deletions(-)

diff --git a/drivers/staging/r8188eu/include/rtw_debug.h b/drivers/staging/r8188eu/include/rtw_debug.h
index 311051757715..959fb6bd25ca 100644
--- a/drivers/staging/r8188eu/include/rtw_debug.h
+++ b/drivers/staging/r8188eu/include/rtw_debug.h
@@ -54,10 +54,4 @@

extern u32 GlobalDebugLevel;

-#define DBG_88E(...) \
- do { \
- if (_drv_err_ <= GlobalDebugLevel) \
- pr_info(DRIVER_PREFIX __VA_ARGS__); \
- } while (0)
-
#endif /* __RTW_DEBUG_H__ */
--
2.34.1

2022-01-25 08:55:33

by Phillip Potter

[permalink] [raw]
Subject: [PATCH 05/10] staging: r8188eu: remove smaller sets of DBG_88E calls from os_dep dir

Remove all DBG_88E calls from the os_dep directory, other than those in
os_dep/ioctl_linux.c, as this contains almost 200 on its own so will be
done in a separate patch for ease of review. These calls do not conform
to kernel coding standards and are superfluous. Also restructure where
appropriate to remove no longer needed code left behind by removal of
these calls. This will allow the eventual removal of the DBG_88E macro
itself.

Signed-off-by: Phillip Potter <[email protected]>
---
drivers/staging/r8188eu/os_dep/mlme_linux.c | 4 -
drivers/staging/r8188eu/os_dep/os_intfs.c | 33 +-------
.../staging/r8188eu/os_dep/osdep_service.c | 2 -
drivers/staging/r8188eu/os_dep/usb_intf.c | 84 ++-----------------
.../staging/r8188eu/os_dep/usb_ops_linux.c | 18 +---
drivers/staging/r8188eu/os_dep/xmit_linux.c | 6 +-
6 files changed, 14 insertions(+), 133 deletions(-)

diff --git a/drivers/staging/r8188eu/os_dep/mlme_linux.c b/drivers/staging/r8188eu/os_dep/mlme_linux.c
index f7ce724ebf87..72ad9700130e 100644
--- a/drivers/staging/r8188eu/os_dep/mlme_linux.c
+++ b/drivers/staging/r8188eu/os_dep/mlme_linux.c
@@ -181,8 +181,6 @@ void rtw_indicate_sta_assoc_event(struct adapter *padapter, struct sta_info *pst

memcpy(wrqu.addr.sa_data, psta->hwaddr, ETH_ALEN);

- DBG_88E("+rtw_indicate_sta_assoc_event\n");
-
wireless_send_event(padapter->pnetdev, IWEVREGISTERED, &wrqu, NULL);
}

@@ -204,7 +202,5 @@ void rtw_indicate_sta_disassoc_event(struct adapter *padapter, struct sta_info *

memcpy(wrqu.addr.sa_data, psta->hwaddr, ETH_ALEN);

- DBG_88E("+rtw_indicate_sta_disassoc_event\n");
-
wireless_send_event(padapter->pnetdev, IWEVEXPIRED, &wrqu, NULL);
}
diff --git a/drivers/staging/r8188eu/os_dep/os_intfs.c b/drivers/staging/r8188eu/os_dep/os_intfs.c
index b65e44f97826..17249b4fb7ad 100644
--- a/drivers/staging/r8188eu/os_dep/os_intfs.c
+++ b/drivers/staging/r8188eu/os_dep/os_intfs.c
@@ -362,7 +362,6 @@ struct net_device *rtw_init_netdev(struct adapter *old_padapter)
pnetdev->dev.type = &wlan_type;
padapter = rtw_netdev_priv(pnetdev);
padapter->pnetdev = pnetdev;
- DBG_88E("register rtw_netdev_ops to netdev_ops\n");
pnetdev->netdev_ops = &rtw_netdev_ops;
pnetdev->watchdog_timeo = HZ * 3; /* 3 second timeout */
pnetdev->wireless_handlers = (struct iw_handler_def *)&rtw_handlers_def;
@@ -492,20 +491,14 @@ u8 rtw_init_drv_sw(struct adapter *padapter)
if (init_mlme_ext_priv(padapter) == _FAIL)
return _FAIL;

- if (_rtw_init_xmit_priv(&padapter->xmitpriv, padapter) == _FAIL) {
- DBG_88E("Can't _rtw_init_xmit_priv\n");
+ if (_rtw_init_xmit_priv(&padapter->xmitpriv, padapter) == _FAIL)
return _FAIL;
- }

- if (_rtw_init_recv_priv(&padapter->recvpriv, padapter) == _FAIL) {
- DBG_88E("Can't _rtw_init_recv_priv\n");
+ if (_rtw_init_recv_priv(&padapter->recvpriv, padapter) == _FAIL)
return _FAIL;
- }

- if (_rtw_init_sta_priv(&padapter->stapriv) == _FAIL) {
- DBG_88E("Can't _rtw_init_sta_priv\n");
+ if (_rtw_init_sta_priv(&padapter->stapriv) == _FAIL)
return _FAIL;
- }

padapter->stapriv.padapter = padapter;

@@ -611,8 +604,6 @@ int _netdev_open(struct net_device *pnetdev)
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(pnetdev);
struct pwrctrl_priv *pwrctrlpriv = &padapter->pwrctrlpriv;

- DBG_88E("+88eu_drv - drv_open, bup =%d\n", padapter->bup);
-
if (pwrctrlpriv->ps_flag) {
padapter->net_closed = false;
goto netdev_open_normal_process;
@@ -661,14 +652,12 @@ int _netdev_open(struct net_device *pnetdev)
netdev_br_init(pnetdev);

netdev_open_normal_process:
- DBG_88E("-88eu_drv - drv_open, bup =%d\n", padapter->bup);
return 0;

netdev_open_error:
padapter->bup = false;
netif_carrier_off(pnetdev);
rtw_netif_stop_queue(pnetdev);
- DBG_88E("-88eu_drv - drv_open fail, bup =%d\n", padapter->bup);
return -1;
}

@@ -687,7 +676,6 @@ static int ips_netdrv_open(struct adapter *padapter)
{
int status = _SUCCESS;
padapter->net_closed = false;
- DBG_88E("===> %s.........\n", __func__);

padapter->bDriverStopped = false;
padapter->bSurpriseRemoved = false;
@@ -706,31 +694,23 @@ static int ips_netdrv_open(struct adapter *padapter)
return _SUCCESS;

netdev_open_error:
- DBG_88E("-ips_netdrv_open - drv_open failure, bup =%d\n", padapter->bup);
-
return _FAIL;
}

int rtw_ips_pwr_up(struct adapter *padapter)
{
int result;
- u32 start_time = jiffies;
- DBG_88E("===> rtw_ips_pwr_up..............\n");
rtw_reset_drv_sw(padapter);

result = ips_netdrv_open(padapter);

rtw_led_control(padapter, LED_CTL_NO_LINK);

- DBG_88E("<=== rtw_ips_pwr_up.............. in %dms\n", rtw_get_passing_time_ms(start_time));
return result;
}

void rtw_ips_pwr_down(struct adapter *padapter)
{
- u32 start_time = jiffies;
- DBG_88E("===> rtw_ips_pwr_down...................\n");
-
padapter->bCardDisableWOHSM = true;
padapter->net_closed = true;

@@ -738,13 +718,10 @@ void rtw_ips_pwr_down(struct adapter *padapter)

rtw_ips_dev_unload(padapter);
padapter->bCardDisableWOHSM = false;
- DBG_88E("<=== rtw_ips_pwr_down..................... in %dms\n", rtw_get_passing_time_ms(start_time));
}

void rtw_ips_dev_unload(struct adapter *padapter)
{
- DBG_88E("====> %s...\n", __func__);
-
SetHwReg8188EU(padapter, HW_VAR_FIFO_CLEARN_UP, NULL);

if (padapter->intf_stop)
@@ -763,9 +740,6 @@ int netdev_close(struct net_device *pnetdev)
padapter->net_closed = true;

if (padapter->pwrctrlpriv.rf_pwrstate == rf_on) {
- DBG_88E("(2)88eu_drv - drv_close, bup =%d, hw_init_completed =%d\n",
- padapter->bup, padapter->hw_init_completed);
-
/* s1. */
if (pnetdev) {
if (!rtw_netif_queue_stopped(pnetdev))
@@ -792,6 +766,5 @@ int netdev_close(struct net_device *pnetdev)
kfree(dvobj->firmware.szFwBuffer);
dvobj->firmware.szFwBuffer = NULL;

- DBG_88E("-88eu_drv - drv_close, bup =%d\n", padapter->bup);
return 0;
}
diff --git a/drivers/staging/r8188eu/os_dep/osdep_service.c b/drivers/staging/r8188eu/os_dep/osdep_service.c
index 59bdd0abea7e..7a6fcc96081a 100644
--- a/drivers/staging/r8188eu/os_dep/osdep_service.c
+++ b/drivers/staging/r8188eu/os_dep/osdep_service.c
@@ -236,8 +236,6 @@ void *rtw_cbuf_pop(struct rtw_cbuf *cbuf)
if (rtw_cbuf_empty(cbuf))
return NULL;

- if (0)
- DBG_88E("%s on %u\n", __func__, cbuf->read);
buf = cbuf->bufs[cbuf->read];
cbuf->read = (cbuf->read + 1) % cbuf->size;

diff --git a/drivers/staging/r8188eu/os_dep/usb_intf.c b/drivers/staging/r8188eu/os_dep/usb_intf.c
index 91792dfd3bbe..adb46c353cf8 100644
--- a/drivers/staging/r8188eu/os_dep/usb_intf.c
+++ b/drivers/staging/r8188eu/os_dep/usb_intf.c
@@ -117,13 +117,10 @@ static struct dvobj_priv *usb_dvobj_init(struct usb_interface *usb_intf)
if (rt_num_in_pipes != 1)
goto err;

- if (pusbd->speed == USB_SPEED_HIGH) {
+ if (pusbd->speed == USB_SPEED_HIGH)
pdvobjpriv->ishighspeed = true;
- DBG_88E("USB_SPEED_HIGH\n");
- } else {
+ else
pdvobjpriv->ishighspeed = false;
- DBG_88E("NON USB_SPEED_HIGH\n");
- }

/* 3 misc */
sema_init(&pdvobjpriv->usb_suspend_sema, 0);
@@ -148,15 +145,13 @@ static void usb_dvobj_deinit(struct usb_interface *usb_intf)
dvobj->NumInterfaces != 3) ||
(dvobj->InterfaceNumber == 1)) {
if (interface_to_usbdev(usb_intf)->state !=
- USB_STATE_NOTATTACHED) {
+ USB_STATE_NOTATTACHED)
/* If we didn't unplug usb dongle and
* remove/insert module, driver fails
* on sitesurvey for the first time when
* device is up . Reset usb port for sitesurvey
* fail issue. */
- DBG_88E("usb attached..., try to reset usb device\n");
usb_reset_device(interface_to_usbdev(usb_intf));
- }
}
kfree(dvobj);
}
@@ -184,7 +179,6 @@ static void usb_intf_stop(struct adapter *padapter)
static void rtw_dev_unload(struct adapter *padapter)
{
if (padapter->bup) {
- DBG_88E("===> rtw_dev_unload\n");
padapter->bDriverStopped = true;
if (padapter->xmitpriv.ack_tx)
rtw_ack_tx_done(&padapter->xmitpriv, RTW_SCTX_DONE_DRV_STOP);
@@ -202,8 +196,6 @@ static void rtw_dev_unload(struct adapter *padapter)

padapter->bup = false;
}
-
- DBG_88E("<=== rtw_dev_unload\n");
}

static int rtw_suspend(struct usb_interface *pusb_intf, pm_message_t message)
@@ -215,18 +207,10 @@ static int rtw_suspend(struct usb_interface *pusb_intf, pm_message_t message)
struct pwrctrl_priv *pwrpriv = &padapter->pwrctrlpriv;

int ret = 0;
- u32 start_time = jiffies;
-
-
- DBG_88E("==> %s (%s:%d)\n", __func__, current->comm, current->pid);

if ((!padapter->bup) || (padapter->bDriverStopped) ||
- (padapter->bSurpriseRemoved)) {
- DBG_88E("padapter->bup=%d bDriverStopped=%d bSurpriseRemoved = %d\n",
- padapter->bup, padapter->bDriverStopped,
- padapter->bSurpriseRemoved);
+ (padapter->bSurpriseRemoved))
goto exit;
- }

pwrpriv->bInSuspend = true;
rtw_cancel_all_timer(padapter);
@@ -243,16 +227,9 @@ static int rtw_suspend(struct usb_interface *pusb_intf, pm_message_t message)
rtw_disassoc_cmd(padapter, 0, false);

if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) &&
- check_fwstate(pmlmepriv, _FW_LINKED)) {
- DBG_88E("%s:%d %s(%pM), length:%d assoc_ssid.length:%d\n",
- __func__, __LINE__,
- pmlmepriv->cur_network.network.Ssid.Ssid,
- pmlmepriv->cur_network.network.MacAddress,
- pmlmepriv->cur_network.network.Ssid.SsidLength,
- pmlmepriv->assoc_ssid.SsidLength);
-
+ check_fwstate(pmlmepriv, _FW_LINKED))
pmlmepriv->to_roaming = 1;
- }
+
/* s2-2. indicate disconnect to os */
rtw_indicate_disconnect(padapter);
/* s2-3. */
@@ -270,9 +247,6 @@ static int rtw_suspend(struct usb_interface *pusb_intf, pm_message_t message)
rtw_indicate_disconnect(padapter);

exit:
- DBG_88E("<=== %s return %d.............. in %dms\n", __func__
- , ret, rtw_get_passing_time_ms(start_time));
-
return ret;
}

@@ -283,9 +257,6 @@ static int rtw_resume(struct usb_interface *pusb_intf)
struct net_device *pnetdev;
struct pwrctrl_priv *pwrpriv = NULL;
int ret = -1;
- u32 start_time = jiffies;
-
- DBG_88E("==> %s (%s:%d)\n", __func__, current->comm, current->pid);

pnetdev = padapter->pnetdev;
pwrpriv = &padapter->pwrctrlpriv;
@@ -295,7 +266,6 @@ static int rtw_resume(struct usb_interface *pusb_intf)
if (pwrpriv)
pwrpriv->bkeepfwalive = false;

- DBG_88E("bkeepfwalive(%x)\n", pwrpriv->bkeepfwalive);
if (netdev_open(pnetdev) != 0) {
mutex_unlock(&pwrpriv->lock);
goto exit;
@@ -306,10 +276,8 @@ static int rtw_resume(struct usb_interface *pusb_intf)

mutex_unlock(&pwrpriv->lock);

- if (padapter->pid[1] != 0) {
- DBG_88E("pid[1]:%d\n", padapter->pid[1]);
+ if (padapter->pid[1] != 0)
rtw_signal_process(padapter->pid[1], SIGUSR2);
- }

rtw_roaming(padapter, NULL);

@@ -317,9 +285,6 @@ static int rtw_resume(struct usb_interface *pusb_intf)
exit:
if (pwrpriv)
pwrpriv->bInSuspend = false;
- DBG_88E("<=== %s return %d.............. in %dms\n", __func__,
- ret, rtw_get_passing_time_ms(start_time));
-

return ret;
}
@@ -388,36 +353,20 @@ static struct adapter *rtw_usb_if1_init(struct dvobj_priv *dvobj,
dvobj->pusbdev->do_remote_wakeup = 1;
pusb_intf->needs_remote_wakeup = 1;
device_init_wakeup(&pusb_intf->dev, 1);
- DBG_88E("\n padapter->pwrctrlpriv.bSupportRemoteWakeup~~~[%d]~~~\n",
- device_may_wakeup(&pusb_intf->dev));
}
#endif

- /* 2012-07-11 Move here to prevent the 8723AS-VAU BT auto
- * suspend influence */
- if (usb_autopm_get_interface(pusb_intf) < 0)
- DBG_88E("can't get autopm:\n");
-
/* alloc dev name after read efuse. */
rtw_init_netdev_name(pnetdev, padapter->registrypriv.ifname);
rtw_macaddr_cfg(padapter->eeprompriv.mac_addr);
rtw_init_wifidirect_addrs(padapter, padapter->eeprompriv.mac_addr,
padapter->eeprompriv.mac_addr);
eth_hw_addr_set(pnetdev, padapter->eeprompriv.mac_addr);
- DBG_88E("MAC Address from pnetdev->dev_addr = %pM\n",
- pnetdev->dev_addr);

/* step 6. Tell the network stack we exist */
if (register_netdev(pnetdev) != 0)
goto handle_dualmac;

- DBG_88E("bDriverStopped:%d, bSurpriseRemoved:%d, bup:%d, hw_init_completed:%d\n"
- , padapter->bDriverStopped
- , padapter->bSurpriseRemoved
- , padapter->bup
- , padapter->hw_init_completed
- );
-
status = _SUCCESS;

handle_dualmac:
@@ -454,8 +403,6 @@ static void rtw_usb_if1_deinit(struct adapter *if1)
rtw_cancel_all_timer(if1);

rtw_dev_unload(if1);
- DBG_88E("+r871xu_dev_remove, hw_init_completed=%d\n",
- if1->hw_init_completed);
rtw_handle_dualmac(if1, 0);
rtw_free_drv_sw(if1);
if (pnetdev)
@@ -473,15 +420,11 @@ static int rtw_drv_init(struct usb_interface *pusb_intf, const struct usb_device
goto err;

if1 = rtw_usb_if1_init(dvobj, pusb_intf);
- if (!if1) {
- DBG_88E("rtw_init_primarystruct adapter Failed!\n");
+ if (!if1)
goto free_dvobj;
- }

- if (ui_pid[1] != 0) {
- DBG_88E("ui_pid[1]:%d\n", ui_pid[1]);
+ if (ui_pid[1] != 0)
rtw_signal_process(ui_pid[1], SIGUSR2);
- }

return 0;

@@ -500,8 +443,6 @@ static void rtw_dev_remove(struct usb_interface *pusb_intf)
struct dvobj_priv *dvobj = usb_get_intfdata(pusb_intf);
struct adapter *padapter = dvobj->if1;

- DBG_88E("+rtw_dev_remove\n");
-
if (usb_drv->drv_registered)
padapter->bSurpriseRemoved = true;

@@ -513,14 +454,10 @@ static void rtw_dev_remove(struct usb_interface *pusb_intf)
rtw_usb_if1_deinit(padapter);

usb_dvobj_deinit(pusb_intf);
-
- DBG_88E("-r871xu_dev_remove, done\n");
}

static int __init rtw_drv_entry(void)
{
- DBG_88E(DRV_NAME " driver version=%s\n", DRIVERVERSION);
-
mutex_init(&usb_drv->hw_init_mutex);

usb_drv->drv_registered = true;
@@ -529,13 +466,10 @@ static int __init rtw_drv_entry(void)

static void __exit rtw_drv_halt(void)
{
- DBG_88E("+rtw_drv_halt\n");
-
usb_drv->drv_registered = false;
usb_deregister(&usb_drv->usbdrv);

mutex_destroy(&usb_drv->hw_init_mutex);
- DBG_88E("-rtw_drv_halt\n");
}

module_init(rtw_drv_entry);
diff --git a/drivers/staging/r8188eu/os_dep/usb_ops_linux.c b/drivers/staging/r8188eu/os_dep/usb_ops_linux.c
index d1cb33d3e6a7..50f43770a05e 100644
--- a/drivers/staging/r8188eu/os_dep/usb_ops_linux.c
+++ b/drivers/staging/r8188eu/os_dep/usb_ops_linux.c
@@ -32,8 +32,6 @@ void rtw_read_port_cancel(struct adapter *padapter)
int i;
struct recv_buf *precvbuf = (struct recv_buf *)padapter->recvpriv.precv_buf;

- DBG_88E("%s\n", __func__);
-
padapter->bReadPortCancel = true;

for (i = 0; i < NR_RECVBUFF; i++) {
@@ -71,32 +69,21 @@ static void usb_write_port_complete(struct urb *purb, struct pt_regs *regs)
}

if (padapter->bSurpriseRemoved || padapter->bDriverStopped ||
- padapter->bWritePortCancel) {
- DBG_88E("%s(): TX Warning! bDriverStopped(%d) OR bSurpriseRemoved(%d) bWritePortCancel(%d) pxmitbuf->ext_tag(%x)\n",
- __func__, padapter->bDriverStopped,
- padapter->bSurpriseRemoved, padapter->bReadPortCancel,
- pxmitbuf->ext_tag);
-
+ padapter->bWritePortCancel)
goto check_completion;
- }

if (purb->status) {
- DBG_88E("###=> urb_write_port_complete status(%d)\n", purb->status);
if (purb->status == -EINPROGRESS) {
goto check_completion;
} else if (purb->status == -ENOENT) {
- DBG_88E("%s: -ENOENT\n", __func__);
goto check_completion;
} else if (purb->status == -ECONNRESET) {
- DBG_88E("%s: -ECONNRESET\n", __func__);
goto check_completion;
} else if (purb->status == -ESHUTDOWN) {
padapter->bDriverStopped = true;
goto check_completion;
} else if ((purb->status != -EPIPE) && (purb->status != -EPROTO)) {
padapter->bSurpriseRemoved = true;
- DBG_88E("bSurpriseRemoved = true\n");
-
goto check_completion;
}
}
@@ -174,7 +161,6 @@ u32 rtw_write_port(struct adapter *padapter, u32 addr, u32 cnt, u8 *wmem)
status = usb_submit_urb(purb, GFP_ATOMIC);
if (status) {
rtw_sctx_done_err(&pxmitbuf->sctx, RTW_SCTX_DONE_WRITE_PORT_ERR);
- DBG_88E("usb_write_port, status =%d\n", status);

switch (status) {
case -ENODEV:
@@ -202,8 +188,6 @@ void rtw_write_port_cancel(struct adapter *padapter)
int i, j;
struct xmit_buf *pxmitbuf = (struct xmit_buf *)padapter->xmitpriv.pxmitbuf;

- DBG_88E("%s\n", __func__);
-
padapter->bWritePortCancel = true;

for (i = 0; i < NR_XMITBUFF; i++) {
diff --git a/drivers/staging/r8188eu/os_dep/xmit_linux.c b/drivers/staging/r8188eu/os_dep/xmit_linux.c
index 088c294f2586..717b980a8c72 100644
--- a/drivers/staging/r8188eu/os_dep/xmit_linux.c
+++ b/drivers/staging/r8188eu/os_dep/xmit_linux.c
@@ -78,10 +78,8 @@ int rtw_os_xmit_resource_alloc(struct adapter *padapter, struct xmit_buf *pxmitb

for (i = 0; i < 8; i++) {
pxmitbuf->pxmit_urb[i] = usb_alloc_urb(0, GFP_KERNEL);
- if (!pxmitbuf->pxmit_urb[i]) {
- DBG_88E("pxmitbuf->pxmit_urb[i]==NULL");
+ if (!pxmitbuf->pxmit_urb[i])
return _FAIL;
- }
}
return _SUCCESS;
}
@@ -188,14 +186,12 @@ static int rtw_mlcst2unicst(struct adapter *padapter, struct sk_buff *skb)
memcpy(newskb->data, psta->hwaddr, 6);
res = rtw_xmit(padapter, &newskb);
if (res < 0) {
- DBG_88E("%s()-%d: rtw_xmit() return error!\n", __func__, __LINE__);
pxmitpriv->tx_drop++;
dev_kfree_skb_any(newskb);
} else {
pxmitpriv->tx_pkts++;
}
} else {
- DBG_88E("%s-%d: skb_copy() failed!\n", __func__, __LINE__);
pxmitpriv->tx_drop++;

spin_unlock_bh(&pstapriv->asoc_list_lock);
--
2.34.1

2022-01-25 09:26:13

by kernel test robot

[permalink] [raw]
Subject: Re: [PATCH 03/10] staging: r8188eu: remove DBG_88E calls from core/rtw_mlme_ext.c

Hi Phillip,

I love your patch! Perhaps something to improve:

[auto build test WARNING on staging/staging-testing]
[also build test WARNING on v5.17-rc1 next-20220124]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url: https://github.com/0day-ci/linux/commits/Phillip-Potter/Cleanup-and-removal-of-DBG_88E-macro/20220125-125206
base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git fa783154524a71ab74e293cd8251155e5971952b
config: arc-allyesconfig (https://download.01.org/0day-ci/archive/20220125/[email protected]/config)
compiler: arceb-elf-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/8b7efc8d3123ad5411beb88fc84fab8141f8b60f
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Phillip-Potter/Cleanup-and-removal-of-DBG_88E-macro/20220125-125206
git checkout 8b7efc8d3123ad5411beb88fc84fab8141f8b60f
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arc SHELL=/bin/bash drivers/staging/r8188eu/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>

All warnings (new ones prefixed by >>):

drivers/staging/r8188eu/core/rtw_mlme_ext.c: In function 'OnAssocReq':
>> drivers/staging/r8188eu/core/rtw_mlme_ext.c:919:33: warning: variable 'reassoc' set but not used [-Wunused-but-set-variable]
919 | unsigned char reassoc, *p, *pos, *wpa_ie;
| ^~~~~~~
drivers/staging/r8188eu/core/rtw_mlme_ext.c: In function 'OnAction_back':
>> drivers/staging/r8188eu/core/rtw_mlme_ext.c:1580:38: warning: variable 'reason_code' set but not used [-Wunused-but-set-variable]
1580 | unsigned short tid, status, reason_code = 0;
| ^~~~~~~~~~~


vim +/reassoc +919 drivers/staging/r8188eu/core/rtw_mlme_ext.c

15865124feed88 Phillip Potter 2021-07-28 913
15865124feed88 Phillip Potter 2021-07-28 914 unsigned int OnAssocReq(struct adapter *padapter, struct recv_frame *precv_frame)
15865124feed88 Phillip Potter 2021-07-28 915 {
15865124feed88 Phillip Potter 2021-07-28 916 u16 capab_info;
15865124feed88 Phillip Potter 2021-07-28 917 struct rtw_ieee802_11_elems elems;
15865124feed88 Phillip Potter 2021-07-28 918 struct sta_info *pstat;
15865124feed88 Phillip Potter 2021-07-28 @919 unsigned char reassoc, *p, *pos, *wpa_ie;
15865124feed88 Phillip Potter 2021-07-28 920 unsigned char WMM_IE[] = {0x00, 0x50, 0xf2, 0x02, 0x00, 0x01};
15865124feed88 Phillip Potter 2021-07-28 921 int i, ie_len, wpa_ie_len, left;
15865124feed88 Phillip Potter 2021-07-28 922 unsigned char supportRate[16];
15865124feed88 Phillip Potter 2021-07-28 923 int supportRateNum;
15865124feed88 Phillip Potter 2021-07-28 924 unsigned short status = _STATS_SUCCESSFUL_;
15865124feed88 Phillip Potter 2021-07-28 925 unsigned short frame_type, ie_offset = 0;
15865124feed88 Phillip Potter 2021-07-28 926 struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
15865124feed88 Phillip Potter 2021-07-28 927 struct security_priv *psecuritypriv = &padapter->securitypriv;
15865124feed88 Phillip Potter 2021-07-28 928 struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
3b522a11b50476 Michael Straube 2021-08-09 929 struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
3b522a11b50476 Michael Straube 2021-08-09 930 struct wlan_bssid_ex *cur = &pmlmeinfo->network;
15865124feed88 Phillip Potter 2021-07-28 931 struct sta_priv *pstapriv = &padapter->stapriv;
15865124feed88 Phillip Potter 2021-07-28 932 u8 *pframe = precv_frame->rx_data;
15865124feed88 Phillip Potter 2021-07-28 933 uint pkt_len = precv_frame->len;
3b522a11b50476 Michael Straube 2021-08-09 934 struct wifidirect_info *pwdinfo = &padapter->wdinfo;
15865124feed88 Phillip Potter 2021-07-28 935 u8 p2p_status_code = P2P_STATUS_SUCCESS;
15865124feed88 Phillip Potter 2021-07-28 936 u8 *p2pie;
15865124feed88 Phillip Potter 2021-07-28 937 u32 p2pielen = 0;
15865124feed88 Phillip Potter 2021-07-28 938
15865124feed88 Phillip Potter 2021-07-28 939 if ((pmlmeinfo->state & 0x03) != WIFI_FW_AP_STATE)
15865124feed88 Phillip Potter 2021-07-28 940 return _FAIL;
15865124feed88 Phillip Potter 2021-07-28 941
15865124feed88 Phillip Potter 2021-07-28 942 frame_type = GetFrameSubType(pframe);
15865124feed88 Phillip Potter 2021-07-28 943 if (frame_type == WIFI_ASSOCREQ) {
15865124feed88 Phillip Potter 2021-07-28 944 reassoc = 0;
15865124feed88 Phillip Potter 2021-07-28 945 ie_offset = _ASOCREQ_IE_OFFSET_;
15865124feed88 Phillip Potter 2021-07-28 946 } else { /* WIFI_REASSOCREQ */
15865124feed88 Phillip Potter 2021-07-28 947 reassoc = 1;
15865124feed88 Phillip Potter 2021-07-28 948 ie_offset = _REASOCREQ_IE_OFFSET_;
15865124feed88 Phillip Potter 2021-07-28 949 }
15865124feed88 Phillip Potter 2021-07-28 950
8b7efc8d3123ad Phillip Potter 2022-01-24 951 if (pkt_len < IEEE80211_3ADDR_LEN + ie_offset)
15865124feed88 Phillip Potter 2021-07-28 952 return _FAIL;
15865124feed88 Phillip Potter 2021-07-28 953
15865124feed88 Phillip Potter 2021-07-28 954 pstat = rtw_get_stainfo(pstapriv, GetAddr2Ptr(pframe));
15865124feed88 Phillip Potter 2021-07-28 955 if (pstat == (struct sta_info *)NULL) {
15865124feed88 Phillip Potter 2021-07-28 956 status = _RSON_CLS2_;
15865124feed88 Phillip Potter 2021-07-28 957 goto asoc_class2_error;
15865124feed88 Phillip Potter 2021-07-28 958 }
15865124feed88 Phillip Potter 2021-07-28 959
15865124feed88 Phillip Potter 2021-07-28 960 capab_info = get_unaligned_le16(pframe + WLAN_HDR_A3_LEN);
15865124feed88 Phillip Potter 2021-07-28 961
15865124feed88 Phillip Potter 2021-07-28 962 left = pkt_len - (IEEE80211_3ADDR_LEN + ie_offset);
15865124feed88 Phillip Potter 2021-07-28 963 pos = pframe + (IEEE80211_3ADDR_LEN + ie_offset);
15865124feed88 Phillip Potter 2021-07-28 964
15865124feed88 Phillip Potter 2021-07-28 965 /* check if this stat has been successfully authenticated/assocated */
15865124feed88 Phillip Potter 2021-07-28 966 if (!((pstat->state) & WIFI_FW_AUTH_SUCCESS)) {
15865124feed88 Phillip Potter 2021-07-28 967 if (!((pstat->state) & WIFI_FW_ASSOC_SUCCESS)) {
15865124feed88 Phillip Potter 2021-07-28 968 status = _RSON_CLS2_;
15865124feed88 Phillip Potter 2021-07-28 969 goto asoc_class2_error;
15865124feed88 Phillip Potter 2021-07-28 970 } else {
15865124feed88 Phillip Potter 2021-07-28 971 pstat->state &= (~WIFI_FW_ASSOC_SUCCESS);
15865124feed88 Phillip Potter 2021-07-28 972 pstat->state |= WIFI_FW_ASSOC_STATE;
15865124feed88 Phillip Potter 2021-07-28 973 }
15865124feed88 Phillip Potter 2021-07-28 974 } else {
15865124feed88 Phillip Potter 2021-07-28 975 pstat->state &= (~WIFI_FW_AUTH_SUCCESS);
15865124feed88 Phillip Potter 2021-07-28 976 pstat->state |= WIFI_FW_ASSOC_STATE;
15865124feed88 Phillip Potter 2021-07-28 977 }
15865124feed88 Phillip Potter 2021-07-28 978 pstat->capability = capab_info;
15865124feed88 Phillip Potter 2021-07-28 979 /* now parse all ieee802_11 ie to point to elems */
15865124feed88 Phillip Potter 2021-07-28 980 if (rtw_ieee802_11_parse_elems(pos, left, &elems, 1) == ParseFailed ||
15865124feed88 Phillip Potter 2021-07-28 981 !elems.ssid) {
15865124feed88 Phillip Potter 2021-07-28 982 status = _STATS_FAILURE_;
15865124feed88 Phillip Potter 2021-07-28 983 goto OnAssocReqFail;
15865124feed88 Phillip Potter 2021-07-28 984 }
15865124feed88 Phillip Potter 2021-07-28 985
15865124feed88 Phillip Potter 2021-07-28 986 /* now we should check all the fields... */
15865124feed88 Phillip Potter 2021-07-28 987 /* checking SSID */
15865124feed88 Phillip Potter 2021-07-28 988 p = rtw_get_ie(pframe + WLAN_HDR_A3_LEN + ie_offset, _SSID_IE_, &ie_len,
15865124feed88 Phillip Potter 2021-07-28 989 pkt_len - WLAN_HDR_A3_LEN - ie_offset);
552838fdcaef2c Michael Straube 2021-08-01 990 if (!p)
15865124feed88 Phillip Potter 2021-07-28 991 status = _STATS_FAILURE_;
15865124feed88 Phillip Potter 2021-07-28 992
15865124feed88 Phillip Potter 2021-07-28 993 if (ie_len == 0) { /* broadcast ssid, however it is not allowed in assocreq */
15865124feed88 Phillip Potter 2021-07-28 994 status = _STATS_FAILURE_;
15865124feed88 Phillip Potter 2021-07-28 995 } else {
15865124feed88 Phillip Potter 2021-07-28 996 /* check if ssid match */
15865124feed88 Phillip Potter 2021-07-28 997 if (memcmp((void *)(p + 2), cur->Ssid.Ssid, cur->Ssid.SsidLength))
15865124feed88 Phillip Potter 2021-07-28 998 status = _STATS_FAILURE_;
15865124feed88 Phillip Potter 2021-07-28 999
15865124feed88 Phillip Potter 2021-07-28 1000 if (ie_len != cur->Ssid.SsidLength)
15865124feed88 Phillip Potter 2021-07-28 1001 status = _STATS_FAILURE_;
15865124feed88 Phillip Potter 2021-07-28 1002 }
15865124feed88 Phillip Potter 2021-07-28 1003
15865124feed88 Phillip Potter 2021-07-28 1004 if (_STATS_SUCCESSFUL_ != status)
15865124feed88 Phillip Potter 2021-07-28 1005 goto OnAssocReqFail;
15865124feed88 Phillip Potter 2021-07-28 1006
15865124feed88 Phillip Potter 2021-07-28 1007 /* check if the supported rate is ok */
15865124feed88 Phillip Potter 2021-07-28 1008 p = rtw_get_ie(pframe + WLAN_HDR_A3_LEN + ie_offset, _SUPPORTEDRATES_IE_, &ie_len, pkt_len - WLAN_HDR_A3_LEN - ie_offset);
552838fdcaef2c Michael Straube 2021-08-01 1009 if (!p) {
15865124feed88 Phillip Potter 2021-07-28 1010 /* use our own rate set as statoin used */
15865124feed88 Phillip Potter 2021-07-28 1011 /* memcpy(supportRate, AP_BSSRATE, AP_BSSRATE_LEN); */
15865124feed88 Phillip Potter 2021-07-28 1012 /* supportRateNum = AP_BSSRATE_LEN; */
15865124feed88 Phillip Potter 2021-07-28 1013
15865124feed88 Phillip Potter 2021-07-28 1014 status = _STATS_FAILURE_;
15865124feed88 Phillip Potter 2021-07-28 1015 goto OnAssocReqFail;
15865124feed88 Phillip Potter 2021-07-28 1016 } else {
15865124feed88 Phillip Potter 2021-07-28 1017 memcpy(supportRate, p + 2, ie_len);
15865124feed88 Phillip Potter 2021-07-28 1018 supportRateNum = ie_len;
15865124feed88 Phillip Potter 2021-07-28 1019
15865124feed88 Phillip Potter 2021-07-28 1020 p = rtw_get_ie(pframe + WLAN_HDR_A3_LEN + ie_offset, _EXT_SUPPORTEDRATES_IE_, &ie_len,
15865124feed88 Phillip Potter 2021-07-28 1021 pkt_len - WLAN_HDR_A3_LEN - ie_offset);
552838fdcaef2c Michael Straube 2021-08-01 1022 if (p) {
15865124feed88 Phillip Potter 2021-07-28 1023 if (supportRateNum <= sizeof(supportRate)) {
15865124feed88 Phillip Potter 2021-07-28 1024 memcpy(supportRate + supportRateNum, p + 2, ie_len);
15865124feed88 Phillip Potter 2021-07-28 1025 supportRateNum += ie_len;
15865124feed88 Phillip Potter 2021-07-28 1026 }
15865124feed88 Phillip Potter 2021-07-28 1027 }
15865124feed88 Phillip Potter 2021-07-28 1028 }
15865124feed88 Phillip Potter 2021-07-28 1029
15865124feed88 Phillip Potter 2021-07-28 1030 /* todo: mask supportRate between AP & STA -> move to update raid */
15865124feed88 Phillip Potter 2021-07-28 1031 /* get_matched_rate(pmlmeext, supportRate, &supportRateNum, 0); */
15865124feed88 Phillip Potter 2021-07-28 1032
15865124feed88 Phillip Potter 2021-07-28 1033 /* update station supportRate */
15865124feed88 Phillip Potter 2021-07-28 1034 pstat->bssratelen = supportRateNum;
15865124feed88 Phillip Potter 2021-07-28 1035 memcpy(pstat->bssrateset, supportRate, supportRateNum);
15865124feed88 Phillip Potter 2021-07-28 1036 UpdateBrateTblForSoftAP(pstat->bssrateset, pstat->bssratelen);
15865124feed88 Phillip Potter 2021-07-28 1037
15865124feed88 Phillip Potter 2021-07-28 1038 /* check RSN/WPA/WPS */
15865124feed88 Phillip Potter 2021-07-28 1039 pstat->dot8021xalg = 0;
15865124feed88 Phillip Potter 2021-07-28 1040 pstat->wpa_psk = 0;
15865124feed88 Phillip Potter 2021-07-28 1041 pstat->wpa_group_cipher = 0;
15865124feed88 Phillip Potter 2021-07-28 1042 pstat->wpa2_group_cipher = 0;
15865124feed88 Phillip Potter 2021-07-28 1043 pstat->wpa_pairwise_cipher = 0;
15865124feed88 Phillip Potter 2021-07-28 1044 pstat->wpa2_pairwise_cipher = 0;
15865124feed88 Phillip Potter 2021-07-28 1045 memset(pstat->wpa_ie, 0, sizeof(pstat->wpa_ie));
15865124feed88 Phillip Potter 2021-07-28 1046 if ((psecuritypriv->wpa_psk & BIT(1)) && elems.rsn_ie) {
15865124feed88 Phillip Potter 2021-07-28 1047 int group_cipher = 0, pairwise_cipher = 0;
15865124feed88 Phillip Potter 2021-07-28 1048
15865124feed88 Phillip Potter 2021-07-28 1049 wpa_ie = elems.rsn_ie;
15865124feed88 Phillip Potter 2021-07-28 1050 wpa_ie_len = elems.rsn_ie_len;
15865124feed88 Phillip Potter 2021-07-28 1051
15865124feed88 Phillip Potter 2021-07-28 1052 if (rtw_parse_wpa2_ie(wpa_ie - 2, wpa_ie_len + 2, &group_cipher, &pairwise_cipher, NULL) == _SUCCESS) {
15865124feed88 Phillip Potter 2021-07-28 1053 pstat->dot8021xalg = 1;/* psk, todo:802.1x */
15865124feed88 Phillip Potter 2021-07-28 1054 pstat->wpa_psk |= BIT(1);
15865124feed88 Phillip Potter 2021-07-28 1055
15865124feed88 Phillip Potter 2021-07-28 1056 pstat->wpa2_group_cipher = group_cipher & psecuritypriv->wpa2_group_cipher;
15865124feed88 Phillip Potter 2021-07-28 1057 pstat->wpa2_pairwise_cipher = pairwise_cipher & psecuritypriv->wpa2_pairwise_cipher;
15865124feed88 Phillip Potter 2021-07-28 1058
15865124feed88 Phillip Potter 2021-07-28 1059 if (!pstat->wpa2_group_cipher)
15865124feed88 Phillip Potter 2021-07-28 1060 status = WLAN_STATUS_GROUP_CIPHER_NOT_VALID;
15865124feed88 Phillip Potter 2021-07-28 1061
15865124feed88 Phillip Potter 2021-07-28 1062 if (!pstat->wpa2_pairwise_cipher)
15865124feed88 Phillip Potter 2021-07-28 1063 status = WLAN_STATUS_PAIRWISE_CIPHER_NOT_VALID;
15865124feed88 Phillip Potter 2021-07-28 1064 } else {
15865124feed88 Phillip Potter 2021-07-28 1065 status = WLAN_STATUS_INVALID_IE;
15865124feed88 Phillip Potter 2021-07-28 1066 }
15865124feed88 Phillip Potter 2021-07-28 1067 } else if ((psecuritypriv->wpa_psk & BIT(0)) && elems.wpa_ie) {
15865124feed88 Phillip Potter 2021-07-28 1068 int group_cipher = 0, pairwise_cipher = 0;
15865124feed88 Phillip Potter 2021-07-28 1069
15865124feed88 Phillip Potter 2021-07-28 1070 wpa_ie = elems.wpa_ie;
15865124feed88 Phillip Potter 2021-07-28 1071 wpa_ie_len = elems.wpa_ie_len;
15865124feed88 Phillip Potter 2021-07-28 1072
15865124feed88 Phillip Potter 2021-07-28 1073 if (rtw_parse_wpa_ie(wpa_ie - 2, wpa_ie_len + 2, &group_cipher, &pairwise_cipher, NULL) == _SUCCESS) {
15865124feed88 Phillip Potter 2021-07-28 1074 pstat->dot8021xalg = 1;/* psk, todo:802.1x */
15865124feed88 Phillip Potter 2021-07-28 1075 pstat->wpa_psk |= BIT(0);
15865124feed88 Phillip Potter 2021-07-28 1076
15865124feed88 Phillip Potter 2021-07-28 1077 pstat->wpa_group_cipher = group_cipher & psecuritypriv->wpa_group_cipher;
15865124feed88 Phillip Potter 2021-07-28 1078 pstat->wpa_pairwise_cipher = pairwise_cipher & psecuritypriv->wpa_pairwise_cipher;
15865124feed88 Phillip Potter 2021-07-28 1079
15865124feed88 Phillip Potter 2021-07-28 1080 if (!pstat->wpa_group_cipher)
15865124feed88 Phillip Potter 2021-07-28 1081 status = WLAN_STATUS_GROUP_CIPHER_NOT_VALID;
15865124feed88 Phillip Potter 2021-07-28 1082
15865124feed88 Phillip Potter 2021-07-28 1083 if (!pstat->wpa_pairwise_cipher)
15865124feed88 Phillip Potter 2021-07-28 1084 status = WLAN_STATUS_PAIRWISE_CIPHER_NOT_VALID;
15865124feed88 Phillip Potter 2021-07-28 1085 } else {
15865124feed88 Phillip Potter 2021-07-28 1086 status = WLAN_STATUS_INVALID_IE;
15865124feed88 Phillip Potter 2021-07-28 1087 }
15865124feed88 Phillip Potter 2021-07-28 1088 } else {
15865124feed88 Phillip Potter 2021-07-28 1089 wpa_ie = NULL;
15865124feed88 Phillip Potter 2021-07-28 1090 wpa_ie_len = 0;
15865124feed88 Phillip Potter 2021-07-28 1091 }
15865124feed88 Phillip Potter 2021-07-28 1092
15865124feed88 Phillip Potter 2021-07-28 1093 if (_STATS_SUCCESSFUL_ != status)
15865124feed88 Phillip Potter 2021-07-28 1094 goto OnAssocReqFail;
15865124feed88 Phillip Potter 2021-07-28 1095
15865124feed88 Phillip Potter 2021-07-28 1096 pstat->flags &= ~(WLAN_STA_WPS | WLAN_STA_MAYBE_WPS);
552838fdcaef2c Michael Straube 2021-08-01 1097 if (!wpa_ie) {
8b7efc8d3123ad Phillip Potter 2022-01-24 1098 if (elems.wps_ie)
15865124feed88 Phillip Potter 2021-07-28 1099 pstat->flags |= WLAN_STA_WPS;
15865124feed88 Phillip Potter 2021-07-28 1100 /* wpabuf_free(sta->wps_ie); */
15865124feed88 Phillip Potter 2021-07-28 1101 /* sta->wps_ie = wpabuf_alloc_copy(elems.wps_ie + 4, */
15865124feed88 Phillip Potter 2021-07-28 1102 /* elems.wps_ie_len - 4); */
8b7efc8d3123ad Phillip Potter 2022-01-24 1103 else
15865124feed88 Phillip Potter 2021-07-28 1104 pstat->flags |= WLAN_STA_MAYBE_WPS;
15865124feed88 Phillip Potter 2021-07-28 1105
15865124feed88 Phillip Potter 2021-07-28 1106 /* AP support WPA/RSN, and sta is going to do WPS, but AP is not ready */
15865124feed88 Phillip Potter 2021-07-28 1107 /* that the selected registrar of AP is _FLASE */
15865124feed88 Phillip Potter 2021-07-28 1108 if ((psecuritypriv->wpa_psk > 0) && (pstat->flags & (WLAN_STA_WPS | WLAN_STA_MAYBE_WPS))) {
15865124feed88 Phillip Potter 2021-07-28 1109 if (pmlmepriv->wps_beacon_ie) {
15865124feed88 Phillip Potter 2021-07-28 1110 u8 selected_registrar = 0;
15865124feed88 Phillip Potter 2021-07-28 1111
15865124feed88 Phillip Potter 2021-07-28 1112 rtw_get_wps_attr_content(pmlmepriv->wps_beacon_ie, pmlmepriv->wps_beacon_ie_len, WPS_ATTR_SELECTED_REGISTRAR, &selected_registrar, NULL);
15865124feed88 Phillip Potter 2021-07-28 1113
15865124feed88 Phillip Potter 2021-07-28 1114 if (!selected_registrar) {
15865124feed88 Phillip Potter 2021-07-28 1115 status = _STATS_UNABLE_HANDLE_STA_;
15865124feed88 Phillip Potter 2021-07-28 1116
15865124feed88 Phillip Potter 2021-07-28 1117 goto OnAssocReqFail;
15865124feed88 Phillip Potter 2021-07-28 1118 }
15865124feed88 Phillip Potter 2021-07-28 1119 }
15865124feed88 Phillip Potter 2021-07-28 1120 }
15865124feed88 Phillip Potter 2021-07-28 1121 } else {
15865124feed88 Phillip Potter 2021-07-28 1122 int copy_len;
15865124feed88 Phillip Potter 2021-07-28 1123
15865124feed88 Phillip Potter 2021-07-28 1124 if (psecuritypriv->wpa_psk == 0) {
15865124feed88 Phillip Potter 2021-07-28 1125 status = WLAN_STATUS_INVALID_IE;
15865124feed88 Phillip Potter 2021-07-28 1126
15865124feed88 Phillip Potter 2021-07-28 1127 goto OnAssocReqFail;
15865124feed88 Phillip Potter 2021-07-28 1128 }
15865124feed88 Phillip Potter 2021-07-28 1129
15865124feed88 Phillip Potter 2021-07-28 1130 if (elems.wps_ie) {
15865124feed88 Phillip Potter 2021-07-28 1131 pstat->flags |= WLAN_STA_WPS;
15865124feed88 Phillip Potter 2021-07-28 1132 copy_len = 0;
15865124feed88 Phillip Potter 2021-07-28 1133 } else {
15865124feed88 Phillip Potter 2021-07-28 1134 copy_len = ((wpa_ie_len + 2) > sizeof(pstat->wpa_ie)) ? (sizeof(pstat->wpa_ie)) : (wpa_ie_len + 2);
15865124feed88 Phillip Potter 2021-07-28 1135 }
15865124feed88 Phillip Potter 2021-07-28 1136 if (copy_len > 0)
15865124feed88 Phillip Potter 2021-07-28 1137 memcpy(pstat->wpa_ie, wpa_ie - 2, copy_len);
15865124feed88 Phillip Potter 2021-07-28 1138 }
15865124feed88 Phillip Potter 2021-07-28 1139 /* check if there is WMM IE & support WWM-PS */
15865124feed88 Phillip Potter 2021-07-28 1140 pstat->flags &= ~WLAN_STA_WME;
15865124feed88 Phillip Potter 2021-07-28 1141 pstat->qos_option = 0;
15865124feed88 Phillip Potter 2021-07-28 1142 pstat->qos_info = 0;
15865124feed88 Phillip Potter 2021-07-28 1143 pstat->has_legacy_ac = true;
15865124feed88 Phillip Potter 2021-07-28 1144 pstat->uapsd_vo = 0;
15865124feed88 Phillip Potter 2021-07-28 1145 pstat->uapsd_vi = 0;
15865124feed88 Phillip Potter 2021-07-28 1146 pstat->uapsd_be = 0;
15865124feed88 Phillip Potter 2021-07-28 1147 pstat->uapsd_bk = 0;
15865124feed88 Phillip Potter 2021-07-28 1148 if (pmlmepriv->qospriv.qos_option) {
15865124feed88 Phillip Potter 2021-07-28 1149 p = pframe + WLAN_HDR_A3_LEN + ie_offset; ie_len = 0;
15865124feed88 Phillip Potter 2021-07-28 1150 for (;;) {
15865124feed88 Phillip Potter 2021-07-28 1151 p = rtw_get_ie(p, _VENDOR_SPECIFIC_IE_, &ie_len, pkt_len - WLAN_HDR_A3_LEN - ie_offset);
552838fdcaef2c Michael Straube 2021-08-01 1152 if (p) {
15865124feed88 Phillip Potter 2021-07-28 1153 if (!memcmp(p + 2, WMM_IE, 6)) {
15865124feed88 Phillip Potter 2021-07-28 1154 pstat->flags |= WLAN_STA_WME;
15865124feed88 Phillip Potter 2021-07-28 1155
15865124feed88 Phillip Potter 2021-07-28 1156 pstat->qos_option = 1;
15865124feed88 Phillip Potter 2021-07-28 1157 pstat->qos_info = *(p + 8);
15865124feed88 Phillip Potter 2021-07-28 1158
15865124feed88 Phillip Potter 2021-07-28 1159 pstat->max_sp_len = (pstat->qos_info >> 5) & 0x3;
15865124feed88 Phillip Potter 2021-07-28 1160
15865124feed88 Phillip Potter 2021-07-28 1161 if ((pstat->qos_info & 0xf) != 0xf)
15865124feed88 Phillip Potter 2021-07-28 1162 pstat->has_legacy_ac = true;
15865124feed88 Phillip Potter 2021-07-28 1163 else
15865124feed88 Phillip Potter 2021-07-28 1164 pstat->has_legacy_ac = false;
15865124feed88 Phillip Potter 2021-07-28 1165
15865124feed88 Phillip Potter 2021-07-28 1166 if (pstat->qos_info & 0xf) {
15865124feed88 Phillip Potter 2021-07-28 1167 if (pstat->qos_info & BIT(0))
15865124feed88 Phillip Potter 2021-07-28 1168 pstat->uapsd_vo = BIT(0) | BIT(1);
15865124feed88 Phillip Potter 2021-07-28 1169 else
15865124feed88 Phillip Potter 2021-07-28 1170 pstat->uapsd_vo = 0;
15865124feed88 Phillip Potter 2021-07-28 1171
15865124feed88 Phillip Potter 2021-07-28 1172 if (pstat->qos_info & BIT(1))
15865124feed88 Phillip Potter 2021-07-28 1173 pstat->uapsd_vi = BIT(0) | BIT(1);
15865124feed88 Phillip Potter 2021-07-28 1174 else
15865124feed88 Phillip Potter 2021-07-28 1175 pstat->uapsd_vi = 0;
15865124feed88 Phillip Potter 2021-07-28 1176
15865124feed88 Phillip Potter 2021-07-28 1177 if (pstat->qos_info & BIT(2))
15865124feed88 Phillip Potter 2021-07-28 1178 pstat->uapsd_bk = BIT(0) | BIT(1);
15865124feed88 Phillip Potter 2021-07-28 1179 else
15865124feed88 Phillip Potter 2021-07-28 1180 pstat->uapsd_bk = 0;
15865124feed88 Phillip Potter 2021-07-28 1181
15865124feed88 Phillip Potter 2021-07-28 1182 if (pstat->qos_info & BIT(3))
15865124feed88 Phillip Potter 2021-07-28 1183 pstat->uapsd_be = BIT(0) | BIT(1);
15865124feed88 Phillip Potter 2021-07-28 1184 else
15865124feed88 Phillip Potter 2021-07-28 1185 pstat->uapsd_be = 0;
15865124feed88 Phillip Potter 2021-07-28 1186 }
15865124feed88 Phillip Potter 2021-07-28 1187 break;
15865124feed88 Phillip Potter 2021-07-28 1188 }
15865124feed88 Phillip Potter 2021-07-28 1189 } else {
15865124feed88 Phillip Potter 2021-07-28 1190 break;
15865124feed88 Phillip Potter 2021-07-28 1191 }
15865124feed88 Phillip Potter 2021-07-28 1192 p = p + ie_len + 2;
15865124feed88 Phillip Potter 2021-07-28 1193 }
15865124feed88 Phillip Potter 2021-07-28 1194 }
15865124feed88 Phillip Potter 2021-07-28 1195
15865124feed88 Phillip Potter 2021-07-28 1196 /* save HT capabilities in the sta object */
15865124feed88 Phillip Potter 2021-07-28 1197 memset(&pstat->htpriv.ht_cap, 0, sizeof(struct ieee80211_ht_cap));
15865124feed88 Phillip Potter 2021-07-28 1198 if (elems.ht_capabilities && elems.ht_capabilities_len >= sizeof(struct ieee80211_ht_cap)) {
15865124feed88 Phillip Potter 2021-07-28 1199 pstat->flags |= WLAN_STA_HT;
15865124feed88 Phillip Potter 2021-07-28 1200
15865124feed88 Phillip Potter 2021-07-28 1201 pstat->flags |= WLAN_STA_WME;
15865124feed88 Phillip Potter 2021-07-28 1202
15865124feed88 Phillip Potter 2021-07-28 1203 memcpy(&pstat->htpriv.ht_cap, elems.ht_capabilities, sizeof(struct ieee80211_ht_cap));
15865124feed88 Phillip Potter 2021-07-28 1204 } else {
15865124feed88 Phillip Potter 2021-07-28 1205 pstat->flags &= ~WLAN_STA_HT;
15865124feed88 Phillip Potter 2021-07-28 1206 }
15865124feed88 Phillip Potter 2021-07-28 1207 if ((!pmlmepriv->htpriv.ht_option) && (pstat->flags & WLAN_STA_HT)) {
15865124feed88 Phillip Potter 2021-07-28 1208 status = _STATS_FAILURE_;
15865124feed88 Phillip Potter 2021-07-28 1209 goto OnAssocReqFail;
15865124feed88 Phillip Potter 2021-07-28 1210 }
15865124feed88 Phillip Potter 2021-07-28 1211
15865124feed88 Phillip Potter 2021-07-28 1212 pstat->flags |= WLAN_STA_NONERP;
15865124feed88 Phillip Potter 2021-07-28 1213 for (i = 0; i < pstat->bssratelen; i++) {
15865124feed88 Phillip Potter 2021-07-28 1214 if ((pstat->bssrateset[i] & 0x7f) > 22) {
15865124feed88 Phillip Potter 2021-07-28 1215 pstat->flags &= ~WLAN_STA_NONERP;
15865124feed88 Phillip Potter 2021-07-28 1216 break;
15865124feed88 Phillip Potter 2021-07-28 1217 }
15865124feed88 Phillip Potter 2021-07-28 1218 }
15865124feed88 Phillip Potter 2021-07-28 1219
15865124feed88 Phillip Potter 2021-07-28 1220 if (pstat->capability & WLAN_CAPABILITY_SHORT_PREAMBLE)
15865124feed88 Phillip Potter 2021-07-28 1221 pstat->flags |= WLAN_STA_SHORT_PREAMBLE;
15865124feed88 Phillip Potter 2021-07-28 1222 else
15865124feed88 Phillip Potter 2021-07-28 1223 pstat->flags &= ~WLAN_STA_SHORT_PREAMBLE;
15865124feed88 Phillip Potter 2021-07-28 1224
15865124feed88 Phillip Potter 2021-07-28 1225 if (status != _STATS_SUCCESSFUL_)
15865124feed88 Phillip Potter 2021-07-28 1226 goto OnAssocReqFail;
15865124feed88 Phillip Potter 2021-07-28 1227
15865124feed88 Phillip Potter 2021-07-28 1228 pstat->is_p2p_device = false;
15865124feed88 Phillip Potter 2021-07-28 1229 if (rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO)) {
15865124feed88 Phillip Potter 2021-07-28 1230 p2pie = rtw_get_p2p_ie(pframe + WLAN_HDR_A3_LEN + ie_offset, pkt_len - WLAN_HDR_A3_LEN - ie_offset, NULL, &p2pielen);
15865124feed88 Phillip Potter 2021-07-28 1231 if (p2pie) {
15865124feed88 Phillip Potter 2021-07-28 1232 pstat->is_p2p_device = true;
15865124feed88 Phillip Potter 2021-07-28 1233 p2p_status_code = (u8)process_assoc_req_p2p_ie(pwdinfo, pframe, pkt_len, pstat);
15865124feed88 Phillip Potter 2021-07-28 1234 if (p2p_status_code > 0) {
15865124feed88 Phillip Potter 2021-07-28 1235 pstat->p2p_status_code = p2p_status_code;
15865124feed88 Phillip Potter 2021-07-28 1236 status = _STATS_CAP_FAIL_;
15865124feed88 Phillip Potter 2021-07-28 1237 goto OnAssocReqFail;
15865124feed88 Phillip Potter 2021-07-28 1238 }
15865124feed88 Phillip Potter 2021-07-28 1239 }
15865124feed88 Phillip Potter 2021-07-28 1240 }
15865124feed88 Phillip Potter 2021-07-28 1241 pstat->p2p_status_code = p2p_status_code;
15865124feed88 Phillip Potter 2021-07-28 1242
15865124feed88 Phillip Potter 2021-07-28 1243 /* TODO: identify_proprietary_vendor_ie(); */
15865124feed88 Phillip Potter 2021-07-28 1244 /* Realtek proprietary IE */
15865124feed88 Phillip Potter 2021-07-28 1245 /* identify if this is Broadcom sta */
15865124feed88 Phillip Potter 2021-07-28 1246 /* identify if this is ralink sta */
15865124feed88 Phillip Potter 2021-07-28 1247 /* Customer proprietary IE */
15865124feed88 Phillip Potter 2021-07-28 1248
15865124feed88 Phillip Potter 2021-07-28 1249 /* get a unique AID */
8b7efc8d3123ad Phillip Potter 2022-01-24 1250 if (pstat->aid == 0) {
15865124feed88 Phillip Potter 2021-07-28 1251 for (pstat->aid = 1; pstat->aid <= NUM_STA; pstat->aid++)
552838fdcaef2c Michael Straube 2021-08-01 1252 if (!pstapriv->sta_aid[pstat->aid - 1])
15865124feed88 Phillip Potter 2021-07-28 1253 break;
15865124feed88 Phillip Potter 2021-07-28 1254
15865124feed88 Phillip Potter 2021-07-28 1255 /* if (pstat->aid > NUM_STA) { */
15865124feed88 Phillip Potter 2021-07-28 1256 if (pstat->aid > pstapriv->max_num_sta) {
15865124feed88 Phillip Potter 2021-07-28 1257 pstat->aid = 0;
15865124feed88 Phillip Potter 2021-07-28 1258
15865124feed88 Phillip Potter 2021-07-28 1259 status = WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA;
15865124feed88 Phillip Potter 2021-07-28 1260
15865124feed88 Phillip Potter 2021-07-28 1261 goto OnAssocReqFail;
15865124feed88 Phillip Potter 2021-07-28 1262 } else {
15865124feed88 Phillip Potter 2021-07-28 1263 pstapriv->sta_aid[pstat->aid - 1] = pstat;
15865124feed88 Phillip Potter 2021-07-28 1264 }
15865124feed88 Phillip Potter 2021-07-28 1265 }
15865124feed88 Phillip Potter 2021-07-28 1266
15865124feed88 Phillip Potter 2021-07-28 1267 pstat->state &= (~WIFI_FW_ASSOC_STATE);
15865124feed88 Phillip Potter 2021-07-28 1268 pstat->state |= WIFI_FW_ASSOC_SUCCESS;
15865124feed88 Phillip Potter 2021-07-28 1269
15865124feed88 Phillip Potter 2021-07-28 1270 spin_lock_bh(&pstapriv->auth_list_lock);
15865124feed88 Phillip Potter 2021-07-28 1271 if (!list_empty(&pstat->auth_list)) {
15865124feed88 Phillip Potter 2021-07-28 1272 list_del_init(&pstat->auth_list);
15865124feed88 Phillip Potter 2021-07-28 1273 pstapriv->auth_list_cnt--;
15865124feed88 Phillip Potter 2021-07-28 1274 }
15865124feed88 Phillip Potter 2021-07-28 1275 spin_unlock_bh(&pstapriv->auth_list_lock);
15865124feed88 Phillip Potter 2021-07-28 1276
15865124feed88 Phillip Potter 2021-07-28 1277 spin_lock_bh(&pstapriv->asoc_list_lock);
15865124feed88 Phillip Potter 2021-07-28 1278 if (list_empty(&pstat->asoc_list)) {
15865124feed88 Phillip Potter 2021-07-28 1279 pstat->expire_to = pstapriv->expire_to;
15865124feed88 Phillip Potter 2021-07-28 1280 list_add_tail(&pstat->asoc_list, &pstapriv->asoc_list);
15865124feed88 Phillip Potter 2021-07-28 1281 pstapriv->asoc_list_cnt++;
15865124feed88 Phillip Potter 2021-07-28 1282 }
15865124feed88 Phillip Potter 2021-07-28 1283 spin_unlock_bh(&pstapriv->asoc_list_lock);
15865124feed88 Phillip Potter 2021-07-28 1284
15865124feed88 Phillip Potter 2021-07-28 1285 /* now the station is qualified to join our BSS... */
15865124feed88 Phillip Potter 2021-07-28 1286 if (pstat && (pstat->state & WIFI_FW_ASSOC_SUCCESS) && (_STATS_SUCCESSFUL_ == status)) {
15865124feed88 Phillip Potter 2021-07-28 1287 /* 1 bss_cap_update & sta_info_update */
15865124feed88 Phillip Potter 2021-07-28 1288 bss_cap_update_on_sta_join(padapter, pstat);
15865124feed88 Phillip Potter 2021-07-28 1289 sta_info_update(padapter, pstat);
15865124feed88 Phillip Potter 2021-07-28 1290
15865124feed88 Phillip Potter 2021-07-28 1291 /* issue assoc rsp before notify station join event. */
15865124feed88 Phillip Potter 2021-07-28 1292 if (frame_type == WIFI_ASSOCREQ)
15865124feed88 Phillip Potter 2021-07-28 1293 issue_asocrsp(padapter, status, pstat, WIFI_ASSOCRSP);
15865124feed88 Phillip Potter 2021-07-28 1294 else
15865124feed88 Phillip Potter 2021-07-28 1295 issue_asocrsp(padapter, status, pstat, WIFI_REASSOCRSP);
15865124feed88 Phillip Potter 2021-07-28 1296
15865124feed88 Phillip Potter 2021-07-28 1297 /* 2 - report to upper layer */
15865124feed88 Phillip Potter 2021-07-28 1298 rtw_indicate_sta_assoc_event(padapter, pstat);
15865124feed88 Phillip Potter 2021-07-28 1299
15865124feed88 Phillip Potter 2021-07-28 1300 /* 3-(1) report sta add event */
15865124feed88 Phillip Potter 2021-07-28 1301 report_add_sta_event(padapter, pstat->hwaddr, pstat->aid);
15865124feed88 Phillip Potter 2021-07-28 1302 }
15865124feed88 Phillip Potter 2021-07-28 1303
15865124feed88 Phillip Potter 2021-07-28 1304 return _SUCCESS;
15865124feed88 Phillip Potter 2021-07-28 1305
15865124feed88 Phillip Potter 2021-07-28 1306 asoc_class2_error:
15865124feed88 Phillip Potter 2021-07-28 1307
15865124feed88 Phillip Potter 2021-07-28 1308 issue_deauth(padapter, (void *)GetAddr2Ptr(pframe), status);
15865124feed88 Phillip Potter 2021-07-28 1309
15865124feed88 Phillip Potter 2021-07-28 1310 return _FAIL;
15865124feed88 Phillip Potter 2021-07-28 1311
15865124feed88 Phillip Potter 2021-07-28 1312 OnAssocReqFail:
15865124feed88 Phillip Potter 2021-07-28 1313
15865124feed88 Phillip Potter 2021-07-28 1314 pstat->aid = 0;
15865124feed88 Phillip Potter 2021-07-28 1315 if (frame_type == WIFI_ASSOCREQ)
15865124feed88 Phillip Potter 2021-07-28 1316 issue_asocrsp(padapter, status, pstat, WIFI_ASSOCRSP);
15865124feed88 Phillip Potter 2021-07-28 1317 else
15865124feed88 Phillip Potter 2021-07-28 1318 issue_asocrsp(padapter, status, pstat, WIFI_REASSOCRSP);
15865124feed88 Phillip Potter 2021-07-28 1319
15865124feed88 Phillip Potter 2021-07-28 1320 return _FAIL;
15865124feed88 Phillip Potter 2021-07-28 1321 }
15865124feed88 Phillip Potter 2021-07-28 1322

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]

2022-01-25 09:31:10

by kernel test robot

[permalink] [raw]
Subject: Re: [PATCH 04/10] staging: r8188eu: remove all DBG_88E calls from hal dir

Hi Phillip,

I love your patch! Perhaps something to improve:

[auto build test WARNING on staging/staging-testing]
[also build test WARNING on v5.17-rc1 next-20220124]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url: https://github.com/0day-ci/linux/commits/Phillip-Potter/Cleanup-and-removal-of-DBG_88E-macro/20220125-125206
base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git fa783154524a71ab74e293cd8251155e5971952b
config: arc-allyesconfig (https://download.01.org/0day-ci/archive/20220125/[email protected]/config)
compiler: arceb-elf-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/041fe115dad9245f83646e7674341f28094d62a5
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Phillip-Potter/Cleanup-and-removal-of-DBG_88E-macro/20220125-125206
git checkout 041fe115dad9245f83646e7674341f28094d62a5
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arc SHELL=/bin/bash drivers/staging/r8188eu/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>

All warnings (new ones prefixed by >>):

drivers/staging/r8188eu/hal/rtl8188e_cmd.c: In function 'rtl8188e_set_FwMediaStatus_cmd':
>> drivers/staging/r8188eu/hal/rtl8188e_cmd.c:195:20: warning: variable 'macid' set but not used [-Wunused-but-set-variable]
195 | u8 opmode, macid;
| ^~~~~
>> drivers/staging/r8188eu/hal/rtl8188e_cmd.c:195:12: warning: variable 'opmode' set but not used [-Wunused-but-set-variable]
195 | u8 opmode, macid;
| ^~~~~~


vim +/macid +195 drivers/staging/r8188eu/hal/rtl8188e_cmd.c

8cd574e6af5463 Phillip Potter 2021-07-28 192
8cd574e6af5463 Phillip Potter 2021-07-28 193 void rtl8188e_set_FwMediaStatus_cmd(struct adapter *adapt, __le16 mstatus_rpt)
8cd574e6af5463 Phillip Potter 2021-07-28 194 {
8cd574e6af5463 Phillip Potter 2021-07-28 @195 u8 opmode, macid;
8cd574e6af5463 Phillip Potter 2021-07-28 196 u16 mst_rpt = le16_to_cpu(mstatus_rpt);
8cd574e6af5463 Phillip Potter 2021-07-28 197 opmode = (u8)mst_rpt;
8cd574e6af5463 Phillip Potter 2021-07-28 198 macid = (u8)(mst_rpt >> 8);
8cd574e6af5463 Phillip Potter 2021-07-28 199
8cd574e6af5463 Phillip Potter 2021-07-28 200 FillH2CCmd_88E(adapt, H2C_COM_MEDIA_STATUS_RPT, sizeof(mst_rpt), (u8 *)&mst_rpt);
8cd574e6af5463 Phillip Potter 2021-07-28 201 }
8cd574e6af5463 Phillip Potter 2021-07-28 202

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]

2022-01-25 14:29:42

by kernel test robot

[permalink] [raw]
Subject: Re: [PATCH 06/10] staging: r8188eu: remove DBG_88E calls from os_dep/ioctl_linux.c

Hi Phillip,

I love your patch! Perhaps something to improve:

[auto build test WARNING on staging/staging-testing]
[also build test WARNING on v5.17-rc1 next-20220124]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url: https://github.com/0day-ci/linux/commits/Phillip-Potter/Cleanup-and-removal-of-DBG_88E-macro/20220125-125206
base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git fa783154524a71ab74e293cd8251155e5971952b
config: arc-allyesconfig (https://download.01.org/0day-ci/archive/20220125/[email protected]/config)
compiler: arceb-elf-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/1724ade2c1f2fa95e0e314ed9229700d6158fbbc
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Phillip-Potter/Cleanup-and-removal-of-DBG_88E-macro/20220125-125206
git checkout 1724ade2c1f2fa95e0e314ed9229700d6158fbbc
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arc SHELL=/bin/bash drivers/staging/r8188eu/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>

All warnings (new ones prefixed by >>):

drivers/staging/r8188eu/os_dep/ioctl_linux.c: In function 'rtw_wx_set_mlme':
>> drivers/staging/r8188eu/os_dep/ioctl_linux.c:1022:13: warning: variable 'reason' set but not used [-Wunused-but-set-variable]
1022 | u16 reason;
| ^~~~~~


vim +/reason +1022 drivers/staging/r8188eu/os_dep/ioctl_linux.c

2b42bd58b32155 Phillip Potter 2021-07-28 1016
2b42bd58b32155 Phillip Potter 2021-07-28 1017 static int rtw_wx_set_mlme(struct net_device *dev,
2b42bd58b32155 Phillip Potter 2021-07-28 1018 struct iw_request_info *info,
2b42bd58b32155 Phillip Potter 2021-07-28 1019 union iwreq_data *wrqu, char *extra)
2b42bd58b32155 Phillip Potter 2021-07-28 1020 {
2b42bd58b32155 Phillip Potter 2021-07-28 1021 int ret = 0;
2b42bd58b32155 Phillip Potter 2021-07-28 @1022 u16 reason;
2b42bd58b32155 Phillip Potter 2021-07-28 1023 struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
2b42bd58b32155 Phillip Potter 2021-07-28 1024 struct iw_mlme *mlme = (struct iw_mlme *)extra;
2b42bd58b32155 Phillip Potter 2021-07-28 1025
d8062f6adca1ef Michael Straube 2021-07-30 1026 if (!mlme)
2b42bd58b32155 Phillip Potter 2021-07-28 1027 return -1;
2b42bd58b32155 Phillip Potter 2021-07-28 1028
2b42bd58b32155 Phillip Potter 2021-07-28 1029 reason = mlme->reason_code;
2b42bd58b32155 Phillip Potter 2021-07-28 1030
2b42bd58b32155 Phillip Potter 2021-07-28 1031 switch (mlme->cmd) {
2b42bd58b32155 Phillip Potter 2021-07-28 1032 case IW_MLME_DEAUTH:
2b42bd58b32155 Phillip Potter 2021-07-28 1033 if (!rtw_set_802_11_disassociate(padapter))
2b42bd58b32155 Phillip Potter 2021-07-28 1034 ret = -1;
2b42bd58b32155 Phillip Potter 2021-07-28 1035 break;
2b42bd58b32155 Phillip Potter 2021-07-28 1036 case IW_MLME_DISASSOC:
2b42bd58b32155 Phillip Potter 2021-07-28 1037 if (!rtw_set_802_11_disassociate(padapter))
2b42bd58b32155 Phillip Potter 2021-07-28 1038 ret = -1;
2b42bd58b32155 Phillip Potter 2021-07-28 1039 break;
2b42bd58b32155 Phillip Potter 2021-07-28 1040 default:
2b42bd58b32155 Phillip Potter 2021-07-28 1041 return -EOPNOTSUPP;
2b42bd58b32155 Phillip Potter 2021-07-28 1042 }
2b42bd58b32155 Phillip Potter 2021-07-28 1043 return ret;
2b42bd58b32155 Phillip Potter 2021-07-28 1044 }
2b42bd58b32155 Phillip Potter 2021-07-28 1045

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]

2022-01-25 17:27:10

by Pavel Skripkin

[permalink] [raw]
Subject: Re: [PATCH 05/10] staging: r8188eu: remove smaller sets of DBG_88E calls from os_dep dir

Hi Phillip,

On 1/25/22 01:44, Phillip Potter wrote:
> Remove all DBG_88E calls from the os_dep directory, other than those in
> os_dep/ioctl_linux.c, as this contains almost 200 on its own so will be
> done in a separate patch for ease of review. These calls do not conform
> to kernel coding standards and are superfluous. Also restructure where
> appropriate to remove no longer needed code left behind by removal of
> these calls. This will allow the eventual removal of the DBG_88E macro
> itself.
>
> Signed-off-by: Phillip Potter <[email protected]>
> ---

[code snip]

>
> - /* 2012-07-11 Move here to prevent the 8723AS-VAU BT auto
> - * suspend influence */
> - if (usb_autopm_get_interface(pusb_intf) < 0)
> - DBG_88E("can't get autopm:\n");
> -

Didn't you make a function change here? I didn't test and also didn't
find any mentions of tests in cover letter.

I am asking just to be sure you done it not by accident :)





With regards,
Pavel Skripkin

2022-01-25 17:36:58

by Dan Carpenter

[permalink] [raw]
Subject: Re: [PATCH 05/10] staging: r8188eu: remove smaller sets of DBG_88E calls from os_dep dir

On Tue, Jan 25, 2022 at 03:48:32PM +0300, Pavel Skripkin wrote:
> Hi Phillip,
>
> On 1/25/22 01:44, Phillip Potter wrote:
> > Remove all DBG_88E calls from the os_dep directory, other than those in
> > os_dep/ioctl_linux.c, as this contains almost 200 on its own so will be
> > done in a separate patch for ease of review. These calls do not conform
> > to kernel coding standards and are superfluous. Also restructure where
> > appropriate to remove no longer needed code left behind by removal of
> > these calls. This will allow the eventual removal of the DBG_88E macro
> > itself.
> >
> > Signed-off-by: Phillip Potter <[email protected]>
> > ---
>
> [code snip]
>
> > - /* 2012-07-11 Move here to prevent the 8723AS-VAU BT auto
> > - * suspend influence */
> > - if (usb_autopm_get_interface(pusb_intf) < 0)
> > - DBG_88E("can't get autopm:\n");
> > -
>
> Didn't you make a function change here? I didn't test and also didn't find
> any mentions of tests in cover letter.

It is obviously a bug. Please avoid ask rhetorical questions or someone
will answer them.

regards,
dan carpenter

2022-01-25 17:38:58

by Pavel Skripkin

[permalink] [raw]
Subject: Re: [PATCH 05/10] staging: r8188eu: remove smaller sets of DBG_88E calls from os_dep dir

Hi Dan,

On 1/25/22 15:59, Dan Carpenter wrote:
> On Tue, Jan 25, 2022 at 03:48:32PM +0300, Pavel Skripkin wrote:
>> Hi Phillip,
>>
>> On 1/25/22 01:44, Phillip Potter wrote:
>> > Remove all DBG_88E calls from the os_dep directory, other than those in
>> > os_dep/ioctl_linux.c, as this contains almost 200 on its own so will be
>> > done in a separate patch for ease of review. These calls do not conform
>> > to kernel coding standards and are superfluous. Also restructure where
>> > appropriate to remove no longer needed code left behind by removal of
>> > these calls. This will allow the eventual removal of the DBG_88E macro
>> > itself.
>> >
>> > Signed-off-by: Phillip Potter <[email protected]>
>> > ---
>>
>> [code snip]
>>
>> > - /* 2012-07-11 Move here to prevent the 8723AS-VAU BT auto
>> > - * suspend influence */
>> > - if (usb_autopm_get_interface(pusb_intf) < 0)
>> > - DBG_88E("can't get autopm:\n");
>> > -
>>
>> Didn't you make a function change here? I didn't test and also didn't find
>> any mentions of tests in cover letter.
>
> It is obviously a bug. Please avoid ask rhetorical questions or someone
> will answer them.
>

It isn't so obvious for me. Might be Phillip knows something about
8723AS-VAU BT (whatever it is) issue.

I prefer not to say "it's an error", when I am not 100% sure :)


With regards,
Pavel Skripkin

2022-01-25 18:52:55

by Dan Carpenter

[permalink] [raw]
Subject: Re: [PATCH 05/10] staging: r8188eu: remove smaller sets of DBG_88E calls from os_dep dir

On Tue, Jan 25, 2022 at 04:04:48PM +0300, Pavel Skripkin wrote:
> Hi Dan,
>
> On 1/25/22 15:59, Dan Carpenter wrote:
> > On Tue, Jan 25, 2022 at 03:48:32PM +0300, Pavel Skripkin wrote:
> > > Hi Phillip,
> > >
> > > On 1/25/22 01:44, Phillip Potter wrote:
> > > > Remove all DBG_88E calls from the os_dep directory, other than those in
> > > > os_dep/ioctl_linux.c, as this contains almost 200 on its own so will be
> > > > done in a separate patch for ease of review. These calls do not conform
> > > > to kernel coding standards and are superfluous. Also restructure where
> > > > appropriate to remove no longer needed code left behind by removal of
> > > > these calls. This will allow the eventual removal of the DBG_88E macro
> > > > itself.
> > > > > Signed-off-by: Phillip Potter <[email protected]>
> > > > ---
> > >
> > > [code snip]
> > >
> > > > - /* 2012-07-11 Move here to prevent the 8723AS-VAU BT auto
> > > > - * suspend influence */
> > > > - if (usb_autopm_get_interface(pusb_intf) < 0)
> > > > - DBG_88E("can't get autopm:\n");
> > > > -
> > >
> > > Didn't you make a function change here? I didn't test and also didn't find
> > > any mentions of tests in cover letter.
> >
> > It is obviously a bug. Please avoid ask rhetorical questions or someone
> > will answer them.
> >
>
> It isn't so obvious for me. Might be Phillip knows something about
> 8723AS-VAU BT (whatever it is) issue.
>
> I prefer not to say "it's an error", when I am not 100% sure :)

Oh, in that case, well done. Good job on the review. :)

regards,
dan carpenter

2022-01-25 22:49:22

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH 00/10] Cleanup and removal of DBG_88E macro

On Mon, Jan 24, 2022 at 10:44:05PM +0000, Phillip Potter wrote:
> This series does a few things in order to effect the removal of the
> DBG_88E macro:
>
> (1) It removes previously converted calls for consistency.
> (2) It removes all current DBG_88E calls.
> (3) It removes all aliased DBG_88E calls.
> (4) It removes the GlobalDebugLevel flag and the file that defines it.
>
> By its very nature, it is a large patchset, so I've tried to group as
> appropriate. I went by file as I did the work, which led to over 40
> patches originally, so I've listed the largest C files as their own
> patches and then grouped everything else by subdir which gives closer
> sizes for the other patches.

Can you rebase this on my staging-testing branch? It no longer applies
:(

thanks,

greg k-h

2022-01-26 03:34:49

by Pavel Skripkin

[permalink] [raw]
Subject: Re: [PATCH 03/10] staging: r8188eu: remove DBG_88E calls from core/rtw_mlme_ext.c

Hi Phillip,

On 1/25/22 01:44, Phillip Potter wrote:
> Remove all DBG_88E calls from core/rtw_mlme_ext.c, including the commented
> one, as they do not conform to kernel coding standards and are
> superfluous. Also restructure where appropriate to remove no longer needed
> code left behind by removal of these calls. This will allow the eventual
> removal of the DBG_88E macro itself.
>
> Signed-off-by: Phillip Potter <[email protected]>
> ---

[code snip]

> static u8 chk_ap_is_alive(struct adapter *padapter, struct sta_info *psta)
> @@ -7141,18 +6905,11 @@ static u8 chk_ap_is_alive(struct adapter *padapter, struct sta_info *psta)
> static void rtl8188e_sreset_linked_status_check(struct adapter *padapter)
> {
> u32 rx_dma_status = rtw_read32(padapter, REG_RXDMA_STATUS);
> - u8 fw_status;
>
> - if (rx_dma_status != 0x00) {
> - DBG_88E("%s REG_RXDMA_STATUS:0x%08x\n", __func__, rx_dma_status);
> + if (rx_dma_status != 0x00)
> rtw_write32(padapter, REG_RXDMA_STATUS, rx_dma_status);
> - }
>
> - fw_status = rtw_read8(padapter, REG_FMETHR);
> - if (fw_status == 1)
> - DBG_88E("%s REG_FW_STATUS (0x%02x), Read_Efuse_Fail !!\n", __func__, fw_status);
> - else if (fw_status == 2)
> - DBG_88E("%s REG_FW_STATUS (0x%02x), Condition_No_Match !!\n", __func__, fw_status);
> + rtw_read8(padapter, REG_FMETHR);
> }

Unused read. Can be dropped



With regards,
Pavel Skripkin

2022-01-26 07:08:39

by Pavel Skripkin

[permalink] [raw]
Subject: Re: [PATCH 06/10] staging: r8188eu: remove DBG_88E calls from os_dep/ioctl_linux.c

Hi Phillip,

On 1/25/22 01:44, Phillip Potter wrote:
> Remove all DBG_88E calls from os_dep/ioctl_linux.c, as they do not
> conform to kernel coding standards and are superfluous. Also restructure
> where appropriate to remove no longer needed code left behind by removal
> of these calls. This will allow the eventual removal of the DBG_88E macro
> itself.
>
> Signed-off-by: Phillip Potter <[email protected]>
> ---

[code snip]

> @@ -3746,7 +3541,6 @@ static int rtw_dbg_port(struct net_device *dev,
> u32 write_num = extra_arg;
>
> int i;
> - u16 final;
> struct xmit_frame *xmit_frame;
>
> xmit_frame = rtw_IOL_accquire_xmit_frame(padapter);
> @@ -3760,11 +3554,7 @@ static int rtw_dbg_port(struct net_device *dev,
> if (rtl8188e_IOL_exec_cmds_sync(padapter, xmit_frame, 5000, 0) != _SUCCESS)
> ret = -EPERM;
>
> - final = rtw_read16(padapter, reg);
> - if (start_value + write_num - 1 == final)
> - DBG_88E("continuous IOL_CMD_WW_REG to 0x%x %u times Success, start:%u, final:%u\n", reg, write_num, start_value, final);
> - else
> - DBG_88E("continuous IOL_CMD_WW_REG to 0x%x %u times Fail, start:%u, final:%u\n", reg, write_num, start_value, final);
> + rtw_read16(padapter, reg);
> }
> break;

I see, that you somewhere removes reads and somewhere leaves them.
What's the difference? I saw, that one of the places has the comment,
that asks not to remove the read, but others do not have such comment

I can point to few places in 2 and 4 patches where you have removed reads.



[code snip]

> @@ -4014,16 +3664,8 @@ static int rtw_dbg_port(struct net_device *dev,
> {
> u32 odm_flag;
>
> - if (0xf == extra_arg) {
> + if (extra_arg == 0xf) {
> GetHalDefVar8188EUsb(padapter, HAL_DEF_DBG_DM_FUNC, &odm_flag);
> - DBG_88E(" === DMFlag(0x%08x) ===\n", odm_flag);
> - DBG_88E("extra_arg = 0 - disable all dynamic func\n");
> - DBG_88E("extra_arg = 1 - disable DIG- BIT(0)\n");
> - DBG_88E("extra_arg = 2 - disable High power - BIT(1)\n");
> - DBG_88E("extra_arg = 3 - disable tx power tracking - BIT(2)\n");
> - DBG_88E("extra_arg = 4 - disable BT coexistence - BIT(3)\n");
> - DBG_88E("extra_arg = 5 - disable antenna diversity - BIT(4)\n");
> - DBG_88E("extra_arg = 6 - enable all dynamic func\n");
> } else {
> /* extra_arg = 0 - disable all dynamic func
> extra_arg = 1 - disable DIG
> @@ -4032,51 +3674,17 @@ static int rtw_dbg_port(struct net_device *dev,
> */
> SetHalDefVar8188EUsb(padapter, HAL_DEF_DBG_DM_FUNC, &extra_arg);
> GetHalDefVar8188EUsb(padapter, HAL_DEF_DBG_DM_FUNC, &odm_flag);
> - DBG_88E(" === DMFlag(0x%08x) ===\n", odm_flag);
> }
> }
> break;
>

Is odm_flag needed now? Seems like it was used only for printing random
debug info

> case 0xfd:
> rtw_write8(padapter, 0xc50, arg);
> - DBG_88E("wr(0xc50) = 0x%x\n", rtw_read8(padapter, 0xc50));
> rtw_write8(padapter, 0xc58, arg);
> - DBG_88E("wr(0xc58) = 0x%x\n", rtw_read8(padapter, 0xc58));
> - break;
> - case 0xfe:
> - DBG_88E("rd(0xc50) = 0x%x\n", rtw_read8(padapter, 0xc50));
> - DBG_88E("rd(0xc58) = 0x%x\n", rtw_read8(padapter, 0xc58));
> - break;
> - case 0xff:
> - DBG_88E("dbg(0x210) = 0x%x\n", rtw_read32(padapter, 0x210));
> - DBG_88E("dbg(0x608) = 0x%x\n", rtw_read32(padapter, 0x608));
> - DBG_88E("dbg(0x280) = 0x%x\n", rtw_read32(padapter, 0x280));
> - DBG_88E("dbg(0x284) = 0x%x\n", rtw_read32(padapter, 0x284));
> - DBG_88E("dbg(0x288) = 0x%x\n", rtw_read32(padapter, 0x288));
> -
> - DBG_88E("dbg(0x664) = 0x%x\n", rtw_read32(padapter, 0x664));
> -
> - DBG_88E("\n");
> -
> - DBG_88E("dbg(0x430) = 0x%x\n", rtw_read32(padapter, 0x430));
> - DBG_88E("dbg(0x438) = 0x%x\n", rtw_read32(padapter, 0x438));
> -
> - DBG_88E("dbg(0x440) = 0x%x\n", rtw_read32(padapter, 0x440));
> -
> - DBG_88E("dbg(0x458) = 0x%x\n", rtw_read32(padapter, 0x458));
> -
> - DBG_88E("dbg(0x484) = 0x%x\n", rtw_read32(padapter, 0x484));
> - DBG_88E("dbg(0x488) = 0x%x\n", rtw_read32(padapter, 0x488));
> -
> - DBG_88E("dbg(0x444) = 0x%x\n", rtw_read32(padapter, 0x444));
> - DBG_88E("dbg(0x448) = 0x%x\n", rtw_read32(padapter, 0x448));
> - DBG_88E("dbg(0x44c) = 0x%x\n", rtw_read32(padapter, 0x44c));
> - DBG_88E("dbg(0x450) = 0x%x\n", rtw_read32(padapter, 0x450));
> break;
> }

And here you also removes the reads. I guess, some kind of magic pattern
is used




With regards,
Pavel Skripkin

2022-01-26 13:46:26

by Phillip Potter

[permalink] [raw]
Subject: Re: [PATCH 00/10] Cleanup and removal of DBG_88E macro

On Tue, Jan 25, 2022 at 04:33:13PM +0100, Greg KH wrote:
> On Mon, Jan 24, 2022 at 10:44:05PM +0000, Phillip Potter wrote:
> > This series does a few things in order to effect the removal of the
> > DBG_88E macro:
> >
> > (1) It removes previously converted calls for consistency.
> > (2) It removes all current DBG_88E calls.
> > (3) It removes all aliased DBG_88E calls.
> > (4) It removes the GlobalDebugLevel flag and the file that defines it.
> >
> > By its very nature, it is a large patchset, so I've tried to group as
> > appropriate. I went by file as I did the work, which led to over 40
> > patches originally, so I've listed the largest C files as their own
> > patches and then grouped everything else by subdir which gives closer
> > sizes for the other patches.
>
> Can you rebase this on my staging-testing branch? It no longer applies
> :(
>
> thanks,
>
> greg k-h

Hi Greg,

Yes, of course - this was to supersede the previous 'conversion' patches
I sent so that is probably why it doesn't apply. Sorry, I did e-mail but
I should probably have made this clearer. I will fix it up over the next
few days, as it needs other changes anyway. Many thanks.

Regards,
Phil

2022-01-26 13:46:59

by Phillip Potter

[permalink] [raw]
Subject: Re: [PATCH 05/10] staging: r8188eu: remove smaller sets of DBG_88E calls from os_dep dir

On Tue, Jan 25, 2022 at 03:48:32PM +0300, Pavel Skripkin wrote:
> Hi Phillip,
>
> On 1/25/22 01:44, Phillip Potter wrote:
> > Remove all DBG_88E calls from the os_dep directory, other than those in
> > os_dep/ioctl_linux.c, as this contains almost 200 on its own so will be
> > done in a separate patch for ease of review. These calls do not conform
> > to kernel coding standards and are superfluous. Also restructure where
> > appropriate to remove no longer needed code left behind by removal of
> > these calls. This will allow the eventual removal of the DBG_88E macro
> > itself.
> >
> > Signed-off-by: Phillip Potter <[email protected]>
> > ---
>
> [code snip]
>
> > - /* 2012-07-11 Move here to prevent the 8723AS-VAU BT auto
> > - * suspend influence */
> > - if (usb_autopm_get_interface(pusb_intf) < 0)
> > - DBG_88E("can't get autopm:\n");
> > -
>
> Didn't you make a function change here? I didn't test and also didn't find
> any mentions of tests in cover letter.
>
> I am asking just to be sure you done it not by accident :)
>
>
>
>
>
> With regards,
> Pavel Skripkin

Hi Pavel,

Thank you for this and your other feedback, really appreciate it :-) So
I mistakenly took this out, you're quite right - will fix in next
series.

Regards,
Phil

2022-01-26 14:15:53

by Phillip Potter

[permalink] [raw]
Subject: Re: [PATCH 03/10] staging: r8188eu: remove DBG_88E calls from core/rtw_mlme_ext.c

On Tue, Jan 25, 2022 at 09:31:27PM +0300, Pavel Skripkin wrote:
> Hi Phillip,
>
> On 1/25/22 01:44, Phillip Potter wrote:
> > Remove all DBG_88E calls from core/rtw_mlme_ext.c, including the commented
> > one, as they do not conform to kernel coding standards and are
> > superfluous. Also restructure where appropriate to remove no longer needed
> > code left behind by removal of these calls. This will allow the eventual
> > removal of the DBG_88E macro itself.
> >
> > Signed-off-by: Phillip Potter <[email protected]>
> > ---
>
> [code snip]
>
> > static u8 chk_ap_is_alive(struct adapter *padapter, struct sta_info *psta)
> > @@ -7141,18 +6905,11 @@ static u8 chk_ap_is_alive(struct adapter *padapter, struct sta_info *psta)
> > static void rtl8188e_sreset_linked_status_check(struct adapter *padapter)
> > {
> > u32 rx_dma_status = rtw_read32(padapter, REG_RXDMA_STATUS);
> > - u8 fw_status;
> > - if (rx_dma_status != 0x00) {
> > - DBG_88E("%s REG_RXDMA_STATUS:0x%08x\n", __func__, rx_dma_status);
> > + if (rx_dma_status != 0x00)
> > rtw_write32(padapter, REG_RXDMA_STATUS, rx_dma_status);
> > - }
> > - fw_status = rtw_read8(padapter, REG_FMETHR);
> > - if (fw_status == 1)
> > - DBG_88E("%s REG_FW_STATUS (0x%02x), Read_Efuse_Fail !!\n", __func__, fw_status);
> > - else if (fw_status == 2)
> > - DBG_88E("%s REG_FW_STATUS (0x%02x), Condition_No_Match !!\n", __func__, fw_status);
> > + rtw_read8(padapter, REG_FMETHR);
> > }
>
> Unused read. Can be dropped
>
>
>
> With regards,
> Pavel Skripkin

Thanks - good point, will remove in v2.

Regards,
Phil

2022-01-26 14:16:33

by Phillip Potter

[permalink] [raw]
Subject: Re: [PATCH 06/10] staging: r8188eu: remove DBG_88E calls from os_dep/ioctl_linux.c

On Tue, Jan 25, 2022 at 10:03:06PM +0300, Pavel Skripkin wrote:
> Hi Phillip,
>
> On 1/25/22 01:44, Phillip Potter wrote:
> > Remove all DBG_88E calls from os_dep/ioctl_linux.c, as they do not
> > conform to kernel coding standards and are superfluous. Also restructure
> > where appropriate to remove no longer needed code left behind by removal
> > of these calls. This will allow the eventual removal of the DBG_88E macro
> > itself.
> >
> > Signed-off-by: Phillip Potter <[email protected]>
> > ---
>
> [code snip]
>
> > @@ -3746,7 +3541,6 @@ static int rtw_dbg_port(struct net_device *dev,
> > u32 write_num = extra_arg;
> > int i;
> > - u16 final;
> > struct xmit_frame *xmit_frame;
> > xmit_frame = rtw_IOL_accquire_xmit_frame(padapter);
> > @@ -3760,11 +3554,7 @@ static int rtw_dbg_port(struct net_device *dev,
> > if (rtl8188e_IOL_exec_cmds_sync(padapter, xmit_frame, 5000, 0) != _SUCCESS)
> > ret = -EPERM;
> > - final = rtw_read16(padapter, reg);
> > - if (start_value + write_num - 1 == final)
> > - DBG_88E("continuous IOL_CMD_WW_REG to 0x%x %u times Success, start:%u, final:%u\n", reg, write_num, start_value, final);
> > - else
> > - DBG_88E("continuous IOL_CMD_WW_REG to 0x%x %u times Fail, start:%u, final:%u\n", reg, write_num, start_value, final);
> > + rtw_read16(padapter, reg);
> > }
> > break;
>
> I see, that you somewhere removes reads and somewhere leaves them. What's
> the difference? I saw, that one of the places has the comment, that asks not
> to remove the read, but others do not have such comment
>
> I can point to few places in 2 and 4 patches where you have removed reads.
>
>
>
> [code snip]
>
> > @@ -4014,16 +3664,8 @@ static int rtw_dbg_port(struct net_device *dev,
> > {
> > u32 odm_flag;
> > - if (0xf == extra_arg) {
> > + if (extra_arg == 0xf) {
> > GetHalDefVar8188EUsb(padapter, HAL_DEF_DBG_DM_FUNC, &odm_flag);
> > - DBG_88E(" === DMFlag(0x%08x) ===\n", odm_flag);
> > - DBG_88E("extra_arg = 0 - disable all dynamic func\n");
> > - DBG_88E("extra_arg = 1 - disable DIG- BIT(0)\n");
> > - DBG_88E("extra_arg = 2 - disable High power - BIT(1)\n");
> > - DBG_88E("extra_arg = 3 - disable tx power tracking - BIT(2)\n");
> > - DBG_88E("extra_arg = 4 - disable BT coexistence - BIT(3)\n");
> > - DBG_88E("extra_arg = 5 - disable antenna diversity - BIT(4)\n");
> > - DBG_88E("extra_arg = 6 - enable all dynamic func\n");
> > } else {
> > /* extra_arg = 0 - disable all dynamic func
> > extra_arg = 1 - disable DIG
> > @@ -4032,51 +3674,17 @@ static int rtw_dbg_port(struct net_device *dev,
> > */
> > SetHalDefVar8188EUsb(padapter, HAL_DEF_DBG_DM_FUNC, &extra_arg);
> > GetHalDefVar8188EUsb(padapter, HAL_DEF_DBG_DM_FUNC, &odm_flag);
> > - DBG_88E(" === DMFlag(0x%08x) ===\n", odm_flag);
> > }
> > }
> > break;
>
> Is odm_flag needed now? Seems like it was used only for printing random
> debug info

You're right, it can probably go :-)

>
> > case 0xfd:
> > rtw_write8(padapter, 0xc50, arg);
> > - DBG_88E("wr(0xc50) = 0x%x\n", rtw_read8(padapter, 0xc50));
> > rtw_write8(padapter, 0xc58, arg);
> > - DBG_88E("wr(0xc58) = 0x%x\n", rtw_read8(padapter, 0xc58));
> > - break;
> > - case 0xfe:
> > - DBG_88E("rd(0xc50) = 0x%x\n", rtw_read8(padapter, 0xc50));
> > - DBG_88E("rd(0xc58) = 0x%x\n", rtw_read8(padapter, 0xc58));
> > - break;
> > - case 0xff:
> > - DBG_88E("dbg(0x210) = 0x%x\n", rtw_read32(padapter, 0x210));
> > - DBG_88E("dbg(0x608) = 0x%x\n", rtw_read32(padapter, 0x608));
> > - DBG_88E("dbg(0x280) = 0x%x\n", rtw_read32(padapter, 0x280));
> > - DBG_88E("dbg(0x284) = 0x%x\n", rtw_read32(padapter, 0x284));
> > - DBG_88E("dbg(0x288) = 0x%x\n", rtw_read32(padapter, 0x288));
> > -
> > - DBG_88E("dbg(0x664) = 0x%x\n", rtw_read32(padapter, 0x664));
> > -
> > - DBG_88E("\n");
> > -
> > - DBG_88E("dbg(0x430) = 0x%x\n", rtw_read32(padapter, 0x430));
> > - DBG_88E("dbg(0x438) = 0x%x\n", rtw_read32(padapter, 0x438));
> > -
> > - DBG_88E("dbg(0x440) = 0x%x\n", rtw_read32(padapter, 0x440));
> > -
> > - DBG_88E("dbg(0x458) = 0x%x\n", rtw_read32(padapter, 0x458));
> > -
> > - DBG_88E("dbg(0x484) = 0x%x\n", rtw_read32(padapter, 0x484));
> > - DBG_88E("dbg(0x488) = 0x%x\n", rtw_read32(padapter, 0x488));
> > -
> > - DBG_88E("dbg(0x444) = 0x%x\n", rtw_read32(padapter, 0x444));
> > - DBG_88E("dbg(0x448) = 0x%x\n", rtw_read32(padapter, 0x448));
> > - DBG_88E("dbg(0x44c) = 0x%x\n", rtw_read32(padapter, 0x44c));
> > - DBG_88E("dbg(0x450) = 0x%x\n", rtw_read32(padapter, 0x450));
> > break;
> > }
>
> And here you also removes the reads. I guess, some kind of magic pattern is
> used
>

So these calls are macro arguments, they would never be executed under
normal circumstances anyway, unless the rtw_debug kernel module was
passed in as 5 or more - it is 1 by default. The DBG_88E macro would
expand during preprocessing phase to (for example):

do {
if (5 <= GlobalDebugLevel)
pr_info("R8188EU: " "dbg(0x450) = 0x%x\n", rtw_read32(padapter, 0x450));
} while (0)

As this is never executed under normal circumstances anyway, I would say
calls like these are therefore safe to remove. Happy to be convinced
though :-) Many thanks.

Regards,
Phil

2022-01-26 21:00:58

by Pavel Skripkin

[permalink] [raw]
Subject: Re: [PATCH 06/10] staging: r8188eu: remove DBG_88E calls from os_dep/ioctl_linux.c

Hi Phillip,

On 1/26/22 04:13, Phillip Potter wrote:

[snip]

}
>>
>> And here you also removes the reads. I guess, some kind of magic pattern is
>> used
>>
>
> So these calls are macro arguments, they would never be executed under
> normal circumstances anyway, unless the rtw_debug kernel module was
> passed in as 5 or more - it is 1 by default. The DBG_88E macro would
> expand during preprocessing phase to (for example):
>
> do {
> if (5 <= GlobalDebugLevel)
> pr_info("R8188EU: " "dbg(0x450) = 0x%x\n", rtw_read32(padapter, 0x450));
> } while (0)
>
> As this is never executed under normal circumstances anyway, I would say
> calls like these are therefore safe to remove. Happy to be convinced
> though :-) Many thanks.
>

I see your point, thanks for explanation.

Well, in this case, you may left all reads, that are executed during
normal lifetime of a driver. We know, that there is at least 1 place,
where read() call removal can break things. Might be there are couple of
other places we don't know about.

IMHO the best thing you can do is to leave these reads and leave a
comment like "hey, please remove me and test". One day useless reads
should be anyway removed, since ideally rtw_read family must get
__must_check annotation + normal error handling.

Thanks :)




With regards,
Pavel Skripkin

2022-01-26 21:05:17

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH 06/10] staging: r8188eu: remove DBG_88E calls from os_dep/ioctl_linux.c

On Wed, Jan 26, 2022 at 01:26:08PM +0300, Pavel Skripkin wrote:
> Hi Phillip,
>
> On 1/26/22 04:13, Phillip Potter wrote:
>
> [snip]
>
> }
> > >
> > > And here you also removes the reads. I guess, some kind of magic pattern is
> > > used
> > >
> >
> > So these calls are macro arguments, they would never be executed under
> > normal circumstances anyway, unless the rtw_debug kernel module was
> > passed in as 5 or more - it is 1 by default. The DBG_88E macro would
> > expand during preprocessing phase to (for example):
> >
> > do {
> > if (5 <= GlobalDebugLevel)
> > pr_info("R8188EU: " "dbg(0x450) = 0x%x\n", rtw_read32(padapter, 0x450));
> > } while (0)
> >
> > As this is never executed under normal circumstances anyway, I would say
> > calls like these are therefore safe to remove. Happy to be convinced
> > though :-) Many thanks.
> >
>
> I see your point, thanks for explanation.
>
> Well, in this case, you may left all reads, that are executed during normal
> lifetime of a driver. We know, that there is at least 1 place, where read()
> call removal can break things. Might be there are couple of other places we
> don't know about.
>
> IMHO the best thing you can do is to leave these reads and leave a comment
> like "hey, please remove me and test". One day useless reads should be
> anyway removed, since ideally rtw_read family must get __must_check
> annotation + normal error handling.

No, if these were never getting called in normal operation, there's no
need to add them back.

thanks,

greg k-h

2022-01-26 21:06:32

by Pavel Skripkin

[permalink] [raw]
Subject: Re: [PATCH 06/10] staging: r8188eu: remove DBG_88E calls from os_dep/ioctl_linux.c

Hi Greg,

On 1/26/22 13:48, Greg KH wrote:
>> IMHO the best thing you can do is to leave these reads and leave a comment
>> like "hey, please remove me and test". One day useless reads should be
>> anyway removed, since ideally rtw_read family must get __must_check
>> annotation + normal error handling.
>
> No, if these were never getting called in normal operation, there's no
> need to add them back.
>

I guess, I was not clear, sorry. I mean leave reads that were called
during normal operations, but used only for printing debug info. (As
Phillip has already done in v1)

Reads inside R88_DBG() and other debug macros of course should be
removed, but other places seems dangerous without good testing. There is
al least one place with following comment:

> /* Although lenc is only used in a debug statement,
> * do not remove it as the rtw_read16() call consumes
> * 2 bytes from the EEPROM source.
> */
> u16 lenc = rtw_read16(adapter, REG_PKTBUF_DBG_DATA_L);

There is a chance that other places have same problem, but don't have a
comment above it. That's why I suggested to leave all these "debug"
reads and leave a comment for further work. It will help to easily spot
them in future and remove or leave them with explanations why.




With regards,
Pavel Skripkin

2022-01-26 21:09:50

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH 06/10] staging: r8188eu: remove DBG_88E calls from os_dep/ioctl_linux.c

On Wed, Jan 26, 2022 at 01:58:52PM +0300, Pavel Skripkin wrote:
> Hi Greg,
>
> On 1/26/22 13:48, Greg KH wrote:
> > > IMHO the best thing you can do is to leave these reads and leave a comment
> > > like "hey, please remove me and test". One day useless reads should be
> > > anyway removed, since ideally rtw_read family must get __must_check
> > > annotation + normal error handling.
> >
> > No, if these were never getting called in normal operation, there's no
> > need to add them back.
> >
>
> I guess, I was not clear, sorry. I mean leave reads that were called during
> normal operations, but used only for printing debug info. (As Phillip has
> already done in v1)
>
> Reads inside R88_DBG() and other debug macros of course should be removed,
> but other places seems dangerous without good testing. There is al least one
> place with following comment:
>
> > /* Although lenc is only used in a debug statement,
> > * do not remove it as the rtw_read16() call consumes
> > * 2 bytes from the EEPROM source.
> > */
> > u16 lenc = rtw_read16(adapter, REG_PKTBUF_DBG_DATA_L);
>
> There is a chance that other places have same problem, but don't have a
> comment above it. That's why I suggested to leave all these "debug" reads
> and leave a comment for further work. It will help to easily spot them in
> future and remove or leave them with explanations why.

Yes, those are fine, thanks.

2022-01-27 14:42:07

by Phillip Potter

[permalink] [raw]
Subject: Re: [PATCH 06/10] staging: r8188eu: remove DBG_88E calls from os_dep/ioctl_linux.c

On Wed, Jan 26, 2022 at 01:26:08PM +0300, Pavel Skripkin wrote:
> Hi Phillip,
>
> On 1/26/22 04:13, Phillip Potter wrote:
>
> [snip]
>
> }
> > >
> > > And here you also removes the reads. I guess, some kind of magic pattern is
> > > used
> > >
> >
> > So these calls are macro arguments, they would never be executed under
> > normal circumstances anyway, unless the rtw_debug kernel module was
> > passed in as 5 or more - it is 1 by default. The DBG_88E macro would
> > expand during preprocessing phase to (for example):
> >
> > do {
> > if (5 <= GlobalDebugLevel)
> > pr_info("R8188EU: " "dbg(0x450) = 0x%x\n", rtw_read32(padapter, 0x450));
> > } while (0)
> >
> > As this is never executed under normal circumstances anyway, I would say
> > calls like these are therefore safe to remove. Happy to be convinced
> > though :-) Many thanks.
> >
>
> I see your point, thanks for explanation.
>
> Well, in this case, you may left all reads, that are executed during normal
> lifetime of a driver. We know, that there is at least 1 place, where read()
> call removal can break things. Might be there are couple of other places we
> don't know about.
>
> IMHO the best thing you can do is to leave these reads and leave a comment
> like "hey, please remove me and test". One day useless reads should be
> anyway removed, since ideally rtw_read family must get __must_check
> annotation + normal error handling.
>

Yeah, not a bad idea - I've tried to remove only those which don't look
like they'd have side effects (such as fwstate checks etc.), but by all
means I can put them back in with the next revision. Thanks.

Regards,
Phil