Skip to content

Commit

Permalink
staging: brcm80211: remove usage of packet section macros
Browse files Browse the repository at this point in the history
Removed include construction used to solve compiler differences
related to packed structure types. Now GNUC variant of packed
structure is used explicitly.

Reviewed-by: Brett Rudley <brudley@broadcom.com>
Reviewed-by: Henry Ptasinski <henryp@broadcom.com>
Reviewed-by: Roland Vossen <rvossen@broadcom.com>
Reviewed-by: Dowan Kim <dowan@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Arend van Spriel authored and Greg Kroah-Hartman committed Jan 20, 2011
1 parent 35af876 commit 1e66108
Show file tree
Hide file tree
Showing 11 changed files with 38 additions and 152 deletions.
34 changes: 14 additions & 20 deletions drivers/staging/brcm80211/include/d11.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
#ifndef _D11_H
#define _D11_H

/* This marks the start of a packed structure section. */
#include <packed_section_start.h>

#ifndef WL_RSSI_ANT_MAX
#define WL_RSSI_ANT_MAX 4 /* max possible rx antennas */
#elif WL_RSSI_ANT_MAX != 4
Expand Down Expand Up @@ -625,11 +622,11 @@ typedef volatile struct _d11regs {

/* 802.11a PLCP header def */
typedef struct ofdm_phy_hdr ofdm_phy_hdr_t;
BWL_PRE_PACKED_STRUCT struct ofdm_phy_hdr {
struct ofdm_phy_hdr {
u8 rlpt[3]; /* rate, length, parity, tail */
u16 service;
u8 pad;
} BWL_POST_PACKED_STRUCT;
} __attribute__((packed));

#define D11A_PHY_HDR_GRATE(phdr) ((phdr)->rlpt[0] & 0x0f)
#define D11A_PHY_HDR_GRES(phdr) (((phdr)->rlpt[0] >> 4) & 0x01)
Expand Down Expand Up @@ -660,12 +657,12 @@ BWL_PRE_PACKED_STRUCT struct ofdm_phy_hdr {

/* 802.11b PLCP header def */
typedef struct cck_phy_hdr cck_phy_hdr_t;
BWL_PRE_PACKED_STRUCT struct cck_phy_hdr {
struct cck_phy_hdr {
u8 signal;
u8 service;
u16 length;
u16 crc;
} BWL_POST_PACKED_STRUCT;
} __attribute__((packed));

#define D11B_PHY_HDR_LEN 6

Expand Down Expand Up @@ -706,7 +703,7 @@ BWL_PRE_PACKED_STRUCT struct cck_phy_hdr {

/* TX DMA buffer header */
typedef struct d11txh d11txh_t;
BWL_PRE_PACKED_STRUCT struct d11txh {
struct d11txh {
u16 MacTxControlLow; /* 0x0 */
u16 MacTxControlHigh; /* 0x1 */
u16 MacFrameControl; /* 0x2 */
Expand Down Expand Up @@ -741,7 +738,7 @@ BWL_PRE_PACKED_STRUCT struct d11txh {
u8 RTSPhyHeader[D11_PHY_HDR_LEN]; /* 0x2c - 0x2e */
struct dot11_rts_frame rts_frame; /* 0x2f - 0x36 */
u16 PAD; /* 0x37 */
} BWL_POST_PACKED_STRUCT;
} __attribute__((packed));

#define D11_TXH_LEN 112 /* bytes */

Expand Down Expand Up @@ -850,7 +847,7 @@ BWL_PRE_PACKED_STRUCT struct d11txh {

/* tx status packet */
typedef struct tx_status tx_status_t;
BWL_PRE_PACKED_STRUCT struct tx_status {
struct tx_status {
u16 framelen;
u16 PAD;
u16 frameid;
Expand All @@ -859,7 +856,7 @@ BWL_PRE_PACKED_STRUCT struct tx_status {
u16 sequence;
u16 phyerr;
u16 ackphyrxsh;
} BWL_POST_PACKED_STRUCT;
} __attribute__((packed));

#define TXSTATUS_LEN 16

Expand Down Expand Up @@ -1243,7 +1240,7 @@ BWL_PRE_PACKED_STRUCT struct tx_status {
#define MIMO_ANTSEL_OVERRIDE 0x8000 /* flag */

typedef struct shm_acparams shm_acparams_t;
BWL_PRE_PACKED_STRUCT struct shm_acparams {
struct shm_acparams {
u16 txop;
u16 cwmin;
u16 cwmax;
Expand All @@ -1253,7 +1250,7 @@ BWL_PRE_PACKED_STRUCT struct shm_acparams {
u16 reggap;
u16 status;
u16 rsvd[8];
} BWL_POST_PACKED_STRUCT;
} __attribute__((packed));
#define M_EDCF_QLEN (16 * 2)

#define WME_STATUS_NEWAC (1 << 8)
Expand Down Expand Up @@ -1302,7 +1299,7 @@ BWL_PRE_PACKED_STRUCT struct shm_acparams {

/* Receive Frame Data Header for 802.11b DCF-only frames */
typedef struct d11rxhdr d11rxhdr_t;
BWL_PRE_PACKED_STRUCT struct d11rxhdr {
struct d11rxhdr {
u16 RxFrameSize; /* Actual byte length of the frame data received */
u16 PAD;
u16 PhyRxStatus_0; /* PhyRxStatus 15:0 */
Expand All @@ -1315,21 +1312,21 @@ BWL_PRE_PACKED_STRUCT struct d11rxhdr {
u16 RxStatus2; /* extended MAC Rx status */
u16 RxTSFTime; /* RxTSFTime time of first MAC symbol + M_PHY_PLCPRX_DLY */
u16 RxChan; /* gain code, channel radio code, and phy type */
} BWL_POST_PACKED_STRUCT;
} __attribute__((packed));

#define RXHDR_LEN 24 /* sizeof d11rxhdr_t */
#define FRAMELEN(h) ((h)->RxFrameSize)

typedef struct wlc_d11rxhdr wlc_d11rxhdr_t;
BWL_PRE_PACKED_STRUCT struct wlc_d11rxhdr {
struct wlc_d11rxhdr {
d11rxhdr_t rxhdr;
u32 tsf_l; /* TSF_L reading */
s8 rssi; /* computed instanteneous rssi in BMAC */
s8 rxpwr0; /* obsoleted, place holder for legacy ROM code. use rxpwr[] */
s8 rxpwr1; /* obsoleted, place holder for legacy ROM code. use rxpwr[] */
s8 do_rssi_ma; /* do per-pkt sampling for per-antenna ma in HIGH */
s8 rxpwr[WL_RSSI_ANT_MAX]; /* rssi for supported antennas */
} BWL_POST_PACKED_STRUCT;
} __attribute__((packed));

/* PhyRxStatus_0: */
#define PRXS0_FT_MASK 0x0003 /* NPHY only: CCK, OFDM, preN, N */
Expand Down Expand Up @@ -1762,9 +1759,6 @@ typedef struct macstat {
#define TST_TXTEST_RATE_11MBPS 3
#define TST_TXTEST_RATE_SHIFT 3

/* This marks the end of a packed structure section. */
#include <packed_section_end.h>

#define SHM_BYT_CNT 0x2 /* IHR location */
#define MAX_BYT_CNT 0x600 /* Maximum frame len */

Expand Down
7 changes: 0 additions & 7 deletions drivers/staging/brcm80211/include/dhdioctl.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@
#ifndef _dhdioctl_h_
#define _dhdioctl_h_

/* require default structure packing */
#define BWL_DEFAULT_PACKING
#include <packed_section_start.h>

/* Linux network driver ioctl encoding */
typedef struct dhd_ioctl {
uint cmd; /* common ioctl definition */
Expand Down Expand Up @@ -101,7 +97,4 @@ typedef struct dhd_pktgen {
#define DHD_IDLE_STOP (-1) /* Request SD clock be stopped
(and use SD1 mode) */

/* require default structure packing */
#include <packed_section_end.h>

#endif /* _dhdioctl_h_ */
10 changes: 2 additions & 8 deletions drivers/staging/brcm80211/include/msgtrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,10 @@
#ifndef _MSGTRACE_H
#define _MSGTRACE_H

/* This marks the start of a packed structure section. */
#include <packed_section_start.h>

#define MSGTRACE_VERSION 1

/* Message trace header */
typedef BWL_PRE_PACKED_STRUCT struct msgtrace_hdr {
typedef struct msgtrace_hdr {
u8 version;
u8 spare;
u16 len; /* Len of the trace */
Expand All @@ -36,7 +33,7 @@ typedef BWL_PRE_PACKED_STRUCT struct msgtrace_hdr {
trace overflow */
u32 discarded_printf; /* Number of discarded printf
because of trace overflow */
} BWL_POST_PACKED_STRUCT msgtrace_hdr_t;
} __attribute__((packed)) msgtrace_hdr_t;

#define MSGTRACE_HDRLEN sizeof(msgtrace_hdr_t)

Expand All @@ -61,7 +58,4 @@ extern void msgtrace_put(char *buf, int count);
extern void msgtrace_init(void *hdl1, void *hdl2,
msgtrace_func_send_t func_send);

/* This marks the end of a packed structure section. */
#include <packed_section_end.h>

#endif /* _MSGTRACE_H */
32 changes: 0 additions & 32 deletions drivers/staging/brcm80211/include/packed_section_end.h

This file was deleted.

36 changes: 0 additions & 36 deletions drivers/staging/brcm80211/include/packed_section_start.h

This file was deleted.

30 changes: 14 additions & 16 deletions drivers/staging/brcm80211/include/proto/802.11.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#define _802_11_H_

#include <proto/ethernet.h>
#include <packed_section_start.h>

#define DOT11_A3_HDR_LEN 24
#define DOT11_A4_HDR_LEN 30
Expand All @@ -45,22 +44,22 @@

#define DOT11_OUI_LEN 3

BWL_PRE_PACKED_STRUCT struct dot11_header {
struct dot11_header {
u16 fc;
u16 durid;
struct ether_addr a1;
struct ether_addr a2;
struct ether_addr a3;
u16 seq;
struct ether_addr a4;
} BWL_POST_PACKED_STRUCT;
} __attribute__((packed));

BWL_PRE_PACKED_STRUCT struct dot11_rts_frame {
struct dot11_rts_frame {
u16 fc;
u16 durid;
struct ether_addr ra;
struct ether_addr ta;
} BWL_POST_PACKED_STRUCT;
} __attribute__((packed));

#define DOT11_RTS_LEN 16
#define DOT11_CTS_LEN 10
Expand All @@ -69,21 +68,21 @@ BWL_PRE_PACKED_STRUCT struct dot11_rts_frame {
#define DOT11_BA_BITMAP_LEN 128
#define DOT11_BA_LEN 4

BWL_PRE_PACKED_STRUCT struct dot11_management_header {
struct dot11_management_header {
u16 fc;
u16 durid;
struct ether_addr da;
struct ether_addr sa;
struct ether_addr bssid;
u16 seq;
} BWL_POST_PACKED_STRUCT;
} __attribute__((packed));
#define DOT11_MGMT_HDR_LEN 24

BWL_PRE_PACKED_STRUCT struct dot11_bcn_prb {
struct dot11_bcn_prb {
u32 timestamp[2];
u16 beacon_interval;
u16 capability;
} BWL_POST_PACKED_STRUCT;
} __attribute__((packed));
#define DOT11_BCN_PRB_LEN 12

#define WME_OUI "\x00\x50\xf2"
Expand All @@ -102,22 +101,22 @@ typedef u8 ac_bitmap_t;
#define AC_BITMAP_ALL 0xf
#define AC_BITMAP_TST(ab, ac) (((ab) & (1 << (ac))) != 0)

BWL_PRE_PACKED_STRUCT struct edcf_acparam {
struct edcf_acparam {
u8 ACI;
u8 ECW;
u16 TXOP;
} BWL_POST_PACKED_STRUCT;
} __attribute__((packed));
typedef struct edcf_acparam edcf_acparam_t;

BWL_PRE_PACKED_STRUCT struct wme_param_ie {
struct wme_param_ie {
u8 oui[3];
u8 type;
u8 subtype;
u8 version;
u8 qosinfo;
u8 rsvd;
edcf_acparam_t acparam[AC_COUNT];
} BWL_POST_PACKED_STRUCT;
} __attribute__((packed));
typedef struct wme_param_ie wme_param_ie_t;
#define WME_PARAM_IE_LEN 24

Expand Down Expand Up @@ -253,14 +252,14 @@ typedef struct d11cnt {

#define MCSSET_LEN 16

BWL_PRE_PACKED_STRUCT struct ht_cap_ie {
struct ht_cap_ie {
u16 cap;
u8 params;
u8 supp_mcs[MCSSET_LEN];
u16 ext_htcap;
u32 txbf_cap;
u8 as_cap;
} BWL_POST_PACKED_STRUCT;
} __attribute__((packed));
typedef struct ht_cap_ie ht_cap_ie_t;

#define HT_CAP_IE_LEN 26
Expand Down Expand Up @@ -317,6 +316,5 @@ typedef struct ht_cap_ie ht_cap_ie_t;
#define AES_KEY_SIZE 16

#define BRCM_OUI "\x00\x10\x18"
#include <packed_section_end.h>

#endif /* _802_11_H_ */
8 changes: 2 additions & 6 deletions drivers/staging/brcm80211/include/proto/bcmeth.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
#ifndef _BCMETH_H_
#define _BCMETH_H_

#include <packed_section_start.h>

#define BCMILCP_SUBTYPE_RATE 1
#define BCMILCP_SUBTYPE_LINK 2
#define BCMILCP_SUBTYPE_CSA 3
Expand All @@ -35,14 +33,12 @@
#define BCMILCP_BCM_SUBTYPEHDR_MINLENGTH 8
#define BCMILCP_BCM_SUBTYPEHDR_VERSION 0

typedef BWL_PRE_PACKED_STRUCT struct bcmeth_hdr {
typedef struct bcmeth_hdr {
u16 subtype;
u16 length;
u8 version;
u8 oui[3];
u16 usr_subtype;
} BWL_POST_PACKED_STRUCT bcmeth_hdr_t;

#include <packed_section_end.h>
} __attribute__((packed)) bcmeth_hdr_t;

#endif /* _BCMETH_H_ */
Loading

0 comments on commit 1e66108

Please sign in to comment.