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;
} }
......
...@@ -205,19 +205,20 @@ static int prism2_fwtry(struct usb_device *udev, wlandevice_t *wlandev) ...@@ -205,19 +205,20 @@ static int prism2_fwtry(struct usb_device *udev, wlandevice_t *wlandev)
{ {
const struct firmware *fw_entry = NULL; const struct firmware *fw_entry = NULL;
printk(KERN_INFO "prism2_usb: Checking for firmware %s\n", netdev_info(wlandev->netdev, "prism2_usb: Checking for firmware %s\n",
PRISM2_USB_FWFILE); PRISM2_USB_FWFILE);
if (request_ihex_firmware(&fw_entry, if (request_ihex_firmware(&fw_entry,
PRISM2_USB_FWFILE, &udev->dev) != 0) { PRISM2_USB_FWFILE, &udev->dev) != 0) {
printk(KERN_INFO netdev_info(wlandev->netdev,
"prism2_usb: Firmware not available, but not essential\n"); "prism2_usb: Firmware not available, but not essential\n");
printk(KERN_INFO netdev_info(wlandev->netdev,
"prism2_usb: can continue to use card anyway.\n"); "prism2_usb: can continue to use card anyway.\n");
return 1; return 1;
} }
printk(KERN_INFO "prism2_usb: %s will be processed, size %zu\n", netdev_info(wlandev->netdev,
PRISM2_USB_FWFILE, fw_entry->size); "prism2_usb: %s will be processed, size %zu\n",
PRISM2_USB_FWFILE, fw_entry->size);
prism2_fwapply((const struct ihex_binrec *)fw_entry->data, wlandev); prism2_fwapply((const struct ihex_binrec *)fw_entry->data, wlandev);
release_firmware(fw_entry); release_firmware(fw_entry);
...@@ -275,7 +276,7 @@ static int prism2_fwapply(const struct ihex_binrec *rfptr, wlandevice_t *wlandev ...@@ -275,7 +276,7 @@ static int prism2_fwapply(const struct ihex_binrec *rfptr, wlandevice_t *wlandev
/* Build the PDA we're going to use. */ /* Build the PDA we're going to use. */
if (read_cardpda(&pda, wlandev)) { if (read_cardpda(&pda, wlandev)) {
printk(KERN_ERR "load_cardpda failed, exiting.\n"); netdev_err(wlandev->netdev, "load_cardpda failed, exiting.\n");
return 1; return 1;
} }
...@@ -299,7 +300,7 @@ static int prism2_fwapply(const struct ihex_binrec *rfptr, wlandevice_t *wlandev ...@@ -299,7 +300,7 @@ static int prism2_fwapply(const struct ihex_binrec *rfptr, wlandevice_t *wlandev
/* DIDmsg_dot11req_mibget */ /* DIDmsg_dot11req_mibget */
prism2mgmt_mibset_mibget(wlandev, &getmsg); prism2mgmt_mibset_mibget(wlandev, &getmsg);
if (getmsg.resultcode.data != P80211ENUM_resultcode_success) if (getmsg.resultcode.data != P80211ENUM_resultcode_success)
printk(KERN_ERR "Couldn't fetch PRI-SUP info\n"); netdev_err(wlandev->netdev, "Couldn't fetch PRI-SUP info\n");
/* Already in host order */ /* Already in host order */
priid.role = *data++; priid.role = *data++;
...@@ -311,19 +312,21 @@ static int prism2_fwapply(const struct ihex_binrec *rfptr, wlandevice_t *wlandev ...@@ -311,19 +312,21 @@ static int prism2_fwapply(const struct ihex_binrec *rfptr, wlandevice_t *wlandev
/* Read the S3 file */ /* Read the S3 file */
result = read_fwfile(rfptr); result = read_fwfile(rfptr);
if (result) { if (result) {
printk(KERN_ERR "Failed to read the data exiting.\n"); netdev_err(wlandev->netdev,
"Failed to read the data exiting.\n");
return 1; return 1;
} }
result = validate_identity(); result = validate_identity();
if (result) { if (result) {
printk(KERN_ERR "Incompatible firmware image.\n"); netdev_err(wlandev->netdev, "Incompatible firmware image.\n");
return 1; return 1;
} }
if (startaddr == 0x00000000) { if (startaddr == 0x00000000) {
printk(KERN_ERR "Can't RAM download a Flash image!\n"); netdev_err(wlandev->netdev,
"Can't RAM download a Flash image!\n");
return 1; return 1;
} }
...@@ -333,20 +336,20 @@ static int prism2_fwapply(const struct ihex_binrec *rfptr, wlandevice_t *wlandev ...@@ -333,20 +336,20 @@ static int prism2_fwapply(const struct ihex_binrec *rfptr, wlandevice_t *wlandev
/* Do any plugging */ /* Do any plugging */
result = plugimage(fchunk, nfchunks, s3plug, ns3plug, &pda); result = plugimage(fchunk, nfchunks, s3plug, ns3plug, &pda);
if (result) { if (result) {
printk(KERN_ERR "Failed to plug data.\n"); netdev_err(wlandev->netdev, "Failed to plug data.\n");
return 1; return 1;
} }
/* Insert any CRCs */ /* Insert any CRCs */
if (crcimage(fchunk, nfchunks, s3crc, ns3crc)) { if (crcimage(fchunk, nfchunks, s3crc, ns3crc)) {
printk(KERN_ERR "Failed to insert all CRCs\n"); netdev_err(wlandev->netdev, "Failed to insert all CRCs\n");
return 1; return 1;
} }
/* Write the image */ /* Write the image */
result = writeimage(wlandev, fchunk, nfchunks); result = writeimage(wlandev, fchunk, nfchunks);
if (result) { if (result) {
printk(KERN_ERR "Failed to ramwrite image data.\n"); netdev_err(wlandev->netdev, "Failed to ramwrite image data.\n");
return 1; return 1;
} }
...@@ -354,7 +357,7 @@ static int prism2_fwapply(const struct ihex_binrec *rfptr, wlandevice_t *wlandev ...@@ -354,7 +357,7 @@ static int prism2_fwapply(const struct ihex_binrec *rfptr, wlandevice_t *wlandev
free_chunks(fchunk, &nfchunks); free_chunks(fchunk, &nfchunks);
free_srecs(); free_srecs();
printk(KERN_INFO "prism2_usb: firmware loading finished.\n"); netdev_info(wlandev->netdev, "prism2_usb: firmware loading finished.\n");
return result; return result;
} }
...@@ -410,8 +413,7 @@ static int crcimage(struct imgchunk *fchunk, unsigned int nfchunks, ...@@ -410,8 +413,7 @@ static int crcimage(struct imgchunk *fchunk, unsigned int nfchunks,
break; break;
} }
if (c >= nfchunks) { if (c >= nfchunks) {
printk(KERN_ERR pr_err("Failed to find chunk for "
"Failed to find chunk for "
"crcrec[%d], addr=0x%06x len=%d , " "crcrec[%d], addr=0x%06x len=%d , "
"aborting crc.\n", "aborting crc.\n",
i, s3crc[i].addr, s3crc[i].len); i, s3crc[i].addr, s3crc[i].len);
...@@ -537,8 +539,7 @@ static int mkimage(struct imgchunk *clist, unsigned int *ccnt) ...@@ -537,8 +539,7 @@ static int mkimage(struct imgchunk *clist, unsigned int *ccnt)
for (i = 0; i < *ccnt; i++) { for (i = 0; i < *ccnt; i++) {
clist[i].data = kzalloc(clist[i].len, GFP_KERNEL); clist[i].data = kzalloc(clist[i].len, GFP_KERNEL);
if (clist[i].data == NULL) { if (clist[i].data == NULL) {
printk(KERN_ERR pr_err("failed to allocate image space, exitting.\n");
"failed to allocate image space, exitting.\n");
return 1; return 1;
} }
pr_debug("chunk[%d]: addr=0x%06x len=%d\n", pr_debug("chunk[%d]: addr=0x%06x len=%d\n",
...@@ -556,8 +557,7 @@ static int mkimage(struct imgchunk *clist, unsigned int *ccnt) ...@@ -556,8 +557,7 @@ static int mkimage(struct imgchunk *clist, unsigned int *ccnt)
break; break;
} }
if (((unsigned int)j) >= (*ccnt)) { if (((unsigned int)j) >= (*ccnt)) {
printk(KERN_ERR pr_err("s3rec(a=0x%06x,l=%d), no chunk match, exiting.\n",
"s3rec(a=0x%06x,l=%d), no chunk match, exiting.\n",
s3start, s3data[i].len); s3start, s3data[i].len);
return 1; return 1;
} }
...@@ -627,8 +627,7 @@ static int mkpdrlist(struct pda *pda) ...@@ -627,8 +627,7 @@ static int mkpdrlist(struct pda *pda)
} }
if (curroff >= (HFA384x_PDA_LEN_MAX / 2)) { if (curroff >= (HFA384x_PDA_LEN_MAX / 2)) {
printk(KERN_ERR pr_err("no end record found or invalid lengths in "
"no end record found or invalid lengths in "
"PDR data, exiting. %x %d\n", curroff, pda->nrec); "PDR data, exiting. %x %d\n", curroff, pda->nrec);
return 1; return 1;
} }
...@@ -685,8 +684,7 @@ static int plugimage(struct imgchunk *fchunk, unsigned int nfchunks, ...@@ -685,8 +684,7 @@ static int plugimage(struct imgchunk *fchunk, unsigned int nfchunks,
j = -1; j = -1;
} }
if (j >= pda->nrec && j != -1) { /* if no matching PDR, fail */ if (j >= pda->nrec && j != -1) { /* if no matching PDR, fail */
printk(KERN_WARNING pr_warn("warning: Failed to find PDR for "
"warning: Failed to find PDR for "
"plugrec 0x%04x.\n", s3plug[i].itemcode); "plugrec 0x%04x.\n", s3plug[i].itemcode);
continue; /* and move on to the next PDR */ continue; /* and move on to the next PDR */
#if 0 #if 0
...@@ -704,8 +702,7 @@ static int plugimage(struct imgchunk *fchunk, unsigned int nfchunks, ...@@ -704,8 +702,7 @@ static int plugimage(struct imgchunk *fchunk, unsigned int nfchunks,
/* Validate plug len against PDR len */ /* Validate plug len against PDR len */
if (j != -1 && s3plug[i].len < le16_to_cpu(pda->rec[j]->len)) { if (j != -1 && s3plug[i].len < le16_to_cpu(pda->rec[j]->len)) {
printk(KERN_ERR pr_err("error: Plug vs. PDR len mismatch for "
"error: Plug vs. PDR len mismatch for "
"plugrec 0x%04x, abort plugging.\n", "plugrec 0x%04x, abort plugging.\n",
s3plug[i].itemcode); s3plug[i].itemcode);
result = 1; result = 1;
...@@ -720,8 +717,7 @@ static int plugimage(struct imgchunk *fchunk, unsigned int nfchunks, ...@@ -720,8 +717,7 @@ static int plugimage(struct imgchunk *fchunk, unsigned int nfchunks,
break; break;
} }
if (c >= nfchunks) { if (c >= nfchunks) {
printk(KERN_ERR pr_err("error: Failed to find image chunk for "
"error: Failed to find image chunk for "
"plugrec 0x%04x.\n", s3plug[i].itemcode); "plugrec 0x%04x.\n", s3plug[i].itemcode);
result = 1; result = 1;
continue; continue;
...@@ -898,7 +894,7 @@ static int read_fwfile(const struct ihex_binrec *record) ...@@ -898,7 +894,7 @@ static int read_fwfile(const struct ihex_binrec *record)
ns3plug++; ns3plug++;
if (ns3plug == S3PLUG_MAX) { if (ns3plug == S3PLUG_MAX) {
printk(KERN_ERR "S3 plugrec limit reached - aborting\n"); pr_err("S3 plugrec limit reached - aborting\n");
return 1; return 1;
} }
break; break;
...@@ -915,7 +911,7 @@ static int read_fwfile(const struct ihex_binrec *record) ...@@ -915,7 +911,7 @@ static int read_fwfile(const struct ihex_binrec *record)
s3crc[ns3crc].dowrite); s3crc[ns3crc].dowrite);
ns3crc++; ns3crc++;
if (ns3crc == S3CRC_MAX) { if (ns3crc == S3CRC_MAX) {
printk(KERN_ERR "S3 crcrec limit reached - aborting\n"); pr_err("S3 crcrec limit reached - aborting\n");
return 1; return 1;
} }
break; break;
...@@ -929,7 +925,7 @@ static int read_fwfile(const struct ihex_binrec *record) ...@@ -929,7 +925,7 @@ static int read_fwfile(const struct ihex_binrec *record)
s3info[ns3info].len, s3info[ns3info].len,
s3info[ns3info].type); s3info[ns3info].type);
if (((s3info[ns3info].len - 1) * sizeof(u16)) > sizeof(s3info[ns3info].info)) { if (((s3info[ns3info].len - 1) * sizeof(u16)) > sizeof(s3info[ns3info].info)) {
printk(KERN_ERR " S3 inforec length too long - aborting\n"); pr_err("S3 inforec length too long - aborting\n");
return 1; return 1;
} }
...@@ -943,7 +939,7 @@ static int read_fwfile(const struct ihex_binrec *record) ...@@ -943,7 +939,7 @@ static int read_fwfile(const struct ihex_binrec *record)
ns3info++; ns3info++;
if (ns3info == S3INFO_MAX) { if (ns3info == S3INFO_MAX) {
printk(KERN_ERR "S3 inforec limit reached - aborting\n"); pr_err("S3 inforec limit reached - aborting\n");
return 1; return 1;
} }
break; break;
...@@ -953,7 +949,7 @@ static int read_fwfile(const struct ihex_binrec *record) ...@@ -953,7 +949,7 @@ static int read_fwfile(const struct ihex_binrec *record)
s3data[ns3data].data = (uint8_t *) record->data; s3data[ns3data].data = (uint8_t *) record->data;
ns3data++; ns3data++;
if (ns3data == S3DATA_MAX) { if (ns3data == S3DATA_MAX) {
printk(KERN_ERR "S3 datarec limit reached - aborting\n"); pr_err("S3 datarec limit reached - aborting\n");
return 1; return 1;
} }
break; break;
...@@ -997,9 +993,9 @@ static int writeimage(wlandevice_t *wlandev, struct imgchunk *fchunk, ...@@ -997,9 +993,9 @@ static int writeimage(wlandevice_t *wlandev, struct imgchunk *fchunk,
if (!rstmsg || !rwrmsg) { if (!rstmsg || !rwrmsg) {
kfree(rstmsg); kfree(rstmsg);
kfree(rwrmsg); kfree(rwrmsg);
printk(KERN_ERR netdev_err(wlandev->netdev,
"writeimage: no memory for firmware download, " "writeimage: no memory for firmware download, "
"aborting download\n"); "aborting download\n");
return -ENOMEM; return -ENOMEM;
} }
...@@ -1042,16 +1038,16 @@ static int writeimage(wlandevice_t *wlandev, struct imgchunk *fchunk, ...@@ -1042,16 +1038,16 @@ static int writeimage(wlandevice_t *wlandev, struct imgchunk *fchunk,
result = prism2mgmt_ramdl_state(wlandev, rstmsg); result = prism2mgmt_ramdl_state(wlandev, rstmsg);
if (result) { if (result) {
printk(KERN_ERR netdev_err(wlandev->netdev,
"writeimage state enable failed w/ result=%d, " "writeimage state enable failed w/ result=%d, "
"aborting download\n", result); "aborting download\n", result);
goto free_result; goto free_result;
} }
resultcode = rstmsg->resultcode.data; resultcode = rstmsg->resultcode.data;
if (resultcode != P80211ENUM_resultcode_success) { if (resultcode != P80211ENUM_resultcode_success) {
printk(KERN_ERR netdev_err(wlandev->netdev,
"writeimage()->xxxdl_state msg indicates failure, " "writeimage()->xxxdl_state msg indicates failure, "
"w/ resultcode=%d, aborting download.\n", resultcode); "w/ resultcode=%d, aborting download.\n", resultcode);
result = 1; result = 1;
goto free_result; goto free_result;
} }
...@@ -1085,15 +1081,14 @@ static int writeimage(wlandevice_t *wlandev, struct imgchunk *fchunk, ...@@ -1085,15 +1081,14 @@ static int writeimage(wlandevice_t *wlandev, struct imgchunk *fchunk,
/* Check the results */ /* Check the results */
if (result) { if (result) {
printk(KERN_ERR netdev_err(wlandev->netdev,
"writeimage chunk write failed w/ result=%d, " "writeimage chunk write failed w/ "
"aborting download\n", result); "result=%d, aborting download\n", result);
goto free_result; goto free_result;
} }
resultcode = rstmsg->resultcode.data; resultcode = rstmsg->resultcode.data;
if (resultcode != P80211ENUM_resultcode_success) { if (resultcode != P80211ENUM_resultcode_success) {
printk(KERN_ERR pr_err("writeimage()->xxxdl_write msg indicates failure, "
"writeimage()->xxxdl_write msg indicates failure, "
"w/ resultcode=%d, aborting download.\n", "w/ resultcode=%d, aborting download.\n",
resultcode); resultcode);
result = 1; result = 1;
...@@ -1110,16 +1105,16 @@ static int writeimage(wlandevice_t *wlandev, struct imgchunk *fchunk, ...@@ -1110,16 +1105,16 @@ static int writeimage(wlandevice_t *wlandev, struct imgchunk *fchunk,
result = prism2mgmt_ramdl_state(wlandev, rstmsg); result = prism2mgmt_ramdl_state(wlandev, rstmsg);
if (result) { if (result) {
printk(KERN_ERR netdev_err(wlandev->netdev,
"writeimage state disable failed w/ result=%d, " "writeimage state disable failed w/ result=%d, "
"aborting download\n", result); "aborting download\n", result);
goto free_result; goto free_result;
} }
resultcode = rstmsg->resultcode.data; resultcode = rstmsg->resultcode.data;
if (resultcode != P80211ENUM_resultcode_success) { if (resultcode != P80211ENUM_resultcode_success) {
printk(KERN_ERR netdev_err(wlandev->netdev,
"writeimage()->xxxdl_state msg indicates failure, " "writeimage()->xxxdl_state msg indicates failure, "
"w/ resultcode=%d, aborting download.\n", resultcode); "w/ resultcode=%d, aborting download.\n", resultcode);
result = 1; result = 1;
goto free_result; goto free_result;
} }
......
...@@ -129,8 +129,8 @@ int prism2mgmt_scan(wlandevice_t *wlandev, void *msgp) ...@@ -129,8 +129,8 @@ int prism2mgmt_scan(wlandevice_t *wlandev, void *msgp)
hw->ident_sta_fw.minor, hw->ident_sta_fw.minor,
hw->ident_sta_fw.variant) < hw->ident_sta_fw.variant) <
HFA384x_FIRMWARE_VERSION(1, 3, 2)) { HFA384x_FIRMWARE_VERSION(1, 3, 2)) {
printk(KERN_ERR netdev_err(wlandev->netdev,
"HostScan not supported with current firmware (<1.3.2).\n"); "HostScan not supported with current firmware (<1.3.2).\n");
result = 1; result = 1;
msg->resultcode.data = P80211ENUM_resultcode_not_supported; msg->resultcode.data = P80211ENUM_resultcode_not_supported;
goto exit; goto exit;
...@@ -143,8 +143,8 @@ int prism2mgmt_scan(wlandevice_t *wlandev, void *msgp) ...@@ -143,8 +143,8 @@ int prism2mgmt_scan(wlandevice_t *wlandev, void *msgp)
HFA384x_RID_CNFROAMINGMODE, HFA384x_RID_CNFROAMINGMODE,
&roamingmode); &roamingmode);
if (result) { if (result) {
printk(KERN_ERR "getconfig(ROAMMODE) failed. result=%d\n", netdev_err(wlandev->netdev,
result); "getconfig(ROAMMODE) failed. result=%d\n", result);
msg->resultcode.data = msg->resultcode.data =
P80211ENUM_resultcode_implementation_failure; P80211ENUM_resultcode_implementation_failure;
goto exit; goto exit;
...@@ -155,8 +155,8 @@ int prism2mgmt_scan(wlandevice_t *wlandev, void *msgp) ...@@ -155,8 +155,8 @@ int prism2mgmt_scan(wlandevice_t *wlandev, void *msgp)
HFA384x_RID_CNFROAMINGMODE, HFA384x_RID_CNFROAMINGMODE,
HFA384x_ROAMMODE_HOSTSCAN_HOSTROAM); HFA384x_ROAMMODE_HOSTSCAN_HOSTROAM);
if (result) { if (result) {
printk(KERN_ERR "setconfig(ROAMINGMODE) failed. result=%d\n", netdev_err(wlandev->netdev,
result); "setconfig(ROAMINGMODE) failed. result=%d\n", result);
msg->resultcode.data = msg->resultcode.data =
P80211ENUM_resultcode_implementation_failure; P80211ENUM_resultcode_implementation_failure;
goto exit; goto exit;
...@@ -176,8 +176,9 @@ int prism2mgmt_scan(wlandevice_t *wlandev, void *msgp) ...@@ -176,8 +176,9 @@ int prism2mgmt_scan(wlandevice_t *wlandev, void *msgp)
hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFPASSIVESCANCTRL, hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFPASSIVESCANCTRL,
word); word);
if (result) { if (result) {
printk(KERN_WARNING "Passive scan not supported with " netdev_warn(wlandev->netdev,
"current firmware. (<1.5.1)\n"); "Passive scan not supported with "
"current firmware. (<1.5.1)\n");
} }
} }
...@@ -203,8 +204,8 @@ int prism2mgmt_scan(wlandevice_t *wlandev, void *msgp) ...@@ -203,8 +204,8 @@ int prism2mgmt_scan(wlandevice_t *wlandev, void *msgp)
/* Enable the MAC port if it's not already enabled */ /* Enable the MAC port if it's not already enabled */
result = hfa384x_drvr_getconfig16(hw, HFA384x_RID_PORTSTATUS, &word); result = hfa384x_drvr_getconfig16(hw, HFA384x_RID_PORTSTATUS, &word);
if (result) { if (result) {
printk(KERN_ERR "getconfig(PORTSTATUS) failed. " netdev_err(wlandev->netdev,
"result=%d\n", result); "getconfig(PORTSTATUS) failed. result=%d\n", result);
msg->resultcode.data = msg->resultcode.data =
P80211ENUM_resultcode_implementation_failure; P80211ENUM_resultcode_implementation_failure;
goto exit; goto exit;
...@@ -216,9 +217,9 @@ int prism2mgmt_scan(wlandevice_t *wlandev, void *msgp) ...@@ -216,9 +217,9 @@ int prism2mgmt_scan(wlandevice_t *wlandev, void *msgp)
HFA384x_RID_CNFROAMINGMODE, HFA384x_RID_CNFROAMINGMODE,
HFA384x_ROAMMODE_HOSTSCAN_HOSTROAM); HFA384x_ROAMMODE_HOSTSCAN_HOSTROAM);
if (result) { if (result) {
printk(KERN_ERR netdev_err(wlandev->netdev,
"setconfig(ROAMINGMODE) failed. result=%d\n", "setconfig(ROAMINGMODE) failed. result=%d\n",
result); result);
msg->resultcode.data = msg->resultcode.data =
P80211ENUM_resultcode_implementation_failure; P80211ENUM_resultcode_implementation_failure;
goto exit; goto exit;
...@@ -232,7 +233,7 @@ int prism2mgmt_scan(wlandevice_t *wlandev, void *msgp) ...@@ -232,7 +233,7 @@ int prism2mgmt_scan(wlandevice_t *wlandev, void *msgp)
wordbuf, wordbuf,
HFA384x_RID_CNFOWNSSID_LEN); HFA384x_RID_CNFOWNSSID_LEN);
if (result) { if (result) {
printk(KERN_ERR "Failed to set OwnSSID.\n"); netdev_err(wlandev->netdev, "Failed to set OwnSSID.\n");
msg->resultcode.data = msg->resultcode.data =
P80211ENUM_resultcode_implementation_failure; P80211ENUM_resultcode_implementation_failure;
goto exit; goto exit;
...@@ -241,7 +242,8 @@ int prism2mgmt_scan(wlandevice_t *wlandev, void *msgp) ...@@ -241,7 +242,8 @@ int prism2mgmt_scan(wlandevice_t *wlandev, void *msgp)
wordbuf, wordbuf,
HFA384x_RID_CNFDESIREDSSID_LEN); HFA384x_RID_CNFDESIREDSSID_LEN);
if (result) { if (result) {
printk(KERN_ERR "Failed to set DesiredSSID.\n"); netdev_err(wlandev->netdev,
"Failed to set DesiredSSID.\n");
msg->resultcode.data = msg->resultcode.data =
P80211ENUM_resultcode_implementation_failure; P80211ENUM_resultcode_implementation_failure;
goto exit; goto exit;
...@@ -251,7 +253,8 @@ int prism2mgmt_scan(wlandevice_t *wlandev, void *msgp) ...@@ -251,7 +253,8 @@ int prism2mgmt_scan(wlandevice_t *wlandev, void *msgp)
HFA384x_RID_CNFPORTTYPE, HFA384x_RID_CNFPORTTYPE,
HFA384x_PORTTYPE_IBSS); HFA384x_PORTTYPE_IBSS);
if (result) { if (result) {
printk(KERN_ERR "Failed to set CNFPORTTYPE.\n"); netdev_err(wlandev->netdev,
"Failed to set CNFPORTTYPE.\n");
msg->resultcode.data = msg->resultcode.data =
P80211ENUM_resultcode_implementation_failure; P80211ENUM_resultcode_implementation_failure;
goto exit; goto exit;
...@@ -261,15 +264,16 @@ int prism2mgmt_scan(wlandevice_t *wlandev, void *msgp) ...@@ -261,15 +264,16 @@ int prism2mgmt_scan(wlandevice_t *wlandev, void *msgp)
HFA384x_RID_CREATEIBSS, HFA384x_RID_CREATEIBSS,
HFA384x_CREATEIBSS_JOINCREATEIBSS); HFA384x_CREATEIBSS_JOINCREATEIBSS);
if (result) { if (result) {
printk(KERN_ERR "Failed to set CREATEIBSS.\n"); netdev_err(wlandev->netdev,
"Failed to set CREATEIBSS.\n");
msg->resultcode.data = msg->resultcode.data =
P80211ENUM_resultcode_implementation_failure; P80211ENUM_resultcode_implementation_failure;
goto exit; goto exit;
} }
result = hfa384x_drvr_enable(hw, 0); result = hfa384x_drvr_enable(hw, 0);
if (result) { if (result) {
printk(KERN_ERR "drvr_enable(0) failed. " netdev_err(wlandev->netdev,
"result=%d\n", result); "drvr_enable(0) failed. result=%d\n", result);
msg->resultcode.data = msg->resultcode.data =
P80211ENUM_resultcode_implementation_failure; P80211ENUM_resultcode_implementation_failure;
goto exit; goto exit;
...@@ -288,8 +292,8 @@ int prism2mgmt_scan(wlandevice_t *wlandev, void *msgp) ...@@ -288,8 +292,8 @@ int prism2mgmt_scan(wlandevice_t *wlandev, void *msgp)
HFA384x_RID_HOSTSCAN, &scanreq, HFA384x_RID_HOSTSCAN, &scanreq,
sizeof(hfa384x_HostScanRequest_data_t)); sizeof(hfa384x_HostScanRequest_data_t));
if (result) { if (result) {
printk(KERN_ERR "setconfig(SCANREQUEST) failed. result=%d\n", netdev_err(wlandev->netdev,
result); "setconfig(SCANREQUEST) failed. result=%d\n", result);
msg->resultcode.data = msg->resultcode.data =
P80211ENUM_resultcode_implementation_failure; P80211ENUM_resultcode_implementation_failure;
goto exit; goto exit;
...@@ -310,8 +314,8 @@ int prism2mgmt_scan(wlandevice_t *wlandev, void *msgp) ...@@ -310,8 +314,8 @@ int prism2mgmt_scan(wlandevice_t *wlandev, void *msgp)
if (istmpenable) { if (istmpenable) {
result = hfa384x_drvr_disable(hw, 0); result = hfa384x_drvr_disable(hw, 0);
if (result) { if (result) {
printk(KERN_ERR "drvr_disable(0) failed. " netdev_err(wlandev->netdev,
"result=%d\n", result); "drvr_disable(0) failed. result=%d\n", result);
msg->resultcode.data = msg->resultcode.data =
P80211ENUM_resultcode_implementation_failure; P80211ENUM_resultcode_implementation_failure;
goto exit; goto exit;
...@@ -322,8 +326,8 @@ int prism2mgmt_scan(wlandevice_t *wlandev, void *msgp) ...@@ -322,8 +326,8 @@ int prism2mgmt_scan(wlandevice_t *wlandev, void *msgp)
result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFROAMINGMODE, result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFROAMINGMODE,
roamingmode); roamingmode);
if (result) { if (result) {
printk(KERN_ERR "setconfig(ROAMMODE) failed. result=%d\n", netdev_err(wlandev->netdev,
result); "setconfig(ROAMMODE) failed. result=%d\n", result);
msg->resultcode.data = msg->resultcode.data =
P80211ENUM_resultcode_implementation_failure; P80211ENUM_resultcode_implementation_failure;
goto exit; goto exit;
...@@ -372,8 +376,9 @@ int prism2mgmt_scan_results(wlandevice_t *wlandev, void *msgp) ...@@ -372,8 +376,9 @@ int prism2mgmt_scan_results(wlandevice_t *wlandev, void *msgp)
req->resultcode.status = P80211ENUM_msgitem_status_data_ok; req->resultcode.status = P80211ENUM_msgitem_status_data_ok;
if (!hw->scanresults) { if (!hw->scanresults) {
printk(KERN_ERR netdev_err(wlandev->netdev,
"dot11req_scan_results can only be used after a successful dot11req_scan.\n"); "dot11req_scan_results can only be used after "
"a successful dot11req_scan.\n");
result = 2; result = 2;
req->resultcode.data = P80211ENUM_resultcode_invalid_parameters; req->resultcode.data = P80211ENUM_resultcode_invalid_parameters;
goto exit; goto exit;
...@@ -555,14 +560,14 @@ int prism2mgmt_start(wlandevice_t *wlandev, void *msgp) ...@@ -555,14 +560,14 @@ int prism2mgmt_start(wlandevice_t *wlandev, void *msgp)
result = hfa384x_drvr_setconfig(hw, HFA384x_RID_CNFOWNSSID, result = hfa384x_drvr_setconfig(hw, HFA384x_RID_CNFOWNSSID,
bytebuf, HFA384x_RID_CNFOWNSSID_LEN); bytebuf, HFA384x_RID_CNFOWNSSID_LEN);
if (result) { if (result) {
printk(KERN_ERR "Failed to set CnfOwnSSID\n"); netdev_err(wlandev->netdev, "Failed to set CnfOwnSSID\n");
goto failed; goto failed;
} }
result = hfa384x_drvr_setconfig(hw, HFA384x_RID_CNFDESIREDSSID, result = hfa384x_drvr_setconfig(hw, HFA384x_RID_CNFDESIREDSSID,
bytebuf, bytebuf,
HFA384x_RID_CNFDESIREDSSID_LEN); HFA384x_RID_CNFDESIREDSSID_LEN);
if (result) { if (result) {
printk(KERN_ERR "Failed to set CnfDesiredSSID\n"); netdev_err(wlandev->netdev, "Failed to set CnfDesiredSSID\n");
goto failed; goto failed;
} }
...@@ -574,7 +579,8 @@ int prism2mgmt_start(wlandevice_t *wlandev, void *msgp) ...@@ -574,7 +579,8 @@ int prism2mgmt_start(wlandevice_t *wlandev, void *msgp)
word = msg->beaconperiod.data; word = msg->beaconperiod.data;
result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFAPBCNint, word); result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFAPBCNint, word);
if (result) { if (result) {
printk(KERN_ERR "Failed to set beacon period=%d.\n", word); netdev_err(wlandev->netdev,
"Failed to set beacon period=%d.\n", word);
goto failed; goto failed;
} }
...@@ -582,7 +588,8 @@ int prism2mgmt_start(wlandevice_t *wlandev, void *msgp) ...@@ -582,7 +588,8 @@ int prism2mgmt_start(wlandevice_t *wlandev, void *msgp)
word = msg->dschannel.data; word = msg->dschannel.data;
result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFOWNCHANNEL, word); result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFOWNCHANNEL, word);
if (result) { if (result) {
printk(KERN_ERR "Failed to set channel=%d.\n", word); netdev_err(wlandev->netdev,
"Failed to set channel=%d.\n", word);
goto failed; goto failed;
} }
/* Basic rates */ /* Basic rates */
...@@ -610,7 +617,8 @@ int prism2mgmt_start(wlandevice_t *wlandev, void *msgp) ...@@ -610,7 +617,8 @@ int prism2mgmt_start(wlandevice_t *wlandev, void *msgp)
result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFBASICRATES, word); result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFBASICRATES, word);
if (result) { if (result) {
printk(KERN_ERR "Failed to set basicrates=%d.\n", word); netdev_err(wlandev->netdev,
"Failed to set basicrates=%d.\n", word);
goto failed; goto failed;
} }
...@@ -639,13 +647,14 @@ int prism2mgmt_start(wlandevice_t *wlandev, void *msgp) ...@@ -639,13 +647,14 @@ int prism2mgmt_start(wlandevice_t *wlandev, void *msgp)
result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFSUPPRATES, word); result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFSUPPRATES, word);
if (result) { if (result) {
printk(KERN_ERR "Failed to set supprates=%d.\n", word); netdev_err(wlandev->netdev,
"Failed to set supprates=%d.\n", word);
goto failed; goto failed;
} }
result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_TXRATECNTL, word); result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_TXRATECNTL, word);
if (result) { if (result) {
printk(KERN_ERR "Failed to set txrates=%d.\n", word); netdev_err(wlandev->netdev, "Failed to set txrates=%d.\n", word);
goto failed; goto failed;
} }
...@@ -659,7 +668,8 @@ int prism2mgmt_start(wlandevice_t *wlandev, void *msgp) ...@@ -659,7 +668,8 @@ int prism2mgmt_start(wlandevice_t *wlandev, void *msgp)
/* Enable the Port */ /* Enable the Port */
result = hfa384x_drvr_enable(hw, 0); result = hfa384x_drvr_enable(hw, 0);
if (result) { if (result) {
printk(KERN_ERR "Enable macport failed, result=%d.\n", result); netdev_err(wlandev->netdev,
"Enable macport failed, result=%d.\n", result);
goto failed; goto failed;
} }
...@@ -704,8 +714,8 @@ int prism2mgmt_readpda(wlandevice_t *wlandev, void *msgp) ...@@ -704,8 +714,8 @@ int prism2mgmt_readpda(wlandevice_t *wlandev, void *msgp)
* state. * state.
*/ */
if (wlandev->msdstate != WLAN_MSD_FWLOAD) { if (wlandev->msdstate != WLAN_MSD_FWLOAD) {
printk(KERN_ERR netdev_err(wlandev->netdev,
"PDA may only be read " "in the fwload state.\n"); "PDA may only be read in the fwload state.\n");
msg->resultcode.data = msg->resultcode.data =
P80211ENUM_resultcode_implementation_failure; P80211ENUM_resultcode_implementation_failure;
msg->resultcode.status = P80211ENUM_msgitem_status_data_ok; msg->resultcode.status = P80211ENUM_msgitem_status_data_ok;
...@@ -717,9 +727,9 @@ int prism2mgmt_readpda(wlandevice_t *wlandev, void *msgp) ...@@ -717,9 +727,9 @@ int prism2mgmt_readpda(wlandevice_t *wlandev, void *msgp)
msg->pda.data, msg->pda.data,
HFA384x_PDA_LEN_MAX); HFA384x_PDA_LEN_MAX);
if (result) { if (result) {
printk(KERN_ERR netdev_err(wlandev->netdev,
"hfa384x_drvr_readpda() failed, " "hfa384x_drvr_readpda() failed, "
"result=%d\n", result); "result=%d\n", result);
msg->resultcode.data = msg->resultcode.data =
P80211ENUM_resultcode_implementation_failure; P80211ENUM_resultcode_implementation_failure;
...@@ -766,9 +776,9 @@ int prism2mgmt_ramdl_state(wlandevice_t *wlandev, void *msgp) ...@@ -766,9 +776,9 @@ int prism2mgmt_ramdl_state(wlandevice_t *wlandev, void *msgp)
struct p80211msg_p2req_ramdl_state *msg = msgp; struct p80211msg_p2req_ramdl_state *msg = msgp;
if (wlandev->msdstate != WLAN_MSD_FWLOAD) { if (wlandev->msdstate != WLAN_MSD_FWLOAD) {
printk(KERN_ERR netdev_err(wlandev->netdev,
"ramdl_state(): may only be called " "ramdl_state(): may only be called "
"in the fwload state.\n"); "in the fwload state.\n");
msg->resultcode.data = msg->resultcode.data =
P80211ENUM_resultcode_implementation_failure; P80211ENUM_resultcode_implementation_failure;
msg->resultcode.status = P80211ENUM_msgitem_status_data_ok; msg->resultcode.status = P80211ENUM_msgitem_status_data_ok;
...@@ -825,9 +835,9 @@ int prism2mgmt_ramdl_write(wlandevice_t *wlandev, void *msgp) ...@@ -825,9 +835,9 @@ int prism2mgmt_ramdl_write(wlandevice_t *wlandev, void *msgp)
u8 *buf; u8 *buf;
if (wlandev->msdstate != WLAN_MSD_FWLOAD) { if (wlandev->msdstate != WLAN_MSD_FWLOAD) {
printk(KERN_ERR netdev_err(wlandev->netdev,
"ramdl_write(): may only be called " "ramdl_write(): may only be called "
"in the fwload state.\n"); "in the fwload state.\n");
msg->resultcode.data = msg->resultcode.data =
P80211ENUM_resultcode_implementation_failure; P80211ENUM_resultcode_implementation_failure;
msg->resultcode.status = P80211ENUM_msgitem_status_data_ok; msg->resultcode.status = P80211ENUM_msgitem_status_data_ok;
...@@ -885,9 +895,9 @@ int prism2mgmt_flashdl_state(wlandevice_t *wlandev, void *msgp) ...@@ -885,9 +895,9 @@ int prism2mgmt_flashdl_state(wlandevice_t *wlandev, void *msgp)
struct p80211msg_p2req_flashdl_state *msg = msgp; struct p80211msg_p2req_flashdl_state *msg = msgp;
if (wlandev->msdstate != WLAN_MSD_FWLOAD) { if (wlandev->msdstate != WLAN_MSD_FWLOAD) {
printk(KERN_ERR netdev_err(wlandev->netdev,
"flashdl_state(): may only be called " "flashdl_state(): may only be called "
"in the fwload state.\n"); "in the fwload state.\n");
msg->resultcode.data = msg->resultcode.data =
P80211ENUM_resultcode_implementation_failure; P80211ENUM_resultcode_implementation_failure;
msg->resultcode.status = P80211ENUM_msgitem_status_data_ok; msg->resultcode.status = P80211ENUM_msgitem_status_data_ok;
...@@ -920,8 +930,9 @@ int prism2mgmt_flashdl_state(wlandevice_t *wlandev, void *msgp) ...@@ -920,8 +930,9 @@ int prism2mgmt_flashdl_state(wlandevice_t *wlandev, void *msgp)
wlandev->msdstate = WLAN_MSD_HWPRESENT; wlandev->msdstate = WLAN_MSD_HWPRESENT;
result = prism2sta_ifstate(wlandev, P80211ENUM_ifstate_fwload); result = prism2sta_ifstate(wlandev, P80211ENUM_ifstate_fwload);
if (result != P80211ENUM_resultcode_success) { if (result != P80211ENUM_resultcode_success) {
printk(KERN_ERR "prism2sta_ifstate(fwload) failed," netdev_err(wlandev->netdev,
"P80211ENUM_resultcode=%d\n", result); "prism2sta_ifstate(fwload) failed,"
"P80211ENUM_resultcode=%d\n", result);
msg->resultcode.data = msg->resultcode.data =
P80211ENUM_resultcode_implementation_failure; P80211ENUM_resultcode_implementation_failure;
result = -1; result = -1;
...@@ -958,9 +969,9 @@ int prism2mgmt_flashdl_write(wlandevice_t *wlandev, void *msgp) ...@@ -958,9 +969,9 @@ int prism2mgmt_flashdl_write(wlandevice_t *wlandev, void *msgp)
u8 *buf; u8 *buf;
if (wlandev->msdstate != WLAN_MSD_FWLOAD) { if (wlandev->msdstate != WLAN_MSD_FWLOAD) {
printk(KERN_ERR netdev_err(wlandev->netdev,
"flashdl_write(): may only be called " "flashdl_write(): may only be called "
"in the fwload state.\n"); "in the fwload state.\n");
msg->resultcode.data = msg->resultcode.data =
P80211ENUM_resultcode_implementation_failure; P80211ENUM_resultcode_implementation_failure;
msg->resultcode.status = P80211ENUM_msgitem_status_data_ok; msg->resultcode.status = P80211ENUM_msgitem_status_data_ok;
...@@ -1153,7 +1164,7 @@ int prism2mgmt_wlansniff(wlandevice_t *wlandev, void *msgp) ...@@ -1153,7 +1164,7 @@ int prism2mgmt_wlansniff(wlandevice_t *wlandev, void *msgp)
} }
printk(KERN_INFO "monitor mode disabled\n"); netdev_info(wlandev->netdev, "monitor mode disabled\n");
msg->resultcode.data = P80211ENUM_resultcode_success; msg->resultcode.data = P80211ENUM_resultcode_success;
result = 0; result = 0;
goto exit; goto exit;
...@@ -1282,7 +1293,7 @@ int prism2mgmt_wlansniff(wlandevice_t *wlandev, void *msgp) ...@@ -1282,7 +1293,7 @@ int prism2mgmt_wlansniff(wlandevice_t *wlandev, void *msgp)
} }
if (wlandev->netdev->type == ARPHRD_ETHER) if (wlandev->netdev->type == ARPHRD_ETHER)
printk(KERN_INFO "monitor mode enabled\n"); netdev_info(wlandev->netdev, "monitor mode enabled\n");
/* Set the driver state */ /* Set the driver state */
/* Do we want the prism2 header? */ /* Do we want the prism2 header? */
......
...@@ -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