Skip to content

Commit

Permalink
Staging: wlan-ng: p80211types.h: Coding style cleanups
Browse files Browse the repository at this point in the history
Signed-off-by: Moritz Muehlenhoff <jmm@debian.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Moritz Muehlenhoff authored and Greg Kroah-Hartman committed Apr 3, 2009
1 parent 82eaca7 commit 356925c
Showing 1 changed file with 105 additions and 140 deletions.
245 changes: 105 additions & 140 deletions drivers/staging/wlan-ng/p80211types.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,6 @@
#include "wlan_compat.h"
#endif

/*================================================================*/
/* Constants */
/*================================================================*/

/*----------------------------------------------------------------*/
/* The following constants are indexes into the Mib Category List */
/* and the Message Category List */
Expand Down Expand Up @@ -129,9 +125,6 @@
/* is a DID-LEN-DATA triple */
/* with a max size of 4+4+384 */

/*================================================================*/
/* Macros */

/*----------------------------------------------------------------*/
/* The following macro creates a name for an enum */

Expand Down Expand Up @@ -165,35 +158,32 @@
#define P80211DID_MASK_ISTABLE (0x00000001UL)
#define P80211DID_MASK_ACCESS (0x00000003UL)


#define P80211DID_MK(a,m,l) ((((u32)(a)) & (m)) << (l))
#define P80211DID_MK(a, m, l) ((((u32)(a)) & (m)) << (l))

#define P80211DID_MKSECTION(a) P80211DID_MK(a, \
P80211DID_MASK_SECTION, \
P80211DID_LSB_SECTION )
P80211DID_LSB_SECTION)
#define P80211DID_MKGROUP(a) P80211DID_MK(a, \
P80211DID_MASK_GROUP, \
P80211DID_LSB_GROUP )
P80211DID_LSB_GROUP)
#define P80211DID_MKITEM(a) P80211DID_MK(a, \
P80211DID_MASK_ITEM, \
P80211DID_LSB_ITEM )
P80211DID_LSB_ITEM)
#define P80211DID_MKINDEX(a) P80211DID_MK(a, \
P80211DID_MASK_INDEX, \
P80211DID_LSB_INDEX )
P80211DID_LSB_INDEX)
#define P80211DID_MKISTABLE(a) P80211DID_MK(a, \
P80211DID_MASK_ISTABLE, \
P80211DID_LSB_ISTABLE )

P80211DID_LSB_ISTABLE)

#define P80211DID_MKID(s,g,i,n,t,a) (P80211DID_MKSECTION(s) | \
P80211DID_MKGROUP(g) | \
P80211DID_MKITEM(i) | \
P80211DID_MKINDEX(n) | \
P80211DID_MKISTABLE(t) | \
(a) )

(a))

#define P80211DID_GET(a,m,l) ((((u32)(a)) >> (l)) & (m))
#define P80211DID_GET(a, m, l) ((((u32)(a)) >> (l)) & (m))

#define P80211DID_SECTION(a) P80211DID_GET(a, \
P80211DID_MASK_SECTION, \
Expand All @@ -214,164 +204,142 @@
P80211DID_MASK_ACCESS, \
P80211DID_LSB_ACCESS)

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

/*----------------------------------------------------------------*/
/* The following structure types are used for the represenation */
/* of ENUMint type metadata. */

typedef struct p80211enumpair
{
u32 val;
char *name;
typedef struct p80211enumpair {
u32 val;
char *name;
} p80211enumpair_t;

typedef struct p80211enum
{
int nitems;
p80211enumpair_t *list;
typedef struct p80211enum {
int nitems;
p80211enumpair_t *list;
} p80211enum_t;

/*----------------------------------------------------------------*/
/* The following structure types are used to store data items in */
/* messages. */

/* Template pascal string */
typedef struct p80211pstr
{
u8 len;
} __attribute__((packed)) p80211pstr_t;
typedef struct p80211pstr {
u8 len;
} __attribute__ ((packed)) p80211pstr_t;

typedef struct p80211pstrd
{
u8 len;
u8 data[0];
} __attribute__((packed)) p80211pstrd_t;
typedef struct p80211pstrd {
u8 len;
u8 data[0];
} __attribute__ ((packed)) p80211pstrd_t;

/* Maximum pascal string */
typedef struct p80211pstr255
{
u8 len;
u8 data[MAXLEN_PSTR255];
} __attribute__((packed)) p80211pstr255_t;
typedef struct p80211pstr255 {
u8 len;
u8 data[MAXLEN_PSTR255];
} __attribute__ ((packed)) p80211pstr255_t;

/* pascal string for macaddress and bssid */
typedef struct p80211pstr6
{
u8 len;
u8 data[MAXLEN_PSTR6];
} __attribute__((packed)) p80211pstr6_t;
typedef struct p80211pstr6 {
u8 len;
u8 data[MAXLEN_PSTR6];
} __attribute__ ((packed)) p80211pstr6_t;

/* pascal string for channel list */
typedef struct p80211pstr14
{
u8 len;
u8 data[MAXLEN_PSTR14];
} __attribute__((packed)) p80211pstr14_t;
typedef struct p80211pstr14 {
u8 len;
u8 data[MAXLEN_PSTR14];
} __attribute__ ((packed)) p80211pstr14_t;

/* pascal string for ssid */
typedef struct p80211pstr32
{
u8 len;
u8 data[MAXLEN_PSTR32];
} __attribute__((packed)) p80211pstr32_t;
typedef struct p80211pstr32 {
u8 len;
u8 data[MAXLEN_PSTR32];
} __attribute__ ((packed)) p80211pstr32_t;

/* MAC address array */
typedef struct p80211macarray
{
u32 cnt;
u8 data[1][MAXLEN_PSTR6];
} __attribute__((packed)) p80211macarray_t;
typedef struct p80211macarray {
u32 cnt;
u8 data[1][MAXLEN_PSTR6];
} __attribute__ ((packed)) p80211macarray_t;

/* prototype template */
typedef struct p80211item
{
u32 did;
u16 status;
u16 len;
} __attribute__((packed)) p80211item_t;
typedef struct p80211item {
u32 did;
u16 status;
u16 len;
} __attribute__ ((packed)) p80211item_t;

/* prototype template w/ data item */
typedef struct p80211itemd
{
u32 did;
u16 status;
u16 len;
u8 data[0];
} __attribute__((packed)) p80211itemd_t;
typedef struct p80211itemd {
u32 did;
u16 status;
u16 len;
u8 data[0];
} __attribute__ ((packed)) p80211itemd_t;

/* message data item for int, BOUNDEDINT, ENUMINT */
typedef struct p80211item_uint32
{
u32 did;
u16 status;
u16 len;
u32 data;
} __attribute__((packed)) p80211item_uint32_t;
typedef struct p80211item_uint32 {
u32 did;
u16 status;
u16 len;
u32 data;
} __attribute__ ((packed)) p80211item_uint32_t;

/* message data item for OCTETSTR, DISPLAYSTR */
typedef struct p80211item_pstr6
{
u32 did;
u16 status;
u16 len;
p80211pstr6_t data;
} __attribute__((packed)) p80211item_pstr6_t;
typedef struct p80211item_pstr6 {
u32 did;
u16 status;
u16 len;
p80211pstr6_t data;
} __attribute__ ((packed)) p80211item_pstr6_t;

/* message data item for OCTETSTR, DISPLAYSTR */
typedef struct p80211item_pstr14
{
u32 did;
u16 status;
u16 len;
p80211pstr14_t data;
} __attribute__((packed)) p80211item_pstr14_t;
typedef struct p80211item_pstr14 {
u32 did;
u16 status;
u16 len;
p80211pstr14_t data;
} __attribute__ ((packed)) p80211item_pstr14_t;

/* message data item for OCTETSTR, DISPLAYSTR */
typedef struct p80211item_pstr32
{
u32 did;
u16 status;
u16 len;
p80211pstr32_t data;
} __attribute__((packed)) p80211item_pstr32_t;
typedef struct p80211item_pstr32 {
u32 did;
u16 status;
u16 len;
p80211pstr32_t data;
} __attribute__ ((packed)) p80211item_pstr32_t;

/* message data item for OCTETSTR, DISPLAYSTR */
typedef struct p80211item_pstr255
{
u32 did;
u16 status;
u16 len;
p80211pstr255_t data;
} __attribute__((packed)) p80211item_pstr255_t;
typedef struct p80211item_pstr255 {
u32 did;
u16 status;
u16 len;
p80211pstr255_t data;
} __attribute__ ((packed)) p80211item_pstr255_t;

/* message data item for UNK 392, namely mib items */
typedef struct p80211item_unk392
{
u32 did;
u16 status;
u16 len;
u8 data[MAXLEN_MIBATTRIBUTE];
} __attribute__((packed)) p80211item_unk392_t;
typedef struct p80211item_unk392 {
u32 did;
u16 status;
u16 len;
u8 data[MAXLEN_MIBATTRIBUTE];
} __attribute__ ((packed)) p80211item_unk392_t;

/* message data item for UNK 1025, namely p2 pdas */
typedef struct p80211item_unk1024
{
u32 did;
u16 status;
u16 len;
u8 data[1024];
} __attribute__((packed)) p80211item_unk1024_t;
typedef struct p80211item_unk1024 {
u32 did;
u16 status;
u16 len;
u8 data[1024];
} __attribute__ ((packed)) p80211item_unk1024_t;

/* message data item for UNK 4096, namely p2 download chunks */
typedef struct p80211item_unk4096
{
u32 did;
u16 status;
u16 len;
u8 data[4096];
} __attribute__((packed)) p80211item_unk4096_t;
typedef struct p80211item_unk4096 {
u32 did;
u16 status;
u16 len;
u8 data[4096];
} __attribute__ ((packed)) p80211item_unk4096_t;

struct catlistitem;

Expand All @@ -380,13 +348,11 @@ struct catlistitem;
/* metadata items. Some components may choose to use more, */
/* less or different metadata items. */

typedef void (*p80211_totext_t)( struct catlistitem *, u32 did, u8* itembuf, char *textbuf);
typedef void (*p80211_fromtext_t)( struct catlistitem *, u32 did, u8* itembuf, char *textbuf);
typedef u32 (*p80211_valid_t)( struct catlistitem *, u32 did, u8* itembuf);


/*================================================================*/
/* Extern Declarations */
typedef void (*p80211_totext_t) (struct catlistitem *, u32 did, u8 *itembuf,
char *textbuf);
typedef void (*p80211_fromtext_t) (struct catlistitem *, u32 did, u8 *itembuf,
char *textbuf);
typedef u32(*p80211_valid_t) (struct catlistitem *, u32 did, u8 *itembuf);

/*----------------------------------------------------------------*/
/* Enumeration Lists */
Expand Down Expand Up @@ -415,4 +381,3 @@ extern p80211enum_t MKENUMNAME(lnxroam_reason);
extern p80211enum_t MKENUMNAME(p2preamble);

#endif /* _P80211TYPES_H */

0 comments on commit 356925c

Please sign in to comment.