2022-01-10 09:02:04

by Phillip Potter

[permalink] [raw]
Subject: [PATCH v2 0/7] staging: r8188eu: further per-file DBG_88E cleanups

This series has more conversions/deletions of DBG_88E macro calls,
per-file, as I've continued to chip away at them. This converts almost
200 calls to standard kernel macros/functions such as netdev_dbg and
pr_debug as appropriate. It also deletes several calls which simply
aren't necessary.

Revisions of this patch set:
V1: Initial set.
V2: Corrects rtw_mlme_ext.c patch to remove empty goto label. All other
patches are the same as V1.

Phillip Potter (7):
staging: r8188eu: convert DBG_88E calls in core/rtw_ieee80211.c
staging: r8188eu: convert DBG_88E calls in core/rtw_xmit.c
staging: r8188eu: convert DBG_88E calls in core/rtw_iol.c
staging: r8188eu: convert DBG_88E calls in core/rtw_mlme.c
staging: r8188eu: convert DBG_88E calls in core/rtw_ioctl_set.c
staging: r8188eu: convert DBG_88E calls in core/rtw_mlme_ext.c
staging: r8188eu: convert DBG_88E calls in core/rtw_sta_mgt.c

drivers/staging/r8188eu/core/rtw_ieee80211.c | 36 +-
drivers/staging/r8188eu/core/rtw_ioctl_set.c | 10 +-
drivers/staging/r8188eu/core/rtw_iol.c | 10 +-
drivers/staging/r8188eu/core/rtw_mlme.c | 95 ++--
drivers/staging/r8188eu/core/rtw_mlme_ext.c | 431 +++++++++++--------
drivers/staging/r8188eu/core/rtw_sta_mgt.c | 4 +-
drivers/staging/r8188eu/core/rtw_xmit.c | 30 +-
7 files changed, 345 insertions(+), 271 deletions(-)

--
2.33.1



2022-01-10 09:02:07

by Phillip Potter

[permalink] [raw]
Subject: [PATCH v2 3/7] staging: r8188eu: convert DBG_88E calls in core/rtw_iol.c

Convert the DBG_88E macro calls in core/rtw_iol.c to use pr_debug
or netdev_dbg appropriately, as their information may be useful to
observers, and this gets the driver closer to the point of being
able to remove DBG_88E itself.

Some calls are at points in the call chain where use of dev_dbg or
netdev_dbg isn't possible due to lack of device pointer, so plain
pr_debug is appropriate here.

Signed-off-by: Phillip Potter <[email protected]>
---
drivers/staging/r8188eu/core/rtw_iol.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/r8188eu/core/rtw_iol.c b/drivers/staging/r8188eu/core/rtw_iol.c
index 7e78b47c1284..923da2a9f6ae 100644
--- a/drivers/staging/r8188eu/core/rtw_iol.c
+++ b/drivers/staging/r8188eu/core/rtw_iol.c
@@ -12,13 +12,15 @@ struct xmit_frame *rtw_IOL_accquire_xmit_frame(struct adapter *adapter)

xmit_frame = rtw_alloc_xmitframe(pxmitpriv);
if (!xmit_frame) {
- DBG_88E("%s rtw_alloc_xmitframe return null\n", __func__);
+ netdev_dbg(adapter->pnetdev,
+ "rtw_alloc_xmitframe return null\n");
return NULL;
}

xmitbuf = rtw_alloc_xmitbuf(pxmitpriv);
if (!xmitbuf) {
- DBG_88E("%s rtw_alloc_xmitbuf return null\n", __func__);
+ netdev_dbg(adapter->pnetdev,
+ "rtw_alloc_xmitbuf return null\n");
rtw_free_xmitframe(pxmitpriv, xmit_frame);
return NULL;
}
@@ -49,8 +51,8 @@ int rtw_IOL_append_cmds(struct xmit_frame *xmit_frame, u8 *IOL_cmds, u32 cmd_len

/* check if the io_buf can accommodate new cmds */
if (ori_len + cmd_len + 8 > MAX_XMITBUF_SZ) {
- DBG_88E("%s %u is large than MAX_XMITBUF_SZ:%u, can't accommodate new cmds\n",
- __func__, ori_len + cmd_len + 8, MAX_XMITBUF_SZ);
+ pr_debug("%u is larger than MAX_XMITBUF_SZ:%u, can't accommodate new cmds\n",
+ ori_len + cmd_len + 8, MAX_XMITBUF_SZ);
return _FAIL;
}

--
2.33.1


2022-01-10 09:02:27

by Phillip Potter

[permalink] [raw]
Subject: [PATCH v2 2/7] staging: r8188eu: convert DBG_88E calls in core/rtw_xmit.c

Convert the DBG_88E macro calls in core/rtw_xmit.c to use pr_debug
or netdev_dbg appropriately, as their information may be useful to
observers, and this gets the driver closer to the point of being
able to remove DBG_88E itself. Also remove some commented out
DBG_88E calls altogether.

Some calls are at points in the call chain where use of dev_dbg or
netdev_dbg isn't possible due to lack of device pointer, so plain
pr_debug is appropriate here.

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

diff --git a/drivers/staging/r8188eu/core/rtw_xmit.c b/drivers/staging/r8188eu/core/rtw_xmit.c
index 8503059edc46..334644e46000 100644
--- a/drivers/staging/r8188eu/core/rtw_xmit.c
+++ b/drivers/staging/r8188eu/core/rtw_xmit.c
@@ -372,7 +372,7 @@ u8 qos_acm(u8 acm_mask, u8 priority)
change_priority = 5;
break;
default:
- DBG_88E("qos_acm(): invalid pattrib->priority: %d!!!\n", priority);
+ pr_debug("invalid pattrib->priority: %d!!!\n", priority);
break;
}

