diff options
Diffstat (limited to 'drivers/staging/wlan-ng/prism2sta.c')
| -rw-r--r-- | drivers/staging/wlan-ng/prism2sta.c | 250 |
1 files changed, 106 insertions, 144 deletions
diff --git a/drivers/staging/wlan-ng/prism2sta.c b/drivers/staging/wlan-ng/prism2sta.c index ed751f418db..278b6a1ef31 100644 --- a/drivers/staging/wlan-ng/prism2sta.c +++ b/drivers/staging/wlan-ng/prism2sta.c @@ -50,13 +50,11 @@ * -------------------------------------------------------------------- */ -#include <linux/version.h> #include <linux/module.h> #include <linux/moduleparam.h> #include <linux/kernel.h> #include <linux/sched.h> #include <linux/types.h> -#include <linux/init.h> #include <linux/slab.h> #include <linux/wireless.h> #include <linux/netdevice.h> @@ -122,10 +120,6 @@ MODULE_PARM_DESC(prism2_reset_settletime, "reset settle time in ms"); MODULE_LICENSE("Dual MPL/GPL"); -void prism2_connect_result(wlandevice_t *wlandev, u8 failed); -void prism2_disconnected(wlandevice_t *wlandev); -void prism2_roamed(wlandevice_t *wlandev); - static int prism2sta_open(wlandevice_t *wlandev); static int prism2sta_close(wlandevice_t *wlandev); static void prism2sta_reset(wlandevice_t *wlandev); @@ -243,7 +237,6 @@ static int prism2sta_close(wlandevice_t *wlandev) ----------------------------------------------------------------*/ static void prism2sta_reset(wlandevice_t *wlandev) { - return; } /*---------------------------------------------------------------- @@ -408,8 +401,9 @@ static int prism2sta_mlmerequest(wlandevice_t *wlandev, struct p80211msg *msg) break; } default: - printk(KERN_WARNING "Unknown mgmt request message 0x%08x", - msg->msgcode); + netdev_warn(wlandev->netdev, + "Unknown mgmt request message 0x%08x", + msg->msgcode); break; } @@ -457,9 +451,8 @@ u32 prism2sta_ifstate(wlandevice_t *wlandev, u32 ifstate) */ result = hfa384x_drvr_start(hw); if (result) { - printk(KERN_ERR - "hfa384x_drvr_start() failed," - "result=%d\n", (int)result); + netdev_err(wlandev->netdev, + "hfa384x_drvr_start() failed,result=%d\n", (int)result); result = P80211ENUM_resultcode_implementation_failure; wlandev->msdstate = WLAN_MSD_HWPRESENT; @@ -473,7 +466,7 @@ u32 prism2sta_ifstate(wlandevice_t *wlandev, u32 ifstate) result = P80211ENUM_resultcode_success; break; case WLAN_MSD_RUNNING: - printk(KERN_WARNING + netdev_warn(wlandev->netdev, "Cannot enter fwload state from enable state," "you must disable first.\n"); result = P80211ENUM_resultcode_invalid_parameters; @@ -502,9 +495,8 @@ u32 prism2sta_ifstate(wlandevice_t *wlandev, u32 ifstate) */ result = hfa384x_drvr_start(hw); if (result) { - printk(KERN_ERR - "hfa384x_drvr_start() failed," - "result=%d\n", (int)result); + netdev_err(wlandev->netdev, + "hfa384x_drvr_start() failed,result=%d\n", (int)result); result = P80211ENUM_resultcode_implementation_failure; wlandev->msdstate = WLAN_MSD_HWPRESENT; @@ -513,9 +505,8 @@ u32 prism2sta_ifstate(wlandevice_t *wlandev, u32 ifstate) result = prism2sta_getcardinfo(wlandev); if (result) { - printk(KERN_ERR - "prism2sta_getcardinfo() failed," - "result=%d\n", (int)result); + netdev_err(wlandev->netdev, + "prism2sta_getcardinfo() failed,result=%d\n", (int)result); result = P80211ENUM_resultcode_implementation_failure; hfa384x_drvr_stop(hw); @@ -524,9 +515,8 @@ u32 prism2sta_ifstate(wlandevice_t *wlandev, u32 ifstate) } result = prism2sta_globalsetup(wlandev); if (result) { - printk(KERN_ERR - "prism2sta_globalsetup() failed," - "result=%d\n", (int)result); + netdev_err(wlandev->netdev, + "prism2sta_globalsetup() failed,result=%d\n", (int)result); result = P80211ENUM_resultcode_implementation_failure; hfa384x_drvr_stop(hw); @@ -626,7 +616,7 @@ static int prism2sta_getcardinfo(wlandevice_t *wlandev) &hw->ident_nic, sizeof(hfa384x_compident_t)); if (result) { - printk(KERN_ERR "Failed to retrieve NICIDENTITY\n"); + netdev_err(wlandev->netdev, "Failed to retrieve NICIDENTITY\n"); goto failed; } @@ -636,7 +626,7 @@ static int prism2sta_getcardinfo(wlandevice_t *wlandev) hw->ident_nic.major = le16_to_cpu(hw->ident_nic.major); hw->ident_nic.minor = le16_to_cpu(hw->ident_nic.minor); - printk(KERN_INFO "ident: nic h/w: id=0x%02x %d.%d.%d\n", + netdev_info(wlandev->netdev, "ident: nic h/w: id=0x%02x %d.%d.%d\n", hw->ident_nic.id, hw->ident_nic.major, hw->ident_nic.minor, hw->ident_nic.variant); @@ -645,7 +635,7 @@ static int prism2sta_getcardinfo(wlandevice_t *wlandev) &hw->ident_pri_fw, sizeof(hfa384x_compident_t)); if (result) { - printk(KERN_ERR "Failed to retrieve PRIIDENTITY\n"); + netdev_err(wlandev->netdev, "Failed to retrieve PRIIDENTITY\n"); goto failed; } @@ -655,7 +645,7 @@ static int prism2sta_getcardinfo(wlandevice_t *wlandev) hw->ident_pri_fw.major = le16_to_cpu(hw->ident_pri_fw.major); hw->ident_pri_fw.minor = le16_to_cpu(hw->ident_pri_fw.minor); - printk(KERN_INFO "ident: pri f/w: id=0x%02x %d.%d.%d\n", + netdev_info(wlandev->netdev, "ident: pri f/w: id=0x%02x %d.%d.%d\n", hw->ident_pri_fw.id, hw->ident_pri_fw.major, hw->ident_pri_fw.minor, hw->ident_pri_fw.variant); @@ -664,12 +654,12 @@ static int prism2sta_getcardinfo(wlandevice_t *wlandev) &hw->ident_sta_fw, sizeof(hfa384x_compident_t)); if (result) { - printk(KERN_ERR "Failed to retrieve STAIDENTITY\n"); + netdev_err(wlandev->netdev, "Failed to retrieve STAIDENTITY\n"); goto failed; } if (hw->ident_nic.id < 0x8000) { - printk(KERN_ERR + netdev_err(wlandev->netdev, "FATAL: Card is not an Intersil Prism2/2.5/3\n"); result = -1; goto failed; @@ -686,16 +676,16 @@ static int prism2sta_getcardinfo(wlandevice_t *wlandev) hw->ident_sta_fw.variant &= ~((u16) (BIT(14) | BIT(15))); if (hw->ident_sta_fw.id == 0x1f) { - printk(KERN_INFO + netdev_info(wlandev->netdev, "ident: sta f/w: id=0x%02x %d.%d.%d\n", hw->ident_sta_fw.id, hw->ident_sta_fw.major, hw->ident_sta_fw.minor, hw->ident_sta_fw.variant); } else { - printk(KERN_INFO + netdev_info(wlandev->netdev, "ident: ap f/w: id=0x%02x %d.%d.%d\n", hw->ident_sta_fw.id, hw->ident_sta_fw.major, hw->ident_sta_fw.minor, hw->ident_sta_fw.variant); - printk(KERN_ERR "Unsupported Tertiary AP firmeare loaded!\n"); + netdev_err(wlandev->netdev, "Unsupported Tertiary AP firmeare loaded!\n"); goto failed; } @@ -704,7 +694,7 @@ static int prism2sta_getcardinfo(wlandevice_t *wlandev) &hw->cap_sup_mfi, sizeof(hfa384x_caplevel_t)); if (result) { - printk(KERN_ERR "Failed to retrieve MFISUPRANGE\n"); + netdev_err(wlandev->netdev, "Failed to retrieve MFISUPRANGE\n"); goto failed; } @@ -716,7 +706,7 @@ static int prism2sta_getcardinfo(wlandevice_t *wlandev) hw->cap_sup_mfi.bottom = le16_to_cpu(hw->cap_sup_mfi.bottom); hw->cap_sup_mfi.top = le16_to_cpu(hw->cap_sup_mfi.top); - printk(KERN_INFO + netdev_info(wlandev->netdev, "MFI:SUP:role=0x%02x:id=0x%02x:var=0x%02x:b/t=%d/%d\n", hw->cap_sup_mfi.role, hw->cap_sup_mfi.id, hw->cap_sup_mfi.variant, hw->cap_sup_mfi.bottom, @@ -727,7 +717,7 @@ static int prism2sta_getcardinfo(wlandevice_t *wlandev) &hw->cap_sup_cfi, sizeof(hfa384x_caplevel_t)); if (result) { - printk(KERN_ERR "Failed to retrieve CFISUPRANGE\n"); + netdev_err(wlandev->netdev, "Failed to retrieve CFISUPRANGE\n"); goto failed; } @@ -739,7 +729,7 @@ static int prism2sta_getcardinfo(wlandevice_t *wlandev) hw->cap_sup_cfi.bottom = le16_to_cpu(hw->cap_sup_cfi.bottom); hw->cap_sup_cfi.top = le16_to_cpu(hw->cap_sup_cfi.top); - printk(KERN_INFO + netdev_info(wlandev->netdev, "CFI:SUP:role=0x%02x:id=0x%02x:var=0x%02x:b/t=%d/%d\n", hw->cap_sup_cfi.role, hw->cap_sup_cfi.id, hw->cap_sup_cfi.variant, hw->cap_sup_cfi.bottom, @@ -750,7 +740,7 @@ static int prism2sta_getcardinfo(wlandevice_t *wlandev) &hw->cap_sup_pri, sizeof(hfa384x_caplevel_t)); if (result) { - printk(KERN_ERR "Failed to retrieve PRISUPRANGE\n"); + netdev_err(wlandev->netdev, "Failed to retrieve PRISUPRANGE\n"); goto failed; } @@ -762,7 +752,7 @@ static int prism2sta_getcardinfo(wlandevice_t *wlandev) hw->cap_sup_pri.bottom = le16_to_cpu(hw->cap_sup_pri.bottom); hw->cap_sup_pri.top = le16_to_cpu(hw->cap_sup_pri.top); - printk(KERN_INFO + netdev_info(wlandev->netdev, "PRI:SUP:role=0x%02x:id=0x%02x:var=0x%02x:b/t=%d/%d\n", hw->cap_sup_pri.role, hw->cap_sup_pri.id, hw->cap_sup_pri.variant, hw->cap_sup_pri.bottom, @@ -773,7 +763,7 @@ static int prism2sta_getcardinfo(wlandevice_t *wlandev) &hw->cap_sup_sta, sizeof(hfa384x_caplevel_t)); if (result) { - printk(KERN_ERR "Failed to retrieve STASUPRANGE\n"); + netdev_err(wlandev->netdev, "Failed to retrieve STASUPRANGE\n"); goto failed; } @@ -786,13 +776,13 @@ static int prism2sta_getcardinfo(wlandevice_t *wlandev) hw->cap_sup_sta.top = le16_to_cpu(hw->cap_sup_sta.top); if (hw->cap_sup_sta.id == 0x04) { - printk(KERN_INFO + netdev_info(wlandev->netdev, "STA:SUP:role=0x%02x:id=0x%02x:var=0x%02x:b/t=%d/%d\n", hw->cap_sup_sta.role, hw->cap_sup_sta.id, hw->cap_sup_sta.variant, hw->cap_sup_sta.bottom, hw->cap_sup_sta.top); } else { - printk(KERN_INFO + netdev_info(wlandev->netdev, "AP:SUP:role=0x%02x:id=0x%02x:var=0x%02x:b/t=%d/%d\n", hw->cap_sup_sta.role, hw->cap_sup_sta.id, hw->cap_sup_sta.variant, hw->cap_sup_sta.bottom, @@ -804,7 +794,7 @@ static int prism2sta_getcardinfo(wlandevice_t *wlandev) &hw->cap_act_pri_cfi, sizeof(hfa384x_caplevel_t)); if (result) { - printk(KERN_ERR "Failed to retrieve PRI_CFIACTRANGES\n"); + netdev_err(wlandev->netdev, "Failed to retrieve PRI_CFIACTRANGES\n"); goto failed; } @@ -816,7 +806,7 @@ static int prism2sta_getcardinfo(wlandevice_t *wlandev) hw->cap_act_pri_cfi.bottom = le16_to_cpu(hw->cap_act_pri_cfi.bottom); hw->cap_act_pri_cfi.top = le16_to_cpu(hw->cap_act_pri_cfi.top); - printk(KERN_INFO + netdev_info(wlandev->netdev, "PRI-CFI:ACT:role=0x%02x:id=0x%02x:var=0x%02x:b/t=%d/%d\n", hw->cap_act_pri_cfi.role, hw->cap_act_pri_cfi.id, hw->cap_act_pri_cfi.variant, hw->cap_act_pri_cfi.bottom, @@ -827,7 +817,7 @@ static int prism2sta_getcardinfo(wlandevice_t *wlandev) &hw->cap_act_sta_cfi, sizeof(hfa384x_caplevel_t)); if (result) { - printk(KERN_ERR "Failed to retrieve STA_CFIACTRANGES\n"); + netdev_err(wlandev->netdev, "Failed to retrieve STA_CFIACTRANGES\n"); goto failed; } @@ -839,7 +829,7 @@ static int prism2sta_getcardinfo(wlandevice_t *wlandev) hw->cap_act_sta_cfi.bottom = le16_to_cpu(hw->cap_act_sta_cfi.bottom); hw->cap_act_sta_cfi.top = le16_to_cpu(hw->cap_act_sta_cfi.top); - printk(KERN_INFO + netdev_info(wlandev->netdev, "STA-CFI:ACT:role=0x%02x:id=0x%02x:var=0x%02x:b/t=%d/%d\n", hw->cap_act_sta_cfi.role, hw->cap_act_sta_cfi.id, hw->cap_act_sta_cfi.variant, hw->cap_act_sta_cfi.bottom, @@ -850,7 +840,7 @@ static int prism2sta_getcardinfo(wlandevice_t *wlandev) &hw->cap_act_sta_mfi, sizeof(hfa384x_caplevel_t)); if (result) { - printk(KERN_ERR "Failed to retrieve STA_MFIACTRANGES\n"); + netdev_err(wlandev->netdev, "Failed to retrieve STA_MFIACTRANGES\n"); goto failed; } @@ -862,7 +852,7 @@ static int prism2sta_getcardinfo(wlandevice_t *wlandev) hw->cap_act_sta_mfi.bottom = le16_to_cpu(hw->cap_act_sta_mfi.bottom); hw->cap_act_sta_mfi.top = le16_to_cpu(hw->cap_act_sta_mfi.top); - printk(KERN_INFO + netdev_info(wlandev->netdev, "STA-MFI:ACT:role=0x%02x:id=0x%02x:var=0x%02x:b/t=%d/%d\n", hw->cap_act_sta_mfi.role, hw->cap_act_sta_mfi.id, hw->cap_act_sta_mfi.variant, hw->cap_act_sta_mfi.bottom, @@ -874,9 +864,9 @@ static int prism2sta_getcardinfo(wlandevice_t *wlandev) if (!result) { wlan_mkprintstr(snum, HFA384x_RID_NICSERIALNUMBER_LEN, pstr, sizeof(pstr)); - printk(KERN_INFO "Prism2 card SN: %s\n", pstr); + netdev_info(wlandev->netdev, "Prism2 card SN: %s\n", pstr); } else { - printk(KERN_ERR "Failed to retrieve Prism2 Card SN\n"); + netdev_err(wlandev->netdev, "Failed to retrieve Prism2 Card SN\n"); goto failed; } @@ -884,7 +874,7 @@ static int prism2sta_getcardinfo(wlandevice_t *wlandev) result = hfa384x_drvr_getconfig(hw, HFA384x_RID_CNFOWNMACADDR, wlandev->netdev->dev_addr, ETH_ALEN); if (result != 0) { - printk(KERN_ERR "Failed to retrieve mac address\n"); + netdev_err(wlandev->netdev, "Failed to retrieve mac address\n"); goto failed; } @@ -912,7 +902,7 @@ static int prism2sta_getcardinfo(wlandevice_t *wlandev) goto done; failed: - printk(KERN_ERR "Failed, result=%d\n", result); + netdev_err(wlandev->netdev, "Failed, result=%d\n", result); done: return result; } @@ -989,7 +979,6 @@ static void prism2sta_inf_handover(wlandevice_t *wlandev, hfa384x_InfFrame_t *inf) { pr_debug("received infoframe:HANDOVER (unhandled)\n"); - return; } /*---------------------------------------------------------------- @@ -1036,8 +1025,6 @@ static void prism2sta_inf_tallies(wlandevice_t *wlandev, for (i = 0; i < cnt; i++, dst++, src16++) *dst += le16_to_cpu(*src16); } - - return; } /*---------------------------------------------------------------- @@ -1091,11 +1078,9 @@ static void prism2sta_inf_scanresults(wlandevice_t *wlandev, HFA384x_RID_JOINREQUEST, &joinreq, HFA384x_RID_JOINREQUEST_LEN); if (result) { - printk(KERN_ERR "setconfig(joinreq) failed, result=%d\n", + netdev_err(wlandev->netdev, "setconfig(joinreq) failed, result=%d\n", result); } - - return; } /*---------------------------------------------------------------- @@ -1129,8 +1114,7 @@ static void prism2sta_inf_hostscanresults(wlandevice_t *wlandev, kfree(hw->scanresults); - hw->scanresults = kmalloc(sizeof(hfa384x_InfFrame_t), GFP_ATOMIC); - memcpy(hw->scanresults, inf, sizeof(hfa384x_InfFrame_t)); + hw->scanresults = kmemdup(inf, sizeof(hfa384x_InfFrame_t), GFP_ATOMIC); if (nbss == 0) nbss = -1; @@ -1167,35 +1151,37 @@ static void prism2sta_inf_chinforesults(wlandevice_t *wlandev, le16_to_cpu(inf->info.chinforesult.scanchannels); for (i = 0, n = 0; i < HFA384x_CHINFORESULT_MAX; i++) { - if (hw->channel_info.results.scanchannels & (1 << i)) { - int channel = - le16_to_cpu(inf->info.chinforesult.result[n].chid) - - 1; - hfa384x_ChInfoResultSub_t *chinforesult = - &hw->channel_info.results.result[channel]; - chinforesult->chid = channel; - chinforesult->anl = - le16_to_cpu(inf->info.chinforesult.result[n].anl); - chinforesult->pnl = - le16_to_cpu(inf->info.chinforesult.result[n].pnl); - chinforesult->active = - le16_to_cpu(inf->info.chinforesult.result[n]. - active); - pr_debug - ("chinfo: channel %d, %s level (avg/peak)=%d/%d dB, pcf %d\n", - channel + 1, - chinforesult-> - active & HFA384x_CHINFORESULT_BSSACTIVE ? "signal" - : "noise", chinforesult->anl, chinforesult->pnl, - chinforesult-> - active & HFA384x_CHINFORESULT_PCFACTIVE ? 1 : 0); - n++; - } + hfa384x_ChInfoResultSub_t *result; + hfa384x_ChInfoResultSub_t *chinforesult; + int chan; + + if (!(hw->channel_info.results.scanchannels & (1 << i))) + continue; + + result = &inf->info.chinforesult.result[n]; + chan = le16_to_cpu(result->chid) - 1; + + if (chan < 0 || chan >= HFA384x_CHINFORESULT_MAX) + continue; + + chinforesult = &hw->channel_info.results.result[chan]; + chinforesult->chid = chan; + chinforesult->anl = le16_to_cpu(result->anl); + chinforesult->pnl = le16_to_cpu(result->pnl); + chinforesult->active = le16_to_cpu(result->active); + + pr_debug("chinfo: channel %d, %s level (avg/peak)=%d/%d dB, pcf %d\n", + chan + 1, + (chinforesult->active & HFA384x_CHINFORESULT_BSSACTIVE) + ? "signal" : "noise", + chinforesult->anl, chinforesult->pnl, + (chinforesult->active & HFA384x_CHINFORESULT_PCFACTIVE) + ? 1 : 0); + n++; } atomic_set(&hw->channel_info.done, 2); hw->channel_info.count = n; - return; } void prism2sta_processing_defer(struct work_struct *data) @@ -1219,7 +1205,7 @@ void prism2sta_processing_defer(struct work_struct *data) /* Now let's handle the linkstatus stuff */ if (hw->link_status == hw->link_status_new) - goto failed; + return; hw->link_status = hw->link_status_new; @@ -1233,7 +1219,7 @@ void prism2sta_processing_defer(struct work_struct *data) */ netif_carrier_off(wlandev->netdev); - printk(KERN_INFO "linkstatus=NOTCONNECTED (unhandled)\n"); + netdev_info(wlandev->netdev, "linkstatus=NOTCONNECTED (unhandled)\n"); break; case HFA384x_LINK_CONNECTED: @@ -1260,7 +1246,7 @@ void prism2sta_processing_defer(struct work_struct *data) if (wlandev->netdev->type == ARPHRD_ETHER) { u16 portstatus; - printk(KERN_INFO "linkstatus=CONNECTED\n"); + netdev_info(wlandev->netdev, "linkstatus=CONNECTED\n"); /* For non-usb devices, we can use the sync versions */ /* Collect the BSSID, and set state to allow tx */ @@ -1273,7 +1259,7 @@ void prism2sta_processing_defer(struct work_struct *data) pr_debug ("getconfig(0x%02x) failed, result = %d\n", HFA384x_RID_CURRENTBSSID, result); - goto failed; + return; } result = hfa384x_drvr_getconfig(hw, @@ -1283,9 +1269,9 @@ void prism2sta_processing_defer(struct work_struct *data) pr_debug ("getconfig(0x%02x) failed, result = %d\n", HFA384x_RID_CURRENTSSID, result); - goto failed; + return; } - prism2mgmt_bytestr2pstr((hfa384x_bytestr_t *) &ssid, + prism2mgmt_bytestr2pstr((struct hfa384x_bytestr *) &ssid, (p80211pstrd_t *) & wlandev->ssid); @@ -1297,7 +1283,7 @@ void prism2sta_processing_defer(struct work_struct *data) pr_debug ("getconfig(0x%02x) failed, result = %d\n", HFA384x_RID_PORTSTATUS, result); - goto failed; + return; } wlandev->macmode = (portstatus == HFA384x_PSTATUS_CONN_IBSS) ? @@ -1322,7 +1308,7 @@ void prism2sta_processing_defer(struct work_struct *data) * Block Transmits, Ignore receives of data frames */ if (wlandev->netdev->type == ARPHRD_ETHER) - printk(KERN_INFO + netdev_info(wlandev->netdev, "linkstatus=DISCONNECTED (unhandled)\n"); wlandev->macmode = WLAN_MACMODE_NONE; @@ -1348,7 +1334,7 @@ void prism2sta_processing_defer(struct work_struct *data) * Indicate Reassociation * Enable Transmits, Receives and pass up data frames */ - printk(KERN_INFO "linkstatus=AP_CHANGE\n"); + netdev_info(wlandev->netdev, "linkstatus=AP_CHANGE\n"); result = hfa384x_drvr_getconfig(hw, HFA384x_RID_CURRENTBSSID, @@ -1356,7 +1342,7 @@ void prism2sta_processing_defer(struct work_struct *data) if (result) { pr_debug("getconfig(0x%02x) failed, result = %d\n", HFA384x_RID_CURRENTBSSID, result); - goto failed; + return; } result = hfa384x_drvr_getconfig(hw, @@ -1365,9 +1351,9 @@ void prism2sta_processing_defer(struct work_struct *data) if (result) { pr_debug("getconfig(0x%02x) failed, result = %d\n", HFA384x_RID_CURRENTSSID, result); - goto failed; + return; } - prism2mgmt_bytestr2pstr((hfa384x_bytestr_t *) &ssid, + prism2mgmt_bytestr2pstr((struct hfa384x_bytestr *) &ssid, (p80211pstrd_t *) &wlandev->ssid); hw->link_status = HFA384x_LINK_CONNECTED; @@ -1390,7 +1376,7 @@ void prism2sta_processing_defer(struct work_struct *data) * Response: * Block Transmits, Ignore receives of data frames */ - printk(KERN_INFO "linkstatus=AP_OUTOFRANGE (unhandled)\n"); + netdev_info(wlandev->netdev, "linkstatus=AP_OUTOFRANGE (unhandled)\n"); netif_carrier_off(wlandev->netdev); @@ -1403,7 +1389,7 @@ void prism2sta_processing_defer(struct work_struct *data) * Response: * Enable Transmits, Receives and pass up data frames */ - printk(KERN_INFO "linkstatus=AP_INRANGE\n"); + netdev_info(wlandev->netdev, "linkstatus=AP_INRANGE\n"); hw->link_status = HFA384x_LINK_CONNECTED; netif_carrier_on(wlandev->netdev); @@ -1427,10 +1413,10 @@ void prism2sta_processing_defer(struct work_struct *data) HFA384x_RID_JOINREQUEST, &joinreq, HFA384x_RID_JOINREQUEST_LEN); - printk(KERN_INFO + netdev_info(wlandev->netdev, "linkstatus=ASSOCFAIL (re-submitting join)\n"); } else { - printk(KERN_INFO "linkstatus=ASSOCFAIL (unhandled)\n"); + netdev_info(wlandev->netdev, "linkstatus=ASSOCFAIL (unhandled)\n"); } netif_carrier_off(wlandev->netdev); @@ -1442,16 +1428,12 @@ void prism2sta_processing_defer(struct work_struct *data) default: /* This is bad, IO port problems? */ - printk(KERN_WARNING + netdev_warn(wlandev->netdev, "unknown linkstatus=0x%02x\n", hw->link_status); - goto failed; - break; + return; } wlandev->linkstatus = (hw->link_status == HFA384x_LINK_CONNECTED); - -failed: - return; } /*---------------------------------------------------------------- @@ -1479,8 +1461,6 @@ static void prism2sta_inf_linkstatus(wlandevice_t *wlandev, hw->link_status_new = le16_to_cpu(inf->info.linkstatus.linkstatus); schedule_work(&hw->link_bh); - - return; } /*---------------------------------------------------------------- @@ -1530,7 +1510,7 @@ static void prism2sta_inf_assocstatus(wlandevice_t *wlandev, if (i >= hw->authlist.cnt) { if (rec.assocstatus != HFA384x_ASSOCSTATUS_AUTHFAIL) - printk(KERN_WARNING + netdev_warn(wlandev->netdev, "assocstatus info frame received for non-authenticated station.\n"); } else { hw->authlist.assoc[i] = @@ -1538,11 +1518,9 @@ static void prism2sta_inf_assocstatus(wlandevice_t *wlandev, rec.assocstatus == HFA384x_ASSOCSTATUS_REASSOC); if (rec.assocstatus == HFA384x_ASSOCSTATUS_AUTHFAIL) - printk(KERN_WARNING + netdev_warn(wlandev->netdev, "authfail assocstatus info frame received for authenticated station.\n"); } - - return; } /*---------------------------------------------------------------- @@ -1728,11 +1706,10 @@ static void prism2sta_inf_authreq_defer(wlandevice_t *wlandev, if (result) { if (added) hw->authlist.cnt--; - printk(KERN_ERR + netdev_err(wlandev->netdev, "setconfig(authenticatestation) failed, result=%d\n", result); } - return; } /*---------------------------------------------------------------- @@ -1759,8 +1736,6 @@ static void prism2sta_inf_psusercnt(wlandevice_t *wlandev, hfa384x_t *hw = (hfa384x_t *) wlandev->priv; hw->psusercount = le16_to_cpu(inf->info.psusercnt.usercnt); - - return; } /*---------------------------------------------------------------- @@ -1813,20 +1788,19 @@ void prism2sta_ev_info(wlandevice_t *wlandev, hfa384x_InfFrame_t *inf) prism2sta_inf_psusercnt(wlandev, inf); break; case HFA384x_IT_KEYIDCHANGED: - printk(KERN_WARNING "Unhandled IT_KEYIDCHANGED\n"); + netdev_warn(wlandev->netdev, "Unhandled IT_KEYIDCHANGED\n"); break; case HFA384x_IT_ASSOCREQ: - printk(KERN_WARNING "Unhandled IT_ASSOCREQ\n"); + netdev_warn(wlandev->netdev, "Unhandled IT_ASSOCREQ\n"); break; case HFA384x_IT_MICFAILURE: - printk(KERN_WARNING "Unhandled IT_MICFAILURE\n"); + netdev_warn(wlandev->netdev, "Unhandled IT_MICFAILURE\n"); break; default: - printk(KERN_WARNING + netdev_warn(wlandev->netdev, "Unknown info type=0x%02x\n", inf->infotype); break; } - return; } /*---------------------------------------------------------------- @@ -1851,8 +1825,6 @@ void prism2sta_ev_info(wlandevice_t *wlandev, hfa384x_InfFrame_t *inf) void prism2sta_ev_txexc(wlandevice_t *wlandev, u16 status) { pr_debug("TxExc status=0x%x.\n", status); - - return; } /*---------------------------------------------------------------- @@ -1876,7 +1848,6 @@ void prism2sta_ev_tx(wlandevice_t *wlandev, u16 status) pr_debug("Tx Complete, status=0x%04x\n", status); /* update linux network stats */ wlandev->linux_stats.tx_packets++; - return; } /*---------------------------------------------------------------- @@ -1898,7 +1869,6 @@ void prism2sta_ev_tx(wlandevice_t *wlandev, u16 status) void prism2sta_ev_rx(wlandevice_t *wlandev, struct sk_buff *skb) { p80211netdev_rx(wlandev, skb); - return; } /*---------------------------------------------------------------- @@ -1920,7 +1890,6 @@ void prism2sta_ev_rx(wlandevice_t *wlandev, struct sk_buff *skb) void prism2sta_ev_alloc(wlandevice_t *wlandev) { netif_wake_queue(wlandev->netdev); - return; } /*---------------------------------------------------------------- @@ -1948,20 +1917,16 @@ static wlandevice_t *create_wlan(void) hfa384x_t *hw = NULL; /* Alloc our structures */ - wlandev = kmalloc(sizeof(wlandevice_t), GFP_KERNEL); - hw = kmalloc(sizeof(hfa384x_t), GFP_KERNEL); + wlandev = kzalloc(sizeof(wlandevice_t), GFP_KERNEL); + hw = kzalloc(sizeof(hfa384x_t), GFP_KERNEL); if (!wlandev || !hw) { - printk(KERN_ERR "%s: Memory allocation failure.\n", dev_info); + pr_err("%s: Memory allocation failure.\n", dev_info); kfree(wlandev); kfree(hw); return NULL; } - /* Clear all the structs */ - memset(wlandev, 0, sizeof(wlandevice_t)); - memset(hw, 0, sizeof(hfa384x_t)); - /* Initialize the network device object. */ wlandev->nsdname = dev_info; wlandev->msdstate = WLAN_MSD_HWPRESENT_PENDING; @@ -1976,7 +1941,7 @@ static wlandevice_t *create_wlan(void) wlandev->nsdcaps = P80211_NSDCAP_HWFRAGMENT | P80211_NSDCAP_AUTOJOIN; - /* Initialize the device private data stucture. */ + /* Initialize the device private data structure. */ hw->dot11_desired_bss_type = 1; return wlandev; @@ -1993,12 +1958,12 @@ void prism2sta_commsqual_defer(struct work_struct *data) int result = 0; if (hw->wlandev->hwremoved) - goto done; + return; /* we don't care if we're in AP mode */ if ((wlandev->macmode == WLAN_MACMODE_NONE) || (wlandev->macmode == WLAN_MACMODE_ESS_AP)) { - goto done; + return; } /* It only makes sense to poll these in non-IBSS */ @@ -2008,8 +1973,8 @@ void prism2sta_commsqual_defer(struct work_struct *data) &hw->qual, HFA384x_RID_DBMCOMMSQUALITY_LEN); if (result) { - printk(KERN_ERR "error fetching commsqual\n"); - goto done; + netdev_err(wlandev->netdev, "error fetching commsqual\n"); + return; } pr_debug("commsqual %d %d %d\n", @@ -2026,7 +1991,7 @@ void prism2sta_commsqual_defer(struct work_struct *data) if (result) { pr_debug("get signal rate failed, result = %d\n", result); - goto done; + return; } switch (mibitem->data) { @@ -2053,7 +2018,7 @@ void prism2sta_commsqual_defer(struct work_struct *data) if (result) { pr_debug("getconfig(0x%02x) failed, result = %d\n", HFA384x_RID_CURRENTBSSID, result); - goto done; + return; } result = hfa384x_drvr_getconfig(hw, @@ -2062,16 +2027,13 @@ void prism2sta_commsqual_defer(struct work_struct *data) if (result) { pr_debug("getconfig(0x%02x) failed, result = %d\n", HFA384x_RID_CURRENTSSID, result); - goto done; + return; } - prism2mgmt_bytestr2pstr((hfa384x_bytestr_t *) &ssid, + prism2mgmt_bytestr2pstr((struct hfa384x_bytestr *) &ssid, (p80211pstrd_t *) &wlandev->ssid); /* Reschedule timer */ mod_timer(&hw->commsqual_timer, jiffies + HZ); - -done: - ; } void prism2sta_commsqual_timer(unsigned long data) |
