Skip to content

Commit

Permalink
Staging: wlan-ng: Replace WLAN_LOG_ERROR() with printk()
Browse files Browse the repository at this point in the history
Signed-off-by: Moritz Muehlenhoff <jmm@debian.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Moritz Muehlenhoff authored and Greg Kroah-Hartman committed Apr 3, 2009
1 parent 2acbf9d commit edbd606
Show file tree
Hide file tree
Showing 10 changed files with 96 additions and 98 deletions.
48 changes: 24 additions & 24 deletions drivers/staging/wlan-ng/hfa384x_usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1330,7 +1330,7 @@ void
hfa384x_copy_from_aux(
hfa384x_t *hw, u32 cardaddr, u32 auxctl, void *buf, unsigned int len)
{
WLAN_LOG_ERROR("not used in USB.\n");
printk(KERN_ERR "not used in USB.\n");
}


Expand Down Expand Up @@ -1362,7 +1362,7 @@ void
hfa384x_copy_to_aux(
hfa384x_t *hw, u32 cardaddr, u32 auxctl, void *buf, unsigned int len)
{
WLAN_LOG_ERROR("not used in USB.\n");
printk(KERN_ERR "not used in USB.\n");
}


Expand Down Expand Up @@ -1395,7 +1395,7 @@ int hfa384x_corereset(hfa384x_t *hw, int holdtime, int settletime, int genesis)

result=usb_reset_device(hw->usb);
if(result<0) {
WLAN_LOG_ERROR("usb_reset_device() failed, result=%d.\n",result);
printk(KERN_ERR "usb_reset_device() failed, result=%d.\n",result);
}