@@ -489,7 +489,6 @@ static s32 update_attrib(struct adapter *padapter, struct sk_buff *pkt, struct p

if (psta) {
pattrib->mac_id = psta->mac_id;
- /* DBG_88E("%s ==> mac_id(%d)\n", __func__, pattrib->mac_id); */
pattrib->psta = psta;
} else {
/* if we cannot get psta => drop the pkt */
@@ -895,7 +894,7 @@ s32 rtw_xmitframe_coalesce(struct adapter *padapter, struct sk_buff *pkt, struct
return _FAIL;

if (!pxmitframe->buf_addr) {
- DBG_88E("==> %s buf_addr == NULL\n", __func__);
+ netdev_dbg(padapter->pnetdev, "buf_addr == NULL\n");
return _FAIL;
}

@@ -906,7 +905,8 @@ s32 rtw_xmitframe_coalesce(struct adapter *padapter, struct sk_buff *pkt, struct
mem_start = pbuf_start + hw_hdr_offset;

if (rtw_make_wlanhdr(padapter, mem_start, pattrib) == _FAIL) {
- DBG_88E("rtw_xmitframe_coalesce: rtw_make_wlanhdr fail; drop pkt\n");
+ netdev_dbg(padapter->pnetdev,
+ "rtw_make_wlanhdr fail; drop pkt\n");
res = _FAIL;
goto exit;
}
@@ -1003,7 +1003,8 @@ s32 rtw_xmitframe_coalesce(struct adapter *padapter, struct sk_buff *pkt, struct
}

if (xmitframe_addmic(padapter, pxmitframe) == _FAIL) {
- DBG_88E("xmitframe_addmic(padapter, pxmitframe) == _FAIL\n");
+ netdev_dbg(padapter->pnetdev,
+ "xmitframe_addmic(padapter, pxmitframe) == _FAIL\n");
res = _FAIL;
goto exit;
}
@@ -1134,7 +1135,7 @@ struct xmit_buf *rtw_alloc_xmitbuf_ext(struct xmit_priv *pxmitpriv)
/* pxmitbuf->ext_tag = true; */

if (pxmitbuf->sctx) {
- DBG_88E("%s pxmitbuf->sctx is not NULL\n", __func__);
+ pr_debug("pxmitbuf->sctx is not NULL\n");
rtw_sctx_done_err(&pxmitbuf->sctx, RTW_SCTX_DONE_BUF_ALLOC);
}
}
@@ -1171,8 +1172,6 @@ struct xmit_buf *rtw_alloc_xmitbuf(struct xmit_priv *pxmitpriv)
struct __queue *pfree_xmitbuf_queue = &pxmitpriv->free_xmitbuf_queue;
unsigned long flags;

- /* DBG_88E("+rtw_alloc_xmitbuf\n"); */
-
spin_lock_irqsave(&pfree_xmitbuf_queue->lock, flags);

if (list_empty(&pfree_xmitbuf_queue->queue)) {
@@ -1191,7 +1190,7 @@ struct xmit_buf *rtw_alloc_xmitbuf(struct xmit_priv *pxmitpriv)
pxmitpriv->free_xmitbuf_cnt--;
pxmitbuf->priv_data = NULL;
if (pxmitbuf->sctx) {
- DBG_88E("%s pxmitbuf->sctx is not NULL\n", __func__);
+ pr_debug("pxmitbuf->sctx is not NULL\n");
rtw_sctx_done_err(&pxmitbuf->sctx, RTW_SCTX_DONE_BUF_ALLOC);
}
}
@@ -1209,7 +1208,7 @@ s32 rtw_free_xmitbuf(struct xmit_priv *pxmitpriv, struct xmit_buf *pxmitbuf)
return _FAIL;

if (pxmitbuf->sctx) {
- DBG_88E("%s pxmitbuf->sctx is not NULL\n", __func__);
+ pr_debug("pxmitbuf->sctx is not NULL\n");
rtw_sctx_done_err(&pxmitbuf->sctx, RTW_SCTX_DONE_BUF_FREE);
}

@@ -1479,7 +1478,7 @@ s32 rtw_xmit_classifier(struct adapter *padapter, struct xmit_frame *pxmitframe)

if (!psta) {
res = _FAIL;
- DBG_88E("rtw_xmit_classifier: psta == NULL\n");
+ netdev_dbg(padapter->pnetdev, "psta == NULL\n");
goto exit;
}

@@ -1725,7 +1724,8 @@ s32 rtw_xmit(struct adapter *padapter, struct sk_buff **ppkt)

pxmitframe = rtw_alloc_xmitframe(pxmitpriv);
if (!pxmitframe) {
- DBG_88E("DBG_TX_DROP_FRAME %s no more pxmitframe\n", __func__);
+ netdev_dbg(padapter->pnetdev,
+ "DBG_TX_DROP_FRAME no more pxmitframe\n");
return -1;
}

@@ -2150,7 +2150,7 @@ int rtw_sctx_wait(struct submit_ctx *sctx)
if (!wait_for_completion_timeout(&sctx->done, expire)) {
/* timeout, do something?? */
status = RTW_SCTX_DONE_TIMEOUT;
- DBG_88E("%s timeout\n", __func__);
+ pr_debug("timeout\n");
} else {
status = sctx->status;
}
@@ -2180,7 +2180,7 @@ void rtw_sctx_done_err(struct submit_ctx **sctx, int status)
{
if (*sctx) {
if (rtw_sctx_chk_waring_status(status))
- DBG_88E("%s status:%d\n", __func__, status);
+ pr_debug("status:%d\n", status);
(*sctx)->status = status;
complete(&((*sctx)->done));
*sctx = NULL;
@@ -2205,5 +2205,5 @@ void rtw_ack_tx_done(struct xmit_priv *pxmitpriv, int status)
if (pxmitpriv->ack_tx)
rtw_sctx_done_err(&pack_tx_ops, status);
else
- DBG_88E("%s ack_tx not set\n", __func__);
+ pr_debug("ack_tx not set\n");
}
--
2.33.1


2022-01-10 09:02:29

by Phillip Potter

[permalink] [raw]
Subject: [PATCH v2 1/7] staging: r8188eu: convert DBG_88E calls in core/rtw_ieee80211.c

Convert the DBG_88E macro calls in core/rtw_ieee80211.c to use pr_debug
as their information may be useful to observers, and this gets the
driver closer to the point of being able to remove DBG_88E itself.

These calls are at points in the call chain where use of dev_dbg or
netdev_dbg isn't possible due to lack of device pointer, so plain
pr_debug is appropriate here.

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

diff --git a/drivers/staging/r8188eu/core/rtw_ieee80211.c b/drivers/staging/r8188eu/core/rtw_ieee80211.c
index ad87954bdeb4..25445f3ab4a3 100644
--- a/drivers/staging/r8188eu/core/rtw_ieee80211.c
+++ b/drivers/staging/r8188eu/core/rtw_ieee80211.c
@@ -655,8 +655,8 @@ static int rtw_ieee802_11_parse_vendor_specific(u8 *pos, uint elen,
* sub-type. */
if (elen < 4) {
if (show_errors) {
- DBG_88E("short vendor specific information element ignored (len=%lu)\n",
- (unsigned long)elen);
+ pr_debug("short vendor specific information element ignored (len=%lu)\n",
+ (unsigned long)elen);
}
return -1;
}
@@ -675,8 +675,8 @@ static int rtw_ieee802_11_parse_vendor_specific(u8 *pos, uint elen,
break;
case WME_OUI_TYPE: /* this is a Wi-Fi WME info. element */
if (elen < 5) {
- DBG_88E("short WME information element ignored (len=%lu)\n",
- (unsigned long)elen);
+ pr_debug("short WME information element ignored (len=%lu)\n",
+ (unsigned long)elen);
return -1;
}
switch (pos[4]) {
@@ -690,8 +690,8 @@ static int rtw_ieee802_11_parse_vendor_specific(u8 *pos, uint elen,
elems->wme_tspec_len = elen;
break;
default:
- DBG_88E("unknown WME information element ignored (subtype=%d len=%lu)\n",
- pos[4], (unsigned long)elen);
+ pr_debug("unknown WME information element ignored (subtype=%d len=%lu)\n",
+ pos[4], (unsigned long)elen);
return -1;
}
break;
@@ -701,8 +701,8 @@ static int rtw_ieee802_11_parse_vendor_specific(u8 *pos, uint elen,
elems->wps_ie_len = elen;
break;
default:
- DBG_88E("Unknown Microsoft information element ignored (type=%d len=%lu)\n",
- pos[3], (unsigned long)elen);
+ pr_debug("Unknown Microsoft information element ignored (type=%d len=%lu)\n",
+ pos[3], (unsigned long)elen);
return -1;
}
break;
@@ -714,14 +714,14 @@ static int rtw_ieee802_11_parse_vendor_specific(u8 *pos, uint elen,
elems->vendor_ht_cap_len = elen;
break;
default:
- DBG_88E("Unknown Broadcom information element ignored (type=%d len=%lu)\n",
- pos[3], (unsigned long)elen);
+ pr_debug("Unknown Broadcom information element ignored (type=%d len=%lu)\n",
+ pos[3], (unsigned long)elen);
return -1;
}
break;
default:
- DBG_88E("unknown vendor specific information element ignored (vendor OUI %02x:%02x:%02x len=%lu)\n",
- pos[0], pos[1], pos[2], (unsigned long)elen);
+ pr_debug("unknown vendor specific information element ignored (vendor OUI %02x:%02x:%02x len=%lu)\n",
+ pos[0], pos[1], pos[2], (unsigned long)elen);
return -1;
}
return 0;
@@ -754,8 +754,8 @@ enum parse_res rtw_ieee802_11_parse_elems(u8 *start, uint len,

if (elen > left) {
if (show_errors) {
- DBG_88E("IEEE 802.11 element parse failed (id=%d elen=%d left=%lu)\n",
- id, elen, (unsigned long)left);
+ pr_debug("IEEE 802.11 element parse failed (id=%d elen=%d left=%lu)\n",
+ id, elen, (unsigned long)left);
}
return ParseFailed;
}
@@ -841,8 +841,8 @@ enum parse_res rtw_ieee802_11_parse_elems(u8 *start, uint len,
unknown++;
if (!show_errors)
break;
- DBG_88E("IEEE 802.11 element parse ignored unknown element (id=%d elen=%d)\n",
- id, elen);
+ pr_debug("IEEE 802.11 element parse ignored unknown element (id=%d elen=%d)\n",
+ id, elen);
break;
}
left -= elen;
@@ -892,10 +892,10 @@ void rtw_macaddr_cfg(u8 *mac_addr)

if (is_broadcast_ether_addr(mac) || is_zero_ether_addr(mac)) {
eth_random_addr(mac_addr);
- DBG_88E("MAC Address from efuse error, assign random one !!!\n");
+ pr_debug("MAC Address from efuse error, assign random one !!!\n");
}

- DBG_88E("rtw_macaddr_cfg MAC Address = %pM\n", mac_addr);
+ pr_debug("MAC Address = %pM\n", mac_addr);
}

/**
--
2.33.1


2022-01-10 09:02:31

by Phillip Potter

[permalink] [raw]
Subject: [PATCH v2 4/7] staging: r8188eu: convert DBG_88E calls in core/rtw_mlme.c

Convert the DBG_88E macro calls in core/rtw_mlme.c to use netdev_dbg,
as their information may be useful to observers, and this gets the
driver closer to the point of being able to remove DBG_88E itself.
Also remove some unnecessary DBG_88E calls altogether as all they do
is print the function name.

Signed-off-by: Phillip Potter <[email protected]>
---
drivers/staging/r8188eu/core/rtw_mlme.c | 95 ++++++++++++++-----------
1 file changed, 54 insertions(+), 41 deletions(-)

diff --git a/drivers/staging/r8188eu/core/rtw_mlme.c b/drivers/staging/r8188eu/core/rtw_mlme.c
index 394e8a5ce03c..189b48b17326 100644
--- a/drivers/staging/r8188eu/core/rtw_mlme.c
+++ b/drivers/staging/r8188eu/core/rtw_mlme.c
@@ -617,7 +617,9 @@ static int rtw_is_desired_network(struct adapter *adapter, struct wlan_network *
}

if ((desired_encmode != Ndis802_11EncryptionDisabled) && (privacy == 0)) {
- DBG_88E("desired_encmode: %d, privacy: %d\n", desired_encmode, privacy);
+ netdev_dbg(adapter->pnetdev,
+ "desired_encmode: %d, privacy: %d\n",
+ desired_encmode, privacy);
bselected = false;
}

@@ -734,8 +736,9 @@ void rtw_surveydone_event_callback(struct adapter *adapter, u8 *pbuf)
_clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING);
rtw_indicate_connect(adapter);
} else {
- DBG_88E("try_to_join, but select scanning queue fail, to_roaming:%d\n",
- pmlmepriv->to_roaming);
+ netdev_dbg(adapter->pnetdev,
+ "try_to_join, but select scanning queue fail, to_roaming:%d\n",
+ pmlmepriv->to_roaming);
if (rtw_to_roaming(adapter) != 0) {
if (--pmlmepriv->to_roaming == 0 ||
_SUCCESS != rtw_sitesurvey_cmd(adapter, &pmlmepriv->assoc_ssid, 1, NULL, 0)) {
@@ -909,7 +912,6 @@ static struct sta_info *rtw_joinbss_update_stainfo(struct adapter *padapter, str
psta = rtw_alloc_stainfo(pstapriv, pnetwork->network.MacAddress);

if (psta) { /* update ptarget_sta */
- DBG_88E("%s\n", __func__);
psta->aid = pnetwork->join_res;
psta->mac_id = 0;
/* sta mode */
@@ -969,8 +971,6 @@ static void rtw_joinbss_update_network(struct adapter *padapter, struct wlan_net
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
struct wlan_network *cur_network = &pmlmepriv->cur_network;

- DBG_88E("%s\n", __func__);
-
/* why not use ptarget_wlan?? */
memcpy(&cur_network->network, &pnetwork->network, pnetwork->network.Length);
/* some IEs in pnetwork is wrong, so we should use ptarget_wlan IEs */
@@ -1196,7 +1196,7 @@ void rtw_stassoc_event_callback(struct adapter *adapter, u8 *pbuf)
/* to do: init sta_info variable */
psta->qos_option = 0;
psta->mac_id = (uint)pstassoc->cam_id;
- DBG_88E("%s\n", __func__);
+
/* for ad-hoc mode */
rtl8188e_SetHalODMVar(adapter, psta, true);
rtw_sta_media_status_rpt(adapter, psta, 1);
@@ -1239,7 +1239,9 @@ void rtw_stadel_event_callback(struct adapter *adapter, u8 *pbuf)
else
mac_id = pstadel->mac_id;

- DBG_88E("%s(mac_id=%d)=%pM\n", __func__, mac_id, pstadel->macaddr);
+ netdev_dbg(adapter->pnetdev,
+ "(mac_id=%d)=%pM\n",
+ mac_id, pstadel->macaddr);

if (mac_id >= 0) {
u16 media_status;
@@ -1330,7 +1332,7 @@ void _rtw_join_timeout_handler (struct adapter *adapter)
struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
int do_join_r;

- DBG_88E("%s, fw_state=%x\n", __func__, get_fwstate(pmlmepriv));
+ netdev_dbg(adapter->pnetdev, "fw_state=%x\n", get_fwstate(pmlmepriv));

if (adapter->bDriverStopped || adapter->bSurpriseRemoved)
return;
@@ -1341,15 +1343,19 @@ void _rtw_join_timeout_handler (struct adapter *adapter)
while (1) {
pmlmepriv->to_roaming--;
if (rtw_to_roaming(adapter) != 0) { /* try another */
- DBG_88E("%s try another roaming\n", __func__);
+ netdev_dbg(adapter->pnetdev,
+ "try another roaming\n");
do_join_r = rtw_do_join(adapter);
if (_SUCCESS != do_join_r) {
- DBG_88E("%s roaming do_join return %d\n", __func__, do_join_r);
+ netdev_dbg(adapter->pnetdev,
+ "roaming do_join return %d\n",
+ do_join_r);
continue;
}
break;
} else {
- DBG_88E("%s We've try roaming but fail\n", __func__);
+ netdev_dbg(adapter->pnetdev,
+ "We've tried roaming but failed\n");
rtw_indicate_disconnect(adapter);
break;
}
@@ -1370,7 +1376,7 @@ void rtw_scan_timeout_handler (struct adapter *adapter)
{
struct mlme_priv *pmlmepriv = &adapter->mlmepriv;

- DBG_88E(FUNC_ADPT_FMT" fw_state=%x\n", FUNC_ADPT_ARG(adapter), get_fwstate(pmlmepriv));
+ netdev_dbg(adapter->pnetdev, "fw_state=%x\n", get_fwstate(pmlmepriv));
spin_lock_bh(&pmlmepriv->lock);
_clr_fwstate_(pmlmepriv, _FW_UNDER_SURVEY);
spin_unlock_bh(&pmlmepriv->lock);
@@ -1385,7 +1391,6 @@ static void rtw_auto_scan_handler(struct adapter *padapter)
if (pmlmepriv->scan_interval > 0) {
pmlmepriv->scan_interval--;
if (pmlmepriv->scan_interval == 0) {
- DBG_88E("%s\n", __func__);
rtw_set_802_11_bssid_list_scan(padapter, NULL, 0);
pmlmepriv->scan_interval = SCAN_INTERVAL;/* 30*2 sec = 60sec */
}
@@ -1476,13 +1481,15 @@ static int rtw_check_join_candidate(struct mlme_priv *pmlmepriv
updated = true;
}
if (updated) {
- DBG_88E("[by_bssid:%u][assoc_ssid:%s]new candidate: %s(%pM rssi:%d\n",
- pmlmepriv->assoc_by_bssid,
- pmlmepriv->assoc_ssid.Ssid,
- (*candidate)->network.Ssid.Ssid,
- (*candidate)->network.MacAddress,
- (int)(*candidate)->network.Rssi);
- DBG_88E("[to_roaming:%u]\n", rtw_to_roaming(adapter));
+ netdev_dbg(adapter->pnetdev,
+ "[by_bssid:%u][assoc_ssid:%s]new candidate: %s(%pM rssi:%d\n",
+ pmlmepriv->assoc_by_bssid,
+ pmlmepriv->assoc_ssid.Ssid,
+ (*candidate)->network.Ssid.Ssid,
+ (*candidate)->network.MacAddress,
+ (int)(*candidate)->network.Rssi);
+ netdev_dbg(adapter->pnetdev,
+ "[to_roaming:%u]\n", rtw_to_roaming(adapter));
}

exit:
@@ -1520,18 +1527,20 @@ int rtw_select_and_join_from_scanned_queue(struct mlme_priv *pmlmepriv)
rtw_check_join_candidate(pmlmepriv, &candidate, pnetwork);
}
if (!candidate) {
- DBG_88E("%s: return _FAIL(candidate==NULL)\n", __func__);
+ netdev_dbg(adapter->pnetdev,
+ "return _FAIL(candidate==NULL)\n");
ret = _FAIL;
goto exit;
} else {
- DBG_88E("%s: candidate: %s(%pM ch:%u)\n", __func__,
- candidate->network.Ssid.Ssid, candidate->network.MacAddress,
- candidate->network.Configuration.DSConfig);
+ netdev_dbg(adapter->pnetdev, "candidate: %s(%pM ch:%u)\n",
+ candidate->network.Ssid.Ssid, candidate->network.MacAddress,
+ candidate->network.Configuration.DSConfig);
}

/* check for situation of _FW_LINKED */
if (check_fwstate(pmlmepriv, _FW_LINKED)) {
- DBG_88E("%s: _FW_LINKED while ask_for_joinbss!!!\n", __func__);
+ netdev_dbg(adapter->pnetdev,
+ "_FW_LINKED while ask_for_joinbss!!!\n");

rtw_disassoc_cmd(adapter, 0, true);
rtw_indicate_disconnect(adapter);
@@ -1542,10 +1551,9 @@ int rtw_select_and_join_from_scanned_queue(struct mlme_priv *pmlmepriv)
if (supp_ant_div) {
u8 cur_ant;
GetHalDefVar8188EUsb(adapter, HAL_DEF_CURRENT_ANTENNA, &cur_ant);
- DBG_88E("#### Opt_Ant_(%s), cur_Ant(%s)\n",
- (2 == candidate->network.PhyInfo.Optimum_antenna) ? "A" : "B",
- (2 == cur_ant) ? "A" : "B"
- );
+ netdev_dbg(adapter->pnetdev, "Opt_Ant_(%s), cur_Ant(%s)\n",
+ (candidate->network.PhyInfo.Optimum_antenna == 2) ? "A" : "B",
+ (cur_ant == 2) ? "A" : "B");
}

ret = rtw_joinbss_cmd(adapter, candidate);
@@ -1617,8 +1625,10 @@ int rtw_set_key(struct adapter *adapter, struct security_priv *psecuritypriv, in
psetkeyparm->keyid = (u8)keyid;/* 0~3 */
psetkeyparm->set_tx = set_tx;
pmlmepriv->key_mask |= BIT(psetkeyparm->keyid);
- DBG_88E("==> rtw_set_key algorithm(%x), keyid(%x), key_mask(%x)\n",
- psetkeyparm->algorithm, psetkeyparm->keyid, pmlmepriv->key_mask);
+ netdev_dbg(adapter->pnetdev,
+ "algorithm(%x), keyid(%x), key_mask(%x)\n",
+ psetkeyparm->algorithm, psetkeyparm->keyid,
+ pmlmepriv->key_mask);

switch (psetkeyparm->algorithm) {
case _WEP40_:
@@ -1970,8 +1980,6 @@ void rtw_update_ht_cap(struct adapter *padapter, u8 *pie, uint ie_len)
if ((!pmlmeinfo->HT_info_enable) || (!pmlmeinfo->HT_caps_enable))
return;

- DBG_88E("+rtw_update_ht_cap()\n");
-
/* maybe needs check if ap supports rx ampdu. */
if ((!phtpriv->ampdu_enable) && (pregistrypriv->ampdu_enable == 1)) {
if (pregistrypriv->wifi_spec == 1)
@@ -2022,7 +2030,7 @@ void rtw_update_ht_cap(struct adapter *padapter, u8 *pie, uint ie_len)
/* Config SM Power Save setting */
pmlmeinfo->SM_PS = (le16_to_cpu(pmlmeinfo->HT_caps.u.HT_cap_element.HT_caps_info) & 0x0C) >> 2;
if (pmlmeinfo->SM_PS == WLAN_HT_CAP_SM_PS_STATIC)
- DBG_88E("%s(): WLAN_HT_CAP_SM_PS_STATIC\n", __func__);
+ netdev_dbg(padapter->pnetdev, "WLAN_HT_CAP_SM_PS_STATIC\n");

/* Config current HT Protection mode. */
pmlmeinfo->HT_protection = pmlmeinfo->HT_info.infos[1] & 0x3;
@@ -2057,7 +2065,7 @@ void rtw_issue_addbareq_cmd(struct adapter *padapter, struct xmit_frame *pxmitfr
issued |= (phtpriv->candidate_tid_bitmap >> priority) & 0x1;

if (0 == issued) {
- DBG_88E("rtw_issue_addbareq_cmd, p=%d\n", priority);
+ netdev_dbg(padapter->pnetdev, "p=%d\n", priority);
psta->htpriv.candidate_tid_bitmap |= BIT((u8)priority);
rtw_addbareq_cmd(padapter, (u8)priority, pattrib->ra);
}
@@ -2085,9 +2093,11 @@ void _rtw_roaming(struct adapter *padapter, struct wlan_network *tgt_network)
pnetwork = &pmlmepriv->cur_network;

if (0 < rtw_to_roaming(padapter)) {
- DBG_88E("roaming from %s(%pM length:%d\n",
- pnetwork->network.Ssid.Ssid, pnetwork->network.MacAddress,
- pnetwork->network.Ssid.SsidLength);
+ netdev_dbg(padapter->pnetdev,
+ "roaming from %s(%pM length:%d\n",
+ pnetwork->network.Ssid.Ssid,
+ pnetwork->network.MacAddress,
+ pnetwork->network.Ssid.SsidLength);
memcpy(&pmlmepriv->assoc_ssid, &pnetwork->network.Ssid, sizeof(struct ndis_802_11_ssid));

pmlmepriv->assoc_by_bssid = false;
@@ -2097,13 +2107,16 @@ void _rtw_roaming(struct adapter *padapter, struct wlan_network *tgt_network)
if (_SUCCESS == do_join_r) {
break;
} else {
- DBG_88E("roaming do_join return %d\n", do_join_r);
+ netdev_dbg(padapter->pnetdev,
+ "roaming do_join return %d\n",
+ do_join_r);
pmlmepriv->to_roaming--;

if (0 < pmlmepriv->to_roaming) {
continue;
} else {
- DBG_88E("%s(%d) -to roaming fail, indicate_disconnect\n", __func__, __LINE__);
+ netdev_dbg(padapter->pnetdev,
+ "-to roaming fail, indicate_disconnect\n");
rtw_indicate_disconnect(padapter);
break;
}
--
2.33.1


2022-01-10 09:02:46

by Phillip Potter

[permalink] [raw]
Subject: [PATCH v2 6/7] staging: r8188eu: convert DBG_88E calls in core/rtw_mlme_ext.c

Convert the DBG_88E macro calls in core/rtw_mlme_ext.c to use pr_debug
or netdev_dbg appropriately, as their information may be useful to
observers, and this gets the driver closer to the point of being
able to remove DBG_88E itself. Also remove some commented out
or unnecessary DBG_88E calls altogether.

Some calls are at points in the call chain where use of dev_dbg or
netdev_dbg isn't possible due to lack of device pointer, so plain
pr_debug is appropriate here.

Signed-off-by: Phillip Potter <[email protected]>
---

V2: Removed empty goto label and used return instead.

drivers/staging/r8188eu/core/rtw_mlme_ext.c | 431 +++++++++++---------
1 file changed, 245 insertions(+), 186 deletions(-)

diff --git a/drivers/staging/r8188eu/core/rtw_mlme_ext.c b/drivers/staging/r8188eu/core/rtw_mlme_ext.c
index a9141ab1690e..090c768cfce1 100644
--- a/drivers/staging/r8188eu/core/rtw_mlme_ext.c
+++ b/drivers/staging/r8188eu/core/rtw_mlme_ext.c
@@ -315,7 +315,9 @@ 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);
+ netdev_dbg(padapter->pnetdev,
+ "ChannelPlan ID %x error !!!!!\n",
+ ChannelPlan);
return chanset_size;
}

@@ -436,7 +438,9 @@ void mgt_dispatcher(struct adapter *padapter, struct recv_frame *precv_frame)
if (GetRetry(pframe)) {
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);
+ netdev_dbg(padapter->pnetdev,
+ "Drop duplicate management frame with seq_num=%d.\n",
+ precv_frame->attrib.seq_num);
return;
}
}
@@ -586,7 +590,8 @@ 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__);
+ netdev_dbg(padapter->pnetdev,
+ "P2P State is GONEGO ING!\n");
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 +599,8 @@ 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__);
+ netdev_dbg(padapter->pnetdev,
+ "P2P_STATE_TX_INVITE_REQ!\n");
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);
@@ -720,15 +726,13 @@ 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);
+ netdev_dbg(padapter->pnetdev, "auth alg=%x, seq=%X\n", algorithm, seq);

if (auth_mode == 2 && psecuritypriv->dot11PrivacyAlgrthm != _WEP40_ &&
psecuritypriv->dot11PrivacyAlgrthm != _WEP104_)
@@ -736,8 +740,9 @@ unsigned int OnAuth(struct adapter *padapter, struct recv_frame *precv_frame)

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]);
+ netdev_dbg(padapter->pnetdev,
+ "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_;

@@ -752,10 +757,12 @@ 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);
+ netdev_dbg(padapter->pnetdev,
+ "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");
+ netdev_dbg(padapter->pnetdev,
+ "Exceed the upper limit of supported clients...\n");
status = _STATS_UNABLE_HANDLE_STA_;
goto auth_fail;
}
@@ -786,8 +793,9 @@ 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);
+ netdev_dbg(padapter->pnetdev,
+ "(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;
}
@@ -799,8 +807,9 @@ 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);
+ netdev_dbg(padapter->pnetdev,
+ "(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;
}
@@ -814,13 +823,14 @@ 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");
+ netdev_dbg(padapter->pnetdev, "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");
+ netdev_dbg(padapter->pnetdev,
+ "auth rejected because challenge failure!(1)\n");
status = _STATS_CHALLENGE_FAIL_;
goto auth_fail;
}
@@ -831,13 +841,15 @@ 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");
+ netdev_dbg(padapter->pnetdev,
+ "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);
+ netdev_dbg(padapter->pnetdev,
+ "(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;
}
@@ -877,8 +889,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;
@@ -892,7 +902,8 @@ 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);
+ netdev_dbg(padapter->pnetdev,
+ "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;
@@ -980,8 +991,9 @@ unsigned int OnAssocReq(struct adapter *padapter, struct recv_frame *precv_frame
}

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);
+ netdev_dbg(padapter->pnetdev,
+ "handle_assoc(reassoc=%d) - too short payload (len=%lu)\n",
+ reassoc, (unsigned long)pkt_len);
return _FAIL;
}

@@ -996,8 +1008,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)) {
@@ -1015,8 +1025,9 @@ 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);
+ netdev_dbg(padapter->pnetdev,
+ "STA %pM sent invalid association request\n",
+ pstat->hwaddr);
status = _STATS_FAILURE_;
goto OnAssocReqFail;
}
@@ -1045,7 +1056,8 @@ 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");
+ netdev_dbg(padapter->pnetdev,
+ "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; */
@@ -1135,17 +1147,15 @@ 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");
+ netdev_dbg(padapter->pnetdev,
+ "STA included WPS IE in (Re)Association Request - assume WPS is used\n");
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");
+ netdev_dbg(padapter->pnetdev,
+ "STA did not include WPA/RSN IE in (Re)Association Request - possible WPS use\n");
pstat->flags |= WLAN_STA_MAYBE_WPS;
}

