Commit 02d9b1eb authored by Vitaly Osipov's avatar Vitaly Osipov Committed by Greg Kroah-Hartman

staging: wlan-ng: use netdev_() instead of printk()

Replaced all uses of printk() in wlan-ng with netdev_err / _warn
where a netdev exists. If a few cases where a netdev does not yet
exist, dev_ or pr_ was used.

Checkpatch complains about lines over 80 chars or split string
constants - the messages are just too long, keeping it completely
happy would make the code less readable.
Signed-off-by: default avatarVitaly Osipov <vitaly.osipov@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 79f9e634
...@@ -195,8 +195,8 @@ int skb_ether_to_p80211(wlandevice_t *wlandev, u32 ethconv, ...@@ -195,8 +195,8 @@ int skb_ether_to_p80211(wlandevice_t *wlandev, u32 ethconv,
memcpy(p80211_hdr->a3.a3, &e_hdr.saddr, ETH_ALEN); memcpy(p80211_hdr->a3.a3, &e_hdr.saddr, ETH_ALEN);
break; break;
default: default:
printk(KERN_ERR netdev_err(wlandev->netdev,
"Error: Converting eth to wlan in unknown mode.\n"); "Error: Converting eth to wlan in unknown mode.\n");
return 1; return 1;
break; break;
} }
...@@ -213,7 +213,7 @@ int skb_ether_to_p80211(wlandevice_t *wlandev, u32 ethconv, ...@@ -213,7 +213,7 @@ int skb_ether_to_p80211(wlandevice_t *wlandev, u32 ethconv,
(wlandev->hostwep & HOSTWEP_DEFAULTKEY_MASK), (wlandev->hostwep & HOSTWEP_DEFAULTKEY_MASK),
p80211_wep->iv, p80211_wep->icv); p80211_wep->iv, p80211_wep->icv);
if (foo) { if (foo) {
printk(KERN_WARNING netdev_warn(wlandev->netdev,
"Host en-WEP failed, dropping frame (%d).\n", "Host en-WEP failed, dropping frame (%d).\n",
foo); foo);
return 2; return 2;
...@@ -310,7 +310,7 @@ int skb_p80211_to_ether(wlandevice_t *wlandev, u32 ethconv, ...@@ -310,7 +310,7 @@ int skb_p80211_to_ether(wlandevice_t *wlandev, u32 ethconv,
} else { } else {
payload_offset = WLAN_HDR_A4_LEN; payload_offset = WLAN_HDR_A4_LEN;
if (payload_length < WLAN_HDR_A4_LEN - WLAN_HDR_A3_LEN) { if (payload_length < WLAN_HDR_A4_LEN - WLAN_HDR_A3_LEN) {
printk(KERN_ERR "A4 frame too short!\n"); netdev_err(netdev, "A4 frame too short!\n");
return 1; return 1;
} }
payload_length -= (WLAN_HDR_A4_LEN - WLAN_HDR_A3_LEN); payload_length -= (WLAN_HDR_A4_LEN - WLAN_HDR_A3_LEN);
...@@ -322,8 +322,8 @@ int skb_p80211_to_ether(wlandevice_t *wlandev, u32 ethconv, ...@@ -322,8 +322,8 @@ int skb_p80211_to_ether(wlandevice_t *wlandev, u32 ethconv,
if ((wlandev->hostwep & HOSTWEP_PRIVACYINVOKED) && WLAN_GET_FC_ISWEP(fc) if ((wlandev->hostwep & HOSTWEP_PRIVACYINVOKED) && WLAN_GET_FC_ISWEP(fc)
&& (wlandev->hostwep & HOSTWEP_DECRYPT)) { && (wlandev->hostwep & HOSTWEP_DECRYPT)) {
if (payload_length <= 8) { if (payload_length <= 8) {
printk(KERN_ERR "WEP frame too short (%u).\n", netdev_err(netdev,
skb->len); "WEP frame too short (%u).\n", skb->len);
return 1; return 1;
} }
foo = wep_decrypt(wlandev, skb->data + payload_offset + 4, foo = wep_decrypt(wlandev, skb->data + payload_offset + 4,
...@@ -367,7 +367,7 @@ int skb_p80211_to_ether(wlandevice_t *wlandev, u32 ethconv, ...@@ -367,7 +367,7 @@ int skb_p80211_to_ether(wlandevice_t *wlandev, u32 ethconv,
if (payload_length > (netdev->mtu + WLAN_ETHHDR_LEN)) { if (payload_length > (netdev->mtu + WLAN_ETHHDR_LEN)) {
/* A bogus length ethfrm has been encap'd. */ /* A bogus length ethfrm has been encap'd. */
/* Is someone trying an oflow attack? */ /* Is someone trying an oflow attack? */
printk(KERN_ERR "ENCAP frame too large (%d > %d)\n", netdev_err(netdev, "ENCAP frame too large (%d > %d)\n",
payload_length, netdev->mtu + WLAN_ETHHDR_LEN); payload_length, netdev->mtu + WLAN_ETHHDR_LEN);
return 1; return 1;
} }
...@@ -396,7 +396,7 @@ int skb_p80211_to_ether(wlandevice_t *wlandev, u32 ethconv, ...@@ -396,7 +396,7 @@ int skb_p80211_to_ether(wlandevice_t *wlandev, u32 ethconv,
if (payload_length > netdev->mtu) { if (payload_length > netdev->mtu) {
/* A bogus length ethfrm has been sent. */ /* A bogus length ethfrm has been sent. */
/* Is someone trying an oflow attack? */ /* Is someone trying an oflow attack? */
printk(KERN_ERR "SNAP frame too large (%d > %d)\n", netdev_err(netdev, "SNAP frame too large (%d > %d)\n",
payload_length, netdev->mtu); payload_length, netdev->mtu);
return 1; return 1;
} }
...@@ -428,7 +428,7 @@ int skb_p80211_to_ether(wlandevice_t *wlandev, u32 ethconv, ...@@ -428,7 +428,7 @@ int skb_p80211_to_ether(wlandevice_t *wlandev, u32 ethconv,
> netdev->mtu) { > netdev->mtu) {
/* A bogus length ethfrm has been sent. */ /* A bogus length ethfrm has been sent. */
/* Is someone trying an oflow attack? */ /* Is someone trying an oflow attack? */
printk(KERN_ERR "DIXII frame too large (%ld > %d)\n", netdev_err(netdev, "DIXII frame too large (%ld > %d)\n",
(long int)(payload_length - (long int)(payload_length -
sizeof(struct wlan_llc) - sizeof(struct wlan_llc) -
sizeof(struct wlan_snap)), netdev->mtu); sizeof(struct wlan_snap)), netdev->mtu);
...@@ -463,7 +463,7 @@ int skb_p80211_to_ether(wlandevice_t *wlandev, u32 ethconv, ...@@ -463,7 +463,7 @@ int skb_p80211_to_ether(wlandevice_t *wlandev, u32 ethconv,
if (payload_length > netdev->mtu) { if (payload_length > netdev->mtu) {
/* A bogus length ethfrm has been sent. */ /* A bogus length ethfrm has been sent. */
/* Is someone trying an oflow attack? */ /* Is someone trying an oflow attack? */
printk(KERN_ERR "OTHER frame too large (%d > %d)\n", netdev_err(netdev, "OTHER frame too large (%d > %d)\n",
payload_length, netdev->mtu); payload_length, netdev->mtu);
return 1; return 1;
} }
...@@ -603,8 +603,8 @@ int p80211skb_rxmeta_attach(struct wlandevice *wlandev, struct sk_buff *skb) ...@@ -603,8 +603,8 @@ int p80211skb_rxmeta_attach(struct wlandevice *wlandev, struct sk_buff *skb)
/* If these already have metadata, we error out! */ /* If these already have metadata, we error out! */
if (P80211SKB_RXMETA(skb) != NULL) { if (P80211SKB_RXMETA(skb) != NULL) {
printk(KERN_ERR "%s: RXmeta already attached!\n", netdev_err(wlandev->netdev,
wlandev->name); "%s: RXmeta already attached!\n", wlandev->name);
result = 0; result = 0;
goto exit; goto exit;
} }
...@@ -613,8 +613,8 @@ int p80211skb_rxmeta_attach(struct wlandevice *wlandev, struct sk_buff *skb) ...@@ -613,8 +613,8 @@ int p80211skb_rxmeta_attach(struct wlandevice *wlandev, struct sk_buff *skb)
rxmeta = kzalloc(sizeof(struct p80211_rxmeta), GFP_ATOMIC); rxmeta = kzalloc(sizeof(struct p80211_rxmeta), GFP_ATOMIC);
if (rxmeta == NULL) { if (rxmeta == NULL) {
printk(KERN_ERR "%s: Failed to allocate rxmeta.\n", netdev_err(wlandev->netdev,
wlandev->name); "%s: Failed to allocate rxmeta.\n", wlandev->name);
result = 1; result = 1;
goto exit; goto exit;
} }
...@@ -656,6 +656,7 @@ void p80211skb_free(struct wlandevice *wlandev, struct sk_buff *skb) ...@@ -656,6 +656,7 @@ void p80211skb_free(struct wlandevice *wlandev, struct sk_buff *skb)
if (meta && meta->rx) if (meta && meta->rx)
p80211skb_rxmeta_detach(skb); p80211skb_rxmeta_detach(skb);
else else
printk(KERN_ERR "Freeing an skb (%p) w/ no frmmeta.\n", skb); netdev_err(wlandev->netdev,
"Freeing an skb (%p) w/ no frmmeta.\n", skb);
dev_kfree_skb(skb); dev_kfree_skb(skb);
} }
...@@ -109,9 +109,9 @@ int p80211req_dorequest(wlandevice_t *wlandev, u8 *msgbuf) ...@@ -109,9 +109,9 @@ int p80211req_dorequest(wlandevice_t *wlandev, u8 *msgbuf)
/* Check Permissions */ /* Check Permissions */
if (!capable(CAP_NET_ADMIN) && if (!capable(CAP_NET_ADMIN) &&
(msg->msgcode != DIDmsg_dot11req_mibget)) { (msg->msgcode != DIDmsg_dot11req_mibget)) {
printk(KERN_ERR netdev_err(wlandev->netdev,
"%s: only dot11req_mibget allowed for non-root.\n", "%s: only dot11req_mibget allowed for non-root.\n",
wlandev->name); wlandev->name);
return -EPERM; return -EPERM;
} }
......
This diff is collapsed.
This diff is collapsed.
...@@ -672,7 +672,7 @@ static int prism2mib_fragmentationthreshold(struct mibrec *mib, ...@@ -672,7 +672,7 @@ static int prism2mib_fragmentationthreshold(struct mibrec *mib,
if (!isget) if (!isget)
if ((*uint32) % 2) { if ((*uint32) % 2) {
printk(KERN_WARNING "Attempt to set odd number " netdev_warn(wlandev->netdev, "Attempt to set odd number "
"FragmentationThreshold\n"); "FragmentationThreshold\n");
msg->resultcode.data = msg->resultcode.data =
P80211ENUM_resultcode_not_supported; P80211ENUM_resultcode_not_supported;
...@@ -742,7 +742,7 @@ static int prism2mib_priv(struct mibrec *mib, ...@@ -742,7 +742,7 @@ static int prism2mib_priv(struct mibrec *mib,
break; break;
} }
default: default:
printk(KERN_ERR "Unhandled DID 0x%08x\n", mib->did); netdev_err(wlandev->netdev, "Unhandled DID 0x%08x\n", mib->did);
} }
return 0; return 0;
......
...@@ -401,8 +401,9 @@ static int prism2sta_mlmerequest(wlandevice_t *wlandev, struct p80211msg *msg) ...@@ -401,8 +401,9 @@ static int prism2sta_mlmerequest(wlandevice_t *wlandev, struct p80211msg *msg)
break; break;
} }
default: default:
printk(KERN_WARNING "Unknown mgmt request message 0x%08x", netdev_warn(wlandev->netdev,
msg->msgcode); "Unknown mgmt request message 0x%08x",
msg->msgcode);
break; break;
} }
...@@ -465,7 +466,7 @@ u32 prism2sta_ifstate(wlandevice_t *wlandev, u32 ifstate) ...@@ -465,7 +466,7 @@ u32 prism2sta_ifstate(wlandevice_t *wlandev, u32 ifstate)
result = P80211ENUM_resultcode_success; result = P80211ENUM_resultcode_success;
break; break;
case WLAN_MSD_RUNNING: case WLAN_MSD_RUNNING:
printk(KERN_WARNING netdev_warn(wlandev->netdev,
"Cannot enter fwload state from enable state," "Cannot enter fwload state from enable state,"
"you must disable first.\n"); "you must disable first.\n");
result = P80211ENUM_resultcode_invalid_parameters; result = P80211ENUM_resultcode_invalid_parameters;
...@@ -1427,7 +1428,7 @@ void prism2sta_processing_defer(struct work_struct *data) ...@@ -1427,7 +1428,7 @@ void prism2sta_processing_defer(struct work_struct *data)
default: default:
/* This is bad, IO port problems? */ /* This is bad, IO port problems? */
printk(KERN_WARNING netdev_warn(wlandev->netdev,
"unknown linkstatus=0x%02x\n", hw->link_status); "unknown linkstatus=0x%02x\n", hw->link_status);
return; return;
} }
...@@ -1509,7 +1510,7 @@ static void prism2sta_inf_assocstatus(wlandevice_t *wlandev, ...@@ -1509,7 +1510,7 @@ static void prism2sta_inf_assocstatus(wlandevice_t *wlandev,
if (i >= hw->authlist.cnt) { if (i >= hw->authlist.cnt) {
if (rec.assocstatus != HFA384x_ASSOCSTATUS_AUTHFAIL) if (rec.assocstatus != HFA384x_ASSOCSTATUS_AUTHFAIL)
printk(KERN_WARNING netdev_warn(wlandev->netdev,
"assocstatus info frame received for non-authenticated station.\n"); "assocstatus info frame received for non-authenticated station.\n");
} else { } else {
hw->authlist.assoc[i] = hw->authlist.assoc[i] =
...@@ -1517,7 +1518,7 @@ static void prism2sta_inf_assocstatus(wlandevice_t *wlandev, ...@@ -1517,7 +1518,7 @@ static void prism2sta_inf_assocstatus(wlandevice_t *wlandev,
rec.assocstatus == HFA384x_ASSOCSTATUS_REASSOC); rec.assocstatus == HFA384x_ASSOCSTATUS_REASSOC);
if (rec.assocstatus == HFA384x_ASSOCSTATUS_AUTHFAIL) if (rec.assocstatus == HFA384x_ASSOCSTATUS_AUTHFAIL)
printk(KERN_WARNING netdev_warn(wlandev->netdev,
"authfail assocstatus info frame received for authenticated station.\n"); "authfail assocstatus info frame received for authenticated station.\n");
} }
} }
...@@ -1787,16 +1788,16 @@ void prism2sta_ev_info(wlandevice_t *wlandev, hfa384x_InfFrame_t *inf) ...@@ -1787,16 +1788,16 @@ void prism2sta_ev_info(wlandevice_t *wlandev, hfa384x_InfFrame_t *inf)
prism2sta_inf_psusercnt(wlandev, inf); prism2sta_inf_psusercnt(wlandev, inf);
break; break;
case HFA384x_IT_KEYIDCHANGED: case HFA384x_IT_KEYIDCHANGED:
printk(KERN_WARNING "Unhandled IT_KEYIDCHANGED\n"); netdev_warn(wlandev->netdev, "Unhandled IT_KEYIDCHANGED\n");
break; break;
case HFA384x_IT_ASSOCREQ: case HFA384x_IT_ASSOCREQ:
printk(KERN_WARNING "Unhandled IT_ASSOCREQ\n"); netdev_warn(wlandev->netdev, "Unhandled IT_ASSOCREQ\n");
break; break;
case HFA384x_IT_MICFAILURE: case HFA384x_IT_MICFAILURE:
printk(KERN_WARNING "Unhandled IT_MICFAILURE\n"); netdev_warn(wlandev->netdev, "Unhandled IT_MICFAILURE\n");
break; break;
default: default:
printk(KERN_WARNING netdev_warn(wlandev->netdev,
"Unknown info type=0x%02x\n", inf->infotype); "Unknown info type=0x%02x\n", inf->infotype);
break; break;
} }
......
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