return result;
Expand Down Expand Up @@ -2289,7 +2289,7 @@ WLAN_LOG_WARNING("dlbuf@0x%06lx len=%d to=%d\n", dlbufaddr, hw->bufinfo.len, hw-
result = hfa384x_cmd_download(hw, HFA384x_PROGMODE_NV,
burnlo, burnhi, burnlen);
if ( result ) {
WLAN_LOG_ERROR("download(NV,lo=%x,hi=%x,len=%x) "
printk(KERN_ERR "download(NV,lo=%x,hi=%x,len=%x) "
"cmd failed, result=%d. Aborting d/l\n",
burnlo, burnhi, burnlen, result);
goto exit_proc;
Expand Down Expand Up @@ -2322,7 +2322,7 @@ WLAN_LOG_WARNING("dlbuf@0x%06lx len=%d to=%d\n", dlbufaddr, hw->bufinfo.len, hw-

Comment out for debugging, assume the write was successful.
if (result) {
WLAN_LOG_ERROR(
printk(KERN_ERR
"Write to dl buffer failed, "
"result=0x%04x. Aborting.\n",
result);
Expand All @@ -2337,7 +2337,7 @@ Comment out for debugging, assume the write was successful.
HFA384x_PROGMODE_NVWRITE,
0,0,0);
if ( result ) {
WLAN_LOG_ERROR(
printk(KERN_ERR
"download(NVWRITE,lo=%x,hi=%x,len=%x) "
"cmd failed, result=%d. Aborting d/l\n",
burnlo, burnhi, burnlen, result);
Expand Down Expand Up @@ -2486,7 +2486,7 @@ hfa384x_drvr_setconfig_async(
----------------------------------------------------------------*/
int hfa384x_drvr_handover( hfa384x_t *hw, u8 *addr)
{
WLAN_LOG_ERROR("Not currently supported in USB!\n");
printk(KERN_ERR "Not currently supported in USB!\n");
return -EIO;
}

Expand Down Expand Up @@ -2585,15 +2585,15 @@ hfa384x_drvr_ramdl_enable(hfa384x_t *hw, u32 exeaddr)
/* Check that a port isn't active */
for ( i = 0; i < HFA384x_PORTID_MAX; i++) {
if ( hw->port_enabled[i] ) {
WLAN_LOG_ERROR(
printk(KERN_ERR
"Can't download with a macport enabled.\n");
return -EINVAL;
}
}

/* Check that we're not already in a download state */
if ( hw->dlstate != HFA384x_DLSTATE_DISABLED ) {
WLAN_LOG_ERROR(
printk(KERN_ERR
"Download state not disabled.\n");
return -EINVAL;
}
Expand Down Expand Up @@ -2778,14 +2778,14 @@ int hfa384x_drvr_readpda(hfa384x_t *hw, void *buf, unsigned int len)
pdrcode = hfa384x2host_16(pda[currpdr+1]);
/* Test the record length */
if ( pdrlen > HFA384x_PDR_LEN_MAX || pdrlen == 0) {
WLAN_LOG_ERROR("pdrlen invalid=%d\n",
printk(KERN_ERR "pdrlen invalid=%d\n",
pdrlen);
pdaok = 0;
break;
}
/* Test the code */
if ( !hfa384x_isgood_pdrcode(pdrcode) ) {
WLAN_LOG_ERROR("pdrcode invalid=%d\n",
printk(KERN_ERR "pdrcode invalid=%d\n",
pdrcode);
pdaok = 0;
break;
Expand Down Expand Up @@ -2883,23 +2883,23 @@ int hfa384x_drvr_start(hfa384x_t *hw)
*/
result = usb_get_status(hw->usb, USB_RECIP_ENDPOINT, hw->endp_in, &status);
if (result < 0) {
WLAN_LOG_ERROR(
printk(KERN_ERR
"Cannot get bulk in endpoint status.\n");
goto done;
}
if ((status == 1) && usb_clear_halt(hw->usb, hw->endp_in)) {
WLAN_LOG_ERROR(
printk(KERN_ERR
"Failed to reset bulk in endpoint.\n");
}

result = usb_get_status(hw->usb, USB_RECIP_ENDPOINT, hw->endp_out, &status);
if (result < 0) {
WLAN_LOG_ERROR(
printk(KERN_ERR
"Cannot get bulk out endpoint status.\n");
goto done;
}
if ((status == 1) && usb_clear_halt(hw->usb, hw->endp_out)) {
WLAN_LOG_ERROR(
printk(KERN_ERR
"Failed to reset bulk out endpoint.\n");
}

Expand All @@ -2909,7 +2909,7 @@ int hfa384x_drvr_start(hfa384x_t *hw)
/* Post the IN urb */
result = submit_rx_urb(hw, GFP_KERNEL);
if (result != 0) {
WLAN_LOG_ERROR(
printk(KERN_ERR
"Fatal, failed to submit RX URB, result=%d\n",
result);
goto done;
Expand All @@ -2930,7 +2930,7 @@ int hfa384x_drvr_start(hfa384x_t *hw)
result = result2 = hfa384x_cmd_initialize(hw);
if (result1 != 0) {
if (result2 != 0) {
WLAN_LOG_ERROR(
printk(KERN_ERR
"cmd_initialize() failed on two attempts, results %d and %d\n",
result1, result2);
usb_kill_urb(&hw->rx_urb);
Expand Down Expand Up @@ -3112,7 +3112,7 @@ int hfa384x_drvr_txframe(hfa384x_t *hw, struct sk_buff *skb, p80211_hdr_t *p8021
result = 1;
ret = submit_tx_urb(hw, &hw->tx_urb, GFP_ATOMIC);
if ( ret != 0 ) {
WLAN_LOG_ERROR(
printk(KERN_ERR
"submit_tx_urb() failed, error=%d\n", ret);
result = 3;
}
Expand Down Expand Up @@ -3337,7 +3337,7 @@ static void unlocked_usbctlx_complete(hfa384x_t *hw, hfa384x_usbctlx_t *ctlx)
break;

default:
WLAN_LOG_ERROR("CTLX[%d] not in a terminating state(%s)\n",
printk(KERN_ERR "CTLX[%d] not in a terminating state(%s)\n",
hfa384x2host_16(ctlx->outbuf.type),
ctlxstr(ctlx->state));
break;
Expand Down Expand Up @@ -3437,7 +3437,7 @@ hfa384x_usbctlxq_run(hfa384x_t *hw)
break;
}

WLAN_LOG_ERROR("Failed to submit CTLX[%d]: error=%d\n",
printk(KERN_ERR "Failed to submit CTLX[%d]: error=%d\n",
hfa384x2host_16(head->outbuf.type), result);
unlocked_usbctlx_complete(hw, head);
} /* while */
Expand Down Expand Up @@ -3559,7 +3559,7 @@ static void hfa384x_usbin_callback(struct urb *urb)
result = submit_rx_urb(hw, GFP_ATOMIC);

if (result != 0) {
WLAN_LOG_ERROR(
printk(KERN_ERR
"Fatal, failed to resubmit rx_urb. error=%d\n",
result);
}
Expand Down Expand Up @@ -3733,7 +3733,7 @@ static void hfa384x_usbin_ctlx(hfa384x_t *hw, hfa384x_usbin_t *usbin,
/*
* Throw this CTLX away ...
*/
WLAN_LOG_ERROR("Matched IN URB, CTLX[%d] in invalid state(%s)."
printk(KERN_ERR "Matched IN URB, CTLX[%d] in invalid state(%s)."
" Discarded.\n",
hfa384x2host_16(ctlx->outbuf.type),
ctlxstr(ctlx->state));
Expand Down Expand Up @@ -3938,7 +3938,7 @@ static void hfa384x_int_rxmonitor( wlandevice_t *wlandev, hfa384x_usb_rxfrm_t *r
}

if ( (skb = dev_alloc_skb(skblen)) == NULL ) {
WLAN_LOG_ERROR("alloc_skb failed trying to allocate %d bytes\n", skblen);
printk(KERN_ERR "alloc_skb failed trying to allocate %d bytes\n", skblen);
return;
}

Expand Down Expand Up @@ -4183,7 +4183,7 @@ static void hfa384x_ctlxout_callback(struct urb *urb)

default:
/* This is NOT a valid CTLX "success" state! */
WLAN_LOG_ERROR(
printk(KERN_ERR
"Illegal CTLX[%d] success state(%s, %d) in OUT URB\n",
hfa384x2host_16(ctlx->outbuf.type),
ctlxstr(ctlx->state), urb->status);
Expand Down
20 changes: 10 additions & 10 deletions drivers/staging/wlan-ng/p80211conv.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ int skb_ether_to_p80211( wlandevice_t *wlandev, u32 ethconv, struct sk_buff *skb
memcpy(p80211_hdr->a3.a3, &e_hdr.saddr, ETH_ALEN);
break;
default:
WLAN_LOG_ERROR("Error: Converting eth to wlan in unknown mode.\n");
printk(KERN_ERR "Error: Converting eth to wlan in unknown mode.\n");
return 1;
break;
}
Expand Down Expand Up @@ -326,7 +326,7 @@ int skb_p80211_to_ether( wlandevice_t *wlandev, u32 ethconv, struct sk_buff *skb
} else {
payload_offset = WLAN_HDR_A4_LEN;
if (payload_length < WLAN_HDR_A4_LEN - WLAN_HDR_A3_LEN) {
WLAN_LOG_ERROR("A4 frame too short!\n");
printk(KERN_ERR "A4 frame too short!\n");
return 1;
}
payload_length -= (WLAN_HDR_A4_LEN - WLAN_HDR_A3_LEN);
Expand All @@ -337,7 +337,7 @@ int skb_p80211_to_ether( wlandevice_t *wlandev, u32 ethconv, struct sk_buff *skb
/* perform de-wep if necessary.. */
if ((wlandev->hostwep & HOSTWEP_PRIVACYINVOKED) && WLAN_GET_FC_ISWEP(fc) && (wlandev->hostwep & HOSTWEP_DECRYPT)) {
if (payload_length <= 8) {
WLAN_LOG_ERROR("WEP frame too short (%u).\n",
printk(KERN_ERR "WEP frame too short (%u).\n",
skb->len);
return 1;
}
Expand Down Expand Up @@ -377,7 +377,7 @@ int skb_p80211_to_ether( wlandevice_t *wlandev, u32 ethconv, struct sk_buff *skb
if ( payload_length > (netdev->mtu + WLAN_ETHHDR_LEN)) {
/* A bogus length ethfrm has been encap'd. */
/* Is someone trying an oflow attack? */
WLAN_LOG_ERROR("ENCAP frame too large (%d > %d)\n",
printk(KERN_ERR "ENCAP frame too large (%d > %d)\n",
payload_length, netdev->mtu + WLAN_ETHHDR_LEN);
return 1;
}
Expand All @@ -404,7 +404,7 @@ int skb_p80211_to_ether( wlandevice_t *wlandev, u32 ethconv, struct sk_buff *skb
if ( payload_length > netdev->mtu ) {
/* A bogus length ethfrm has been sent. */
/* Is someone trying an oflow attack? */
WLAN_LOG_ERROR("SNAP frame too large (%d > %d)\n",
printk(KERN_ERR "SNAP frame too large (%d > %d)\n",
payload_length, netdev->mtu);
return 1;
}
Expand Down Expand Up @@ -434,7 +434,7 @@ int skb_p80211_to_ether( wlandevice_t *wlandev, u32 ethconv, struct sk_buff *skb
> netdev->mtu) {
/* A bogus length ethfrm has been sent. */
/* Is someone trying an oflow attack? */
WLAN_LOG_ERROR("DIXII frame too large (%ld > %d)\n",
printk(KERN_ERR "DIXII frame too large (%ld > %d)\n",
(long int) (payload_length - sizeof(wlan_llc_t) -
sizeof(wlan_snap_t)),
netdev->mtu);
Expand Down Expand Up @@ -469,7 +469,7 @@ int skb_p80211_to_ether( wlandevice_t *wlandev, u32 ethconv, struct sk_buff *skb
if ( payload_length > netdev->mtu ) {
/* A bogus length ethfrm has been sent. */
/* Is someone trying an oflow attack? */
WLAN_LOG_ERROR("OTHER frame too large (%d > %d)\n",
printk(KERN_ERR "OTHER frame too large (%d > %d)\n",
payload_length,
netdev->mtu);
return 1;
Expand Down Expand Up @@ -613,7 +613,7 @@ p80211skb_rxmeta_attach(struct wlandevice *wlandev, struct sk_buff *skb)

/* If these already have metadata, we error out! */
if (P80211SKB_RXMETA(skb) != NULL) {
WLAN_LOG_ERROR("%s: RXmeta already attached!\n",
printk(KERN_ERR "%s: RXmeta already attached!\n",
wlandev->name);
result = 0;
goto exit;
Expand All @@ -623,7 +623,7 @@ p80211skb_rxmeta_attach(struct wlandevice *wlandev, struct sk_buff *skb)
rxmeta = kmalloc(sizeof(p80211_rxmeta_t), GFP_ATOMIC);

if ( rxmeta == NULL ) {
WLAN_LOG_ERROR("%s: Failed to allocate rxmeta.\n",
printk(KERN_ERR "%s: Failed to allocate rxmeta.\n",
wlandev->name);
result = 1;
goto exit;
Expand Down Expand Up @@ -668,7 +668,7 @@ p80211skb_free(struct wlandevice *wlandev, struct sk_buff *skb)
if ( meta && meta->rx) {
p80211skb_rxmeta_detach(skb);
} else {
WLAN_LOG_ERROR("Freeing an skb (%p) w/ no frmmeta.\n", skb);
printk(KERN_ERR "Freeing an skb (%p) w/ no frmmeta.\n", skb);
}

dev_kfree_skb(skb);
Expand Down
6 changes: 3 additions & 3 deletions drivers/staging/wlan-ng/p80211netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,7 @@ static int p80211knetdev_set_mac_address(netdevice_t *dev, void *addr)
* change the netdev address
*/
if ( result != 0 || resultcode->data != P80211ENUM_resultcode_success) {
WLAN_LOG_ERROR(
printk(KERN_ERR
"Low-level driver failed dot11req_mibset(dot11MACAddress).\n");
result = -EADDRNOTAVAIL;
} else {
Expand Down Expand Up @@ -785,7 +785,7 @@ int wlan_setup(wlandevice_t *wlandev)
/* Allocate and initialize the struct device */
dev = alloc_netdev(0,"wlan%d",ether_setup);
if ( dev == NULL ) {
WLAN_LOG_ERROR("Failed to alloc netdev.\n");
printk(KERN_ERR "Failed to alloc netdev.\n");
result = 1;
} else {
wlandev->netdev = dev;
Expand Down Expand Up @@ -852,7 +852,7 @@ int wlan_unsetup(wlandevice_t *wlandev)
tasklet_kill(&wlandev->rx_bh);

if (wlandev->netdev == NULL ) {
WLAN_LOG_ERROR("called without wlandev->netdev set.\n");
printk(KERN_ERR "called without wlandev->netdev set.\n");
result = 1;
} else {
free_netdev(wlandev->netdev);
Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/wlan-ng/p80211req.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ int p80211req_dorequest( wlandevice_t *wlandev, u8 *msgbuf)
/* Check Permissions */
if (!capable(CAP_NET_ADMIN) &&
(msg->msgcode != DIDmsg_dot11req_mibget)) {
WLAN_LOG_ERROR("%s: only dot11req_mibget allowed for non-root.\n", wlandev->name);
printk(KERN_ERR "%s: only dot11req_mibget allowed for non-root.\n", wlandev->name);
return -EPERM;
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/wlan-ng/p80211wext.c
Original file line number Diff line number Diff line change
Expand Up @@ -1274,7 +1274,7 @@ static int p80211wext_siwscan(netdevice_t *dev,
int i = 0;

if (wlandev->macmode == WLAN_MACMODE_ESS_AP) {
WLAN_LOG_ERROR("Can't scan in AP mode\n");
printk(KERN_ERR "Can't scan in AP mode\n");
err = (-EOPNOTSUPP);
goto exit;
}
Expand Down
Loading

0 comments on commit edbd606

Please sign in to comment.