@@ -1158,7 +1168,8 @@ 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");
+ netdev_dbg(padapter->pnetdev,
+ "selected_registrar is false , or AP is not ready to do WPS\n");

status = _STATS_UNABLE_HANDLE_STA_;

@@ -1170,8 +1181,9 @@ 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);
+ netdev_dbg(padapter->pnetdev,
+ "STA %pM: WPA/RSN IE in association request, but AP don't support WPA/RSN\n",
+ pstat->hwaddr);

status = WLAN_STATUS_INVALID_IE;

@@ -1179,9 +1191,8 @@ unsigned int OnAssocReq(struct adapter *padapter, struct recv_frame *precv_frame
}

if (elems.wps_ie) {
- DBG_88E("STA included WPS IE in "
- "(Re)Association Request - WPS is "
- "used\n");
+ netdev_dbg(padapter->pnetdev,
+ "STA included WPS IE in (Re)Association Request - WPS is used\n");
pstat->flags |= WLAN_STA_WPS;
copy_len = 0;
} else {
@@ -1266,8 +1277,9 @@ unsigned int OnAssocReq(struct adapter *padapter, struct recv_frame *precv_frame
if ((pstat->flags & WLAN_STA_HT) &&
((pstat->wpa2_pairwise_cipher & WPA_CIPHER_TKIP) ||
(pstat->wpa_pairwise_cipher & WPA_CIPHER_TKIP))) {
- DBG_88E("HT: %pM tried to "
- "use TKIP with HT association\n", pstat->hwaddr);
+ netdev_dbg(padapter->pnetdev,
+ "HT: %pM tried to use TKIP with HT association\n",
+ pstat->hwaddr);

/* status = WLAN_STATUS_CIPHER_REJECTED_PER_POLICY; */
/* goto OnAssocReqFail; */
@@ -1312,7 +1324,7 @@ unsigned int OnAssocReq(struct adapter *padapter, struct recv_frame *precv_frame

/* get a unique AID */
if (pstat->aid > 0) {
- DBG_88E(" old AID %d\n", pstat->aid);
+ netdev_dbg(padapter->pnetdev, "old AID %d\n", pstat->aid);
} else {
for (pstat->aid = 1; pstat->aid <= NUM_STA; pstat->aid++)
if (!pstapriv->sta_aid[pstat->aid - 1])
@@ -1322,14 +1334,16 @@ 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");
+ netdev_dbg(padapter->pnetdev,
+ "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);
+ netdev_dbg(padapter->pnetdev,
+ "allocate new AID=(%d)\n", pstat->aid);
}
}

@@ -1364,7 +1378,8 @@ 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");
+ netdev_dbg(padapter->pnetdev,
+ "indicate_sta_join_event to upper layer - hostapd\n");
rtw_indicate_sta_assoc_event(padapter, pstat);

/* 3-(1) report sta add event */
@@ -1403,8 +1418,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;
@@ -1420,7 +1433,8 @@ 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);
+ netdev_dbg(padapter->pnetdev,
+ "assoc reject, status code: %d\n", status);
pmlmeinfo->state = WIFI_FW_NULL_STATE;
res = -4;
goto report_assoc_result;
@@ -1500,7 +1514,7 @@ 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);
+ netdev_dbg(padapter->pnetdev, "Reason code(%d)\n", reason);

if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) {
struct sta_info *psta;
@@ -1575,7 +1589,7 @@ 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);
+ netdev_dbg(padapter->pnetdev, "Reason code(%d)\n", reason);

if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) {
struct sta_info *psta;
@@ -1614,7 +1628,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;
}

@@ -1628,8 +1641,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)
@@ -1682,8 +1693,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;
@@ -1701,7 +1710,7 @@ 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);
+ netdev_dbg(padapter->pnetdev, "action=%d\n", action);
switch (action) {
case RTW_WLAN_ACTION_ADDBA_REQ: /* ADDBA request */
memcpy(&pmlmeinfo->ADDBA_req, &frame_body[2], sizeof(struct ADDBA_request));
@@ -1716,7 +1725,8 @@ 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);
+ netdev_dbg(padapter->pnetdev,
+ "agg_enable for TID=%d\n", tid);
psta->htpriv.agg_enable_bitmap |= 1 << tid;
psta->htpriv.candidate_tid_bitmap &= ~BIT(tid);
} else {
@@ -1734,7 +1744,10 @@ 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);
+ netdev_dbg(padapter->pnetdev,
+ "DELBA: %x(%x)\n",
+ pmlmeinfo->agg_enable_bitmap,
+ reason_code);
/* todo: how to notify the host while receiving DELETE BA */
break;
default:
@@ -1778,7 +1791,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);
@@ -2114,7 +2126,7 @@ 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);
+ netdev_dbg(padapter->pnetdev, "result=%d\n", result);
/* update attribute */
pattrib = &pmgntframe->attrib;
update_mgntframe_attrib(padapter, pattrib);
@@ -2472,7 +2484,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);
@@ -3072,7 +3083,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);
@@ -3148,16 +3158,18 @@ 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]);
+ pr_debug("peermac=%.2X %.2X %.2X %.2X %.2X %.2X\n",
+ 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]);
+ pr_debug("profileinfo_mac=%.2X %.2X %.2X %.2X %.2X %.2X\n",
+ 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__);
+ pr_debug("Match!\n");
break;
}
}
@@ -3709,14 +3721,16 @@ 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);
+ netdev_dbg(adapter->pnetdev,
+ "seq_ctrl = 0x%x, rxseq = 0x%x, token:%d\n",
+ seq_ctrl, mlmeext->action_public_rxseq, 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);
+ netdev_dbg(adapter->pnetdev,
+ "seq_ctrl = 0x%x, rxseq = 0x%x\n",
+ seq_ctrl, mlmeext->action_public_rxseq);
return _FAIL;
}
}
@@ -3759,7 +3773,7 @@ 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__);
+ netdev_dbg(padapter->pnetdev, "Got GO Nego Req Frame\n");
memset(&pwdinfo->groupid_info, 0x00, sizeof(struct group_id_info));

