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

Staging: wlan-ng: hfa384x.h: Coding style cleanups

Signed-off-by: default avatarMoritz Muehlenhoff <jmm@debian.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 2407486b
...@@ -56,21 +56,19 @@ ...@@ -56,21 +56,19 @@
#ifndef _HFA384x_H #ifndef _HFA384x_H
#define _HFA384x_H #define _HFA384x_H
/*=============================================================*/ #define HFA384x_FIRMWARE_VERSION(a, b, c) (((a) << 16) + ((b) << 8) + (c))
#define HFA384x_FIRMWARE_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
#include <linux/if_ether.h> #include <linux/if_ether.h>
/*------ Constants --------------------------------------------*/
/*--- Mins & Maxs -----------------------------------*/ /*--- Mins & Maxs -----------------------------------*/
#define HFA384x_PORTID_MAX ((u16)7) #define HFA384x_PORTID_MAX ((u16)7)
#define HFA384x_NUMPORTS_MAX ((u16)(HFA384x_PORTID_MAX+1)) #define HFA384x_NUMPORTS_MAX ((u16)(HFA384x_PORTID_MAX+1))
#define HFA384x_PDR_LEN_MAX ((u16)512) /* in bytes, from EK */ #define HFA384x_PDR_LEN_MAX ((u16)512) /* in bytes, from EK */
#define HFA384x_PDA_LEN_MAX ((u16)1024) /* in bytes, from EK */ #define HFA384x_PDA_LEN_MAX ((u16)1024) /* in bytes, from EK */
#define HFA384x_SCANRESULT_MAX ((u16)31) #define HFA384x_SCANRESULT_MAX ((u16)31)
#define HFA384x_HSCANRESULT_MAX ((u16)31) #define HFA384x_HSCANRESULT_MAX ((u16)31)
#define HFA384x_CHINFORESULT_MAX ((u16)16) #define HFA384x_CHINFORESULT_MAX ((u16)16)
#define HFA384x_RID_GUESSING_MAXLEN 2048 /* I'm not really sure */ #define HFA384x_RID_GUESSING_MAXLEN 2048 /* I'm not really sure */
#define HFA384x_RIDDATA_MAXLEN HFA384x_RID_GUESSING_MAXLEN #define HFA384x_RIDDATA_MAXLEN HFA384x_RID_GUESSING_MAXLEN
#define HFA384x_USB_RWMEM_MAXLEN 2048 #define HFA384x_USB_RWMEM_MAXLEN 2048
...@@ -109,13 +107,14 @@ ...@@ -109,13 +107,14 @@
#define HFA384x_ADDR_FLAT_CMD_PAGE_MASK (0xffff0000) #define HFA384x_ADDR_FLAT_CMD_PAGE_MASK (0xffff0000)
#define HFA384x_ADDR_FLAT_CMD_OFF_MASK (0x0000ffff) #define HFA384x_ADDR_FLAT_CMD_OFF_MASK (0x0000ffff)
/* Mask bits for discarding unwanted pieces in AUX format 16-bit address parts */ /* Mask bits for discarding unwanted pieces in AUX format
16-bit address parts */
#define HFA384x_ADDR_AUX_PAGE_MASK (0xffff) #define HFA384x_ADDR_AUX_PAGE_MASK (0xffff)
#define HFA384x_ADDR_AUX_OFF_MASK (0x007f) #define HFA384x_ADDR_AUX_OFF_MASK (0x007f)
/* Make a 32-bit flat address from AUX format 16-bit page and offset */ /* Make a 32-bit flat address from AUX format 16-bit page and offset */
#define HFA384x_ADDR_AUX_MKFLAT(p,o) \ #define HFA384x_ADDR_AUX_MKFLAT(p, o) \
(((u32)(((u16)(p))&HFA384x_ADDR_AUX_PAGE_MASK)) <<7) | \ (((u32)(((u16)(p))&HFA384x_ADDR_AUX_PAGE_MASK)) << 7) | \
((u32)(((u16)(o))&HFA384x_ADDR_AUX_OFF_MASK)) ((u32)(((u16)(o))&HFA384x_ADDR_AUX_OFF_MASK))
/* Make CMD format offset and page from a 32-bit flat address */ /* Make CMD format offset and page from a 32-bit flat address */
...@@ -124,7 +123,6 @@ ...@@ -124,7 +123,6 @@
#define HFA384x_ADDR_CMD_MKOFF(f) \ #define HFA384x_ADDR_CMD_MKOFF(f) \
((u16)(((u32)(f))&HFA384x_ADDR_FLAT_CMD_OFF_MASK)) ((u16)(((u32)(f))&HFA384x_ADDR_FLAT_CMD_OFF_MASK))
/*--- Controller Memory addresses -------------------*/ /*--- Controller Memory addresses -------------------*/
#define HFA3842_PDA_BASE (0x007f0000UL) #define HFA3842_PDA_BASE (0x007f0000UL)
#define HFA3841_PDA_BASE (0x003f0000UL) #define HFA3841_PDA_BASE (0x003f0000UL)
...@@ -265,15 +263,15 @@ API ENHANCEMENTS (NOT ALREADY IMPLEMENTED) ...@@ -265,15 +263,15 @@ API ENHANCEMENTS (NOT ALREADY IMPLEMENTED)
#define HFA384x_RID_CNFAUTHENTICATION ((u16)0xFC2A) #define HFA384x_RID_CNFAUTHENTICATION ((u16)0xFC2A)
#define HFA384x_RID_CNFROAMINGMODE ((u16)0xFC2D) #define HFA384x_RID_CNFROAMINGMODE ((u16)0xFC2D)
#define HFA384x_RID_CNFAPBCNint ((u16)0xFC33) #define HFA384x_RID_CNFAPBCNint ((u16)0xFC33)
#define HFA384x_RID_CNFDBMADJUST ((u16)0xFC46) // NEW #define HFA384x_RID_CNFDBMADJUST ((u16)0xFC46)
#define HFA384x_RID_CNFWPADATA ((u16)0xFC48) // 1.7.0 #define HFA384x_RID_CNFWPADATA ((u16)0xFC48)
#define HFA384x_RID_CNFBASICRATES ((u16)0xFCB3) #define HFA384x_RID_CNFBASICRATES ((u16)0xFCB3)
#define HFA384x_RID_CNFSUPPRATES ((u16)0xFCB4) #define HFA384x_RID_CNFSUPPRATES ((u16)0xFCB4)
#define HFA384x_RID_CNFPASSIVESCANCTRL ((u16)0xFCBA) // NEW STA #define HFA384x_RID_CNFPASSIVESCANCTRL ((u16)0xFCBA)
#define HFA384x_RID_TXPOWERMAX ((u16)0xFCBE) // 1.7.0/1.4.0 #define HFA384x_RID_TXPOWERMAX ((u16)0xFCBE)
#define HFA384x_RID_JOINREQUEST ((u16)0xFCE2) #define HFA384x_RID_JOINREQUEST ((u16)0xFCE2)
#define HFA384x_RID_AUTHENTICATESTA ((u16)0xFCE3) #define HFA384x_RID_AUTHENTICATESTA ((u16)0xFCE3)
#define HFA384x_RID_HOSTSCAN ((u16)0xFCE5) // NEW STA #define HFA384x_RID_HOSTSCAN ((u16)0xFCE5)
#define HFA384x_RID_CNFWEPDEFAULTKEY_LEN ((u16)6) #define HFA384x_RID_CNFWEPDEFAULTKEY_LEN ((u16)6)
#define HFA384x_RID_CNFWEP128DEFAULTKEY_LEN ((u16)14) #define HFA384x_RID_CNFWEP128DEFAULTKEY_LEN ((u16)14)
...@@ -321,10 +319,6 @@ PD Record codes ...@@ -321,10 +319,6 @@ PD Record codes
#define HFA384x_PDR_HFA3861_MANF_TESTI ((u16)0x0901) #define HFA384x_PDR_HFA3861_MANF_TESTI ((u16)0x0901)
#define HFA384x_PDR_END_OF_PDA ((u16)0x0000) #define HFA384x_PDR_END_OF_PDA ((u16)0x0000)
/*=============================================================*/
/*------ Macros -----------------------------------------------*/
/*--- Register Test/Get/Set Field macros ------------------------*/ /*--- Register Test/Get/Set Field macros ------------------------*/
#define HFA384x_CMD_AINFO_SET(value) ((u16)((u16)(value) << 8)) #define HFA384x_CMD_AINFO_SET(value) ((u16)((u16)(value) << 8))
...@@ -347,22 +341,17 @@ PD Record codes ...@@ -347,22 +341,17 @@ PD Record codes
#define HFA384x_STATE_INIT 1 #define HFA384x_STATE_INIT 1
#define HFA384x_STATE_RUNNING 2 #define HFA384x_STATE_RUNNING 2
/*=============================================================*/
/*------ Types and their related constants --------------------*/
/*-------------------------------------------------------------*/ /*-------------------------------------------------------------*/
/* Commonly used basic types */ /* Commonly used basic types */
typedef struct hfa384x_bytestr typedef struct hfa384x_bytestr {
{ u16 len;
u16 len; u8 data[0];
u8 data[0]; } __attribute__ ((packed)) hfa384x_bytestr_t;
} __attribute__((packed)) hfa384x_bytestr_t;
typedef struct hfa384x_bytestr32 typedef struct hfa384x_bytestr32 {
{ u16 len;
u16 len; u8 data[32];
u8 data[32]; } __attribute__ ((packed)) hfa384x_bytestr32_t;
} __attribute__((packed)) hfa384x_bytestr32_t;
/*-------------------------------------------------------------------- /*--------------------------------------------------------------------
Configuration Record Structures: Configuration Record Structures:
...@@ -370,22 +359,20 @@ Configuration Record Structures: ...@@ -370,22 +359,20 @@ Configuration Record Structures:
--------------------------------------------------------------------*/ --------------------------------------------------------------------*/
/*-- Hardware/Firmware Component Information ----------*/ /*-- Hardware/Firmware Component Information ----------*/
typedef struct hfa384x_compident typedef struct hfa384x_compident {
{ u16 id;
u16 id; u16 variant;
u16 variant; u16 major;
u16 major; u16 minor;
u16 minor; } __attribute__ ((packed)) hfa384x_compident_t;
} __attribute__((packed)) hfa384x_compident_t;
typedef struct hfa384x_caplevel {
typedef struct hfa384x_caplevel u16 role;
{ u16 id;
u16 role; u16 variant;
u16 id; u16 bottom;
u16 variant; u16 top;
u16 bottom; } __attribute__ ((packed)) hfa384x_caplevel_t;
u16 top;
} __attribute__((packed)) hfa384x_caplevel_t;
/*-- Configuration Record: cnfAuthentication --*/ /*-- Configuration Record: cnfAuthentication --*/
#define HFA384x_CNFAUTHENTICATION_OPENSYSTEM 0x0001 #define HFA384x_CNFAUTHENTICATION_OPENSYSTEM 0x0001
...@@ -400,34 +387,30 @@ Configuration Record Structures: ...@@ -400,34 +387,30 @@ Configuration Record Structures:
#define HFA384x_CREATEIBSS_JOINCREATEIBSS 0 #define HFA384x_CREATEIBSS_JOINCREATEIBSS 0
/*-- Configuration Record: HostScanRequest (data portion only) --*/ /*-- Configuration Record: HostScanRequest (data portion only) --*/
typedef struct hfa384x_HostScanRequest_data typedef struct hfa384x_HostScanRequest_data {
{ u16 channelList;
u16 channelList; u16 txRate;
u16 txRate;
hfa384x_bytestr32_t ssid; hfa384x_bytestr32_t ssid;
} __attribute__((packed)) hfa384x_HostScanRequest_data_t; } __attribute__ ((packed)) hfa384x_HostScanRequest_data_t;
/*-- Configuration Record: JoinRequest (data portion only) --*/ /*-- Configuration Record: JoinRequest (data portion only) --*/
typedef struct hfa384x_JoinRequest_data typedef struct hfa384x_JoinRequest_data {
{ u8 bssid[WLAN_BSSID_LEN];
u8 bssid[WLAN_BSSID_LEN]; u16 channel;
u16 channel; } __attribute__ ((packed)) hfa384x_JoinRequest_data_t;
} __attribute__((packed)) hfa384x_JoinRequest_data_t;
/*-- Configuration Record: authenticateStation (data portion only) --*/ /*-- Configuration Record: authenticateStation (data portion only) --*/
typedef struct hfa384x_authenticateStation_data typedef struct hfa384x_authenticateStation_data {
{ u8 address[ETH_ALEN];
u8 address[ETH_ALEN]; u16 status;
u16 status; u16 algorithm;
u16 algorithm; } __attribute__ ((packed)) hfa384x_authenticateStation_data_t;
} __attribute__((packed)) hfa384x_authenticateStation_data_t;
/*-- Configuration Record: WPAData (data portion only) --*/ /*-- Configuration Record: WPAData (data portion only) --*/
typedef struct hfa384x_WPAData typedef struct hfa384x_WPAData {
{ u16 datalen;
u16 datalen; u8 data[0]; // max 80
u8 data[0]; // max 80 } __attribute__ ((packed)) hfa384x_WPAData_t;
} __attribute__((packed)) hfa384x_WPAData_t;
/*-------------------------------------------------------------------- /*--------------------------------------------------------------------
Information Record Structures: NIC Information Information Record Structures: NIC Information
...@@ -435,12 +418,11 @@ Information Record Structures: NIC Information ...@@ -435,12 +418,11 @@ Information Record Structures: NIC Information
/*-- Information Record: DownLoadBuffer --*/ /*-- Information Record: DownLoadBuffer --*/
/* NOTE: The page and offset are in AUX format */ /* NOTE: The page and offset are in AUX format */
typedef struct hfa384x_downloadbuffer typedef struct hfa384x_downloadbuffer {
{ u16 page;
u16 page; u16 offset;
u16 offset; u16 len;
u16 len; } __attribute__ ((packed)) hfa384x_downloadbuffer_t;
} __attribute__((packed)) hfa384x_downloadbuffer_t;
/*-------------------------------------------------------------------- /*--------------------------------------------------------------------
Information Record Structures: NIC Information Information Record Structures: NIC Information
...@@ -449,20 +431,18 @@ Information Record Structures: NIC Information ...@@ -449,20 +431,18 @@ Information Record Structures: NIC Information
#define HFA384x_PSTATUS_CONN_IBSS ((u16)3) #define HFA384x_PSTATUS_CONN_IBSS ((u16)3)
/*-- Information Record: commsquality --*/ /*-- Information Record: commsquality --*/
typedef struct hfa384x_commsquality typedef struct hfa384x_commsquality {
{ u16 CQ_currBSS;
u16 CQ_currBSS; u16 ASL_currBSS;
u16 ASL_currBSS; u16 ANL_currFC;
u16 ANL_currFC; } __attribute__ ((packed)) hfa384x_commsquality_t;
} __attribute__((packed)) hfa384x_commsquality_t;
/*-- Information Record: dmbcommsquality --*/ /*-- Information Record: dmbcommsquality --*/
typedef struct hfa384x_dbmcommsquality typedef struct hfa384x_dbmcommsquality {
{ u16 CQdbm_currBSS;
u16 CQdbm_currBSS; u16 ASLdbm_currBSS;
u16 ASLdbm_currBSS; u16 ANLdbm_currFC;
u16 ANLdbm_currFC; } __attribute__ ((packed)) hfa384x_dbmcommsquality_t;
} __attribute__((packed)) hfa384x_dbmcommsquality_t;
/*-------------------------------------------------------------------- /*--------------------------------------------------------------------
FRAME STRUCTURES: Communication Frames FRAME STRUCTURES: Communication Frames
...@@ -470,33 +450,32 @@ FRAME STRUCTURES: Communication Frames ...@@ -470,33 +450,32 @@ FRAME STRUCTURES: Communication Frames
Communication Frames: Transmit Frames Communication Frames: Transmit Frames
--------------------------------------------------------------------*/ --------------------------------------------------------------------*/
/*-- Communication Frame: Transmit Frame Structure --*/ /*-- Communication Frame: Transmit Frame Structure --*/
typedef struct hfa384x_tx_frame typedef struct hfa384x_tx_frame {
{ u16 status;
u16 status; u16 reserved1;
u16 reserved1; u16 reserved2;
u16 reserved2; u32 sw_support;
u32 sw_support; u8 tx_retrycount;
u8 tx_retrycount; u8 tx_rate;
u8 tx_rate; u16 tx_control;
u16 tx_control;
/*-- 802.11 Header Information --*/ /*-- 802.11 Header Information --*/
u16 frame_control; u16 frame_control;
u16 duration_id; u16 duration_id;
u8 address1[6]; u8 address1[6];
u8 address2[6]; u8 address2[6];
u8 address3[6]; u8 address3[6];
u16 sequence_control; u16 sequence_control;
u8 address4[6]; u8 address4[6];
u16 data_len; /* little endian format */ u16 data_len; /* little endian format */
/*-- 802.3 Header Information --*/ /*-- 802.3 Header Information --*/
u8 dest_addr[6]; u8 dest_addr[6];
u8 src_addr[6]; u8 src_addr[6];
u16 data_length; /* big endian format */ u16 data_length; /* big endian format */
} __attribute__((packed)) hfa384x_tx_frame_t; } __attribute__ ((packed)) hfa384x_tx_frame_t;
/*-------------------------------------------------------------------- /*--------------------------------------------------------------------
Communication Frames: Field Masks for Transmit Frames Communication Frames: Field Masks for Transmit Frames
--------------------------------------------------------------------*/ --------------------------------------------------------------------*/
...@@ -521,7 +500,7 @@ Communication Frames: Test/Get/Set Field Values for Transmit Frames ...@@ -521,7 +500,7 @@ Communication Frames: Test/Get/Set Field Values for Transmit Frames
HFA384x_TXSTATUS_DISCON|HFA384x_TXSTATUS_AGEDERR|\ HFA384x_TXSTATUS_DISCON|HFA384x_TXSTATUS_AGEDERR|\
HFA384x_TXSTATUS_RETRYERR)) HFA384x_TXSTATUS_RETRYERR))
#define HFA384x_TX_SET(v,m,s) ((((u16)(v))<<((u16)(s)))&((u16)(m))) #define HFA384x_TX_SET(v, m, s) ((((u16)(v))<<((u16)(s)))&((u16)(m)))
#define HFA384x_TX_MACPORT_SET(v) HFA384x_TX_SET(v, HFA384x_TX_MACPORT, 8) #define HFA384x_TX_MACPORT_SET(v) HFA384x_TX_SET(v, HFA384x_TX_MACPORT, 8)
#define HFA384x_TX_STRUCTYPE_SET(v) HFA384x_TX_SET(v, HFA384x_TX_STRUCTYPE, 3) #define HFA384x_TX_STRUCTYPE_SET(v) HFA384x_TX_SET(v, HFA384x_TX_STRUCTYPE, 3)
...@@ -531,33 +510,32 @@ Communication Frames: Test/Get/Set Field Values for Transmit Frames ...@@ -531,33 +510,32 @@ Communication Frames: Test/Get/Set Field Values for Transmit Frames
Communication Frames: Receive Frames Communication Frames: Receive Frames
--------------------------------------------------------------------*/ --------------------------------------------------------------------*/
/*-- Communication Frame: Receive Frame Structure --*/ /*-- Communication Frame: Receive Frame Structure --*/
typedef struct hfa384x_rx_frame typedef struct hfa384x_rx_frame {
{
/*-- MAC rx descriptor (hfa384x byte order) --*/ /*-- MAC rx descriptor (hfa384x byte order) --*/
u16 status; u16 status;
u32 time; u32 time;
u8 silence; u8 silence;
u8 signal; u8 signal;
u8 rate; u8 rate;
u8 rx_flow; u8 rx_flow;
u16 reserved1; u16 reserved1;
u16 reserved2; u16 reserved2;
/*-- 802.11 Header Information (802.11 byte order) --*/ /*-- 802.11 Header Information (802.11 byte order) --*/
u16 frame_control; u16 frame_control;
u16 duration_id; u16 duration_id;
u8 address1[6]; u8 address1[6];
u8 address2[6]; u8 address2[6];
u8 address3[6]; u8 address3[6];
u16 sequence_control; u16 sequence_control;
u8 address4[6]; u8 address4[6];
u16 data_len; /* hfa384x (little endian) format */ u16 data_len; /* hfa384x (little endian) format */
/*-- 802.3 Header Information --*/ /*-- 802.3 Header Information --*/
u8 dest_addr[6]; u8 dest_addr[6];
u8 src_addr[6]; u8 src_addr[6];
u16 data_length; /* IEEE? (big endian) format */ u16 data_length; /* IEEE? (big endian) format */
} __attribute__((packed)) hfa384x_rx_frame_t; } __attribute__ ((packed)) hfa384x_rx_frame_t;
/*-------------------------------------------------------------------- /*--------------------------------------------------------------------
Communication Frames: Field Masks for Receive Frames Communication Frames: Field Masks for Receive Frames
--------------------------------------------------------------------*/ --------------------------------------------------------------------*/
...@@ -595,119 +573,108 @@ Information Frames: Notification Frame Structures ...@@ -595,119 +573,108 @@ Information Frames: Notification Frame Structures
--------------------------------------------------------------------*/ --------------------------------------------------------------------*/
/*-- Inquiry Frame, Diagnose: Communication Tallies --*/ /*-- Inquiry Frame, Diagnose: Communication Tallies --*/
typedef struct hfa384x_CommTallies16 typedef struct hfa384x_CommTallies16 {
{ u16 txunicastframes;
u16 txunicastframes; u16 txmulticastframes;
u16 txmulticastframes; u16 txfragments;
u16 txfragments; u16 txunicastoctets;
u16 txunicastoctets; u16 txmulticastoctets;
u16 txmulticastoctets; u16 txdeferredtrans;
u16 txdeferredtrans; u16 txsingleretryframes;
u16 txsingleretryframes; u16 txmultipleretryframes;
u16 txmultipleretryframes; u16 txretrylimitexceeded;
u16 txretrylimitexceeded; u16 txdiscards;
u16 txdiscards; u16 rxunicastframes;
u16 rxunicastframes; u16 rxmulticastframes;
u16 rxmulticastframes; u16 rxfragments;
u16 rxfragments; u16 rxunicastoctets;
u16 rxunicastoctets; u16 rxmulticastoctets;
u16 rxmulticastoctets; u16 rxfcserrors;
u16 rxfcserrors; u16 rxdiscardsnobuffer;
u16 rxdiscardsnobuffer; u16 txdiscardswrongsa;
u16 txdiscardswrongsa; u16 rxdiscardswepundecr;
u16 rxdiscardswepundecr; u16 rxmsginmsgfrag;
u16 rxmsginmsgfrag; u16 rxmsginbadmsgfrag;
u16 rxmsginbadmsgfrag; } __attribute__ ((packed)) hfa384x_CommTallies16_t;
} __attribute__((packed)) hfa384x_CommTallies16_t;
typedef struct hfa384x_CommTallies32 {
typedef struct hfa384x_CommTallies32 u32 txunicastframes;
{ u32 txmulticastframes;
u32 txunicastframes; u32 txfragments;
u32 txmulticastframes; u32 txunicastoctets;
u32 txfragments; u32 txmulticastoctets;
u32 txunicastoctets; u32 txdeferredtrans;
u32 txmulticastoctets; u32 txsingleretryframes;
u32 txdeferredtrans; u32 txmultipleretryframes;
u32 txsingleretryframes; u32 txretrylimitexceeded;
u32 txmultipleretryframes; u32 txdiscards;
u32 txretrylimitexceeded; u32 rxunicastframes;
u32 txdiscards; u32 rxmulticastframes;
u32 rxunicastframes; u32 rxfragments;
u32 rxmulticastframes; u32 rxunicastoctets;
u32 rxfragments; u32 rxmulticastoctets;
u32 rxunicastoctets; u32 rxfcserrors;
u32 rxmulticastoctets; u32 rxdiscardsnobuffer;
u32 rxfcserrors; u32 txdiscardswrongsa;
u32 rxdiscardsnobuffer; u32 rxdiscardswepundecr;
u32 txdiscardswrongsa; u32 rxmsginmsgfrag;
u32 rxdiscardswepundecr; u32 rxmsginbadmsgfrag;
u32 rxmsginmsgfrag; } __attribute__ ((packed)) hfa384x_CommTallies32_t;
u32 rxmsginbadmsgfrag;
} __attribute__((packed)) hfa384x_CommTallies32_t;
/*-- Inquiry Frame, Diagnose: Scan Results & Subfields--*/ /*-- Inquiry Frame, Diagnose: Scan Results & Subfields--*/
typedef struct hfa384x_ScanResultSub typedef struct hfa384x_ScanResultSub {
{ u16 chid;
u16 chid; u16 anl;
u16 anl; u16 sl;
u16 sl; u8 bssid[WLAN_BSSID_LEN];
u8 bssid[WLAN_BSSID_LEN]; u16 bcnint;
u16 bcnint; u16 capinfo;
u16 capinfo; hfa384x_bytestr32_t ssid;
hfa384x_bytestr32_t ssid; u8 supprates[10]; /* 802.11 info element */
u8 supprates[10]; /* 802.11 info element */ u16 proberesp_rate;
u16 proberesp_rate; } __attribute__ ((packed)) hfa384x_ScanResultSub_t;
} __attribute__((packed)) hfa384x_ScanResultSub_t;
typedef struct hfa384x_ScanResult {
typedef struct hfa384x_ScanResult u16 rsvd;
{ u16 scanreason;
u16 rsvd; hfa384x_ScanResultSub_t result[HFA384x_SCANRESULT_MAX];
u16 scanreason; } __attribute__ ((packed)) hfa384x_ScanResult_t;
hfa384x_ScanResultSub_t
result[HFA384x_SCANRESULT_MAX];
} __attribute__((packed)) hfa384x_ScanResult_t;
/*-- Inquiry Frame, Diagnose: ChInfo Results & Subfields--*/ /*-- Inquiry Frame, Diagnose: ChInfo Results & Subfields--*/
typedef struct hfa384x_ChInfoResultSub typedef struct hfa384x_ChInfoResultSub {
{ u16 chid;
u16 chid; u16 anl;
u16 anl; u16 pnl;
u16 pnl; u16 active;
u16 active; } __attribute__ ((packed)) hfa384x_ChInfoResultSub_t;
} __attribute__((packed)) hfa384x_ChInfoResultSub_t;
#define HFA384x_CHINFORESULT_BSSACTIVE BIT(0) #define HFA384x_CHINFORESULT_BSSACTIVE BIT(0)
#define HFA384x_CHINFORESULT_PCFACTIVE BIT(1) #define HFA384x_CHINFORESULT_PCFACTIVE BIT(1)
typedef struct hfa384x_ChInfoResult typedef struct hfa384x_ChInfoResult {
{ u16 scanchannels;
u16 scanchannels; hfa384x_ChInfoResultSub_t result[HFA384x_CHINFORESULT_MAX];
hfa384x_ChInfoResultSub_t } __attribute__ ((packed)) hfa384x_ChInfoResult_t;
result[HFA384x_CHINFORESULT_MAX];
} __attribute__((packed)) hfa384x_ChInfoResult_t;
/*-- Inquiry Frame, Diagnose: Host Scan Results & Subfields--*/ /*-- Inquiry Frame, Diagnose: Host Scan Results & Subfields--*/
typedef struct hfa384x_HScanResultSub typedef struct hfa384x_HScanResultSub {
{ u16 chid;
u16 chid; u16 anl;
u16 anl; u16 sl;
u16 sl; u8 bssid[WLAN_BSSID_LEN];
u8 bssid[WLAN_BSSID_LEN]; u16 bcnint;
u16 bcnint; u16 capinfo;
u16 capinfo; hfa384x_bytestr32_t ssid;
hfa384x_bytestr32_t ssid; u8 supprates[10]; /* 802.11 info element */
u8 supprates[10]; /* 802.11 info element */ u16 proberesp_rate;
u16 proberesp_rate; u16 atim;
u16 atim; } __attribute__ ((packed)) hfa384x_HScanResultSub_t;
} __attribute__((packed)) hfa384x_HScanResultSub_t;
typedef struct hfa384x_HScanResult {
typedef struct hfa384x_HScanResult u16 nresult;
{ u16 rsvd;
u16 nresult; hfa384x_HScanResultSub_t result[HFA384x_HSCANRESULT_MAX];
u16 rsvd; } __attribute__ ((packed)) hfa384x_HScanResult_t;
hfa384x_HScanResultSub_t
result[HFA384x_HSCANRESULT_MAX];
} __attribute__((packed)) hfa384x_HScanResult_t;
/*-- Unsolicited Frame, MAC Mgmt: LinkStatus --*/ /*-- Unsolicited Frame, MAC Mgmt: LinkStatus --*/
...@@ -719,11 +686,9 @@ typedef struct hfa384x_HScanResult ...@@ -719,11 +686,9 @@ typedef struct hfa384x_HScanResult
#define HFA384x_LINK_AP_INRANGE ((u16)5) #define HFA384x_LINK_AP_INRANGE ((u16)5)
#define HFA384x_LINK_ASSOCFAIL ((u16)6) #define HFA384x_LINK_ASSOCFAIL ((u16)6)
typedef struct hfa384x_LinkStatus typedef struct hfa384x_LinkStatus {
{ u16 linkstatus;
u16 linkstatus; } __attribute__ ((packed)) hfa384x_LinkStatus_t;
} __attribute__((packed)) hfa384x_LinkStatus_t;
/*-- Unsolicited Frame, MAC Mgmt: AssociationStatus (--*/ /*-- Unsolicited Frame, MAC Mgmt: AssociationStatus (--*/
...@@ -731,57 +696,52 @@ typedef struct hfa384x_LinkStatus ...@@ -731,57 +696,52 @@ typedef struct hfa384x_LinkStatus
#define HFA384x_ASSOCSTATUS_REASSOC ((u16)2) #define HFA384x_ASSOCSTATUS_REASSOC ((u16)2)
#define HFA384x_ASSOCSTATUS_AUTHFAIL ((u16)5) #define HFA384x_ASSOCSTATUS_AUTHFAIL ((u16)5)
typedef struct hfa384x_AssocStatus typedef struct hfa384x_AssocStatus {
{ u16 assocstatus;
u16 assocstatus; u8 sta_addr[ETH_ALEN];
u8 sta_addr[ETH_ALEN];
/* old_ap_addr is only valid if assocstatus == 2 */ /* old_ap_addr is only valid if assocstatus == 2 */
u8 old_ap_addr[ETH_ALEN]; u8 old_ap_addr[ETH_ALEN];
u16 reason; u16 reason;
u16 reserved; u16 reserved;
} __attribute__((packed)) hfa384x_AssocStatus_t; } __attribute__ ((packed)) hfa384x_AssocStatus_t;
/*-- Unsolicited Frame, MAC Mgmt: AuthRequest (AP Only) --*/ /*-- Unsolicited Frame, MAC Mgmt: AuthRequest (AP Only) --*/
typedef struct hfa384x_AuthRequest typedef struct hfa384x_AuthRequest {
{ u8 sta_addr[ETH_ALEN];
u8 sta_addr[ETH_ALEN]; u16 algorithm;
u16 algorithm; } __attribute__ ((packed)) hfa384x_AuthReq_t;
} __attribute__((packed)) hfa384x_AuthReq_t;
/*-- Unsolicited Frame, MAC Mgmt: PSUserCount (AP Only) --*/ /*-- Unsolicited Frame, MAC Mgmt: PSUserCount (AP Only) --*/
typedef struct hfa384x_PSUserCount typedef struct hfa384x_PSUserCount {
{ u16 usercnt;
u16 usercnt; } __attribute__ ((packed)) hfa384x_PSUserCount_t;
} __attribute__((packed)) hfa384x_PSUserCount_t;
typedef struct hfa384x_KeyIDChanged typedef struct hfa384x_KeyIDChanged {
{ u8 sta_addr[ETH_ALEN];
u8 sta_addr[ETH_ALEN]; u16 keyid;
u16 keyid; } __attribute__ ((packed)) hfa384x_KeyIDChanged_t;
} __attribute__((packed)) hfa384x_KeyIDChanged_t;
/*-- Collection of all Inf frames ---------------*/ /*-- Collection of all Inf frames ---------------*/
typedef union hfa384x_infodata { typedef union hfa384x_infodata {
hfa384x_CommTallies16_t commtallies16; hfa384x_CommTallies16_t commtallies16;
hfa384x_CommTallies32_t commtallies32; hfa384x_CommTallies32_t commtallies32;
hfa384x_ScanResult_t scanresult; hfa384x_ScanResult_t scanresult;
hfa384x_ChInfoResult_t chinforesult; hfa384x_ChInfoResult_t chinforesult;
hfa384x_HScanResult_t hscanresult; hfa384x_HScanResult_t hscanresult;
hfa384x_LinkStatus_t linkstatus; hfa384x_LinkStatus_t linkstatus;
hfa384x_AssocStatus_t assocstatus; hfa384x_AssocStatus_t assocstatus;
hfa384x_AuthReq_t authreq; hfa384x_AuthReq_t authreq;
hfa384x_PSUserCount_t psusercnt; hfa384x_PSUserCount_t psusercnt;
hfa384x_KeyIDChanged_t keyidchanged; hfa384x_KeyIDChanged_t keyidchanged;
} __attribute__((packed)) hfa384x_infodata_t; } __attribute__ ((packed)) hfa384x_infodata_t;
typedef struct hfa384x_InfFrame typedef struct hfa384x_InfFrame {
{ u16 framelen;
u16 framelen; u16 infotype;
u16 infotype; hfa384x_infodata_t info;
hfa384x_infodata_t info; } __attribute__ ((packed)) hfa384x_InfFrame_t;
} __attribute__((packed)) hfa384x_InfFrame_t;
/*-------------------------------------------------------------------- /*--------------------------------------------------------------------
USB Packet structures and constants. USB Packet structures and constants.
...@@ -811,137 +771,135 @@ USB Packet structures and constants. ...@@ -811,137 +771,135 @@ USB Packet structures and constants.
/* Request (bulk OUT) packet contents */ /* Request (bulk OUT) packet contents */
typedef struct hfa384x_usb_txfrm { typedef struct hfa384x_usb_txfrm {
hfa384x_tx_frame_t desc; hfa384x_tx_frame_t desc;
u8 data[WLAN_DATA_MAXLEN]; u8 data[WLAN_DATA_MAXLEN];
} __attribute__((packed)) hfa384x_usb_txfrm_t; } __attribute__ ((packed)) hfa384x_usb_txfrm_t;
typedef struct hfa384x_usb_cmdreq { typedef struct hfa384x_usb_cmdreq {
u16 type; u16 type;
u16 cmd; u16 cmd;
u16 parm0; u16 parm0;
u16 parm1; u16 parm1;
u16 parm2; u16 parm2;
u8 pad[54]; u8 pad[54];
} __attribute__((packed)) hfa384x_usb_cmdreq_t; } __attribute__ ((packed)) hfa384x_usb_cmdreq_t;
typedef struct hfa384x_usb_wridreq { typedef struct hfa384x_usb_wridreq {
u16 type; u16 type;
u16 frmlen; u16 frmlen;
u16 rid; u16 rid;
u8 data[HFA384x_RIDDATA_MAXLEN]; u8 data[HFA384x_RIDDATA_MAXLEN];
} __attribute__((packed)) hfa384x_usb_wridreq_t; } __attribute__ ((packed)) hfa384x_usb_wridreq_t;
typedef struct hfa384x_usb_rridreq { typedef struct hfa384x_usb_rridreq {
u16 type; u16 type;
u16 frmlen; u16 frmlen;
u16 rid; u16 rid;
u8 pad[58]; u8 pad[58];
} __attribute__((packed)) hfa384x_usb_rridreq_t; } __attribute__ ((packed)) hfa384x_usb_rridreq_t;
typedef struct hfa384x_usb_wmemreq { typedef struct hfa384x_usb_wmemreq {
u16 type; u16 type;
u16 frmlen; u16 frmlen;
u16 offset; u16 offset;
u16 page; u16 page;
u8 data[HFA384x_USB_RWMEM_MAXLEN]; u8 data[HFA384x_USB_RWMEM_MAXLEN];
} __attribute__((packed)) hfa384x_usb_wmemreq_t; } __attribute__ ((packed)) hfa384x_usb_wmemreq_t;
typedef struct hfa384x_usb_rmemreq { typedef struct hfa384x_usb_rmemreq {
u16 type; u16 type;
u16 frmlen; u16 frmlen;
u16 offset; u16 offset;
u16 page; u16 page;
u8 pad[56]; u8 pad[56];
} __attribute__((packed)) hfa384x_usb_rmemreq_t; } __attribute__ ((packed)) hfa384x_usb_rmemreq_t;
/*------------------------------------*/ /*------------------------------------*/
/* Response (bulk IN) packet contents */ /* Response (bulk IN) packet contents */
typedef struct hfa384x_usb_rxfrm { typedef struct hfa384x_usb_rxfrm {
hfa384x_rx_frame_t desc; hfa384x_rx_frame_t desc;
u8 data[WLAN_DATA_MAXLEN]; u8 data[WLAN_DATA_MAXLEN];
} __attribute__((packed)) hfa384x_usb_rxfrm_t; } __attribute__ ((packed)) hfa384x_usb_rxfrm_t;
typedef struct hfa384x_usb_infofrm { typedef struct hfa384x_usb_infofrm {
u16 type; u16 type;
hfa384x_InfFrame_t info; hfa384x_InfFrame_t info;
} __attribute__((packed)) hfa384x_usb_infofrm_t; } __attribute__ ((packed)) hfa384x_usb_infofrm_t;
typedef struct hfa384x_usb_statusresp { typedef struct hfa384x_usb_statusresp {
u16 type; u16 type;
u16 status; u16 status;
u16 resp0; u16 resp0;
u16 resp1; u16 resp1;
u16 resp2; u16 resp2;
} __attribute__((packed)) hfa384x_usb_cmdresp_t; } __attribute__ ((packed)) hfa384x_usb_cmdresp_t;
typedef hfa384x_usb_cmdresp_t hfa384x_usb_wridresp_t; typedef hfa384x_usb_cmdresp_t hfa384x_usb_wridresp_t;
typedef struct hfa384x_usb_rridresp { typedef struct hfa384x_usb_rridresp {
u16 type; u16 type;
u16 frmlen; u16 frmlen;
u16 rid; u16 rid;
u8 data[HFA384x_RIDDATA_MAXLEN]; u8 data[HFA384x_RIDDATA_MAXLEN];
} __attribute__((packed)) hfa384x_usb_rridresp_t; } __attribute__ ((packed)) hfa384x_usb_rridresp_t;
typedef hfa384x_usb_cmdresp_t hfa384x_usb_wmemresp_t; typedef hfa384x_usb_cmdresp_t hfa384x_usb_wmemresp_t;
typedef struct hfa384x_usb_rmemresp { typedef struct hfa384x_usb_rmemresp {
u16 type; u16 type;
u16 frmlen; u16 frmlen;
u8 data[HFA384x_USB_RWMEM_MAXLEN]; u8 data[HFA384x_USB_RWMEM_MAXLEN];
} __attribute__((packed)) hfa384x_usb_rmemresp_t; } __attribute__ ((packed)) hfa384x_usb_rmemresp_t;
typedef struct hfa384x_usb_bufavail { typedef struct hfa384x_usb_bufavail {
u16 type; u16 type;
u16 frmlen; u16 frmlen;
} __attribute__((packed)) hfa384x_usb_bufavail_t; } __attribute__ ((packed)) hfa384x_usb_bufavail_t;
typedef struct hfa384x_usb_error { typedef struct hfa384x_usb_error {
u16 type; u16 type;
u16 errortype; u16 errortype;
} __attribute__((packed)) hfa384x_usb_error_t; } __attribute__ ((packed)) hfa384x_usb_error_t;
/*----------------------------------------------------------*/ /*----------------------------------------------------------*/
/* Unions for packaging all the known packet types together */ /* Unions for packaging all the known packet types together */
typedef union hfa384x_usbout { typedef union hfa384x_usbout {
u16 type; u16 type;
hfa384x_usb_txfrm_t txfrm; hfa384x_usb_txfrm_t txfrm;
hfa384x_usb_cmdreq_t cmdreq; hfa384x_usb_cmdreq_t cmdreq;
hfa384x_usb_wridreq_t wridreq; hfa384x_usb_wridreq_t wridreq;
hfa384x_usb_rridreq_t rridreq; hfa384x_usb_rridreq_t rridreq;
hfa384x_usb_wmemreq_t wmemreq; hfa384x_usb_wmemreq_t wmemreq;
hfa384x_usb_rmemreq_t rmemreq; hfa384x_usb_rmemreq_t rmemreq;
} __attribute__((packed)) hfa384x_usbout_t; } __attribute__ ((packed)) hfa384x_usbout_t;
typedef union hfa384x_usbin { typedef union hfa384x_usbin {
u16 type; u16 type;
hfa384x_usb_rxfrm_t rxfrm; hfa384x_usb_rxfrm_t rxfrm;
hfa384x_usb_txfrm_t txfrm; hfa384x_usb_txfrm_t txfrm;
hfa384x_usb_infofrm_t infofrm; hfa384x_usb_infofrm_t infofrm;
hfa384x_usb_cmdresp_t cmdresp; hfa384x_usb_cmdresp_t cmdresp;
hfa384x_usb_wridresp_t wridresp; hfa384x_usb_wridresp_t wridresp;
hfa384x_usb_rridresp_t rridresp; hfa384x_usb_rridresp_t rridresp;
hfa384x_usb_wmemresp_t wmemresp; hfa384x_usb_wmemresp_t wmemresp;
hfa384x_usb_rmemresp_t rmemresp; hfa384x_usb_rmemresp_t rmemresp;
hfa384x_usb_bufavail_t bufavail; hfa384x_usb_bufavail_t bufavail;
hfa384x_usb_error_t usberror; hfa384x_usb_error_t usberror;
u8 boguspad[3000]; u8 boguspad[3000];
} __attribute__((packed)) hfa384x_usbin_t; } __attribute__ ((packed)) hfa384x_usbin_t;
#ifdef __KERNEL__ #ifdef __KERNEL__
/*-------------------------------------------------------------------- /*--------------------------------------------------------------------
--- MAC state structure, argument to all functions -- --- MAC state structure, argument to all functions --
--- Also, a collection of support types -- --- Also, a collection of support types --
--------------------------------------------------------------------*/ --------------------------------------------------------------------*/
typedef struct hfa384x_statusresult typedef struct hfa384x_statusresult {
{ u16 status;
u16 status; u16 resp0;
u16 resp0; u16 resp1;
u16 resp1; u16 resp2;
u16 resp2;
} hfa384x_cmdresult_t; } hfa384x_cmdresult_t;
/* USB Control Exchange (CTLX): /* USB Control Exchange (CTLX):
...@@ -951,17 +909,16 @@ typedef struct hfa384x_statusresult ...@@ -951,17 +909,16 @@ typedef struct hfa384x_statusresult
/* The following hfa384x_* structures are arguments to /* The following hfa384x_* structures are arguments to
* the usercb() for the different CTLX types. * the usercb() for the different CTLX types.
*/ */
typedef struct hfa384x_rridresult typedef struct hfa384x_rridresult {
{ u16 rid;
u16 rid; const void *riddata;
const void *riddata; unsigned int riddata_len;
unsigned int riddata_len;
} hfa384x_rridresult_t; } hfa384x_rridresult_t;
enum ctlx_state { enum ctlx_state {
CTLX_START = 0, /* Start state, not queued */ CTLX_START = 0, /* Start state, not queued */
CTLX_COMPLETE, /* CTLX successfully completed */ CTLX_COMPLETE, /* CTLX successfully completed */
CTLX_REQ_FAILED, /* OUT URB completed w/ error */ CTLX_REQ_FAILED, /* OUT URB completed w/ error */
CTLX_PENDING, /* Queued, data valid */ CTLX_PENDING, /* Queued, data valid */
...@@ -969,106 +926,98 @@ enum ctlx_state { ...@@ -969,106 +926,98 @@ enum ctlx_state {
CTLX_REQ_COMPLETE, /* OUT URB complete */ CTLX_REQ_COMPLETE, /* OUT URB complete */
CTLX_RESP_COMPLETE /* IN URB received */ CTLX_RESP_COMPLETE /* IN URB received */
}; };
typedef enum ctlx_state CTLX_STATE; typedef enum ctlx_state CTLX_STATE;
struct hfa384x_usbctlx; struct hfa384x_usbctlx;
struct hfa384x; struct hfa384x;
typedef void (*ctlx_cmdcb_t)( struct hfa384x*, const struct hfa384x_usbctlx* ); typedef void (*ctlx_cmdcb_t) (struct hfa384x *, const struct hfa384x_usbctlx *);
typedef void (*ctlx_usercb_t)( typedef void (*ctlx_usercb_t) (struct hfa384x *hw,
struct hfa384x *hw, void *ctlxresult, void *usercb_data);
void *ctlxresult,
void *usercb_data);
typedef struct hfa384x_usbctlx typedef struct hfa384x_usbctlx {
{ struct list_head list;
struct list_head list;
size_t outbufsize; size_t outbufsize;
hfa384x_usbout_t outbuf; /* pkt buf for OUT */ hfa384x_usbout_t outbuf; /* pkt buf for OUT */
hfa384x_usbin_t inbuf; /* pkt buf for IN(a copy) */ hfa384x_usbin_t inbuf; /* pkt buf for IN(a copy) */
CTLX_STATE state; /* Tracks running state */ CTLX_STATE state; /* Tracks running state */
struct completion done; struct completion done;
volatile int reapable; /* Food for the reaper task */ volatile int reapable; /* Food for the reaper task */
ctlx_cmdcb_t cmdcb; /* Async command callback */ ctlx_cmdcb_t cmdcb; /* Async command callback */
ctlx_usercb_t usercb; /* Async user callback, */ ctlx_usercb_t usercb; /* Async user callback, */
void *usercb_data; /* at CTLX completion */ void *usercb_data; /* at CTLX completion */
int variant; /* Identifies cmd variant */ int variant; /* Identifies cmd variant */
} hfa384x_usbctlx_t; } hfa384x_usbctlx_t;
typedef struct hfa384x_usbctlxq typedef struct hfa384x_usbctlxq {
{ spinlock_t lock;
spinlock_t lock; struct list_head pending;
struct list_head pending; struct list_head active;
struct list_head active; struct list_head completing;
struct list_head completing; struct list_head reapable;
struct list_head reapable;
} hfa384x_usbctlxq_t; } hfa384x_usbctlxq_t;
typedef struct hfa484x_metacmd typedef struct hfa484x_metacmd {
{ u16 cmd;
u16 cmd;
u16 parm0; u16 parm0;
u16 parm1; u16 parm1;
u16 parm2; u16 parm2;
hfa384x_cmdresult_t result; hfa384x_cmdresult_t result;
} hfa384x_metacmd_t; } hfa384x_metacmd_t;
#define MAX_GRP_ADDR 32 #define MAX_GRP_ADDR 32
#define WLAN_COMMENT_MAX 80 /* Max. length of user comment string. */ #define WLAN_COMMENT_MAX 80 /* Max. length of user comment string. */
#define WLAN_AUTH_MAX 60 /* Max. # of authenticated stations. */ #define WLAN_AUTH_MAX 60 /* Max. # of authenticated stations. */
#define WLAN_ACCESS_MAX 60 /* Max. # of stations in an access list. */ #define WLAN_ACCESS_MAX 60 /* Max. # of stations in an access list. */
#define WLAN_ACCESS_NONE 0 /* No stations may be authenticated. */ #define WLAN_ACCESS_NONE 0 /* No stations may be authenticated. */
#define WLAN_ACCESS_ALL 1 /* All stations may be authenticated. */ #define WLAN_ACCESS_ALL 1 /* All stations may be authenticated. */
#define WLAN_ACCESS_ALLOW 2 /* Authenticate only "allowed" stations. */ #define WLAN_ACCESS_ALLOW 2 /* Authenticate only "allowed" stations. */
#define WLAN_ACCESS_DENY 3 /* Do not authenticate "denied" stations. */ #define WLAN_ACCESS_DENY 3 /* Do not authenticate "denied" stations. */
/* XXX These are going away ASAP */ /* XXX These are going away ASAP */
typedef struct prism2sta_authlist typedef struct prism2sta_authlist {
{ unsigned int cnt;
unsigned int cnt; u8 addr[WLAN_AUTH_MAX][ETH_ALEN];
u8 addr[WLAN_AUTH_MAX][ETH_ALEN]; u8 assoc[WLAN_AUTH_MAX];
u8 assoc[WLAN_AUTH_MAX];
} prism2sta_authlist_t; } prism2sta_authlist_t;
typedef struct prism2sta_accesslist typedef struct prism2sta_accesslist {
{ unsigned int modify;
unsigned int modify; unsigned int cnt;
unsigned int cnt; u8 addr[WLAN_ACCESS_MAX][ETH_ALEN];
u8 addr[WLAN_ACCESS_MAX][ETH_ALEN]; unsigned int cnt1;
unsigned int cnt1; u8 addr1[WLAN_ACCESS_MAX][ETH_ALEN];
u8 addr1[WLAN_ACCESS_MAX][ETH_ALEN];
} prism2sta_accesslist_t; } prism2sta_accesslist_t;
typedef struct hfa384x typedef struct hfa384x {
{
/* USB support data */ /* USB support data */
struct usb_device *usb; struct usb_device *usb;
struct urb rx_urb; struct urb rx_urb;
struct sk_buff *rx_urb_skb; struct sk_buff *rx_urb_skb;
struct urb tx_urb; struct urb tx_urb;
struct urb ctlx_urb; struct urb ctlx_urb;
hfa384x_usbout_t txbuff; hfa384x_usbout_t txbuff;
hfa384x_usbctlxq_t ctlxq; hfa384x_usbctlxq_t ctlxq;
struct timer_list reqtimer; struct timer_list reqtimer;
struct timer_list resptimer; struct timer_list resptimer;
struct timer_list throttle; struct timer_list throttle;
struct tasklet_struct reaper_bh; struct tasklet_struct reaper_bh;
struct tasklet_struct completion_bh; struct tasklet_struct completion_bh;
struct work_struct usb_work; struct work_struct usb_work;
unsigned long usb_flags; unsigned long usb_flags;
#define THROTTLE_RX 0 #define THROTTLE_RX 0
#define THROTTLE_TX 1 #define THROTTLE_TX 1
#define WORK_RX_HALT 2 #define WORK_RX_HALT 2
...@@ -1076,223 +1025,175 @@ typedef struct hfa384x ...@@ -1076,223 +1025,175 @@ typedef struct hfa384x
#define WORK_RX_RESUME 4 #define WORK_RX_RESUME 4
#define WORK_TX_RESUME 5 #define WORK_TX_RESUME 5
unsigned short req_timer_done:1; unsigned short req_timer_done:1;
unsigned short resp_timer_done:1; unsigned short resp_timer_done:1;
int endp_in; int endp_in;
int endp_out; int endp_out;
int sniff_fcs; int sniff_fcs;
int sniff_channel; int sniff_channel;
int sniff_truncate; int sniff_truncate;
int sniffhdr; int sniffhdr;
wait_queue_head_t cmdq; /* wait queue itself */ wait_queue_head_t cmdq; /* wait queue itself */
/* Controller state */ /* Controller state */
u32 state; u32 state;
u32 isap; u32 isap;
u8 port_enabled[HFA384x_NUMPORTS_MAX]; u8 port_enabled[HFA384x_NUMPORTS_MAX];
/* Download support */ /* Download support */
unsigned int dlstate; unsigned int dlstate;
hfa384x_downloadbuffer_t bufinfo; hfa384x_downloadbuffer_t bufinfo;
u16 dltimeout; u16 dltimeout;
int scanflag; /* to signal scan comlete */ int scanflag; /* to signal scan comlete */
int join_ap; /* are we joined to a specific ap */ int join_ap; /* are we joined to a specific ap */
int join_retries; /* number of join retries till we fail */ int join_retries; /* number of join retries till we fail */
hfa384x_JoinRequest_data_t joinreq; /* join request saved data */ hfa384x_JoinRequest_data_t joinreq; /* join request saved data */
wlandevice_t *wlandev; wlandevice_t *wlandev;
/* Timer to allow for the deferred processing of linkstatus messages */ /* Timer to allow for the deferred processing of linkstatus messages */
struct work_struct link_bh; struct work_struct link_bh;
struct work_struct commsqual_bh; struct work_struct commsqual_bh;
hfa384x_commsquality_t qual; hfa384x_commsquality_t qual;
struct timer_list commsqual_timer; struct timer_list commsqual_timer;
u16 link_status; u16 link_status;
u16 link_status_new; u16 link_status_new;
struct sk_buff_head authq; struct sk_buff_head authq;
/* And here we have stuff that used to be in priv */ /* And here we have stuff that used to be in priv */
/* State variables */ /* State variables */
unsigned int presniff_port_type; unsigned int presniff_port_type;
u16 presniff_wepflags; u16 presniff_wepflags;
u32 dot11_desired_bss_type; u32 dot11_desired_bss_type;
int dbmadjust; int dbmadjust;
/* Group Addresses - right now, there are up to a total /* Group Addresses - right now, there are up to a total
of MAX_GRP_ADDR group addresses */ of MAX_GRP_ADDR group addresses */
u8 dot11_grp_addr[MAX_GRP_ADDR][ETH_ALEN]; u8 dot11_grp_addr[MAX_GRP_ADDR][ETH_ALEN];
unsigned int dot11_grpcnt; unsigned int dot11_grpcnt;
/* Component Identities */ /* Component Identities */
hfa384x_compident_t ident_nic; hfa384x_compident_t ident_nic;
hfa384x_compident_t ident_pri_fw; hfa384x_compident_t ident_pri_fw;
hfa384x_compident_t ident_sta_fw; hfa384x_compident_t ident_sta_fw;
hfa384x_compident_t ident_ap_fw; hfa384x_compident_t ident_ap_fw;
u16 mm_mods; u16 mm_mods;
/* Supplier compatibility ranges */ /* Supplier compatibility ranges */
hfa384x_caplevel_t cap_sup_mfi; hfa384x_caplevel_t cap_sup_mfi;
hfa384x_caplevel_t cap_sup_cfi; hfa384x_caplevel_t cap_sup_cfi;
hfa384x_caplevel_t cap_sup_pri; hfa384x_caplevel_t cap_sup_pri;
hfa384x_caplevel_t cap_sup_sta; hfa384x_caplevel_t cap_sup_sta;
hfa384x_caplevel_t cap_sup_ap; hfa384x_caplevel_t cap_sup_ap;
/* Actor compatibility ranges */ /* Actor compatibility ranges */
hfa384x_caplevel_t cap_act_pri_cfi; /* pri f/w to controller interface */ hfa384x_caplevel_t cap_act_pri_cfi; /* pri f/w to controller interface */
hfa384x_caplevel_t cap_act_sta_cfi; /* sta f/w to controller interface */ hfa384x_caplevel_t cap_act_sta_cfi; /* sta f/w to controller interface */
hfa384x_caplevel_t cap_act_sta_mfi; /* sta f/w to modem interface */ hfa384x_caplevel_t cap_act_sta_mfi; /* sta f/w to modem interface */
hfa384x_caplevel_t cap_act_ap_cfi; /* ap f/w to controller interface */ hfa384x_caplevel_t cap_act_ap_cfi; /* ap f/w to controller interface */
hfa384x_caplevel_t cap_act_ap_mfi; /* ap f/w to modem interface */ hfa384x_caplevel_t cap_act_ap_mfi; /* ap f/w to modem interface */
u32 psusercount; /* Power save user count. */ u32 psusercount; /* Power save user count. */
hfa384x_CommTallies32_t tallies; /* Communication tallies. */ hfa384x_CommTallies32_t tallies; /* Communication tallies. */
u8 comment[WLAN_COMMENT_MAX+1]; /* User comment */ u8 comment[WLAN_COMMENT_MAX + 1]; /* User comment */
/* Channel Info request results (AP only) */ /* Channel Info request results (AP only) */
struct { struct {
atomic_t done; atomic_t done;
u8 count; u8 count;
hfa384x_ChInfoResult_t results; hfa384x_ChInfoResult_t results;
} channel_info; } channel_info;
hfa384x_InfFrame_t *scanresults; hfa384x_InfFrame_t *scanresults;
prism2sta_authlist_t authlist; /* Authenticated station list. */
prism2sta_authlist_t authlist; /* Authenticated station list. */ unsigned int accessmode; /* Access mode. */
unsigned int accessmode; /* Access mode. */ prism2sta_accesslist_t allow; /* Allowed station list. */
prism2sta_accesslist_t allow; /* Allowed station list. */ prism2sta_accesslist_t deny; /* Denied station list. */
prism2sta_accesslist_t deny; /* Denied station list. */
} hfa384x_t; } hfa384x_t;
/*=============================================================*/ void hfa384x_create(hfa384x_t *hw, struct usb_device *usb);
/*--- Function Declarations -----------------------------------*/
/*=============================================================*/
void
hfa384x_create(
hfa384x_t *hw,
struct usb_device *usb);
void hfa384x_destroy(hfa384x_t *hw); void hfa384x_destroy(hfa384x_t *hw);
int int
hfa384x_corereset( hfa384x_t *hw, int holdtime, int settletime, int genesis); hfa384x_corereset(hfa384x_t *hw, int holdtime, int settletime, int genesis);
int int hfa384x_drvr_commtallies(hfa384x_t *hw);
hfa384x_drvr_commtallies( hfa384x_t *hw); int hfa384x_drvr_disable(hfa384x_t *hw, u16 macport);
int int hfa384x_drvr_enable(hfa384x_t *hw, u16 macport);
hfa384x_drvr_disable(hfa384x_t *hw, u16 macport); int hfa384x_drvr_flashdl_enable(hfa384x_t *hw);
int int hfa384x_drvr_flashdl_disable(hfa384x_t *hw);
hfa384x_drvr_enable(hfa384x_t *hw, u16 macport); int hfa384x_drvr_flashdl_write(hfa384x_t *hw, u32 daddr, void *buf, u32 len);
int int hfa384x_drvr_getconfig(hfa384x_t *hw, u16 rid, void *buf, u16 len);
hfa384x_drvr_flashdl_enable(hfa384x_t *hw); int hfa384x_drvr_handover(hfa384x_t *hw, u8 *addr);
int int hfa384x_drvr_ramdl_enable(hfa384x_t *hw, u32 exeaddr);
hfa384x_drvr_flashdl_disable(hfa384x_t *hw); int hfa384x_drvr_ramdl_disable(hfa384x_t *hw);
int int hfa384x_drvr_ramdl_write(hfa384x_t *hw, u32 daddr, void *buf, u32 len);
hfa384x_drvr_flashdl_write(hfa384x_t *hw, u32 daddr, void* buf, u32 len); int hfa384x_drvr_readpda(hfa384x_t *hw, void *buf, unsigned int len);
int int hfa384x_drvr_setconfig(hfa384x_t *hw, u16 rid, void *buf, u16 len);
hfa384x_drvr_getconfig(hfa384x_t *hw, u16 rid, void *buf, u16 len);
int static inline int hfa384x_drvr_getconfig16(hfa384x_t *hw, u16 rid, void *val)
hfa384x_drvr_handover( hfa384x_t *hw, u8 *addr);
int
hfa384x_drvr_ramdl_enable(hfa384x_t *hw, u32 exeaddr);
int
hfa384x_drvr_ramdl_disable(hfa384x_t *hw);
int
hfa384x_drvr_ramdl_write(hfa384x_t *hw, u32 daddr, void* buf, u32 len);
int
hfa384x_drvr_readpda(hfa384x_t *hw, void *buf, unsigned int len);
int
hfa384x_drvr_setconfig(hfa384x_t *hw, u16 rid, void *buf, u16 len);
static inline int
hfa384x_drvr_getconfig16(hfa384x_t *hw, u16 rid, void *val)
{ {
int result = 0; int result = 0;
result = hfa384x_drvr_getconfig(hw, rid, val, sizeof(u16)); result = hfa384x_drvr_getconfig(hw, rid, val, sizeof(u16));
if ( result == 0 ) { if (result == 0)
*((u16*)val) = hfa384x2host_16(*((u16*)val)); *((u16 *) val) = hfa384x2host_16(*((u16 *) val));
}
return result; return result;
} }
static inline int static inline int hfa384x_drvr_setconfig16(hfa384x_t *hw, u16 rid, u16 val)
hfa384x_drvr_setconfig16(hfa384x_t *hw, u16 rid, u16 val)
{ {
u16 value = host2hfa384x_16(val); u16 value = host2hfa384x_16(val);
return hfa384x_drvr_setconfig(hw, rid, &value, sizeof(value)); return hfa384x_drvr_setconfig(hw, rid, &value, sizeof(value));
} }
int int
hfa384x_drvr_getconfig_async(hfa384x_t *hw, hfa384x_drvr_getconfig_async(hfa384x_t *hw,
u16 rid, u16 rid, ctlx_usercb_t usercb, void *usercb_data);
ctlx_usercb_t usercb,
void *usercb_data);
int int
hfa384x_drvr_setconfig_async(hfa384x_t *hw, hfa384x_drvr_setconfig_async(hfa384x_t *hw,
u16 rid, u16 rid,
void *buf, void *buf,
u16 len, u16 len, ctlx_usercb_t usercb, void *usercb_data);
ctlx_usercb_t usercb,
void *usercb_data);
static inline int static inline int
hfa384x_drvr_setconfig16_async(hfa384x_t *hw, u16 rid, u16 val) hfa384x_drvr_setconfig16_async(hfa384x_t *hw, u16 rid, u16 val)
{ {
u16 value = host2hfa384x_16(val); u16 value = host2hfa384x_16(val);
return hfa384x_drvr_setconfig_async(hw, rid, &value, sizeof(value), return hfa384x_drvr_setconfig_async(hw, rid, &value, sizeof(value),
NULL , NULL); NULL, NULL);
} }
int hfa384x_drvr_start(hfa384x_t *hw);
int hfa384x_drvr_stop(hfa384x_t *hw);
int int
hfa384x_drvr_start(hfa384x_t *hw); hfa384x_drvr_txframe(hfa384x_t *hw, struct sk_buff *skb,
int p80211_hdr_t *p80211_hdr, p80211_metawep_t *p80211_wep);
hfa384x_drvr_stop(hfa384x_t *hw); void hfa384x_tx_timeout(wlandevice_t *wlandev);
int
hfa384x_drvr_txframe(hfa384x_t *hw, struct sk_buff *skb, p80211_hdr_t *p80211_hdr, p80211_metawep_t *p80211_wep); int hfa384x_cmd_initialize(hfa384x_t *hw);
void int hfa384x_cmd_enable(hfa384x_t *hw, u16 macport);
hfa384x_tx_timeout(wlandevice_t *wlandev); int hfa384x_cmd_disable(hfa384x_t *hw, u16 macport);
int hfa384x_cmd_allocate(hfa384x_t *hw, u16 len);
int int hfa384x_cmd_monitor(hfa384x_t *hw, u16 enable);
hfa384x_cmd_initialize(hfa384x_t *hw);
int
hfa384x_cmd_enable(hfa384x_t *hw, u16 macport);
int
hfa384x_cmd_disable(hfa384x_t *hw, u16 macport);
int
hfa384x_cmd_allocate(hfa384x_t *hw, u16 len);
int
hfa384x_cmd_monitor(hfa384x_t *hw, u16 enable);
int int
hfa384x_cmd_download( hfa384x_cmd_download(hfa384x_t *hw,
hfa384x_t *hw, u16 mode, u16 lowaddr, u16 highaddr, u16 codelen);
u16 mode,
u16 lowaddr,
u16 highaddr,
u16 codelen);
void void
hfa384x_copy_from_aux( hfa384x_copy_from_aux(hfa384x_t *hw,
hfa384x_t *hw, u32 cardaddr, u32 auxctl, void *buf, unsigned int len);
u32 cardaddr,
u32 auxctl,
void *buf,
unsigned int len);
void void
hfa384x_copy_to_aux( hfa384x_copy_to_aux(hfa384x_t *hw,
hfa384x_t *hw, u32 cardaddr, u32 auxctl, void *buf, unsigned int len);
u32 cardaddr,
u32 auxctl,
void *buf,
unsigned int len);
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
#endif /* _HFA384x_H */ #endif /* _HFA384x_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment