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

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

Signed-off-by: default avatarMoritz Muehlenhoff <jmm@debian.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent bb127932
...@@ -50,11 +50,7 @@ ...@@ -50,11 +50,7 @@
* -------------------------------------------------------------------- * --------------------------------------------------------------------
*/ */
/*================================================================*/
/* System Includes */
#include <linux/version.h> #include <linux/version.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/sched.h> #include <linux/sched.h>
...@@ -62,15 +58,12 @@ ...@@ -62,15 +58,12 @@
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/wireless.h> #include <linux/wireless.h>
#include <linux/netdevice.h> #include <linux/netdevice.h>
#include <asm/io.h> #include <linux/io.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <asm/byteorder.h> #include <asm/byteorder.h>
#include <linux/usb.h> #include <linux/usb.h>
#include <linux/bitops.h> #include <linux/bitops.h>
/*================================================================*/
/* Project Includes */
#include "p80211types.h" #include "p80211types.h"
#include "p80211hdr.h" #include "p80211hdr.h"
#include "p80211mgmt.h" #include "p80211mgmt.h"
...@@ -82,196 +75,169 @@ ...@@ -82,196 +75,169 @@
#include "hfa384x.h" #include "hfa384x.h"
#include "prism2mgmt.h" #include "prism2mgmt.h"
/*================================================================*/
/* Local Constants */
#define MIB_TMP_MAXLEN 200 /* Max length of RID record (in bytes). */ #define MIB_TMP_MAXLEN 200 /* Max length of RID record (in bytes). */
/*================================================================*/
/* Local Types */
#define F_STA 0x1 /* MIB is supported on stations. */ #define F_STA 0x1 /* MIB is supported on stations. */
#define F_READ 0x2 /* MIB may be read. */ #define F_READ 0x2 /* MIB may be read. */
#define F_WRITE 0x4 /* MIB may be written. */ #define F_WRITE 0x4 /* MIB may be written. */
typedef struct mibrec typedef struct mibrec {
{
u32 did; u32 did;
u16 flag; u16 flag;
u16 parm1; u16 parm1;
u16 parm2; u16 parm2;
u16 parm3; u16 parm3;
int (*func)(struct mibrec *mib, int (*func) (struct mibrec *mib,
int isget,
wlandevice_t *wlandev,
hfa384x_t *hw,
p80211msg_dot11req_mibset_t *msg, void *data);
} mibrec_t;
static int prism2mib_bytearea2pstr(mibrec_t *mib,
int isget,
wlandevice_t *wlandev,
hfa384x_t *hw,
p80211msg_dot11req_mibset_t *msg,
void *data);
static int prism2mib_uint32(mibrec_t *mib,
int isget,
wlandevice_t *wlandev,
hfa384x_t *hw,
p80211msg_dot11req_mibset_t *msg, void *data);
static int prism2mib_flag(mibrec_t *mib,
int isget,
wlandevice_t *wlandev,
hfa384x_t *hw,
p80211msg_dot11req_mibset_t *msg, void *data);
static int prism2mib_wepdefaultkey(mibrec_t *mib,
int isget, int isget,
wlandevice_t *wlandev, wlandevice_t *wlandev,
hfa384x_t *hw, hfa384x_t *hw,
p80211msg_dot11req_mibset_t *msg, p80211msg_dot11req_mibset_t *msg,
void *data); void *data);
} mibrec_t;
/*================================================================*/ static int prism2mib_privacyinvoked(mibrec_t *mib,
/* Local Function Declarations */ int isget,
wlandevice_t *wlandev,
static int prism2mib_bytearea2pstr( hfa384x_t *hw,
mibrec_t *mib, p80211msg_dot11req_mibset_t *msg,
int isget, void *data);
wlandevice_t *wlandev,
hfa384x_t *hw, static int prism2mib_excludeunencrypted(mibrec_t *mib,
p80211msg_dot11req_mibset_t *msg, int isget,
void *data); wlandevice_t *wlandev,
hfa384x_t *hw,
static int prism2mib_uint32( p80211msg_dot11req_mibset_t *msg,
mibrec_t *mib, void *data);
int isget,
wlandevice_t *wlandev, static int prism2mib_fragmentationthreshold(mibrec_t *mib,
hfa384x_t *hw, int isget,
p80211msg_dot11req_mibset_t *msg, wlandevice_t *wlandev,
void *data); hfa384x_t *hw,
p80211msg_dot11req_mibset_t *msg,
static int prism2mib_flag( void *data);
mibrec_t *mib,
int isget, static int prism2mib_priv(mibrec_t *mib,
wlandevice_t *wlandev, int isget,
hfa384x_t *hw, wlandevice_t *wlandev,
p80211msg_dot11req_mibset_t *msg, hfa384x_t *hw,
void *data); p80211msg_dot11req_mibset_t *msg, void *data);
static int prism2mib_wepdefaultkey(
mibrec_t *mib,
int isget,
wlandevice_t *wlandev,
hfa384x_t *hw,
p80211msg_dot11req_mibset_t *msg,
void *data);
static int prism2mib_privacyinvoked(
mibrec_t *mib,
int isget,
wlandevice_t *wlandev,
hfa384x_t *hw,
p80211msg_dot11req_mibset_t *msg,
void *data);
static int prism2mib_excludeunencrypted(
mibrec_t *mib,
int isget,
wlandevice_t *wlandev,
hfa384x_t *hw,
p80211msg_dot11req_mibset_t *msg,
void *data);
static int prism2mib_fragmentationthreshold(
mibrec_t *mib,
int isget,
wlandevice_t *wlandev,
hfa384x_t *hw,
p80211msg_dot11req_mibset_t *msg,
void *data);
static int prism2mib_priv(
mibrec_t *mib,
int isget,
wlandevice_t *wlandev,
hfa384x_t *hw,
p80211msg_dot11req_mibset_t *msg,
void *data);
/*================================================================*/
/* Local Static Definitions */
static mibrec_t mibtab[] = { static mibrec_t mibtab[] = {
/* dot11smt MIB's */ /* dot11smt MIB's */
{ DIDmib_dot11smt_dot11WEPDefaultKeysTable_dot11WEPDefaultKey0, {DIDmib_dot11smt_dot11WEPDefaultKeysTable_dot11WEPDefaultKey0,
F_STA | F_WRITE, F_STA | F_WRITE,
HFA384x_RID_CNFWEPDEFAULTKEY0, 0, 0, HFA384x_RID_CNFWEPDEFAULTKEY0, 0, 0,
prism2mib_wepdefaultkey }, prism2mib_wepdefaultkey},
{ DIDmib_dot11smt_dot11WEPDefaultKeysTable_dot11WEPDefaultKey1, {DIDmib_dot11smt_dot11WEPDefaultKeysTable_dot11WEPDefaultKey1,
F_STA | F_WRITE, F_STA | F_WRITE,
HFA384x_RID_CNFWEPDEFAULTKEY1, 0, 0, HFA384x_RID_CNFWEPDEFAULTKEY1, 0, 0,
prism2mib_wepdefaultkey }, prism2mib_wepdefaultkey},
{ DIDmib_dot11smt_dot11WEPDefaultKeysTable_dot11WEPDefaultKey2, {DIDmib_dot11smt_dot11WEPDefaultKeysTable_dot11WEPDefaultKey2,
F_STA | F_WRITE, F_STA | F_WRITE,
HFA384x_RID_CNFWEPDEFAULTKEY2, 0, 0, HFA384x_RID_CNFWEPDEFAULTKEY2, 0, 0,
prism2mib_wepdefaultkey }, prism2mib_wepdefaultkey},
{ DIDmib_dot11smt_dot11WEPDefaultKeysTable_dot11WEPDefaultKey3, {DIDmib_dot11smt_dot11WEPDefaultKeysTable_dot11WEPDefaultKey3,
F_STA | F_WRITE, F_STA | F_WRITE,
HFA384x_RID_CNFWEPDEFAULTKEY3, 0, 0, HFA384x_RID_CNFWEPDEFAULTKEY3, 0, 0,
prism2mib_wepdefaultkey }, prism2mib_wepdefaultkey},
{ DIDmib_dot11smt_dot11PrivacyTable_dot11PrivacyInvoked, {DIDmib_dot11smt_dot11PrivacyTable_dot11PrivacyInvoked,
F_STA | F_READ | F_WRITE, F_STA | F_READ | F_WRITE,
HFA384x_RID_CNFWEPFLAGS, HFA384x_WEPFLAGS_PRIVINVOKED, 0, HFA384x_RID_CNFWEPFLAGS, HFA384x_WEPFLAGS_PRIVINVOKED, 0,
prism2mib_privacyinvoked }, prism2mib_privacyinvoked},
{ DIDmib_dot11smt_dot11PrivacyTable_dot11WEPDefaultKeyID, {DIDmib_dot11smt_dot11PrivacyTable_dot11WEPDefaultKeyID,
F_STA | F_READ | F_WRITE, F_STA | F_READ | F_WRITE,
HFA384x_RID_CNFWEPDEFAULTKEYID, 0, 0, HFA384x_RID_CNFWEPDEFAULTKEYID, 0, 0,
prism2mib_uint32 }, prism2mib_uint32},
{ DIDmib_dot11smt_dot11PrivacyTable_dot11ExcludeUnencrypted, {DIDmib_dot11smt_dot11PrivacyTable_dot11ExcludeUnencrypted,
F_STA | F_READ | F_WRITE, F_STA | F_READ | F_WRITE,
HFA384x_RID_CNFWEPFLAGS, HFA384x_WEPFLAGS_EXCLUDE, 0, HFA384x_RID_CNFWEPFLAGS, HFA384x_WEPFLAGS_EXCLUDE, 0,
prism2mib_excludeunencrypted }, prism2mib_excludeunencrypted},
/* dot11mac MIB's */ /* dot11mac MIB's */
{ DIDmib_dot11mac_dot11OperationTable_dot11MACAddress, {DIDmib_dot11mac_dot11OperationTable_dot11MACAddress,
F_STA | F_READ | F_WRITE, F_STA | F_READ | F_WRITE,
HFA384x_RID_CNFOWNMACADDR, HFA384x_RID_CNFOWNMACADDR_LEN, 0, HFA384x_RID_CNFOWNMACADDR, HFA384x_RID_CNFOWNMACADDR_LEN, 0,
prism2mib_bytearea2pstr }, prism2mib_bytearea2pstr},
{ DIDmib_dot11mac_dot11OperationTable_dot11RTSThreshold, {DIDmib_dot11mac_dot11OperationTable_dot11RTSThreshold,
F_STA | F_READ | F_WRITE, F_STA | F_READ | F_WRITE,
HFA384x_RID_RTSTHRESH, 0, 0, HFA384x_RID_RTSTHRESH, 0, 0,
prism2mib_uint32 }, prism2mib_uint32},
{ DIDmib_dot11mac_dot11OperationTable_dot11ShortRetryLimit, {DIDmib_dot11mac_dot11OperationTable_dot11ShortRetryLimit,
F_STA | F_READ, F_STA | F_READ,
HFA384x_RID_SHORTRETRYLIMIT, 0, 0, HFA384x_RID_SHORTRETRYLIMIT, 0, 0,
prism2mib_uint32 }, prism2mib_uint32},
{ DIDmib_dot11mac_dot11OperationTable_dot11LongRetryLimit, {DIDmib_dot11mac_dot11OperationTable_dot11LongRetryLimit,
F_STA | F_READ, F_STA | F_READ,
HFA384x_RID_LONGRETRYLIMIT, 0, 0, HFA384x_RID_LONGRETRYLIMIT, 0, 0,
prism2mib_uint32 }, prism2mib_uint32},
{ DIDmib_dot11mac_dot11OperationTable_dot11FragmentationThreshold, {DIDmib_dot11mac_dot11OperationTable_dot11FragmentationThreshold,
F_STA | F_READ | F_WRITE, F_STA | F_READ | F_WRITE,
HFA384x_RID_FRAGTHRESH, 0, 0, HFA384x_RID_FRAGTHRESH, 0, 0,
prism2mib_fragmentationthreshold }, prism2mib_fragmentationthreshold},
{ DIDmib_dot11mac_dot11OperationTable_dot11MaxTransmitMSDULifetime, {DIDmib_dot11mac_dot11OperationTable_dot11MaxTransmitMSDULifetime,
F_STA | F_READ, F_STA | F_READ,
HFA384x_RID_MAXTXLIFETIME, 0, 0, HFA384x_RID_MAXTXLIFETIME, 0, 0,
prism2mib_uint32 }, prism2mib_uint32},
/* dot11phy MIB's */ /* dot11phy MIB's */
{ DIDmib_dot11phy_dot11PhyDSSSTable_dot11CurrentChannel, {DIDmib_dot11phy_dot11PhyDSSSTable_dot11CurrentChannel,
F_STA | F_READ, F_STA | F_READ,
HFA384x_RID_CURRENTCHANNEL, 0, 0, HFA384x_RID_CURRENTCHANNEL, 0, 0,
prism2mib_uint32 }, prism2mib_uint32},
{ DIDmib_dot11phy_dot11PhyTxPowerTable_dot11CurrentTxPowerLevel, {DIDmib_dot11phy_dot11PhyTxPowerTable_dot11CurrentTxPowerLevel,
F_STA | F_READ | F_WRITE, F_STA | F_READ | F_WRITE,
HFA384x_RID_TXPOWERMAX, 0, 0, HFA384x_RID_TXPOWERMAX, 0, 0,
prism2mib_uint32 }, prism2mib_uint32},
/* p2Static MIB's */ /* p2Static MIB's */
{ DIDmib_p2_p2Static_p2CnfPortType, {DIDmib_p2_p2Static_p2CnfPortType,
F_STA | F_READ | F_WRITE, F_STA | F_READ | F_WRITE,
HFA384x_RID_CNFPORTTYPE, 0, 0, HFA384x_RID_CNFPORTTYPE, 0, 0,
prism2mib_uint32 }, prism2mib_uint32},
/* p2MAC MIB's */ /* p2MAC MIB's */
{ DIDmib_p2_p2MAC_p2CurrentTxRate, {DIDmib_p2_p2MAC_p2CurrentTxRate,
F_STA | F_READ, F_STA | F_READ,
HFA384x_RID_CURRENTTXRATE, 0, 0, HFA384x_RID_CURRENTTXRATE, 0, 0,
prism2mib_uint32 }, prism2mib_uint32},
/* And finally, lnx mibs */ /* And finally, lnx mibs */
{ DIDmib_lnx_lnxConfigTable_lnxRSNAIE, {DIDmib_lnx_lnxConfigTable_lnxRSNAIE,
F_STA | F_READ | F_WRITE, F_STA | F_READ | F_WRITE,
HFA384x_RID_CNFWPADATA, 0, 0, HFA384x_RID_CNFWPADATA, 0, 0,
prism2mib_priv }, prism2mib_priv},
{ 0, 0, 0, 0, 0, NULL}}; {0, 0, 0, 0, 0, NULL}
};
/*================================================================*/
/* Function Definitions */
/*---------------------------------------------------------------- /*----------------------------------------------------------------
* prism2mgmt_mibset_mibget * prism2mgmt_mibset_mibget
...@@ -361,8 +327,7 @@ int prism2mgmt_mibset_mibget(wlandevice_t *wlandev, void *msgp) ...@@ -361,8 +327,7 @@ int prism2mgmt_mibset_mibget(wlandevice_t *wlandev, void *msgp)
** portion of the "mibattribute". ** portion of the "mibattribute".
*/ */
result = mib->func(mib, isget, wlandev, hw, msg, result = mib->func(mib, isget, wlandev, hw, msg, (void *)mibitem->data);
(void *) mibitem->data);
if (msg->resultcode.data == P80211ENUM_resultcode_success) { if (msg->resultcode.data == P80211ENUM_resultcode_success) {
if (result != 0) { if (result != 0) {
...@@ -381,7 +346,7 @@ int prism2mgmt_mibset_mibget(wlandevice_t *wlandev, void *msgp) ...@@ -381,7 +346,7 @@ int prism2mgmt_mibset_mibget(wlandevice_t *wlandev, void *msgp)
} }
done: done:
return(0); return 0;
} }
/*---------------------------------------------------------------- /*----------------------------------------------------------------
...@@ -409,28 +374,29 @@ done: ...@@ -409,28 +374,29 @@ done:
* *
----------------------------------------------------------------*/ ----------------------------------------------------------------*/
static int prism2mib_bytearea2pstr( static int prism2mib_bytearea2pstr(mibrec_t *mib,
mibrec_t *mib, int isget,
int isget, wlandevice_t *wlandev,
wlandevice_t *wlandev, hfa384x_t *hw,
hfa384x_t *hw, p80211msg_dot11req_mibset_t *msg,
p80211msg_dot11req_mibset_t *msg, void *data)
void *data)
{ {
int result; int result;
p80211pstrd_t *pstr = (p80211pstrd_t*) data; p80211pstrd_t *pstr = (p80211pstrd_t *) data;
u8 bytebuf[MIB_TMP_MAXLEN]; u8 bytebuf[MIB_TMP_MAXLEN];
if (isget) { if (isget) {
result = hfa384x_drvr_getconfig(hw, mib->parm1, bytebuf, mib->parm2); result =
hfa384x_drvr_getconfig(hw, mib->parm1, bytebuf, mib->parm2);
prism2mgmt_bytearea2pstr(bytebuf, pstr, mib->parm2); prism2mgmt_bytearea2pstr(bytebuf, pstr, mib->parm2);
} else { } else {
memset(bytebuf, 0, mib->parm2); memset(bytebuf, 0, mib->parm2);
prism2mgmt_pstr2bytearea(bytebuf, pstr); prism2mgmt_pstr2bytearea(bytebuf, pstr);
result = hfa384x_drvr_setconfig(hw, mib->parm1, bytebuf, mib->parm2); result =
hfa384x_drvr_setconfig(hw, mib->parm1, bytebuf, mib->parm2);
} }
return(result); return result;
} }
/*---------------------------------------------------------------- /*----------------------------------------------------------------
...@@ -458,18 +424,16 @@ void *data) ...@@ -458,18 +424,16 @@ void *data)
* *
----------------------------------------------------------------*/ ----------------------------------------------------------------*/
static int prism2mib_uint32( static int prism2mib_uint32(mibrec_t *mib,
mibrec_t *mib, int isget,
int isget, wlandevice_t *wlandev,
wlandevice_t *wlandev, hfa384x_t *hw,
hfa384x_t *hw, p80211msg_dot11req_mibset_t *msg, void *data)
p80211msg_dot11req_mibset_t *msg,
void *data)
{ {
int result; int result;
u32 *uint32 = (u32*) data; u32 *uint32 = (u32 *) data;
u8 bytebuf[MIB_TMP_MAXLEN]; u8 bytebuf[MIB_TMP_MAXLEN];
u16 *wordbuf = (u16*) bytebuf; u16 *wordbuf = (u16 *) bytebuf;
if (isget) { if (isget) {
result = hfa384x_drvr_getconfig16(hw, mib->parm1, wordbuf); result = hfa384x_drvr_getconfig16(hw, mib->parm1, wordbuf);
...@@ -485,7 +449,7 @@ void *data) ...@@ -485,7 +449,7 @@ void *data)
result = hfa384x_drvr_setconfig16(hw, mib->parm1, *wordbuf); result = hfa384x_drvr_setconfig16(hw, mib->parm1, *wordbuf);
} }
return(result); return result;
} }
/*---------------------------------------------------------------- /*----------------------------------------------------------------
...@@ -513,18 +477,16 @@ void *data) ...@@ -513,18 +477,16 @@ void *data)
* *
----------------------------------------------------------------*/ ----------------------------------------------------------------*/
static int prism2mib_flag( static int prism2mib_flag(mibrec_t *mib,
mibrec_t *mib, int isget,
int isget, wlandevice_t *wlandev,
wlandevice_t *wlandev, hfa384x_t *hw,
hfa384x_t *hw, p80211msg_dot11req_mibset_t *msg, void *data)
p80211msg_dot11req_mibset_t *msg,
void *data)
{ {
int result; int result;
u32 *uint32 = (u32*) data; u32 *uint32 = (u32 *) data;
u8 bytebuf[MIB_TMP_MAXLEN]; u8 bytebuf[MIB_TMP_MAXLEN];
u16 *wordbuf = (u16*) bytebuf; u16 *wordbuf = (u16 *) bytebuf;
u32 flags; u32 flags;
result = hfa384x_drvr_getconfig16(hw, mib->parm1, wordbuf); result = hfa384x_drvr_getconfig16(hw, mib->parm1, wordbuf);
...@@ -545,11 +507,12 @@ void *data) ...@@ -545,11 +507,12 @@ void *data)
* prism2mgmt_p80211int2prism2int(wordbuf, &flags); * prism2mgmt_p80211int2prism2int(wordbuf, &flags);
*/ */
*wordbuf = flags; *wordbuf = flags;
result = hfa384x_drvr_setconfig16(hw, mib->parm1, *wordbuf); result =
hfa384x_drvr_setconfig16(hw, mib->parm1, *wordbuf);
} }
} }
return(result); return result;
} }
/*---------------------------------------------------------------- /*----------------------------------------------------------------
...@@ -577,16 +540,15 @@ void *data) ...@@ -577,16 +540,15 @@ void *data)
* *
----------------------------------------------------------------*/ ----------------------------------------------------------------*/
static int prism2mib_wepdefaultkey( static int prism2mib_wepdefaultkey(mibrec_t *mib,
mibrec_t *mib, int isget,
int isget, wlandevice_t *wlandev,
wlandevice_t *wlandev, hfa384x_t *hw,
hfa384x_t *hw, p80211msg_dot11req_mibset_t *msg,
p80211msg_dot11req_mibset_t *msg, void *data)
void *data)
{ {
int result; int result;
p80211pstrd_t *pstr = (p80211pstrd_t*) data; p80211pstrd_t *pstr = (p80211pstrd_t *) data;
u8 bytebuf[MIB_TMP_MAXLEN]; u8 bytebuf[MIB_TMP_MAXLEN];
u16 len; u16 len;
...@@ -600,7 +562,7 @@ void *data) ...@@ -600,7 +562,7 @@ void *data)
result = hfa384x_drvr_setconfig(hw, mib->parm1, bytebuf, len); result = hfa384x_drvr_setconfig(hw, mib->parm1, bytebuf, len);
} }
return(result); return result;
} }
/*---------------------------------------------------------------- /*----------------------------------------------------------------
...@@ -628,13 +590,12 @@ void *data) ...@@ -628,13 +590,12 @@ void *data)
* *
----------------------------------------------------------------*/ ----------------------------------------------------------------*/
static int prism2mib_privacyinvoked( static int prism2mib_privacyinvoked(mibrec_t *mib,
mibrec_t *mib, int isget,
int isget, wlandevice_t *wlandev,
wlandevice_t *wlandev, hfa384x_t *hw,
hfa384x_t *hw, p80211msg_dot11req_mibset_t *msg,
p80211msg_dot11req_mibset_t *msg, void *data)
void *data)
{ {
int result; int result;
...@@ -647,7 +608,7 @@ void *data) ...@@ -647,7 +608,7 @@ void *data)
result = prism2mib_flag(mib, isget, wlandev, hw, msg, data); result = prism2mib_flag(mib, isget, wlandev, hw, msg, data);
return(result); return result;
} }
/*---------------------------------------------------------------- /*----------------------------------------------------------------
...@@ -675,19 +636,18 @@ void *data) ...@@ -675,19 +636,18 @@ void *data)
* *
----------------------------------------------------------------*/ ----------------------------------------------------------------*/
static int prism2mib_excludeunencrypted( static int prism2mib_excludeunencrypted(mibrec_t *mib,
mibrec_t *mib, int isget,
int isget, wlandevice_t *wlandev,
wlandevice_t *wlandev, hfa384x_t *hw,
hfa384x_t *hw, p80211msg_dot11req_mibset_t *msg,
p80211msg_dot11req_mibset_t *msg, void *data)
void *data)
{ {
int result; int result;
result = prism2mib_flag(mib, isget, wlandev, hw, msg, data); result = prism2mib_flag(mib, isget, wlandev, hw, msg, data);
return(result); return result;
} }
/*---------------------------------------------------------------- /*----------------------------------------------------------------
...@@ -715,28 +675,28 @@ void *data) ...@@ -715,28 +675,28 @@ void *data)
* *
----------------------------------------------------------------*/ ----------------------------------------------------------------*/
static int prism2mib_fragmentationthreshold( static int prism2mib_fragmentationthreshold(mibrec_t *mib,
mibrec_t *mib, int isget,
int isget, wlandevice_t *wlandev,
wlandevice_t *wlandev, hfa384x_t *hw,
hfa384x_t *hw, p80211msg_dot11req_mibset_t *msg,
p80211msg_dot11req_mibset_t *msg, void *data)
void *data)
{ {
int result; int result;
u32 *uint32 = (u32*) data; u32 *uint32 = (u32 *) data;
if (!isget) if (!isget)
if ((*uint32) % 2) { if ((*uint32) % 2) {
printk(KERN_WARNING "Attempt to set odd number " printk(KERN_WARNING "Attempt to set odd number "
"FragmentationThreshold\n"); "FragmentationThreshold\n");
msg->resultcode.data = P80211ENUM_resultcode_not_supported; msg->resultcode.data =
return(0); P80211ENUM_resultcode_not_supported;
return 0;
} }
result = prism2mib_uint32(mib, isget, wlandev, hw, msg, data); result = prism2mib_uint32(mib, isget, wlandev, hw, msg, data);
return(result); return result;
} }
/*---------------------------------------------------------------- /*----------------------------------------------------------------
...@@ -764,32 +724,35 @@ void *data) ...@@ -764,32 +724,35 @@ void *data)
* *
----------------------------------------------------------------*/ ----------------------------------------------------------------*/
static int prism2mib_priv( static int prism2mib_priv(mibrec_t *mib,
mibrec_t *mib, int isget,
int isget, wlandevice_t *wlandev,
wlandevice_t *wlandev, hfa384x_t *hw,
hfa384x_t *hw, p80211msg_dot11req_mibset_t *msg, void *data)
p80211msg_dot11req_mibset_t *msg,
void *data)
{ {
p80211pstrd_t *pstr = (p80211pstrd_t*) data; p80211pstrd_t *pstr = (p80211pstrd_t *) data;
int result; int result;
switch (mib->did) { switch (mib->did) {
case DIDmib_lnx_lnxConfigTable_lnxRSNAIE: { case DIDmib_lnx_lnxConfigTable_lnxRSNAIE:{
hfa384x_WPAData_t wpa; hfa384x_WPAData_t wpa;
if (isget) { if (isget) {
hfa384x_drvr_getconfig( hw, HFA384x_RID_CNFWPADATA, hfa384x_drvr_getconfig(hw,
(u8 *) &wpa, sizeof(wpa)); HFA384x_RID_CNFWPADATA,
(u8 *)&wpa,
sizeof(wpa));
pstr->len = hfa384x2host_16(wpa.datalen); pstr->len = hfa384x2host_16(wpa.datalen);
memcpy(pstr->data, wpa.data, pstr->len); memcpy(pstr->data, wpa.data, pstr->len);
} else { } else {
wpa.datalen = host2hfa384x_16(pstr->len); wpa.datalen = host2hfa384x_16(pstr->len);
memcpy(wpa.data, pstr->data, pstr->len); memcpy(wpa.data, pstr->data, pstr->len);
result = hfa384x_drvr_setconfig(hw, HFA384x_RID_CNFWPADATA, result =
(u8 *) &wpa, sizeof(wpa)); hfa384x_drvr_setconfig(hw,
HFA384x_RID_CNFWPADATA,
(u8 *)&wpa,
sizeof(wpa));
} }
break; break;
} }
...@@ -797,7 +760,7 @@ void *data) ...@@ -797,7 +760,7 @@ void *data)
printk(KERN_ERR "Unhandled DID 0x%08x\n", mib->did); printk(KERN_ERR "Unhandled DID 0x%08x\n", mib->did);
} }
return(0); return 0;
} }
/*---------------------------------------------------------------- /*----------------------------------------------------------------
...@@ -817,11 +780,10 @@ void *data) ...@@ -817,11 +780,10 @@ void *data)
void prism2mgmt_pstr2bytestr(hfa384x_bytestr_t *bytestr, p80211pstrd_t *pstr) void prism2mgmt_pstr2bytestr(hfa384x_bytestr_t *bytestr, p80211pstrd_t *pstr)
{ {
bytestr->len = host2hfa384x_16((u16)(pstr->len)); bytestr->len = host2hfa384x_16((u16) (pstr->len));
memcpy(bytestr->data, pstr->data, pstr->len); memcpy(bytestr->data, pstr->data, pstr->len);
} }
/*---------------------------------------------------------------- /*----------------------------------------------------------------
* prism2mgmt_pstr2bytearea * prism2mgmt_pstr2bytearea
* *
...@@ -842,7 +804,6 @@ void prism2mgmt_pstr2bytearea(u8 *bytearea, p80211pstrd_t *pstr) ...@@ -842,7 +804,6 @@ void prism2mgmt_pstr2bytearea(u8 *bytearea, p80211pstrd_t *pstr)
memcpy(bytearea, pstr->data, pstr->len); memcpy(bytearea, pstr->data, pstr->len);
} }
/*---------------------------------------------------------------- /*----------------------------------------------------------------
* prism2mgmt_bytestr2pstr * prism2mgmt_bytestr2pstr
* *
...@@ -860,11 +821,10 @@ void prism2mgmt_pstr2bytearea(u8 *bytearea, p80211pstrd_t *pstr) ...@@ -860,11 +821,10 @@ void prism2mgmt_pstr2bytearea(u8 *bytearea, p80211pstrd_t *pstr)
void prism2mgmt_bytestr2pstr(hfa384x_bytestr_t *bytestr, p80211pstrd_t *pstr) void prism2mgmt_bytestr2pstr(hfa384x_bytestr_t *bytestr, p80211pstrd_t *pstr)
{ {
pstr->len = (u8)(hfa384x2host_16((u16)(bytestr->len))); pstr->len = (u8) (hfa384x2host_16((u16) (bytestr->len)));
memcpy(pstr->data, bytestr->data, pstr->len); memcpy(pstr->data, bytestr->data, pstr->len);
} }
/*---------------------------------------------------------------- /*----------------------------------------------------------------
* prism2mgmt_bytearea2pstr * prism2mgmt_bytearea2pstr
* *
...@@ -882,11 +842,10 @@ void prism2mgmt_bytestr2pstr(hfa384x_bytestr_t *bytestr, p80211pstrd_t *pstr) ...@@ -882,11 +842,10 @@ void prism2mgmt_bytestr2pstr(hfa384x_bytestr_t *bytestr, p80211pstrd_t *pstr)
void prism2mgmt_bytearea2pstr(u8 *bytearea, p80211pstrd_t *pstr, int len) void prism2mgmt_bytearea2pstr(u8 *bytearea, p80211pstrd_t *pstr, int len)
{ {
pstr->len = (u8)len; pstr->len = (u8) len;
memcpy(pstr->data, bytearea, len); memcpy(pstr->data, bytearea, len);
} }
/*---------------------------------------------------------------- /*----------------------------------------------------------------
* prism2mgmt_prism2int2p80211int * prism2mgmt_prism2int2p80211int
* *
...@@ -903,10 +862,9 @@ void prism2mgmt_bytearea2pstr(u8 *bytearea, p80211pstrd_t *pstr, int len) ...@@ -903,10 +862,9 @@ void prism2mgmt_bytearea2pstr(u8 *bytearea, p80211pstrd_t *pstr, int len)
void prism2mgmt_prism2int2p80211int(u16 *prism2int, u32 *wlanint) void prism2mgmt_prism2int2p80211int(u16 *prism2int, u32 *wlanint)
{ {
*wlanint = (u32)hfa384x2host_16(*prism2int); *wlanint = (u32) hfa384x2host_16(*prism2int);
} }
/*---------------------------------------------------------------- /*----------------------------------------------------------------
* prism2mgmt_p80211int2prism2int * prism2mgmt_p80211int2prism2int
* *
...@@ -923,10 +881,9 @@ void prism2mgmt_prism2int2p80211int(u16 *prism2int, u32 *wlanint) ...@@ -923,10 +881,9 @@ void prism2mgmt_prism2int2p80211int(u16 *prism2int, u32 *wlanint)
void prism2mgmt_p80211int2prism2int(u16 *prism2int, u32 *wlanint) void prism2mgmt_p80211int2prism2int(u16 *prism2int, u32 *wlanint)
{ {
*prism2int = host2hfa384x_16((u16)(*wlanint)); *prism2int = host2hfa384x_16((u16) (*wlanint));
} }
/*---------------------------------------------------------------- /*----------------------------------------------------------------
* prism2mgmt_prism2enum2p80211enum * prism2mgmt_prism2enum2p80211enum
* *
...@@ -945,11 +902,10 @@ void prism2mgmt_prism2enum2p80211enum(u16 *prism2enum, u32 *wlanenum, u16 rid) ...@@ -945,11 +902,10 @@ void prism2mgmt_prism2enum2p80211enum(u16 *prism2enum, u32 *wlanenum, u16 rid)
{ {
/* At the moment, the need for this functionality hasn't /* At the moment, the need for this functionality hasn't
presented itself. All the wlan enumerated values are presented itself. All the wlan enumerated values are
a 1-to-1 match against the Prism2 enumerated values*/ a 1-to-1 match against the Prism2 enumerated values */
return; return;
} }
/*---------------------------------------------------------------- /*----------------------------------------------------------------
* prism2mgmt_p80211enum2prism2enum * prism2mgmt_p80211enum2prism2enum
* *
...@@ -968,12 +924,10 @@ void prism2mgmt_p80211enum2prism2enum(u16 *prism2enum, u32 *wlanenum, u16 rid) ...@@ -968,12 +924,10 @@ void prism2mgmt_p80211enum2prism2enum(u16 *prism2enum, u32 *wlanenum, u16 rid)
{ {
/* At the moment, the need for this functionality hasn't /* At the moment, the need for this functionality hasn't
presented itself. All the wlan enumerated values are presented itself. All the wlan enumerated values are
a 1-to-1 match against the Prism2 enumerated values*/ a 1-to-1 match against the Prism2 enumerated values */
return; return;
} }
/*---------------------------------------------------------------- /*----------------------------------------------------------------
* prism2mgmt_get_oprateset * prism2mgmt_get_oprateset
* *
...@@ -996,30 +950,30 @@ void prism2mgmt_get_oprateset(u16 *rate, p80211pstrd_t *pstr) ...@@ -996,30 +950,30 @@ void prism2mgmt_get_oprateset(u16 *rate, p80211pstrd_t *pstr)
datarate = pstr->data; datarate = pstr->data;
/* 1 Mbps */ /* 1 Mbps */
if ( BIT(0) & (*rate) ) { if (BIT(0) & (*rate)) {
len += (u8)1; len += (u8) 1;
*datarate = (u8)2; *datarate = (u8) 2;
datarate++; datarate++;
} }
/* 2 Mbps */ /* 2 Mbps */
if ( BIT(1) & (*rate) ) { if (BIT(1) & (*rate)) {
len += (u8)1; len += (u8) 1;
*datarate = (u8)4; *datarate = (u8) 4;
datarate++; datarate++;
} }
/* 5.5 Mbps */ /* 5.5 Mbps */
if ( BIT(2) & (*rate) ) { if (BIT(2) & (*rate)) {
len += (u8)1; len += (u8) 1;
*datarate = (u8)11; *datarate = (u8) 11;
datarate++; datarate++;
} }
/* 11 Mbps */ /* 11 Mbps */
if ( BIT(3) & (*rate) ) { if (BIT(3) & (*rate)) {
len += (u8)1; len += (u8) 1;
*datarate = (u8)22; *datarate = (u8) 22;
datarate++; datarate++;
} }
...@@ -1028,8 +982,6 @@ void prism2mgmt_get_oprateset(u16 *rate, p80211pstrd_t *pstr) ...@@ -1028,8 +982,6 @@ void prism2mgmt_get_oprateset(u16 *rate, p80211pstrd_t *pstr)
return; return;
} }
/*---------------------------------------------------------------- /*----------------------------------------------------------------
* prism2mgmt_set_oprateset * prism2mgmt_set_oprateset
* *
...@@ -1052,7 +1004,7 @@ void prism2mgmt_set_oprateset(u16 *rate, p80211pstrd_t *pstr) ...@@ -1052,7 +1004,7 @@ void prism2mgmt_set_oprateset(u16 *rate, p80211pstrd_t *pstr)
datarate = pstr->data; datarate = pstr->data;
for ( i=0; i < pstr->len; i++, datarate++ ) { for (i = 0; i < pstr->len; i++, datarate++) {
switch (*datarate) { switch (*datarate) {
case 2: /* 1 Mbps */ case 2: /* 1 Mbps */
*rate |= BIT(0); *rate |= BIT(0);
......
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