diff options
Diffstat (limited to 'drivers/staging/wlan-ng')
-rw-r--r-- | drivers/staging/wlan-ng/hfa384x_usb.c | 205 | ||||
-rw-r--r-- | drivers/staging/wlan-ng/p80211conv.c | 12 | ||||
-rw-r--r-- | drivers/staging/wlan-ng/p80211hdr.h | 15 | ||||
-rw-r--r-- | drivers/staging/wlan-ng/p80211meta.h | 6 | ||||
-rw-r--r-- | drivers/staging/wlan-ng/p80211mgmt.h | 6 | ||||
-rw-r--r-- | drivers/staging/wlan-ng/p80211msg.h | 6 | ||||
-rw-r--r-- | drivers/staging/wlan-ng/p80211netdev.c | 62 | ||||
-rw-r--r-- | drivers/staging/wlan-ng/p80211netdev.h | 3 | ||||
-rw-r--r-- | drivers/staging/wlan-ng/p80211req.c | 12 | ||||
-rw-r--r-- | drivers/staging/wlan-ng/p80211types.h | 4 | ||||
-rw-r--r-- | drivers/staging/wlan-ng/p80211wep.c | 27 | ||||
-rw-r--r-- | drivers/staging/wlan-ng/p80211wext.c | 77 | ||||
-rw-r--r-- | drivers/staging/wlan-ng/prism2fw.c | 509 | ||||
-rw-r--r-- | drivers/staging/wlan-ng/prism2mgmt.c | 23 | ||||
-rw-r--r-- | drivers/staging/wlan-ng/prism2mib.c | 144 | ||||
-rw-r--r-- | drivers/staging/wlan-ng/prism2sta.c | 153 | ||||
-rw-r--r-- | drivers/staging/wlan-ng/prism2usb.c | 10 |
17 files changed, 496 insertions, 778 deletions
diff --git a/drivers/staging/wlan-ng/hfa384x_usb.c b/drivers/staging/wlan-ng/hfa384x_usb.c index 51d9e520d52a..925678babd9e 100644 --- a/drivers/staging/wlan-ng/hfa384x_usb.c +++ b/drivers/staging/wlan-ng/hfa384x_usb.c @@ -128,9 +128,6 @@ #define SUBMIT_URB(u,f) usb_submit_urb(u,f) -/*================================================================*/ -/* Project Includes */ - #include "p80211types.h" #include "p80211hdr.h" #include "p80211mgmt.h" @@ -160,13 +157,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 */ @@ -175,22 +172,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); @@ -202,9 +199,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 *); @@ -212,35 +209,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, @@ -248,7 +245,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, @@ -256,7 +253,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, @@ -265,7 +262,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, @@ -334,7 +331,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; @@ -395,7 +392,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; @@ -532,7 +529,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; @@ -608,7 +605,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; @@ -640,8 +637,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); @@ -656,8 +653,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; @@ -712,7 +709,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; @@ -733,7 +730,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, @@ -773,7 +770,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; @@ -783,9 +780,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; @@ -816,7 +813,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; @@ -853,7 +850,7 @@ 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; @@ -870,21 +867,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, @@ -892,7 +889,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) @@ -903,7 +900,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, @@ -911,7 +908,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) @@ -922,7 +919,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, @@ -930,7 +927,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) @@ -941,7 +938,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, @@ -949,7 +946,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, @@ -981,7 +978,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; @@ -1029,7 +1026,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; @@ -1065,7 +1062,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; @@ -1110,7 +1107,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; @@ -1164,7 +1161,7 @@ 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; @@ -1208,7 +1205,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; @@ -1245,9 +1242,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; @@ -1361,9 +1358,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; @@ -1450,7 +1447,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, @@ -1531,7 +1528,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, @@ -1618,7 +1615,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, @@ -1709,7 +1706,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, @@ -1783,7 +1780,7 @@ done: * Call context: * process ----------------------------------------------------------------*/ -int hfa384x_drvr_commtallies(hfa384x_t * hw) +int hfa384x_drvr_commtallies(hfa384x_t *hw) { hfa384x_metacmd_t cmd; @@ -1819,7 +1816,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; @@ -1857,7 +1854,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; @@ -1894,7 +1891,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; @@ -1952,7 +1949,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) @@ -1997,7 +1994,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; @@ -2143,7 +2140,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; @@ -2180,7 +2177,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, @@ -2211,7 +2208,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) @@ -2238,7 +2235,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) @@ -2278,7 +2275,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; @@ -2346,7 +2343,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; @@ -2425,7 +2422,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; @@ -2531,7 +2528,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); } @@ -2556,7 +2553,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; @@ -2657,7 +2654,7 @@ done: * Call context: * process ----------------------------------------------------------------*/ -int hfa384x_drvr_stop(hfa384x_t * hw) +int hfa384x_drvr_stop(hfa384x_t *hw) { int result = 0; int i; @@ -2708,9 +2705,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; @@ -2801,7 +2798,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; @@ -2950,8 +2947,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; @@ -3000,7 +2997,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" @@ -3038,7 +3035,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; @@ -3318,7 +3315,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; @@ -3439,8 +3436,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; @@ -3470,7 +3467,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; @@ -3573,8 +3570,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; @@ -3677,7 +3674,7 @@ static void hfa384x_int_rxmonitor(wlandevice_t * wlandev, * Call context: * interrupt ----------------------------------------------------------------*/ -static void hfa384x_usbin_info(wlandevice_t * wlandev, hfa384x_usbin_t * usbin) +static void hfa384x_usbin_info(wlandevice_t *wlandev, hfa384x_usbin_t *usbin) { usbin->infofrm.info.framelen = le16_to_cpu(usbin->infofrm.info.framelen); @@ -4055,7 +4052,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; @@ -4096,7 +4093,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); } diff --git a/drivers/staging/wlan-ng/p80211conv.c b/drivers/staging/wlan-ng/p80211conv.c index 8b4f3960d9bc..5952c671073f 100644 --- a/drivers/staging/wlan-ng/p80211conv.c +++ b/drivers/staging/wlan-ng/p80211conv.c @@ -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; @@ -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; diff --git a/drivers/staging/wlan-ng/p80211hdr.h b/drivers/staging/wlan-ng/p80211hdr.h index 1703c9239476..419de4dee560 100644 --- a/drivers/staging/wlan-ng/p80211hdr.h +++ b/drivers/staging/wlan-ng/p80211hdr.h @@ -60,17 +60,8 @@ #ifndef _P80211HDR_H #define _P80211HDR_H -/*================================================================*/ -/* System Includes */ - #include <linux/if_ether.h> -/*================================================================*/ -/* Project Includes */ - -/*================================================================*/ -/* Constants */ - /*--- Sizes -----------------------------------------------*/ #define WLAN_CRC_LEN 4 #define WLAN_BSSID_LEN 6 @@ -121,9 +112,6 @@ #define WLAN_FSTYPE_CFPOLL 0x06 #define WLAN_FSTYPE_CFACK_CFPOLL 0x07 -/*================================================================*/ -/* Macros */ - /*--- FC Macros ----------------------------------------------*/ /* Macros to get/set the bitfields of the Frame Control Field */ /* GET_FC_??? - takes the host byte-order value of an FC */ @@ -157,9 +145,6 @@ #define DOT11_RATE5_ISBASIC_GET(r) (((u8)(r)) & BIT(7)) -/*================================================================*/ -/* Types */ - /* Generic 802.11 Header types */ typedef struct p80211_hdr_a3 { diff --git a/drivers/staging/wlan-ng/p80211meta.h b/drivers/staging/wlan-ng/p80211meta.h index c1a677be8dea..b9badcff681f 100644 --- a/drivers/staging/wlan-ng/p80211meta.h +++ b/drivers/staging/wlan-ng/p80211meta.h @@ -57,12 +57,6 @@ #ifndef _P80211META_H #define _P80211META_H -/*================================================================*/ -/* Project Includes */ - -/*================================================================*/ -/* Types */ - /*----------------------------------------------------------------*/ /* The following structure types are used for the metadata */ /* representation of category list metadata, group list metadata, */ diff --git a/drivers/staging/wlan-ng/p80211mgmt.h b/drivers/staging/wlan-ng/p80211mgmt.h index c925a45b1885..14cdc86d1676 100644 --- a/drivers/staging/wlan-ng/p80211mgmt.h +++ b/drivers/staging/wlan-ng/p80211mgmt.h @@ -100,16 +100,10 @@ #ifndef _P80211MGMT_H #define _P80211MGMT_H -/*================================================================*/ -/* Project Includes */ - #ifndef _P80211HDR_H #include "p80211hdr.h" #endif -/*================================================================*/ -/* Constants */ - /*-- Information Element IDs --------------------*/ #define WLAN_EID_SSID 0 #define WLAN_EID_SUPP_RATES 1 diff --git a/drivers/staging/wlan-ng/p80211msg.h b/drivers/staging/wlan-ng/p80211msg.h index 4ac77274eefd..c691d3eeb9d0 100644 --- a/drivers/staging/wlan-ng/p80211msg.h +++ b/drivers/staging/wlan-ng/p80211msg.h @@ -48,14 +48,8 @@ #ifndef _P80211MSG_H #define _P80211MSG_H -/*================================================================*/ -/* Project Includes */ - #define WLAN_DEVNAMELEN_MAX 16 -/*--------------------------------------------------------------------*/ -/* Prototype msg type */ - typedef struct p80211msg { u32 msgcode; u32 msglen; diff --git a/drivers/staging/wlan-ng/p80211netdev.c b/drivers/staging/wlan-ng/p80211netdev.c index c273c034a830..22424c8903ee 100644 --- a/drivers/staging/wlan-ng/p80211netdev.c +++ b/drivers/staging/wlan-ng/p80211netdev.c @@ -76,9 +76,6 @@ #include <net/iw_handler.h> #include <net/net_namespace.h> -/*================================================================*/ -/* Project Includes */ - #include "p80211types.h" #include "p80211hdr.h" #include "p80211conv.h" @@ -94,18 +91,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 +124,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 */ @@ -174,7 +171,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 +206,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 +233,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 +342,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; @@ -451,7 +448,7 @@ static int p80211knetdev_hard_start_xmit(struct sk_buff *skb, failed: /* Free up the WEP buffer if it's not the same as the skb */ if ((p80211_wep.data) && (p80211_wep.data != skb->data)) - kfree(p80211_wep.data); + kzfree(p80211_wep.data); /* we always free the skb here, never in a lower level. */ if (!result) @@ -472,7 +469,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 +482,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 +554,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 +631,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; @@ -694,7 +691,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 +739,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; @@ -767,9 +764,6 @@ int wlan_setup(wlandevice_t * wlandev) dev->ml_priv = wlandev; dev->netdev_ops = &p80211_netdev_ops; -#if (WIRELESS_EXT < 21) - dev->get_wireless_stats = p80211wext_get_wireless_stats; -#endif dev->wireless_handlers = &p80211wext_handler_def; netif_stop_queue(dev); @@ -800,7 +794,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 +830,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 +858,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 +901,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 +931,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 +1089,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; diff --git a/drivers/staging/wlan-ng/p80211netdev.h b/drivers/staging/wlan-ng/p80211netdev.h index f4fcd2b11c47..8bd9dfb3b9b4 100644 --- a/drivers/staging/wlan-ng/p80211netdev.h +++ b/drivers/staging/wlan-ng/p80211netdev.h @@ -57,9 +57,6 @@ #include <linux/wireless.h> #include <linux/netdevice.h> -/*================================================================*/ -/* Constants */ - #undef netdevice_t typedef struct net_device netdevice_t; diff --git a/drivers/staging/wlan-ng/p80211req.c b/drivers/staging/wlan-ng/p80211req.c index 584c4193ad84..c88156cdf681 100644 --- a/drivers/staging/wlan-ng/p80211req.c +++ b/drivers/staging/wlan-ng/p80211req.c @@ -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); /*---------------------------------------------------------------- @@ -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; diff --git a/drivers/staging/wlan-ng/p80211types.h b/drivers/staging/wlan-ng/p80211types.h index 043da1e5607f..2b83ab0c711b 100644 --- a/drivers/staging/wlan-ng/p80211types.h +++ b/drivers/staging/wlan-ng/p80211types.h @@ -57,10 +57,6 @@ #ifndef _P80211TYPES_H #define _P80211TYPES_H -/*================================================================*/ -/* Project Includes */ -/*================================================================*/ - /*----------------------------------------------------------------*/ /* The following constants are indexes into the Mib Category List */ /* and the Message Category List */ diff --git a/drivers/staging/wlan-ng/p80211wep.c b/drivers/staging/wlan-ng/p80211wep.c index f0b4275ab228..ecbb15b297ae 100644 --- a/drivers/staging/wlan-ng/p80211wep.c +++ b/drivers/staging/wlan-ng/p80211wep.c @@ -54,10 +54,7 @@ #include <linux/random.h> #include <linux/kernel.h> -// #define WEP_DEBUG - -/*================================================================*/ -/* Project Includes */ +/* #define WEP_DEBUG */ #include "p80211hdr.h" #include "p80211types.h" @@ -65,14 +62,8 @@ #include "p80211conv.h" #include "p80211netdev.h" -/*================================================================*/ -/* Local Constants */ - #define WEP_KEY(x) (((x) & 0xC0) >> 6) -/*================================================================*/ -/* Local Static Definitions */ - static const u32 wep_crc32_table[256] = { 0x00000000L, 0x77073096L, 0xee0e612cL, 0x990951baL, 0x076dc419L, 0x706af48fL, 0xe963a535L, 0x9e6495a3L, 0x0edb8832L, 0x79dcb8a4L, @@ -128,15 +119,9 @@ static const u32 wep_crc32_table[256] = { 0x2d02ef8dL }; -/*================================================================*/ -/* Local Function Declarations */ - -/*================================================================*/ -/* Function Definitions */ - /* 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; @@ -166,8 +151,8 @@ 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]; @@ -245,8 +230,8 @@ int wep_decrypt(wlandevice_t * wlandev, u8 * buf, u32 len, int key_override, } /* 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]; diff --git a/drivers/staging/wlan-ng/p80211wext.c b/drivers/staging/wlan-ng/p80211wext.c index 984e45d9f700..74d8022adb24 100644 --- a/drivers/staging/wlan-ng/p80211wext.c +++ b/drivers/staging/wlan-ng/p80211wext.c @@ -52,9 +52,6 @@ #include <linux/if_ether.h> #include <linux/bitops.h> -/*================================================================*/ -/* Project Includes */ - #include "p80211types.h" #include "p80211hdr.h" #include "p80211conv.h" @@ -66,10 +63,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); @@ -130,7 +127,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; @@ -145,7 +142,7 @@ static int p80211wext_dorequest(wlandevice_t * wlandev, u32 did, u32 data) 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; @@ -191,7 +188,7 @@ exit: } /* called by /proc/net/wireless */ -struct iw_statistics *p80211wext_get_wireless_stats(netdevice_t * dev) +struct iw_statistics *p80211wext_get_wireless_stats(netdevice_t *dev) { p80211msg_lnxreq_commsquality_t quality; wlandevice_t *wlandev = dev->ml_priv; @@ -232,7 +229,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) { @@ -261,7 +258,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) { @@ -296,7 +293,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) { @@ -332,9 +329,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; @@ -356,9 +353,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; @@ -411,7 +408,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) { @@ -480,7 +477,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) { @@ -493,7 +490,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) { @@ -534,7 +531,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) { @@ -681,7 +678,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) { @@ -692,9 +689,6 @@ static int p80211wext_giwessid(netdevice_t * dev, data->flags = 1; memcpy(essid, wlandev->ssid.data, data->length); essid[data->length] = 0; -#if (WIRELESS_EXT < 21) - data->length++; -#endif } else { memset(essid, 0, sizeof(wlandev->ssid.data)); data->length = 0; @@ -704,7 +698,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) { @@ -727,11 +721,6 @@ static int p80211wext_siwessid(netdevice_t * dev, msg.msgcode = DIDmsg_lnxreq_autojoin; -#if (WIRELESS_EXT < 21) - if (length) - length--; -#endif - /* Trim the last '\0' to fit the SSID format */ if (length && essid[length - 1] == '\0') length--; @@ -752,7 +741,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) { @@ -771,7 +760,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) { @@ -822,7 +811,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) { @@ -852,7 +841,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) { @@ -886,7 +875,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) { @@ -917,7 +906,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) { @@ -961,7 +950,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) { @@ -1038,7 +1027,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) { @@ -1109,7 +1098,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) { @@ -1143,7 +1132,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) { @@ -1178,7 +1167,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) { @@ -1213,7 +1202,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) { @@ -1273,7 +1262,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) { @@ -1320,7 +1309,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 */ @@ -1404,7 +1393,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) { diff --git a/drivers/staging/wlan-ng/prism2fw.c b/drivers/staging/wlan-ng/prism2fw.c index 608b234b6a44..7d76a7f92a33 100644 --- a/drivers/staging/wlan-ng/prism2fw.c +++ b/drivers/staging/wlan-ng/prism2fw.c @@ -47,84 +47,28 @@ /*================================================================*/ /* System Includes */ -#include <linux/sort.h> -#include <linux/firmware.h> +#include <linux/ihex.h> /*================================================================*/ /* Local Constants */ -#define PRISM2_USB_FWFILE "prism2_ru.hex" +#define PRISM2_USB_FWFILE "prism2_ru.fw" #define S3DATA_MAX 5000 #define S3PLUG_MAX 200 #define S3CRC_MAX 200 #define S3INFO_MAX 50 -#define SREC_LINE_MAX 264 -#define S3LEN_TXTOFFSET 2 -#define S3LEN_TXTLEN 2 -#define S3ADDR_TXTOFFSET 4 -#define S3ADDR_TXTLEN 8 -#define S3DATA_TXTOFFSET 12 -/*S3DATA_TXTLEN variable, depends on len field */ -/*S3CKSUM_TXTOFFSET variable, depends on len field */ -#define S3CKSUM_TXTLEN 2 -#define SERNUM_LEN_MAX 12 - -#define S3PLUG_ITEMCODE_TXTOFFSET (S3DATA_TXTOFFSET) -#define S3PLUG_ITEMCODE_TXTLEN 8 -#define S3PLUG_ADDR_TXTOFFSET (S3DATA_TXTOFFSET+8) -#define S3PLUG_ADDR_TXTLEN 8 -#define S3PLUG_LEN_TXTOFFSET (S3DATA_TXTOFFSET+16) -#define S3PLUG_LEN_TXTLEN 8 - -#define S3CRC_ADDR_TXTOFFSET (S3DATA_TXTOFFSET) -#define S3CRC_ADDR_TXTLEN 8 -#define S3CRC_LEN_TXTOFFSET (S3DATA_TXTOFFSET+8) -#define S3CRC_LEN_TXTLEN 8 -#define S3CRC_DOWRITE_TXTOFFSET (S3DATA_TXTOFFSET+16) -#define S3CRC_DOWRITE_TXTLEN 8 - -#define S3INFO_LEN_TXTOFFSET (S3DATA_TXTOFFSET) -#define S3INFO_LEN_TXTLEN 4 -#define S3INFO_TYPE_TXTOFFSET (S3DATA_TXTOFFSET+4) -#define S3INFO_TYPE_TXTLEN 4 -#define S3INFO_DATA_TXTOFFSET (S3DATA_TXTOFFSET+8) -/* S3INFO_DATA_TXTLEN variable, depends on INFO_LEN field */ #define S3ADDR_PLUG (0xff000000UL) #define S3ADDR_CRC (0xff100000UL) #define S3ADDR_INFO (0xff200000UL) - -#define PDAFILE_LINE_MAX 1024 +#define S3ADDR_START (0xff400000UL) #define CHUNKS_MAX 100 #define WRITESIZE_MAX 4096 /*================================================================*/ -/* Local Macros */ - -#define bswap_16(x) \ - (__extension__ \ - ({ register unsigned short int __v, __x = (x); \ - __asm__ ("rorw $8, %w0" \ - : "=r" (__v) \ - : "0" (__x) \ - : "cc"); \ - __v; })) - -#define bswap_32(x) \ - (__extension__ \ - ({ register unsigned int __v, __x = (x); \ - __asm__ ("rorw $8, %w0;" \ - "rorl $16, %0;" \ - "rorw $8, %w0" \ - : "=r" (__v) \ - : "0" (__x) \ - : "cc"); \ - __v; })) - -/*================================================================*/ /* Local Types */ typedef struct s3datarec { @@ -177,19 +121,19 @@ typedef struct imgchunk { /* s-record image processing */ /* Data records */ -unsigned int ns3data = 0; +unsigned int ns3data; s3datarec_t s3data[S3DATA_MAX]; /* Plug records */ -unsigned int ns3plug = 0; +unsigned int ns3plug; s3plugrec_t s3plug[S3PLUG_MAX]; /* CRC records */ -unsigned int ns3crc = 0; +unsigned int ns3crc; s3crcrec_t s3crc[S3CRC_MAX]; /* Info records */ -unsigned int ns3info = 0; +unsigned int ns3info; s3inforec_t s3info[S3INFO_MAX]; /* S7 record (there _better_ be only one) */ @@ -214,19 +158,18 @@ hfa384x_caplevel_t priid; /*================================================================*/ /* Local Function Declarations */ -int prism2_fwapply(char *rfptr, int rfsize, wlandevice_t * wlandev); -int read_srecfile(char *rfptr, int rfsize); -int mkimage(imgchunk_t * clist, unsigned int *ccnt); -int read_cardpda(pda_t * pda, wlandevice_t * wlandev); -int mkpdrlist(pda_t * pda); -int s3datarec_compare(const void *p1, const void *p2); -int plugimage(imgchunk_t * fchunk, unsigned int nfchunks, - s3plugrec_t * s3plug, unsigned int ns3plug, pda_t * pda); -int crcimage(imgchunk_t * fchunk, unsigned int nfchunks, - s3crcrec_t * s3crc, unsigned int ns3crc); -int writeimage(wlandevice_t * wlandev, imgchunk_t * fchunk, +int prism2_fwapply(const struct ihex_binrec *rfptr, wlandevice_t *wlandev); +int read_fwfile(const struct ihex_binrec *rfptr); +int mkimage(imgchunk_t *clist, unsigned int *ccnt); +int read_cardpda(pda_t *pda, wlandevice_t *wlandev); +int mkpdrlist(pda_t *pda); +int plugimage(imgchunk_t *fchunk, unsigned int nfchunks, + s3plugrec_t *s3plug, unsigned int ns3plug, pda_t * pda); +int crcimage(imgchunk_t *fchunk, unsigned int nfchunks, + s3crcrec_t *s3crc, unsigned int ns3crc); +int writeimage(wlandevice_t *wlandev, imgchunk_t *fchunk, unsigned int nfchunks); -void free_chunks(imgchunk_t * fchunk, unsigned int *nfchunks); +void free_chunks(imgchunk_t *fchunk, unsigned int *nfchunks); void free_srecs(void); int validate_identity(void); @@ -247,13 +190,13 @@ int validate_identity(void); * 0 - success * ~0 - failure ----------------------------------------------------------------*/ -int prism2_fwtry(struct usb_device *udev, wlandevice_t * wlandev) +int prism2_fwtry(struct usb_device *udev, wlandevice_t *wlandev) { const struct firmware *fw_entry = NULL; printk(KERN_INFO "prism2_usb: Checking for firmware %s\n", PRISM2_USB_FWFILE); - if (request_firmware(&fw_entry, PRISM2_USB_FWFILE, &udev->dev) != 0) { + if (request_ihex_firmware(&fw_entry, PRISM2_USB_FWFILE, &udev->dev) != 0) { printk(KERN_INFO "prism2_usb: Firmware not available, but not essential\n"); printk(KERN_INFO @@ -263,7 +206,7 @@ int prism2_fwtry(struct usb_device *udev, wlandevice_t * wlandev) printk(KERN_INFO "prism2_usb: %s will be processed, size %d\n", PRISM2_USB_FWFILE, fw_entry->size); - prism2_fwapply((char *)fw_entry->data, fw_entry->size, wlandev); + prism2_fwapply((const struct ihex_binrec *)fw_entry->data, wlandev); release_firmware(fw_entry); return 0; @@ -276,14 +219,13 @@ int prism2_fwtry(struct usb_device *udev, wlandevice_t * wlandev) * * Arguments: * rfptr firmware image in kernel memory -* rfsize firmware size in kernel memory * wlandev device * * Returns: * 0 - success * ~0 - failure ----------------------------------------------------------------*/ -int prism2_fwapply(char *rfptr, int rfsize, wlandevice_t * wlandev) +int prism2_fwapply(const struct ihex_binrec *rfptr, wlandevice_t *wlandev) { signed int result = 0; p80211msg_dot11req_mibget_t getmsg; @@ -356,13 +298,11 @@ int prism2_fwapply(char *rfptr, int rfsize, wlandevice_t * wlandev) priid.top = *data++; /* Read the S3 file */ - result = read_srecfile(rfptr, rfsize); + result = read_fwfile(rfptr); if (result) { printk(KERN_ERR "Failed to read the data exiting.\n"); return (1); } - /* Sort the S3 data records */ - sort(s3data, ns3data, sizeof(s3datarec_t), s3datarec_compare, NULL); result = validate_identity(); @@ -425,7 +365,7 @@ int prism2_fwapply(char *rfptr, int rfsize, wlandevice_t * wlandev) * 0 success * ~0 failure ----------------------------------------------------------------*/ -int crcimage(imgchunk_t * fchunk, unsigned int nfchunks, s3crcrec_t * s3crc, +int crcimage(imgchunk_t *fchunk, unsigned int nfchunks, s3crcrec_t *s3crc, unsigned int ns3crc) { int result = 0; @@ -490,7 +430,7 @@ int crcimage(imgchunk_t * fchunk, unsigned int nfchunks, s3crcrec_t * s3crc, * Returns: * nothing ----------------------------------------------------------------*/ -void free_chunks(imgchunk_t * fchunk, unsigned int *nfchunks) +void free_chunks(imgchunk_t *fchunk, unsigned int *nfchunks) { int i; for (i = 0; i < *nfchunks; i++) { @@ -516,10 +456,6 @@ void free_chunks(imgchunk_t * fchunk, unsigned int *nfchunks) ----------------------------------------------------------------*/ void free_srecs(void) { - int i; - for (i = 0; i < ns3data; i++) { - kfree(s3data[i].data); - } ns3data = 0; memset(s3data, 0, sizeof(s3data)); ns3plug = 0; @@ -545,7 +481,7 @@ void free_srecs(void) * 0 - success * ~0 - failure (probably an errno) ----------------------------------------------------------------*/ -int mkimage(imgchunk_t * clist, unsigned int *ccnt) +int mkimage(imgchunk_t *clist, unsigned int *ccnt) { int result = 0; int i; @@ -598,10 +534,6 @@ int mkimage(imgchunk_t * clist, unsigned int *ccnt) return (1); } memset(clist[i].data, 0, clist[i].len); - } - - /* Display chunks */ - for (i = 0; i < *ccnt; i++) { pr_debug("chunk[%d]: addr=0x%06x len=%d\n", i, clist[i].addr, clist[i].len); } @@ -644,7 +576,7 @@ int mkimage(imgchunk_t * clist, unsigned int *ccnt) * 0 - success * ~0 - failure (probably an errno) ----------------------------------------------------------------*/ -int mkpdrlist(pda_t * pda) +int mkpdrlist(pda_t *pda) { int result = 0; u16 *pda16 = (u16 *) pda->buf; @@ -717,8 +649,8 @@ int mkpdrlist(pda_t * pda) * 0 success * ~0 failure ----------------------------------------------------------------*/ -int plugimage(imgchunk_t * fchunk, unsigned int nfchunks, - s3plugrec_t * s3plug, unsigned int ns3plug, pda_t * pda) +int plugimage(imgchunk_t *fchunk, unsigned int nfchunks, + s3plugrec_t *s3plug, unsigned int ns3plug, pda_t * pda) { int result = 0; int i; /* plug index */ @@ -825,7 +757,7 @@ int plugimage(imgchunk_t * fchunk, unsigned int nfchunks, * 0 - success * ~0 - failure (probably an errno) ----------------------------------------------------------------*/ -int read_cardpda(pda_t * pda, wlandevice_t * wlandev) +int read_cardpda(pda_t *pda, wlandevice_t *wlandev) { int result = 0; p80211msg_p2req_readpda_t msg; @@ -856,44 +788,20 @@ int read_cardpda(pda_t * pda, wlandevice_t * wlandev) } /*---------------------------------------------------------------- -* copy_line +* read_fwfile * -* Copies a line of text, up to \n, \0, or SREC_LINE_MAX, or limit of -* From array +* Reads the given fw file which should have been compiled from an srec +* file. Each record in the fw file will either be a plain data record, +* a start address record, or other records used for plugging. * -* Arguments: -* from From addr -* to To addr -* limit Addr of last character in From array that can be copied -* -* Returns: -* Num characters copied -----------------------------------------------------------------*/ -int copyline(char *from, char *to, char *limit) -{ - int c = 0; - - while ((c < SREC_LINE_MAX - 1) && (from + c <= limit) && - (from[c] != '\n') && (from[c] != '\0')) { - to[c] = from[c]; - c++; - } - - to[c] = '\0'; - return (c < SREC_LINE_MAX - 1) ? c + 1 : c; -} - -/*---------------------------------------------------------------- -* read_srecfile +* Note that data records are expected to be sorted into +* ascending address order in the fw file. * -* Reads the given srecord file and loads the records into the -* s3xxx arrays. This function can be called repeatedly (once for -* each of a set of files), if necessary. This function performs -* no validation of the data except for the grossest of S-record -* line format checks. Don't forget that these will be DOS files... -* CR/LF at the end of each line. +* Note also that the start address record, originally an S7 record in +* the srec file, is expected in the fw file to be like a data record but +* with a certain address to make it identiable. * -* Here's the SREC format we're dealing with: +* Here's the SREC format that the fw should have come from: * S[37]nnaaaaaaaaddd...dddcc * * nn - number of bytes starting with the address field @@ -902,8 +810,9 @@ int copyline(char *from, char *to, char *limit) * cc - checksum * * The S7 record's (there should be only one) address value gets -* saved in startaddr. It's the start execution address used -* for RAM downloads. +* converted to an S3 record with address of 0xff400000, with the +* start address being stored as a 4 byte data word. That address is +* the start execution address used for RAM downloads. * * The S3 records have a collection of subformats indicated by the * value of aaaaaaaa: @@ -927,237 +836,124 @@ int copyline(char *from, char *to, char *limit) * d - (s - 1) little endian words giving the contents of * the given info type. * +* 0xff400000 - Start address record, data field format: +* aaaaaaaa +* a - Address in load image to plug (little endian) +* * Arguments: -* rfptr firmware image (s-record structure) in kernel memory -* rfsize firmware size in kernel memory +* record firmware image (ihex record structure) in kernel memory * * Returns: * 0 - success * ~0 - failure (probably an errno) ----------------------------------------------------------------*/ -int read_srecfile(char *rfptr, int rfsize) +int read_fwfile(const struct ihex_binrec *record) { - int result = 0; - char buf[SREC_LINE_MAX]; - char tmpbuf[30]; - s3datarec_t tmprec; - int i, c; - int line = 0; - u16 *tmpinfo; - char *endptr = rfptr + rfsize; - - pr_debug("Reading S-record file ...\n"); - - while ((c = copyline(rfptr, buf, endptr)) >= 12) { - rfptr = rfptr + c; - line++; - if (buf[0] != 'S') { - printk(KERN_ERR "%d warning: No initial \'S\'\n", line); - return 1; - } - if (buf[1] == '7') { /* S7 record, start address */ - buf[12] = '\0'; - startaddr = simple_strtoul(buf + 4, NULL, 16); - pr_debug(" S7 start addr, line=%d " - " addr=0x%08x\n", line, startaddr); - continue; - } else if (buf[1] == '3') { - /* Ok, it's an S3, parse and put it in the right array */ - /* Record Length field (we only want datalen) */ - memcpy(tmpbuf, buf + S3LEN_TXTOFFSET, S3LEN_TXTLEN); - tmpbuf[S3LEN_TXTLEN] = '\0'; - tmprec.len = simple_strtoul(tmpbuf, NULL, 16) - 4 - 1; /* 4=addr, 1=cksum */ - /* Address field */ - memcpy(tmpbuf, buf + S3ADDR_TXTOFFSET, S3ADDR_TXTLEN); - tmpbuf[S3ADDR_TXTLEN] = '\0'; - tmprec.addr = simple_strtoul(tmpbuf, NULL, 16); - /* Checksum field */ - tmprec.checksum = - simple_strtoul(buf + strlen(buf) - 2, NULL, 16); - - switch (tmprec.addr) { - case S3ADDR_PLUG: - memcpy(tmpbuf, buf + S3PLUG_ITEMCODE_TXTOFFSET, - S3PLUG_ITEMCODE_TXTLEN); - tmpbuf[S3PLUG_ITEMCODE_TXTLEN] = '\0'; - s3plug[ns3plug].itemcode = - simple_strtoul(tmpbuf, NULL, 16); - s3plug[ns3plug].itemcode = - bswap_32(s3plug[ns3plug].itemcode); - - memcpy(tmpbuf, buf + S3PLUG_ADDR_TXTOFFSET, - S3PLUG_ADDR_TXTLEN); - tmpbuf[S3PLUG_ADDR_TXTLEN] = '\0'; - s3plug[ns3plug].addr = - simple_strtoul(tmpbuf, NULL, 16); - s3plug[ns3plug].addr = - bswap_32(s3plug[ns3plug].addr); - - memcpy(tmpbuf, buf + S3PLUG_LEN_TXTOFFSET, - S3PLUG_LEN_TXTLEN); - tmpbuf[S3PLUG_LEN_TXTLEN] = '\0'; - s3plug[ns3plug].len = - simple_strtoul(tmpbuf, NULL, 16); - s3plug[ns3plug].len = - bswap_32(s3plug[ns3plug].len); - - pr_debug(" S3 plugrec, line=%d " - "itemcode=0x%04x addr=0x%08x len=%d\n", - line, - s3plug[ns3plug].itemcode, - s3plug[ns3plug].addr, - s3plug[ns3plug].len); - - ns3plug++; - if (ns3plug == S3PLUG_MAX) { - printk(KERN_ERR - "S3 plugrec limit reached - aborting\n"); - return 1; - } - break; - case S3ADDR_CRC: - memcpy(tmpbuf, buf + S3CRC_ADDR_TXTOFFSET, - S3CRC_ADDR_TXTLEN); - tmpbuf[S3CRC_ADDR_TXTLEN] = '\0'; - s3crc[ns3crc].addr = - simple_strtoul(tmpbuf, NULL, 16); - s3crc[ns3crc].addr = - bswap_32(s3crc[ns3crc].addr); - - memcpy(tmpbuf, buf + S3CRC_LEN_TXTOFFSET, - S3CRC_LEN_TXTLEN); - tmpbuf[S3CRC_LEN_TXTLEN] = '\0'; - s3crc[ns3crc].len = - simple_strtoul(tmpbuf, NULL, 16); - s3crc[ns3crc].len = bswap_32(s3crc[ns3crc].len); - - memcpy(tmpbuf, buf + S3CRC_DOWRITE_TXTOFFSET, - S3CRC_DOWRITE_TXTLEN); - tmpbuf[S3CRC_DOWRITE_TXTLEN] = '\0'; - s3crc[ns3crc].dowrite = - simple_strtoul(tmpbuf, NULL, 16); - s3crc[ns3crc].dowrite = - bswap_32(s3crc[ns3crc].dowrite); - - pr_debug(" S3 crcrec, line=%d " - "addr=0x%08x len=%d write=0x%08x\n", - line, - s3crc[ns3crc].addr, - s3crc[ns3crc].len, - s3crc[ns3crc].dowrite); - ns3crc++; - if (ns3crc == S3CRC_MAX) { - printk(KERN_ERR - "S3 crcrec limit reached - aborting\n"); - return 1; - } - break; - case S3ADDR_INFO: - memcpy(tmpbuf, buf + S3INFO_LEN_TXTOFFSET, - S3INFO_LEN_TXTLEN); - tmpbuf[S3INFO_LEN_TXTLEN] = '\0'; - s3info[ns3info].len = - simple_strtoul(tmpbuf, NULL, 16); - s3info[ns3info].len = - bswap_16(s3info[ns3info].len); - - memcpy(tmpbuf, buf + S3INFO_TYPE_TXTOFFSET, - S3INFO_TYPE_TXTLEN); - tmpbuf[S3INFO_TYPE_TXTLEN] = '\0'; - s3info[ns3info].type = - simple_strtoul(tmpbuf, NULL, 16); - s3info[ns3info].type = - bswap_16(s3info[ns3info].type); - - pr_debug(" S3 inforec, line=%d " - "len=0x%04x type=0x%04x\n", - line, - s3info[ns3info].len, - s3info[ns3info].type); - if (((s3info[ns3info].len - 1) * sizeof(u16)) > - sizeof(s3info[ns3info].info)) { - printk(KERN_ERR - " S3 inforec length too long - aborting\n"); - return 1; - } + int i; + int rcnt = 0; + u16 *tmpinfo; + u16 *ptr16; + u32 *ptr32, len, addr; - tmpinfo = - (u16 *) & (s3info[ns3info].info.version); - for (i = 0; i < s3info[ns3info].len - 1; i++) { - memcpy(tmpbuf, - buf + S3INFO_DATA_TXTOFFSET + - (i * 4), 4); - tmpbuf[4] = '\0'; - tmpinfo[i] = - simple_strtoul(tmpbuf, NULL, 16); - tmpinfo[i] = bswap_16(tmpinfo[i]); - } - pr_debug(" info="); - for (i = 0; i < s3info[ns3info].len - 1; i++) { - pr_debug("%04x ", tmpinfo[i]); - } - pr_debug("\n"); + pr_debug("Reading fw file ...\n"); - ns3info++; - if (ns3info == S3INFO_MAX) { - printk(KERN_ERR - "S3 inforec limit reached - aborting\n"); - return 1; - } - break; - default: /* Data record */ - s3data[ns3data].addr = tmprec.addr; - s3data[ns3data].len = tmprec.len; - s3data[ns3data].checksum = tmprec.checksum; - s3data[ns3data].data = - kmalloc(tmprec.len, GFP_KERNEL); - for (i = 0; i < tmprec.len; i++) { - memcpy(tmpbuf, - buf + S3DATA_TXTOFFSET + (i * 2), - 2); - tmpbuf[2] = '\0'; - s3data[ns3data].data[i] = - simple_strtoul(tmpbuf, NULL, 16); - } - ns3data++; - if (ns3data == S3DATA_MAX) { - printk(KERN_ERR - "S3 datarec limit reached - aborting\n"); - return 1; - } - break; + while (record) { + + rcnt++; + + len = be16_to_cpu(record->len); + addr = be32_to_cpu(record->addr); + + /* Point into data for different word lengths */ + ptr32 = (u32 *) record->data; + ptr16 = (u16 *) record->data; + + /* parse what was an S3 srec and put it in the right array */ + switch(addr) { + case S3ADDR_START: + startaddr = *ptr32; + pr_debug(" S7 start addr, record=%d " + " addr=0x%08x\n", + rcnt, + startaddr); + break; + case S3ADDR_PLUG: + s3plug[ns3plug].itemcode = *ptr32; + s3plug[ns3plug].addr = *(ptr32 + 1); + s3plug[ns3plug].len = *(ptr32 + 2); + + pr_debug(" S3 plugrec, record=%d " + "itemcode=0x%08x addr=0x%08x len=%d\n", + rcnt, + s3plug[ns3plug].itemcode, + s3plug[ns3plug].addr, + s3plug[ns3plug].len); + + ns3plug++; + if ( ns3plug == S3PLUG_MAX ) { + printk(KERN_ERR "S3 plugrec limit reached - aborting\n"); + return 1; } - } else { - printk(KERN_WARNING - "%d warning: Unknown S-record detected.\n", - line); + break; + case S3ADDR_CRC: + s3crc[ns3crc].addr = *ptr32; + s3crc[ns3crc].len = *(ptr32 + 1); + s3crc[ns3crc].dowrite = *(ptr32 + 2); + + pr_debug(" S3 crcrec, record=%d " + "addr=0x%08x len=%d write=0x%08x\n", + rcnt, + s3crc[ns3crc].addr, + s3crc[ns3crc].len, + s3crc[ns3crc].dowrite); + ns3crc++; + if ( ns3crc == S3CRC_MAX ) { + printk(KERN_ERR "S3 crcrec limit reached - aborting\n"); + return 1; + } + break; + case S3ADDR_INFO: + s3info[ns3info].len = *ptr16; + s3info[ns3info].type = *(ptr16 + 1); + + pr_debug(" S3 inforec, record=%d " + "len=0x%04x type=0x%04x\n", + rcnt, + s3info[ns3info].len, + s3info[ns3info].type); + if ( ((s3info[ns3info].len - 1) * sizeof(u16)) > sizeof(s3info[ns3info].info) ) { + printk(KERN_ERR " S3 inforec length too long - aborting\n"); + return 1; + } + + tmpinfo = (u16*)&(s3info[ns3info].info.version); + pr_debug(" info="); + for (i = 0; i < s3info[ns3info].len - 1; i++) { + tmpinfo[i] = *(ptr16 + 2 + i); + pr_debug("%04x ", tmpinfo[i]); + } + pr_debug("\n"); + + ns3info++; + if ( ns3info == S3INFO_MAX ) { + printk(KERN_ERR "S3 inforec limit reached - aborting\n"); + return 1; + } + break; + default: /* Data record */ + s3data[ns3data].addr = addr; + s3data[ns3data].len = len; + s3data[ns3data].data = (uint8_t *) record->data; + ns3data++; + if ( ns3data == S3DATA_MAX ) { + printk(KERN_ERR "S3 datarec limit reached - aborting\n"); + return 1; + } + break; } + record = ihex_next_binrec(record); } - return result; -} - -/*---------------------------------------------------------------- -* s3datarec_compare -* -* Comparison function for sort(). -* -* Arguments: -* p1 ptr to the first item -* p2 ptr to the second item -* Returns: -* 0 items are equal -* <0 p1 < p2 -* >0 p1 > p2 -----------------------------------------------------------------*/ -int s3datarec_compare(const void *p1, const void *p2) -{ - const s3datarec_t *s1 = p1; - const s3datarec_t *s2 = p2; - if (s1->addr == s2->addr) - return 0; - if (s1->addr < s2->addr) - return -1; - return 1; + return 0; } /*---------------------------------------------------------------- @@ -1175,7 +971,7 @@ int s3datarec_compare(const void *p1, const void *p2) * 0 success * ~0 failure ----------------------------------------------------------------*/ -int writeimage(wlandevice_t * wlandev, imgchunk_t * fchunk, +int writeimage(wlandevice_t *wlandev, imgchunk_t *fchunk, unsigned int nfchunks) { int result = 0; @@ -1316,6 +1112,7 @@ int validate_identity(void) { int i; int result = 1; + int trump = 0; pr_debug("NIC ID: %#x v%d.%d.%d\n", nicid.id, nicid.major, nicid.minor, nicid.variant); @@ -1389,8 +1186,7 @@ int validate_identity(void) (nicid.id != 0x8008)) continue; - if (result != 2) - result = 0; + trump = 1; break; case 0x8001: pr_debug("name inforec len %d\n", s3info[i].len); @@ -1402,5 +1198,6 @@ int validate_identity(void) } // walk through + if (trump && (result != 2)) result = 0; return result; } diff --git a/drivers/staging/wlan-ng/prism2mgmt.c b/drivers/staging/wlan-ng/prism2mgmt.c index 465457653eb3..9f7d96cae8e3 100644 --- a/drivers/staging/wlan-ng/prism2mgmt.c +++ b/drivers/staging/wlan-ng/prism2mgmt.c @@ -73,9 +73,6 @@ #include <linux/usb.h> #include <linux/bitops.h> -/*================================================================*/ -/* Project Includes */ - #include "p80211types.h" #include "p80211hdr.h" #include "p80211mgmt.h" @@ -117,7 +114,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 +359,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 +508,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; @@ -688,7 +685,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 +751,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 +807,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 +869,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 +940,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 +1001,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; @@ -1075,7 +1072,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; diff --git a/drivers/staging/wlan-ng/prism2mib.c b/drivers/staging/wlan-ng/prism2mib.c index f930254e1b34..2fff0a110bcb 100644 --- a/drivers/staging/wlan-ng/prism2mib.c +++ b/drivers/staging/wlan-ng/prism2mib.c @@ -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, + 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; @@ -372,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; @@ -422,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; @@ -469,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; @@ -526,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; @@ -576,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; @@ -622,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; @@ -661,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; @@ -710,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; @@ -764,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); @@ -785,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); } @@ -805,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); @@ -826,7 +826,7 @@ 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); diff --git a/drivers/staging/wlan-ng/prism2sta.c b/drivers/staging/wlan-ng/prism2sta.c index f493cf430db8..50f301d65212 100644 --- a/drivers/staging/wlan-ng/prism2sta.c +++ b/drivers/staging/wlan-ng/prism2sta.c @@ -71,9 +71,6 @@ #include <linux/if_ether.h> #include <linux/bitops.h> -/*================================================================*/ -/* Project Includes */ - #include "p80211types.h" #include "p80211hdr.h" #include "p80211mgmt.h" @@ -115,7 +112,7 @@ static wlandevice_t *create_wlan(void); int prism2_reset_holdtime = 30; /* Reset hold time in ms */ int prism2_reset_settletime = 100; /* Reset settle time in ms */ -static int prism2_doreset = 0; /* Do a reset at init? */ +static int prism2_doreset; /* Do a reset at init? */ module_param(prism2_doreset, int, 0644); MODULE_PARM_DESC(prism2_doreset, "Issue a reset on initialization"); @@ -127,37 +124,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 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 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); /*---------------------------------------------------------------- * prism2sta_open @@ -180,7 +177,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 +211,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 +239,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 +265,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 +307,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; @@ -437,7 +434,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; @@ -455,7 +452,8 @@ u32 prism2sta_ifstate(wlandevice_t * wlandev, u32 ifstate) * Initialize the device+driver sufficiently * for firmware loading. */ - if ((result = hfa384x_drvr_start(hw))) { + result = hfa384x_drvr_start(hw); + if (result) { printk(KERN_ERR "hfa384x_drvr_start() failed," "result=%d\n", (int)result); @@ -499,7 +497,8 @@ u32 prism2sta_ifstate(wlandevice_t * wlandev, u32 ifstate) * can't make any assumptions about the state * of the hardware or a previous firmware load. */ - if ((result = hfa384x_drvr_start(hw))) { + result = hfa384x_drvr_start(hw); + if (result) { printk(KERN_ERR "hfa384x_drvr_start() failed," "result=%d\n", (int)result); @@ -509,7 +508,8 @@ u32 prism2sta_ifstate(wlandevice_t * wlandev, u32 ifstate) break; } - if ((result = prism2sta_getcardinfo(wlandev))) { + result = prism2sta_getcardinfo(wlandev); + if (result) { printk(KERN_ERR "prism2sta_getcardinfo() failed," "result=%d\n", (int)result); @@ -519,7 +519,8 @@ u32 prism2sta_ifstate(wlandevice_t * wlandev, u32 ifstate) wlandev->msdstate = WLAN_MSD_HWPRESENT; break; } - if ((result = prism2sta_globalsetup(wlandev))) { + result = prism2sta_globalsetup(wlandev); + if (result) { printk(KERN_ERR "prism2sta_globalsetup() failed," "result=%d\n", (int)result); @@ -607,7 +608,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; @@ -931,7 +932,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; @@ -940,7 +941,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; @@ -981,8 +982,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; @@ -1005,8 +1006,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; @@ -1053,8 +1054,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; @@ -1111,8 +1112,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; @@ -1153,8 +1154,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; @@ -1443,9 +1444,7 @@ void prism2sta_processing_defer(struct work_struct *data) } wlandev->linkstatus = (hw->link_status == HFA384x_LINK_CONNECTED); -#ifdef WIRELESS_EXT p80211wext_event_associated(wlandev, wlandev->linkstatus); -#endif failed: return; @@ -1468,8 +1467,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; @@ -1498,8 +1497,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; @@ -1560,8 +1559,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; @@ -1575,8 +1574,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; @@ -1749,8 +1748,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; @@ -1776,7 +1775,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 */ @@ -1844,7 +1843,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); @@ -1867,7 +1866,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 */ @@ -1891,7 +1890,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; @@ -1913,7 +1912,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; diff --git a/drivers/staging/wlan-ng/prism2usb.c b/drivers/staging/wlan-ng/prism2usb.c index 7aa703ce9dd4..9dde68be8d74 100644 --- a/drivers/staging/wlan-ng/prism2usb.c +++ b/drivers/staging/wlan-ng/prism2usb.c @@ -4,9 +4,9 @@ #include "prism2sta.c" #include "prism2fw.c" -#define PRISM_USB_DEVICE(vid, pid, name) \ - USB_DEVICE(vid, pid), \ - .driver_info = (unsigned long) name +#define PRISM_USB_DEVICE(vid, pid, name) \ + USB_DEVICE(vid, pid), \ + .driver_info = (unsigned long) name static struct usb_device_id usb_prism_tbl[] = { {PRISM_USB_DEVICE(0x04bb, 0x0922, "IOData AirPort WN-B11/USBS")}, @@ -111,8 +111,8 @@ static int prism2sta_probe_usb(struct usb_interface *interface, int result = 0; dev = interface_to_usbdev(interface); - - if ((wlandev = create_wlan()) == NULL) { + wlandev = create_wlan(); + if (wlandev == NULL) { printk(KERN_ERR "%s: Memory allocation failure.\n", dev_info); result = -EIO; goto failed; |