Commit 79f9e634 authored by Denis Pithon's avatar Denis Pithon Committed by Greg Kroah-Hartman

staging/wlan-ng: log with netdev_xxx and dev_xxx

Wherever possible, replaced printk() and pr_xxx() calls with
netdev_xxx() / dev_xxx() calls; used pr_xxx() otherwise.
Signed-off-by: default avatarDenis Pithon <denis.pithon@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 95c9668d
...@@ -279,7 +279,7 @@ static int p80211_convert_to_ether(wlandevice_t *wlandev, struct sk_buff *skb) ...@@ -279,7 +279,7 @@ static int p80211_convert_to_ether(wlandevice_t *wlandev, struct sk_buff *skb)
return 0; return 0;
} }
pr_debug("p80211_to_ether failed.\n"); netdev_dbg(wlandev->netdev, "p80211_convert_to_ether failed.\n");
return CONV_TO_ETHER_FAILED; return CONV_TO_ETHER_FAILED;
} }
...@@ -365,7 +365,7 @@ static int p80211knetdev_hard_start_xmit(struct sk_buff *skb, ...@@ -365,7 +365,7 @@ static int p80211knetdev_hard_start_xmit(struct sk_buff *skb,
memset(&p80211_wep, 0, sizeof(struct p80211_metawep)); memset(&p80211_wep, 0, sizeof(struct p80211_metawep));
if (netif_queue_stopped(netdev)) { if (netif_queue_stopped(netdev)) {
pr_debug("called when queue stopped.\n"); netdev_dbg(netdev, "called when queue stopped.\n");
result = 1; result = 1;
goto failed; goto failed;
} }
...@@ -385,8 +385,7 @@ static int p80211knetdev_hard_start_xmit(struct sk_buff *skb, ...@@ -385,8 +385,7 @@ static int p80211knetdev_hard_start_xmit(struct sk_buff *skb,
*/ */
if (skb->protocol != ETH_P_80211_RAW) { if (skb->protocol != ETH_P_80211_RAW) {
netif_start_queue(wlandev->netdev); netif_start_queue(wlandev->netdev);
printk(KERN_NOTICE netdev_notice(netdev, "Tx attempt prior to association, frame dropped.\n");
"Tx attempt prior to association, frame dropped.\n");
wlandev->linux_stats.tx_dropped++; wlandev->linux_stats.tx_dropped++;
result = 0; result = 0;
goto failed; goto failed;
...@@ -408,8 +407,8 @@ static int p80211knetdev_hard_start_xmit(struct sk_buff *skb, ...@@ -408,8 +407,8 @@ static int p80211knetdev_hard_start_xmit(struct sk_buff *skb,
(wlandev, wlandev->ethconv, skb, &p80211_hdr, (wlandev, wlandev->ethconv, skb, &p80211_hdr,
&p80211_wep) != 0) { &p80211_wep) != 0) {
/* convert failed */ /* convert failed */
pr_debug("ether_to_80211(%d) failed.\n", netdev_dbg(netdev, "ether_to_80211(%d) failed.\n",
wlandev->ethconv); wlandev->ethconv);
result = 1; result = 1;
goto failed; goto failed;
} }
...@@ -434,17 +433,17 @@ static int p80211knetdev_hard_start_xmit(struct sk_buff *skb, ...@@ -434,17 +433,17 @@ static int p80211knetdev_hard_start_xmit(struct sk_buff *skb,
result = NETDEV_TX_OK; result = NETDEV_TX_OK;
} else if (txresult == 1) { } else if (txresult == 1) {
/* success, no more avail */ /* success, no more avail */
pr_debug("txframe success, no more bufs\n"); netdev_dbg(netdev, "txframe success, no more bufs\n");
/* netdev->tbusy = 1; don't set here, irqhdlr */ /* netdev->tbusy = 1; don't set here, irqhdlr */
/* may have already cleared it */ /* may have already cleared it */
result = NETDEV_TX_OK; result = NETDEV_TX_OK;
} else if (txresult == 2) { } else if (txresult == 2) {
/* alloc failure, drop frame */ /* alloc failure, drop frame */
pr_debug("txframe returned alloc_fail\n"); netdev_dbg(netdev, "txframe returned alloc_fail\n");
result = NETDEV_TX_BUSY; result = NETDEV_TX_BUSY;
} else { } else {
/* buffer full or queue busy, drop frame. */ /* buffer full or queue busy, drop frame. */
pr_debug("txframe returned full or busy\n"); netdev_dbg(netdev, "txframe returned full or busy\n");
result = NETDEV_TX_BUSY; result = NETDEV_TX_BUSY;
} }
...@@ -564,7 +563,7 @@ static int p80211knetdev_do_ioctl(netdevice_t *dev, struct ifreq *ifr, int cmd) ...@@ -564,7 +563,7 @@ static int p80211knetdev_do_ioctl(netdevice_t *dev, struct ifreq *ifr, int cmd)
wlandevice_t *wlandev = dev->ml_priv; wlandevice_t *wlandev = dev->ml_priv;
u8 *msgbuf; u8 *msgbuf;
pr_debug("rx'd ioctl, cmd=%d, len=%d\n", cmd, req->len); netdev_dbg(dev, "rx'd ioctl, cmd=%d, len=%d\n", cmd, req->len);
#ifdef SIOCETHTOOL #ifdef SIOCETHTOOL
if (cmd == SIOCETHTOOL) { if (cmd == SIOCETHTOOL) {
...@@ -685,8 +684,7 @@ static int p80211knetdev_set_mac_address(netdevice_t *dev, void *addr) ...@@ -685,8 +684,7 @@ static int p80211knetdev_set_mac_address(netdevice_t *dev, void *addr)
* change the netdev address * change the netdev address
*/ */
if (result != 0 || resultcode->data != P80211ENUM_resultcode_success) { if (result != 0 || resultcode->data != P80211ENUM_resultcode_success) {
printk(KERN_ERR netdev_err(dev, "Low-level driver failed dot11req_mibset(dot11MACAddress).\n");
"Low-level driver failed dot11req_mibset(dot11MACAddress).\n");
result = -EADDRNOTAVAIL; result = -EADDRNOTAVAIL;
} else { } else {
/* everything's ok, change the addr in netdev */ /* everything's ok, change the addr in netdev */
...@@ -765,7 +763,7 @@ int wlan_setup(wlandevice_t *wlandev, struct device *physdev) ...@@ -765,7 +763,7 @@ int wlan_setup(wlandevice_t *wlandev, struct device *physdev)
/* Allocate and initialize the wiphy struct */ /* Allocate and initialize the wiphy struct */
wiphy = wlan_create_wiphy(physdev, wlandev); wiphy = wlan_create_wiphy(physdev, wlandev);
if (wiphy == NULL) { if (wiphy == NULL) {
printk(KERN_ERR "Failed to alloc wiphy.\n"); dev_err(physdev, "Failed to alloc wiphy.\n");
return 1; return 1;
} }
...@@ -773,7 +771,7 @@ int wlan_setup(wlandevice_t *wlandev, struct device *physdev) ...@@ -773,7 +771,7 @@ int wlan_setup(wlandevice_t *wlandev, struct device *physdev)
netdev = alloc_netdev(sizeof(struct wireless_dev), "wlan%d", netdev = alloc_netdev(sizeof(struct wireless_dev), "wlan%d",
ether_setup); ether_setup);
if (netdev == NULL) { if (netdev == NULL) {
printk(KERN_ERR "Failed to alloc netdev.\n"); dev_err(physdev, "Failed to alloc netdev.\n");
wlan_free_wiphy(wiphy); wlan_free_wiphy(wiphy);
result = 1; result = 1;
} else { } else {
...@@ -949,7 +947,8 @@ static int p80211_rx_typedrop(wlandevice_t *wlandev, u16 fc) ...@@ -949,7 +947,8 @@ static int p80211_rx_typedrop(wlandevice_t *wlandev, u16 fc)
ftype = WLAN_GET_FC_FTYPE(fc); ftype = WLAN_GET_FC_FTYPE(fc);
fstype = WLAN_GET_FC_FSTYPE(fc); fstype = WLAN_GET_FC_FSTYPE(fc);
#if 0 #if 0
pr_debug("rx_typedrop : ftype=%d fstype=%d.\n", ftype, fstype); netdev_dbg(wlandev->netdev, "rx_typedrop : ftype=%d fstype=%d.\n",
ftype, fstype);
#endif #endif
switch (ftype) { switch (ftype) {
case WLAN_FTYPE_MGMT: case WLAN_FTYPE_MGMT:
...@@ -958,7 +957,7 @@ static int p80211_rx_typedrop(wlandevice_t *wlandev, u16 fc) ...@@ -958,7 +957,7 @@ static int p80211_rx_typedrop(wlandevice_t *wlandev, u16 fc)
drop = 1; drop = 1;
break; break;
} }
pr_debug("rx'd mgmt:\n"); netdev_dbg(wlandev->netdev, "rx'd mgmt:\n");
wlandev->rx.mgmt++; wlandev->rx.mgmt++;
switch (fstype) { switch (fstype) {
case WLAN_FSTYPE_ASSOCREQ: case WLAN_FSTYPE_ASSOCREQ:
...@@ -1020,7 +1019,7 @@ static int p80211_rx_typedrop(wlandevice_t *wlandev, u16 fc) ...@@ -1020,7 +1019,7 @@ static int p80211_rx_typedrop(wlandevice_t *wlandev, u16 fc)
drop = 1; drop = 1;
break; break;
} }
pr_debug("rx'd ctl:\n"); netdev_dbg(wlandev->netdev, "rx'd ctl:\n");
wlandev->rx.ctl++; wlandev->rx.ctl++;
switch (fstype) { switch (fstype) {
case WLAN_FSTYPE_PSPOLL: case WLAN_FSTYPE_PSPOLL:
...@@ -1072,19 +1071,19 @@ static int p80211_rx_typedrop(wlandevice_t *wlandev, u16 fc) ...@@ -1072,19 +1071,19 @@ static int p80211_rx_typedrop(wlandevice_t *wlandev, u16 fc)
wlandev->rx.data__cfack_cfpoll++; wlandev->rx.data__cfack_cfpoll++;
break; break;
case WLAN_FSTYPE_NULL: case WLAN_FSTYPE_NULL:
pr_debug("rx'd data:null\n"); netdev_dbg(wlandev->netdev, "rx'd data:null\n");
wlandev->rx.null++; wlandev->rx.null++;
break; break;
case WLAN_FSTYPE_CFACK: case WLAN_FSTYPE_CFACK:
pr_debug("rx'd data:cfack\n"); netdev_dbg(wlandev->netdev, "rx'd data:cfack\n");
wlandev->rx.cfack++; wlandev->rx.cfack++;
break; break;
case WLAN_FSTYPE_CFPOLL: case WLAN_FSTYPE_CFPOLL:
pr_debug("rx'd data:cfpoll\n"); netdev_dbg(wlandev->netdev, "rx'd data:cfpoll\n");
wlandev->rx.cfpoll++; wlandev->rx.cfpoll++;
break; break;
case WLAN_FSTYPE_CFACK_CFPOLL: case WLAN_FSTYPE_CFACK_CFPOLL:
pr_debug("rx'd data:cfack_cfpoll\n"); netdev_dbg(wlandev->netdev, "rx'd data:cfack_cfpoll\n");
wlandev->rx.cfack_cfpoll++; wlandev->rx.cfack_cfpoll++;
break; break;
default: default:
...@@ -1105,8 +1104,8 @@ static void p80211knetdev_tx_timeout(netdevice_t *netdev) ...@@ -1105,8 +1104,8 @@ static void p80211knetdev_tx_timeout(netdevice_t *netdev)
if (wlandev->tx_timeout) { if (wlandev->tx_timeout) {
wlandev->tx_timeout(wlandev); wlandev->tx_timeout(wlandev);
} else { } else {
printk(KERN_WARNING "Implement tx_timeout for %s\n", netdev_warn(netdev, "Implement tx_timeout for %s\n",
wlandev->nsdname); wlandev->nsdname);
netif_wake_queue(wlandev->netdev); netif_wake_queue(wlandev->netdev);
} }
} }
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