if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_RX_PROVISION_DIS_REQ))
@@ -3771,7 +3785,9 @@ 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));
+ netdev_dbg(padapter->pnetdev,
+ "Restore the previous p2p state to %d\n",
+ rtw_p2p_state(pwdinfo));
}

/* Commented by Kurt 20110902 */
@@ -3792,7 +3808,7 @@ 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__);
+ netdev_dbg(padapter->pnetdev, "Got GO Nego Resp Frame\n");

if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_GONEGO_ING)) {
/* Commented by Albert 20110425 */
@@ -3813,11 +3829,12 @@ static unsigned int on_action_public_p2p(struct recv_frame *precv_frame)
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__);
+ netdev_dbg(padapter->pnetdev,
+ "Skipped GO Nego Resp Frame (p2p_state != P2P_STATE_GONEGO_ING)\n");
}
break;
case P2P_GO_NEGO_CONF:
- DBG_88E("[%s] Got GO Nego Confirm Frame\n", __func__);
+ netdev_dbg(padapter->pnetdev, "Got GO Nego Confirm Frame\n");
result = process_p2p_group_negotation_confirm(pwdinfo, frame_body, len);
if (P2P_STATUS_SUCCESS == result) {
if (rtw_p2p_role(pwdinfo) == P2P_ROLE_CLIENT) {
@@ -3831,7 +3848,7 @@ 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__);
+ netdev_dbg(padapter->pnetdev, "Got invite request frame!\n");
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. */
@@ -3851,10 +3868,14 @@ static unsigned int on_action_public_p2p(struct recv_frame *precv_frame)
/* 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]);
+ netdev_dbg(padapter->pnetdev,
+ "GO's BSSID = %.2X %.2X %.2X %.2X %.2X %.2X\n",
+ 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) {
@@ -3902,7 +3923,8 @@ static unsigned int on_action_public_p2p(struct recv_frame *precv_frame)
}
}
} else {
- DBG_88E("[%s] P2P Group ID Attribute NOT FOUND!\n", __func__);
+ netdev_dbg(padapter->pnetdev,
+ "P2P Group ID Attribute NOT FOUND!\n");
status_code = P2P_STATUS_FAIL_INFO_UNAVAILABLE;
}
} else {
@@ -3928,16 +3950,19 @@ 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__);
+ netdev_dbg(padapter->pnetdev,
+ "P2P Group ID Attribute NOT FOUND!\n");
status_code = P2P_STATUS_FAIL_INFO_UNAVAILABLE;
}
}
} else {
- DBG_88E("[%s] P2P Invitation Flags Attribute NOT FOUND!\n", __func__);
+ netdev_dbg(padapter->pnetdev,
+ "P2P Invitation Flags Attribute NOT FOUND!\n");
status_code = P2P_STATUS_FAIL_INFO_UNAVAILABLE;
}

- DBG_88E("[%s] status_code = %d\n", __func__, status_code);
+ netdev_dbg(padapter->pnetdev,
+ "status_code = %d\n", status_code);

pwdinfo->inviteresp_info.token = frame_body[7];
issue_p2p_invitation_response(padapter, GetAddr2Ptr(pframe), pwdinfo->inviteresp_info.token, status_code);
@@ -3947,14 +3972,15 @@ 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__);
+ netdev_dbg(padapter->pnetdev, "Got invite response frame!\n");
_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);
+ netdev_dbg(padapter->pnetdev,
+ "Status = %d\n", attr_content);
pwdinfo->invitereq_info.benable = false;

if (attr_content == P2P_STATUS_SUCCESS) {
@@ -3988,7 +4014,8 @@ 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__);
+ netdev_dbg(padapter->pnetdev,
+ "Got Provisioning Discovery Request Frame\n");
process_p2p_provdisc_req(pwdinfo, pframe, len);
memcpy(pwdinfo->rx_prov_disc_info.peerDevAddr, GetAddr2Ptr(pframe), ETH_ALEN);

@@ -4003,7 +4030,8 @@ 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__);
+ netdev_dbg(padapter->pnetdev,
+ "Got Provisioning Discovery Response Frame\n");
/* 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);
@@ -4094,8 +4122,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;
@@ -4160,13 +4186,13 @@ struct xmit_frame *alloc_mgtxmitframe(struct xmit_priv *pxmitpriv)

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

pxmitbuf = rtw_alloc_xmitbuf_ext(pxmitpriv);
if (!pxmitbuf) {
- DBG_88E("%s, alloc xmitbuf fail\n", __func__);
+ pr_debug("alloc xmitbuf fail\n");
rtw_free_xmitframe(pxmitpriv, pmgntframe);
return NULL;
}
@@ -4188,7 +4214,7 @@ 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);
+ netdev_dbg(padapter->pnetdev, "rate = %x\n", rate);
}

void update_mgntframe_attrib(struct adapter *padapter, struct pkt_attrib *pattrib)
@@ -4325,7 +4351,7 @@ void issue_beacon(struct adapter *padapter, int timeout_ms)

pmgntframe = alloc_mgtxmitframe(pxmitpriv);
if (!pmgntframe) {
- DBG_88E("%s, alloc mgnt frame fail\n", __func__);
+ netdev_dbg(padapter->pnetdev, "alloc mgnt frame fail\n");
return;
}
spin_lock_bh(&pmlmepriv->bcn_update_lock);
@@ -4508,13 +4534,12 @@ 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");
+ netdev_dbg(padapter->pnetdev, "beacon frame too large\n");
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
@@ -4541,7 +4566,8 @@ void issue_probersp(struct adapter *padapter, unsigned char *da, u8 is_valid_p2p

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

@@ -4789,13 +4815,17 @@ int issue_probereq_ex(struct adapter *padapter, struct ndis_802_11_ssid *pssid,

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));
+ netdev_dbg(padapter->pnetdev,
+ "to %pM, ch:%u%s, %d/%d in %u ms\n",
+ 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));
+ netdev_dbg(padapter->pnetdev,
+ "ch:%u%s, %d/%d in %u ms\n",
+ rtw_get_oper_ch(padapter),
+ ret == _SUCCESS ? ", acked" : "",
+ i, try_cnt, rtw_get_passing_time_ms(start));
}
exit:
return ret;
@@ -4925,7 +4955,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);
}

@@ -4946,8 +4975,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;
@@ -5134,7 +5161,9 @@ 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]);
+ netdev_dbg(padapter->pnetdev,
+ "network.SupportedRates[%d]=%02X\n",
+ i, pmlmeinfo->network.SupportedRates[i]);
}

for (i = 0; i < NDIS_802_11_LENGTH_RATES_EX; i++) {
@@ -5151,7 +5180,9 @@ void issue_assocreq(struct adapter *padapter)

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]);
+ netdev_dbg(padapter->pnetdev,
+ "the rate[%d]=%02X is not supported by STA!\n",
+ i, pmlmeinfo->network.SupportedRates[i]);
} else {
/* the rate is supported by STA */
bssrate[index++] = pmlmeinfo->network.SupportedRates[i];
@@ -5159,7 +5190,7 @@ void issue_assocreq(struct adapter *padapter)
}

bssrate_len = index;
- DBG_88E("bssrate_len=%d\n", bssrate_len);
+ netdev_dbg(padapter->pnetdev, "bssrate_len=%d\n", bssrate_len);

if (bssrate_len == 0) {
rtw_free_xmitbuf(pxmitpriv, pmgntframe->pxmitbuf);
@@ -5471,13 +5502,17 @@ int issue_nulldata(struct adapter *padapter, unsigned char *da, unsigned int pow

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));
+ netdev_dbg(padapter->pnetdev,
+ "to %pM, ch:%u%s, %d/%d in %u ms\n",
+ 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));
+ netdev_dbg(padapter->pnetdev,
+ "ch:%u%s, %d/%d in %u ms\n",
+ rtw_get_oper_ch(padapter),
+ ret == _SUCCESS ? ", acked" : "",
+ i, try_cnt, rtw_get_passing_time_ms(start));
}
exit:
return ret;
@@ -5497,8 +5532,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;
@@ -5591,13 +5624,17 @@ int issue_qos_nulldata(struct adapter *padapter, unsigned char *da, u16 tid, int

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));
+ netdev_dbg(padapter->pnetdev,
+ "to %pM, ch:%u%s, %d/%d in %u ms\n",
+ 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));
+ netdev_dbg(padapter->pnetdev,
+ "ch:%u%s, %d/%d in %u ms\n",
+ rtw_get_oper_ch(padapter),
+ ret == _SUCCESS ? ", acked" : "",
+ i, try_cnt, rtw_get_passing_time_ms(start));
}
exit:
return ret;
@@ -5668,7 +5705,7 @@ 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);
+ netdev_dbg(padapter->pnetdev, "to %pM\n", da);
return _issue_deauth(padapter, da, reason, false);
}

@@ -5698,13 +5735,17 @@ int issue_deauth_ex(struct adapter *padapter, u8 *da, unsigned short reason, int

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));
+ netdev_dbg(padapter->pnetdev,
+ "to %pM, ch:%u%s, %d/%d in %u ms\n",
+ 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));
+ netdev_dbg(padapter->pnetdev,
+ "ch:%u%s, %d/%d in %u ms\n",
+ rtw_get_oper_ch(padapter),
+ ret == _SUCCESS ? ", acked" : "",
+ i, try_cnt, rtw_get_passing_time_ms(start));
}
exit:
return ret;
@@ -5732,7 +5773,9 @@ 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);
+ netdev_dbg(padapter->pnetdev,
+ "category=%d, action=%d, status=%d\n",
+ category, action, status);

pmgntframe = alloc_mgtxmitframe(pxmitpriv);
if (!pmgntframe)
@@ -5785,7 +5828,9 @@ 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);
+ netdev_dbg(padapter->pnetdev,
+ "BA_starting_seqctrl=%d for TID=%d\n",
+ start_seq, status & 0x07);

psta->BA_starting_seqctrl[status & 0x07] = start_seq;

@@ -5868,8 +5913,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;

