Commit 7a176c10 authored by Paulo Miguel Almeida's avatar Paulo Miguel Almeida Committed by Greg Kroah-Hartman

staging: rtl8192u: replace printk with natdev_<LEVEL> statements in ieee80211

Checkpatch reports 'WARNING: printk() should include KERN_<LEVEL>
facility level'. Fix this by specifying a relevant KERN_<LEVEL> value
for each line in which it was missing.

Once they are fixed, checkpatch reports 'WARNING: Prefer [subsystem eg:
netdev]_dbg([subsystem]dev, ... then dev_dbg(dev, ... then
pr_debug(...  to printk(KERN_DEBUG ...'. Fix this by replacing
relevant printk_<level> statements with their netdev_<level>
equivalent.
Signed-off-by: default avatarPaulo Miguel Almeida <paulo.miguel.almeida.rodenas@gmail.com>
Link: https://lore.kernel.org/r/20200115101208.GA683742@localhost.localdomainSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 32f78c90
...@@ -232,8 +232,7 @@ ieee80211_rx_frame_mgmt(struct ieee80211_device *ieee, struct sk_buff *skb, ...@@ -232,8 +232,7 @@ ieee80211_rx_frame_mgmt(struct ieee80211_device *ieee, struct sk_buff *skb,
#ifdef NOT_YET #ifdef NOT_YET
if (ieee->iw_mode == IW_MODE_MASTER) { if (ieee->iw_mode == IW_MODE_MASTER) {
printk(KERN_DEBUG "%s: Master mode not yet supported.\n", netdev_dbg(ieee->dev, "Master mode not yet supported.\n");
ieee->dev->name);
return 0; return 0;
/* /*
hostap_update_sta_ps(ieee, (struct hostap_ieee80211_hdr_4addr *) hostap_update_sta_ps(ieee, (struct hostap_ieee80211_hdr_4addr *)
...@@ -261,9 +260,9 @@ ieee80211_rx_frame_mgmt(struct ieee80211_device *ieee, struct sk_buff *skb, ...@@ -261,9 +260,9 @@ ieee80211_rx_frame_mgmt(struct ieee80211_device *ieee, struct sk_buff *skb,
if (ieee->iw_mode == IW_MODE_MASTER) { if (ieee->iw_mode == IW_MODE_MASTER) {
if (type != WLAN_FC_TYPE_MGMT && type != WLAN_FC_TYPE_CTRL) { if (type != WLAN_FC_TYPE_MGMT && type != WLAN_FC_TYPE_CTRL) {
printk(KERN_DEBUG "%s: unknown management frame " netdev_dbg(skb->dev, "unknown management frame "
"(type=0x%02x, stype=0x%02x) dropped\n", "(type=0x%02x, stype=0x%02x) dropped\n",
skb->dev->name, type, stype); type, stype);
return -1; return -1;
} }
...@@ -271,8 +270,8 @@ ieee80211_rx_frame_mgmt(struct ieee80211_device *ieee, struct sk_buff *skb, ...@@ -271,8 +270,8 @@ ieee80211_rx_frame_mgmt(struct ieee80211_device *ieee, struct sk_buff *skb,
return 0; return 0;
} }
printk(KERN_DEBUG "%s: hostap_rx_frame_mgmt: management frame " netdev_dbg(skb->dev, "hostap_rx_frame_mgmt: management frame "
"received in non-Host AP mode\n", skb->dev->name); "received in non-Host AP mode\n");
return -1; return -1;
#endif #endif
} }
...@@ -349,9 +348,9 @@ ieee80211_rx_frame_decrypt(struct ieee80211_device *ieee, struct sk_buff *skb, ...@@ -349,9 +348,9 @@ ieee80211_rx_frame_decrypt(struct ieee80211_device *ieee, struct sk_buff *skb,
if (ieee->tkip_countermeasures && if (ieee->tkip_countermeasures &&
strcmp(crypt->ops->name, "TKIP") == 0) { strcmp(crypt->ops->name, "TKIP") == 0) {
if (net_ratelimit()) { if (net_ratelimit()) {
printk(KERN_DEBUG "%s: TKIP countermeasures: dropped " netdev_dbg(ieee->dev, "TKIP countermeasures: dropped "
"received packet from %pM\n", "received packet from %pM\n",
ieee->dev->name, hdr->addr2); hdr->addr2);
} }
return -1; return -1;
} }
...@@ -397,9 +396,9 @@ ieee80211_rx_frame_decrypt_msdu(struct ieee80211_device *ieee, struct sk_buff *s ...@@ -397,9 +396,9 @@ ieee80211_rx_frame_decrypt_msdu(struct ieee80211_device *ieee, struct sk_buff *s
res = crypt->ops->decrypt_msdu(skb, keyidx, hdrlen, crypt->priv); res = crypt->ops->decrypt_msdu(skb, keyidx, hdrlen, crypt->priv);
atomic_dec(&crypt->refcnt); atomic_dec(&crypt->refcnt);
if (res < 0) { if (res < 0) {
printk(KERN_DEBUG "%s: MSDU decryption/MIC verification failed" netdev_dbg(ieee->dev, "MSDU decryption/MIC verification failed"
" (SA=%pM keyidx=%d)\n", " (SA=%pM keyidx=%d)\n",
ieee->dev->name, hdr->addr2, keyidx); hdr->addr2, keyidx);
return -1; return -1;
} }
...@@ -749,7 +748,8 @@ static void RxReorderIndicatePacket(struct ieee80211_device *ieee, ...@@ -749,7 +748,8 @@ static void RxReorderIndicatePacket(struct ieee80211_device *ieee,
kfree(prxbIndicateArray); kfree(prxbIndicateArray);
} }
static u8 parse_subframe(struct sk_buff *skb, static u8 parse_subframe(struct ieee80211_device *ieee,
struct sk_buff *skb,
struct ieee80211_rx_stats *rx_stats, struct ieee80211_rx_stats *rx_stats,
struct ieee80211_rxb *rxb, u8 *src, u8 *dst) struct ieee80211_rxb *rxb, u8 *src, u8 *dst)
{ {
...@@ -810,11 +810,11 @@ static u8 parse_subframe(struct sk_buff *skb, ...@@ -810,11 +810,11 @@ static u8 parse_subframe(struct sk_buff *skb,
nSubframe_Length = (nSubframe_Length >> 8) + (nSubframe_Length << 8); nSubframe_Length = (nSubframe_Length >> 8) + (nSubframe_Length << 8);
if (skb->len < (ETHERNET_HEADER_SIZE + nSubframe_Length)) { if (skb->len < (ETHERNET_HEADER_SIZE + nSubframe_Length)) {
printk("%s: A-MSDU parse error!! pRfd->nTotalSubframe : %d\n",\ netdev_dbg(ieee->dev, "A-MSDU parse error!! pRfd->nTotalSubframe : %d\n",
__func__, rxb->nr_subframes); rxb->nr_subframes);
printk("%s: A-MSDU parse error!! Subframe Length: %d\n", __func__, nSubframe_Length); netdev_dbg(ieee->dev, "A-MSDU parse error!! Subframe Length: %d\n", nSubframe_Length);
printk("nRemain_Length is %d and nSubframe_Length is : %d\n", skb->len, nSubframe_Length); netdev_dbg(ieee->dev, "nRemain_Length is %d and nSubframe_Length is : %d\n", skb->len, nSubframe_Length);
printk("The Packet SeqNum is %d\n", SeqNum); netdev_dbg(ieee->dev, "The Packet SeqNum is %d\n", SeqNum);
return 0; return 0;
} }
...@@ -904,8 +904,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, ...@@ -904,8 +904,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
stats = &ieee->stats; stats = &ieee->stats;
if (skb->len < 10) { if (skb->len < 10) {
printk(KERN_INFO "%s: SKB length < 10\n", netdev_info(dev, "SKB length < 10\n");
dev->name);
goto rx_dropped; goto rx_dropped;
} }
...@@ -919,7 +918,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, ...@@ -919,7 +918,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
if (HTCCheck(ieee, skb->data)) { if (HTCCheck(ieee, skb->data)) {
if (net_ratelimit()) if (net_ratelimit())
printk("find HTCControl\n"); netdev_warn(dev, "find HTCControl\n");
hdrlen += 4; hdrlen += 4;
rx_stats->bContainHTC = true; rx_stats->bContainHTC = true;
} }
...@@ -1113,7 +1112,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, ...@@ -1113,7 +1112,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
if (ieee->host_decrypt && (fc & IEEE80211_FCTL_WEP) && if (ieee->host_decrypt && (fc & IEEE80211_FCTL_WEP) &&
(keyidx = ieee80211_rx_frame_decrypt(ieee, skb, crypt)) < 0) { (keyidx = ieee80211_rx_frame_decrypt(ieee, skb, crypt)) < 0) {
printk("decrypt frame error\n"); netdev_dbg(ieee->dev, "decrypt frame error\n");
goto rx_dropped; goto rx_dropped;
} }
...@@ -1141,9 +1140,8 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, ...@@ -1141,9 +1140,8 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
flen -= hdrlen; flen -= hdrlen;
if (frag_skb->tail + flen > frag_skb->end) { if (frag_skb->tail + flen > frag_skb->end) {
printk(KERN_WARNING "%s: host decrypted and " netdev_warn(dev, "host decrypted and "
"reassembled frame did not fit skb\n", "reassembled frame did not fit skb\n");
dev->name);
ieee80211_frag_cache_invalidate(ieee, hdr); ieee80211_frag_cache_invalidate(ieee, hdr);
goto rx_dropped; goto rx_dropped;
} }
...@@ -1178,7 +1176,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, ...@@ -1178,7 +1176,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
* encrypted/authenticated */ * encrypted/authenticated */
if (ieee->host_decrypt && (fc & IEEE80211_FCTL_WEP) && if (ieee->host_decrypt && (fc & IEEE80211_FCTL_WEP) &&
ieee80211_rx_frame_decrypt_msdu(ieee, skb, keyidx, crypt)) { ieee80211_rx_frame_decrypt_msdu(ieee, skb, keyidx, crypt)) {
printk("==>decrypt msdu error\n"); netdev_dbg(ieee->dev, "==>decrypt msdu error\n");
goto rx_dropped; goto rx_dropped;
} }
...@@ -1250,7 +1248,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, ...@@ -1250,7 +1248,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
goto rx_dropped; goto rx_dropped;
/* to parse amsdu packets */ /* to parse amsdu packets */
/* qos data packets & reserved bit is 1 */ /* qos data packets & reserved bit is 1 */
if (parse_subframe(skb, rx_stats, rxb, src, dst) == 0) { if (parse_subframe(ieee, skb, rx_stats, rxb, src, dst) == 0) {
/* only to free rxb, and not submit the packets to upper layer */ /* only to free rxb, and not submit the packets to upper layer */
for (i = 0; i < rxb->nr_subframes; i++) { for (i = 0; i < rxb->nr_subframes; i++) {
dev_kfree_skb(rxb->subframes[i]); dev_kfree_skb(rxb->subframes[i]);
...@@ -1863,7 +1861,7 @@ int ieee80211_parse_info_param(struct ieee80211_device *ieee, ...@@ -1863,7 +1861,7 @@ int ieee80211_parse_info_param(struct ieee80211_device *ieee,
info_element->data[0] == 0x00 && info_element->data[0] == 0x00 &&
info_element->data[1] == 0x13 && info_element->data[1] == 0x13 &&
info_element->data[2] == 0x74)) { info_element->data[2] == 0x74)) {
printk("========>%s(): athros AP is exist\n", __func__); netdev_dbg(ieee->dev, "========> athros AP is exist\n");
network->atheros_cap_exist = true; network->atheros_cap_exist = true;
} else } else
network->atheros_cap_exist = false; network->atheros_cap_exist = false;
...@@ -1980,8 +1978,8 @@ int ieee80211_parse_info_param(struct ieee80211_device *ieee, ...@@ -1980,8 +1978,8 @@ int ieee80211_parse_info_param(struct ieee80211_device *ieee,
} }
break; break;
case MFIE_TYPE_QOS_PARAMETER: case MFIE_TYPE_QOS_PARAMETER:
printk(KERN_ERR netdev_err(ieee->dev,
"QoS Error need to parse QOS_PARAMETER IE\n"); "QoS Error need to parse QOS_PARAMETER IE\n");
break; break;
case MFIE_TYPE_COUNTRY: case MFIE_TYPE_COUNTRY:
...@@ -2357,14 +2355,14 @@ static inline void ieee80211_process_probe_response( ...@@ -2357,14 +2355,14 @@ static inline void ieee80211_process_probe_response(
if (IS_COUNTRY_IE_VALID(ieee)) { if (IS_COUNTRY_IE_VALID(ieee)) {
// Case 1: Country code // Case 1: Country code
if (!is_legal_channel(ieee, network->channel)) { if (!is_legal_channel(ieee, network->channel)) {
printk("GetScanInfo(): For Country code, filter probe response at channel(%d).\n", network->channel); netdev_warn(ieee->dev, "GetScanInfo(): For Country code, filter probe response at channel(%d).\n", network->channel);
goto out; goto out;
} }
} else { } else {
// Case 2: No any country code. // Case 2: No any country code.
// Filter over channel ch12~14 // Filter over channel ch12~14
if (network->channel > 11) { if (network->channel > 11) {
printk("GetScanInfo(): For Global Domain, filter probe response at channel(%d).\n", network->channel); netdev_warn(ieee->dev, "GetScanInfo(): For Global Domain, filter probe response at channel(%d).\n", network->channel);
goto out; goto out;
} }
} }
...@@ -2372,14 +2370,14 @@ static inline void ieee80211_process_probe_response( ...@@ -2372,14 +2370,14 @@ static inline void ieee80211_process_probe_response(
if (IS_COUNTRY_IE_VALID(ieee)) { if (IS_COUNTRY_IE_VALID(ieee)) {
// Case 1: Country code // Case 1: Country code
if (!is_legal_channel(ieee, network->channel)) { if (!is_legal_channel(ieee, network->channel)) {
printk("GetScanInfo(): For Country code, filter beacon at channel(%d).\n", network->channel); netdev_warn(ieee->dev, "GetScanInfo(): For Country code, filter beacon at channel(%d).\n", network->channel);
goto out; goto out;
} }
} else { } else {
// Case 2: No any country code. // Case 2: No any country code.
// Filter over channel ch12~14 // Filter over channel ch12~14
if (network->channel > 14) { if (network->channel > 14) {
printk("GetScanInfo(): For Global Domain, filter beacon at channel(%d).\n", network->channel); netdev_warn(ieee->dev, "GetScanInfo(): For Global Domain, filter beacon at channel(%d).\n", network->channel);
goto out; goto out;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment