Commit f3422882 authored by Moritz Muehlenhoff's avatar Moritz Muehlenhoff Committed by Greg Kroah-Hartman

Staging: wlan-ng: prism2sta.c: Coding style cleanups

Signed-off-by: default avatarMoritz Muehlenhoff <jmm@debian.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent f4ee0f42
...@@ -50,9 +50,6 @@ ...@@ -50,9 +50,6 @@
* -------------------------------------------------------------------- * --------------------------------------------------------------------
*/ */
/*================================================================*/
/* System Includes */
#include <linux/version.h> #include <linux/version.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/moduleparam.h> #include <linux/moduleparam.h>
...@@ -91,9 +88,6 @@ ...@@ -91,9 +88,6 @@
#include "hfa384x.h" #include "hfa384x.h"
#include "prism2mgmt.h" #include "prism2mgmt.h"
/*================================================================*/
/* Local Macros */
#define wlan_hexchar(x) (((x) < 0x0a) ? ('0' + (x)) : ('a' + ((x) - 0x0a))) #define wlan_hexchar(x) (((x) < 0x0a) ? ('0' + (x)) : ('a' + ((x) - 0x0a)))
/* Create a string of printable chars from something that might not be */ /* Create a string of printable chars from something that might not be */
...@@ -104,7 +98,7 @@ ...@@ -104,7 +98,7 @@
int j = 0; \ int j = 0; \
memset(str, 0, (strlen)); \ memset(str, 0, (strlen)); \
for (i = 0; i < (buflen); i++) { \ for (i = 0; i < (buflen); i++) { \
if ( isprint((buf)[i]) ) { \ if (isprint((buf)[i])) { \
(str)[j] = (buf)[i]; \ (str)[j] = (buf)[i]; \
j++; \ j++; \
} else { \ } else { \
...@@ -117,68 +111,55 @@ ...@@ -117,68 +111,55 @@
} \ } \
} }
/*================================================================*/
/* Local Static Definitions */
static char *dev_info = "prism2_usb"; static char *dev_info = "prism2_usb";
static wlandevice_t *create_wlan(void); static wlandevice_t *create_wlan(void);
/*----------------------------------------------------------------*/ int prism2_reset_holdtime = 30; /* Reset hold time in ms */
/* --Module Parameters */ int prism2_reset_settletime = 100; /* Reset settle time in ms */
int prism2_reset_holdtime=30; /* Reset hold time in ms */
int prism2_reset_settletime=100; /* Reset settle time in ms */
static int prism2_doreset=0; /* Do a reset at init? */ static int prism2_doreset = 0; /* Do a reset at init? */
module_param( prism2_doreset, int, 0644); module_param(prism2_doreset, int, 0644);
MODULE_PARM_DESC(prism2_doreset, "Issue a reset on initialization"); MODULE_PARM_DESC(prism2_doreset, "Issue a reset on initialization");
module_param( prism2_reset_holdtime, int, 0644); module_param(prism2_reset_holdtime, int, 0644);
MODULE_PARM_DESC( prism2_reset_holdtime, "reset hold time in ms"); MODULE_PARM_DESC(prism2_reset_holdtime, "reset hold time in ms");
module_param( prism2_reset_settletime, int, 0644); module_param(prism2_reset_settletime, int, 0644);
MODULE_PARM_DESC( prism2_reset_settletime, "reset settle time in ms"); MODULE_PARM_DESC(prism2_reset_settletime, "reset settle time in ms");
MODULE_LICENSE("Dual MPL/GPL"); MODULE_LICENSE("Dual MPL/GPL");
/*================================================================*/
/* Local Function Declarations */
static int prism2sta_open(wlandevice_t *wlandev); static int prism2sta_open(wlandevice_t *wlandev);
static int prism2sta_close(wlandevice_t *wlandev); static int prism2sta_close(wlandevice_t *wlandev);
static void prism2sta_reset(wlandevice_t *wlandev ); static void prism2sta_reset(wlandevice_t *wlandev);
static int prism2sta_txframe(wlandevice_t *wlandev, struct sk_buff *skb, p80211_hdr_t *p80211_hdr, p80211_metawep_t *p80211_wep); static int prism2sta_txframe(wlandevice_t *wlandev, struct sk_buff *skb,
p80211_hdr_t *p80211_hdr,
p80211_metawep_t *p80211_wep);
static int prism2sta_mlmerequest(wlandevice_t *wlandev, p80211msg_t *msg); static int prism2sta_mlmerequest(wlandevice_t *wlandev, p80211msg_t *msg);
static int prism2sta_getcardinfo(wlandevice_t *wlandev); static int prism2sta_getcardinfo(wlandevice_t *wlandev);
static int prism2sta_globalsetup(wlandevice_t *wlandev); static int prism2sta_globalsetup(wlandevice_t *wlandev);
static int prism2sta_setmulticast(wlandevice_t *wlandev, static int prism2sta_setmulticast(wlandevice_t *wlandev, netdevice_t *dev);
netdevice_t *dev);
static void prism2sta_inf_handover(
wlandevice_t *wlandev, hfa384x_InfFrame_t *inf);
static void prism2sta_inf_tallies(
wlandevice_t *wlandev, hfa384x_InfFrame_t *inf);
static void prism2sta_inf_hostscanresults(
wlandevice_t *wlandev, hfa384x_InfFrame_t *inf);
static void prism2sta_inf_scanresults(
wlandevice_t *wlandev, hfa384x_InfFrame_t *inf);
static void prism2sta_inf_chinforesults(
wlandevice_t *wlandev, hfa384x_InfFrame_t *inf);
static void prism2sta_inf_linkstatus(
wlandevice_t *wlandev, hfa384x_InfFrame_t *inf);
static void prism2sta_inf_assocstatus(
wlandevice_t *wlandev, hfa384x_InfFrame_t *inf);
static void prism2sta_inf_authreq(
wlandevice_t *wlandev, hfa384x_InfFrame_t *inf);
static void prism2sta_inf_authreq_defer(
wlandevice_t *wlandev, hfa384x_InfFrame_t *inf);
static void prism2sta_inf_psusercnt(
wlandevice_t *wlandev, hfa384x_InfFrame_t *inf);
/*================================================================*/
/* Function Definitions */
static void prism2sta_inf_handover(wlandevice_t *wlandev,
hfa384x_InfFrame_t *inf);
static void prism2sta_inf_tallies(wlandevice_t *wlandev,
hfa384x_InfFrame_t *inf);
static void prism2sta_inf_hostscanresults(wlandevice_t *wlandev,
hfa384x_InfFrame_t *inf);
static void prism2sta_inf_scanresults(wlandevice_t *wlandev,
hfa384x_InfFrame_t *inf);
static void prism2sta_inf_chinforesults(wlandevice_t *wlandev,
hfa384x_InfFrame_t *inf);
static void prism2sta_inf_linkstatus(wlandevice_t *wlandev,
hfa384x_InfFrame_t *inf);
static void prism2sta_inf_assocstatus(wlandevice_t *wlandev,
hfa384x_InfFrame_t *inf);
static void prism2sta_inf_authreq(wlandevice_t *wlandev,
hfa384x_InfFrame_t *inf);
static void prism2sta_inf_authreq_defer(wlandevice_t *wlandev,
hfa384x_InfFrame_t *inf);
static void prism2sta_inf_psusercnt(wlandevice_t *wlandev,
hfa384x_InfFrame_t *inf);
/*---------------------------------------------------------------- /*----------------------------------------------------------------
* prism2sta_open * prism2sta_open
...@@ -214,7 +195,6 @@ static int prism2sta_open(wlandevice_t *wlandev) ...@@ -214,7 +195,6 @@ static int prism2sta_open(wlandevice_t *wlandev)
return 0; return 0;
} }
/*---------------------------------------------------------------- /*----------------------------------------------------------------
* prism2sta_close * prism2sta_close
* *
...@@ -247,7 +227,6 @@ static int prism2sta_close(wlandevice_t *wlandev) ...@@ -247,7 +227,6 @@ static int prism2sta_close(wlandevice_t *wlandev)
return 0; return 0;
} }
/*---------------------------------------------------------------- /*----------------------------------------------------------------
* prism2sta_reset * prism2sta_reset
* *
...@@ -265,12 +244,11 @@ static int prism2sta_close(wlandevice_t *wlandev) ...@@ -265,12 +244,11 @@ static int prism2sta_close(wlandevice_t *wlandev)
* Call context: * Call context:
* process thread * process thread
----------------------------------------------------------------*/ ----------------------------------------------------------------*/
static void prism2sta_reset(wlandevice_t *wlandev ) static void prism2sta_reset(wlandevice_t *wlandev)
{ {
return; return;
} }
/*---------------------------------------------------------------- /*----------------------------------------------------------------
* prism2sta_txframe * prism2sta_txframe
* *
...@@ -296,11 +274,12 @@ static int prism2sta_txframe(wlandevice_t *wlandev, struct sk_buff *skb, ...@@ -296,11 +274,12 @@ static int prism2sta_txframe(wlandevice_t *wlandev, struct sk_buff *skb,
p80211_hdr_t *p80211_hdr, p80211_hdr_t *p80211_hdr,
p80211_metawep_t *p80211_wep) p80211_metawep_t *p80211_wep)
{ {
hfa384x_t *hw = (hfa384x_t *)wlandev->priv; hfa384x_t *hw = (hfa384x_t *) wlandev->priv;
int result; int result;
/* If necessary, set the 802.11 WEP bit */ /* If necessary, set the 802.11 WEP bit */
if ((wlandev->hostwep & (HOSTWEP_PRIVACYINVOKED | HOSTWEP_ENCRYPT)) == HOSTWEP_PRIVACYINVOKED) { if ((wlandev->hostwep & (HOSTWEP_PRIVACYINVOKED | HOSTWEP_ENCRYPT)) ==
HOSTWEP_PRIVACYINVOKED) {
p80211_hdr->a3.fc |= cpu_to_le16(WLAN_SET_FC_ISWEP(1)); p80211_hdr->a3.fc |= cpu_to_le16(WLAN_SET_FC_ISWEP(1));
} }
...@@ -309,7 +288,6 @@ static int prism2sta_txframe(wlandevice_t *wlandev, struct sk_buff *skb, ...@@ -309,7 +288,6 @@ static int prism2sta_txframe(wlandevice_t *wlandev, struct sk_buff *skb,
return result; return result;
} }
/*---------------------------------------------------------------- /*----------------------------------------------------------------
* prism2sta_mlmerequest * prism2sta_mlmerequest
* *
...@@ -336,107 +314,113 @@ static int prism2sta_txframe(wlandevice_t *wlandev, struct sk_buff *skb, ...@@ -336,107 +314,113 @@ static int prism2sta_txframe(wlandevice_t *wlandev, struct sk_buff *skb,
----------------------------------------------------------------*/ ----------------------------------------------------------------*/
static int prism2sta_mlmerequest(wlandevice_t *wlandev, p80211msg_t *msg) static int prism2sta_mlmerequest(wlandevice_t *wlandev, p80211msg_t *msg)
{ {
hfa384x_t *hw = (hfa384x_t *)wlandev->priv; hfa384x_t *hw = (hfa384x_t *) wlandev->priv;
int result = 0; int result = 0;
switch( msg->msgcode ) switch (msg->msgcode) {
{ case DIDmsg_dot11req_mibget:
case DIDmsg_dot11req_mibget :
pr_debug("Received mibget request\n"); pr_debug("Received mibget request\n");
result = prism2mgmt_mibset_mibget(wlandev, msg); result = prism2mgmt_mibset_mibget(wlandev, msg);
break; break;
case DIDmsg_dot11req_mibset : case DIDmsg_dot11req_mibset:
pr_debug("Received mibset request\n"); pr_debug("Received mibset request\n");
result = prism2mgmt_mibset_mibget(wlandev, msg); result = prism2mgmt_mibset_mibget(wlandev, msg);
break; break;
case DIDmsg_dot11req_scan : case DIDmsg_dot11req_scan:
pr_debug("Received scan request\n"); pr_debug("Received scan request\n");
result = prism2mgmt_scan(wlandev, msg); result = prism2mgmt_scan(wlandev, msg);
break; break;
case DIDmsg_dot11req_scan_results : case DIDmsg_dot11req_scan_results:
pr_debug("Received scan_results request\n"); pr_debug("Received scan_results request\n");
result = prism2mgmt_scan_results(wlandev, msg); result = prism2mgmt_scan_results(wlandev, msg);
break; break;
case DIDmsg_dot11req_start : case DIDmsg_dot11req_start:
pr_debug("Received mlme start request\n"); pr_debug("Received mlme start request\n");
result = prism2mgmt_start(wlandev, msg); result = prism2mgmt_start(wlandev, msg);
break; break;
/* /*
* Prism2 specific messages * Prism2 specific messages
*/ */
case DIDmsg_p2req_readpda : case DIDmsg_p2req_readpda:
pr_debug("Received mlme readpda request\n"); pr_debug("Received mlme readpda request\n");
result = prism2mgmt_readpda(wlandev, msg); result = prism2mgmt_readpda(wlandev, msg);
break; break;
case DIDmsg_p2req_ramdl_state : case DIDmsg_p2req_ramdl_state:
pr_debug("Received mlme ramdl_state request\n"); pr_debug("Received mlme ramdl_state request\n");
result = prism2mgmt_ramdl_state(wlandev, msg); result = prism2mgmt_ramdl_state(wlandev, msg);
break; break;
case DIDmsg_p2req_ramdl_write : case DIDmsg_p2req_ramdl_write:
pr_debug("Received mlme ramdl_write request\n"); pr_debug("Received mlme ramdl_write request\n");
result = prism2mgmt_ramdl_write(wlandev, msg); result = prism2mgmt_ramdl_write(wlandev, msg);
break; break;
case DIDmsg_p2req_flashdl_state : case DIDmsg_p2req_flashdl_state:
pr_debug("Received mlme flashdl_state request\n"); pr_debug("Received mlme flashdl_state request\n");
result = prism2mgmt_flashdl_state(wlandev, msg); result = prism2mgmt_flashdl_state(wlandev, msg);
break; break;
case DIDmsg_p2req_flashdl_write : case DIDmsg_p2req_flashdl_write:
pr_debug("Received mlme flashdl_write request\n"); pr_debug("Received mlme flashdl_write request\n");
result = prism2mgmt_flashdl_write(wlandev, msg); result = prism2mgmt_flashdl_write(wlandev, msg);
break; break;
/* /*
* Linux specific messages * Linux specific messages
*/ */
case DIDmsg_lnxreq_hostwep : case DIDmsg_lnxreq_hostwep:
break; // ignore me. break; /* ignore me. */
case DIDmsg_lnxreq_ifstate : case DIDmsg_lnxreq_ifstate:
{ {
p80211msg_lnxreq_ifstate_t *ifstatemsg; p80211msg_lnxreq_ifstate_t *ifstatemsg;
pr_debug("Received mlme ifstate request\n"); pr_debug("Received mlme ifstate request\n");
ifstatemsg = (p80211msg_lnxreq_ifstate_t*)msg; ifstatemsg = (p80211msg_lnxreq_ifstate_t *) msg;
result = prism2sta_ifstate(wlandev, ifstatemsg->ifstate.data); result =
prism2sta_ifstate(wlandev,
ifstatemsg->ifstate.data);
ifstatemsg->resultcode.status = ifstatemsg->resultcode.status =
P80211ENUM_msgitem_status_data_ok; P80211ENUM_msgitem_status_data_ok;
ifstatemsg->resultcode.data = result; ifstatemsg->resultcode.data = result;
result = 0; result = 0;
} }
break; break;
case DIDmsg_lnxreq_wlansniff : case DIDmsg_lnxreq_wlansniff:
pr_debug("Received mlme wlansniff request\n"); pr_debug("Received mlme wlansniff request\n");
result = prism2mgmt_wlansniff(wlandev, msg); result = prism2mgmt_wlansniff(wlandev, msg);
break; break;
case DIDmsg_lnxreq_autojoin : case DIDmsg_lnxreq_autojoin:
pr_debug("Received mlme autojoin request\n"); pr_debug("Received mlme autojoin request\n");
result = prism2mgmt_autojoin(wlandev, msg); result = prism2mgmt_autojoin(wlandev, msg);
break; break;
case DIDmsg_lnxreq_commsquality: { case DIDmsg_lnxreq_commsquality:{
p80211msg_lnxreq_commsquality_t *qualmsg; p80211msg_lnxreq_commsquality_t *qualmsg;
pr_debug("Received commsquality request\n"); pr_debug("Received commsquality request\n");
qualmsg = (p80211msg_lnxreq_commsquality_t*) msg; qualmsg = (p80211msg_lnxreq_commsquality_t *) msg;
qualmsg->link.status = P80211ENUM_msgitem_status_data_ok;
qualmsg->level.status = P80211ENUM_msgitem_status_data_ok;
qualmsg->noise.status = P80211ENUM_msgitem_status_data_ok;
qualmsg->link.status =
P80211ENUM_msgitem_status_data_ok;
qualmsg->level.status =
P80211ENUM_msgitem_status_data_ok;
qualmsg->noise.status =
P80211ENUM_msgitem_status_data_ok;
qualmsg->link.data = hfa384x2host_16(hw->qual.CQ_currBSS); qualmsg->link.data =
qualmsg->level.data = hfa384x2host_16(hw->qual.ASL_currBSS); hfa384x2host_16(hw->qual.CQ_currBSS);
qualmsg->noise.data = hfa384x2host_16(hw->qual.ANL_currFC); qualmsg->level.data =
hfa384x2host_16(hw->qual.ASL_currBSS);
qualmsg->noise.data =
hfa384x2host_16(hw->qual.ANL_currFC);
break; break;
} }
default: default:
printk(KERN_WARNING "Unknown mgmt request message 0x%08x", msg->msgcode); printk(KERN_WARNING "Unknown mgmt request message 0x%08x",
msg->msgcode);
break; break;
} }
return result; return result;
} }
/*---------------------------------------------------------------- /*----------------------------------------------------------------
* prism2sta_ifstate * prism2sta_ifstate
* *
...@@ -460,15 +444,14 @@ static int prism2sta_mlmerequest(wlandevice_t *wlandev, p80211msg_t *msg) ...@@ -460,15 +444,14 @@ static int prism2sta_mlmerequest(wlandevice_t *wlandev, p80211msg_t *msg)
----------------------------------------------------------------*/ ----------------------------------------------------------------*/
u32 prism2sta_ifstate(wlandevice_t *wlandev, u32 ifstate) u32 prism2sta_ifstate(wlandevice_t *wlandev, u32 ifstate)
{ {
hfa384x_t *hw = (hfa384x_t *)wlandev->priv; hfa384x_t *hw = (hfa384x_t *) wlandev->priv;
u32 result; u32 result;
result = P80211ENUM_resultcode_implementation_failure; result = P80211ENUM_resultcode_implementation_failure;
pr_debug("Current MSD state(%d), requesting(%d)\n", pr_debug("Current MSD state(%d), requesting(%d)\n",
wlandev->msdstate, ifstate); wlandev->msdstate, ifstate);
switch (ifstate) switch (ifstate) {
{
case P80211ENUM_ifstate_fwload: case P80211ENUM_ifstate_fwload:
switch (wlandev->msdstate) { switch (wlandev->msdstate) {
case WLAN_MSD_HWPRESENT: case WLAN_MSD_HWPRESENT:
...@@ -477,7 +460,7 @@ u32 prism2sta_ifstate(wlandevice_t *wlandev, u32 ifstate) ...@@ -477,7 +460,7 @@ u32 prism2sta_ifstate(wlandevice_t *wlandev, u32 ifstate)
* Initialize the device+driver sufficiently * Initialize the device+driver sufficiently
* for firmware loading. * for firmware loading.
*/ */
if ((result=hfa384x_drvr_start(hw))) { if ((result = hfa384x_drvr_start(hw))) {
printk(KERN_ERR printk(KERN_ERR
"hfa384x_drvr_start() failed," "hfa384x_drvr_start() failed,"
"result=%d\n", (int)result); "result=%d\n", (int)result);
...@@ -521,7 +504,7 @@ u32 prism2sta_ifstate(wlandevice_t *wlandev, u32 ifstate) ...@@ -521,7 +504,7 @@ u32 prism2sta_ifstate(wlandevice_t *wlandev, u32 ifstate)
* can't make any assumptions about the state * can't make any assumptions about the state
* of the hardware or a previous firmware load. * of the hardware or a previous firmware load.
*/ */
if ((result=hfa384x_drvr_start(hw))) { if ((result = hfa384x_drvr_start(hw))) {
printk(KERN_ERR printk(KERN_ERR
"hfa384x_drvr_start() failed," "hfa384x_drvr_start() failed,"
"result=%d\n", (int)result); "result=%d\n", (int)result);
...@@ -531,7 +514,7 @@ u32 prism2sta_ifstate(wlandevice_t *wlandev, u32 ifstate) ...@@ -531,7 +514,7 @@ u32 prism2sta_ifstate(wlandevice_t *wlandev, u32 ifstate)
break; break;
} }
if ((result=prism2sta_getcardinfo(wlandev))) { if ((result = prism2sta_getcardinfo(wlandev))) {
printk(KERN_ERR printk(KERN_ERR
"prism2sta_getcardinfo() failed," "prism2sta_getcardinfo() failed,"
"result=%d\n", (int)result); "result=%d\n", (int)result);
...@@ -541,7 +524,7 @@ u32 prism2sta_ifstate(wlandevice_t *wlandev, u32 ifstate) ...@@ -541,7 +524,7 @@ u32 prism2sta_ifstate(wlandevice_t *wlandev, u32 ifstate)
wlandev->msdstate = WLAN_MSD_HWPRESENT; wlandev->msdstate = WLAN_MSD_HWPRESENT;
break; break;
} }
if ((result=prism2sta_globalsetup(wlandev))) { if ((result = prism2sta_globalsetup(wlandev))) {
printk(KERN_ERR printk(KERN_ERR
"prism2sta_globalsetup() failed," "prism2sta_globalsetup() failed,"
"result=%d\n", (int)result); "result=%d\n", (int)result);
...@@ -557,7 +540,7 @@ u32 prism2sta_ifstate(wlandevice_t *wlandev, u32 ifstate) ...@@ -557,7 +540,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:
/* Do nothing, we're already in this state.*/ /* Do nothing, we're already in this state. */
result = P80211ENUM_resultcode_success; result = P80211ENUM_resultcode_success;
break; break;
case WLAN_MSD_HWFAIL: case WLAN_MSD_HWFAIL:
...@@ -572,7 +555,7 @@ u32 prism2sta_ifstate(wlandevice_t *wlandev, u32 ifstate) ...@@ -572,7 +555,7 @@ u32 prism2sta_ifstate(wlandevice_t *wlandev, u32 ifstate)
case P80211ENUM_ifstate_disable: case P80211ENUM_ifstate_disable:
switch (wlandev->msdstate) { switch (wlandev->msdstate) {
case WLAN_MSD_HWPRESENT: case WLAN_MSD_HWPRESENT:
/* Do nothing, we're already in this state.*/ /* Do nothing, we're already in this state. */
result = P80211ENUM_resultcode_success; result = P80211ENUM_resultcode_success;
break; break;
case WLAN_MSD_FWLOAD: case WLAN_MSD_FWLOAD:
...@@ -610,7 +593,6 @@ u32 prism2sta_ifstate(wlandevice_t *wlandev, u32 ifstate) ...@@ -610,7 +593,6 @@ u32 prism2sta_ifstate(wlandevice_t *wlandev, u32 ifstate)
return result; return result;
} }
/*---------------------------------------------------------------- /*----------------------------------------------------------------
* prism2sta_getcardinfo * prism2sta_getcardinfo
* *
...@@ -633,7 +615,7 @@ u32 prism2sta_ifstate(wlandevice_t *wlandev, u32 ifstate) ...@@ -633,7 +615,7 @@ u32 prism2sta_ifstate(wlandevice_t *wlandev, u32 ifstate)
static int prism2sta_getcardinfo(wlandevice_t *wlandev) static int prism2sta_getcardinfo(wlandevice_t *wlandev)
{ {
int result = 0; int result = 0;
hfa384x_t *hw = (hfa384x_t *)wlandev->priv; hfa384x_t *hw = (hfa384x_t *) wlandev->priv;
u16 temp; u16 temp;
u8 snum[HFA384x_RID_NICSERIALNUMBER_LEN]; u8 snum[HFA384x_RID_NICSERIALNUMBER_LEN];
char pstr[(HFA384x_RID_NICSERIALNUMBER_LEN * 4) + 1]; char pstr[(HFA384x_RID_NICSERIALNUMBER_LEN * 4) + 1];
...@@ -642,8 +624,9 @@ static int prism2sta_getcardinfo(wlandevice_t *wlandev) ...@@ -642,8 +624,9 @@ static int prism2sta_getcardinfo(wlandevice_t *wlandev)
/* Some are critical, some are not */ /* Some are critical, some are not */
/* NIC identity */ /* NIC identity */
result = hfa384x_drvr_getconfig(hw, HFA384x_RID_NICIDENTITY, result = hfa384x_drvr_getconfig(hw, HFA384x_RID_NICIDENTITY,
&hw->ident_nic, sizeof(hfa384x_compident_t)); &hw->ident_nic,
if ( result ) { sizeof(hfa384x_compident_t));
if (result) {
printk(KERN_ERR "Failed to retrieve NICIDENTITY\n"); printk(KERN_ERR "Failed to retrieve NICIDENTITY\n");
goto failed; goto failed;
} }
...@@ -660,8 +643,9 @@ static int prism2sta_getcardinfo(wlandevice_t *wlandev) ...@@ -660,8 +643,9 @@ static int prism2sta_getcardinfo(wlandevice_t *wlandev)
/* Primary f/w identity */ /* Primary f/w identity */
result = hfa384x_drvr_getconfig(hw, HFA384x_RID_PRIIDENTITY, result = hfa384x_drvr_getconfig(hw, HFA384x_RID_PRIIDENTITY,
&hw->ident_pri_fw, sizeof(hfa384x_compident_t)); &hw->ident_pri_fw,
if ( result ) { sizeof(hfa384x_compident_t));
if (result) {
printk(KERN_ERR "Failed to retrieve PRIIDENTITY\n"); printk(KERN_ERR "Failed to retrieve PRIIDENTITY\n");
goto failed; goto failed;
} }
...@@ -678,14 +662,16 @@ static int prism2sta_getcardinfo(wlandevice_t *wlandev) ...@@ -678,14 +662,16 @@ static int prism2sta_getcardinfo(wlandevice_t *wlandev)
/* Station (Secondary?) f/w identity */ /* Station (Secondary?) f/w identity */
result = hfa384x_drvr_getconfig(hw, HFA384x_RID_STAIDENTITY, result = hfa384x_drvr_getconfig(hw, HFA384x_RID_STAIDENTITY,
&hw->ident_sta_fw, sizeof(hfa384x_compident_t)); &hw->ident_sta_fw,
if ( result ) { sizeof(hfa384x_compident_t));
if (result) {
printk(KERN_ERR "Failed to retrieve STAIDENTITY\n"); printk(KERN_ERR "Failed to retrieve STAIDENTITY\n");
goto failed; goto failed;
} }
if (hw->ident_nic.id < 0x8000) { if (hw->ident_nic.id < 0x8000) {
printk(KERN_ERR "FATAL: Card is not an Intersil Prism2/2.5/3\n"); printk(KERN_ERR
"FATAL: Card is not an Intersil Prism2/2.5/3\n");
result = -1; result = -1;
goto failed; goto failed;
} }
...@@ -698,9 +684,9 @@ static int prism2sta_getcardinfo(wlandevice_t *wlandev) ...@@ -698,9 +684,9 @@ static int prism2sta_getcardinfo(wlandevice_t *wlandev)
/* strip out the 'special' variant bits */ /* strip out the 'special' variant bits */
hw->mm_mods = hw->ident_sta_fw.variant & (BIT(14) | BIT(15)); hw->mm_mods = hw->ident_sta_fw.variant & (BIT(14) | BIT(15));
hw->ident_sta_fw.variant &= ~((u16)(BIT(14) | BIT(15))); hw->ident_sta_fw.variant &= ~((u16) (BIT(14) | BIT(15)));
if ( hw->ident_sta_fw.id == 0x1f ) { if (hw->ident_sta_fw.id == 0x1f) {
printk(KERN_INFO printk(KERN_INFO
"ident: sta f/w: id=0x%02x %d.%d.%d\n", "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.id, hw->ident_sta_fw.major,
...@@ -716,8 +702,9 @@ static int prism2sta_getcardinfo(wlandevice_t *wlandev) ...@@ -716,8 +702,9 @@ static int prism2sta_getcardinfo(wlandevice_t *wlandev)
/* Compatibility range, Modem supplier */ /* Compatibility range, Modem supplier */
result = hfa384x_drvr_getconfig(hw, HFA384x_RID_MFISUPRANGE, result = hfa384x_drvr_getconfig(hw, HFA384x_RID_MFISUPRANGE,
&hw->cap_sup_mfi, sizeof(hfa384x_caplevel_t)); &hw->cap_sup_mfi,
if ( result ) { sizeof(hfa384x_caplevel_t));
if (result) {
printk(KERN_ERR "Failed to retrieve MFISUPRANGE\n"); printk(KERN_ERR "Failed to retrieve MFISUPRANGE\n");
goto failed; goto failed;
} }
...@@ -738,8 +725,9 @@ static int prism2sta_getcardinfo(wlandevice_t *wlandev) ...@@ -738,8 +725,9 @@ static int prism2sta_getcardinfo(wlandevice_t *wlandev)
/* Compatibility range, Controller supplier */ /* Compatibility range, Controller supplier */
result = hfa384x_drvr_getconfig(hw, HFA384x_RID_CFISUPRANGE, result = hfa384x_drvr_getconfig(hw, HFA384x_RID_CFISUPRANGE,
&hw->cap_sup_cfi, sizeof(hfa384x_caplevel_t)); &hw->cap_sup_cfi,
if ( result ) { sizeof(hfa384x_caplevel_t));
if (result) {
printk(KERN_ERR "Failed to retrieve CFISUPRANGE\n"); printk(KERN_ERR "Failed to retrieve CFISUPRANGE\n");
goto failed; goto failed;
} }
...@@ -760,8 +748,9 @@ static int prism2sta_getcardinfo(wlandevice_t *wlandev) ...@@ -760,8 +748,9 @@ static int prism2sta_getcardinfo(wlandevice_t *wlandev)
/* Compatibility range, Primary f/w supplier */ /* Compatibility range, Primary f/w supplier */
result = hfa384x_drvr_getconfig(hw, HFA384x_RID_PRISUPRANGE, result = hfa384x_drvr_getconfig(hw, HFA384x_RID_PRISUPRANGE,
&hw->cap_sup_pri, sizeof(hfa384x_caplevel_t)); &hw->cap_sup_pri,
if ( result ) { sizeof(hfa384x_caplevel_t));
if (result) {
printk(KERN_ERR "Failed to retrieve PRISUPRANGE\n"); printk(KERN_ERR "Failed to retrieve PRISUPRANGE\n");
goto failed; goto failed;
} }
...@@ -782,8 +771,9 @@ static int prism2sta_getcardinfo(wlandevice_t *wlandev) ...@@ -782,8 +771,9 @@ static int prism2sta_getcardinfo(wlandevice_t *wlandev)
/* Compatibility range, Station f/w supplier */ /* Compatibility range, Station f/w supplier */
result = hfa384x_drvr_getconfig(hw, HFA384x_RID_STASUPRANGE, result = hfa384x_drvr_getconfig(hw, HFA384x_RID_STASUPRANGE,
&hw->cap_sup_sta, sizeof(hfa384x_caplevel_t)); &hw->cap_sup_sta,
if ( result ) { sizeof(hfa384x_caplevel_t));
if (result) {
printk(KERN_ERR "Failed to retrieve STASUPRANGE\n"); printk(KERN_ERR "Failed to retrieve STASUPRANGE\n");
goto failed; goto failed;
} }
...@@ -796,7 +786,7 @@ static int prism2sta_getcardinfo(wlandevice_t *wlandev) ...@@ -796,7 +786,7 @@ static int prism2sta_getcardinfo(wlandevice_t *wlandev)
hw->cap_sup_sta.bottom = hfa384x2host_16(hw->cap_sup_sta.bottom); hw->cap_sup_sta.bottom = hfa384x2host_16(hw->cap_sup_sta.bottom);
hw->cap_sup_sta.top = hfa384x2host_16(hw->cap_sup_sta.top); hw->cap_sup_sta.top = hfa384x2host_16(hw->cap_sup_sta.top);
if ( hw->cap_sup_sta.id == 0x04 ) { if (hw->cap_sup_sta.id == 0x04) {
printk(KERN_INFO printk(KERN_INFO
"STA:SUP:role=0x%02x:id=0x%02x:var=0x%02x:b/t=%d/%d\n", "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.role, hw->cap_sup_sta.id,
...@@ -812,8 +802,9 @@ static int prism2sta_getcardinfo(wlandevice_t *wlandev) ...@@ -812,8 +802,9 @@ static int prism2sta_getcardinfo(wlandevice_t *wlandev)
/* Compatibility range, primary f/w actor, CFI supplier */ /* Compatibility range, primary f/w actor, CFI supplier */
result = hfa384x_drvr_getconfig(hw, HFA384x_RID_PRI_CFIACTRANGES, result = hfa384x_drvr_getconfig(hw, HFA384x_RID_PRI_CFIACTRANGES,
&hw->cap_act_pri_cfi, sizeof(hfa384x_caplevel_t)); &hw->cap_act_pri_cfi,
if ( result ) { sizeof(hfa384x_caplevel_t));
if (result) {
printk(KERN_ERR "Failed to retrieve PRI_CFIACTRANGES\n"); printk(KERN_ERR "Failed to retrieve PRI_CFIACTRANGES\n");
goto failed; goto failed;
} }
...@@ -822,8 +813,10 @@ static int prism2sta_getcardinfo(wlandevice_t *wlandev) ...@@ -822,8 +813,10 @@ static int prism2sta_getcardinfo(wlandevice_t *wlandev)
fields in byte order */ fields in byte order */
hw->cap_act_pri_cfi.role = hfa384x2host_16(hw->cap_act_pri_cfi.role); hw->cap_act_pri_cfi.role = hfa384x2host_16(hw->cap_act_pri_cfi.role);
hw->cap_act_pri_cfi.id = hfa384x2host_16(hw->cap_act_pri_cfi.id); hw->cap_act_pri_cfi.id = hfa384x2host_16(hw->cap_act_pri_cfi.id);
hw->cap_act_pri_cfi.variant = hfa384x2host_16(hw->cap_act_pri_cfi.variant); hw->cap_act_pri_cfi.variant =
hw->cap_act_pri_cfi.bottom = hfa384x2host_16(hw->cap_act_pri_cfi.bottom); hfa384x2host_16(hw->cap_act_pri_cfi.variant);
hw->cap_act_pri_cfi.bottom =
hfa384x2host_16(hw->cap_act_pri_cfi.bottom);
hw->cap_act_pri_cfi.top = hfa384x2host_16(hw->cap_act_pri_cfi.top); hw->cap_act_pri_cfi.top = hfa384x2host_16(hw->cap_act_pri_cfi.top);
printk(KERN_INFO printk(KERN_INFO
...@@ -834,8 +827,9 @@ static int prism2sta_getcardinfo(wlandevice_t *wlandev) ...@@ -834,8 +827,9 @@ static int prism2sta_getcardinfo(wlandevice_t *wlandev)
/* Compatibility range, sta f/w actor, CFI supplier */ /* Compatibility range, sta f/w actor, CFI supplier */
result = hfa384x_drvr_getconfig(hw, HFA384x_RID_STA_CFIACTRANGES, result = hfa384x_drvr_getconfig(hw, HFA384x_RID_STA_CFIACTRANGES,
&hw->cap_act_sta_cfi, sizeof(hfa384x_caplevel_t)); &hw->cap_act_sta_cfi,
if ( result ) { sizeof(hfa384x_caplevel_t));
if (result) {
printk(KERN_ERR "Failed to retrieve STA_CFIACTRANGES\n"); printk(KERN_ERR "Failed to retrieve STA_CFIACTRANGES\n");
goto failed; goto failed;
} }
...@@ -844,8 +838,10 @@ static int prism2sta_getcardinfo(wlandevice_t *wlandev) ...@@ -844,8 +838,10 @@ static int prism2sta_getcardinfo(wlandevice_t *wlandev)
fields in byte order */ fields in byte order */
hw->cap_act_sta_cfi.role = hfa384x2host_16(hw->cap_act_sta_cfi.role); hw->cap_act_sta_cfi.role = hfa384x2host_16(hw->cap_act_sta_cfi.role);
hw->cap_act_sta_cfi.id = hfa384x2host_16(hw->cap_act_sta_cfi.id); hw->cap_act_sta_cfi.id = hfa384x2host_16(hw->cap_act_sta_cfi.id);
hw->cap_act_sta_cfi.variant = hfa384x2host_16(hw->cap_act_sta_cfi.variant); hw->cap_act_sta_cfi.variant =
hw->cap_act_sta_cfi.bottom = hfa384x2host_16(hw->cap_act_sta_cfi.bottom); hfa384x2host_16(hw->cap_act_sta_cfi.variant);
hw->cap_act_sta_cfi.bottom =
hfa384x2host_16(hw->cap_act_sta_cfi.bottom);
hw->cap_act_sta_cfi.top = hfa384x2host_16(hw->cap_act_sta_cfi.top); hw->cap_act_sta_cfi.top = hfa384x2host_16(hw->cap_act_sta_cfi.top);
printk(KERN_INFO printk(KERN_INFO
...@@ -856,8 +852,9 @@ static int prism2sta_getcardinfo(wlandevice_t *wlandev) ...@@ -856,8 +852,9 @@ static int prism2sta_getcardinfo(wlandevice_t *wlandev)
/* Compatibility range, sta f/w actor, MFI supplier */ /* Compatibility range, sta f/w actor, MFI supplier */
result = hfa384x_drvr_getconfig(hw, HFA384x_RID_STA_MFIACTRANGES, result = hfa384x_drvr_getconfig(hw, HFA384x_RID_STA_MFIACTRANGES,
&hw->cap_act_sta_mfi, sizeof(hfa384x_caplevel_t)); &hw->cap_act_sta_mfi,
if ( result ) { sizeof(hfa384x_caplevel_t));
if (result) {
printk(KERN_ERR "Failed to retrieve STA_MFIACTRANGES\n"); printk(KERN_ERR "Failed to retrieve STA_MFIACTRANGES\n");
goto failed; goto failed;
} }
...@@ -866,8 +863,10 @@ static int prism2sta_getcardinfo(wlandevice_t *wlandev) ...@@ -866,8 +863,10 @@ static int prism2sta_getcardinfo(wlandevice_t *wlandev)
fields in byte order */ fields in byte order */
hw->cap_act_sta_mfi.role = hfa384x2host_16(hw->cap_act_sta_mfi.role); hw->cap_act_sta_mfi.role = hfa384x2host_16(hw->cap_act_sta_mfi.role);
hw->cap_act_sta_mfi.id = hfa384x2host_16(hw->cap_act_sta_mfi.id); hw->cap_act_sta_mfi.id = hfa384x2host_16(hw->cap_act_sta_mfi.id);
hw->cap_act_sta_mfi.variant = hfa384x2host_16(hw->cap_act_sta_mfi.variant); hw->cap_act_sta_mfi.variant =
hw->cap_act_sta_mfi.bottom = hfa384x2host_16(hw->cap_act_sta_mfi.bottom); hfa384x2host_16(hw->cap_act_sta_mfi.variant);
hw->cap_act_sta_mfi.bottom =
hfa384x2host_16(hw->cap_act_sta_mfi.bottom);
hw->cap_act_sta_mfi.top = hfa384x2host_16(hw->cap_act_sta_mfi.top); hw->cap_act_sta_mfi.top = hfa384x2host_16(hw->cap_act_sta_mfi.top);
printk(KERN_INFO printk(KERN_INFO
...@@ -879,7 +878,7 @@ static int prism2sta_getcardinfo(wlandevice_t *wlandev) ...@@ -879,7 +878,7 @@ static int prism2sta_getcardinfo(wlandevice_t *wlandev)
/* Serial Number */ /* Serial Number */
result = hfa384x_drvr_getconfig(hw, HFA384x_RID_NICSERIALNUMBER, result = hfa384x_drvr_getconfig(hw, HFA384x_RID_NICSERIALNUMBER,
snum, HFA384x_RID_NICSERIALNUMBER_LEN); snum, HFA384x_RID_NICSERIALNUMBER_LEN);
if ( !result ) { if (!result) {
wlan_mkprintstr(snum, HFA384x_RID_NICSERIALNUMBER_LEN, wlan_mkprintstr(snum, HFA384x_RID_NICSERIALNUMBER_LEN,
pstr, sizeof(pstr)); pstr, sizeof(pstr));
printk(KERN_INFO "Prism2 card SN: %s\n", pstr); printk(KERN_INFO "Prism2 card SN: %s\n", pstr);
...@@ -891,7 +890,7 @@ static int prism2sta_getcardinfo(wlandevice_t *wlandev) ...@@ -891,7 +890,7 @@ static int prism2sta_getcardinfo(wlandevice_t *wlandev)
/* Collect the MAC address */ /* Collect the MAC address */
result = hfa384x_drvr_getconfig(hw, HFA384x_RID_CNFOWNMACADDR, result = hfa384x_drvr_getconfig(hw, HFA384x_RID_CNFOWNMACADDR,
wlandev->netdev->dev_addr, ETH_ALEN); wlandev->netdev->dev_addr, ETH_ALEN);
if ( result != 0 ) { if (result != 0) {
printk(KERN_ERR "Failed to retrieve mac address\n"); printk(KERN_ERR "Failed to retrieve mac address\n");
goto failed; goto failed;
} }
...@@ -912,7 +911,7 @@ static int prism2sta_getcardinfo(wlandevice_t *wlandev) ...@@ -912,7 +911,7 @@ static int prism2sta_getcardinfo(wlandevice_t *wlandev)
if (HFA384x_FIRMWARE_VERSION(hw->ident_sta_fw.major, if (HFA384x_FIRMWARE_VERSION(hw->ident_sta_fw.major,
hw->ident_sta_fw.minor, hw->ident_sta_fw.minor,
hw->ident_sta_fw.variant) < hw->ident_sta_fw.variant) <
HFA384x_FIRMWARE_VERSION(1,5,5)) { HFA384x_FIRMWARE_VERSION(1, 5, 5)) {
wlandev->nsdcaps |= P80211_NSDCAP_NOSCAN; wlandev->nsdcaps |= P80211_NSDCAP_NOSCAN;
} }
...@@ -925,7 +924,6 @@ static int prism2sta_getcardinfo(wlandevice_t *wlandev) ...@@ -925,7 +924,6 @@ static int prism2sta_getcardinfo(wlandevice_t *wlandev)
return result; return result;
} }
/*---------------------------------------------------------------- /*----------------------------------------------------------------
* prism2sta_globalsetup * prism2sta_globalsetup
* *
...@@ -946,7 +944,7 @@ static int prism2sta_getcardinfo(wlandevice_t *wlandev) ...@@ -946,7 +944,7 @@ static int prism2sta_getcardinfo(wlandevice_t *wlandev)
----------------------------------------------------------------*/ ----------------------------------------------------------------*/
static int prism2sta_globalsetup(wlandevice_t *wlandev) static int prism2sta_globalsetup(wlandevice_t *wlandev)
{ {
hfa384x_t *hw = (hfa384x_t *)wlandev->priv; hfa384x_t *hw = (hfa384x_t *) wlandev->priv;
/* Set the maximum frame size */ /* Set the maximum frame size */
return hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFMAXDATALEN, return hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFMAXDATALEN,
...@@ -956,30 +954,23 @@ static int prism2sta_globalsetup(wlandevice_t *wlandev) ...@@ -956,30 +954,23 @@ static int prism2sta_globalsetup(wlandevice_t *wlandev)
static int prism2sta_setmulticast(wlandevice_t *wlandev, netdevice_t *dev) static int prism2sta_setmulticast(wlandevice_t *wlandev, netdevice_t *dev)
{ {
int result = 0; int result = 0;
hfa384x_t *hw = (hfa384x_t *)wlandev->priv; hfa384x_t *hw = (hfa384x_t *) wlandev->priv;
u16 promisc; u16 promisc;
/* If we're not ready, what's the point? */ /* If we're not ready, what's the point? */
if ( hw->state != HFA384x_STATE_RUNNING ) if (hw->state != HFA384x_STATE_RUNNING)
goto exit; goto exit;
if ( (dev->flags & (IFF_PROMISC | IFF_ALLMULTI)) != 0 ) if ((dev->flags & (IFF_PROMISC | IFF_ALLMULTI)) != 0)
promisc = P80211ENUM_truth_true; promisc = P80211ENUM_truth_true;
else else
promisc = P80211ENUM_truth_false; promisc = P80211ENUM_truth_false;
result = hfa384x_drvr_setconfig16_async(hw, HFA384x_RID_PROMISCMODE, promisc); result =
hfa384x_drvr_setconfig16_async(hw, HFA384x_RID_PROMISCMODE,
/* XXX TODO: configure the multicast list */ promisc);
// CLEAR_HW_MULTICAST_LIST exit:
// struct dev_mc_list element = dev->mc_list;
// while (element != null) {
// HW_ADD_MULTICAST_ADDR(element->dmi_addr, dmi_addrlen)
// element = element->next;
// }
exit:
return result; return result;
} }
...@@ -1001,13 +992,13 @@ static int prism2sta_setmulticast(wlandevice_t *wlandev, netdevice_t *dev) ...@@ -1001,13 +992,13 @@ static int prism2sta_setmulticast(wlandevice_t *wlandev, netdevice_t *dev)
* Call context: * Call context:
* interrupt * interrupt
----------------------------------------------------------------*/ ----------------------------------------------------------------*/
static void prism2sta_inf_handover(wlandevice_t *wlandev, hfa384x_InfFrame_t *inf) static void prism2sta_inf_handover(wlandevice_t *wlandev,
hfa384x_InfFrame_t *inf)
{ {
pr_debug("received infoframe:HANDOVER (unhandled)\n"); pr_debug("received infoframe:HANDOVER (unhandled)\n");
return; return;
} }
/*---------------------------------------------------------------- /*----------------------------------------------------------------
* prism2sta_inf_tallies * prism2sta_inf_tallies
* *
...@@ -1025,9 +1016,10 @@ static void prism2sta_inf_handover(wlandevice_t *wlandev, hfa384x_InfFrame_t *in ...@@ -1025,9 +1016,10 @@ static void prism2sta_inf_handover(wlandevice_t *wlandev, hfa384x_InfFrame_t *in
* Call context: * Call context:
* interrupt * interrupt
----------------------------------------------------------------*/ ----------------------------------------------------------------*/
static void prism2sta_inf_tallies(wlandevice_t *wlandev, hfa384x_InfFrame_t *inf) static void prism2sta_inf_tallies(wlandevice_t *wlandev,
hfa384x_InfFrame_t *inf)
{ {
hfa384x_t *hw = (hfa384x_t *)wlandev->priv; hfa384x_t *hw = (hfa384x_t *) wlandev->priv;
u16 *src16; u16 *src16;
u32 *dst; u32 *dst;
u32 *src32; u32 *src32;
...@@ -1041,13 +1033,13 @@ static void prism2sta_inf_tallies(wlandevice_t *wlandev, hfa384x_InfFrame_t *inf ...@@ -1041,13 +1033,13 @@ static void prism2sta_inf_tallies(wlandevice_t *wlandev, hfa384x_InfFrame_t *inf
cnt = sizeof(hfa384x_CommTallies32_t) / sizeof(u32); cnt = sizeof(hfa384x_CommTallies32_t) / sizeof(u32);
if (inf->framelen > 22) { if (inf->framelen > 22) {
dst = (u32 *) &hw->tallies; dst = (u32 *)&hw->tallies;
src32 = (u32 *) &inf->info.commtallies32; src32 = (u32 *)&inf->info.commtallies32;
for (i = 0; i < cnt; i++, dst++, src32++) for (i = 0; i < cnt; i++, dst++, src32++)
*dst += hfa384x2host_32(*src32); *dst += hfa384x2host_32(*src32);
} else { } else {
dst = (u32 *) &hw->tallies; dst = (u32 *)&hw->tallies;
src16 = (u16 *) &inf->info.commtallies16; src16 = (u16 *)&inf->info.commtallies16;
for (i = 0; i < cnt; i++, dst++, src16++) for (i = 0; i < cnt; i++, dst++, src16++)
*dst += hfa384x2host_16(*src16); *dst += hfa384x2host_16(*src16);
} }
...@@ -1076,7 +1068,7 @@ static void prism2sta_inf_scanresults(wlandevice_t *wlandev, ...@@ -1076,7 +1068,7 @@ static void prism2sta_inf_scanresults(wlandevice_t *wlandev,
hfa384x_InfFrame_t *inf) hfa384x_InfFrame_t *inf)
{ {
hfa384x_t *hw = (hfa384x_t *)wlandev->priv; hfa384x_t *hw = (hfa384x_t *) wlandev->priv;
int nbss; int nbss;
hfa384x_ScanResult_t *sr = &(inf->info.scanresult); hfa384x_ScanResult_t *sr = &(inf->info.scanresult);
int i; int i;
...@@ -1085,31 +1077,29 @@ static void prism2sta_inf_scanresults(wlandevice_t *wlandev, ...@@ -1085,31 +1077,29 @@ static void prism2sta_inf_scanresults(wlandevice_t *wlandev,
/* Get the number of results, first in bytes, then in results */ /* Get the number of results, first in bytes, then in results */
nbss = (inf->framelen * sizeof(u16)) - nbss = (inf->framelen * sizeof(u16)) -
sizeof(inf->infotype) - sizeof(inf->infotype) - sizeof(inf->info.scanresult.scanreason);
sizeof(inf->info.scanresult.scanreason);
nbss /= sizeof(hfa384x_ScanResultSub_t); nbss /= sizeof(hfa384x_ScanResultSub_t);
/* Print em */ /* Print em */
pr_debug("rx scanresults, reason=%d, nbss=%d:\n", pr_debug("rx scanresults, reason=%d, nbss=%d:\n",
inf->info.scanresult.scanreason, nbss); inf->info.scanresult.scanreason, nbss);
for ( i = 0; i < nbss; i++) { for (i = 0; i < nbss; i++) {
pr_debug("chid=%d anl=%d sl=%d bcnint=%d\n", pr_debug("chid=%d anl=%d sl=%d bcnint=%d\n",
sr->result[i].chid, sr->result[i].chid,
sr->result[i].anl, sr->result[i].anl,
sr->result[i].sl, sr->result[i].sl, sr->result[i].bcnint);
sr->result[i].bcnint);
pr_debug(" capinfo=0x%04x proberesp_rate=%d\n", pr_debug(" capinfo=0x%04x proberesp_rate=%d\n",
sr->result[i].capinfo, sr->result[i].capinfo, sr->result[i].proberesp_rate);
sr->result[i].proberesp_rate);
} }
/* issue a join request */ /* issue a join request */
joinreq.channel = sr->result[0].chid; joinreq.channel = sr->result[0].chid;
memcpy( joinreq.bssid, sr->result[0].bssid, WLAN_BSSID_LEN); memcpy(joinreq.bssid, sr->result[0].bssid, WLAN_BSSID_LEN);
result = hfa384x_drvr_setconfig( hw, result = hfa384x_drvr_setconfig(hw,
HFA384x_RID_JOINREQUEST, HFA384x_RID_JOINREQUEST,
&joinreq, HFA384x_RID_JOINREQUEST_LEN); &joinreq, HFA384x_RID_JOINREQUEST_LEN);
if (result) { if (result) {
printk(KERN_ERR "setconfig(joinreq) failed, result=%d\n", result); printk(KERN_ERR "setconfig(joinreq) failed, result=%d\n",
result);
} }
return; return;
...@@ -1135,7 +1125,7 @@ static void prism2sta_inf_scanresults(wlandevice_t *wlandev, ...@@ -1135,7 +1125,7 @@ static void prism2sta_inf_scanresults(wlandevice_t *wlandev,
static void prism2sta_inf_hostscanresults(wlandevice_t *wlandev, static void prism2sta_inf_hostscanresults(wlandevice_t *wlandev,
hfa384x_InfFrame_t *inf) hfa384x_InfFrame_t *inf)
{ {
hfa384x_t *hw = (hfa384x_t *)wlandev->priv; hfa384x_t *hw = (hfa384x_t *) wlandev->priv;
int nbss; int nbss;
nbss = (inf->framelen - 3) / 32; nbss = (inf->framelen - 3) / 32;
...@@ -1178,27 +1168,38 @@ static void prism2sta_inf_hostscanresults(wlandevice_t *wlandev, ...@@ -1178,27 +1168,38 @@ static void prism2sta_inf_hostscanresults(wlandevice_t *wlandev,
static void prism2sta_inf_chinforesults(wlandevice_t *wlandev, static void prism2sta_inf_chinforesults(wlandevice_t *wlandev,
hfa384x_InfFrame_t *inf) hfa384x_InfFrame_t *inf)
{ {
hfa384x_t *hw = (hfa384x_t *)wlandev->priv; hfa384x_t *hw = (hfa384x_t *) wlandev->priv;
unsigned int i, n; unsigned int i, n;
hw->channel_info.results.scanchannels = hw->channel_info.results.scanchannels =
hfa384x2host_16(inf->info.chinforesult.scanchannels); hfa384x2host_16(inf->info.chinforesult.scanchannels);
for (i=0, n=0; i<HFA384x_CHINFORESULT_MAX; i++) { for (i = 0, n = 0; i < HFA384x_CHINFORESULT_MAX; i++) {
if (hw->channel_info.results.scanchannels & (1<<i)) { if (hw->channel_info.results.scanchannels & (1 << i)) {
int channel=hfa384x2host_16(inf->info.chinforesult.result[n].chid)-1; int channel =
hfa384x_ChInfoResultSub_t *chinforesult=&hw->channel_info.results.result[channel]; hfa384x2host_16(inf->info.chinforesult.result[n].
chid) - 1;
hfa384x_ChInfoResultSub_t *chinforesult =
&hw->channel_info.results.result[channel];
chinforesult->chid = channel; chinforesult->chid = channel;
chinforesult->anl = hfa384x2host_16(inf->info.chinforesult.result[n].anl); chinforesult->anl =
chinforesult->pnl = hfa384x2host_16(inf->info.chinforesult.result[n].pnl); hfa384x2host_16(inf->info.chinforesult.result[n].
chinforesult->active = hfa384x2host_16(inf->info.chinforesult.result[n].active); anl);
pr_debug("chinfo: channel %d, %s level (avg/peak)=%d/%d dB, pcf %d\n", chinforesult->pnl =
channel+1, hfa384x2host_16(inf->info.chinforesult.result[n].
chinforesult->active & pnl);
HFA384x_CHINFORESULT_BSSACTIVE ? "signal" : "noise", chinforesult->active =
chinforesult->anl, chinforesult->pnl, hfa384x2host_16(inf->info.chinforesult.result[n].
chinforesult->active & HFA384x_CHINFORESULT_PCFACTIVE ? 1 : 0 active);
); printk(KERN_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++; n++;
} }
} }
...@@ -1220,7 +1221,7 @@ void prism2sta_processing_defer(struct work_struct *data) ...@@ -1220,7 +1221,7 @@ void prism2sta_processing_defer(struct work_struct *data)
struct sk_buff *skb; struct sk_buff *skb;
hfa384x_InfFrame_t *inf; hfa384x_InfFrame_t *inf;
while ( (skb = skb_dequeue(&hw->authq)) ) { while ((skb = skb_dequeue(&hw->authq))) {
inf = (hfa384x_InfFrame_t *) skb->data; inf = (hfa384x_InfFrame_t *) skb->data;
prism2sta_inf_authreq_defer(wlandev, inf); prism2sta_inf_authreq_defer(wlandev, inf);
} }
...@@ -1233,7 +1234,7 @@ void prism2sta_processing_defer(struct work_struct *data) ...@@ -1233,7 +1234,7 @@ void prism2sta_processing_defer(struct work_struct *data)
hw->link_status = hw->link_status_new; hw->link_status = hw->link_status_new;
switch(hw->link_status) { switch (hw->link_status) {
case HFA384x_LINK_NOTCONNECTED: case HFA384x_LINK_NOTCONNECTED:
/* I'm currently assuming that this is the initial link /* I'm currently assuming that this is the initial link
* state. It should only be possible immediately * state. It should only be possible immediately
...@@ -1260,12 +1261,12 @@ void prism2sta_processing_defer(struct work_struct *data) ...@@ -1260,12 +1261,12 @@ void prism2sta_processing_defer(struct work_struct *data)
netif_carrier_on(wlandev->netdev); netif_carrier_on(wlandev->netdev);
/* If we are joining a specific AP, set our state and reset retries */ /* If we are joining a specific AP, set our state and reset retries */
if(hw->join_ap == 1) if (hw->join_ap == 1)
hw->join_ap = 2; hw->join_ap = 2;
hw->join_retries = 60; hw->join_retries = 60;
/* Don't call this in monitor mode */ /* Don't call this in monitor mode */
if ( wlandev->netdev->type == ARPHRD_ETHER ) { if (wlandev->netdev->type == ARPHRD_ETHER) {
u16 portstatus; u16 portstatus;
printk(KERN_INFO "linkstatus=CONNECTED\n"); printk(KERN_INFO "linkstatus=CONNECTED\n");
...@@ -1275,9 +1276,10 @@ void prism2sta_processing_defer(struct work_struct *data) ...@@ -1275,9 +1276,10 @@ void prism2sta_processing_defer(struct work_struct *data)
result = hfa384x_drvr_getconfig(hw, result = hfa384x_drvr_getconfig(hw,
HFA384x_RID_CURRENTBSSID, HFA384x_RID_CURRENTBSSID,
wlandev->bssid, WLAN_BSSID_LEN); wlandev->bssid,
if ( result ) { WLAN_BSSID_LEN);
pr_debug( if (result) {
printk(KERN_DEBUG
"getconfig(0x%02x) failed, result = %d\n", "getconfig(0x%02x) failed, result = %d\n",
HFA384x_RID_CURRENTBSSID, result); HFA384x_RID_CURRENTBSSID, result);
goto failed; goto failed;
...@@ -1286,20 +1288,22 @@ void prism2sta_processing_defer(struct work_struct *data) ...@@ -1286,20 +1288,22 @@ void prism2sta_processing_defer(struct work_struct *data)
result = hfa384x_drvr_getconfig(hw, result = hfa384x_drvr_getconfig(hw,
HFA384x_RID_CURRENTSSID, HFA384x_RID_CURRENTSSID,
&ssid, sizeof(ssid)); &ssid, sizeof(ssid));
if ( result ) { if (result) {
pr_debug( printk(KERN_DEBUG
"getconfig(0x%02x) failed, result = %d\n", "getconfig(0x%02x) failed, result = %d\n",
HFA384x_RID_CURRENTSSID, result); HFA384x_RID_CURRENTSSID, result);
goto failed; goto failed;
} }
prism2mgmt_bytestr2pstr((hfa384x_bytestr_t *)&ssid, prism2mgmt_bytestr2pstr((hfa384x_bytestr_t *)&ssid,
(p80211pstrd_t *) &wlandev->ssid); (p80211pstrd_t *)&wlandev->
ssid);
/* Collect the port status */ /* Collect the port status */
result = hfa384x_drvr_getconfig16(hw, result = hfa384x_drvr_getconfig16(hw,
HFA384x_RID_PORTSTATUS, &portstatus); HFA384x_RID_PORTSTATUS,
if ( result ) { &portstatus);
pr_debug( if (result) {
printk(KERN_DEBUG
"getconfig(0x%02x) failed, result = %d\n", "getconfig(0x%02x) failed, result = %d\n",
HFA384x_RID_PORTSTATUS, result); HFA384x_RID_PORTSTATUS, result);
goto failed; goto failed;
...@@ -1323,18 +1327,20 @@ void prism2sta_processing_defer(struct work_struct *data) ...@@ -1323,18 +1327,20 @@ void prism2sta_processing_defer(struct work_struct *data)
* Indicate Deauthentication * Indicate Deauthentication
* Block Transmits, Ignore receives of data frames * Block Transmits, Ignore receives of data frames
*/ */
if(hw->join_ap == 2) if (hw->join_ap == 2) {
{
hfa384x_JoinRequest_data_t joinreq; hfa384x_JoinRequest_data_t joinreq;
joinreq = hw->joinreq; joinreq = hw->joinreq;
/* Send the join request */ /* Send the join request */
hfa384x_drvr_setconfig( hw, hfa384x_drvr_setconfig(hw,
HFA384x_RID_JOINREQUEST, HFA384x_RID_JOINREQUEST,
&joinreq, HFA384x_RID_JOINREQUEST_LEN); &joinreq,
printk(KERN_INFO "linkstatus=DISCONNECTED (re-submitting join)\n"); HFA384x_RID_JOINREQUEST_LEN);
printk(KERN_INFO
"linkstatus=DISCONNECTED (re-submitting join)\n");
} else { } else {
if (wlandev->netdev->type == ARPHRD_ETHER) if (wlandev->netdev->type == ARPHRD_ETHER)
printk(KERN_INFO "linkstatus=DISCONNECTED (unhandled)\n"); printk(KERN_INFO
"linkstatus=DISCONNECTED (unhandled)\n");
} }
wlandev->macmode = WLAN_MACMODE_NONE; wlandev->macmode = WLAN_MACMODE_NONE;
...@@ -1362,8 +1368,8 @@ void prism2sta_processing_defer(struct work_struct *data) ...@@ -1362,8 +1368,8 @@ void prism2sta_processing_defer(struct work_struct *data)
result = hfa384x_drvr_getconfig(hw, result = hfa384x_drvr_getconfig(hw,
HFA384x_RID_CURRENTBSSID, HFA384x_RID_CURRENTBSSID,
wlandev->bssid, WLAN_BSSID_LEN); wlandev->bssid, WLAN_BSSID_LEN);
if ( result ) { if (result) {
pr_debug( printk(KERN_DEBUG
"getconfig(0x%02x) failed, result = %d\n", "getconfig(0x%02x) failed, result = %d\n",
HFA384x_RID_CURRENTBSSID, result); HFA384x_RID_CURRENTBSSID, result);
goto failed; goto failed;
...@@ -1372,15 +1378,14 @@ void prism2sta_processing_defer(struct work_struct *data) ...@@ -1372,15 +1378,14 @@ void prism2sta_processing_defer(struct work_struct *data)
result = hfa384x_drvr_getconfig(hw, result = hfa384x_drvr_getconfig(hw,
HFA384x_RID_CURRENTSSID, HFA384x_RID_CURRENTSSID,
&ssid, sizeof(ssid)); &ssid, sizeof(ssid));
if ( result ) { if (result) {
pr_debug( printk(KERN_DEBUG
"getconfig(0x%02x) failed, result = %d\n", "getconfig(0x%02x) failed, result = %d\n",
HFA384x_RID_CURRENTSSID, result); HFA384x_RID_CURRENTSSID, result);
goto failed; goto failed;
} }
prism2mgmt_bytestr2pstr((hfa384x_bytestr_t *)&ssid, prism2mgmt_bytestr2pstr((hfa384x_bytestr_t *)&ssid,
(p80211pstrd_t *) &wlandev->ssid); (p80211pstrd_t *)&wlandev->ssid);
hw->link_status = HFA384x_LINK_CONNECTED; hw->link_status = HFA384x_LINK_CONNECTED;
netif_carrier_on(wlandev->netdev); netif_carrier_on(wlandev->netdev);
...@@ -1428,15 +1433,16 @@ void prism2sta_processing_defer(struct work_struct *data) ...@@ -1428,15 +1433,16 @@ void prism2sta_processing_defer(struct work_struct *data)
* Response: * Response:
* Disable Transmits, Ignore receives of data frames * Disable Transmits, Ignore receives of data frames
*/ */
if(hw->join_ap && --hw->join_retries > 0) if (hw->join_ap && --hw->join_retries > 0) {
{
hfa384x_JoinRequest_data_t joinreq; hfa384x_JoinRequest_data_t joinreq;
joinreq = hw->joinreq; joinreq = hw->joinreq;
/* Send the join request */ /* Send the join request */
hfa384x_drvr_setconfig( hw, hfa384x_drvr_setconfig(hw,
HFA384x_RID_JOINREQUEST, HFA384x_RID_JOINREQUEST,
&joinreq, HFA384x_RID_JOINREQUEST_LEN); &joinreq,
printk(KERN_INFO "linkstatus=ASSOCFAIL (re-submitting join)\n"); HFA384x_RID_JOINREQUEST_LEN);
printk(KERN_INFO
"linkstatus=ASSOCFAIL (re-submitting join)\n");
} else { } else {
printk(KERN_INFO "linkstatus=ASSOCFAIL (unhandled)\n"); printk(KERN_INFO "linkstatus=ASSOCFAIL (unhandled)\n");
} }
...@@ -1458,7 +1464,7 @@ void prism2sta_processing_defer(struct work_struct *data) ...@@ -1458,7 +1464,7 @@ void prism2sta_processing_defer(struct work_struct *data)
p80211wext_event_associated(wlandev, wlandev->linkstatus); p80211wext_event_associated(wlandev, wlandev->linkstatus);
#endif #endif
failed: failed:
return; return;
} }
...@@ -1482,7 +1488,7 @@ void prism2sta_processing_defer(struct work_struct *data) ...@@ -1482,7 +1488,7 @@ void prism2sta_processing_defer(struct work_struct *data)
static void prism2sta_inf_linkstatus(wlandevice_t *wlandev, static void prism2sta_inf_linkstatus(wlandevice_t *wlandev,
hfa384x_InfFrame_t *inf) hfa384x_InfFrame_t *inf)
{ {
hfa384x_t *hw = (hfa384x_t *)wlandev->priv; hfa384x_t *hw = (hfa384x_t *) wlandev->priv;
hw->link_status_new = hfa384x2host_16(inf->info.linkstatus.linkstatus); hw->link_status_new = hfa384x2host_16(inf->info.linkstatus.linkstatus);
...@@ -1512,7 +1518,7 @@ static void prism2sta_inf_linkstatus(wlandevice_t *wlandev, ...@@ -1512,7 +1518,7 @@ static void prism2sta_inf_linkstatus(wlandevice_t *wlandev,
static void prism2sta_inf_assocstatus(wlandevice_t *wlandev, static void prism2sta_inf_assocstatus(wlandevice_t *wlandev,
hfa384x_InfFrame_t *inf) hfa384x_InfFrame_t *inf)
{ {
hfa384x_t *hw = (hfa384x_t *)wlandev->priv; hfa384x_t *hw = (hfa384x_t *) wlandev->priv;
hfa384x_AssocStatus_t rec; hfa384x_AssocStatus_t rec;
int i; int i;
...@@ -1537,14 +1543,16 @@ static void prism2sta_inf_assocstatus(wlandevice_t *wlandev, ...@@ -1537,14 +1543,16 @@ 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 "assocstatus info frame received for non-authenticated station.\n"); printk(KERN_WARNING
"assocstatus info frame received for non-authenticated station.\n");
} else { } else {
hw->authlist.assoc[i] = hw->authlist.assoc[i] =
(rec.assocstatus == HFA384x_ASSOCSTATUS_STAASSOC || (rec.assocstatus == HFA384x_ASSOCSTATUS_STAASSOC ||
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 "authfail assocstatus info frame received for authenticated station.\n"); printk(KERN_WARNING
"authfail assocstatus info frame received for authenticated station.\n");
} }
return; return;
...@@ -1572,7 +1580,7 @@ static void prism2sta_inf_assocstatus(wlandevice_t *wlandev, ...@@ -1572,7 +1580,7 @@ static void prism2sta_inf_assocstatus(wlandevice_t *wlandev,
static void prism2sta_inf_authreq(wlandevice_t *wlandev, static void prism2sta_inf_authreq(wlandevice_t *wlandev,
hfa384x_InfFrame_t *inf) hfa384x_InfFrame_t *inf)
{ {
hfa384x_t *hw = (hfa384x_t *)wlandev->priv; hfa384x_t *hw = (hfa384x_t *) wlandev->priv;
struct sk_buff *skb; struct sk_buff *skb;
skb = dev_alloc_skb(sizeof(*inf)); skb = dev_alloc_skb(sizeof(*inf));
...@@ -1587,7 +1595,7 @@ static void prism2sta_inf_authreq(wlandevice_t *wlandev, ...@@ -1587,7 +1595,7 @@ static void prism2sta_inf_authreq(wlandevice_t *wlandev,
static void prism2sta_inf_authreq_defer(wlandevice_t *wlandev, static void prism2sta_inf_authreq_defer(wlandevice_t *wlandev,
hfa384x_InfFrame_t *inf) hfa384x_InfFrame_t *inf)
{ {
hfa384x_t *hw = (hfa384x_t *)wlandev->priv; hfa384x_t *hw = (hfa384x_t *) wlandev->priv;
hfa384x_authenticateStation_data_t rec; hfa384x_authenticateStation_data_t rec;
int i, added, result, cnt; int i, added, result, cnt;
...@@ -1703,7 +1711,8 @@ static void prism2sta_inf_authreq_defer(wlandevice_t *wlandev, ...@@ -1703,7 +1711,8 @@ static void prism2sta_inf_authreq_defer(wlandevice_t *wlandev,
if (rec.status == P80211ENUM_status_successful) { if (rec.status == P80211ENUM_status_successful) {
for (i = 0; i < hw->authlist.cnt; i++) for (i = 0; i < hw->authlist.cnt; i++)
if (memcmp(rec.address, hw->authlist.addr[i], ETH_ALEN) == 0) if (memcmp(rec.address, hw->authlist.addr[i], ETH_ALEN)
== 0)
break; break;
if (i >= hw->authlist.cnt) { if (i >= hw->authlist.cnt) {
...@@ -1730,13 +1739,15 @@ static void prism2sta_inf_authreq_defer(wlandevice_t *wlandev, ...@@ -1730,13 +1739,15 @@ static void prism2sta_inf_authreq_defer(wlandevice_t *wlandev,
result = hfa384x_drvr_setconfig(hw, HFA384x_RID_AUTHENTICATESTA, result = hfa384x_drvr_setconfig(hw, HFA384x_RID_AUTHENTICATESTA,
&rec, sizeof(rec)); &rec, sizeof(rec));
if (result) { if (result) {
if (added) hw->authlist.cnt--; if (added)
printk(KERN_ERR "setconfig(authenticatestation) failed, result=%d\n", result); hw->authlist.cnt--;
printk(KERN_ERR
"setconfig(authenticatestation) failed, result=%d\n",
result);
} }
return; return;
} }
/*---------------------------------------------------------------- /*----------------------------------------------------------------
* prism2sta_inf_psusercnt * prism2sta_inf_psusercnt
* *
...@@ -1758,7 +1769,7 @@ static void prism2sta_inf_authreq_defer(wlandevice_t *wlandev, ...@@ -1758,7 +1769,7 @@ static void prism2sta_inf_authreq_defer(wlandevice_t *wlandev,
static void prism2sta_inf_psusercnt(wlandevice_t *wlandev, static void prism2sta_inf_psusercnt(wlandevice_t *wlandev,
hfa384x_InfFrame_t *inf) hfa384x_InfFrame_t *inf)
{ {
hfa384x_t *hw = (hfa384x_t *)wlandev->priv; hfa384x_t *hw = (hfa384x_t *) wlandev->priv;
hw->psusercount = hfa384x2host_16(inf->info.psusercnt.usercnt); hw->psusercount = hfa384x2host_16(inf->info.psusercnt.usercnt);
...@@ -1786,7 +1797,7 @@ void prism2sta_ev_info(wlandevice_t *wlandev, hfa384x_InfFrame_t *inf) ...@@ -1786,7 +1797,7 @@ void prism2sta_ev_info(wlandevice_t *wlandev, hfa384x_InfFrame_t *inf)
{ {
inf->infotype = hfa384x2host_16(inf->infotype); inf->infotype = hfa384x2host_16(inf->infotype);
/* Dispatch */ /* Dispatch */
switch ( inf->infotype ) { switch (inf->infotype) {
case HFA384x_IT_HANDOVERADDR: case HFA384x_IT_HANDOVERADDR:
prism2sta_inf_handover(wlandev, inf); prism2sta_inf_handover(wlandev, inf);
break; break;
...@@ -1831,7 +1842,6 @@ void prism2sta_ev_info(wlandevice_t *wlandev, hfa384x_InfFrame_t *inf) ...@@ -1831,7 +1842,6 @@ void prism2sta_ev_info(wlandevice_t *wlandev, hfa384x_InfFrame_t *inf)
return; return;
} }
/*---------------------------------------------------------------- /*----------------------------------------------------------------
* prism2sta_ev_txexc * prism2sta_ev_txexc
* *
...@@ -1858,7 +1868,6 @@ void prism2sta_ev_txexc(wlandevice_t *wlandev, u16 status) ...@@ -1858,7 +1868,6 @@ void prism2sta_ev_txexc(wlandevice_t *wlandev, u16 status)
return; return;
} }
/*---------------------------------------------------------------- /*----------------------------------------------------------------
* prism2sta_ev_tx * prism2sta_ev_tx
* *
...@@ -1883,7 +1892,6 @@ void prism2sta_ev_tx(wlandevice_t *wlandev, u16 status) ...@@ -1883,7 +1892,6 @@ void prism2sta_ev_tx(wlandevice_t *wlandev, u16 status)
return; return;
} }
/*---------------------------------------------------------------- /*----------------------------------------------------------------
* prism2sta_ev_rx * prism2sta_ev_rx
* *
...@@ -1958,8 +1966,10 @@ static wlandevice_t *create_wlan(void) ...@@ -1958,8 +1966,10 @@ static wlandevice_t *create_wlan(void)
if (!wlandev || !hw) { if (!wlandev || !hw) {
printk(KERN_ERR "%s: Memory allocation failure.\n", dev_info); printk(KERN_ERR "%s: Memory allocation failure.\n", dev_info);
if (wlandev) kfree(wlandev); if (wlandev)
if (hw) kfree(hw); kfree(wlandev);
if (hw)
kfree(hw);
return NULL; return NULL;
} }
...@@ -1979,8 +1989,7 @@ static wlandevice_t *create_wlan(void) ...@@ -1979,8 +1989,7 @@ static wlandevice_t *create_wlan(void)
wlandev->set_multicast_list = prism2sta_setmulticast; wlandev->set_multicast_list = prism2sta_setmulticast;
wlandev->tx_timeout = hfa384x_tx_timeout; wlandev->tx_timeout = hfa384x_tx_timeout;
wlandev->nsdcaps = P80211_NSDCAP_HWFRAGMENT | wlandev->nsdcaps = P80211_NSDCAP_HWFRAGMENT | P80211_NSDCAP_AUTOJOIN;
P80211_NSDCAP_AUTOJOIN;
/* Initialize the device private data stucture. */ /* Initialize the device private data stucture. */
hw->dot11_desired_bss_type = 1; hw->dot11_desired_bss_type = 1;
...@@ -2015,10 +2024,6 @@ void prism2sta_commsqual_defer(struct work_struct *data) ...@@ -2015,10 +2024,6 @@ void prism2sta_commsqual_defer(struct work_struct *data)
goto done; goto done;
} }
// qual.CQ_currBSS; // link
// ASL_currBSS; // level
// qual.ANL_currFC; // noise
pr_debug("commsqual %d %d %d\n", pr_debug("commsqual %d %d %d\n",
hfa384x2host_16(hw->qual.CQ_currBSS), hfa384x2host_16(hw->qual.CQ_currBSS),
hfa384x2host_16(hw->qual.ASL_currBSS), hfa384x2host_16(hw->qual.ASL_currBSS),
...@@ -2029,8 +2034,8 @@ void prism2sta_commsqual_defer(struct work_struct *data) ...@@ -2029,8 +2034,8 @@ void prism2sta_commsqual_defer(struct work_struct *data)
result = hfa384x_drvr_getconfig(hw, result = hfa384x_drvr_getconfig(hw,
HFA384x_RID_CURRENTBSSID, HFA384x_RID_CURRENTBSSID,
wlandev->bssid, WLAN_BSSID_LEN); wlandev->bssid, WLAN_BSSID_LEN);
if ( result ) { if (result) {
pr_debug( printk(KERN_DEBUG
"getconfig(0x%02x) failed, result = %d\n", "getconfig(0x%02x) failed, result = %d\n",
HFA384x_RID_CURRENTBSSID, result); HFA384x_RID_CURRENTBSSID, result);
goto done; goto done;
...@@ -2039,20 +2044,19 @@ void prism2sta_commsqual_defer(struct work_struct *data) ...@@ -2039,20 +2044,19 @@ void prism2sta_commsqual_defer(struct work_struct *data)
result = hfa384x_drvr_getconfig(hw, result = hfa384x_drvr_getconfig(hw,
HFA384x_RID_CURRENTSSID, HFA384x_RID_CURRENTSSID,
&ssid, sizeof(ssid)); &ssid, sizeof(ssid));
if ( result ) { if (result) {
pr_debug( printk(KERN_DEBUG
"getconfig(0x%02x) failed, result = %d\n", "getconfig(0x%02x) failed, result = %d\n",
HFA384x_RID_CURRENTSSID, result); HFA384x_RID_CURRENTSSID, result);
goto done; goto done;
} }
prism2mgmt_bytestr2pstr((hfa384x_bytestr_t *)&ssid, prism2mgmt_bytestr2pstr((hfa384x_bytestr_t *)&ssid,
(p80211pstrd_t *) &wlandev->ssid); (p80211pstrd_t *)&wlandev->ssid);
/* Reschedule timer */ /* Reschedule timer */
mod_timer(&hw->commsqual_timer, jiffies + HZ); mod_timer(&hw->commsqual_timer, jiffies + HZ);
done: done:
; ;
} }
...@@ -2062,5 +2066,3 @@ void prism2sta_commsqual_timer(unsigned long data) ...@@ -2062,5 +2066,3 @@ void prism2sta_commsqual_timer(unsigned long data)
schedule_work(&hw->commsqual_bh); schedule_work(&hw->commsqual_bh);
} }
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