mirror of
https://github.com/torvalds/linux.git
synced 2024-11-15 16:41:58 +00:00
Staging: wlan-ng: p80211types.h: Coding style cleanups
Signed-off-by: Moritz Muehlenhoff <jmm@debian.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
82eaca7d9a
commit
356925c713
@ -65,10 +65,6 @@
|
|||||||
#include "wlan_compat.h"
|
#include "wlan_compat.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*================================================================*/
|
|
||||||
/* Constants */
|
|
||||||
/*================================================================*/
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------*/
|
/*----------------------------------------------------------------*/
|
||||||
/* The following constants are indexes into the Mib Category List */
|
/* The following constants are indexes into the Mib Category List */
|
||||||
/* and the Message Category List */
|
/* and the Message Category List */
|
||||||
@ -129,9 +125,6 @@
|
|||||||
/* is a DID-LEN-DATA triple */
|
/* is a DID-LEN-DATA triple */
|
||||||
/* with a max size of 4+4+384 */
|
/* with a max size of 4+4+384 */
|
||||||
|
|
||||||
/*================================================================*/
|
|
||||||
/* Macros */
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------*/
|
/*----------------------------------------------------------------*/
|
||||||
/* The following macro creates a name for an enum */
|
/* The following macro creates a name for an enum */
|
||||||
|
|
||||||
@ -165,35 +158,32 @@
|
|||||||
#define P80211DID_MASK_ISTABLE (0x00000001UL)
|
#define P80211DID_MASK_ISTABLE (0x00000001UL)
|
||||||
#define P80211DID_MASK_ACCESS (0x00000003UL)
|
#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, \
|
#define P80211DID_MKSECTION(a) P80211DID_MK(a, \
|
||||||
P80211DID_MASK_SECTION, \
|
P80211DID_MASK_SECTION, \
|
||||||
P80211DID_LSB_SECTION )
|
P80211DID_LSB_SECTION)
|
||||||
#define P80211DID_MKGROUP(a) P80211DID_MK(a, \
|
#define P80211DID_MKGROUP(a) P80211DID_MK(a, \
|
||||||
P80211DID_MASK_GROUP, \
|
P80211DID_MASK_GROUP, \
|
||||||
P80211DID_LSB_GROUP )
|
P80211DID_LSB_GROUP)
|
||||||
#define P80211DID_MKITEM(a) P80211DID_MK(a, \
|
#define P80211DID_MKITEM(a) P80211DID_MK(a, \
|
||||||
P80211DID_MASK_ITEM, \
|
P80211DID_MASK_ITEM, \
|
||||||
P80211DID_LSB_ITEM )
|
P80211DID_LSB_ITEM)
|
||||||
#define P80211DID_MKINDEX(a) P80211DID_MK(a, \
|
#define P80211DID_MKINDEX(a) P80211DID_MK(a, \
|
||||||
P80211DID_MASK_INDEX, \
|
P80211DID_MASK_INDEX, \
|
||||||
P80211DID_LSB_INDEX )
|
P80211DID_LSB_INDEX)
|
||||||
#define P80211DID_MKISTABLE(a) P80211DID_MK(a, \
|
#define P80211DID_MKISTABLE(a) P80211DID_MK(a, \
|
||||||
P80211DID_MASK_ISTABLE, \
|
P80211DID_MASK_ISTABLE, \
|
||||||
P80211DID_LSB_ISTABLE )
|
P80211DID_LSB_ISTABLE)
|
||||||
|
|
||||||
|
|
||||||
#define P80211DID_MKID(s,g,i,n,t,a) (P80211DID_MKSECTION(s) | \
|
#define P80211DID_MKID(s,g,i,n,t,a) (P80211DID_MKSECTION(s) | \
|
||||||
P80211DID_MKGROUP(g) | \
|
P80211DID_MKGROUP(g) | \
|
||||||
P80211DID_MKITEM(i) | \
|
P80211DID_MKITEM(i) | \
|
||||||
P80211DID_MKINDEX(n) | \
|
P80211DID_MKINDEX(n) | \
|
||||||
P80211DID_MKISTABLE(t) | \
|
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, \
|
#define P80211DID_SECTION(a) P80211DID_GET(a, \
|
||||||
P80211DID_MASK_SECTION, \
|
P80211DID_MASK_SECTION, \
|
||||||
@ -214,23 +204,18 @@
|
|||||||
P80211DID_MASK_ACCESS, \
|
P80211DID_MASK_ACCESS, \
|
||||||
P80211DID_LSB_ACCESS)
|
P80211DID_LSB_ACCESS)
|
||||||
|
|
||||||
/*================================================================*/
|
|
||||||
/* Types */
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------*/
|
/*----------------------------------------------------------------*/
|
||||||
/* The following structure types are used for the represenation */
|
/* The following structure types are used for the represenation */
|
||||||
/* of ENUMint type metadata. */
|
/* of ENUMint type metadata. */
|
||||||
|
|
||||||
typedef struct p80211enumpair
|
typedef struct p80211enumpair {
|
||||||
{
|
u32 val;
|
||||||
u32 val;
|
char *name;
|
||||||
char *name;
|
|
||||||
} p80211enumpair_t;
|
} p80211enumpair_t;
|
||||||
|
|
||||||
typedef struct p80211enum
|
typedef struct p80211enum {
|
||||||
{
|
int nitems;
|
||||||
int nitems;
|
p80211enumpair_t *list;
|
||||||
p80211enumpair_t *list;
|
|
||||||
} p80211enum_t;
|
} p80211enum_t;
|
||||||
|
|
||||||
/*----------------------------------------------------------------*/
|
/*----------------------------------------------------------------*/
|
||||||
@ -238,140 +223,123 @@ typedef struct p80211enum
|
|||||||
/* messages. */
|
/* messages. */
|
||||||
|
|
||||||
/* Template pascal string */
|
/* Template pascal string */
|
||||||
typedef struct p80211pstr
|
typedef struct p80211pstr {
|
||||||
{
|
u8 len;
|
||||||
u8 len;
|
} __attribute__ ((packed)) p80211pstr_t;
|
||||||
} __attribute__((packed)) p80211pstr_t;
|
|
||||||
|
|
||||||
typedef struct p80211pstrd
|
typedef struct p80211pstrd {
|
||||||
{
|
u8 len;
|
||||||
u8 len;
|
u8 data[0];
|
||||||
u8 data[0];
|
} __attribute__ ((packed)) p80211pstrd_t;
|
||||||
} __attribute__((packed)) p80211pstrd_t;
|
|
||||||
|
|
||||||
/* Maximum pascal string */
|
/* Maximum pascal string */
|
||||||
typedef struct p80211pstr255
|
typedef struct p80211pstr255 {
|
||||||
{
|
u8 len;
|
||||||
u8 len;
|
u8 data[MAXLEN_PSTR255];
|
||||||
u8 data[MAXLEN_PSTR255];
|
} __attribute__ ((packed)) p80211pstr255_t;
|
||||||
} __attribute__((packed)) p80211pstr255_t;
|
|
||||||
|
|
||||||
/* pascal string for macaddress and bssid */
|
/* pascal string for macaddress and bssid */
|
||||||
typedef struct p80211pstr6
|
typedef struct p80211pstr6 {
|
||||||
{
|
u8 len;
|
||||||
u8 len;
|
u8 data[MAXLEN_PSTR6];
|
||||||
u8 data[MAXLEN_PSTR6];
|
} __attribute__ ((packed)) p80211pstr6_t;
|
||||||
} __attribute__((packed)) p80211pstr6_t;
|
|
||||||
|
|
||||||
/* pascal string for channel list */
|
/* pascal string for channel list */
|
||||||
typedef struct p80211pstr14
|
typedef struct p80211pstr14 {
|
||||||
{
|
u8 len;
|
||||||
u8 len;
|
u8 data[MAXLEN_PSTR14];
|
||||||
u8 data[MAXLEN_PSTR14];
|
} __attribute__ ((packed)) p80211pstr14_t;
|
||||||
} __attribute__((packed)) p80211pstr14_t;
|
|
||||||
|
|
||||||
/* pascal string for ssid */
|
/* pascal string for ssid */
|
||||||
typedef struct p80211pstr32
|
typedef struct p80211pstr32 {
|
||||||
{
|
u8 len;
|
||||||
u8 len;
|
u8 data[MAXLEN_PSTR32];
|
||||||
u8 data[MAXLEN_PSTR32];
|
} __attribute__ ((packed)) p80211pstr32_t;
|
||||||
} __attribute__((packed)) p80211pstr32_t;
|
|
||||||
|
|
||||||
/* MAC address array */
|
/* MAC address array */
|
||||||
typedef struct p80211macarray
|
typedef struct p80211macarray {
|
||||||
{
|
u32 cnt;
|
||||||
u32 cnt;
|
u8 data[1][MAXLEN_PSTR6];
|
||||||
u8 data[1][MAXLEN_PSTR6];
|
} __attribute__ ((packed)) p80211macarray_t;
|
||||||
} __attribute__((packed)) p80211macarray_t;
|
|
||||||
|
|
||||||
/* prototype template */
|
/* prototype template */
|
||||||
typedef struct p80211item
|
typedef struct p80211item {
|
||||||
{
|
u32 did;
|
||||||
u32 did;
|
u16 status;
|
||||||
u16 status;
|
u16 len;
|
||||||
u16 len;
|
} __attribute__ ((packed)) p80211item_t;
|
||||||
} __attribute__((packed)) p80211item_t;
|
|
||||||
|
|
||||||
/* prototype template w/ data item */
|
/* prototype template w/ data item */
|
||||||
typedef struct p80211itemd
|
typedef struct p80211itemd {
|
||||||
{
|
u32 did;
|
||||||
u32 did;
|
u16 status;
|
||||||
u16 status;
|
u16 len;
|
||||||
u16 len;
|
u8 data[0];
|
||||||
u8 data[0];
|
} __attribute__ ((packed)) p80211itemd_t;
|
||||||
} __attribute__((packed)) p80211itemd_t;
|
|
||||||
|
|
||||||
/* message data item for int, BOUNDEDINT, ENUMINT */
|
/* message data item for int, BOUNDEDINT, ENUMINT */
|
||||||
typedef struct p80211item_uint32
|
typedef struct p80211item_uint32 {
|
||||||
{
|
u32 did;
|
||||||
u32 did;
|
u16 status;
|
||||||
u16 status;
|
u16 len;
|
||||||
u16 len;
|
u32 data;
|
||||||
u32 data;
|
} __attribute__ ((packed)) p80211item_uint32_t;
|
||||||
} __attribute__((packed)) p80211item_uint32_t;
|
|
||||||
|
|
||||||
/* message data item for OCTETSTR, DISPLAYSTR */
|
/* message data item for OCTETSTR, DISPLAYSTR */
|
||||||
typedef struct p80211item_pstr6
|
typedef struct p80211item_pstr6 {
|
||||||
{
|
u32 did;
|
||||||
u32 did;
|
u16 status;
|
||||||
u16 status;
|
u16 len;
|
||||||
u16 len;
|
p80211pstr6_t data;
|
||||||
p80211pstr6_t data;
|
} __attribute__ ((packed)) p80211item_pstr6_t;
|
||||||
} __attribute__((packed)) p80211item_pstr6_t;
|
|
||||||
|
|
||||||
/* message data item for OCTETSTR, DISPLAYSTR */
|
/* message data item for OCTETSTR, DISPLAYSTR */
|
||||||
typedef struct p80211item_pstr14
|
typedef struct p80211item_pstr14 {
|
||||||
{
|
u32 did;
|
||||||
u32 did;
|
u16 status;
|
||||||
u16 status;
|
u16 len;
|
||||||
u16 len;
|
p80211pstr14_t data;
|
||||||
p80211pstr14_t data;
|
} __attribute__ ((packed)) p80211item_pstr14_t;
|
||||||
} __attribute__((packed)) p80211item_pstr14_t;
|
|
||||||
|
|
||||||
/* message data item for OCTETSTR, DISPLAYSTR */
|
/* message data item for OCTETSTR, DISPLAYSTR */
|
||||||
typedef struct p80211item_pstr32
|
typedef struct p80211item_pstr32 {
|
||||||
{
|
u32 did;
|
||||||
u32 did;
|
u16 status;
|
||||||
u16 status;
|
u16 len;
|
||||||
u16 len;
|
p80211pstr32_t data;
|
||||||
p80211pstr32_t data;
|
} __attribute__ ((packed)) p80211item_pstr32_t;
|
||||||
} __attribute__((packed)) p80211item_pstr32_t;
|
|
||||||
|
|
||||||
/* message data item for OCTETSTR, DISPLAYSTR */
|
/* message data item for OCTETSTR, DISPLAYSTR */
|
||||||
typedef struct p80211item_pstr255
|
typedef struct p80211item_pstr255 {
|
||||||
{
|
u32 did;
|
||||||
u32 did;
|
u16 status;
|
||||||
u16 status;
|
u16 len;
|
||||||
u16 len;
|
p80211pstr255_t data;
|
||||||
p80211pstr255_t data;
|
} __attribute__ ((packed)) p80211item_pstr255_t;
|
||||||
} __attribute__((packed)) p80211item_pstr255_t;
|
|
||||||
|
|
||||||
/* message data item for UNK 392, namely mib items */
|
/* message data item for UNK 392, namely mib items */
|
||||||
typedef struct p80211item_unk392
|
typedef struct p80211item_unk392 {
|
||||||
{
|
u32 did;
|
||||||
u32 did;
|
u16 status;
|
||||||
u16 status;
|
u16 len;
|
||||||
u16 len;
|
u8 data[MAXLEN_MIBATTRIBUTE];
|
||||||
u8 data[MAXLEN_MIBATTRIBUTE];
|
} __attribute__ ((packed)) p80211item_unk392_t;
|
||||||
} __attribute__((packed)) p80211item_unk392_t;
|
|
||||||
|
|
||||||
/* message data item for UNK 1025, namely p2 pdas */
|
/* message data item for UNK 1025, namely p2 pdas */
|
||||||
typedef struct p80211item_unk1024
|
typedef struct p80211item_unk1024 {
|
||||||
{
|
u32 did;
|
||||||
u32 did;
|
u16 status;
|
||||||
u16 status;
|
u16 len;
|
||||||
u16 len;
|
u8 data[1024];
|
||||||
u8 data[1024];
|
} __attribute__ ((packed)) p80211item_unk1024_t;
|
||||||
} __attribute__((packed)) p80211item_unk1024_t;
|
|
||||||
|
|
||||||
/* message data item for UNK 4096, namely p2 download chunks */
|
/* message data item for UNK 4096, namely p2 download chunks */
|
||||||
typedef struct p80211item_unk4096
|
typedef struct p80211item_unk4096 {
|
||||||
{
|
u32 did;
|
||||||
u32 did;
|
u16 status;
|
||||||
u16 status;
|
u16 len;
|
||||||
u16 len;
|
u8 data[4096];
|
||||||
u8 data[4096];
|
} __attribute__ ((packed)) p80211item_unk4096_t;
|
||||||
} __attribute__((packed)) p80211item_unk4096_t;
|
|
||||||
|
|
||||||
struct catlistitem;
|
struct catlistitem;
|
||||||
|
|
||||||
@ -380,13 +348,11 @@ struct catlistitem;
|
|||||||
/* metadata items. Some components may choose to use more, */
|
/* metadata items. Some components may choose to use more, */
|
||||||
/* less or different metadata items. */
|
/* less or different metadata items. */
|
||||||
|
|
||||||
typedef void (*p80211_totext_t)( struct catlistitem *, u32 did, u8* itembuf, char *textbuf);
|
typedef void (*p80211_totext_t) (struct catlistitem *, u32 did, u8 *itembuf,
|
||||||
typedef void (*p80211_fromtext_t)( struct catlistitem *, u32 did, u8* itembuf, char *textbuf);
|
char *textbuf);
|
||||||
typedef u32 (*p80211_valid_t)( struct catlistitem *, u32 did, u8* itembuf);
|
typedef void (*p80211_fromtext_t) (struct catlistitem *, u32 did, u8 *itembuf,
|
||||||
|
char *textbuf);
|
||||||
|
typedef u32(*p80211_valid_t) (struct catlistitem *, u32 did, u8 *itembuf);
|
||||||
/*================================================================*/
|
|
||||||
/* Extern Declarations */
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------*/
|
/*----------------------------------------------------------------*/
|
||||||
/* Enumeration Lists */
|
/* Enumeration Lists */
|
||||||
@ -415,4 +381,3 @@ extern p80211enum_t MKENUMNAME(lnxroam_reason);
|
|||||||
extern p80211enum_t MKENUMNAME(p2preamble);
|
extern p80211enum_t MKENUMNAME(p2preamble);
|
||||||
|
|
||||||
#endif /* _P80211TYPES_H */
|
#endif /* _P80211TYPES_H */
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user