@@ -5994,7 +6037,8 @@ 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);
+ netdev_dbg(padapter->pnetdev,
+ "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;
@@ -6003,7 +6047,8 @@ 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);
+ netdev_dbg(padapter->pnetdev,
+ "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);
@@ -6036,13 +6081,16 @@ 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));
+ netdev_dbg(padapter->pnetdev, "fail! %u ms\n",
+ 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));
+ netdev_dbg(padapter->pnetdev,
+ "success, issue:%d, poll:%d, %u ms\n",
+ issue, poll, rtw_get_passing_time_ms(start));
return _SUCCESS;
}
}
@@ -6251,13 +6299,16 @@ 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");
+ netdev_dbg(padapter->pnetdev,
+ "marc: cannot find SSID for survey event\n");
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);
+ netdev_dbg(padapter->pnetdev,
+ "IE too long (%d) for survey event\n",
+ len);
return _FAIL;
}
memcpy(bssid->Ssid.Ssid, (p + 2), *(p + 1));
@@ -6273,7 +6324,9 @@ u8 collect_bss_info(struct adapter *padapter, struct recv_frame *precv_frame, st
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);
+ netdev_dbg(padapter->pnetdev,
+ "IE too long (%d) for survey event\n",
+ len);
return _FAIL;
}
memcpy(bssid->SupportedRates, (p + 2), len);
@@ -6283,7 +6336,9 @@ u8 collect_bss_info(struct adapter *padapter, struct recv_frame *precv_frame, st
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);
+ netdev_dbg(padapter->pnetdev,
+ "IE too long (%d) for survey event\n",
+ len);
return _FAIL;
}
memcpy(bssid->SupportedRates + i, (p + 2), len);
@@ -6400,7 +6455,7 @@ void start_create_ibss(struct adapter *padapter)
rtw_indicate_connect(padapter);
}
} else {
- DBG_88E("start_create_ibss, invalid cap:%x\n", caps);
+ netdev_dbg(padapter->pnetdev, "invalid cap:%x\n", caps);
return;
}
/* update bc/mc sta_info */
@@ -6515,8 +6570,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;
@@ -6774,7 +6827,8 @@ 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);
+ netdev_dbg(padapter->pnetdev, "survey done event(%x)\n",
+ psurveydone_evt->bss_cnt);

rtw_enqueue_cmd(pcmdpriv, pcmd_obj);
}
@@ -6820,7 +6874,7 @@ 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);
+ netdev_dbg(padapter->pnetdev, "res=%d\n", res);

rtw_joinbss_event_prehandle(padapter, (u8 *)&pjoinbss_evt->network);

@@ -6876,7 +6930,7 @@ 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);
+ netdev_dbg(padapter->pnetdev, "delete STA, mac_id = %d\n", mac_id);

rtw_enqueue_cmd(pcmdpriv, pcmd_obj);
}
@@ -6920,7 +6974,7 @@ 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");
+ netdev_dbg(padapter->pnetdev, "add STA\n");

rtw_enqueue_cmd(pcmdpriv, pcmd_obj);
}
@@ -6990,7 +7044,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) {
@@ -7046,10 +7100,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)
@@ -7058,8 +7108,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 */
@@ -7139,7 +7187,8 @@ 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);
+ netdev_dbg(padapter->pnetdev,
+ "UndecoratedSmoothedPWDB:%d\n", UndecoratedSmoothedPWDB);
}

static u8 chk_ap_is_alive(struct adapter *padapter, struct sta_info *psta)
@@ -7164,15 +7213,20 @@ static void rtl8188e_sreset_linked_status_check(struct adapter *padapter)
u8 fw_status;

if (rx_dma_status != 0x00) {
- DBG_88E("%s REG_RXDMA_STATUS:0x%08x\n", __func__, rx_dma_status);
+ netdev_dbg(padapter->pnetdev, "REG_RXDMA_STATUS:0x%08x\n",
+ rx_dma_status);
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);
+ netdev_dbg(padapter->pnetdev,
+ "REG_FW_STATUS (0x%02x), Read_Efuse_Fail !!\n",
+ fw_status);
else if (fw_status == 2)
- DBG_88E("%s REG_FW_STATUS (0x%02x), Condition_No_Match !!\n", __func__, fw_status);
+ netdev_dbg(padapter->pnetdev,
+ "REG_FW_STATUS (0x%02x), Condition_No_Match !!\n",
+ fw_status);
}

void linked_status_chk(struct adapter *padapter)
@@ -7308,15 +7362,15 @@ 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
- );
+ netdev_dbg(padapter->pnetdev,
+ "idx:%d, cnt:%u\n",
+ 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
- );
+ netdev_dbg(padapter->pnetdev,
+ "idx:%d\n",
+ pmlmeext->sitesurvey_res.channel_idx);
}

pmlmeext->scan_abort = false;/* reset */
@@ -7346,7 +7400,7 @@ 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");
+ netdev_dbg(padapter->pnetdev, "no beacon while connecting\n");
pmlmeinfo->state = WIFI_FW_NULL_STATE;
report_join_res(padapter, -3);
} else if (pmlmeinfo->state & WIFI_FW_AUTH_STATE) {
@@ -7357,7 +7411,7 @@ void link_timer_hdl(struct adapter *padapter)
return;
}

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

- DBG_88E("link_timer_hdl: assoc timeout and try again\n");
+ netdev_dbg(padapter->pnetdev, "assoc timeout and try again\n");
issue_assocreq(padapter);
set_link_timer(pmlmeext, REASSOC_TO);
}
@@ -7560,7 +7614,8 @@ u8 join_cmd_hdl(struct adapter *padapter, u8 *pbuf)
break;
}

- DBG_88E("set ch/bw before connected\n");
+ netdev_dbg(padapter->pnetdev,
+ "set ch/bw before connected\n");
}
}
break;
@@ -7819,24 +7874,29 @@ 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);
+ netdev_dbg(padapter->pnetdev, "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);
+ netdev_dbg(padapter->pnetdev,
+ "set_stakey failed, mac_id(aid)=%d\n",
+ psta->mac_id);
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);
+ netdev_dbg(padapter->pnetdev,
+ "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");
+ netdev_dbg(padapter->pnetdev, "sta has been free\n");
return H2C_REJECTED;
}
}
@@ -7960,7 +8020,7 @@ 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");
+ netdev_dbg(padapter->pnetdev, "issue_beacon, fail!\n");
return H2C_PARAMETERS_ERROR;
} else {
/* tx bc/mc frames after update TIM */
@@ -8019,9 +8079,8 @@ 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);
+ netdev_dbg(padapter->pnetdev, "ch:%u, bw:%u, ch_offset:%u\n",
+ 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;
--
2.33.1


2022-01-10 09:03:02

by Phillip Potter

[permalink] [raw]
Subject: [PATCH v2 7/7] staging: r8188eu: convert DBG_88E calls in core/rtw_sta_mgt.c

Convert the DBG_88E macro calls in core/rtw_sta_mgt.c to use pr_debug,
as their information may be useful to observers, and this gets the
driver closer to the point of being able to remove DBG_88E itself.

These calls are at points in the call chain where use of dev_dbg or
netdev_dbg isn't possible due to lack of device pointer, so plain
pr_debug is appropriate here.

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

diff --git a/drivers/staging/r8188eu/core/rtw_sta_mgt.c b/drivers/staging/r8188eu/core/rtw_sta_mgt.c
index 54561ff239a0..de5406a5870c 100644
--- a/drivers/staging/r8188eu/core/rtw_sta_mgt.c
+++ b/drivers/staging/r8188eu/core/rtw_sta_mgt.c
@@ -104,7 +104,7 @@ inline int rtw_stainfo_offset(struct sta_priv *stapriv, struct sta_info *sta)
int offset = (((u8 *)sta) - stapriv->pstainfo_buf) / sizeof(struct sta_info);

if (!stainfo_offset_valid(offset))
- DBG_88E("%s invalid offset(%d), out of range!!!", __func__, offset);
+ pr_debug("invalid offset(%d), out of range!!!", offset);

return offset;
}
@@ -112,7 +112,7 @@ inline int rtw_stainfo_offset(struct sta_priv *stapriv, struct sta_info *sta)
inline struct sta_info *rtw_get_stainfo_by_offset(struct sta_priv *stapriv, int offset)
{
if (!stainfo_offset_valid(offset))
- DBG_88E("%s invalid offset(%d), out of range!!!", __func__, offset);
+ pr_debug("invalid offset(%d), out of range!!!", offset);

return (struct sta_info *)(stapriv->pstainfo_buf + offset * sizeof(struct sta_info));
}
--
2.33.1


2022-01-10 09:03:16

by Phillip Potter

[permalink] [raw]
Subject: [PATCH v2 5/7] staging: r8188eu: convert DBG_88E calls in core/rtw_ioctl_set.c

Convert the DBG_88E macro calls in core/rtw_ioctl_set.c to use netdev_dbg,
as their information may be useful to observers, and this gets the
driver closer to the point of being able to remove DBG_88E itself.
Also remove one unnecessary DBG_88E call which was already commented
out.

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

diff --git a/drivers/staging/r8188eu/core/rtw_ioctl_set.c b/drivers/staging/r8188eu/core/rtw_ioctl_set.c
index eadfbdb94dd5..c95ca471ae55 100644
--- a/drivers/staging/r8188eu/core/rtw_ioctl_set.c
+++ b/drivers/staging/r8188eu/core/rtw_ioctl_set.c
@@ -122,7 +122,8 @@ u8 rtw_set_802_11_bssid(struct adapter *padapter, u8 *bssid)

spin_lock_bh(&pmlmepriv->lock);

