Skip to content

Commit

Permalink
Staging: wlan-ng: Use standard kernel integer (u32/s32/etc) types.
Browse files Browse the repository at this point in the history
wlan-ng needed to interact with userspace, and support very old kernels,
so it used to define its own types for integers to ensure consistency.

It's all rather irrelevant now.

Signed-off-by: Solomon Peachy <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
speachy authored and gregkh committed Jan 6, 2009
1 parent 5704976 commit aaad430
Show file tree
Hide file tree
Showing 24 changed files with 1,926 additions and 1,953 deletions.
2,220 changes: 1,110 additions & 1,110 deletions drivers/staging/wlan-ng/hfa384x.h

Large diffs are not rendered by default.

212 changes: 106 additions & 106 deletions drivers/staging/wlan-ng/hfa384x_usb.c

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions drivers/staging/wlan-ng/p80211conv.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@
/*================================================================*/
/* Local Static Definitions */

static UINT8 oui_rfc1042[] = {0x00, 0x00, 0x00};
static UINT8 oui_8021h[] = {0x00, 0x00, 0xf8};
static u8 oui_rfc1042[] = {0x00, 0x00, 0x00};
static u8 oui_8021h[] = {0x00, 0x00, 0xf8};

/*================================================================*/
/* Local Function Declarations */
Expand Down Expand Up @@ -134,11 +134,11 @@ static UINT8 oui_8021h[] = {0x00, 0x00, 0xf8};
* Call context:
* May be called in interrupt or non-interrupt context
----------------------------------------------------------------*/
int skb_ether_to_p80211( wlandevice_t *wlandev, UINT32 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)
{

UINT16 fc;
UINT16 proto;
u16 fc;
u16 proto;
wlan_ethhdr_t e_hdr;
wlan_llc_t *e_llc;
wlan_snap_t *e_snap;
Expand Down Expand Up @@ -297,14 +297,14 @@ 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, UINT32 ethconv, struct sk_buff *skb)
int skb_p80211_to_ether( wlandevice_t *wlandev, u32 ethconv, struct sk_buff *skb)
{
netdevice_t *netdev = wlandev->netdev;
UINT16 fc;
UINT payload_length;
UINT payload_offset;
UINT8 daddr[WLAN_ETHADDR_LEN];
UINT8 saddr[WLAN_ETHADDR_LEN];
u16 fc;
unsigned int payload_length;
unsigned int payload_offset;
u8 daddr[WLAN_ETHADDR_LEN];
u8 saddr[WLAN_ETHADDR_LEN];
p80211_hdr_t *w_hdr;
wlan_ethhdr_t *e_hdr;
wlan_llc_t *e_llc;
Expand Down Expand Up @@ -488,7 +488,7 @@ int skb_p80211_to_ether( wlandevice_t *wlandev, UINT32 ethconv, struct sk_buff *
* Call context:
* May be called in interrupt or non-interrupt context
----------------------------------------------------------------*/
int p80211_stt_findproto(UINT16 proto)
int p80211_stt_findproto(u16 proto)
{
/* Always return found for now. This is the behavior used by the */
/* Zoom Win95 driver when 802.1h mode is selected */
Expand Down
76 changes: 38 additions & 38 deletions drivers/staging/wlan-ng/p80211conv.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,22 +86,22 @@ typedef struct p80211_rxmeta
{
struct wlandevice *wlandev;

UINT64 mactime; /* Hi-rez MAC-supplied time value */
UINT64 hosttime; /* Best-rez host supplied time value */
u64 mactime; /* Hi-rez MAC-supplied time value */
u64 hosttime; /* Best-rez host supplied time value */

UINT rxrate; /* Receive data rate in 100kbps */
UINT priority; /* 0-15, 0=contention, 6=CF */
INT signal; /* An SSI, see p80211netdev.h */
INT noise; /* An SSI, see p80211netdev.h */
UINT channel; /* Receive channel (mostly for snifs) */
UINT preamble; /* P80211ENUM_preambletype_* */
UINT encoding; /* P80211ENUM_encoding_* */
unsigned int rxrate; /* Receive data rate in 100kbps */
unsigned int priority; /* 0-15, 0=contention, 6=CF */
int signal; /* An SSI, see p80211netdev.h */
int noise; /* An SSI, see p80211netdev.h */
unsigned int channel; /* Receive channel (mostly for snifs) */
unsigned int preamble; /* P80211ENUM_preambletype_* */
unsigned int encoding; /* P80211ENUM_encoding_* */

} p80211_rxmeta_t;

typedef struct p80211_frmmeta
{
UINT magic;
unsigned int magic;
p80211_rxmeta_t *rx;
} p80211_frmmeta_t;

Expand All @@ -117,52 +117,52 @@ void p80211skb_rxmeta_detach(struct sk_buff *skb);
*/
typedef struct p80211_caphdr
{
UINT32 version;
UINT32 length;
UINT64 mactime;
UINT64 hosttime;
UINT32 phytype;
UINT32 channel;
UINT32 datarate;
UINT32 antenna;
UINT32 priority;
UINT32 ssi_type;
INT32 ssi_signal;
INT32 ssi_noise;
UINT32 preamble;
UINT32 encoding;
u32 version;
u32 length;
u64 mactime;
u64 hosttime;
u32 phytype;
u32 channel;
u32 datarate;
u32 antenna;
u32 priority;
u32 ssi_type;
s32 ssi_signal;
s32 ssi_noise;
u32 preamble;
u32 encoding;
} p80211_caphdr_t;

/* buffer free method pointer type */
typedef void (* freebuf_method_t)(void *buf, int size);

typedef struct p80211_metawep {
void *data;
UINT8 iv[4];
UINT8 icv[4];
u8 iv[4];
u8 icv[4];
} p80211_metawep_t;

/* local ether header type */
typedef struct wlan_ethhdr
{
UINT8 daddr[WLAN_ETHADDR_LEN];
UINT8 saddr[WLAN_ETHADDR_LEN];
UINT16 type;
u8 daddr[WLAN_ETHADDR_LEN];
u8 saddr[WLAN_ETHADDR_LEN];
u16 type;
} __WLAN_ATTRIB_PACK__ wlan_ethhdr_t;

/* local llc header type */
typedef struct wlan_llc
{
UINT8 dsap;
UINT8 ssap;
UINT8 ctl;
u8 dsap;
u8 ssap;
u8 ctl;
} __WLAN_ATTRIB_PACK__ wlan_llc_t;

/* local snap header type */
typedef struct wlan_snap
{
UINT8 oui[WLAN_IEEE_OUI_LEN];
UINT16 type;
u8 oui[WLAN_IEEE_OUI_LEN];
u16 type;
} __WLAN_ATTRIB_PACK__ wlan_snap_t;

/* Circular include trick */
Expand All @@ -174,13 +174,13 @@ struct wlandevice;
/*================================================================*/
/*Function Declarations */

int skb_p80211_to_ether( struct wlandevice *wlandev, UINT32 ethconv,
int skb_p80211_to_ether( struct wlandevice *wlandev, u32 ethconv,
struct sk_buff *skb);
int skb_ether_to_p80211( struct wlandevice *wlandev, UINT32 ethconv,
int skb_ether_to_p80211( struct wlandevice *wlandev, u32 ethconv,
struct sk_buff *skb, p80211_hdr_t *p80211_hdr,
p80211_metawep_t *p80211_wep );

int p80211_stt_findproto(UINT16 proto);
int p80211_stt_addproto(UINT16 proto);
int p80211_stt_findproto(u16 proto);
int p80211_stt_addproto(u16 proto);

#endif
90 changes: 45 additions & 45 deletions drivers/staging/wlan-ng/p80211hdr.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,29 +166,29 @@
/* SET_FC_FSTYPE(WLAN_FSTYPE_RTS) ); */
/*------------------------------------------------------------*/

#define WLAN_GET_FC_PVER(n) (((UINT16)(n)) & (BIT0 | BIT1))
#define WLAN_GET_FC_FTYPE(n) ((((UINT16)(n)) & (BIT2 | BIT3)) >> 2)
#define WLAN_GET_FC_FSTYPE(n) ((((UINT16)(n)) & (BIT4|BIT5|BIT6|BIT7)) >> 4)
#define WLAN_GET_FC_TODS(n) ((((UINT16)(n)) & (BIT8)) >> 8)
#define WLAN_GET_FC_FROMDS(n) ((((UINT16)(n)) & (BIT9)) >> 9)
#define WLAN_GET_FC_MOREFRAG(n) ((((UINT16)(n)) & (BIT10)) >> 10)
#define WLAN_GET_FC_RETRY(n) ((((UINT16)(n)) & (BIT11)) >> 11)
#define WLAN_GET_FC_PWRMGT(n) ((((UINT16)(n)) & (BIT12)) >> 12)
#define WLAN_GET_FC_MOREDATA(n) ((((UINT16)(n)) & (BIT13)) >> 13)
#define WLAN_GET_FC_ISWEP(n) ((((UINT16)(n)) & (BIT14)) >> 14)
#define WLAN_GET_FC_ORDER(n) ((((UINT16)(n)) & (BIT15)) >> 15)

#define WLAN_SET_FC_PVER(n) ((UINT16)(n))
#define WLAN_SET_FC_FTYPE(n) (((UINT16)(n)) << 2)
#define WLAN_SET_FC_FSTYPE(n) (((UINT16)(n)) << 4)
#define WLAN_SET_FC_TODS(n) (((UINT16)(n)) << 8)
#define WLAN_SET_FC_FROMDS(n) (((UINT16)(n)) << 9)
#define WLAN_SET_FC_MOREFRAG(n) (((UINT16)(n)) << 10)
#define WLAN_SET_FC_RETRY(n) (((UINT16)(n)) << 11)
#define WLAN_SET_FC_PWRMGT(n) (((UINT16)(n)) << 12)
#define WLAN_SET_FC_MOREDATA(n) (((UINT16)(n)) << 13)
#define WLAN_SET_FC_ISWEP(n) (((UINT16)(n)) << 14)
#define WLAN_SET_FC_ORDER(n) (((UINT16)(n)) << 15)
#define WLAN_GET_FC_PVER(n) (((u16)(n)) & (BIT0 | BIT1))
#define WLAN_GET_FC_FTYPE(n) ((((u16)(n)) & (BIT2 | BIT3)) >> 2)
#define WLAN_GET_FC_FSTYPE(n) ((((u16)(n)) & (BIT4|BIT5|BIT6|BIT7)) >> 4)
#define WLAN_GET_FC_TODS(n) ((((u16)(n)) & (BIT8)) >> 8)
#define WLAN_GET_FC_FROMDS(n) ((((u16)(n)) & (BIT9)) >> 9)
#define WLAN_GET_FC_MOREFRAG(n) ((((u16)(n)) & (BIT10)) >> 10)
#define WLAN_GET_FC_RETRY(n) ((((u16)(n)) & (BIT11)) >> 11)
#define WLAN_GET_FC_PWRMGT(n) ((((u16)(n)) & (BIT12)) >> 12)
#define WLAN_GET_FC_MOREDATA(n) ((((u16)(n)) & (BIT13)) >> 13)
#define WLAN_GET_FC_ISWEP(n) ((((u16)(n)) & (BIT14)) >> 14)
#define WLAN_GET_FC_ORDER(n) ((((u16)(n)) & (BIT15)) >> 15)

#define WLAN_SET_FC_PVER(n) ((u16)(n))
#define WLAN_SET_FC_FTYPE(n) (((u16)(n)) << 2)
#define WLAN_SET_FC_FSTYPE(n) (((u16)(n)) << 4)
#define WLAN_SET_FC_TODS(n) (((u16)(n)) << 8)
#define WLAN_SET_FC_FROMDS(n) (((u16)(n)) << 9)
#define WLAN_SET_FC_MOREFRAG(n) (((u16)(n)) << 10)
#define WLAN_SET_FC_RETRY(n) (((u16)(n)) << 11)
#define WLAN_SET_FC_PWRMGT(n) (((u16)(n)) << 12)
#define WLAN_SET_FC_MOREDATA(n) (((u16)(n)) << 13)
#define WLAN_SET_FC_ISWEP(n) (((u16)(n)) << 14)
#define WLAN_SET_FC_ORDER(n) (((u16)(n)) << 15)

/*--- Duration Macros ----------------------------------------*/
/* Macros to get/set the bitfields of the Duration Field */
Expand All @@ -201,45 +201,45 @@
/* Macros to get/set the bitfields of the Sequence Control */
/* Field. */
/*------------------------------------------------------------*/
#define WLAN_GET_SEQ_FRGNUM(n) (((UINT16)(n)) & (BIT0|BIT1|BIT2|BIT3))
#define WLAN_GET_SEQ_SEQNUM(n) ((((UINT16)(n)) & (~(BIT0|BIT1|BIT2|BIT3))) >> 4)
#define WLAN_GET_SEQ_FRGNUM(n) (((u16)(n)) & (BIT0|BIT1|BIT2|BIT3))
#define WLAN_GET_SEQ_SEQNUM(n) ((((u16)(n)) & (~(BIT0|BIT1|BIT2|BIT3))) >> 4)

/*--- Data ptr macro -----------------------------------------*/
/* Creates a UINT8* to the data portion of a frame */
/* Creates a u8* to the data portion of a frame */
/* Assumes you're passing in a ptr to the beginning of the hdr*/
/*------------------------------------------------------------*/
#define WLAN_HDR_A3_DATAP(p) (((UINT8*)(p)) + WLAN_HDR_A3_LEN)
#define WLAN_HDR_A4_DATAP(p) (((UINT8*)(p)) + WLAN_HDR_A4_LEN)
#define WLAN_HDR_A3_DATAP(p) (((u8*)(p)) + WLAN_HDR_A3_LEN)
#define WLAN_HDR_A4_DATAP(p) (((u8*)(p)) + WLAN_HDR_A4_LEN)

#define DOT11_RATE5_ISBASIC_GET(r) (((UINT8)(r)) & BIT7)
#define DOT11_RATE5_ISBASIC_GET(r) (((u8)(r)) & BIT7)

/*================================================================*/
/* Types */

/* BSS Timestamp */
typedef UINT8 wlan_bss_ts_t[WLAN_BSS_TS_LEN];
typedef u8 wlan_bss_ts_t[WLAN_BSS_TS_LEN];

/* Generic 802.11 Header types */

typedef struct p80211_hdr_a3
{
UINT16 fc;
UINT16 dur;
UINT8 a1[WLAN_ADDR_LEN];
UINT8 a2[WLAN_ADDR_LEN];
UINT8 a3[WLAN_ADDR_LEN];
UINT16 seq;
u16 fc;
u16 dur;
u8 a1[WLAN_ADDR_LEN];
u8 a2[WLAN_ADDR_LEN];
u8 a3[WLAN_ADDR_LEN];
u16 seq;
} __WLAN_ATTRIB_PACK__ p80211_hdr_a3_t;

typedef struct p80211_hdr_a4
{
UINT16 fc;
UINT16 dur;
UINT8 a1[WLAN_ADDR_LEN];
UINT8 a2[WLAN_ADDR_LEN];
UINT8 a3[WLAN_ADDR_LEN];
UINT16 seq;
UINT8 a4[WLAN_ADDR_LEN];
u16 fc;
u16 dur;
u8 a1[WLAN_ADDR_LEN];
u8 a2[WLAN_ADDR_LEN];
u8 a3[WLAN_ADDR_LEN];
u16 seq;
u8 a4[WLAN_ADDR_LEN];
} __WLAN_ATTRIB_PACK__ p80211_hdr_a4_t;

typedef union p80211_hdr
Expand Down Expand Up @@ -271,9 +271,9 @@ typedef union p80211_hdr
#define WLAN_FCS_LEN 4

/* ftcl in HOST order */
inline static UINT16 p80211_headerlen(UINT16 fctl)
inline static u16 p80211_headerlen(u16 fctl)
{
UINT16 hdrlen = 0;
u16 hdrlen = 0;

switch ( WLAN_GET_FC_FTYPE(fctl) ) {
case WLAN_FTYPE_MGMT:
Expand Down
6 changes: 3 additions & 3 deletions drivers/staging/wlan-ng/p80211ioctl.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ typedef struct p80211ioctl_req
{
char name[WLAN_DEVNAMELEN_MAX];
caddr_t data;
UINT32 magic;
UINT16 len;
UINT32 result;
u32 magic;
u16 len;
u32 result;
} __WLAN_ATTRIB_PACK__ p80211ioctl_req_t;


Expand Down
46 changes: 23 additions & 23 deletions drivers/staging/wlan-ng/p80211meta.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
#define MKMIBMETASIZE(name) p80211meta_ ## mib ## _ ## name ## _ ## size
#define MKGRPMETASIZE(name) p80211meta_ ## grp ## _ ## name ## _ ## size

#define GETMETASIZE(aptr) (**((UINT32**)(aptr)))
#define GETMETASIZE(aptr) (**((u32**)(aptr)))

/*----------------------------------------------------------------*/
/* The following ifdef depends on the following defines: */
Expand All @@ -114,14 +114,14 @@
typedef struct p80211meta
{
char *name; /* data item name */
UINT32 did; /* partial did */
UINT32 flags; /* set of various flag bits */
UINT32 min; /* min value of a BOUNDEDINT */
UINT32 max; /* max value of a BOUNDEDINT */

UINT32 maxlen; /* maxlen of a OCTETSTR or DISPLAYSTR */
UINT32 minlen; /* minlen of a OCTETSTR or DISPLAYSTR */
p80211enum_t *enumptr; /* ptr to the enum type for ENUMINT */
u32 did; /* partial did */
u32 flags; /* set of various flag bits */
u32 min; /* min value of a BOUNDEDint */
u32 max; /* max value of a BOUNDEDint */

u32 maxlen; /* maxlen of a OCTETSTR or DISPLAYSTR */
u32 minlen; /* minlen of a OCTETSTR or DISPLAYSTR */
p80211enum_t *enumptr; /* ptr to the enum type for ENUMint */
p80211_totext_t totextptr; /* ptr to totext conversion function */
p80211_fromtext_t fromtextptr; /* ptr to totext conversion function */
p80211_valid_t validfunptr; /* ptr to totext conversion function */
Expand Down Expand Up @@ -150,20 +150,20 @@ typedef struct catlistitem

/*----------------------------------------------------------------*/
/* */
UINT32 p80211_text2did(catlistitem_t *catlist, char *catname, char *grpname, char *itemname);
UINT32 p80211_text2catdid(catlistitem_t *list, char *name );
UINT32 p80211_text2grpdid(grplistitem_t *list, char *name );
UINT32 p80211_text2itemdid(p80211meta_t *list, char *name );
UINT32 p80211_isvalid_did( catlistitem_t *catlist, UINT32 did );
UINT32 p80211_isvalid_catdid( catlistitem_t *catlist, UINT32 did );
UINT32 p80211_isvalid_grpdid( catlistitem_t *catlist, UINT32 did );
UINT32 p80211_isvalid_itemdid( catlistitem_t *catlist, UINT32 did );
catlistitem_t *p80211_did2cat( catlistitem_t *catlist, UINT32 did );
grplistitem_t *p80211_did2grp( catlistitem_t *catlist, UINT32 did );
p80211meta_t *p80211_did2item( catlistitem_t *catlist, UINT32 did );
UINT32 p80211item_maxdatalen( struct catlistitem *metalist, UINT32 did );
UINT32 p80211_metaname2did(struct catlistitem *metalist, char *itemname);
UINT32 p80211item_getoffset( struct catlistitem *metalist, UINT32 did );
u32 p80211_text2did(catlistitem_t *catlist, char *catname, char *grpname, char *itemname);
u32 p80211_text2catdid(catlistitem_t *list, char *name );
u32 p80211_text2grpdid(grplistitem_t *list, char *name );
u32 p80211_text2itemdid(p80211meta_t *list, char *name );
u32 p80211_isvalid_did( catlistitem_t *catlist, u32 did );
u32 p80211_isvalid_catdid( catlistitem_t *catlist, u32 did );
u32 p80211_isvalid_grpdid( catlistitem_t *catlist, u32 did );
u32 p80211_isvalid_itemdid( catlistitem_t *catlist, u32 did );
catlistitem_t *p80211_did2cat( catlistitem_t *catlist, u32 did );
grplistitem_t *p80211_did2grp( catlistitem_t *catlist, u32 did );
p80211meta_t *p80211_did2item( catlistitem_t *catlist, u32 did );
u32 p80211item_maxdatalen( struct catlistitem *metalist, u32 did );
u32 p80211_metaname2did(struct catlistitem *metalist, char *itemname);
u32 p80211item_getoffset( struct catlistitem *metalist, u32 did );
int p80211item_gettype(p80211meta_t *meta);

#endif /* _P80211META_H */
Loading

0 comments on commit aaad430

Please sign in to comment.