Staging: wlan-ng: Lindent cleanups

Lindent script cleanups in wlan-ng driver in the staging tree.
This is a item in the TODO list.

Signed-off-by: Mithlesh Thukral <mithlesh@linsyssoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Mithlesh Thukral 2009-05-25 19:06:16 +05:30 committed by Greg Kroah-Hartman
parent 1611a52c39
commit 75f49e0752
21 changed files with 1320 additions and 1399 deletions

View File

@ -887,23 +887,19 @@ typedef union hfa384x_usbin {
PD record structures.
--------------------------------------------------------------------*/
typedef struct hfa384x_pdr_pcb_partnum
{
typedef struct hfa384x_pdr_pcb_partnum {
u8 num[8];
} __attribute__ ((packed)) hfa384x_pdr_pcb_partnum_t;
typedef struct hfa384x_pdr_pcb_tracenum
{
typedef struct hfa384x_pdr_pcb_tracenum {
u8 num[8];
} __attribute__ ((packed)) hfa384x_pdr_pcb_tracenum_t;
typedef struct hfa384x_pdr_nic_serial
{
typedef struct hfa384x_pdr_nic_serial {
u8 num[12];
} __attribute__ ((packed)) hfa384x_pdr_nic_serial_t;
typedef struct hfa384x_pdr_mkk_measurements
{
typedef struct hfa384x_pdr_mkk_measurements {
double carrier_freq;
double occupied_band;
double power_density;
@ -921,170 +917,138 @@ typedef struct hfa384x_pdr_mkk_measurements
double rx_spur_l2;
} __attribute__ ((packed)) hfa384x_pdr_mkk_measurements_t;
typedef struct hfa384x_pdr_nic_ramsize
{
typedef struct hfa384x_pdr_nic_ramsize {
u8 size[12]; /* units of KB */
} __attribute__ ((packed)) hfa384x_pdr_nic_ramsize_t;
typedef struct hfa384x_pdr_mfisuprange
{
typedef struct hfa384x_pdr_mfisuprange {
u16 id;
u16 variant;
u16 bottom;
u16 top;
} __attribute__ ((packed)) hfa384x_pdr_mfisuprange_t;
typedef struct hfa384x_pdr_cfisuprange
{
typedef struct hfa384x_pdr_cfisuprange {
u16 id;
u16 variant;
u16 bottom;
u16 top;
} __attribute__ ((packed)) hfa384x_pdr_cfisuprange_t;
typedef struct hfa384x_pdr_nicid
{
typedef struct hfa384x_pdr_nicid {
u16 id;
u16 variant;
u16 major;
u16 minor;
} __attribute__ ((packed)) hfa384x_pdr_nicid_t;
typedef struct hfa384x_pdr_refdac_measurements
{
typedef struct hfa384x_pdr_refdac_measurements {
u16 value[0];
} __attribute__ ((packed)) hfa384x_pdr_refdac_measurements_t;
typedef struct hfa384x_pdr_vgdac_measurements
{
typedef struct hfa384x_pdr_vgdac_measurements {
u16 value[0];
} __attribute__ ((packed)) hfa384x_pdr_vgdac_measurements_t;
typedef struct hfa384x_pdr_level_comp_measurements
{
typedef struct hfa384x_pdr_level_comp_measurements {
u16 value[0];
} __attribute__ ((packed)) hfa384x_pdr_level_compc_measurements_t;
typedef struct hfa384x_pdr_mac_address
{
typedef struct hfa384x_pdr_mac_address {
u8 addr[6];
} __attribute__ ((packed)) hfa384x_pdr_mac_address_t;
typedef struct hfa384x_pdr_mkk_callname
{
typedef struct hfa384x_pdr_mkk_callname {
u8 callname[8];
} __attribute__ ((packed)) hfa384x_pdr_mkk_callname_t;
typedef struct hfa384x_pdr_regdomain
{
typedef struct hfa384x_pdr_regdomain {
u16 numdomains;
u16 domain[5];
} __attribute__ ((packed)) hfa384x_pdr_regdomain_t;
typedef struct hfa384x_pdr_allowed_channel
{
typedef struct hfa384x_pdr_allowed_channel {
u16 ch_bitmap;
} __attribute__ ((packed)) hfa384x_pdr_allowed_channel_t;
typedef struct hfa384x_pdr_default_channel
{
typedef struct hfa384x_pdr_default_channel {
u16 channel;
} __attribute__ ((packed)) hfa384x_pdr_default_channel_t;
typedef struct hfa384x_pdr_privacy_option
{
typedef struct hfa384x_pdr_privacy_option {
u16 available;
} __attribute__ ((packed)) hfa384x_pdr_privacy_option_t;
typedef struct hfa384x_pdr_temptype
{
typedef struct hfa384x_pdr_temptype {
u16 type;
} __attribute__ ((packed)) hfa384x_pdr_temptype_t;
typedef struct hfa384x_pdr_refdac_setup
{
typedef struct hfa384x_pdr_refdac_setup {
u16 ch_value[14];
} __attribute__ ((packed)) hfa384x_pdr_refdac_setup_t;
typedef struct hfa384x_pdr_vgdac_setup
{
typedef struct hfa384x_pdr_vgdac_setup {
u16 ch_value[14];
} __attribute__ ((packed)) hfa384x_pdr_vgdac_setup_t;
typedef struct hfa384x_pdr_level_comp_setup
{
typedef struct hfa384x_pdr_level_comp_setup {
u16 ch_value[14];
} __attribute__ ((packed)) hfa384x_pdr_level_comp_setup_t;
typedef struct hfa384x_pdr_trimdac_setup
{
typedef struct hfa384x_pdr_trimdac_setup {
u16 trimidac;
u16 trimqdac;
} __attribute__ ((packed)) hfa384x_pdr_trimdac_setup_t;
typedef struct hfa384x_pdr_ifr_setting
{
typedef struct hfa384x_pdr_ifr_setting {
u16 value[3];
} __attribute__ ((packed)) hfa384x_pdr_ifr_setting_t;
typedef struct hfa384x_pdr_rfr_setting
{
typedef struct hfa384x_pdr_rfr_setting {
u16 value[3];
} __attribute__ ((packed)) hfa384x_pdr_rfr_setting_t;
typedef struct hfa384x_pdr_hfa3861_baseline
{
typedef struct hfa384x_pdr_hfa3861_baseline {
u16 value[50];
} __attribute__ ((packed)) hfa384x_pdr_hfa3861_baseline_t;
typedef struct hfa384x_pdr_hfa3861_shadow
{
typedef struct hfa384x_pdr_hfa3861_shadow {
u32 value[32];
} __attribute__ ((packed)) hfa384x_pdr_hfa3861_shadow_t;
typedef struct hfa384x_pdr_hfa3861_ifrf
{
typedef struct hfa384x_pdr_hfa3861_ifrf {
u32 value[20];
} __attribute__ ((packed)) hfa384x_pdr_hfa3861_ifrf_t;
typedef struct hfa384x_pdr_hfa3861_chcalsp
{
typedef struct hfa384x_pdr_hfa3861_chcalsp {
u16 value[14];
} __attribute__ ((packed)) hfa384x_pdr_hfa3861_chcalsp_t;
typedef struct hfa384x_pdr_hfa3861_chcali
{
typedef struct hfa384x_pdr_hfa3861_chcali {
u16 value[17];
} __attribute__ ((packed)) hfa384x_pdr_hfa3861_chcali_t;
typedef struct hfa384x_pdr_hfa3861_nic_config
{
typedef struct hfa384x_pdr_hfa3861_nic_config {
u16 config_bitmap;
} __attribute__ ((packed)) hfa384x_pdr_nic_config_t;
typedef struct hfa384x_pdr_hfo_delay
{
typedef struct hfa384x_pdr_hfo_delay {
u8 hfo_delay;
} __attribute__ ((packed)) hfa384x_hfo_delay_t;
typedef struct hfa384x_pdr_hfa3861_manf_testsp
{
typedef struct hfa384x_pdr_hfa3861_manf_testsp {
u16 value[30];
} __attribute__ ((packed)) hfa384x_pdr_hfa3861_manf_testsp_t;
typedef struct hfa384x_pdr_hfa3861_manf_testi
{
typedef struct hfa384x_pdr_hfa3861_manf_testi {
u16 value[30];
} __attribute__ ((packed)) hfa384x_pdr_hfa3861_manf_testi_t;
typedef struct hfa384x_end_of_pda
{
typedef struct hfa384x_end_of_pda {
u16 crc;
} __attribute__ ((packed)) hfa384x_pdr_end_of_pda_t;
typedef struct hfa384x_pdrec
{
typedef struct hfa384x_pdrec {
u16 len; /* in words */
u16 code;
union pdr {
@ -1169,7 +1133,7 @@ struct hfa384x;
typedef void (*ctlx_cmdcb_t) (struct hfa384x *, const struct hfa384x_usbctlx *);
typedef void (*ctlx_usercb_t) (struct hfa384x *hw,
typedef void (*ctlx_usercb_t) (struct hfa384x * hw,
void *ctlxresult, void *usercb_data);
typedef struct hfa384x_usbctlx {
@ -1356,25 +1320,25 @@ typedef struct hfa384x {
} hfa384x_t;
void hfa384x_create(hfa384x_t *hw, struct usb_device *usb);
void hfa384x_destroy(hfa384x_t *hw);
void hfa384x_create(hfa384x_t * hw, struct usb_device *usb);
void hfa384x_destroy(hfa384x_t * hw);
int
hfa384x_corereset(hfa384x_t *hw, int holdtime, int settletime, int genesis);
int hfa384x_drvr_commtallies(hfa384x_t *hw);
int hfa384x_drvr_disable(hfa384x_t *hw, u16 macport);
int hfa384x_drvr_enable(hfa384x_t *hw, u16 macport);
int hfa384x_drvr_flashdl_enable(hfa384x_t *hw);
int hfa384x_drvr_flashdl_disable(hfa384x_t *hw);
int hfa384x_drvr_flashdl_write(hfa384x_t *hw, u32 daddr, void *buf, u32 len);
int hfa384x_drvr_getconfig(hfa384x_t *hw, u16 rid, void *buf, u16 len);
int hfa384x_drvr_ramdl_enable(hfa384x_t *hw, u32 exeaddr);
int hfa384x_drvr_ramdl_disable(hfa384x_t *hw);
int hfa384x_drvr_ramdl_write(hfa384x_t *hw, u32 daddr, void *buf, u32 len);
int hfa384x_drvr_readpda(hfa384x_t *hw, void *buf, unsigned int len);
int hfa384x_drvr_setconfig(hfa384x_t *hw, u16 rid, void *buf, u16 len);
hfa384x_corereset(hfa384x_t * hw, int holdtime, int settletime, int genesis);
int hfa384x_drvr_commtallies(hfa384x_t * hw);
int hfa384x_drvr_disable(hfa384x_t * hw, u16 macport);
int hfa384x_drvr_enable(hfa384x_t * hw, u16 macport);
int hfa384x_drvr_flashdl_enable(hfa384x_t * hw);
int hfa384x_drvr_flashdl_disable(hfa384x_t * hw);
int hfa384x_drvr_flashdl_write(hfa384x_t * hw, u32 daddr, void *buf, u32 len);
int hfa384x_drvr_getconfig(hfa384x_t * hw, u16 rid, void *buf, u16 len);
int hfa384x_drvr_ramdl_enable(hfa384x_t * hw, u32 exeaddr);
int hfa384x_drvr_ramdl_disable(hfa384x_t * hw);
int hfa384x_drvr_ramdl_write(hfa384x_t * hw, u32 daddr, void *buf, u32 len);
int hfa384x_drvr_readpda(hfa384x_t * hw, void *buf, unsigned int len);
int hfa384x_drvr_setconfig(hfa384x_t * hw, u16 rid, void *buf, u16 len);
static inline int hfa384x_drvr_getconfig16(hfa384x_t *hw, u16 rid, void *val)
static inline int hfa384x_drvr_getconfig16(hfa384x_t * hw, u16 rid, void *val)
{
int result = 0;
result = hfa384x_drvr_getconfig(hw, rid, val, sizeof(u16));
@ -1383,44 +1347,44 @@ static inline int hfa384x_drvr_getconfig16(hfa384x_t *hw, u16 rid, void *val)
return result;
}
static inline int hfa384x_drvr_setconfig16(hfa384x_t *hw, u16 rid, u16 val)
static inline int hfa384x_drvr_setconfig16(hfa384x_t * hw, u16 rid, u16 val)
{
u16 value = cpu_to_le16(val);
return hfa384x_drvr_setconfig(hw, rid, &value, sizeof(value));
}
int
hfa384x_drvr_getconfig_async(hfa384x_t *hw,
hfa384x_drvr_getconfig_async(hfa384x_t * hw,
u16 rid, ctlx_usercb_t usercb, void *usercb_data);
int
hfa384x_drvr_setconfig_async(hfa384x_t *hw,
hfa384x_drvr_setconfig_async(hfa384x_t * hw,
u16 rid,
void *buf,
u16 len, ctlx_usercb_t usercb, void *usercb_data);
static inline int
hfa384x_drvr_setconfig16_async(hfa384x_t *hw, u16 rid, u16 val)
hfa384x_drvr_setconfig16_async(hfa384x_t * hw, u16 rid, u16 val)
{
u16 value = cpu_to_le16(val);
return hfa384x_drvr_setconfig_async(hw, rid, &value, sizeof(value),
NULL, NULL);
}
int hfa384x_drvr_start(hfa384x_t *hw);
int hfa384x_drvr_stop(hfa384x_t *hw);
int hfa384x_drvr_start(hfa384x_t * hw);
int hfa384x_drvr_stop(hfa384x_t * hw);
int
hfa384x_drvr_txframe(hfa384x_t *hw, struct sk_buff *skb,
p80211_hdr_t *p80211_hdr, p80211_metawep_t *p80211_wep);
void hfa384x_tx_timeout(wlandevice_t *wlandev);
hfa384x_drvr_txframe(hfa384x_t * hw, struct sk_buff *skb,
p80211_hdr_t * p80211_hdr, p80211_metawep_t * p80211_wep);
void hfa384x_tx_timeout(wlandevice_t * wlandev);
int hfa384x_cmd_initialize(hfa384x_t *hw);
int hfa384x_cmd_enable(hfa384x_t *hw, u16 macport);
int hfa384x_cmd_disable(hfa384x_t *hw, u16 macport);
int hfa384x_cmd_allocate(hfa384x_t *hw, u16 len);
int hfa384x_cmd_monitor(hfa384x_t *hw, u16 enable);
int hfa384x_cmd_initialize(hfa384x_t * hw);
int hfa384x_cmd_enable(hfa384x_t * hw, u16 macport);
int hfa384x_cmd_disable(hfa384x_t * hw, u16 macport);
int hfa384x_cmd_allocate(hfa384x_t * hw, u16 len);
int hfa384x_cmd_monitor(hfa384x_t * hw, u16 enable);
int
hfa384x_cmd_download(hfa384x_t *hw,
hfa384x_cmd_download(hfa384x_t * hw,
u16 mode, u16 lowaddr, u16 highaddr, u16 codelen);
#endif /* __KERNEL__ */

View File

@ -110,7 +110,6 @@
* --------------------------------------------------------------------
*/
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/sched.h>
@ -161,13 +160,13 @@ static void dbprint_urb(struct urb *urb);
#endif
static void
hfa384x_int_rxmonitor(wlandevice_t *wlandev, hfa384x_usb_rxfrm_t *rxfrm);
hfa384x_int_rxmonitor(wlandevice_t * wlandev, hfa384x_usb_rxfrm_t * rxfrm);
static void hfa384x_usb_defer(struct work_struct *data);
static int submit_rx_urb(hfa384x_t *hw, gfp_t flags);
static int submit_rx_urb(hfa384x_t * hw, gfp_t flags);
static int submit_tx_urb(hfa384x_t *hw, struct urb *tx_urb, gfp_t flags);
static int submit_tx_urb(hfa384x_t * hw, struct urb *tx_urb, gfp_t flags);
/*---------------------------------------------------*/
/* Callbacks */
@ -176,22 +175,22 @@ static void hfa384x_ctlxout_callback(struct urb *urb);
static void hfa384x_usbin_callback(struct urb *urb);
static void
hfa384x_usbin_txcompl(wlandevice_t *wlandev, hfa384x_usbin_t *usbin);
hfa384x_usbin_txcompl(wlandevice_t * wlandev, hfa384x_usbin_t * usbin);
static void hfa384x_usbin_rx(wlandevice_t *wlandev, struct sk_buff *skb);
static void hfa384x_usbin_rx(wlandevice_t * wlandev, struct sk_buff *skb);
static void hfa384x_usbin_info(wlandevice_t *wlandev, hfa384x_usbin_t *usbin);
static void hfa384x_usbin_info(wlandevice_t * wlandev, hfa384x_usbin_t * usbin);
static void
hfa384x_usbout_tx(wlandevice_t *wlandev, hfa384x_usbout_t *usbout);
hfa384x_usbout_tx(wlandevice_t * wlandev, hfa384x_usbout_t * usbout);
static void hfa384x_usbin_ctlx(hfa384x_t *hw, hfa384x_usbin_t *usbin,
static void hfa384x_usbin_ctlx(hfa384x_t * hw, hfa384x_usbin_t * usbin,
int urb_status);
/*---------------------------------------------------*/
/* Functions to support the prism2 usb command queue */
static void hfa384x_usbctlxq_run(hfa384x_t *hw);
static void hfa384x_usbctlxq_run(hfa384x_t * hw);
static void hfa384x_usbctlx_reqtimerfn(unsigned long data);
@ -203,9 +202,9 @@ static void hfa384x_usbctlx_completion_task(unsigned long data);
static void hfa384x_usbctlx_reaper_task(unsigned long data);
static int hfa384x_usbctlx_submit(hfa384x_t *hw, hfa384x_usbctlx_t *ctlx);
static int hfa384x_usbctlx_submit(hfa384x_t * hw, hfa384x_usbctlx_t * ctlx);
static void unlocked_usbctlx_complete(hfa384x_t *hw, hfa384x_usbctlx_t *ctlx);
static void unlocked_usbctlx_complete(hfa384x_t * hw, hfa384x_usbctlx_t * ctlx);
struct usbctlx_completor {
int (*complete) (struct usbctlx_completor *);
@ -213,35 +212,35 @@ struct usbctlx_completor {
typedef struct usbctlx_completor usbctlx_completor_t;
static int
hfa384x_usbctlx_complete_sync(hfa384x_t *hw,
hfa384x_usbctlx_t *ctlx,
usbctlx_completor_t *completor);
hfa384x_usbctlx_complete_sync(hfa384x_t * hw,
hfa384x_usbctlx_t * ctlx,
usbctlx_completor_t * completor);
static int
unlocked_usbctlx_cancel_async(hfa384x_t *hw, hfa384x_usbctlx_t *ctlx);
unlocked_usbctlx_cancel_async(hfa384x_t * hw, hfa384x_usbctlx_t * ctlx);
static void hfa384x_cb_status(hfa384x_t *hw, const hfa384x_usbctlx_t *ctlx);
static void hfa384x_cb_status(hfa384x_t * hw, const hfa384x_usbctlx_t * ctlx);
static void hfa384x_cb_rrid(hfa384x_t *hw, const hfa384x_usbctlx_t *ctlx);
static void hfa384x_cb_rrid(hfa384x_t * hw, const hfa384x_usbctlx_t * ctlx);
static int
usbctlx_get_status(const hfa384x_usb_cmdresp_t *cmdresp,
hfa384x_cmdresult_t *result);
usbctlx_get_status(const hfa384x_usb_cmdresp_t * cmdresp,
hfa384x_cmdresult_t * result);
static void
usbctlx_get_rridresult(const hfa384x_usb_rridresp_t *rridresp,
hfa384x_rridresult_t *result);
usbctlx_get_rridresult(const hfa384x_usb_rridresp_t * rridresp,
hfa384x_rridresult_t * result);
/*---------------------------------------------------*/
/* Low level req/resp CTLX formatters and submitters */
static int
hfa384x_docmd(hfa384x_t *hw,
hfa384x_docmd(hfa384x_t * hw,
CMD_MODE mode,
hfa384x_metacmd_t *cmd,
hfa384x_metacmd_t * cmd,
ctlx_cmdcb_t cmdcb, ctlx_usercb_t usercb, void *usercb_data);
static int
hfa384x_dorrid(hfa384x_t *hw,
hfa384x_dorrid(hfa384x_t * hw,
CMD_MODE mode,
u16 rid,
void *riddata,
@ -249,7 +248,7 @@ hfa384x_dorrid(hfa384x_t *hw,
ctlx_cmdcb_t cmdcb, ctlx_usercb_t usercb, void *usercb_data);
static int
hfa384x_dowrid(hfa384x_t *hw,
hfa384x_dowrid(hfa384x_t * hw,
CMD_MODE mode,
u16 rid,
void *riddata,
@ -257,7 +256,7 @@ hfa384x_dowrid(hfa384x_t *hw,
ctlx_cmdcb_t cmdcb, ctlx_usercb_t usercb, void *usercb_data);
static int
hfa384x_dormem(hfa384x_t *hw,
hfa384x_dormem(hfa384x_t * hw,
CMD_MODE mode,
u16 page,
u16 offset,
@ -266,7 +265,7 @@ hfa384x_dormem(hfa384x_t *hw,
ctlx_cmdcb_t cmdcb, ctlx_usercb_t usercb, void *usercb_data);
static int
hfa384x_dowmem(hfa384x_t *hw,
hfa384x_dowmem(hfa384x_t * hw,
CMD_MODE mode,
u16 page,
u16 offset,
@ -291,7 +290,7 @@ static inline const char *ctlxstr(CTLX_STATE s)
return ctlx_str[s];
};
static inline hfa384x_usbctlx_t *get_active_ctlx(hfa384x_t *hw)
static inline hfa384x_usbctlx_t *get_active_ctlx(hfa384x_t * hw)
{
return list_entry(hw->ctlxq.active.next, hfa384x_usbctlx_t, list);
}
@ -310,14 +309,12 @@ void dbprint_urb(struct urb *urb)
pr_debug("urb->bandwidth=0x%08x\n", urb->bandwidth);
pr_debug("urb->setup_packet(ctl)=0x%08x\n",
(unsigned int)urb->setup_packet);
pr_debug("urb->start_frame(iso/irq)=0x%08x\n",
urb->start_frame);
pr_debug("urb->start_frame(iso/irq)=0x%08x\n", urb->start_frame);
pr_debug("urb->interval(irq)=0x%08x\n", urb->interval);
pr_debug("urb->error_count(iso)=0x%08x\n", urb->error_count);
pr_debug("urb->timeout=0x%08x\n", urb->timeout);
pr_debug("urb->context=0x%08x\n", (unsigned int)urb->context);
pr_debug("urb->complete=0x%08x\n",
(unsigned int)urb->complete);
pr_debug("urb->complete=0x%08x\n", (unsigned int)urb->complete);
}
#endif
@ -337,7 +334,7 @@ void dbprint_urb(struct urb *urb)
* Call context:
* Any
----------------------------------------------------------------*/
static int submit_rx_urb(hfa384x_t *hw, gfp_t memflags)
static int submit_rx_urb(hfa384x_t * hw, gfp_t memflags)
{
struct sk_buff *skb;
int result;
@ -398,7 +395,7 @@ done:
* Call context:
* Any
----------------------------------------------------------------*/
static int submit_tx_urb(hfa384x_t *hw, struct urb *tx_urb, gfp_t memflags)
static int submit_tx_urb(hfa384x_t * hw, struct urb *tx_urb, gfp_t memflags)
{
struct net_device *netdev = hw->wlandev->netdev;
int result;
@ -535,7 +532,7 @@ static void hfa384x_usb_defer(struct work_struct *data)
* Call context:
* process
----------------------------------------------------------------*/
void hfa384x_create(hfa384x_t *hw, struct usb_device *usb)
void hfa384x_create(hfa384x_t * hw, struct usb_device *usb)
{
memset(hw, 0, sizeof(hfa384x_t));
hw->usb = usb;
@ -611,7 +608,7 @@ void hfa384x_create(hfa384x_t *hw, struct usb_device *usb)
* Call context:
* process
----------------------------------------------------------------*/
void hfa384x_destroy(hfa384x_t *hw)
void hfa384x_destroy(hfa384x_t * hw)
{
struct sk_buff *skb;
@ -633,7 +630,7 @@ static hfa384x_usbctlx_t *usbctlx_alloc(void)
{
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) {
memset(ctlx, 0, sizeof(*ctlx));
init_completion(&ctlx->done);
@ -643,8 +640,8 @@ static hfa384x_usbctlx_t *usbctlx_alloc(void)
}
static int
usbctlx_get_status(const hfa384x_usb_cmdresp_t *cmdresp,
hfa384x_cmdresult_t *result)
usbctlx_get_status(const hfa384x_usb_cmdresp_t * cmdresp,
hfa384x_cmdresult_t * result)
{
result->status = le16_to_cpu(cmdresp->status);
result->resp0 = le16_to_cpu(cmdresp->resp0);
@ -659,8 +656,8 @@ usbctlx_get_status(const hfa384x_usb_cmdresp_t *cmdresp,
}
static void
usbctlx_get_rridresult(const hfa384x_usb_rridresp_t *rridresp,
hfa384x_rridresult_t *result)
usbctlx_get_rridresult(const hfa384x_usb_rridresp_t * rridresp,
hfa384x_rridresult_t * result)
{
result->rid = le16_to_cpu(rridresp->rid);
result->riddata = rridresp->data;
@ -681,7 +678,7 @@ struct usbctlx_cmd_completor {
};
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;
return usbctlx_get_status(complete->cmdresp, complete->result);
@ -715,7 +712,7 @@ struct usbctlx_rrid_completor {
};
typedef struct usbctlx_rrid_completor usbctlx_rrid_completor_t;
static int usbctlx_rrid_completor_fn(usbctlx_completor_t *head)
static int usbctlx_rrid_completor_fn(usbctlx_completor_t * head)
{
usbctlx_rrid_completor_t *complete = (usbctlx_rrid_completor_t *) head;
hfa384x_rridresult_t rridresult;
@ -736,7 +733,7 @@ static int usbctlx_rrid_completor_fn(usbctlx_completor_t *head)
}
static inline usbctlx_completor_t *init_rrid_completor(usbctlx_rrid_completor_t
*completor,
* completor,
const
hfa384x_usb_rridresp_t *
rridresp, void *riddata,
@ -776,7 +773,7 @@ struct usbctlx_rmem_completor {
};
typedef struct usbctlx_rmem_completor usbctlx_rmem_completor_t;
static int usbctlx_rmem_completor_fn(usbctlx_completor_t *head)
static int usbctlx_rmem_completor_fn(usbctlx_completor_t * head)
{
usbctlx_rmem_completor_t *complete = (usbctlx_rmem_completor_t *) head;
@ -786,9 +783,9 @@ static int usbctlx_rmem_completor_fn(usbctlx_completor_t *head)
}
static inline usbctlx_completor_t *init_rmem_completor(usbctlx_rmem_completor_t
*completor,
* completor,
hfa384x_usb_rmemresp_t
*rmemresp, void *data,
* rmemresp, void *data,
unsigned int len)
{
completor->head.complete = usbctlx_rmem_completor_fn;
@ -819,7 +816,7 @@ static inline usbctlx_completor_t *init_rmem_completor(usbctlx_rmem_completor_t
* Call context:
* interrupt
----------------------------------------------------------------*/
static void hfa384x_cb_status(hfa384x_t *hw, const hfa384x_usbctlx_t *ctlx)
static void hfa384x_cb_status(hfa384x_t * hw, const hfa384x_usbctlx_t * ctlx)
{
if (ctlx->usercb != NULL) {
hfa384x_cmdresult_t cmdresult;
@ -856,15 +853,14 @@ static void hfa384x_cb_status(hfa384x_t *hw, const hfa384x_usbctlx_t *ctlx)
* Call context:
* interrupt
----------------------------------------------------------------*/
static void hfa384x_cb_rrid(hfa384x_t *hw, const hfa384x_usbctlx_t *ctlx)
static void hfa384x_cb_rrid(hfa384x_t * hw, const hfa384x_usbctlx_t * ctlx)
{
if (ctlx->usercb != NULL) {
hfa384x_rridresult_t rridresult;
if (ctlx->state != CTLX_COMPLETE) {
memset(&rridresult, 0, sizeof(rridresult));
rridresult.rid =
le16_to_cpu(ctlx->outbuf.rridreq.rid);
rridresult.rid = le16_to_cpu(ctlx->outbuf.rridreq.rid);
} else {
usbctlx_get_rridresult(&ctlx->inbuf.rridresp,
&rridresult);
@ -874,21 +870,21 @@ static void hfa384x_cb_rrid(hfa384x_t *hw, const hfa384x_usbctlx_t *ctlx)
}
}
static inline int hfa384x_docmd_wait(hfa384x_t *hw, hfa384x_metacmd_t *cmd)
static inline int hfa384x_docmd_wait(hfa384x_t * hw, hfa384x_metacmd_t * cmd)
{
return hfa384x_docmd(hw, DOWAIT, cmd, NULL, NULL, NULL);
}
static inline int
hfa384x_docmd_async(hfa384x_t *hw,
hfa384x_metacmd_t *cmd,
hfa384x_docmd_async(hfa384x_t * hw,
hfa384x_metacmd_t * cmd,
ctlx_cmdcb_t cmdcb, ctlx_usercb_t usercb, void *usercb_data)
{
return hfa384x_docmd(hw, DOASYNC, cmd, cmdcb, usercb, usercb_data);
}
static inline int
hfa384x_dorrid_wait(hfa384x_t *hw, u16 rid, void *riddata,
hfa384x_dorrid_wait(hfa384x_t * hw, u16 rid, void *riddata,
unsigned int riddatalen)
{
return hfa384x_dorrid(hw, DOWAIT,
@ -896,7 +892,7 @@ hfa384x_dorrid_wait(hfa384x_t *hw, u16 rid, void *riddata,
}
static inline int
hfa384x_dorrid_async(hfa384x_t *hw,
hfa384x_dorrid_async(hfa384x_t * hw,
u16 rid, void *riddata, unsigned int riddatalen,
ctlx_cmdcb_t cmdcb,
ctlx_usercb_t usercb, void *usercb_data)
@ -907,7 +903,7 @@ hfa384x_dorrid_async(hfa384x_t *hw,
}
static inline int
hfa384x_dowrid_wait(hfa384x_t *hw, u16 rid, void *riddata,
hfa384x_dowrid_wait(hfa384x_t * hw, u16 rid, void *riddata,
unsigned int riddatalen)
{
return hfa384x_dowrid(hw, DOWAIT,
@ -915,7 +911,7 @@ hfa384x_dowrid_wait(hfa384x_t *hw, u16 rid, void *riddata,
}
static inline int
hfa384x_dowrid_async(hfa384x_t *hw,
hfa384x_dowrid_async(hfa384x_t * hw,
u16 rid, void *riddata, unsigned int riddatalen,
ctlx_cmdcb_t cmdcb,
ctlx_usercb_t usercb, void *usercb_data)
@ -926,7 +922,7 @@ hfa384x_dowrid_async(hfa384x_t *hw,
}
static inline int
hfa384x_dormem_wait(hfa384x_t *hw,
hfa384x_dormem_wait(hfa384x_t * hw,
u16 page, u16 offset, void *data, unsigned int len)
{
return hfa384x_dormem(hw, DOWAIT,
@ -934,7 +930,7 @@ hfa384x_dormem_wait(hfa384x_t *hw,
}
static inline int
hfa384x_dormem_async(hfa384x_t *hw,
hfa384x_dormem_async(hfa384x_t * hw,
u16 page, u16 offset, void *data, unsigned int len,
ctlx_cmdcb_t cmdcb,
ctlx_usercb_t usercb, void *usercb_data)
@ -945,7 +941,7 @@ hfa384x_dormem_async(hfa384x_t *hw,
}
static inline int
hfa384x_dowmem_wait(hfa384x_t *hw,
hfa384x_dowmem_wait(hfa384x_t * hw,
u16 page, u16 offset, void *data, unsigned int len)
{
return hfa384x_dowmem(hw, DOWAIT,
@ -953,7 +949,7 @@ hfa384x_dowmem_wait(hfa384x_t *hw,
}
static inline int
hfa384x_dowmem_async(hfa384x_t *hw,
hfa384x_dowmem_async(hfa384x_t * hw,
u16 page,
u16 offset,
void *data,
@ -985,7 +981,7 @@ hfa384x_dowmem_async(hfa384x_t *hw,
* Call context:
* process
----------------------------------------------------------------*/
int hfa384x_cmd_initialize(hfa384x_t *hw)
int hfa384x_cmd_initialize(hfa384x_t * hw)
{
int result = 0;
int i;
@ -1033,7 +1029,7 @@ int hfa384x_cmd_initialize(hfa384x_t *hw)
* Call context:
* process
----------------------------------------------------------------*/
int hfa384x_cmd_disable(hfa384x_t *hw, u16 macport)
int hfa384x_cmd_disable(hfa384x_t * hw, u16 macport)
{
int result = 0;
hfa384x_metacmd_t cmd;
@ -1069,7 +1065,7 @@ int hfa384x_cmd_disable(hfa384x_t *hw, u16 macport)
* Call context:
* process
----------------------------------------------------------------*/
int hfa384x_cmd_enable(hfa384x_t *hw, u16 macport)
int hfa384x_cmd_enable(hfa384x_t * hw, u16 macport)
{
int result = 0;
hfa384x_metacmd_t cmd;
@ -1114,7 +1110,7 @@ int hfa384x_cmd_enable(hfa384x_t *hw, u16 macport)
* Call context:
* process
----------------------------------------------------------------*/
int hfa384x_cmd_monitor(hfa384x_t *hw, u16 enable)
int hfa384x_cmd_monitor(hfa384x_t * hw, u16 enable)
{
int result = 0;
hfa384x_metacmd_t cmd;
@ -1168,14 +1164,13 @@ int hfa384x_cmd_monitor(hfa384x_t *hw, u16 enable)
* Call context:
* process
----------------------------------------------------------------*/
int hfa384x_cmd_download(hfa384x_t *hw, u16 mode, u16 lowaddr,
int hfa384x_cmd_download(hfa384x_t * hw, u16 mode, u16 lowaddr,
u16 highaddr, u16 codelen)
{
int result = 0;
hfa384x_metacmd_t cmd;
pr_debug(
"mode=%d, lowaddr=0x%04x, highaddr=0x%04x, codelen=%d\n",
pr_debug("mode=%d, lowaddr=0x%04x, highaddr=0x%04x, codelen=%d\n",
mode, lowaddr, highaddr, codelen);
cmd.cmd = (HFA384x_CMD_CMDCODE_SET(HFA384x_CMDCODE_DOWNLD) |
@ -1213,7 +1208,7 @@ int hfa384x_cmd_download(hfa384x_t *hw, u16 mode, u16 lowaddr,
* Call context:
* process
----------------------------------------------------------------*/
int hfa384x_corereset(hfa384x_t *hw, int holdtime, int settletime, int genesis)
int hfa384x_corereset(hfa384x_t * hw, int holdtime, int settletime, int genesis)
{
int result = 0;
@ -1250,9 +1245,9 @@ int hfa384x_corereset(hfa384x_t *hw, int holdtime, int settletime, int genesis)
* Call context:
* process
----------------------------------------------------------------*/
static int hfa384x_usbctlx_complete_sync(hfa384x_t *hw,
hfa384x_usbctlx_t *ctlx,
usbctlx_completor_t *completor)
static int hfa384x_usbctlx_complete_sync(hfa384x_t * hw,
hfa384x_usbctlx_t * ctlx,
usbctlx_completor_t * completor)
{
unsigned long flags;
int result;
@ -1366,9 +1361,9 @@ cleanup:
* process
----------------------------------------------------------------*/
static int
hfa384x_docmd(hfa384x_t *hw,
hfa384x_docmd(hfa384x_t * hw,
CMD_MODE mode,
hfa384x_metacmd_t *cmd,
hfa384x_metacmd_t * cmd,
ctlx_cmdcb_t cmdcb, ctlx_usercb_t usercb, void *usercb_data)
{
int result;
@ -1455,7 +1450,7 @@ done:
* process (DOWAIT or DOASYNC)
----------------------------------------------------------------*/
static int
hfa384x_dorrid(hfa384x_t *hw,
hfa384x_dorrid(hfa384x_t * hw,
CMD_MODE mode,
u16 rid,
void *riddata,
@ -1536,7 +1531,7 @@ done:
* process (DOWAIT or DOASYNC)
----------------------------------------------------------------*/
static int
hfa384x_dowrid(hfa384x_t *hw,
hfa384x_dowrid(hfa384x_t * hw,
CMD_MODE mode,
u16 rid,
void *riddata,
@ -1555,9 +1550,8 @@ hfa384x_dowrid(hfa384x_t *hw,
/* Initialize the command */
ctlx->outbuf.wridreq.type = cpu_to_le16(HFA384x_USB_WRIDREQ);
ctlx->outbuf.wridreq.frmlen = cpu_to_le16((sizeof
(ctlx->outbuf.wridreq.
rid) + riddatalen +
1) / 2);
(ctlx->outbuf.wridreq.rid) +
riddatalen + 1) / 2);
ctlx->outbuf.wridreq.rid = cpu_to_le16(rid);
memcpy(ctlx->outbuf.wridreq.data, riddata, riddatalen);
@ -1624,7 +1618,7 @@ done:
* process (DOWAIT or DOASYNC)
----------------------------------------------------------------*/
static int
hfa384x_dormem(hfa384x_t *hw,
hfa384x_dormem(hfa384x_t * hw,
CMD_MODE mode,
u16 page,
u16 offset,
@ -1651,14 +1645,12 @@ hfa384x_dormem(hfa384x_t *hw,
ctlx->outbufsize = sizeof(ctlx->outbuf.rmemreq);
pr_debug(
"type=0x%04x frmlen=%d offset=0x%04x page=0x%04x\n",
pr_debug("type=0x%04x frmlen=%d offset=0x%04x page=0x%04x\n",
ctlx->outbuf.rmemreq.type,
ctlx->outbuf.rmemreq.frmlen,
ctlx->outbuf.rmemreq.offset, ctlx->outbuf.rmemreq.page);
pr_debug("pktsize=%zd\n",
ROUNDUP64(sizeof(ctlx->outbuf.rmemreq)));
pr_debug("pktsize=%zd\n", ROUNDUP64(sizeof(ctlx->outbuf.rmemreq)));
ctlx->reapable = mode;
ctlx->cmdcb = cmdcb;
@ -1717,7 +1709,7 @@ done:
* process (DOWAIT or DOASYNC)
----------------------------------------------------------------*/
static int
hfa384x_dowmem(hfa384x_t *hw,
hfa384x_dowmem(hfa384x_t * hw,
CMD_MODE mode,
u16 page,
u16 offset,
@ -1728,8 +1720,7 @@ hfa384x_dowmem(hfa384x_t *hw,
int result;
hfa384x_usbctlx_t *ctlx;
pr_debug("page=0x%04x offset=0x%04x len=%d\n",
page, offset, len);
pr_debug("page=0x%04x offset=0x%04x len=%d\n", page, offset, len);
ctlx = usbctlx_alloc();
if (ctlx == NULL) {
@ -1792,7 +1783,7 @@ done:
* Call context:
* process
----------------------------------------------------------------*/
int hfa384x_drvr_commtallies(hfa384x_t *hw)
int hfa384x_drvr_commtallies(hfa384x_t * hw)
{
hfa384x_metacmd_t cmd;
@ -1828,7 +1819,7 @@ int hfa384x_drvr_commtallies(hfa384x_t *hw)
* Call context:
* process
----------------------------------------------------------------*/
int hfa384x_drvr_disable(hfa384x_t *hw, u16 macport)
int hfa384x_drvr_disable(hfa384x_t * hw, u16 macport)
{
int result = 0;
@ -1866,7 +1857,7 @@ int hfa384x_drvr_disable(hfa384x_t *hw, u16 macport)
* Call context:
* process
----------------------------------------------------------------*/
int hfa384x_drvr_enable(hfa384x_t *hw, u16 macport)
int hfa384x_drvr_enable(hfa384x_t * hw, u16 macport)
{
int result = 0;
@ -1903,7 +1894,7 @@ int hfa384x_drvr_enable(hfa384x_t *hw, u16 macport)
* Call context:
* process
----------------------------------------------------------------*/
int hfa384x_drvr_flashdl_enable(hfa384x_t *hw)
int hfa384x_drvr_flashdl_enable(hfa384x_t * hw)
{
int result = 0;
int i;
@ -1961,7 +1952,7 @@ int hfa384x_drvr_flashdl_enable(hfa384x_t *hw)
* Call context:
* process
----------------------------------------------------------------*/
int hfa384x_drvr_flashdl_disable(hfa384x_t *hw)
int hfa384x_drvr_flashdl_disable(hfa384x_t * hw)
{
/* Check that we're already in the download state */
if (hw->dlstate != HFA384x_DLSTATE_FLASHENABLED)
@ -2006,7 +1997,7 @@ int hfa384x_drvr_flashdl_disable(hfa384x_t *hw)
* Call context:
* process
----------------------------------------------------------------*/
int hfa384x_drvr_flashdl_write(hfa384x_t *hw, u32 daddr, void *buf, u32 len)
int hfa384x_drvr_flashdl_write(hfa384x_t * hw, u32 daddr, void *buf, u32 len)
{
int result = 0;
u32 dlbufaddr;
@ -2035,8 +2026,7 @@ int hfa384x_drvr_flashdl_write(hfa384x_t *hw, u32 daddr, void *buf, u32 len)
/* NOTE: dlbuffer RID stores the address in AUX format */
dlbufaddr =
HFA384x_ADDR_AUX_MKFLAT(hw->bufinfo.page, hw->bufinfo.offset);
pr_debug(
"dlbuf.page=0x%04x dlbuf.offset=0x%04x dlbufaddr=0x%08x\n",
pr_debug("dlbuf.page=0x%04x dlbuf.offset=0x%04x dlbufaddr=0x%08x\n",
hw->bufinfo.page, hw->bufinfo.offset, dlbufaddr);
#if 0
@ -2153,7 +2143,7 @@ exit_proc:
* Call context:
* process
----------------------------------------------------------------*/
int hfa384x_drvr_getconfig(hfa384x_t *hw, u16 rid, void *buf, u16 len)
int hfa384x_drvr_getconfig(hfa384x_t * hw, u16 rid, void *buf, u16 len)
{
int result;
@ -2190,7 +2180,7 @@ int hfa384x_drvr_getconfig(hfa384x_t *hw, u16 rid, void *buf, u16 len)
* Any
----------------------------------------------------------------*/
int
hfa384x_drvr_getconfig_async(hfa384x_t *hw,
hfa384x_drvr_getconfig_async(hfa384x_t * hw,
u16 rid, ctlx_usercb_t usercb, void *usercb_data)
{
return hfa384x_dorrid_async(hw, rid, NULL, 0,
@ -2221,7 +2211,7 @@ hfa384x_drvr_getconfig_async(hfa384x_t *hw,
* process
----------------------------------------------------------------*/
int
hfa384x_drvr_setconfig_async(hfa384x_t *hw,
hfa384x_drvr_setconfig_async(hfa384x_t * hw,
u16 rid,
void *buf,
u16 len, ctlx_usercb_t usercb, void *usercb_data)
@ -2248,7 +2238,7 @@ hfa384x_drvr_setconfig_async(hfa384x_t *hw,
* Call context:
* process
----------------------------------------------------------------*/
int hfa384x_drvr_ramdl_disable(hfa384x_t *hw)
int hfa384x_drvr_ramdl_disable(hfa384x_t * hw)
{
/* Check that we're already in the download state */
if (hw->dlstate != HFA384x_DLSTATE_RAMENABLED)
@ -2288,7 +2278,7 @@ int hfa384x_drvr_ramdl_disable(hfa384x_t *hw)
* Call context:
* process
----------------------------------------------------------------*/
int hfa384x_drvr_ramdl_enable(hfa384x_t *hw, u32 exeaddr)
int hfa384x_drvr_ramdl_enable(hfa384x_t * hw, u32 exeaddr)
{
int result = 0;
u16 lowaddr;
@ -2323,8 +2313,7 @@ int hfa384x_drvr_ramdl_enable(hfa384x_t *hw, u32 exeaddr)
/* Set the download state */
hw->dlstate = HFA384x_DLSTATE_RAMENABLED;
} else {
pr_debug(
"cmd_download(0x%04x, 0x%04x) failed, result=%d.\n",
pr_debug("cmd_download(0x%04x, 0x%04x) failed, result=%d.\n",
lowaddr, hiaddr, result);
}
@ -2357,7 +2346,7 @@ int hfa384x_drvr_ramdl_enable(hfa384x_t *hw, u32 exeaddr)
* Call context:
* process
----------------------------------------------------------------*/
int hfa384x_drvr_ramdl_write(hfa384x_t *hw, u32 daddr, void *buf, u32 len)
int hfa384x_drvr_ramdl_write(hfa384x_t * hw, u32 daddr, void *buf, u32 len)
{
int result = 0;
int nwrites;
@ -2436,7 +2425,7 @@ int hfa384x_drvr_ramdl_write(hfa384x_t *hw, u32 daddr, void *buf, u32 len)
* Call context:
* process or non-card interrupt.
----------------------------------------------------------------*/
int hfa384x_drvr_readpda(hfa384x_t *hw, void *buf, unsigned int len)
int hfa384x_drvr_readpda(hfa384x_t * hw, void *buf, unsigned int len)
{
int result = 0;
u16 *pda = buf;
@ -2542,7 +2531,7 @@ int hfa384x_drvr_readpda(hfa384x_t *hw, void *buf, unsigned int len)
* Call context:
* process
----------------------------------------------------------------*/
int hfa384x_drvr_setconfig(hfa384x_t *hw, u16 rid, void *buf, u16 len)
int hfa384x_drvr_setconfig(hfa384x_t * hw, u16 rid, void *buf, u16 len)
{
return hfa384x_dowrid_wait(hw, rid, buf, len);
}
@ -2567,7 +2556,7 @@ int hfa384x_drvr_setconfig(hfa384x_t *hw, u16 rid, void *buf, u16 len)
* process
----------------------------------------------------------------*/
int hfa384x_drvr_start(hfa384x_t *hw)
int hfa384x_drvr_start(hfa384x_t * hw)
{
int result, result1, result2;
u16 status;
@ -2629,11 +2618,10 @@ int hfa384x_drvr_start(hfa384x_t *hw)
usb_kill_urb(&hw->rx_urb);
goto done;
} else {
pr_debug(
"First cmd_initialize() failed (result %d),\n",
pr_debug("First cmd_initialize() failed (result %d),\n",
result1);
pr_debug(
"but second attempt succeeded. All should be ok\n");
pr_debug
("but second attempt succeeded. All should be ok\n");
}
} else if (result2 != 0) {
printk(KERN_WARNING
@ -2669,7 +2657,7 @@ done:
* Call context:
* process
----------------------------------------------------------------*/
int hfa384x_drvr_stop(hfa384x_t *hw)
int hfa384x_drvr_stop(hfa384x_t * hw)
{
int result = 0;
int i;
@ -2720,9 +2708,9 @@ int hfa384x_drvr_stop(hfa384x_t *hw)
* Call context:
* interrupt
----------------------------------------------------------------*/
int hfa384x_drvr_txframe(hfa384x_t *hw, struct sk_buff *skb,
p80211_hdr_t *p80211_hdr,
p80211_metawep_t *p80211_wep)
int hfa384x_drvr_txframe(hfa384x_t * hw, struct sk_buff *skb,
p80211_hdr_t * p80211_hdr,
p80211_metawep_t * p80211_wep)
{
int usbpktlen = sizeof(hfa384x_tx_frame_t);
int result;
@ -2813,7 +2801,7 @@ exit:
return result;
}
void hfa384x_tx_timeout(wlandevice_t *wlandev)
void hfa384x_tx_timeout(wlandevice_t * wlandev)
{
hfa384x_t *hw = wlandev->priv;
unsigned long flags;
@ -2962,8 +2950,8 @@ static void hfa384x_usbctlx_completion_task(unsigned long data)
* Call context:
* Either process or interrupt, but presumably interrupt
----------------------------------------------------------------*/
static int unlocked_usbctlx_cancel_async(hfa384x_t *hw,
hfa384x_usbctlx_t *ctlx)
static int unlocked_usbctlx_cancel_async(hfa384x_t * hw,
hfa384x_usbctlx_t * ctlx)
{
int ret;
@ -3012,7 +3000,7 @@ static int unlocked_usbctlx_cancel_async(hfa384x_t *hw,
* Call context:
* Either, assume interrupt
----------------------------------------------------------------*/
static void unlocked_usbctlx_complete(hfa384x_t *hw, hfa384x_usbctlx_t *ctlx)
static void unlocked_usbctlx_complete(hfa384x_t * hw, hfa384x_usbctlx_t * ctlx)
{
/* Timers have been stopped, and ctlx should be in
* a terminal state. Retire it from the "active"
@ -3029,8 +3017,7 @@ static void unlocked_usbctlx_complete(hfa384x_t *hw, hfa384x_usbctlx_t *ctlx)
default:
printk(KERN_ERR "CTLX[%d] not in a terminating state(%s)\n",
le16_to_cpu(ctlx->outbuf.type),
ctlxstr(ctlx->state));
le16_to_cpu(ctlx->outbuf.type), ctlxstr(ctlx->state));
break;
} /* switch */
}
@ -3051,7 +3038,7 @@ static void unlocked_usbctlx_complete(hfa384x_t *hw, hfa384x_usbctlx_t *ctlx)
* Call context:
* any
----------------------------------------------------------------*/
static void hfa384x_usbctlxq_run(hfa384x_t *hw)
static void hfa384x_usbctlxq_run(hfa384x_t * hw)
{
unsigned long flags;
@ -3225,8 +3212,7 @@ static void hfa384x_usbin_callback(struct urb *urb)
case -ENOENT:
case -ECONNRESET:
pr_debug("status=%d, urb explicitly unlinked.\n",
urb->status);
pr_debug("status=%d, urb explicitly unlinked.\n", urb->status);
action = ABORT;
break;
@ -3301,8 +3287,7 @@ static void hfa384x_usbin_callback(struct urb *urb)
break;
default:
pr_debug(
"Unrecognized USBIN packet, type=%x, status=%d\n",
pr_debug("Unrecognized USBIN packet, type=%x, status=%d\n",
usbin->type, urb_status);
break;
} /* switch */
@ -3333,7 +3318,7 @@ exit:
* Call context:
* interrupt
----------------------------------------------------------------*/
static void hfa384x_usbin_ctlx(hfa384x_t *hw, hfa384x_usbin_t *usbin,
static void hfa384x_usbin_ctlx(hfa384x_t * hw, hfa384x_usbin_t * usbin,
int urb_status)
{
hfa384x_usbctlx_t *ctlx;
@ -3399,8 +3384,8 @@ retry:
* our request has been acknowledged. Odd,
* but our OUT URB is still alive...
*/
pr_debug(
"Causality violation: please reboot Universe, or email linux-wlan-devel@lists.linux-wlan.com\n");
pr_debug
("Causality violation: please reboot Universe, or email linux-wlan-devel@lists.linux-wlan.com\n");
ctlx->state = CTLX_RESP_COMPLETE;
break;
@ -3454,8 +3439,8 @@ unlock:
* Call context:
* interrupt
----------------------------------------------------------------*/
static void hfa384x_usbin_txcompl(wlandevice_t *wlandev,
hfa384x_usbin_t *usbin)
static void hfa384x_usbin_txcompl(wlandevice_t * wlandev,
hfa384x_usbin_t * usbin)
{
u16 status;
@ -3485,7 +3470,7 @@ static void hfa384x_usbin_txcompl(wlandevice_t *wlandev,
* Call context:
* interrupt
----------------------------------------------------------------*/
static void hfa384x_usbin_rx(wlandevice_t *wlandev, struct sk_buff *skb)
static void hfa384x_usbin_rx(wlandevice_t * wlandev, struct sk_buff *skb)
{
hfa384x_usbin_t *usbin = (hfa384x_usbin_t *) skb->data;
hfa384x_t *hw = wlandev->priv;
@ -3552,8 +3537,7 @@ static void hfa384x_usbin_rx(wlandevice_t *wlandev, struct sk_buff *skb)
hfa384x_int_rxmonitor(wlandev, &usbin->rxfrm);
dev_kfree_skb(skb);
} else {
pr_debug(
"Received monitor frame: FCSerr set\n");
pr_debug("Received monitor frame: FCSerr set\n");
}
break;
@ -3589,8 +3573,8 @@ done:
* Call context:
* interrupt
----------------------------------------------------------------*/
static void hfa384x_int_rxmonitor(wlandevice_t *wlandev,
hfa384x_usb_rxfrm_t *rxfrm)
static void hfa384x_int_rxmonitor(wlandevice_t * wlandev,
hfa384x_usb_rxfrm_t * rxfrm)
{
hfa384x_rx_frame_t *rxdesc = &(rxfrm->desc);
unsigned int hdrlen = 0;
@ -4071,7 +4055,7 @@ static void hfa384x_usb_throttlefn(unsigned long data)
* Call context:
* process or interrupt
----------------------------------------------------------------*/
static int hfa384x_usbctlx_submit(hfa384x_t *hw, hfa384x_usbctlx_t *ctlx)
static int hfa384x_usbctlx_submit(hfa384x_t * hw, hfa384x_usbctlx_t * ctlx)
{
unsigned long flags;
int ret;
@ -4112,7 +4096,7 @@ static int hfa384x_usbctlx_submit(hfa384x_t *hw, hfa384x_usbctlx_t *ctlx)
* Call context:
* interrupt
----------------------------------------------------------------*/
static void hfa384x_usbout_tx(wlandevice_t *wlandev, hfa384x_usbout_t *usbout)
static void hfa384x_usbout_tx(wlandevice_t * wlandev, hfa384x_usbout_t * usbout)
{
prism2sta_ev_alloc(wlandev);
}
@ -4171,14 +4155,12 @@ static int hfa384x_isgood_pdrcode(u16 pdrcode)
default:
if (pdrcode < 0x1000) {
/* code is OK, but we don't know exactly what it is */
pr_debug(
"Encountered unknown PDR#=0x%04x, "
pr_debug("Encountered unknown PDR#=0x%04x, "
"assuming it's ok.\n", pdrcode);
return 1;
} else {
/* bad code */
pr_debug(
"Encountered unknown PDR#=0x%04x, "
pr_debug("Encountered unknown PDR#=0x%04x, "
"(>=0x1000), assuming it's bad.\n", pdrcode);
return 0;
}

View File

@ -102,9 +102,9 @@ static u8 oui_8021h[] = { 0x00, 0x00, 0xf8 };
* Call context:
* May be called in interrupt or non-interrupt context
----------------------------------------------------------------*/
int skb_ether_to_p80211(wlandevice_t *wlandev, u32 ethconv,
struct sk_buff *skb, p80211_hdr_t *p80211_hdr,
p80211_metawep_t *p80211_wep)
int skb_ether_to_p80211(wlandevice_t * wlandev, u32 ethconv,
struct sk_buff *skb, p80211_hdr_t * p80211_hdr,
p80211_metawep_t * p80211_wep)
{
u16 fc;
@ -209,8 +209,8 @@ int skb_ether_to_p80211(wlandevice_t *wlandev, u32 ethconv,
if ((foo = wep_encrypt(wlandev, skb->data, p80211_wep->data,
skb->len,
(wlandev->
hostwep & HOSTWEP_DEFAULTKEY_MASK),
(wlandev->hostwep &
HOSTWEP_DEFAULTKEY_MASK),
p80211_wep->iv, p80211_wep->icv))) {
printk(KERN_WARNING
"Host en-WEP failed, dropping frame (%d).\n",
@ -230,8 +230,8 @@ int skb_ether_to_p80211(wlandevice_t *wlandev, u32 ethconv,
}
/* jkriegl: from orinoco, modified */
static void orinoco_spy_gather(wlandevice_t *wlandev, char *mac,
p80211_rxmeta_t *rxmeta)
static void orinoco_spy_gather(wlandevice_t * wlandev, char *mac,
p80211_rxmeta_t * rxmeta)
{
int i;
@ -272,7 +272,7 @@ static void orinoco_spy_gather(wlandevice_t *wlandev, char *mac,
* Call context:
* May be called in interrupt or non-interrupt context
----------------------------------------------------------------*/
int skb_p80211_to_ether(wlandevice_t *wlandev, u32 ethconv,
int skb_p80211_to_ether(wlandevice_t * wlandev, u32 ethconv,
struct sk_buff *skb)
{
netdevice_t *netdev = wlandev->netdev;
@ -329,8 +329,7 @@ int skb_p80211_to_ether(wlandevice_t *wlandev, u32 ethconv,
skb->data + payload_offset +
payload_length - 4))) {
/* de-wep failed, drop skb. */
pr_debug(
"Host de-WEP failed, dropping frame (%d).\n",
pr_debug("Host de-WEP failed, dropping frame (%d).\n",
foo);
wlandev->rx.decrypt_err++;
return 2;

View File

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

View File

@ -68,8 +68,6 @@
/*================================================================*/
/* Project Includes */
/*================================================================*/
/* Constants */
@ -188,7 +186,6 @@ typedef union p80211_hdr {
p80211_hdr_a4_t a4;
} __attribute__ ((packed)) p80211_hdr_t;
/* Frame and header length macros */
#define WLAN_CTL_FRAMELEN(fstype) (\

View File

@ -60,7 +60,6 @@
/*================================================================*/
/* Project Includes */
/*================================================================*/
/* Types */

View File

@ -103,12 +103,10 @@
/*================================================================*/
/* Project Includes */
#ifndef _P80211HDR_H
#include "p80211hdr.h"
#endif
/*================================================================*/
/* Constants */
@ -504,25 +502,25 @@ typedef struct wlan_fr_deauthen {
} wlan_fr_deauthen_t;
void wlan_mgmt_encode_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_decode_disassoc(wlan_fr_disassoc_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_encode_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_decode_reassocreq(wlan_fr_reassocreq_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_encode_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_decode_proberesp(wlan_fr_proberesp_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_encode_deauthen(wlan_fr_deauthen_t *f);
void wlan_mgmt_decode_deauthen(wlan_fr_deauthen_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_encode_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_decode_assocreq(wlan_fr_assocreq_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_encode_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_decode_reassocresp(wlan_fr_reassocresp_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_encode_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_decode_authen(wlan_fr_authen_t * f);
void wlan_mgmt_encode_deauthen(wlan_fr_deauthen_t * f);
void wlan_mgmt_decode_deauthen(wlan_fr_deauthen_t * f);
#endif /* _P80211MGMT_H */

View File

@ -51,7 +51,6 @@
/*================================================================*/
/* Project Includes */
#define WLAN_DEVNAMELEN_MAX 16
/*--------------------------------------------------------------------*/

View File

@ -94,18 +94,18 @@
static void p80211netdev_rx_bh(unsigned long arg);
/* netdevice method functions */
static int p80211knetdev_init(netdevice_t *netdev);
static struct net_device_stats *p80211knetdev_get_stats(netdevice_t *netdev);
static int p80211knetdev_open(netdevice_t *netdev);
static int p80211knetdev_stop(netdevice_t *netdev);
static int p80211knetdev_init(netdevice_t * netdev);
static struct net_device_stats *p80211knetdev_get_stats(netdevice_t * netdev);
static int p80211knetdev_open(netdevice_t * netdev);
static int p80211knetdev_stop(netdevice_t * netdev);
static int p80211knetdev_hard_start_xmit(struct sk_buff *skb,
netdevice_t *netdev);
static void p80211knetdev_set_multicast_list(netdevice_t *dev);
static int p80211knetdev_do_ioctl(netdevice_t *dev, struct ifreq *ifr,
netdevice_t * netdev);
static void p80211knetdev_set_multicast_list(netdevice_t * dev);
static int p80211knetdev_do_ioctl(netdevice_t * dev, struct ifreq *ifr,
int cmd);
static int p80211knetdev_set_mac_address(netdevice_t *dev, void *addr);
static void p80211knetdev_tx_timeout(netdevice_t *netdev);
static int p80211_rx_typedrop(wlandevice_t *wlandev, u16 fc);
static int p80211knetdev_set_mac_address(netdevice_t * dev, void *addr);
static void p80211knetdev_tx_timeout(netdevice_t * netdev);
static int p80211_rx_typedrop(wlandevice_t * wlandev, u16 fc);
int wlan_watchdog = 5000;
module_param(wlan_watchdog, int, 0644);
@ -127,7 +127,7 @@ MODULE_PARM_DESC(wlan_wext_write, "enable write wireless extensions");
* Returns:
* nothing
----------------------------------------------------------------*/
static int p80211knetdev_init(netdevice_t *netdev)
static int p80211knetdev_init(netdevice_t * netdev)
{
/* Called in response to register_netdev */
/* This is usually the probe function, but the probe has */
@ -150,7 +150,7 @@ static int p80211knetdev_init(netdevice_t *netdev)
* Returns:
* the address of the statistics structure
----------------------------------------------------------------*/
static struct net_device_stats *p80211knetdev_get_stats(netdevice_t *netdev)
static struct net_device_stats *p80211knetdev_get_stats(netdevice_t * netdev)
{
wlandevice_t *wlandev = netdev->ml_priv;
@ -174,7 +174,7 @@ static struct net_device_stats *p80211knetdev_get_stats(netdevice_t *netdev)
* Returns:
* zero on success, non-zero otherwise
----------------------------------------------------------------*/
static int p80211knetdev_open(netdevice_t *netdev)
static int p80211knetdev_open(netdevice_t * netdev)
{
int result = 0; /* success */
wlandevice_t *wlandev = netdev->ml_priv;
@ -209,7 +209,7 @@ static int p80211knetdev_open(netdevice_t *netdev)
* Returns:
* zero on success, non-zero otherwise
----------------------------------------------------------------*/
static int p80211knetdev_stop(netdevice_t *netdev)
static int p80211knetdev_stop(netdevice_t * netdev)
{
int result = 0;
wlandevice_t *wlandev = netdev->ml_priv;
@ -236,7 +236,7 @@ static int p80211knetdev_stop(netdevice_t *netdev)
* Side effects:
*
----------------------------------------------------------------*/
void p80211netdev_rx(wlandevice_t *wlandev, struct sk_buff *skb)
void p80211netdev_rx(wlandevice_t * wlandev, struct sk_buff *skb)
{
/* Enqueue for post-irq processing */
skb_queue_tail(&wlandev->nsd_rxq, skb);
@ -345,7 +345,7 @@ static void p80211netdev_rx_bh(unsigned long arg)
* zero on success, non-zero on failure.
----------------------------------------------------------------*/
static int p80211knetdev_hard_start_xmit(struct sk_buff *skb,
netdevice_t *netdev)
netdevice_t * netdev)
{
int result = 0;
int txresult = -1;
@ -472,7 +472,7 @@ failed:
* Returns:
* nothing
----------------------------------------------------------------*/
static void p80211knetdev_set_multicast_list(netdevice_t *dev)
static void p80211knetdev_set_multicast_list(netdevice_t * dev)
{
wlandevice_t *wlandev = dev->ml_priv;
@ -485,7 +485,7 @@ static void p80211knetdev_set_multicast_list(netdevice_t *dev)
#ifdef SIOCETHTOOL
static int p80211netdev_ethtool(wlandevice_t *wlandev, void __user *useraddr)
static int p80211netdev_ethtool(wlandevice_t * wlandev, void __user * useraddr)
{
u32 ethcmd;
struct ethtool_drvinfo info;
@ -557,7 +557,7 @@ static int p80211netdev_ethtool(wlandevice_t *wlandev, void __user *useraddr)
* Process thread (ioctl caller). TODO: SMP support may require
* locks.
----------------------------------------------------------------*/
static int p80211knetdev_do_ioctl(netdevice_t *dev, struct ifreq *ifr, int cmd)
static int p80211knetdev_do_ioctl(netdevice_t * dev, struct ifreq *ifr, int cmd)
{
int result = 0;
p80211ioctl_req_t *req = (p80211ioctl_req_t *) ifr;
@ -634,7 +634,7 @@ bail:
*
* by: Collin R. Mulliner <collin@mulliner.org>
----------------------------------------------------------------*/
static int p80211knetdev_set_mac_address(netdevice_t *dev, void *addr)
static int p80211knetdev_set_mac_address(netdevice_t * dev, void *addr)
{
struct sockaddr *new_addr = addr;
p80211msg_dot11req_mibset_t dot11req;
@ -649,7 +649,7 @@ static int p80211knetdev_set_mac_address(netdevice_t *dev, void *addr)
/* Set up some convenience pointers. */
mibattr = &dot11req.mibattribute;
macaddr = (p80211item_pstr6_t *)&mibattr->data;
macaddr = (p80211item_pstr6_t *) & mibattr->data;
resultcode = &dot11req.resultcode;
/* Set up a dot11req_mibset */
@ -677,7 +677,7 @@ static int p80211knetdev_set_mac_address(netdevice_t *dev, void *addr)
resultcode->data = 0;
/* 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
* change the netdev address
@ -694,7 +694,7 @@ static int p80211knetdev_set_mac_address(netdevice_t *dev, void *addr)
return result;
}
static int wlan_change_mtu(netdevice_t *dev, int new_mtu)
static int wlan_change_mtu(netdevice_t * dev, int new_mtu)
{
/* 2312 is max 802.11 payload, 20 is overhead, (ether + llc +snap)
and another 8 for wep. */
@ -742,7 +742,7 @@ static const struct net_device_ops p80211_netdev_ops = {
* compiled drivers, this function will be called in the
* context of the kernel startup code.
----------------------------------------------------------------*/
int wlan_setup(wlandevice_t *wlandev)
int wlan_setup(wlandevice_t * wlandev)
{
int result = 0;
netdevice_t *dev;
@ -800,7 +800,7 @@ int wlan_setup(wlandevice_t *wlandev)
* compiled drivers, this function will be called in the
* context of the kernel startup code.
----------------------------------------------------------------*/
int wlan_unsetup(wlandevice_t *wlandev)
int wlan_unsetup(wlandevice_t * wlandev)
{
int result = 0;
@ -836,7 +836,7 @@ int wlan_unsetup(wlandevice_t *wlandev)
* Call Context:
* Can be either interrupt or not.
----------------------------------------------------------------*/
int register_wlandev(wlandevice_t *wlandev)
int register_wlandev(wlandevice_t * wlandev)
{
int i = 0;
@ -864,7 +864,7 @@ int register_wlandev(wlandevice_t *wlandev)
* Call Context:
* Can be either interrupt or not.
----------------------------------------------------------------*/
int unregister_wlandev(wlandevice_t *wlandev)
int unregister_wlandev(wlandevice_t * wlandev)
{
struct sk_buff *skb;
@ -907,7 +907,7 @@ int unregister_wlandev(wlandevice_t *wlandev)
* Call context:
* Usually interrupt.
----------------------------------------------------------------*/
void p80211netdev_hwremoved(wlandevice_t *wlandev)
void p80211netdev_hwremoved(wlandevice_t * wlandev)
{
wlandev->hwremoved = 1;
if (wlandev->state == WLAN_DEVICE_OPEN)
@ -937,7 +937,7 @@ void p80211netdev_hwremoved(wlandevice_t *wlandev)
* Call context:
* interrupt
----------------------------------------------------------------*/
static int p80211_rx_typedrop(wlandevice_t *wlandev, u16 fc)
static int p80211_rx_typedrop(wlandevice_t * wlandev, u16 fc)
{
u16 ftype;
u16 fstype;
@ -1095,7 +1095,7 @@ static int p80211_rx_typedrop(wlandevice_t *wlandev, u16 fc)
return drop;
}
static void p80211knetdev_tx_timeout(netdevice_t *netdev)
static void p80211knetdev_tx_timeout(netdevice_t * netdev)
{
wlandevice_t *wlandev = netdev->ml_priv;

View File

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

View File

@ -73,9 +73,9 @@
#include "p80211metastruct.h"
#include "p80211req.h"
static void p80211req_handlemsg(wlandevice_t *wlandev, p80211msg_t *msg);
static int p80211req_mibset_mibget(wlandevice_t *wlandev,
p80211msg_dot11req_mibget_t *mib_msg,
static void p80211req_handlemsg(wlandevice_t * wlandev, p80211msg_t * msg);
static int p80211req_mibset_mibget(wlandevice_t * wlandev,
p80211msg_dot11req_mibget_t * mib_msg,
int isget);
/*----------------------------------------------------------------
@ -94,7 +94,7 @@ static int p80211req_mibset_mibget(wlandevice_t *wlandev,
* Potentially blocks the caller, so it's a good idea to
* 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;
p80211msg_t *msg = (p80211msg_t *) msgbuf;
@ -150,7 +150,7 @@ int p80211req_dorequest(wlandevice_t *wlandev, u8 *msgbuf)
* Call context:
* Process thread
----------------------------------------------------------------*/
static void p80211req_handlemsg(wlandevice_t *wlandev, p80211msg_t *msg)
static void p80211req_handlemsg(wlandevice_t * wlandev, p80211msg_t * msg)
{
switch (msg->msgcode) {
@ -180,8 +180,8 @@ static void p80211req_handlemsg(wlandevice_t *wlandev, p80211msg_t *msg)
return;
}
static int p80211req_mibset_mibget(wlandevice_t *wlandev,
p80211msg_dot11req_mibget_t *mib_msg,
static int p80211req_mibset_mibget(wlandevice_t * wlandev,
p80211msg_dot11req_mibget_t * mib_msg,
int isget)
{
p80211itemd_t *mibitem = (p80211itemd_t *) mib_msg->mibattribute.data;
@ -243,8 +243,8 @@ static int p80211req_mibset_mibget(wlandevice_t *wlandev,
u32 *data = (u32 *) mibitem->data;
if (isget) {
if (wlandev->
hostwep & HOSTWEP_EXCLUDEUNENCRYPTED)
if (wlandev->hostwep &
HOSTWEP_EXCLUDEUNENCRYPTED)
*data = P80211ENUM_truth_true;
else
*data = P80211ENUM_truth_false;

View File

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

View File

@ -61,7 +61,6 @@
/* Project Includes */
/*================================================================*/
/*----------------------------------------------------------------*/
/* The following constants are indexes into the Mib Category List */
/* and the Message Category List */
@ -345,11 +344,11 @@ struct catlistitem;
/* metadata items. Some components may choose to use more, */
/* 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);
typedef void (*p80211_fromtext_t) (struct catlistitem *, u32 did, u8 *itembuf,
typedef void (*p80211_fromtext_t) (struct catlistitem *, u32 did, u8 * itembuf,
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 */

View File

@ -48,8 +48,6 @@
/*================================================================*/
/* System Includes */
#include <linux/netdevice.h>
#include <linux/wireless.h>
#include <linux/slab.h>
@ -138,17 +136,24 @@ static const u32 wep_crc32_table[256] = {
/* keylen in bytes! */
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)
{
if (keylen < 0) return -1;
if (keylen >= MAX_KEYLEN) return -1;
if (key == NULL) return -1;
if (keynum < 0) return -1;
if (keynum >= NUM_WEPKEYS) return -1;
if (keylen < 0)
return -1;
if (keylen >= MAX_KEYLEN)
return -1;
if (key == NULL)
return -1;
if (keynum < 0)
return -1;
if (keynum >= NUM_WEPKEYS)
return -1;
#ifdef WEP_DEBUG
printk(KERN_DEBUG "WEP key %d len %d = %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x\n", keynum, keylen, key[0], key[1], key[2], key[3], key[4], key[5], key[6], key[7]);
printk(KERN_DEBUG
"WEP key %d len %d = %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x\n",
keynum, keylen, key[0], key[1], key[2], key[3], key[4], key[5],
key[6], key[7]);
#endif
wlandev->wep_keylens[keynum] = keylen;
@ -161,14 +166,16 @@ int wep_change_key(wlandevice_t *wlandev, int keynum, u8* key, int keylen)
4-byte IV at start of buffer, 4-byte ICV at end of buffer.
if successful, buf start is payload begin, length -= 8;
*/
int wep_decrypt(wlandevice_t *wlandev, u8 *buf, u32 len, int key_override, u8 *iv, u8 *icv)
int wep_decrypt(wlandevice_t * wlandev, u8 * buf, u32 len, int key_override,
u8 * iv, u8 * icv)
{
u32 i, j, k, crc, keylen;
u8 s[256], key[64], c_crc[4];
u8 keyidx;
/* Needs to be at least 8 bytes of payload */
if (len <= 0) return -1;
if (len <= 0)
return -1;
/* initialize the first bytes of the key from the IV */
key[0] = iv[0];
@ -179,19 +186,24 @@ int wep_decrypt(wlandevice_t *wlandev, u8 *buf, u32 len, int key_override, u8 *i
if (key_override >= 0)
keyidx = key_override;
if (keyidx >= NUM_WEPKEYS) return -2;
if (keyidx >= NUM_WEPKEYS)
return -2;
keylen = wlandev->wep_keylens[keyidx];
if (keylen == 0) return -3;
if (keylen == 0)
return -3;
/* copy the rest of the key over from the designated key */
memcpy(key+3, wlandev->wep_keys[keyidx], keylen);
memcpy(key + 3, wlandev->wep_keys[keyidx], keylen);
keylen+=3; /* add in IV bytes */
keylen += 3; /* add in IV bytes */
#ifdef WEP_DEBUG
printk(KERN_DEBUG "D %d: %02x %02x %02x (%d %d) %02x:%02x:%02x:%02x:%02x\n", len, key[0], key[1], key[2], keyidx, keylen, key[3], key[4], key[5], key[6], key[7]);
printk(KERN_DEBUG
"D %d: %02x %02x %02x (%d %d) %02x:%02x:%02x:%02x:%02x\n", len,
key[0], key[1], key[2], keyidx, keylen, key[3], key[4], key[5],
key[6], key[7]);
#endif
/* set up the RC4 state */
@ -200,16 +212,16 @@ int wep_decrypt(wlandevice_t *wlandev, u8 *buf, u32 len, int key_override, u8 *i
j = 0;
for (i = 0; i < 256; i++) {
j = (j + s[i] + key[i % keylen]) & 0xff;
swap(i,j);
swap(i, j);
}
/* Apply the RC4 to the data, update the CRC32 */
crc = ~0;
i = j = 0;
for (k = 0; k < len; k++) {
i = (i+1) & 0xff;
j = (j+s[i]) & 0xff;
swap(i,j);
i = (i + 1) & 0xff;
j = (j + s[i]) & 0xff;
swap(i, j);
buf[k] ^= s[(s[i] + s[j]) & 0xff];
crc = wep_crc32_table[(crc ^ buf[k]) & 0xff] ^ (crc >> 8);
}
@ -223,28 +235,32 @@ int wep_decrypt(wlandevice_t *wlandev, u8 *buf, u32 len, int key_override, u8 *i
for (k = 0; k < 4; k++) {
i = (i + 1) & 0xff;
j = (j+s[i]) & 0xff;
swap(i,j);
j = (j + s[i]) & 0xff;
swap(i, j);
if ((c_crc[k] ^ s[(s[i] + s[j]) & 0xff]) != icv[k])
return -(4 | (k << 4)) ; /* ICV mismatch */
return -(4 | (k << 4)); /* ICV mismatch */
}
return 0;
}
/* encrypts in-place. */
int wep_encrypt(wlandevice_t *wlandev, u8 *buf, u8 *dst, u32 len, int keynum, u8 *iv, u8 *icv)
int wep_encrypt(wlandevice_t * wlandev, u8 * buf, u8 * dst, u32 len, int keynum,
u8 * iv, u8 * icv)
{
u32 i, j, k, crc, keylen;
u8 s[256], key[64];
/* no point in WEPping an empty frame */
if (len <= 0) return -1;
if (len <= 0)
return -1;
/* we need to have a real key.. */
if (keynum >= NUM_WEPKEYS) return -2;
if (keynum >= NUM_WEPKEYS)
return -2;
keylen = wlandev->wep_keylens[keynum];
if (keylen <= 0) return -3;
if (keylen <= 0)
return -3;
/* use a random IV. And skip known weak ones. */
get_random_bytes(iv, 3);
@ -258,12 +274,15 @@ int wep_encrypt(wlandevice_t *wlandev, u8 *buf, u8 *dst, u32 len, int keynum, u8
key[2] = iv[2];
/* copy the rest of the key over from the designated key */
memcpy(key+3, wlandev->wep_keys[keynum], keylen);
memcpy(key + 3, wlandev->wep_keys[keynum], keylen);
keylen+=3; /* add in IV bytes */
keylen += 3; /* add in IV bytes */
#ifdef WEP_DEBUG
printk(KERN_DEBUG "E %d (%d/%d %d) %02x %02x %02x %02x:%02x:%02x:%02x:%02x\n", len, iv[3], keynum, keylen, key[0], key[1], key[2], key[3], key[4], key[5], key[6], key[7]);
printk(KERN_DEBUG
"E %d (%d/%d %d) %02x %02x %02x %02x:%02x:%02x:%02x:%02x\n", len,
iv[3], keynum, keylen, key[0], key[1], key[2], key[3], key[4],
key[5], key[6], key[7]);
#endif
/* set up the RC4 state */
@ -272,7 +291,7 @@ int wep_encrypt(wlandevice_t *wlandev, u8 *buf, u8 *dst, u32 len, int keynum, u8
j = 0;
for (i = 0; i < 256; i++) {
j = (j + s[i] + key[i % keylen]) & 0xff;
swap(i,j);
swap(i, j);
}
/* Update CRC32 then apply RC4 to the data */
@ -280,9 +299,9 @@ int wep_encrypt(wlandevice_t *wlandev, u8 *buf, u8 *dst, u32 len, int keynum, u8
i = j = 0;
for (k = 0; k < len; k++) {
crc = wep_crc32_table[(crc ^ buf[k]) & 0xff] ^ (crc >> 8);
i = (i+1) & 0xff;
j = (j+s[i]) & 0xff;
swap(i,j);
i = (i + 1) & 0xff;
j = (j + s[i]) & 0xff;
swap(i, j);
dst[k] = buf[k] ^ s[(s[i] + s[j]) & 0xff];
}
crc = ~crc;
@ -295,8 +314,8 @@ int wep_encrypt(wlandevice_t *wlandev, u8 *buf, u8 *dst, u32 len, int keynum, u8
for (k = 0; k < 4; k++) {
i = (i + 1) & 0xff;
j = (j+s[i]) & 0xff;
swap(i,j);
j = (j + s[i]) & 0xff;
swap(i, j);
icv[k] ^= s[(s[i] + s[j]) & 0xff];
}

View File

@ -37,8 +37,6 @@
/*================================================================*/
/* System Includes */
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/types.h>
@ -68,10 +66,10 @@
#include "p80211ioctl.h"
#include "p80211req.h"
static int p80211wext_giwrate(netdevice_t *dev,
static int p80211wext_giwrate(netdevice_t * dev,
struct iw_request_info *info,
struct iw_param *rrq, char *extra);
static int p80211wext_giwessid(netdevice_t *dev,
static int p80211wext_giwessid(netdevice_t * dev,
struct iw_request_info *info,
struct iw_point *data, char *essid);
@ -132,7 +130,7 @@ static int qual_as_percent(int snr)
return 100;
}
static int p80211wext_dorequest(wlandevice_t *wlandev, u32 did, u32 data)
static int p80211wext_dorequest(wlandevice_t * wlandev, u32 did, u32 data)
{
p80211msg_dot11req_mibset_t msg;
p80211item_uint32_t mibitem;
@ -142,12 +140,12 @@ static int p80211wext_dorequest(wlandevice_t *wlandev, u32 did, u32 data)
mibitem.did = did;
mibitem.data = data;
memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem));
result = p80211req_dorequest(wlandev, (u8 *)&msg);
result = p80211req_dorequest(wlandev, (u8 *) & msg);
return result;
}
static int p80211wext_autojoin(wlandevice_t *wlandev)
static int p80211wext_autojoin(wlandevice_t * wlandev)
{
p80211msg_lnxreq_autojoin_t msg;
struct iw_point data;
@ -179,7 +177,7 @@ static int p80211wext_autojoin(wlandevice_t *wlandev)
memcpy(msg.ssid.data.data, ssid, data.length);
msg.ssid.data.len = data.length;
result = p80211req_dorequest(wlandev, (u8 *)&msg);
result = p80211req_dorequest(wlandev, (u8 *) & msg);
if (result) {
err = -EFAULT;
@ -216,7 +214,7 @@ struct iw_statistics *p80211wext_get_wireless_stats(netdevice_t * dev)
if (wlandev->mlmerequest == 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.level = quality.level.data; /* instant signal level */
@ -234,7 +232,7 @@ struct iw_statistics *p80211wext_get_wireless_stats(netdevice_t * dev)
return wstats;
}
static int p80211wext_giwname(netdevice_t *dev,
static int p80211wext_giwname(netdevice_t * dev,
struct iw_request_info *info,
char *name, char *extra)
{
@ -263,7 +261,7 @@ exit:
return err;
}
static int p80211wext_giwfreq(netdevice_t *dev,
static int p80211wext_giwfreq(netdevice_t * dev,
struct iw_request_info *info,
struct iw_freq *freq, char *extra)
{
@ -276,7 +274,7 @@ static int p80211wext_giwfreq(netdevice_t *dev,
msg.msgcode = DIDmsg_dot11req_mibget;
mibitem.did = DIDmib_dot11phy_dot11PhyDSSSTable_dot11CurrentChannel;
memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem));
result = p80211req_dorequest(wlandev, (u8 *)&msg);
result = p80211req_dorequest(wlandev, (u8 *) & msg);
if (result) {
err = -EFAULT;
@ -298,7 +296,7 @@ exit:
return err;
}
static int p80211wext_siwfreq(netdevice_t *dev,
static int p80211wext_siwfreq(netdevice_t * dev,
struct iw_request_info *info,
struct iw_freq *freq, char *extra)
{
@ -323,7 +321,7 @@ static int p80211wext_siwfreq(netdevice_t *dev,
mibitem.data = p80211_mhz_to_channel(freq->m);
memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem));
result = p80211req_dorequest(wlandev, (u8 *)&msg);
result = p80211req_dorequest(wlandev, (u8 *) & msg);
if (result) {
err = -EFAULT;
@ -334,9 +332,9 @@ exit:
return err;
}
static int p80211wext_giwmode(netdevice_t *dev,
static int p80211wext_giwmode(netdevice_t * dev,
struct iw_request_info *info,
__u32 *mode, char *extra)
__u32 * mode, char *extra)
{
wlandevice_t *wlandev = dev->ml_priv;
@ -358,9 +356,9 @@ static int p80211wext_giwmode(netdevice_t *dev,
return 0;
}
static int p80211wext_siwmode(netdevice_t *dev,
static int p80211wext_siwmode(netdevice_t * dev,
struct iw_request_info *info,
__u32 *mode, char *extra)
__u32 * mode, char *extra)
{
wlandevice_t *wlandev = dev->ml_priv;
p80211item_uint32_t mibitem;
@ -404,7 +402,7 @@ static int p80211wext_siwmode(netdevice_t *dev,
mibitem.did = DIDmib_p2_p2Static_p2CnfPortType;
mibitem.data = (*mode == IW_MODE_ADHOC) ? 0 : 1;
memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem));
result = p80211req_dorequest(wlandev, (u8 *)&msg);
result = p80211req_dorequest(wlandev, (u8 *) & msg);
if (result)
err = -EFAULT;
@ -413,7 +411,7 @@ exit:
return err;
}
static int p80211wext_giwrange(netdevice_t *dev,
static int p80211wext_giwrange(netdevice_t * dev,
struct iw_request_info *info,
struct iw_point *data, char *extra)
{
@ -482,7 +480,7 @@ static int p80211wext_giwrange(netdevice_t *dev,
return 0;
}
static int p80211wext_giwap(netdevice_t *dev,
static int p80211wext_giwap(netdevice_t * dev,
struct iw_request_info *info,
struct sockaddr *ap_addr, char *extra)
{
@ -495,7 +493,7 @@ static int p80211wext_giwap(netdevice_t *dev,
return 0;
}
static int p80211wext_giwencode(netdevice_t *dev,
static int p80211wext_giwencode(netdevice_t * dev,
struct iw_request_info *info,
struct iw_point *erq, char *key)
{
@ -536,7 +534,7 @@ exit:
return err;
}
static int p80211wext_siwencode(netdevice_t *dev,
static int p80211wext_siwencode(netdevice_t * dev,
struct iw_request_info *info,
struct iw_point *erq, char *key)
{
@ -626,7 +624,7 @@ static int p80211wext_siwencode(netdevice_t *dev,
msg.msgcode = DIDmsg_dot11req_mibset;
memcpy(&msg.mibattribute.data, &pstr, sizeof(pstr));
result = p80211req_dorequest(wlandev, (u8 *)&msg);
result = p80211req_dorequest(wlandev, (u8 *) & msg);
if (result) {
err = -EFAULT;
@ -683,7 +681,7 @@ exit:
return err;
}
static int p80211wext_giwessid(netdevice_t *dev,
static int p80211wext_giwessid(netdevice_t * dev,
struct iw_request_info *info,
struct iw_point *data, char *essid)
{
@ -706,7 +704,7 @@ static int p80211wext_giwessid(netdevice_t *dev,
return 0;
}
static int p80211wext_siwessid(netdevice_t *dev,
static int p80211wext_siwessid(netdevice_t * dev,
struct iw_request_info *info,
struct iw_point *data, char *essid)
{
@ -742,7 +740,7 @@ static int p80211wext_siwessid(netdevice_t *dev,
msg.ssid.data.len = length;
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);
if (result) {
@ -754,7 +752,7 @@ exit:
return err;
}
static int p80211wext_siwcommit(netdevice_t *dev,
static int p80211wext_siwcommit(netdevice_t * dev,
struct iw_request_info *info,
struct iw_point *data, char *essid)
{
@ -773,7 +771,7 @@ exit:
return err;
}
static int p80211wext_giwrate(netdevice_t *dev,
static int p80211wext_giwrate(netdevice_t * dev,
struct iw_request_info *info,
struct iw_param *rrq, char *extra)
{
@ -786,7 +784,7 @@ static int p80211wext_giwrate(netdevice_t *dev,
msg.msgcode = DIDmsg_dot11req_mibget;
mibitem.did = DIDmib_p2_p2MAC_p2CurrentTxRate;
memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem));
result = p80211req_dorequest(wlandev, (u8 *)&msg);
result = p80211req_dorequest(wlandev, (u8 *) & msg);
if (result) {
err = -EFAULT;
@ -824,7 +822,7 @@ exit:
return err;
}
static int p80211wext_giwrts(netdevice_t *dev,
static int p80211wext_giwrts(netdevice_t * dev,
struct iw_request_info *info,
struct iw_param *rts, char *extra)
{
@ -837,7 +835,7 @@ static int p80211wext_giwrts(netdevice_t *dev,
msg.msgcode = DIDmsg_dot11req_mibget;
mibitem.did = DIDmib_dot11mac_dot11OperationTable_dot11RTSThreshold;
memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem));
result = p80211req_dorequest(wlandev, (u8 *)&msg);
result = p80211req_dorequest(wlandev, (u8 *) & msg);
if (result) {
err = -EFAULT;
@ -854,7 +852,7 @@ exit:
return err;
}
static int p80211wext_siwrts(netdevice_t *dev,
static int p80211wext_siwrts(netdevice_t * dev,
struct iw_request_info *info,
struct iw_param *rts, char *extra)
{
@ -877,7 +875,7 @@ static int p80211wext_siwrts(netdevice_t *dev,
mibitem.data = rts->value;
memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem));
result = p80211req_dorequest(wlandev, (u8 *)&msg);
result = p80211req_dorequest(wlandev, (u8 *) & msg);
if (result) {
err = -EFAULT;
@ -888,7 +886,7 @@ exit:
return err;
}
static int p80211wext_giwfrag(netdevice_t *dev,
static int p80211wext_giwfrag(netdevice_t * dev,
struct iw_request_info *info,
struct iw_param *frag, char *extra)
{
@ -902,7 +900,7 @@ static int p80211wext_giwfrag(netdevice_t *dev,
mibitem.did =
DIDmib_dot11mac_dot11OperationTable_dot11FragmentationThreshold;
memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem));
result = p80211req_dorequest(wlandev, (u8 *)&msg);
result = p80211req_dorequest(wlandev, (u8 *) & msg);
if (result) {
err = -EFAULT;
@ -919,7 +917,7 @@ exit:
return err;
}
static int p80211wext_siwfrag(netdevice_t *dev,
static int p80211wext_siwfrag(netdevice_t * dev,
struct iw_request_info *info,
struct iw_param *frag, char *extra)
{
@ -944,7 +942,7 @@ static int p80211wext_siwfrag(netdevice_t *dev,
mibitem.data = frag->value;
memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem));
result = p80211req_dorequest(wlandev, (u8 *)&msg);
result = p80211req_dorequest(wlandev, (u8 *) & msg);
if (result) {
err = -EFAULT;
@ -963,7 +961,7 @@ exit:
#define IW_RETRY_SHORT IW_RETRY_MIN
#endif
static int p80211wext_giwretry(netdevice_t *dev,
static int p80211wext_giwretry(netdevice_t * dev,
struct iw_request_info *info,
struct iw_param *rrq, char *extra)
{
@ -978,7 +976,7 @@ static int p80211wext_giwretry(netdevice_t *dev,
mibitem.did = DIDmib_dot11mac_dot11OperationTable_dot11ShortRetryLimit;
memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem));
result = p80211req_dorequest(wlandev, (u8 *)&msg);
result = p80211req_dorequest(wlandev, (u8 *) & msg);
if (result) {
err = -EFAULT;
@ -992,7 +990,7 @@ static int p80211wext_giwretry(netdevice_t *dev,
mibitem.did = DIDmib_dot11mac_dot11OperationTable_dot11LongRetryLimit;
memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem));
result = p80211req_dorequest(wlandev, (u8 *)&msg);
result = p80211req_dorequest(wlandev, (u8 *) & msg);
if (result) {
err = -EFAULT;
@ -1007,7 +1005,7 @@ static int p80211wext_giwretry(netdevice_t *dev,
DIDmib_dot11mac_dot11OperationTable_dot11MaxTransmitMSDULifetime;
memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem));
result = p80211req_dorequest(wlandev, (u8 *)&msg);
result = p80211req_dorequest(wlandev, (u8 *) & msg);
if (result) {
err = -EFAULT;
@ -1040,7 +1038,7 @@ exit:
}
static int p80211wext_siwretry(netdevice_t *dev,
static int p80211wext_siwretry(netdevice_t * dev,
struct iw_request_info *info,
struct iw_param *rrq, char *extra)
{
@ -1068,7 +1066,7 @@ static int p80211wext_siwretry(netdevice_t *dev,
mibitem.data = rrq->value /= 1024;
memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem));
result = p80211req_dorequest(wlandev, (u8 *)&msg);
result = p80211req_dorequest(wlandev, (u8 *) & msg);
if (result) {
err = -EFAULT;
@ -1082,7 +1080,7 @@ static int p80211wext_siwretry(netdevice_t *dev,
memcpy(&msg.mibattribute.data, &mibitem,
sizeof(mibitem));
result = p80211req_dorequest(wlandev, (u8 *)&msg);
result = p80211req_dorequest(wlandev, (u8 *) & msg);
if (result) {
err = -EFAULT;
@ -1097,7 +1095,7 @@ static int p80211wext_siwretry(netdevice_t *dev,
memcpy(&msg.mibattribute.data, &mibitem,
sizeof(mibitem));
result = p80211req_dorequest(wlandev, (u8 *)&msg);
result = p80211req_dorequest(wlandev, (u8 *) & msg);
if (result) {
err = -EFAULT;
@ -1111,7 +1109,7 @@ exit:
}
static int p80211wext_siwtxpow(netdevice_t *dev,
static int p80211wext_siwtxpow(netdevice_t * dev,
struct iw_request_info *info,
struct iw_param *rrq, char *extra)
{
@ -1134,7 +1132,7 @@ static int p80211wext_siwtxpow(netdevice_t *dev,
else
mibitem.data = rrq->value;
memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem));
result = p80211req_dorequest(wlandev, (u8 *)&msg);
result = p80211req_dorequest(wlandev, (u8 *) & msg);
if (result) {
err = -EFAULT;
@ -1145,7 +1143,7 @@ exit:
return err;
}
static int p80211wext_giwtxpow(netdevice_t *dev,
static int p80211wext_giwtxpow(netdevice_t * dev,
struct iw_request_info *info,
struct iw_param *rrq, char *extra)
{
@ -1160,7 +1158,7 @@ static int p80211wext_giwtxpow(netdevice_t *dev,
DIDmib_dot11phy_dot11PhyTxPowerTable_dot11CurrentTxPowerLevel;
memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem));
result = p80211req_dorequest(wlandev, (u8 *)&msg);
result = p80211req_dorequest(wlandev, (u8 *) & msg);
if (result) {
err = -EFAULT;
@ -1180,7 +1178,7 @@ exit:
return err;
}
static int p80211wext_siwspy(netdevice_t *dev,
static int p80211wext_siwspy(netdevice_t * dev,
struct iw_request_info *info,
struct iw_point *srq, char *extra)
{
@ -1215,7 +1213,7 @@ static int p80211wext_siwspy(netdevice_t *dev,
}
/* jkriegl: from orinoco, modified */
static int p80211wext_giwspy(netdevice_t *dev,
static int p80211wext_giwspy(netdevice_t * dev,
struct iw_request_info *info,
struct iw_point *srq, char *extra)
{
@ -1275,7 +1273,7 @@ static int prism2_result2err(int prism2_result)
return err;
}
static int p80211wext_siwscan(netdevice_t *dev,
static int p80211wext_siwscan(netdevice_t * dev,
struct iw_request_info *info,
struct iw_point *srq, char *extra)
{
@ -1308,7 +1306,7 @@ static int p80211wext_siwscan(netdevice_t *dev,
msg.maxchanneltime.data = 250;
msg.minchanneltime.data = 200;
result = p80211req_dorequest(wlandev, (u8 *)&msg);
result = p80211req_dorequest(wlandev, (u8 *) & msg);
if (result)
err = prism2_result2err(msg.resultcode.data);
@ -1322,7 +1320,7 @@ exit:
*/
static char *wext_translate_bss(struct iw_request_info *info, char *current_ev,
char *end_buf,
p80211msg_dot11req_scan_results_t *bss)
p80211msg_dot11req_scan_results_t * bss)
{
struct iw_event iwe; /* Temporary buffer */
@ -1406,7 +1404,7 @@ static char *wext_translate_bss(struct iw_request_info *info, char *current_ev,
return current_ev;
}
static int p80211wext_giwscan(netdevice_t *dev,
static int p80211wext_giwscan(netdevice_t * dev,
struct iw_request_info *info,
struct iw_point *srq, char *extra)
{
@ -1427,7 +1425,7 @@ static int p80211wext_giwscan(netdevice_t *dev,
msg.msgcode = DIDmsg_dot11req_scan_results;
msg.bssindex.data = i;
result = p80211req_dorequest(wlandev, (u8 *)&msg);
result = p80211req_dorequest(wlandev, (u8 *) & msg);
if ((result != 0) ||
(msg.resultcode.data != P80211ENUM_resultcode_success)) {
break;
@ -1502,7 +1500,7 @@ static int p80211wext_set_encodeext(struct net_device *dev,
memcpy(wlandev->wep_keys[idx], ext->key, ext->key_len);
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);
pstr->data.len = ext->key_len;
switch (idx) {
@ -1526,7 +1524,7 @@ static int p80211wext_set_encodeext(struct net_device *dev,
break;
}
msg.msgcode = DIDmsg_dot11req_mibset;
result = p80211req_dorequest(wlandev, (u8 *)&msg);
result = p80211req_dorequest(wlandev, (u8 *) & msg);
pr_debug("result (%d)\n", result);
}
return result;
@ -1550,8 +1548,7 @@ static int p80211wext_get_encodeext(struct net_device *dev,
max_len = encoding->length - sizeof(*ext);
if (max_len <= 0) {
pr_debug("get_encodeext max_len [%d] invalid\n",
max_len);
pr_debug("get_encodeext max_len [%d] invalid\n", max_len);
result = -EINVAL;
goto exit;
}
@ -1561,8 +1558,8 @@ static int p80211wext_get_encodeext(struct net_device *dev,
if (idx) {
if (idx < 1 || idx > NUM_WEPKEYS) {
pr_debug(
"get_encode_ext invalid key index [%d]\n", idx);
pr_debug("get_encode_ext invalid key index [%d]\n",
idx);
result = -EINVAL;
goto exit;
}
@ -1593,8 +1590,7 @@ static int p80211_wext_set_iwauth(struct net_device *dev,
struct iw_param *param = &wrqu->param;
int result = 0;
pr_debug("set_iwauth flags[%d]\n",
(int)param->flags & IW_AUTH_INDEX);
pr_debug("set_iwauth flags[%d]\n", (int)param->flags & IW_AUTH_INDEX);
switch (param->flags & IW_AUTH_INDEX) {
case IW_AUTH_DROP_UNENCRYPTED:
@ -1635,8 +1631,7 @@ static int p80211_wext_set_iwauth(struct net_device *dev,
wlandev->hostwep |= HOSTWEP_SHAREDKEY;
} else {
/* don't know what to do know */
pr_debug("unknown AUTH_ALG (%d)\n",
param->value);
pr_debug("unknown AUTH_ALG (%d)\n", param->value);
result = -EINVAL;
}
break;
@ -1657,8 +1652,7 @@ static int p80211_wext_get_iwauth(struct net_device *dev,
struct iw_param *param = &wrqu->param;
int result = 0;
pr_debug("get_iwauth flags[%d]\n",
(int)param->flags & IW_AUTH_INDEX);
pr_debug("get_iwauth flags[%d]\n", (int)param->flags & IW_AUTH_INDEX);
switch (param->flags & IW_AUTH_INDEX) {
case IW_AUTH_DROP_UNENCRYPTED:
@ -1673,9 +1667,8 @@ static int p80211_wext_get_iwauth(struct net_device *dev,
case IW_AUTH_80211_AUTH_ALG:
param->value =
wlandev->
hostwep & HOSTWEP_SHAREDKEY ? IW_AUTH_ALG_SHARED_KEY :
IW_AUTH_ALG_OPEN_SYSTEM;
wlandev->hostwep & HOSTWEP_SHAREDKEY ?
IW_AUTH_ALG_SHARED_KEY : IW_AUTH_ALG_OPEN_SYSTEM;
break;
default:
@ -1755,7 +1748,7 @@ struct iw_handler_def p80211wext_handler_def = {
.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;

File diff suppressed because it is too large Load Diff

View File

@ -117,7 +117,7 @@
* process thread (usually)
* interrupt
----------------------------------------------------------------*/
int prism2mgmt_scan(wlandevice_t *wlandev, void *msgp)
int prism2mgmt_scan(wlandevice_t * wlandev, void *msgp)
{
int result = 0;
hfa384x_t *hw = wlandev->priv;
@ -362,7 +362,7 @@ exit:
* process thread (usually)
* interrupt
----------------------------------------------------------------*/
int prism2mgmt_scan_results(wlandevice_t *wlandev, void *msgp)
int prism2mgmt_scan_results(wlandevice_t * wlandev, void *msgp)
{
int result = 0;
p80211msg_dot11req_scan_results_t *req;
@ -511,7 +511,7 @@ exit:
* process thread (usually)
* interrupt
----------------------------------------------------------------*/
int prism2mgmt_start(wlandevice_t *wlandev, void *msgp)
int prism2mgmt_start(wlandevice_t * wlandev, void *msgp)
{
int result = 0;
hfa384x_t *hw = wlandev->priv;
@ -544,7 +544,7 @@ int prism2mgmt_start(wlandevice_t *wlandev, void *msgp)
/*** STATION ***/
/* Set the REQUIRED config items */
/* SSID */
pstr = (p80211pstrd_t *)&(msg->ssid.data);
pstr = (p80211pstrd_t *) & (msg->ssid.data);
prism2mgmt_pstr2bytestr(p2bytestr, pstr);
result = hfa384x_drvr_setconfig(hw, HFA384x_RID_CNFOWNSSID,
bytebuf, HFA384x_RID_CNFOWNSSID_LEN);
@ -688,7 +688,7 @@ done:
* Call context:
* process thread (usually)
----------------------------------------------------------------*/
int prism2mgmt_readpda(wlandevice_t *wlandev, void *msgp)
int prism2mgmt_readpda(wlandevice_t * wlandev, void *msgp)
{
hfa384x_t *hw = wlandev->priv;
p80211msg_p2req_readpda_t *msg = msgp;
@ -754,7 +754,7 @@ int prism2mgmt_readpda(wlandevice_t *wlandev, void *msgp)
* Call context:
* process thread (usually)
----------------------------------------------------------------*/
int prism2mgmt_ramdl_state(wlandevice_t *wlandev, void *msgp)
int prism2mgmt_ramdl_state(wlandevice_t * wlandev, void *msgp)
{
hfa384x_t *hw = wlandev->priv;
p80211msg_p2req_ramdl_state_t *msg = msgp;
@ -810,7 +810,7 @@ int prism2mgmt_ramdl_state(wlandevice_t *wlandev, void *msgp)
* Call context:
* process thread (usually)
----------------------------------------------------------------*/
int prism2mgmt_ramdl_write(wlandevice_t *wlandev, void *msgp)
int prism2mgmt_ramdl_write(wlandevice_t * wlandev, void *msgp)
{
hfa384x_t *hw = wlandev->priv;
p80211msg_p2req_ramdl_write_t *msg = msgp;
@ -872,7 +872,7 @@ int prism2mgmt_ramdl_write(wlandevice_t *wlandev, void *msgp)
* Call context:
* process thread (usually)
----------------------------------------------------------------*/
int prism2mgmt_flashdl_state(wlandevice_t *wlandev, void *msgp)
int prism2mgmt_flashdl_state(wlandevice_t * wlandev, void *msgp)
{
int result = 0;
hfa384x_t *hw = wlandev->priv;
@ -943,7 +943,7 @@ int prism2mgmt_flashdl_state(wlandevice_t *wlandev, void *msgp)
* Call context:
* process thread (usually)
----------------------------------------------------------------*/
int prism2mgmt_flashdl_write(wlandevice_t *wlandev, void *msgp)
int prism2mgmt_flashdl_write(wlandevice_t * wlandev, void *msgp)
{
hfa384x_t *hw = wlandev->priv;
p80211msg_p2req_flashdl_write_t *msg = msgp;
@ -1004,7 +1004,7 @@ int prism2mgmt_flashdl_write(wlandevice_t *wlandev, void *msgp)
* process thread (usually)
* interrupt
----------------------------------------------------------------*/
int prism2mgmt_autojoin(wlandevice_t *wlandev, void *msgp)
int prism2mgmt_autojoin(wlandevice_t * wlandev, void *msgp)
{
hfa384x_t *hw = wlandev->priv;
int result = 0;
@ -1037,7 +1037,7 @@ int prism2mgmt_autojoin(wlandevice_t *wlandev, void *msgp)
/* Set the ssid */
memset(bytebuf, 0, 256);
pstr = (p80211pstrd_t *)&(msg->ssid.data);
pstr = (p80211pstrd_t *) & (msg->ssid.data);
prism2mgmt_pstr2bytestr(p2bytestr, pstr);
result = hfa384x_drvr_setconfig(hw, HFA384x_RID_CNFDESIREDSSID,
bytebuf,
@ -1075,7 +1075,7 @@ int prism2mgmt_autojoin(wlandevice_t *wlandev, void *msgp)
* process thread (usually)
* interrupt
----------------------------------------------------------------*/
int prism2mgmt_wlansniff(wlandevice_t *wlandev, void *msgp)
int prism2mgmt_wlansniff(wlandevice_t * wlandev, void *msgp)
{
int result = 0;
p80211msg_lnxreq_wlansniff_t *msg = msgp;
@ -1096,16 +1096,15 @@ int prism2mgmt_wlansniff(wlandevice_t *wlandev, void *msgp)
/* Disable monitor mode */
result = hfa384x_cmd_monitor(hw, HFA384x_MONITOR_DISABLE);
if (result) {
pr_debug(
"failed to disable monitor mode, result=%d\n",
pr_debug("failed to disable monitor mode, result=%d\n",
result);
goto failed;
}
/* Disable port 0 */
result = hfa384x_drvr_disable(hw, 0);
if (result) {
pr_debug(
"failed to disable port 0 after sniffing, result=%d\n",
pr_debug
("failed to disable port 0 after sniffing, result=%d\n",
result);
goto failed;
}
@ -1117,8 +1116,8 @@ int prism2mgmt_wlansniff(wlandevice_t *wlandev, void *msgp)
HFA384x_RID_CNFWEPFLAGS,
hw->presniff_wepflags);
if (result) {
pr_debug(
"failed to restore wepflags=0x%04x, result=%d\n",
pr_debug
("failed to restore wepflags=0x%04x, result=%d\n",
hw->presniff_wepflags, result);
goto failed;
}
@ -1130,8 +1129,8 @@ int prism2mgmt_wlansniff(wlandevice_t *wlandev, void *msgp)
HFA384x_RID_CNFPORTTYPE,
word);
if (result) {
pr_debug(
"failed to restore porttype, result=%d\n",
pr_debug
("failed to restore porttype, result=%d\n",
result);
goto failed;
}
@ -1139,8 +1138,8 @@ int prism2mgmt_wlansniff(wlandevice_t *wlandev, void *msgp)
/* Enable the port */
result = hfa384x_drvr_enable(hw, 0);
if (result) {
pr_debug(
"failed to enable port to presniff setting, result=%d\n",
pr_debug
("failed to enable port to presniff setting, result=%d\n",
result);
goto failed;
}
@ -1161,30 +1160,32 @@ int prism2mgmt_wlansniff(wlandevice_t *wlandev, void *msgp)
/* Save macport 0 state */
result = hfa384x_drvr_getconfig16(hw,
HFA384x_RID_CNFPORTTYPE,
&(hw->
&
(hw->
presniff_port_type));
if (result) {
pr_debug(
"failed to read porttype, result=%d\n",
pr_debug
("failed to read porttype, result=%d\n",
result);
goto failed;
}
/* Save the wepflags state */
result = hfa384x_drvr_getconfig16(hw,
HFA384x_RID_CNFWEPFLAGS,
&(hw->
&
(hw->
presniff_wepflags));
if (result) {
pr_debug(
"failed to read wepflags, result=%d\n",
pr_debug
("failed to read wepflags, result=%d\n",
result);
goto failed;
}
hfa384x_drvr_stop(hw);
result = hfa384x_drvr_start(hw);
if (result) {
pr_debug(
"failed to restart the card for sniffing, result=%d\n",
pr_debug
("failed to restart the card for sniffing, result=%d\n",
result);
goto failed;
}
@ -1192,8 +1193,8 @@ int prism2mgmt_wlansniff(wlandevice_t *wlandev, void *msgp)
/* Disable the port */
result = hfa384x_drvr_disable(hw, 0);
if (result) {
pr_debug(
"failed to enable port for sniffing, result=%d\n",
pr_debug
("failed to enable port for sniffing, result=%d\n",
result);
goto failed;
}
@ -1210,8 +1211,7 @@ int prism2mgmt_wlansniff(wlandevice_t *wlandev, void *msgp)
hw->sniff_channel = word;
if (result) {
pr_debug(
"failed to set channel %d, result=%d\n",
pr_debug("failed to set channel %d, result=%d\n",
word, result);
goto failed;
}
@ -1224,8 +1224,8 @@ int prism2mgmt_wlansniff(wlandevice_t *wlandev, void *msgp)
HFA384x_RID_CNFPORTTYPE,
word);
if (result) {
pr_debug(
"failed to set porttype %d, result=%d\n",
pr_debug
("failed to set porttype %d, result=%d\n",
word, result);
goto failed;
}
@ -1243,8 +1243,8 @@ int prism2mgmt_wlansniff(wlandevice_t *wlandev, void *msgp)
}
if (result) {
pr_debug(
"failed to set wepflags=0x%04x, result=%d\n",
pr_debug
("failed to set wepflags=0x%04x, result=%d\n",
word, result);
goto failed;
}
@ -1269,16 +1269,15 @@ int prism2mgmt_wlansniff(wlandevice_t *wlandev, void *msgp)
/* Enable the port */
result = hfa384x_drvr_enable(hw, 0);
if (result) {
pr_debug(
"failed to enable port for sniffing, result=%d\n",
pr_debug
("failed to enable port for sniffing, result=%d\n",
result);
goto failed;
}
/* Enable monitor mode */
result = hfa384x_cmd_monitor(hw, HFA384x_MONITOR_ENABLE);
if (result) {
pr_debug(
"failed to enable monitor mode, result=%d\n",
pr_debug("failed to enable monitor mode, result=%d\n",
result);
goto failed;
}

View File

@ -63,43 +63,43 @@
extern int prism2_reset_holdtime;
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_txexc(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_alloc(wlandevice_t *wlandev);
void prism2sta_ev_info(wlandevice_t * wlandev, hfa384x_InfFrame_t * inf);
void prism2sta_ev_txexc(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_alloc(wlandevice_t * wlandev);
int prism2mgmt_mibset_mibget(wlandevice_t *wlandev, void *msgp);
int prism2mgmt_scan(wlandevice_t *wlandev, void *msgp);
int prism2mgmt_scan_results(wlandevice_t *wlandev, void *msgp);
int prism2mgmt_start(wlandevice_t *wlandev, void *msgp);
int prism2mgmt_wlansniff(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_write(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_autojoin(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_results(wlandevice_t * wlandev, void *msgp);
int prism2mgmt_start(wlandevice_t * wlandev, void *msgp);
int prism2mgmt_wlansniff(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_write(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_autojoin(wlandevice_t * wlandev, void *msgp);
/*---------------------------------------------------------------
* conversion functions going between wlan message data types and
* Prism2 data types
---------------------------------------------------------------*/
/* byte area conversion functions*/
void prism2mgmt_pstr2bytearea(u8 *bytearea, p80211pstrd_t *pstr);
void prism2mgmt_bytearea2pstr(u8 *bytearea, p80211pstrd_t *pstr, int len);
void prism2mgmt_pstr2bytearea(u8 * bytearea, p80211pstrd_t * pstr);
void prism2mgmt_bytearea2pstr(u8 * bytearea, p80211pstrd_t * pstr, int len);
/* byte string conversion functions*/
void prism2mgmt_pstr2bytestr(hfa384x_bytestr_t *bytestr, p80211pstrd_t *pstr);
void prism2mgmt_bytestr2pstr(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);
/* 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,
u8 *prism2buf, p80211pstrd_t *pstr,
hfa384x_t *priv);
u8 * prism2buf, p80211pstrd_t * pstr,
hfa384x_t * priv);
int prism2mgmt_get_grpaddr_index(u32 did);
void prism2sta_processing_defer(struct work_struct *data);

View File

@ -86,65 +86,65 @@ typedef struct mibrec {
u16 parm1;
u16 parm2;
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);
wlandevice_t * wlandev,
hfa384x_t * hw,
p80211msg_dot11req_mibset_t * msg, void *data);
} mibrec_t;
static int prism2mib_bytearea2pstr(mibrec_t *mib,
static int prism2mib_bytearea2pstr(mibrec_t * mib,
int isget,
wlandevice_t *wlandev,
hfa384x_t *hw,
p80211msg_dot11req_mibset_t *msg,
wlandevice_t * wlandev,
hfa384x_t * hw,
p80211msg_dot11req_mibset_t * msg,
void *data);
static int prism2mib_uint32(mibrec_t *mib,
static int prism2mib_uint32(mibrec_t * mib,
int isget,
wlandevice_t *wlandev,
hfa384x_t *hw,
p80211msg_dot11req_mibset_t *msg, void *data);
wlandevice_t * wlandev,
hfa384x_t * hw,
p80211msg_dot11req_mibset_t * msg, void *data);
static int prism2mib_flag(mibrec_t *mib,
static int prism2mib_flag(mibrec_t * mib,
int isget,
wlandevice_t *wlandev,
hfa384x_t *hw,
p80211msg_dot11req_mibset_t *msg, void *data);
wlandevice_t * wlandev,
hfa384x_t * hw,
p80211msg_dot11req_mibset_t * msg, void *data);
static int prism2mib_wepdefaultkey(mibrec_t *mib,
static int prism2mib_wepdefaultkey(mibrec_t * mib,
int isget,
wlandevice_t *wlandev,
hfa384x_t *hw,
p80211msg_dot11req_mibset_t *msg,
wlandevice_t * wlandev,
hfa384x_t * hw,
p80211msg_dot11req_mibset_t * msg,
void *data);
static int prism2mib_privacyinvoked(mibrec_t *mib,
static int prism2mib_privacyinvoked(mibrec_t * mib,
int isget,
wlandevice_t *wlandev,
hfa384x_t *hw,
p80211msg_dot11req_mibset_t *msg,
wlandevice_t * wlandev,
hfa384x_t * hw,
p80211msg_dot11req_mibset_t * msg,
void *data);
static int prism2mib_excludeunencrypted(mibrec_t *mib,
static int prism2mib_excludeunencrypted(mibrec_t * mib,
int isget,
wlandevice_t *wlandev,
hfa384x_t *hw,
p80211msg_dot11req_mibset_t *msg,
wlandevice_t * wlandev,
hfa384x_t * hw,
p80211msg_dot11req_mibset_t * msg,
void *data);
static int prism2mib_fragmentationthreshold(mibrec_t *mib,
static int prism2mib_fragmentationthreshold(mibrec_t * mib,
int isget,
wlandevice_t *wlandev,
hfa384x_t *hw,
p80211msg_dot11req_mibset_t *msg,
wlandevice_t * wlandev,
hfa384x_t * hw,
p80211msg_dot11req_mibset_t * msg,
void *data);
static int prism2mib_priv(mibrec_t *mib,
static int prism2mib_priv(mibrec_t * mib,
int isget,
wlandevice_t *wlandev,
hfa384x_t *hw,
p80211msg_dot11req_mibset_t *msg, void *data);
wlandevice_t * wlandev,
hfa384x_t * hw,
p80211msg_dot11req_mibset_t * msg, void *data);
static mibrec_t mibtab[] = {
@ -258,7 +258,7 @@ static mibrec_t mibtab[] = {
* interrupt
----------------------------------------------------------------*/
int prism2mgmt_mibset_mibget(wlandevice_t *wlandev, void *msgp)
int prism2mgmt_mibset_mibget(wlandevice_t * wlandev, void *msgp)
{
hfa384x_t *hw = wlandev->priv;
int result, isget;
@ -330,8 +330,7 @@ int prism2mgmt_mibset_mibget(wlandevice_t *wlandev, void *msgp)
if (msg->resultcode.data == P80211ENUM_resultcode_success) {
if (result != 0) {
pr_debug("get/set failure, result=%d\n",
result);
pr_debug("get/set failure, result=%d\n", result);
msg->resultcode.data =
P80211ENUM_resultcode_implementation_failure;
} else {
@ -373,11 +372,11 @@ done:
*
----------------------------------------------------------------*/
static int prism2mib_bytearea2pstr(mibrec_t *mib,
static int prism2mib_bytearea2pstr(mibrec_t * mib,
int isget,
wlandevice_t *wlandev,
hfa384x_t *hw,
p80211msg_dot11req_mibset_t *msg,
wlandevice_t * wlandev,
hfa384x_t * hw,
p80211msg_dot11req_mibset_t * msg,
void *data)
{
int result;
@ -423,11 +422,11 @@ static int prism2mib_bytearea2pstr(mibrec_t *mib,
*
----------------------------------------------------------------*/
static int prism2mib_uint32(mibrec_t *mib,
static int prism2mib_uint32(mibrec_t * mib,
int isget,
wlandevice_t *wlandev,
hfa384x_t *hw,
p80211msg_dot11req_mibset_t *msg, void *data)
wlandevice_t * wlandev,
hfa384x_t * hw,
p80211msg_dot11req_mibset_t * msg, void *data)
{
int result;
u32 *uint32 = (u32 *) data;
@ -470,11 +469,11 @@ static int prism2mib_uint32(mibrec_t *mib,
*
----------------------------------------------------------------*/
static int prism2mib_flag(mibrec_t *mib,
static int prism2mib_flag(mibrec_t * mib,
int isget,
wlandevice_t *wlandev,
hfa384x_t *hw,
p80211msg_dot11req_mibset_t *msg, void *data)
wlandevice_t * wlandev,
hfa384x_t * hw,
p80211msg_dot11req_mibset_t * msg, void *data)
{
int result;
u32 *uint32 = (u32 *) data;
@ -527,11 +526,11 @@ static int prism2mib_flag(mibrec_t *mib,
*
----------------------------------------------------------------*/
static int prism2mib_wepdefaultkey(mibrec_t *mib,
static int prism2mib_wepdefaultkey(mibrec_t * mib,
int isget,
wlandevice_t *wlandev,
hfa384x_t *hw,
p80211msg_dot11req_mibset_t *msg,
wlandevice_t * wlandev,
hfa384x_t * hw,
p80211msg_dot11req_mibset_t * msg,
void *data)
{
int result;
@ -577,11 +576,11 @@ static int prism2mib_wepdefaultkey(mibrec_t *mib,
*
----------------------------------------------------------------*/
static int prism2mib_privacyinvoked(mibrec_t *mib,
static int prism2mib_privacyinvoked(mibrec_t * mib,
int isget,
wlandevice_t *wlandev,
hfa384x_t *hw,
p80211msg_dot11req_mibset_t *msg,
wlandevice_t * wlandev,
hfa384x_t * hw,
p80211msg_dot11req_mibset_t * msg,
void *data)
{
int result;
@ -623,11 +622,11 @@ static int prism2mib_privacyinvoked(mibrec_t *mib,
*
----------------------------------------------------------------*/
static int prism2mib_excludeunencrypted(mibrec_t *mib,
static int prism2mib_excludeunencrypted(mibrec_t * mib,
int isget,
wlandevice_t *wlandev,
hfa384x_t *hw,
p80211msg_dot11req_mibset_t *msg,
wlandevice_t * wlandev,
hfa384x_t * hw,
p80211msg_dot11req_mibset_t * msg,
void *data)
{
int result;
@ -662,11 +661,11 @@ static int prism2mib_excludeunencrypted(mibrec_t *mib,
*
----------------------------------------------------------------*/
static int prism2mib_fragmentationthreshold(mibrec_t *mib,
static int prism2mib_fragmentationthreshold(mibrec_t * mib,
int isget,
wlandevice_t *wlandev,
hfa384x_t *hw,
p80211msg_dot11req_mibset_t *msg,
wlandevice_t * wlandev,
hfa384x_t * hw,
p80211msg_dot11req_mibset_t * msg,
void *data)
{
int result;
@ -711,11 +710,11 @@ static int prism2mib_fragmentationthreshold(mibrec_t *mib,
*
----------------------------------------------------------------*/
static int prism2mib_priv(mibrec_t *mib,
static int prism2mib_priv(mibrec_t * mib,
int isget,
wlandevice_t *wlandev,
hfa384x_t *hw,
p80211msg_dot11req_mibset_t *msg, void *data)
wlandevice_t * wlandev,
hfa384x_t * hw,
p80211msg_dot11req_mibset_t * msg, void *data)
{
p80211pstrd_t *pstr = (p80211pstrd_t *) data;
@ -727,7 +726,7 @@ static int prism2mib_priv(mibrec_t *mib,
if (isget) {
hfa384x_drvr_getconfig(hw,
HFA384x_RID_CNFWPADATA,
(u8 *)&wpa,
(u8 *) & wpa,
sizeof(wpa));
pstr->len = le16_to_cpu(wpa.datalen);
memcpy(pstr->data, wpa.data, pstr->len);
@ -738,7 +737,7 @@ static int prism2mib_priv(mibrec_t *mib,
result =
hfa384x_drvr_setconfig(hw,
HFA384x_RID_CNFWPADATA,
(u8 *)&wpa,
(u8 *) & wpa,
sizeof(wpa));
}
break;
@ -765,7 +764,7 @@ static int prism2mib_priv(mibrec_t *mib,
*
----------------------------------------------------------------*/
void prism2mgmt_pstr2bytestr(hfa384x_bytestr_t *bytestr, p80211pstrd_t *pstr)
void prism2mgmt_pstr2bytestr(hfa384x_bytestr_t * bytestr, p80211pstrd_t * pstr)
{
bytestr->len = cpu_to_le16((u16) (pstr->len));
memcpy(bytestr->data, pstr->data, pstr->len);
@ -786,7 +785,7 @@ void prism2mgmt_pstr2bytestr(hfa384x_bytestr_t *bytestr, p80211pstrd_t *pstr)
*
----------------------------------------------------------------*/
void prism2mgmt_pstr2bytearea(u8 *bytearea, p80211pstrd_t *pstr)
void prism2mgmt_pstr2bytearea(u8 * bytearea, p80211pstrd_t * pstr)
{
memcpy(bytearea, pstr->data, pstr->len);
}
@ -806,7 +805,7 @@ 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) (le16_to_cpu((u16) (bytestr->len)));
memcpy(pstr->data, bytestr->data, pstr->len);
@ -827,13 +826,8 @@ 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;
memcpy(pstr->data, bytearea, len);
}

View File

@ -127,37 +127,37 @@ MODULE_PARM_DESC(prism2_reset_settletime, "reset settle time in ms");
MODULE_LICENSE("Dual MPL/GPL");
static int prism2sta_open(wlandevice_t *wlandev);
static int prism2sta_close(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_mlmerequest(wlandevice_t *wlandev, p80211msg_t *msg);
static int prism2sta_getcardinfo(wlandevice_t *wlandev);
static int prism2sta_globalsetup(wlandevice_t *wlandev);
static int prism2sta_setmulticast(wlandevice_t *wlandev, netdevice_t *dev);
static int prism2sta_open(wlandevice_t * wlandev);
static int prism2sta_close(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_mlmerequest(wlandevice_t * wlandev, p80211msg_t * msg);
static int prism2sta_getcardinfo(wlandevice_t * wlandev);
static int prism2sta_globalsetup(wlandevice_t * wlandev);
static int prism2sta_setmulticast(wlandevice_t * wlandev, 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);
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
@ -180,7 +180,7 @@ static void prism2sta_inf_psusercnt(wlandevice_t *wlandev,
* Call context:
* process thread
----------------------------------------------------------------*/
static int prism2sta_open(wlandevice_t *wlandev)
static int prism2sta_open(wlandevice_t * wlandev)
{
/* We don't currently have to do anything else.
* The setup of the MAC should be subsequently completed via
@ -214,7 +214,7 @@ static int prism2sta_open(wlandevice_t *wlandev)
* Call context:
* process thread
----------------------------------------------------------------*/
static int prism2sta_close(wlandevice_t *wlandev)
static int prism2sta_close(wlandevice_t * wlandev)
{
/* We don't currently have to do anything else.
* Higher layers know we're not ready from dev->start==0 and
@ -242,7 +242,7 @@ static int prism2sta_close(wlandevice_t *wlandev)
* Call context:
* process thread
----------------------------------------------------------------*/
static void prism2sta_reset(wlandevice_t *wlandev)
static void prism2sta_reset(wlandevice_t * wlandev)
{
return;
}
@ -268,9 +268,9 @@ static void prism2sta_reset(wlandevice_t *wlandev)
* Call context:
* process thread
----------------------------------------------------------------*/
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)
{
hfa384x_t *hw = (hfa384x_t *) wlandev->priv;
int result;
@ -310,7 +310,7 @@ static int prism2sta_txframe(wlandevice_t *wlandev, struct sk_buff *skb,
* Call context:
* process thread
----------------------------------------------------------------*/
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;
@ -401,12 +401,9 @@ static int prism2sta_mlmerequest(wlandevice_t *wlandev, p80211msg_t *msg)
qualmsg->noise.status =
P80211ENUM_msgitem_status_data_ok;
qualmsg->link.data =
le16_to_cpu(hw->qual.CQ_currBSS);
qualmsg->level.data =
le16_to_cpu(hw->qual.ASL_currBSS);
qualmsg->noise.data =
le16_to_cpu(hw->qual.ANL_currFC);
qualmsg->link.data = le16_to_cpu(hw->qual.CQ_currBSS);
qualmsg->level.data = le16_to_cpu(hw->qual.ASL_currBSS);
qualmsg->noise.data = le16_to_cpu(hw->qual.ANL_currFC);
break;
}
@ -440,7 +437,7 @@ static int prism2sta_mlmerequest(wlandevice_t *wlandev, p80211msg_t *msg)
* process thread (usually)
* interrupt
----------------------------------------------------------------*/
u32 prism2sta_ifstate(wlandevice_t *wlandev, u32 ifstate)
u32 prism2sta_ifstate(wlandevice_t * wlandev, u32 ifstate)
{
hfa384x_t *hw = (hfa384x_t *) wlandev->priv;
u32 result;
@ -610,7 +607,7 @@ u32 prism2sta_ifstate(wlandevice_t *wlandev, u32 ifstate)
* Call context:
* Either.
----------------------------------------------------------------*/
static int prism2sta_getcardinfo(wlandevice_t *wlandev)
static int prism2sta_getcardinfo(wlandevice_t * wlandev)
{
int result = 0;
hfa384x_t *hw = (hfa384x_t *) wlandev->priv;
@ -811,10 +808,8 @@ static int prism2sta_getcardinfo(wlandevice_t *wlandev)
fields in byte order */
hw->cap_act_pri_cfi.role = le16_to_cpu(hw->cap_act_pri_cfi.role);
hw->cap_act_pri_cfi.id = le16_to_cpu(hw->cap_act_pri_cfi.id);
hw->cap_act_pri_cfi.variant =
le16_to_cpu(hw->cap_act_pri_cfi.variant);
hw->cap_act_pri_cfi.bottom =
le16_to_cpu(hw->cap_act_pri_cfi.bottom);
hw->cap_act_pri_cfi.variant = le16_to_cpu(hw->cap_act_pri_cfi.variant);
hw->cap_act_pri_cfi.bottom = le16_to_cpu(hw->cap_act_pri_cfi.bottom);
hw->cap_act_pri_cfi.top = le16_to_cpu(hw->cap_act_pri_cfi.top);
printk(KERN_INFO
@ -836,10 +831,8 @@ static int prism2sta_getcardinfo(wlandevice_t *wlandev)
fields in byte order */
hw->cap_act_sta_cfi.role = le16_to_cpu(hw->cap_act_sta_cfi.role);
hw->cap_act_sta_cfi.id = le16_to_cpu(hw->cap_act_sta_cfi.id);
hw->cap_act_sta_cfi.variant =
le16_to_cpu(hw->cap_act_sta_cfi.variant);
hw->cap_act_sta_cfi.bottom =
le16_to_cpu(hw->cap_act_sta_cfi.bottom);
hw->cap_act_sta_cfi.variant = le16_to_cpu(hw->cap_act_sta_cfi.variant);
hw->cap_act_sta_cfi.bottom = le16_to_cpu(hw->cap_act_sta_cfi.bottom);
hw->cap_act_sta_cfi.top = le16_to_cpu(hw->cap_act_sta_cfi.top);
printk(KERN_INFO
@ -861,10 +854,8 @@ static int prism2sta_getcardinfo(wlandevice_t *wlandev)
fields in byte order */
hw->cap_act_sta_mfi.role = le16_to_cpu(hw->cap_act_sta_mfi.role);
hw->cap_act_sta_mfi.id = le16_to_cpu(hw->cap_act_sta_mfi.id);
hw->cap_act_sta_mfi.variant =
le16_to_cpu(hw->cap_act_sta_mfi.variant);
hw->cap_act_sta_mfi.bottom =
le16_to_cpu(hw->cap_act_sta_mfi.bottom);
hw->cap_act_sta_mfi.variant = le16_to_cpu(hw->cap_act_sta_mfi.variant);
hw->cap_act_sta_mfi.bottom = le16_to_cpu(hw->cap_act_sta_mfi.bottom);
hw->cap_act_sta_mfi.top = le16_to_cpu(hw->cap_act_sta_mfi.top);
printk(KERN_INFO
@ -940,7 +931,7 @@ done:
* Call context:
* process thread
----------------------------------------------------------------*/
static int prism2sta_globalsetup(wlandevice_t *wlandev)
static int prism2sta_globalsetup(wlandevice_t * wlandev)
{
hfa384x_t *hw = (hfa384x_t *) wlandev->priv;
@ -949,7 +940,7 @@ static int prism2sta_globalsetup(wlandevice_t *wlandev)
WLAN_DATA_MAXLEN);
}
static int prism2sta_setmulticast(wlandevice_t *wlandev, netdevice_t *dev)
static int prism2sta_setmulticast(wlandevice_t * wlandev, netdevice_t * dev)
{
int result = 0;
hfa384x_t *hw = (hfa384x_t *) wlandev->priv;
@ -990,8 +981,8 @@ exit:
* Call context:
* 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");
return;
@ -1014,8 +1005,8 @@ static void prism2sta_inf_handover(wlandevice_t *wlandev,
* Call context:
* 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;
u16 *src16;
@ -1031,13 +1022,13 @@ static void prism2sta_inf_tallies(wlandevice_t *wlandev,
cnt = sizeof(hfa384x_CommTallies32_t) / sizeof(u32);
if (inf->framelen > 22) {
dst = (u32 *)&hw->tallies;
src32 = (u32 *)&inf->info.commtallies32;
dst = (u32 *) & hw->tallies;
src32 = (u32 *) & inf->info.commtallies32;
for (i = 0; i < cnt; i++, dst++, src32++)
*dst += le32_to_cpu(*src32);
} else {
dst = (u32 *)&hw->tallies;
src16 = (u16 *)&inf->info.commtallies16;
dst = (u32 *) & hw->tallies;
src16 = (u16 *) & inf->info.commtallies16;
for (i = 0; i < cnt; i++, dst++, src16++)
*dst += le16_to_cpu(*src16);
}
@ -1062,8 +1053,8 @@ static void prism2sta_inf_tallies(wlandevice_t *wlandev,
* Call context:
* interrupt
----------------------------------------------------------------*/
static void prism2sta_inf_scanresults(wlandevice_t *wlandev,
hfa384x_InfFrame_t *inf)
static void prism2sta_inf_scanresults(wlandevice_t * wlandev,
hfa384x_InfFrame_t * inf)
{
hfa384x_t *hw = (hfa384x_t *) wlandev->priv;
@ -1120,8 +1111,8 @@ static void prism2sta_inf_scanresults(wlandevice_t *wlandev,
* Call context:
* interrupt
----------------------------------------------------------------*/
static void prism2sta_inf_hostscanresults(wlandevice_t *wlandev,
hfa384x_InfFrame_t *inf)
static void prism2sta_inf_hostscanresults(wlandevice_t * wlandev,
hfa384x_InfFrame_t * inf)
{
hfa384x_t *hw = (hfa384x_t *) wlandev->priv;
int nbss;
@ -1162,8 +1153,8 @@ static void prism2sta_inf_hostscanresults(wlandevice_t *wlandev,
* Call context:
* interrupt
----------------------------------------------------------------*/
static void prism2sta_inf_chinforesults(wlandevice_t *wlandev,
hfa384x_InfFrame_t *inf)
static void prism2sta_inf_chinforesults(wlandevice_t * wlandev,
hfa384x_InfFrame_t * inf)
{
hfa384x_t *hw = (hfa384x_t *) wlandev->priv;
unsigned int i, n;
@ -1174,27 +1165,24 @@ static void prism2sta_inf_chinforesults(wlandevice_t *wlandev,
for (i = 0, n = 0; i < HFA384x_CHINFORESULT_MAX; i++) {
if (hw->channel_info.results.scanchannels & (1 << i)) {
int channel =
le16_to_cpu(inf->info.chinforesult.result[n].
chid) - 1;
le16_to_cpu(inf->info.chinforesult.result[n].chid) -
1;
hfa384x_ChInfoResultSub_t *chinforesult =
&hw->channel_info.results.result[channel];
chinforesult->chid = channel;
chinforesult->anl =
le16_to_cpu(inf->info.chinforesult.result[n].
anl);
le16_to_cpu(inf->info.chinforesult.result[n].anl);
chinforesult->pnl =
le16_to_cpu(inf->info.chinforesult.result[n].
pnl);
le16_to_cpu(inf->info.chinforesult.result[n].pnl);
chinforesult->active =
le16_to_cpu(inf->info.chinforesult.result[n].
active);
pr_debug(
"chinfo: channel %d, %s level (avg/peak)=%d/%d dB, pcf %d\n",
pr_debug
("chinfo: channel %d, %s level (avg/peak)=%d/%d dB, pcf %d\n",
channel + 1,
chinforesult->
active & HFA384x_CHINFORESULT_BSSACTIVE ?
"signal" : "noise", chinforesult->anl,
chinforesult->pnl,
active & HFA384x_CHINFORESULT_BSSACTIVE ? "signal"
: "noise", chinforesult->anl, chinforesult->pnl,
chinforesult->
active & HFA384x_CHINFORESULT_PCFACTIVE ? 1 : 0);
n++;
@ -1276,8 +1264,8 @@ void prism2sta_processing_defer(struct work_struct *data)
wlandev->bssid,
WLAN_BSSID_LEN);
if (result) {
pr_debug(
"getconfig(0x%02x) failed, result = %d\n",
pr_debug
("getconfig(0x%02x) failed, result = %d\n",
HFA384x_RID_CURRENTBSSID, result);
goto failed;
}
@ -1286,22 +1274,22 @@ void prism2sta_processing_defer(struct work_struct *data)
HFA384x_RID_CURRENTSSID,
&ssid, sizeof(ssid));
if (result) {
pr_debug(
"getconfig(0x%02x) failed, result = %d\n",
pr_debug
("getconfig(0x%02x) failed, result = %d\n",
HFA384x_RID_CURRENTSSID, result);
goto failed;
}
prism2mgmt_bytestr2pstr((hfa384x_bytestr_t *)&ssid,
(p80211pstrd_t *)&wlandev->
ssid);
prism2mgmt_bytestr2pstr((hfa384x_bytestr_t *) & ssid,
(p80211pstrd_t *) &
wlandev->ssid);
/* Collect the port status */
result = hfa384x_drvr_getconfig16(hw,
HFA384x_RID_PORTSTATUS,
&portstatus);
if (result) {
pr_debug(
"getconfig(0x%02x) failed, result = %d\n",
pr_debug
("getconfig(0x%02x) failed, result = %d\n",
HFA384x_RID_PORTSTATUS, result);
goto failed;
}
@ -1366,8 +1354,7 @@ void prism2sta_processing_defer(struct work_struct *data)
HFA384x_RID_CURRENTBSSID,
wlandev->bssid, WLAN_BSSID_LEN);
if (result) {
pr_debug(
"getconfig(0x%02x) failed, result = %d\n",
pr_debug("getconfig(0x%02x) failed, result = %d\n",
HFA384x_RID_CURRENTBSSID, result);
goto failed;
}
@ -1376,13 +1363,12 @@ void prism2sta_processing_defer(struct work_struct *data)
HFA384x_RID_CURRENTSSID,
&ssid, sizeof(ssid));
if (result) {
pr_debug(
"getconfig(0x%02x) failed, result = %d\n",
pr_debug("getconfig(0x%02x) failed, result = %d\n",
HFA384x_RID_CURRENTSSID, result);
goto failed;
}
prism2mgmt_bytestr2pstr((hfa384x_bytestr_t *)&ssid,
(p80211pstrd_t *)&wlandev->ssid);
prism2mgmt_bytestr2pstr((hfa384x_bytestr_t *) & ssid,
(p80211pstrd_t *) & wlandev->ssid);
hw->link_status = HFA384x_LINK_CONNECTED;
netif_carrier_on(wlandev->netdev);
@ -1482,8 +1468,8 @@ failed:
* Call context:
* interrupt
----------------------------------------------------------------*/
static void prism2sta_inf_linkstatus(wlandevice_t *wlandev,
hfa384x_InfFrame_t *inf)
static void prism2sta_inf_linkstatus(wlandevice_t * wlandev,
hfa384x_InfFrame_t * inf)
{
hfa384x_t *hw = (hfa384x_t *) wlandev->priv;
@ -1512,8 +1498,8 @@ static void prism2sta_inf_linkstatus(wlandevice_t *wlandev,
* Call context:
* interrupt
----------------------------------------------------------------*/
static void prism2sta_inf_assocstatus(wlandevice_t *wlandev,
hfa384x_InfFrame_t *inf)
static void prism2sta_inf_assocstatus(wlandevice_t * wlandev,
hfa384x_InfFrame_t * inf)
{
hfa384x_t *hw = (hfa384x_t *) wlandev->priv;
hfa384x_AssocStatus_t rec;
@ -1574,8 +1560,8 @@ static void prism2sta_inf_assocstatus(wlandevice_t *wlandev,
* interrupt
*
----------------------------------------------------------------*/
static void prism2sta_inf_authreq(wlandevice_t *wlandev,
hfa384x_InfFrame_t *inf)
static void prism2sta_inf_authreq(wlandevice_t * wlandev,
hfa384x_InfFrame_t * inf)
{
hfa384x_t *hw = (hfa384x_t *) wlandev->priv;
struct sk_buff *skb;
@ -1589,8 +1575,8 @@ static void prism2sta_inf_authreq(wlandevice_t *wlandev,
}
}
static void prism2sta_inf_authreq_defer(wlandevice_t *wlandev,
hfa384x_InfFrame_t *inf)
static void prism2sta_inf_authreq_defer(wlandevice_t * wlandev,
hfa384x_InfFrame_t * inf)
{
hfa384x_t *hw = (hfa384x_t *) wlandev->priv;
hfa384x_authenticateStation_data_t rec;
@ -1763,8 +1749,8 @@ static void prism2sta_inf_authreq_defer(wlandevice_t *wlandev,
* Call context:
* interrupt
----------------------------------------------------------------*/
static void prism2sta_inf_psusercnt(wlandevice_t *wlandev,
hfa384x_InfFrame_t *inf)
static void prism2sta_inf_psusercnt(wlandevice_t * wlandev,
hfa384x_InfFrame_t * inf)
{
hfa384x_t *hw = (hfa384x_t *) wlandev->priv;
@ -1790,7 +1776,7 @@ static void prism2sta_inf_psusercnt(wlandevice_t *wlandev,
* Call context:
* interrupt
----------------------------------------------------------------*/
void prism2sta_ev_info(wlandevice_t *wlandev, hfa384x_InfFrame_t *inf)
void prism2sta_ev_info(wlandevice_t * wlandev, hfa384x_InfFrame_t * inf)
{
inf->infotype = le16_to_cpu(inf->infotype);
/* Dispatch */
@ -1858,7 +1844,7 @@ void prism2sta_ev_info(wlandevice_t *wlandev, hfa384x_InfFrame_t *inf)
* Call context:
* interrupt
----------------------------------------------------------------*/
void prism2sta_ev_txexc(wlandevice_t *wlandev, u16 status)
void prism2sta_ev_txexc(wlandevice_t * wlandev, u16 status)
{
pr_debug("TxExc status=0x%x.\n", status);
@ -1881,7 +1867,7 @@ void prism2sta_ev_txexc(wlandevice_t *wlandev, u16 status)
* Call context:
* interrupt
----------------------------------------------------------------*/
void prism2sta_ev_tx(wlandevice_t *wlandev, u16 status)
void prism2sta_ev_tx(wlandevice_t * wlandev, u16 status)
{
pr_debug("Tx Complete, status=0x%04x\n", status);
/* update linux network stats */
@ -1905,7 +1891,7 @@ void prism2sta_ev_tx(wlandevice_t *wlandev, u16 status)
* Call context:
* interrupt
----------------------------------------------------------------*/
void prism2sta_ev_rx(wlandevice_t *wlandev, struct sk_buff *skb)
void prism2sta_ev_rx(wlandevice_t * wlandev, struct sk_buff *skb)
{
p80211netdev_rx(wlandev, skb);
return;
@ -1927,7 +1913,7 @@ void prism2sta_ev_rx(wlandevice_t *wlandev, struct sk_buff *skb)
* Call context:
* interrupt
----------------------------------------------------------------*/
void prism2sta_ev_alloc(wlandevice_t *wlandev)
void prism2sta_ev_alloc(wlandevice_t * wlandev)
{
netif_wake_queue(wlandev->netdev);
return;
@ -2030,8 +2016,7 @@ void prism2sta_commsqual_defer(struct work_struct *data)
HFA384x_RID_CURRENTBSSID,
wlandev->bssid, WLAN_BSSID_LEN);
if (result) {
pr_debug(
"getconfig(0x%02x) failed, result = %d\n",
pr_debug("getconfig(0x%02x) failed, result = %d\n",
HFA384x_RID_CURRENTBSSID, result);
goto done;
}
@ -2040,13 +2025,12 @@ void prism2sta_commsqual_defer(struct work_struct *data)
HFA384x_RID_CURRENTSSID,
&ssid, sizeof(ssid));
if (result) {
pr_debug(
"getconfig(0x%02x) failed, result = %d\n",
pr_debug("getconfig(0x%02x) failed, result = %d\n",
HFA384x_RID_CURRENTSSID, result);
goto done;
}
prism2mgmt_bytestr2pstr((hfa384x_bytestr_t *)&ssid,
(p80211pstrd_t *)&wlandev->ssid);
prism2mgmt_bytestr2pstr((hfa384x_bytestr_t *) & ssid,
(p80211pstrd_t *) & wlandev->ssid);
/* Reschedule timer */
mod_timer(&hw->commsqual_timer, jiffies + HZ);

View File

@ -24,8 +24,7 @@ static struct usb_device_id usb_prism_tbl[] = {
(0x066b, 0x2213, "Linksys WUSB12v1.1 11Mbps WLAN USB Adapter")},
{PRISM_USB_DEVICE
(0x067c, 0x1022, "Siemens SpeedStream 1022 11Mbps WLAN USB Adapter")},
{PRISM_USB_DEVICE
(0x049f, 0x0033,
{PRISM_USB_DEVICE(0x049f, 0x0033,
"Compaq/Intel W100 PRO/Wireless 11Mbps multiport WLAN Adapter")},
{PRISM_USB_DEVICE
(0x0411, 0x0016, "Melco WLI-USB-S11 11Mbps WLAN Adapter")},