- DBG_88E("Set BSSID under fw_state = 0x%08x\n", get_fwstate(pmlmepriv));
+ netdev_dbg(padapter->pnetdev, "Set BSSID under fw_state = 0x%08x\n",
+ get_fwstate(pmlmepriv));
if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY))
goto handle_tkip_countermeasure;
else if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING))
@@ -195,7 +196,8 @@ u8 rtw_set_802_11_ssid(struct adapter *padapter, struct ndis_802_11_ssid *ssid)

spin_lock_bh(&pmlmepriv->lock);

- DBG_88E("Set SSID under fw_state = 0x%08x\n", get_fwstate(pmlmepriv));
+ netdev_dbg(padapter->pnetdev, "Set SSID under fw_state = 0x%08x\n",
+ get_fwstate(pmlmepriv));
if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY)) {
goto handle_tkip_countermeasure;
} else if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING)) {
@@ -280,8 +282,6 @@ u8 rtw_set_802_11_infrastructure_mode(struct adapter *padapter,
if (*pold_state != networktype) {
spin_lock_bh(&pmlmepriv->lock);

- /* DBG_88E("change mode, old_mode =%d, new_mode =%d, fw_state = 0x%x\n", *pold_state, networktype, get_fwstate(pmlmepriv)); */
-
if (*pold_state == Ndis802_11APMode) {
/* change to other mode from Ndis802_11APMode */
cur_network->join_res = -1;
@@ -364,7 +364,7 @@ u8 rtw_set_802_11_bssid_list_scan(struct adapter *padapter, struct ndis_802_11_s
res = true;
} else {
if (rtw_is_scan_deny(padapter)) {
- DBG_88E(FUNC_ADPT_FMT": scan deny\n", FUNC_ADPT_ARG(padapter));
+ netdev_dbg(padapter->pnetdev, "scan deny\n");
indicate_wx_scan_complete_event(padapter);
return _SUCCESS;
}
--
2.33.1


2022-01-10 21:05:15

by Pavel Skripkin

[permalink] [raw]
Subject: Re: [PATCH v2 7/7] staging: r8188eu: convert DBG_88E calls in core/rtw_sta_mgt.c

Hi Phillip,

On 1/10/22 12:00, Phillip Potter wrote:
> Convert the DBG_88E macro calls in core/rtw_sta_mgt.c to use pr_debug,
> as their information may be useful to observers, and this gets the
> driver closer to the point of being able to remove DBG_88E itself.
>
> These calls are at points in the call chain where use of dev_dbg or
> netdev_dbg isn't possible due to lack of device pointer, so plain
> pr_debug is appropriate here.
>
> Signed-off-by: Phillip Potter <[email protected]>
> ---
> drivers/staging/r8188eu/core/rtw_sta_mgt.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/r8188eu/core/rtw_sta_mgt.c b/drivers/staging/r8188eu/core/rtw_sta_mgt.c
> index 54561ff239a0..de5406a5870c 100644
> --- a/drivers/staging/r8188eu/core/rtw_sta_mgt.c
> +++ b/drivers/staging/r8188eu/core/rtw_sta_mgt.c
> @@ -104,7 +104,7 @@ inline int rtw_stainfo_offset(struct sta_priv *stapriv, struct sta_info *sta)
> int offset = (((u8 *)sta) - stapriv->pstainfo_buf) / sizeof(struct sta_info);
>
> if (!stainfo_offset_valid(offset))
> - DBG_88E("%s invalid offset(%d), out of range!!!", __func__, offset);
> + pr_debug("invalid offset(%d), out of range!!!", offset);
>
> return offset;
> }

There is only one caller of this function and it also checks if offset
is valid. I think, this check with debug message can be removed from
this function.

> @@ -112,7 +112,7 @@ inline int rtw_stainfo_offset(struct sta_priv *stapriv, struct sta_info *sta)
> inline struct sta_info *rtw_get_stainfo_by_offset(struct sta_priv *stapriv, int offset)
> {
> if (!stainfo_offset_valid(offset))
> - DBG_88E("%s invalid offset(%d), out of range!!!", __func__, offset);
> + pr_debug("invalid offset(%d), out of range!!!", offset);
>
> return (struct sta_info *)(stapriv->pstainfo_buf + offset * sizeof(struct sta_info));
> }

Is it safe to proceed with invalid offset? Debug message says it's out
of range, so might be we should just return with an error?




With regards,
Pavel Skripkin

2022-01-14 00:32:55

by Phillip Potter

[permalink] [raw]
Subject: Re: [PATCH v2 7/7] staging: r8188eu: convert DBG_88E calls in core/rtw_sta_mgt.c

On Tue, Jan 11, 2022 at 12:05:09AM +0300, Pavel Skripkin wrote:
> Hi Phillip,
>
> On 1/10/22 12:00, Phillip Potter wrote:
> > Convert the DBG_88E macro calls in core/rtw_sta_mgt.c to use pr_debug,
> > as their information may be useful to observers, and this gets the
> > driver closer to the point of being able to remove DBG_88E itself.
> >
> > These calls are at points in the call chain where use of dev_dbg or
> > netdev_dbg isn't possible due to lack of device pointer, so plain
> > pr_debug is appropriate here.
> >
> > Signed-off-by: Phillip Potter <[email protected]>
> > ---
> > drivers/staging/r8188eu/core/rtw_sta_mgt.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/staging/r8188eu/core/rtw_sta_mgt.c b/drivers/staging/r8188eu/core/rtw_sta_mgt.c
> > index 54561ff239a0..de5406a5870c 100644
> > --- a/drivers/staging/r8188eu/core/rtw_sta_mgt.c
> > +++ b/drivers/staging/r8188eu/core/rtw_sta_mgt.c
> > @@ -104,7 +104,7 @@ inline int rtw_stainfo_offset(struct sta_priv *stapriv, struct sta_info *sta)
> > int offset = (((u8 *)sta) - stapriv->pstainfo_buf) / sizeof(struct sta_info);
> > if (!stainfo_offset_valid(offset))
> > - DBG_88E("%s invalid offset(%d), out of range!!!", __func__, offset);
> > + pr_debug("invalid offset(%d), out of range!!!", offset);
> > return offset;
> > }
>
> There is only one caller of this function and it also checks if offset is
> valid. I think, this check with debug message can be removed from this
> function.
>

Dear Pavel,

Thank you for your feedback, much appreciated. Good call on this one, I
can take it out in a subsequent v3 series.

> > @@ -112,7 +112,7 @@ inline int rtw_stainfo_offset(struct sta_priv *stapriv, struct sta_info *sta)
> > inline struct sta_info *rtw_get_stainfo_by_offset(struct sta_priv *stapriv, int offset)
> > {
> > if (!stainfo_offset_valid(offset))
> > - DBG_88E("%s invalid offset(%d), out of range!!!", __func__, offset);
> > + pr_debug("invalid offset(%d), out of range!!!", offset);
> > return (struct sta_info *)(stapriv->pstainfo_buf + offset * sizeof(struct sta_info));
> > }
>
> Is it safe to proceed with invalid offset? Debug message says it's out of
> range, so might be we should just return with an error?
>
>
>
>
> With regards,
> Pavel Skripkin

I would need to check the code, but good observation. I wanted to limit
the scope of this series explicitly to DBG_88E calls, but might be worth
changing this at the same time.

Regards,
Phil

2022-01-14 23:04:39

by Pavel Skripkin

[permalink] [raw]
Subject: Re: [PATCH v2 7/7] staging: r8188eu: convert DBG_88E calls in core/rtw_sta_mgt.c

Hi Phillip,

On 1/14/22 03:32, Phillip Potter wrote:
[...]

>> > @@ -112,7 +112,7 @@ inline int rtw_stainfo_offset(struct sta_priv *stapriv, struct sta_info *sta)
>> > inline struct sta_info *rtw_get_stainfo_by_offset(struct sta_priv *stapriv, int offset)
>> > {
>> > if (!stainfo_offset_valid(offset))
>> > - DBG_88E("%s invalid offset(%d), out of range!!!", __func__, offset);
>> > + pr_debug("invalid offset(%d), out of range!!!", offset);
>> > return (struct sta_info *)(stapriv->pstainfo_buf + offset * sizeof(struct sta_info));
>> > }
>>
>> Is it safe to proceed with invalid offset? Debug message says it's out of
>> range, so might be we should just return with an error?
>>
>>
>>
>>
>> With regards,
>> Pavel Skripkin
>
> I would need to check the code, but good observation. I wanted to limit
> the scope of this series explicitly to DBG_88E calls, but might be worth
> changing this at the same time.
>

I think, this log without immediate return is not very useful. If code
writes somewhere OOB it means bomb has been planted. And this message
can be reworked as "hey, I've placed a small bomb somewhere, please, be
ready".

I do not mean, that log is useless, I mean log without return is not
very useful



With regards,
Pavel Skripkin