dect
/
linux-2.6
Archived
13
0
Fork 0

Staging: wlan-ng - checkpatch.pl fixups

Basic fixups in the staging/wlan-ng directory.
(First kernel patch - thanks to FOSDEM talk)

Signed-off-by: Andrew Elwell <Andrew.Elwell@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Andrew Elwell 2010-02-18 23:56:12 +01:00 committed by Greg Kroah-Hartman
parent 6705b68d0b
commit ef1a0ed7f1
15 changed files with 182 additions and 193 deletions

View File

@ -118,15 +118,15 @@
#include <linux/wireless.h> #include <linux/wireless.h>
#include <linux/netdevice.h> #include <linux/netdevice.h>
#include <linux/timer.h> #include <linux/timer.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 <asm/bitops.h> #include <linux/bitops.h>
#include <linux/list.h> #include <linux/list.h>
#include <linux/usb.h> #include <linux/usb.h>
#include <linux/byteorder/generic.h> #include <linux/byteorder/generic.h>
#define SUBMIT_URB(u,f) usb_submit_urb(u,f) #define SUBMIT_URB(u, f) usb_submit_urb(u, f)
#include "p80211types.h" #include "p80211types.h"
#include "p80211hdr.h" #include "p80211hdr.h"
@ -627,7 +627,7 @@ static hfa384x_usbctlx_t *usbctlx_alloc(void)
{ {
hfa384x_usbctlx_t *ctlx; hfa384x_usbctlx_t *ctlx;
ctlx = kmalloc(sizeof(*ctlx), in_interrupt()? GFP_ATOMIC : GFP_KERNEL); ctlx = kmalloc(sizeof(*ctlx), in_interrupt() ? GFP_ATOMIC : GFP_KERNEL);
if (ctlx != NULL) { if (ctlx != NULL) {
memset(ctlx, 0, sizeof(*ctlx)); memset(ctlx, 0, sizeof(*ctlx));
init_completion(&ctlx->done); init_completion(&ctlx->done);
@ -675,7 +675,7 @@ struct usbctlx_cmd_completor {
}; };
typedef struct usbctlx_cmd_completor usbctlx_cmd_completor_t; typedef struct usbctlx_cmd_completor usbctlx_cmd_completor_t;
static int usbctlx_cmd_completor_fn(usbctlx_completor_t * head) static int usbctlx_cmd_completor_fn(usbctlx_completor_t *head)
{ {
usbctlx_cmd_completor_t *complete = (usbctlx_cmd_completor_t *) head; usbctlx_cmd_completor_t *complete = (usbctlx_cmd_completor_t *) head;
return usbctlx_get_status(complete->cmdresp, complete->result); return usbctlx_get_status(complete->cmdresp, complete->result);
@ -3642,7 +3642,7 @@ static void hfa384x_int_rxmonitor(wlandevice_t *wlandev,
/* check for unencrypted stuff if WEP bit set. */ /* check for unencrypted stuff if WEP bit set. */
if (*(datap - hdrlen + 1) & 0x40) /* wep set */ if (*(datap - hdrlen + 1) & 0x40) /* wep set */
if ((*(datap) == 0xaa) && (*(datap + 1) == 0xaa)) if ((*(datap) == 0xaa) && (*(datap + 1) == 0xaa))
*(datap - hdrlen + 1) &= 0xbf; // clear wep; it's the 802.2 header! *(datap - hdrlen + 1) &= 0xbf; /* clear wep; it's the 802.2 header! */
} }
if (hw->sniff_fcs) { if (hw->sniff_fcs) {

View File

@ -153,8 +153,8 @@ struct wlandevice;
int skb_p80211_to_ether(struct wlandevice *wlandev, u32 ethconv, int skb_p80211_to_ether(struct wlandevice *wlandev, u32 ethconv,
struct sk_buff *skb); struct sk_buff *skb);
int skb_ether_to_p80211(struct wlandevice *wlandev, u32 ethconv, int skb_ether_to_p80211(struct wlandevice *wlandev, u32 ethconv,
struct sk_buff *skb, p80211_hdr_t * p80211_hdr, struct sk_buff *skb, p80211_hdr_t *p80211_hdr,
p80211_metawep_t * p80211_wep); p80211_metawep_t *p80211_wep);
int p80211_stt_findproto(u16 proto); int p80211_stt_findproto(u16 proto);

View File

@ -190,9 +190,9 @@
(P80211DID_MKSECTION(2) | \ (P80211DID_MKSECTION(2) | \
P80211DID_MKGROUP(1)) P80211DID_MKGROUP(1))
#define DIDmib_dot11mac_dot11OperationTable_dot11MACAddress \ #define DIDmib_dot11mac_dot11OperationTable_dot11MACAddress \
(P80211DID_MKSECTION(2) | \ (P80211DID_MKSECTION(2) | \
P80211DID_MKGROUP(1) | \ P80211DID_MKGROUP(1) | \
P80211DID_MKITEM(1) | 0x18000000) P80211DID_MKITEM(1) | 0x18000000)
#define DIDmib_dot11mac_dot11OperationTable_dot11RTSThreshold \ #define DIDmib_dot11mac_dot11OperationTable_dot11RTSThreshold \
(P80211DID_MKSECTION(2) | \ (P80211DID_MKSECTION(2) | \
P80211DID_MKGROUP(1) | \ P80211DID_MKGROUP(1) | \
@ -210,18 +210,18 @@
P80211DID_MKGROUP(1) | \ P80211DID_MKGROUP(1) | \
P80211DID_MKITEM(5) | 0x18000000) P80211DID_MKITEM(5) | 0x18000000)
#define DIDmib_dot11mac_dot11OperationTable_dot11MaxTransmitMSDULifetime \ #define DIDmib_dot11mac_dot11OperationTable_dot11MaxTransmitMSDULifetime \
(P80211DID_MKSECTION(2) | \ (P80211DID_MKSECTION(2) | \
P80211DID_MKGROUP(1) | \ P80211DID_MKGROUP(1) | \
P80211DID_MKITEM(6) | 0x10000000) P80211DID_MKITEM(6) | 0x10000000)
#define DIDmib_cat_dot11phy \ #define DIDmib_cat_dot11phy \
P80211DID_MKSECTION(3) P80211DID_MKSECTION(3)
#define DIDmib_dot11phy_dot11PhyOperationTable \ #define DIDmib_dot11phy_dot11PhyOperationTable \
(P80211DID_MKSECTION(3) | \ (P80211DID_MKSECTION(3) | \
P80211DID_MKGROUP(1)) P80211DID_MKGROUP(1))
#define DIDmib_dot11phy_dot11PhyTxPowerTable_dot11CurrentTxPowerLevel \ #define DIDmib_dot11phy_dot11PhyTxPowerTable_dot11CurrentTxPowerLevel \
(P80211DID_MKSECTION(3) | \ (P80211DID_MKSECTION(3) | \
P80211DID_MKGROUP(3) | \ P80211DID_MKGROUP(3) | \
P80211DID_MKITEM(10) | 0x18000000) P80211DID_MKITEM(10) | 0x18000000)
#define DIDmib_dot11phy_dot11PhyDSSSTable \ #define DIDmib_dot11phy_dot11PhyDSSSTable \
(P80211DID_MKSECTION(3) | \ (P80211DID_MKSECTION(3) | \
P80211DID_MKGROUP(5)) P80211DID_MKGROUP(5))

View File

@ -100,7 +100,7 @@
#ifndef _P80211MGMT_H #ifndef _P80211MGMT_H
#define _P80211MGMT_H #define _P80211MGMT_H
#ifndef _P80211HDR_H #ifndef _P80211HDR_H
#include "p80211hdr.h" #include "p80211hdr.h"
#endif #endif
@ -496,25 +496,25 @@ typedef struct wlan_fr_deauthen {
} wlan_fr_deauthen_t; } wlan_fr_deauthen_t;
void wlan_mgmt_encode_beacon(wlan_fr_beacon_t * f); void wlan_mgmt_encode_beacon(wlan_fr_beacon_t *f);
void wlan_mgmt_decode_beacon(wlan_fr_beacon_t * f); void wlan_mgmt_decode_beacon(wlan_fr_beacon_t *f);
void wlan_mgmt_encode_disassoc(wlan_fr_disassoc_t * f); void wlan_mgmt_encode_disassoc(wlan_fr_disassoc_t *f);
void wlan_mgmt_decode_disassoc(wlan_fr_disassoc_t * f); void wlan_mgmt_decode_disassoc(wlan_fr_disassoc_t *f);
void wlan_mgmt_encode_assocreq(wlan_fr_assocreq_t * f); void wlan_mgmt_encode_assocreq(wlan_fr_assocreq_t *f);
void wlan_mgmt_decode_assocreq(wlan_fr_assocreq_t * f); void wlan_mgmt_decode_assocreq(wlan_fr_assocreq_t *f);
void wlan_mgmt_encode_assocresp(wlan_fr_assocresp_t * f); void wlan_mgmt_encode_assocresp(wlan_fr_assocresp_t *f);
void wlan_mgmt_decode_assocresp(wlan_fr_assocresp_t * f); void wlan_mgmt_decode_assocresp(wlan_fr_assocresp_t *f);
void wlan_mgmt_encode_reassocreq(wlan_fr_reassocreq_t * f); void wlan_mgmt_encode_reassocreq(wlan_fr_reassocreq_t *f);
void wlan_mgmt_decode_reassocreq(wlan_fr_reassocreq_t * f); void wlan_mgmt_decode_reassocreq(wlan_fr_reassocreq_t *f);
void wlan_mgmt_encode_reassocresp(wlan_fr_reassocresp_t * f); void wlan_mgmt_encode_reassocresp(wlan_fr_reassocresp_t *f);
void wlan_mgmt_decode_reassocresp(wlan_fr_reassocresp_t * f); void wlan_mgmt_decode_reassocresp(wlan_fr_reassocresp_t *f);
void wlan_mgmt_encode_probereq(wlan_fr_probereq_t * f); void wlan_mgmt_encode_probereq(wlan_fr_probereq_t *f);
void wlan_mgmt_decode_probereq(wlan_fr_probereq_t * f); void wlan_mgmt_decode_probereq(wlan_fr_probereq_t *f);
void wlan_mgmt_encode_proberesp(wlan_fr_proberesp_t * f); void wlan_mgmt_encode_proberesp(wlan_fr_proberesp_t *f);
void wlan_mgmt_decode_proberesp(wlan_fr_proberesp_t * f); void wlan_mgmt_decode_proberesp(wlan_fr_proberesp_t *f);
void wlan_mgmt_encode_authen(wlan_fr_authen_t * f); void wlan_mgmt_encode_authen(wlan_fr_authen_t *f);
void wlan_mgmt_decode_authen(wlan_fr_authen_t * f); void wlan_mgmt_decode_authen(wlan_fr_authen_t *f);
void wlan_mgmt_encode_deauthen(wlan_fr_deauthen_t * f); void wlan_mgmt_encode_deauthen(wlan_fr_deauthen_t *f);
void wlan_mgmt_decode_deauthen(wlan_fr_deauthen_t * f); void wlan_mgmt_decode_deauthen(wlan_fr_deauthen_t *f);
#endif /* _P80211MGMT_H */ #endif /* _P80211MGMT_H */

View File

@ -646,7 +646,7 @@ static int p80211knetdev_set_mac_address(netdevice_t *dev, void *addr)
/* Set up some convenience pointers. */ /* Set up some convenience pointers. */
mibattr = &dot11req.mibattribute; mibattr = &dot11req.mibattribute;
macaddr = (p80211item_pstr6_t *) & mibattr->data; macaddr = (p80211item_pstr6_t *) &mibattr->data;
resultcode = &dot11req.resultcode; resultcode = &dot11req.resultcode;
/* Set up a dot11req_mibset */ /* Set up a dot11req_mibset */
@ -674,7 +674,7 @@ static int p80211knetdev_set_mac_address(netdevice_t *dev, void *addr)
resultcode->data = 0; resultcode->data = 0;
/* now fire the request */ /* now fire the request */
result = p80211req_dorequest(dev->ml_priv, (u8 *) & dot11req); result = p80211req_dorequest(dev->ml_priv, (u8 *) &dot11req);
/* If the request wasn't successful, report an error and don't /* If the request wasn't successful, report an error and don't
* change the netdev address * change the netdev address

View File

@ -179,16 +179,16 @@ typedef struct wlandevice {
unsigned int ethconv; unsigned int ethconv;
/* device methods (init by MSD, used by p80211 */ /* device methods (init by MSD, used by p80211 */
int (*open) (struct wlandevice * wlandev); int (*open) (struct wlandevice *wlandev);
int (*close) (struct wlandevice * wlandev); int (*close) (struct wlandevice *wlandev);
void (*reset) (struct wlandevice * wlandev); void (*reset) (struct wlandevice *wlandev);
int (*txframe) (struct wlandevice * wlandev, struct sk_buff * skb, int (*txframe) (struct wlandevice *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);
int (*mlmerequest) (struct wlandevice * wlandev, p80211msg_t * msg); int (*mlmerequest) (struct wlandevice *wlandev, p80211msg_t *msg);
int (*set_multicast_list) (struct wlandevice * wlandev, int (*set_multicast_list) (struct wlandevice *wlandev,
netdevice_t * dev); netdevice_t *dev);
void (*tx_timeout) (struct wlandevice * wlandev); void (*tx_timeout) (struct wlandevice *wlandev);
/* 802.11 State */ /* 802.11 State */
u8 bssid[WLAN_BSSID_LEN]; u8 bssid[WLAN_BSSID_LEN];
@ -227,16 +227,16 @@ typedef struct wlandevice {
} wlandevice_t; } wlandevice_t;
/* WEP stuff */ /* WEP stuff */
int wep_change_key(wlandevice_t * wlandev, int keynum, u8 * key, int keylen); int wep_change_key(wlandevice_t *wlandev, int keynum, u8 *key, int keylen);
int wep_decrypt(wlandevice_t * wlandev, u8 * buf, u32 len, int key_override, int wep_decrypt(wlandevice_t *wlandev, u8 *buf, u32 len, int key_override,
u8 * iv, u8 * icv); u8 *iv, u8 *icv);
int wep_encrypt(wlandevice_t * wlandev, u8 * buf, u8 * dst, u32 len, int keynum, int wep_encrypt(wlandevice_t *wlandev, u8 *buf, u8 *dst, u32 len, int keynum,
u8 * iv, u8 * icv); u8 *iv, u8 *icv);
int wlan_setup(wlandevice_t * wlandev); int wlan_setup(wlandevice_t *wlandev);
int wlan_unsetup(wlandevice_t * wlandev); int wlan_unsetup(wlandevice_t *wlandev);
int register_wlandev(wlandevice_t * wlandev); int register_wlandev(wlandevice_t *wlandev);
int unregister_wlandev(wlandevice_t * wlandev); int unregister_wlandev(wlandevice_t *wlandev);
void p80211netdev_rx(wlandevice_t * wlandev, struct sk_buff *skb); void p80211netdev_rx(wlandevice_t *wlandev, struct sk_buff *skb);
void p80211netdev_hwremoved(wlandevice_t * wlandev); void p80211netdev_hwremoved(wlandevice_t *wlandev);
#endif #endif

View File

@ -94,7 +94,7 @@ static int p80211req_mibset_mibget(wlandevice_t *wlandev,
* Potentially blocks the caller, so it's a good idea to * Potentially blocks the caller, so it's a good idea to
* not call this function from an interrupt context. * not call this function from an interrupt context.
----------------------------------------------------------------*/ ----------------------------------------------------------------*/
int p80211req_dorequest(wlandevice_t * wlandev, u8 * msgbuf) int p80211req_dorequest(wlandevice_t *wlandev, u8 *msgbuf)
{ {
int result = 0; int result = 0;
p80211msg_t *msg = (p80211msg_t *) msgbuf; p80211msg_t *msg = (p80211msg_t *) msgbuf;

View File

@ -48,6 +48,6 @@
#ifndef _LINUX_P80211REQ_H #ifndef _LINUX_P80211REQ_H
#define _LINUX_P80211REQ_H #define _LINUX_P80211REQ_H
int p80211req_dorequest(wlandevice_t * wlandev, u8 * msgbuf); int p80211req_dorequest(wlandevice_t *wlandev, u8 *msgbuf);
#endif #endif

View File

@ -168,10 +168,10 @@
P80211DID_MASK_ISTABLE, \ P80211DID_MASK_ISTABLE, \
P80211DID_LSB_ISTABLE) P80211DID_LSB_ISTABLE)
#define P80211DID_MKID(s,g,i,n,t,a) (P80211DID_MKSECTION(s) | \ #define P80211DID_MKID(s, g, i, n, t, a) (P80211DID_MKSECTION(s) | \
P80211DID_MKGROUP(g) | \ P80211DID_MKGROUP(g) | \
P80211DID_MKITEM(i) | \ P80211DID_MKITEM(i) | \
P80211DID_MKINDEX(n) | \ P80211DID_MKINDEX(n) | \
P80211DID_MKISTABLE(t) | \ P80211DID_MKISTABLE(t) | \
(a)) (a))
@ -340,11 +340,11 @@ struct catlistitem;
/* metadata items. Some components may choose to use more, */ /* metadata items. Some components may choose to use more, */
/* less or different metadata items. */ /* less or different metadata items. */
typedef void (*p80211_totext_t) (struct catlistitem *, u32 did, u8 * itembuf, typedef void (*p80211_totext_t) (struct catlistitem *, u32 did, u8 *itembuf,
char *textbuf); char *textbuf);
typedef void (*p80211_fromtext_t) (struct catlistitem *, u32 did, u8 * itembuf, typedef void (*p80211_fromtext_t) (struct catlistitem *, u32 did, u8 *itembuf,
char *textbuf); char *textbuf);
typedef u32(*p80211_valid_t) (struct catlistitem *, u32 did, u8 * itembuf); typedef u32(*p80211_valid_t) (struct catlistitem *, u32 did, u8 *itembuf);
/*----------------------------------------------------------------*/ /*----------------------------------------------------------------*/
/* Enumeration Lists */ /* Enumeration Lists */

View File

@ -46,8 +46,8 @@
#include <linux/wireless.h> #include <linux/wireless.h>
#include <net/iw_handler.h> #include <net/iw_handler.h>
#include <linux/if_arp.h> #include <linux/if_arp.h>
#include <asm/bitops.h> #include <linux/bitops.h>
#include <asm/uaccess.h> #include <linux/uaccess.h>
#include <asm/byteorder.h> #include <asm/byteorder.h>
#include <linux/if_ether.h> #include <linux/if_ether.h>
#include <linux/bitops.h> #include <linux/bitops.h>
@ -137,7 +137,7 @@ static int p80211wext_dorequest(wlandevice_t *wlandev, u32 did, u32 data)
mibitem.did = did; mibitem.did = did;
mibitem.data = data; mibitem.data = data;
memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem)); memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem));
result = p80211req_dorequest(wlandev, (u8 *) & msg); result = p80211req_dorequest(wlandev, (u8 *) &msg);
return result; return result;
} }
@ -174,7 +174,7 @@ static int p80211wext_autojoin(wlandevice_t *wlandev)
memcpy(msg.ssid.data.data, ssid, data.length); memcpy(msg.ssid.data.data, ssid, data.length);
msg.ssid.data.len = data.length; msg.ssid.data.len = data.length;
result = p80211req_dorequest(wlandev, (u8 *) & msg); result = p80211req_dorequest(wlandev, (u8 *) &msg);
if (result) { if (result) {
err = -EFAULT; err = -EFAULT;
@ -211,7 +211,7 @@ struct iw_statistics *p80211wext_get_wireless_stats(netdevice_t *dev)
if (wlandev->mlmerequest == NULL) if (wlandev->mlmerequest == NULL)
return NULL; return NULL;
retval = wlandev->mlmerequest(wlandev, (p80211msg_t *) & quality); retval = wlandev->mlmerequest(wlandev, (p80211msg_t *) &quality);
wstats->qual.qual = qual_as_percent(quality.link.data); /* overall link quality */ wstats->qual.qual = qual_as_percent(quality.link.data); /* overall link quality */
wstats->qual.level = quality.level.data; /* instant signal level */ wstats->qual.level = quality.level.data; /* instant signal level */
@ -271,7 +271,7 @@ static int p80211wext_giwfreq(netdevice_t *dev,
msg.msgcode = DIDmsg_dot11req_mibget; msg.msgcode = DIDmsg_dot11req_mibget;
mibitem.did = DIDmib_dot11phy_dot11PhyDSSSTable_dot11CurrentChannel; mibitem.did = DIDmib_dot11phy_dot11PhyDSSSTable_dot11CurrentChannel;
memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem)); memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem));
result = p80211req_dorequest(wlandev, (u8 *) & msg); result = p80211req_dorequest(wlandev, (u8 *) &msg);
if (result) { if (result) {
err = -EFAULT; err = -EFAULT;
@ -318,7 +318,7 @@ static int p80211wext_siwfreq(netdevice_t *dev,
mibitem.data = p80211_mhz_to_channel(freq->m); mibitem.data = p80211_mhz_to_channel(freq->m);
memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem)); memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem));
result = p80211req_dorequest(wlandev, (u8 *) & msg); result = p80211req_dorequest(wlandev, (u8 *) &msg);
if (result) { if (result) {
err = -EFAULT; err = -EFAULT;
@ -399,7 +399,7 @@ static int p80211wext_siwmode(netdevice_t *dev,
mibitem.did = DIDmib_p2_p2Static_p2CnfPortType; mibitem.did = DIDmib_p2_p2Static_p2CnfPortType;
mibitem.data = (*mode == IW_MODE_ADHOC) ? 0 : 1; mibitem.data = (*mode == IW_MODE_ADHOC) ? 0 : 1;
memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem)); memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem));
result = p80211req_dorequest(wlandev, (u8 *) & msg); result = p80211req_dorequest(wlandev, (u8 *) &msg);
if (result) if (result)
err = -EFAULT; err = -EFAULT;
@ -621,7 +621,7 @@ static int p80211wext_siwencode(netdevice_t *dev,
msg.msgcode = DIDmsg_dot11req_mibset; msg.msgcode = DIDmsg_dot11req_mibset;
memcpy(&msg.mibattribute.data, &pstr, sizeof(pstr)); memcpy(&msg.mibattribute.data, &pstr, sizeof(pstr));
result = p80211req_dorequest(wlandev, (u8 *) & msg); result = p80211req_dorequest(wlandev, (u8 *) &msg);
if (result) { if (result) {
err = -EFAULT; err = -EFAULT;
@ -729,7 +729,7 @@ static int p80211wext_siwessid(netdevice_t *dev,
msg.ssid.data.len = length; msg.ssid.data.len = length;
pr_debug("autojoin_ssid for %s \n", essid); pr_debug("autojoin_ssid for %s \n", essid);
result = p80211req_dorequest(wlandev, (u8 *) & msg); result = p80211req_dorequest(wlandev, (u8 *) &msg);
pr_debug("autojoin_ssid %d\n", result); pr_debug("autojoin_ssid %d\n", result);
if (result) { if (result) {
@ -773,7 +773,7 @@ static int p80211wext_giwrate(netdevice_t *dev,
msg.msgcode = DIDmsg_dot11req_mibget; msg.msgcode = DIDmsg_dot11req_mibget;
mibitem.did = DIDmib_p2_p2MAC_p2CurrentTxRate; mibitem.did = DIDmib_p2_p2MAC_p2CurrentTxRate;
memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem)); memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem));
result = p80211req_dorequest(wlandev, (u8 *) & msg); result = p80211req_dorequest(wlandev, (u8 *) &msg);
if (result) { if (result) {
err = -EFAULT; err = -EFAULT;
@ -824,7 +824,7 @@ static int p80211wext_giwrts(netdevice_t *dev,
msg.msgcode = DIDmsg_dot11req_mibget; msg.msgcode = DIDmsg_dot11req_mibget;
mibitem.did = DIDmib_dot11mac_dot11OperationTable_dot11RTSThreshold; mibitem.did = DIDmib_dot11mac_dot11OperationTable_dot11RTSThreshold;
memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem)); memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem));
result = p80211req_dorequest(wlandev, (u8 *) & msg); result = p80211req_dorequest(wlandev, (u8 *) &msg);
if (result) { if (result) {
err = -EFAULT; err = -EFAULT;
@ -864,7 +864,7 @@ static int p80211wext_siwrts(netdevice_t *dev,
mibitem.data = rts->value; mibitem.data = rts->value;
memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem)); memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem));
result = p80211req_dorequest(wlandev, (u8 *) & msg); result = p80211req_dorequest(wlandev, (u8 *) &msg);
if (result) { if (result) {
err = -EFAULT; err = -EFAULT;
@ -889,7 +889,7 @@ static int p80211wext_giwfrag(netdevice_t *dev,
mibitem.did = mibitem.did =
DIDmib_dot11mac_dot11OperationTable_dot11FragmentationThreshold; DIDmib_dot11mac_dot11OperationTable_dot11FragmentationThreshold;
memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem)); memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem));
result = p80211req_dorequest(wlandev, (u8 *) & msg); result = p80211req_dorequest(wlandev, (u8 *) &msg);
if (result) { if (result) {
err = -EFAULT; err = -EFAULT;
@ -931,7 +931,7 @@ static int p80211wext_siwfrag(netdevice_t *dev,
mibitem.data = frag->value; mibitem.data = frag->value;
memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem)); memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem));
result = p80211req_dorequest(wlandev, (u8 *) & msg); result = p80211req_dorequest(wlandev, (u8 *) &msg);
if (result) { if (result) {
err = -EFAULT; err = -EFAULT;
@ -965,7 +965,7 @@ static int p80211wext_giwretry(netdevice_t *dev,
mibitem.did = DIDmib_dot11mac_dot11OperationTable_dot11ShortRetryLimit; mibitem.did = DIDmib_dot11mac_dot11OperationTable_dot11ShortRetryLimit;
memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem)); memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem));
result = p80211req_dorequest(wlandev, (u8 *) & msg); result = p80211req_dorequest(wlandev, (u8 *) &msg);
if (result) { if (result) {
err = -EFAULT; err = -EFAULT;
@ -979,7 +979,7 @@ static int p80211wext_giwretry(netdevice_t *dev,
mibitem.did = DIDmib_dot11mac_dot11OperationTable_dot11LongRetryLimit; mibitem.did = DIDmib_dot11mac_dot11OperationTable_dot11LongRetryLimit;
memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem)); memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem));
result = p80211req_dorequest(wlandev, (u8 *) & msg); result = p80211req_dorequest(wlandev, (u8 *) &msg);
if (result) { if (result) {
err = -EFAULT; err = -EFAULT;
@ -994,7 +994,7 @@ static int p80211wext_giwretry(netdevice_t *dev,
DIDmib_dot11mac_dot11OperationTable_dot11MaxTransmitMSDULifetime; DIDmib_dot11mac_dot11OperationTable_dot11MaxTransmitMSDULifetime;
memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem)); memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem));
result = p80211req_dorequest(wlandev, (u8 *) & msg); result = p80211req_dorequest(wlandev, (u8 *) &msg);
if (result) { if (result) {
err = -EFAULT; err = -EFAULT;
@ -1055,7 +1055,7 @@ static int p80211wext_siwretry(netdevice_t *dev,
mibitem.data = rrq->value /= 1024; mibitem.data = rrq->value /= 1024;
memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem)); memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem));
result = p80211req_dorequest(wlandev, (u8 *) & msg); result = p80211req_dorequest(wlandev, (u8 *) &msg);
if (result) { if (result) {
err = -EFAULT; err = -EFAULT;
@ -1069,7 +1069,7 @@ static int p80211wext_siwretry(netdevice_t *dev,
memcpy(&msg.mibattribute.data, &mibitem, memcpy(&msg.mibattribute.data, &mibitem,
sizeof(mibitem)); sizeof(mibitem));
result = p80211req_dorequest(wlandev, (u8 *) & msg); result = p80211req_dorequest(wlandev, (u8 *) &msg);
if (result) { if (result) {
err = -EFAULT; err = -EFAULT;
@ -1084,7 +1084,7 @@ static int p80211wext_siwretry(netdevice_t *dev,
memcpy(&msg.mibattribute.data, &mibitem, memcpy(&msg.mibattribute.data, &mibitem,
sizeof(mibitem)); sizeof(mibitem));
result = p80211req_dorequest(wlandev, (u8 *) & msg); result = p80211req_dorequest(wlandev, (u8 *) &msg);
if (result) { if (result) {
err = -EFAULT; err = -EFAULT;
@ -1121,7 +1121,7 @@ static int p80211wext_siwtxpow(netdevice_t *dev,
else else
mibitem.data = rrq->value; mibitem.data = rrq->value;
memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem)); memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem));
result = p80211req_dorequest(wlandev, (u8 *) & msg); result = p80211req_dorequest(wlandev, (u8 *) &msg);
if (result) { if (result) {
err = -EFAULT; err = -EFAULT;
@ -1147,7 +1147,7 @@ static int p80211wext_giwtxpow(netdevice_t *dev,
DIDmib_dot11phy_dot11PhyTxPowerTable_dot11CurrentTxPowerLevel; DIDmib_dot11phy_dot11PhyTxPowerTable_dot11CurrentTxPowerLevel;
memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem)); memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem));
result = p80211req_dorequest(wlandev, (u8 *) & msg); result = p80211req_dorequest(wlandev, (u8 *) &msg);
if (result) { if (result) {
err = -EFAULT; err = -EFAULT;
@ -1295,7 +1295,7 @@ static int p80211wext_siwscan(netdevice_t *dev,
msg.maxchanneltime.data = 250; msg.maxchanneltime.data = 250;
msg.minchanneltime.data = 200; msg.minchanneltime.data = 200;
result = p80211req_dorequest(wlandev, (u8 *) & msg); result = p80211req_dorequest(wlandev, (u8 *) &msg);
if (result) if (result)
err = prism2_result2err(msg.resultcode.data); err = prism2_result2err(msg.resultcode.data);
@ -1414,7 +1414,7 @@ static int p80211wext_giwscan(netdevice_t *dev,
msg.msgcode = DIDmsg_dot11req_scan_results; msg.msgcode = DIDmsg_dot11req_scan_results;
msg.bssindex.data = i; msg.bssindex.data = i;
result = p80211req_dorequest(wlandev, (u8 *) & msg); result = p80211req_dorequest(wlandev, (u8 *) &msg);
if ((result != 0) || if ((result != 0) ||
(msg.resultcode.data != P80211ENUM_resultcode_success)) { (msg.resultcode.data != P80211ENUM_resultcode_success)) {
break; break;
@ -1489,7 +1489,7 @@ static int p80211wext_set_encodeext(struct net_device *dev,
memcpy(wlandev->wep_keys[idx], ext->key, ext->key_len); memcpy(wlandev->wep_keys[idx], ext->key, ext->key_len);
memset(&msg, 0, sizeof(msg)); memset(&msg, 0, sizeof(msg));
pstr = (p80211item_pstr32_t *) & msg.mibattribute.data; pstr = (p80211item_pstr32_t *) &msg.mibattribute.data;
memcpy(pstr->data.data, ext->key, ext->key_len); memcpy(pstr->data.data, ext->key, ext->key_len);
pstr->data.len = ext->key_len; pstr->data.len = ext->key_len;
switch (idx) { switch (idx) {
@ -1513,7 +1513,7 @@ static int p80211wext_set_encodeext(struct net_device *dev,
break; break;
} }
msg.msgcode = DIDmsg_dot11req_mibset; msg.msgcode = DIDmsg_dot11req_mibset;
result = p80211req_dorequest(wlandev, (u8 *) & msg); result = p80211req_dorequest(wlandev, (u8 *) &msg);
pr_debug("result (%d)\n", result); pr_debug("result (%d)\n", result);
} }
return result; return result;
@ -1737,7 +1737,7 @@ struct iw_handler_def p80211wext_handler_def = {
.get_wireless_stats = p80211wext_get_wireless_stats .get_wireless_stats = p80211wext_get_wireless_stats
}; };
int p80211wext_event_associated(wlandevice_t * wlandev, int assoc) int p80211wext_event_associated(wlandevice_t *wlandev, int assoc)
{ {
union iwreq_data data; union iwreq_data data;

View File

@ -108,9 +108,9 @@ typedef struct pda {
} pda_t; } pda_t;
typedef struct imgchunk { typedef struct imgchunk {
u32 addr; /* start address */ u32 addr; /* start address */
u32 len; /* in bytes */ u32 len; /* in bytes */
u16 crc; /* CRC value (if it falls at a chunk boundary) */ u16 crc; /* CRC value (if it falls at a chunk boundary) */
u8 *data; u8 *data;
} imgchunk_t; } imgchunk_t;
@ -264,7 +264,7 @@ int prism2_fwapply(const struct ihex_binrec *rfptr, wlandevice_t *wlandev)
/* Build the PDA we're going to use. */ /* Build the PDA we're going to use. */
if (read_cardpda(&pda, wlandev)) { if (read_cardpda(&pda, wlandev)) {
printk(KERN_ERR "load_cardpda failed, exiting.\n"); printk(KERN_ERR "load_cardpda failed, exiting.\n");
return (1); return 1;
} }
/* read the card's PRI-SUP */ /* read the card's PRI-SUP */
@ -286,9 +286,8 @@ int prism2_fwapply(const struct ihex_binrec *rfptr, wlandevice_t *wlandev)
/* DIDmsg_dot11req_mibget */ /* DIDmsg_dot11req_mibget */
prism2mgmt_mibset_mibget(wlandev, &getmsg); prism2mgmt_mibset_mibget(wlandev, &getmsg);
if (getmsg.resultcode.data != P80211ENUM_resultcode_success) { if (getmsg.resultcode.data != P80211ENUM_resultcode_success)
printk(KERN_ERR "Couldn't fetch PRI-SUP info\n"); printk(KERN_ERR "Couldn't fetch PRI-SUP info\n");
}
/* Already in host order */ /* Already in host order */
priid.role = *data++; priid.role = *data++;
@ -301,19 +300,19 @@ int prism2_fwapply(const struct ihex_binrec *rfptr, wlandevice_t *wlandev)
result = read_fwfile(rfptr); result = read_fwfile(rfptr);
if (result) { if (result) {
printk(KERN_ERR "Failed to read the data exiting.\n"); printk(KERN_ERR "Failed to read the data exiting.\n");
return (1); return 1;
} }
result = validate_identity(); result = validate_identity();
if (result) { if (result) {
printk(KERN_ERR "Incompatible firmware image.\n"); printk(KERN_ERR "Incompatible firmware image.\n");
return (1); return 1;
} }
if (startaddr == 0x00000000) { if (startaddr == 0x00000000) {
printk(KERN_ERR "Can't RAM download a Flash image!\n"); printk(KERN_ERR "Can't RAM download a Flash image!\n");
return (1); return 1;
} }
/* Make the image chunks */ /* Make the image chunks */
@ -323,20 +322,20 @@ int prism2_fwapply(const struct ihex_binrec *rfptr, wlandevice_t *wlandev)
result = plugimage(fchunk, nfchunks, s3plug, ns3plug, &pda); result = plugimage(fchunk, nfchunks, s3plug, ns3plug, &pda);
if (result) { if (result) {
printk(KERN_ERR "Failed to plug data.\n"); printk(KERN_ERR "Failed to plug data.\n");
return (1); return 1;
} }
/* Insert any CRCs */ /* Insert any CRCs */
if (crcimage(fchunk, nfchunks, s3crc, ns3crc)) { if (crcimage(fchunk, nfchunks, s3crc, ns3crc)) {
printk(KERN_ERR "Failed to insert all CRCs\n"); printk(KERN_ERR "Failed to insert all CRCs\n");
return (1); return 1;
} }
/* Write the image */ /* Write the image */
result = writeimage(wlandev, fchunk, nfchunks); result = writeimage(wlandev, fchunk, nfchunks);
if (result) { if (result) {
printk(KERN_ERR "Failed to ramwrite image data.\n"); printk(KERN_ERR "Failed to ramwrite image data.\n");
return (1); return 1;
} }
/* clear any allocated memory */ /* clear any allocated memory */
@ -434,9 +433,8 @@ void free_chunks(imgchunk_t *fchunk, unsigned int *nfchunks)
{ {
int i; int i;
for (i = 0; i < *nfchunks; i++) { for (i = 0; i < *nfchunks; i++) {
if (fchunk[i].data != NULL) { if (fchunk[i].data != NULL)
kfree(fchunk[i].data); kfree(fchunk[i].data);
}
} }
*nfchunks = 0; *nfchunks = 0;
memset(fchunk, 0, sizeof(*fchunk)); memset(fchunk, 0, sizeof(*fchunk));
@ -531,7 +529,7 @@ int mkimage(imgchunk_t *clist, unsigned int *ccnt)
if (clist[i].data == NULL) { if (clist[i].data == NULL) {
printk(KERN_ERR printk(KERN_ERR
"failed to allocate image space, exitting.\n"); "failed to allocate image space, exitting.\n");
return (1); return 1;
} }
memset(clist[i].data, 0, clist[i].len); memset(clist[i].data, 0, clist[i].len);
pr_debug("chunk[%d]: addr=0x%06x len=%d\n", pr_debug("chunk[%d]: addr=0x%06x len=%d\n",
@ -545,15 +543,14 @@ int mkimage(imgchunk_t *clist, unsigned int *ccnt)
for (j = 0; j < *ccnt; j++) { for (j = 0; j < *ccnt; j++) {
cstart = clist[j].addr; cstart = clist[j].addr;
cend = cstart + clist[j].len - 1; cend = cstart + clist[j].len - 1;
if (s3start >= cstart && s3end <= cend) { if (s3start >= cstart && s3end <= cend)
break; break;
}
} }
if (((unsigned int)j) >= (*ccnt)) { if (((unsigned int)j) >= (*ccnt)) {
printk(KERN_ERR printk(KERN_ERR
"s3rec(a=0x%06x,l=%d), no chunk match, exiting.\n", "s3rec(a=0x%06x,l=%d), no chunk match, exiting.\n",
s3start, s3data[i].len); s3start, s3data[i].len);
return (1); return 1;
} }
coffset = s3start - cstart; coffset = s3start - cstart;
memcpy(clist[j].data + coffset, s3data[i].data, s3data[i].len); memcpy(clist[j].data + coffset, s3data[i].data, s3data[i].len);
@ -586,7 +583,7 @@ int mkpdrlist(pda_t *pda)
curroff = 0; curroff = 0;
while (curroff < (HFA384x_PDA_LEN_MAX / 2) && while (curroff < (HFA384x_PDA_LEN_MAX / 2) &&
le16_to_cpu(pda16[curroff + 1]) != HFA384x_PDR_END_OF_PDA) { le16_to_cpu(pda16[curroff + 1]) != HFA384x_PDR_END_OF_PDA) {
pda->rec[pda->nrec] = (hfa384x_pdrec_t *) & (pda16[curroff]); pda->rec[pda->nrec] = (hfa384x_pdrec_t *) &(pda16[curroff]);
if (le16_to_cpu(pda->rec[pda->nrec]->code) == HFA384x_PDR_NICID) { if (le16_to_cpu(pda->rec[pda->nrec]->code) == HFA384x_PDR_NICID) {
memcpy(&nicid, &pda->rec[pda->nrec]->data.nicid, memcpy(&nicid, &pda->rec[pda->nrec]->data.nicid,
@ -623,10 +620,10 @@ int mkpdrlist(pda_t *pda)
printk(KERN_ERR printk(KERN_ERR
"no end record found or invalid lengths in " "no end record found or invalid lengths in "
"PDR data, exiting. %x %d\n", curroff, pda->nrec); "PDR data, exiting. %x %d\n", curroff, pda->nrec);
return (1); return 1;
} }
if (le16_to_cpu(pda16[curroff + 1]) == HFA384x_PDR_END_OF_PDA) { if (le16_to_cpu(pda16[curroff + 1]) == HFA384x_PDR_END_OF_PDA) {
pda->rec[pda->nrec] = (hfa384x_pdrec_t *) & (pda16[curroff]); pda->rec[pda->nrec] = (hfa384x_pdrec_t *) &(pda16[curroff]);
(pda->nrec)++; (pda->nrec)++;
} }
return result; return result;
@ -869,7 +866,7 @@ int read_fwfile(const struct ihex_binrec *record)
ptr16 = (u16 *) record->data; ptr16 = (u16 *) record->data;
/* parse what was an S3 srec and put it in the right array */ /* parse what was an S3 srec and put it in the right array */
switch(addr) { switch (addr) {
case S3ADDR_START: case S3ADDR_START:
startaddr = *ptr32; startaddr = *ptr32;
pr_debug(" S7 start addr, record=%d " pr_debug(" S7 start addr, record=%d "
@ -890,7 +887,7 @@ int read_fwfile(const struct ihex_binrec *record)
s3plug[ns3plug].len); s3plug[ns3plug].len);
ns3plug++; ns3plug++;
if ( ns3plug == S3PLUG_MAX ) { if (ns3plug == S3PLUG_MAX) {
printk(KERN_ERR "S3 plugrec limit reached - aborting\n"); printk(KERN_ERR "S3 plugrec limit reached - aborting\n");
return 1; return 1;
} }
@ -907,7 +904,7 @@ int read_fwfile(const struct ihex_binrec *record)
s3crc[ns3crc].len, s3crc[ns3crc].len,
s3crc[ns3crc].dowrite); s3crc[ns3crc].dowrite);
ns3crc++; ns3crc++;
if ( ns3crc == S3CRC_MAX ) { if (ns3crc == S3CRC_MAX) {
printk(KERN_ERR "S3 crcrec limit reached - aborting\n"); printk(KERN_ERR "S3 crcrec limit reached - aborting\n");
return 1; return 1;
} }
@ -921,12 +918,12 @@ int read_fwfile(const struct ihex_binrec *record)
rcnt, rcnt,
s3info[ns3info].len, s3info[ns3info].len,
s3info[ns3info].type); s3info[ns3info].type);
if ( ((s3info[ns3info].len - 1) * sizeof(u16)) > sizeof(s3info[ns3info].info) ) { if (((s3info[ns3info].len - 1) * sizeof(u16)) > sizeof(s3info[ns3info].info)) {
printk(KERN_ERR " S3 inforec length too long - aborting\n"); printk(KERN_ERR " S3 inforec length too long - aborting\n");
return 1; return 1;
} }
tmpinfo = (u16*)&(s3info[ns3info].info.version); tmpinfo = (u16 *)&(s3info[ns3info].info.version);
pr_debug(" info="); pr_debug(" info=");
for (i = 0; i < s3info[ns3info].len - 1; i++) { for (i = 0; i < s3info[ns3info].len - 1; i++) {
tmpinfo[i] = *(ptr16 + 2 + i); tmpinfo[i] = *(ptr16 + 2 + i);
@ -935,7 +932,7 @@ int read_fwfile(const struct ihex_binrec *record)
pr_debug("\n"); pr_debug("\n");
ns3info++; ns3info++;
if ( ns3info == S3INFO_MAX ) { if (ns3info == S3INFO_MAX) {
printk(KERN_ERR "S3 inforec limit reached - aborting\n"); printk(KERN_ERR "S3 inforec limit reached - aborting\n");
return 1; return 1;
} }
@ -945,7 +942,7 @@ int read_fwfile(const struct ihex_binrec *record)
s3data[ns3data].len = len; s3data[ns3data].len = len;
s3data[ns3data].data = (uint8_t *) record->data; s3data[ns3data].data = (uint8_t *) record->data;
ns3data++; ns3data++;
if ( ns3data == S3DATA_MAX ) { if (ns3data == S3DATA_MAX) {
printk(KERN_ERR "S3 datarec limit reached - aborting\n"); printk(KERN_ERR "S3 datarec limit reached - aborting\n");
return 1; return 1;
} }
@ -1023,7 +1020,7 @@ int writeimage(wlandevice_t *wlandev, imgchunk_t *fchunk,
rstatemsg.enable.data = P80211ENUM_truth_true; rstatemsg.enable.data = P80211ENUM_truth_true;
rstatemsg.exeaddr.data = startaddr; rstatemsg.exeaddr.data = startaddr;
msgp = (p80211msg_t *) & rstatemsg; msgp = (p80211msg_t *) &rstatemsg;
result = prism2mgmt_ramdl_state(wlandev, msgp); result = prism2mgmt_ramdl_state(wlandev, msgp);
if (result) { if (result) {
printk(KERN_ERR printk(KERN_ERR
@ -1063,7 +1060,7 @@ int writeimage(wlandevice_t *wlandev, imgchunk_t *fchunk,
("Sending xxxdl_write message addr=%06x len=%d.\n", ("Sending xxxdl_write message addr=%06x len=%d.\n",
currdaddr, currlen); currdaddr, currlen);
msgp = (p80211msg_t *) & rwritemsg; msgp = (p80211msg_t *) &rwritemsg;
result = prism2mgmt_ramdl_write(wlandev, msgp); result = prism2mgmt_ramdl_write(wlandev, msgp);
/* Check the results */ /* Check the results */
@ -1090,7 +1087,7 @@ int writeimage(wlandevice_t *wlandev, imgchunk_t *fchunk,
rstatemsg.enable.data = P80211ENUM_truth_false; rstatemsg.enable.data = P80211ENUM_truth_false;
rstatemsg.exeaddr.data = 0; rstatemsg.exeaddr.data = 0;
msgp = (p80211msg_t *) & rstatemsg; msgp = (p80211msg_t *) &rstatemsg;
result = prism2mgmt_ramdl_state(wlandev, msgp); result = prism2mgmt_ramdl_state(wlandev, msgp);
if (result) { if (result) {
printk(KERN_ERR printk(KERN_ERR
@ -1160,10 +1157,7 @@ int validate_identity(void)
} }
/* SEC compat range */ /* SEC compat range */
if ((s3info[i].info.compat.role == 1) && if ((s3info[i].info.compat.role == 1) &&
(s3info[i].info.compat.id == 4)) { (s3info[i].info.compat.id == 4))
}
break; break;
case 3: case 3:
pr_debug("Seq: %#x\n", s3info[i].info.buildseq); pr_debug("Seq: %#x\n", s3info[i].info.buildseq);
@ -1196,8 +1190,9 @@ int validate_identity(void)
pr_debug("Unknown inforec type %d\n", s3info[i].type); pr_debug("Unknown inforec type %d\n", s3info[i].type);
} }
} }
// walk through /* walk through */
if (trump && (result != 2)) result = 0; if (trump && (result != 2))
result = 0;
return result; return result;
} }

View File

@ -67,7 +67,7 @@
#include <linux/wireless.h> #include <linux/wireless.h>
#include <linux/netdevice.h> #include <linux/netdevice.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <asm/io.h> #include <linux/io.h>
#include <asm/byteorder.h> #include <asm/byteorder.h>
#include <linux/random.h> #include <linux/random.h>
#include <linux/usb.h> #include <linux/usb.h>
@ -541,7 +541,7 @@ int prism2mgmt_start(wlandevice_t *wlandev, void *msgp)
/*** STATION ***/ /*** STATION ***/
/* Set the REQUIRED config items */ /* Set the REQUIRED config items */
/* SSID */ /* SSID */
pstr = (p80211pstrd_t *) & (msg->ssid.data); pstr = (p80211pstrd_t *) &(msg->ssid.data);
prism2mgmt_pstr2bytestr(p2bytestr, pstr); prism2mgmt_pstr2bytestr(p2bytestr, pstr);
result = hfa384x_drvr_setconfig(hw, HFA384x_RID_CNFOWNSSID, result = hfa384x_drvr_setconfig(hw, HFA384x_RID_CNFOWNSSID,
bytebuf, HFA384x_RID_CNFOWNSSID_LEN); bytebuf, HFA384x_RID_CNFOWNSSID_LEN);
@ -1034,7 +1034,7 @@ int prism2mgmt_autojoin(wlandevice_t *wlandev, void *msgp)
/* Set the ssid */ /* Set the ssid */
memset(bytebuf, 0, 256); memset(bytebuf, 0, 256);
pstr = (p80211pstrd_t *) & (msg->ssid.data); pstr = (p80211pstrd_t *) &(msg->ssid.data);
prism2mgmt_pstr2bytestr(p2bytestr, pstr); prism2mgmt_pstr2bytestr(p2bytestr, pstr);
result = hfa384x_drvr_setconfig(hw, HFA384x_RID_CNFDESIREDSSID, result = hfa384x_drvr_setconfig(hw, HFA384x_RID_CNFDESIREDSSID,
bytebuf, bytebuf,
@ -1123,8 +1123,8 @@ int prism2mgmt_wlansniff(wlandevice_t *wlandev, void *msgp)
if (hw->presniff_port_type != 0) { if (hw->presniff_port_type != 0) {
word = hw->presniff_port_type; word = hw->presniff_port_type;
result = hfa384x_drvr_setconfig16(hw, result = hfa384x_drvr_setconfig16(hw,
HFA384x_RID_CNFPORTTYPE, HFA384x_RID_CNFPORTTYPE,
word); word);
if (result) { if (result) {
pr_debug pr_debug
("failed to restore porttype, result=%d\n", ("failed to restore porttype, result=%d\n",
@ -1156,10 +1156,8 @@ int prism2mgmt_wlansniff(wlandevice_t *wlandev, void *msgp)
if (wlandev->netdev->type == ARPHRD_ETHER) { if (wlandev->netdev->type == ARPHRD_ETHER) {
/* Save macport 0 state */ /* Save macport 0 state */
result = hfa384x_drvr_getconfig16(hw, result = hfa384x_drvr_getconfig16(hw,
HFA384x_RID_CNFPORTTYPE, HFA384x_RID_CNFPORTTYPE,
& &(hw->presniff_port_type));
(hw->
presniff_port_type));
if (result) { if (result) {
pr_debug pr_debug
("failed to read porttype, result=%d\n", ("failed to read porttype, result=%d\n",
@ -1168,10 +1166,8 @@ int prism2mgmt_wlansniff(wlandevice_t *wlandev, void *msgp)
} }
/* Save the wepflags state */ /* Save the wepflags state */
result = hfa384x_drvr_getconfig16(hw, result = hfa384x_drvr_getconfig16(hw,
HFA384x_RID_CNFWEPFLAGS, HFA384x_RID_CNFWEPFLAGS,
& &(hw->presniff_wepflags));
(hw->
presniff_wepflags));
if (result) { if (result) {
pr_debug pr_debug
("failed to read wepflags, result=%d\n", ("failed to read wepflags, result=%d\n",
@ -1218,8 +1214,8 @@ int prism2mgmt_wlansniff(wlandevice_t *wlandev, void *msgp)
/* Set the port type to pIbss */ /* Set the port type to pIbss */
word = HFA384x_PORTTYPE_PSUEDOIBSS; word = HFA384x_PORTTYPE_PSUEDOIBSS;
result = hfa384x_drvr_setconfig16(hw, result = hfa384x_drvr_setconfig16(hw,
HFA384x_RID_CNFPORTTYPE, HFA384x_RID_CNFPORTTYPE,
word); word);
if (result) { if (result) {
pr_debug pr_debug
("failed to set porttype %d, result=%d\n", ("failed to set porttype %d, result=%d\n",
@ -1235,8 +1231,8 @@ int prism2mgmt_wlansniff(wlandevice_t *wlandev, void *msgp)
HFA384x_WEPFLAGS_DISABLE_RXCRYPT; HFA384x_WEPFLAGS_DISABLE_RXCRYPT;
result = result =
hfa384x_drvr_setconfig16(hw, hfa384x_drvr_setconfig16(hw,
HFA384x_RID_CNFWEPFLAGS, HFA384x_RID_CNFWEPFLAGS,
word); word);
} }
if (result) { if (result) {

View File

@ -63,43 +63,43 @@
extern int prism2_reset_holdtime; extern int prism2_reset_holdtime;
extern int prism2_reset_settletime; extern int prism2_reset_settletime;
u32 prism2sta_ifstate(wlandevice_t * wlandev, u32 ifstate); u32 prism2sta_ifstate(wlandevice_t *wlandev, u32 ifstate);
void prism2sta_ev_info(wlandevice_t * wlandev, hfa384x_InfFrame_t * inf); void prism2sta_ev_info(wlandevice_t *wlandev, hfa384x_InfFrame_t *inf);
void prism2sta_ev_txexc(wlandevice_t * wlandev, u16 status); void prism2sta_ev_txexc(wlandevice_t *wlandev, u16 status);
void prism2sta_ev_tx(wlandevice_t * wlandev, u16 status); void prism2sta_ev_tx(wlandevice_t *wlandev, u16 status);
void prism2sta_ev_rx(wlandevice_t * wlandev, struct sk_buff *skb); void prism2sta_ev_rx(wlandevice_t *wlandev, struct sk_buff *skb);
void prism2sta_ev_alloc(wlandevice_t * wlandev); void prism2sta_ev_alloc(wlandevice_t *wlandev);
int prism2mgmt_mibset_mibget(wlandevice_t * wlandev, void *msgp); int prism2mgmt_mibset_mibget(wlandevice_t *wlandev, void *msgp);
int prism2mgmt_scan(wlandevice_t * wlandev, void *msgp); int prism2mgmt_scan(wlandevice_t *wlandev, void *msgp);
int prism2mgmt_scan_results(wlandevice_t * wlandev, void *msgp); int prism2mgmt_scan_results(wlandevice_t *wlandev, void *msgp);
int prism2mgmt_start(wlandevice_t * wlandev, void *msgp); int prism2mgmt_start(wlandevice_t *wlandev, void *msgp);
int prism2mgmt_wlansniff(wlandevice_t * wlandev, void *msgp); int prism2mgmt_wlansniff(wlandevice_t *wlandev, void *msgp);
int prism2mgmt_readpda(wlandevice_t * wlandev, void *msgp); int prism2mgmt_readpda(wlandevice_t *wlandev, void *msgp);
int prism2mgmt_ramdl_state(wlandevice_t * wlandev, void *msgp); int prism2mgmt_ramdl_state(wlandevice_t *wlandev, void *msgp);
int prism2mgmt_ramdl_write(wlandevice_t * wlandev, void *msgp); int prism2mgmt_ramdl_write(wlandevice_t *wlandev, void *msgp);
int prism2mgmt_flashdl_state(wlandevice_t * wlandev, void *msgp); int prism2mgmt_flashdl_state(wlandevice_t *wlandev, void *msgp);
int prism2mgmt_flashdl_write(wlandevice_t * wlandev, void *msgp); int prism2mgmt_flashdl_write(wlandevice_t *wlandev, void *msgp);
int prism2mgmt_autojoin(wlandevice_t * wlandev, void *msgp); int prism2mgmt_autojoin(wlandevice_t *wlandev, void *msgp);
/*--------------------------------------------------------------- /*---------------------------------------------------------------
* conversion functions going between wlan message data types and * conversion functions going between wlan message data types and
* Prism2 data types * Prism2 data types
---------------------------------------------------------------*/ ---------------------------------------------------------------*/
/* byte area conversion functions*/ /* byte area conversion functions*/
void prism2mgmt_pstr2bytearea(u8 * bytearea, p80211pstrd_t * pstr); void prism2mgmt_pstr2bytearea(u8 *bytearea, p80211pstrd_t *pstr);
void prism2mgmt_bytearea2pstr(u8 * bytearea, p80211pstrd_t * pstr, int len); void prism2mgmt_bytearea2pstr(u8 *bytearea, p80211pstrd_t *pstr, int len);
/* byte string conversion functions*/ /* byte string conversion functions*/
void prism2mgmt_pstr2bytestr(hfa384x_bytestr_t * bytestr, p80211pstrd_t * pstr); void prism2mgmt_pstr2bytestr(hfa384x_bytestr_t *bytestr, p80211pstrd_t *pstr);
void prism2mgmt_bytestr2pstr(hfa384x_bytestr_t * bytestr, p80211pstrd_t * pstr); void prism2mgmt_bytestr2pstr(hfa384x_bytestr_t *bytestr, p80211pstrd_t *pstr);
/* functions to convert Group Addresses */ /* functions to convert Group Addresses */
void prism2mgmt_get_grpaddr(u32 did, p80211pstrd_t * pstr, hfa384x_t * priv); void prism2mgmt_get_grpaddr(u32 did, p80211pstrd_t *pstr, hfa384x_t *priv);
int prism2mgmt_set_grpaddr(u32 did, int prism2mgmt_set_grpaddr(u32 did,
u8 * prism2buf, p80211pstrd_t * pstr, u8 *prism2buf, p80211pstrd_t *pstr,
hfa384x_t * priv); hfa384x_t *priv);
int prism2mgmt_get_grpaddr_index(u32 did); int prism2mgmt_get_grpaddr_index(u32 did);
void prism2sta_processing_defer(struct work_struct *data); void prism2sta_processing_defer(struct work_struct *data);

View File

@ -113,8 +113,7 @@ static int prism2mib_flag(mibrec_t *mib,
p80211msg_dot11req_mibset_t *msg, void *data); p80211msg_dot11req_mibset_t *msg, void *data);
static int prism2mib_wepdefaultkey(mibrec_t *mib, 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);
@ -726,7 +725,7 @@ static int prism2mib_priv(mibrec_t *mib,
if (isget) { if (isget) {
hfa384x_drvr_getconfig(hw, hfa384x_drvr_getconfig(hw,
HFA384x_RID_CNFWPADATA, HFA384x_RID_CNFWPADATA,
(u8 *) & wpa, (u8 *) &wpa,
sizeof(wpa)); sizeof(wpa));
pstr->len = le16_to_cpu(wpa.datalen); pstr->len = le16_to_cpu(wpa.datalen);
memcpy(pstr->data, wpa.data, pstr->len); memcpy(pstr->data, wpa.data, pstr->len);
@ -736,9 +735,9 @@ static int prism2mib_priv(mibrec_t *mib,
result = result =
hfa384x_drvr_setconfig(hw, hfa384x_drvr_setconfig(hw,
HFA384x_RID_CNFWPADATA, HFA384x_RID_CNFWPADATA,
(u8 *) & wpa, (u8 *) &wpa,
sizeof(wpa)); sizeof(wpa));
} }
break; break;
} }

View File

@ -64,7 +64,7 @@
#include <linux/byteorder/generic.h> #include <linux/byteorder/generic.h>
#include <linux/ctype.h> #include <linux/ctype.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/if_arp.h> #include <linux/if_arp.h>
@ -1023,13 +1023,13 @@ static void prism2sta_inf_tallies(wlandevice_t *wlandev,
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 += le32_to_cpu(*src32); *dst += le32_to_cpu(*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 += le16_to_cpu(*src16); *dst += le16_to_cpu(*src16);
} }
@ -1280,9 +1280,8 @@ void prism2sta_processing_defer(struct work_struct *data)
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 *) & (p80211pstrd_t *) &wlandev->ssid);
wlandev->ssid);
/* Collect the port status */ /* Collect the port status */
result = hfa384x_drvr_getconfig16(hw, result = hfa384x_drvr_getconfig16(hw,
@ -1368,8 +1367,8 @@ void prism2sta_processing_defer(struct work_struct *data)
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);
@ -2028,8 +2027,8 @@ void prism2sta_commsqual_defer(struct work_struct *data)
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);