Commit ba2d3587 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller
Browse files

drivers/net: use __packed annotation



cleanup patch.

Use new __packed annotation in drivers/net/
Signed-off-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1273d976
......@@ -305,7 +305,7 @@ struct dfu_status {
unsigned char poll_timeout[3];
unsigned char state;
unsigned char string;
} __attribute__((packed));
} __packed;
static inline int at76_is_intersil(enum board_type board)
{
......
......@@ -99,7 +99,7 @@ struct hwcfg_r505 {
u8 reserved2[14];
u8 cr15_values[14];
u8 reserved3[3];
} __attribute__((packed));
} __packed;
struct hwcfg_rfmd {
u8 cr20_values[14];
......@@ -111,7 +111,7 @@ struct hwcfg_rfmd {
u8 low_power_values[14];
u8 normal_power_values[14];
u8 reserved1[3];
} __attribute__((packed));
} __packed;
struct hwcfg_intersil {
u8 mac_addr[ETH_ALEN];
......@@ -120,7 +120,7 @@ struct hwcfg_intersil {
u8 pidvid[4];
u8 regulatory_domain;
u8 reserved[1];
} __attribute__((packed));
} __packed;
union at76_hwcfg {
struct hwcfg_intersil i;
......@@ -149,14 +149,14 @@ struct at76_card_config {
u8 ssid_len;
u8 short_preamble;
__le16 beacon_period;
} __attribute__((packed));
} __packed;
struct at76_command {
u8 cmd;
u8 reserved;
__le16 size;
u8 data[0];
} __attribute__((packed));
} __packed;
/* Length of Atmel-specific Rx header before 802.11 frame */
#define AT76_RX_HDRLEN offsetof(struct at76_rx_buffer, packet)
......@@ -171,7 +171,7 @@ struct at76_rx_buffer {
u8 noise_level;
__le32 rx_time;
u8 packet[IEEE80211_MAX_FRAG_THRESHOLD];
} __attribute__((packed));
} __packed;
/* Length of Atmel-specific Tx header before 802.11 frame */
#define AT76_TX_HDRLEN offsetof(struct at76_tx_buffer, packet)
......@@ -182,7 +182,7 @@ struct at76_tx_buffer {
u8 padding;
u8 reserved[4];
u8 packet[IEEE80211_MAX_FRAG_THRESHOLD];
} __attribute__((packed));
} __packed;
/* defines for scan_type below */
#define SCAN_TYPE_ACTIVE 0
......@@ -198,7 +198,7 @@ struct at76_req_scan {
__le16 max_channel_time;
u8 essid_size;
u8 international_scan;
} __attribute__((packed));
} __packed;
struct at76_req_ibss {
u8 bssid[ETH_ALEN];
......@@ -207,7 +207,7 @@ struct at76_req_ibss {
u8 channel;
u8 essid_size;
u8 reserved[3];
} __attribute__((packed));
} __packed;
struct at76_req_join {
u8 bssid[ETH_ALEN];
......@@ -217,7 +217,7 @@ struct at76_req_join {
__le16 timeout;
u8 essid_size;
u8 reserved;
} __attribute__((packed));
} __packed;
struct set_mib_buffer {
u8 type;
......@@ -229,7 +229,7 @@ struct set_mib_buffer {
__le16 word;
u8 addr[ETH_ALEN];
} data;
} __attribute__((packed));
} __packed;
struct mib_local {
u16 reserved0;
......@@ -241,14 +241,14 @@ struct mib_local {
u16 reserved2;
u8 preamble_type;
u16 reserved3;
} __attribute__((packed));
} __packed;
struct mib_mac_addr {
u8 mac_addr[ETH_ALEN];
u8 res[2]; /* ??? */
u8 group_addr[4][ETH_ALEN];
u8 group_addr_status[4];
} __attribute__((packed));
} __packed;
struct mib_mac {
__le32 max_tx_msdu_lifetime;
......@@ -269,7 +269,7 @@ struct mib_mac {
u8 desired_bssid[ETH_ALEN];
u8 desired_bsstype; /* ad-hoc or infrastructure */
u8 reserved2;
} __attribute__((packed));
} __packed;
struct mib_mac_mgmt {
__le16 beacon_period;
......@@ -292,7 +292,7 @@ struct mib_mac_mgmt {
u8 multi_domain_capability_enabled;
u8 country_string[3];
u8 reserved[3];
} __attribute__((packed));
} __packed;
struct mib_mac_wep {
u8 privacy_invoked; /* 0 disable encr., 1 enable encr */
......@@ -303,7 +303,7 @@ struct mib_mac_wep {
__le32 wep_excluded_count;
u8 wep_default_keyvalue[WEP_KEYS][WEP_LARGE_KEY_LEN];
u8 encryption_level; /* 1 for 40bit, 2 for 104bit encryption */
} __attribute__((packed));
} __packed;
struct mib_phy {
__le32 ed_threshold;
......@@ -320,19 +320,19 @@ struct mib_phy {
u8 current_cca_mode;
u8 phy_type;
u8 current_reg_domain;
} __attribute__((packed));
} __packed;
struct mib_fw_version {
u8 major;
u8 minor;
u8 patch;
u8 build;
} __attribute__((packed));
} __packed;
struct mib_mdomain {
u8 tx_powerlevel[14];
u8 channel_list[14]; /* 0 for invalid channels */
} __attribute__((packed));
} __packed;
struct at76_fw_header {
__le32 crc; /* CRC32 of the whole image */
......@@ -346,7 +346,7 @@ struct at76_fw_header {
__le32 int_fw_len; /* internal firmware image length */
__le32 ext_fw_offset; /* external firmware image offset */
__le32 ext_fw_len; /* external firmware image length */
} __attribute__((packed));
} __packed;
/* a description of a regulatory domain and the allowed channels */
struct reg_domain {
......
......@@ -530,7 +530,7 @@ struct b43_fw_header {
/* Size of the data. For ucode and PCM this is in bytes.
* For IV this is number-of-ivs. */
__be32 size;
} __attribute__((__packed__));
} __packed;
/* Initial Value file format */
#define B43_IV_OFFSET_MASK 0x7FFF
......@@ -540,8 +540,8 @@ struct b43_iv {
union {
__be16 d16;
__be32 d32;
} data __attribute__((__packed__));
} __attribute__((__packed__));
} data __packed;
} __packed;
/* Data structures for DMA transmission, per 80211 core. */
......
......@@ -67,7 +67,7 @@
struct b43_dmadesc32 {
__le32 control;
__le32 address;
} __attribute__ ((__packed__));
} __packed;
#define B43_DMA32_DCTL_BYTECNT 0x00001FFF
#define B43_DMA32_DCTL_ADDREXT_MASK 0x00030000
#define B43_DMA32_DCTL_ADDREXT_SHIFT 16
......@@ -140,7 +140,7 @@ struct b43_dmadesc64 {
__le32 control1;
__le32 address_low;
__le32 address_high;
} __attribute__ ((__packed__));
} __packed;
#define B43_DMA64_DCTL0_DTABLEEND 0x10000000
#define B43_DMA64_DCTL0_IRQ 0x20000000
#define B43_DMA64_DCTL0_FRAMEEND 0x40000000
......@@ -153,8 +153,8 @@ struct b43_dmadesc_generic {
union {
struct b43_dmadesc32 dma32;
struct b43_dmadesc64 dma64;
} __attribute__ ((__packed__));
} __attribute__ ((__packed__));
} __packed;
} __packed;
/* Misc DMA constants */
#define B43_DMA_RINGMEMSIZE PAGE_SIZE
......
......@@ -10,8 +10,8 @@
union { \
__le32 data; \
__u8 raw[size]; \
} __attribute__((__packed__)); \
} __attribute__((__packed__))
} __packed; \
} __packed
/* struct b43_plcp_hdr4 */
_b43_declare_plcp_hdr(4);
......@@ -57,7 +57,7 @@ struct b43_txhdr {
__u8 rts_frame[16]; /* The RTS frame (if used) */
PAD_BYTES(2);
struct b43_plcp_hdr6 plcp; /* Main PLCP header */
} new_format __attribute__ ((__packed__));
} new_format __packed;
/* The old r351 format. */
struct {
......@@ -68,10 +68,10 @@ struct b43_txhdr {
__u8 rts_frame[16]; /* The RTS frame (if used) */
PAD_BYTES(2);
struct b43_plcp_hdr6 plcp; /* Main PLCP header */
} old_format __attribute__ ((__packed__));
} old_format __packed;
} __attribute__ ((__packed__));
} __attribute__ ((__packed__));
} __packed;
} __packed;
/* MAC TX control */
#define B43_TXH_MAC_USEFBR 0x10000000 /* Use fallback rate for this AMPDU */
......@@ -218,20 +218,20 @@ struct b43_rxhdr_fw4 {
struct {
__u8 jssi; /* PHY RX Status 1: JSSI */
__u8 sig_qual; /* PHY RX Status 1: Signal Quality */
} __attribute__ ((__packed__));
} __packed;
/* RSSI for N-PHYs */
struct {
__s8 power0; /* PHY RX Status 1: Power 0 */
__s8 power1; /* PHY RX Status 1: Power 1 */
} __attribute__ ((__packed__));
} __attribute__ ((__packed__));
} __packed;
} __packed;
__le16 phy_status2; /* PHY RX Status 2 */
__le16 phy_status3; /* PHY RX Status 3 */
__le32 mac_status; /* MAC RX status */
__le16 mac_time;
__le16 channel;
} __attribute__ ((__packed__));
} __packed;
/* PHY RX Status 0 */
#define B43_RX_PHYST0_GAINCTL 0x4000 /* Gain Control */
......
......@@ -372,7 +372,7 @@ struct b43legacy_fw_header {
/* Size of the data. For ucode and PCM this is in bytes.
* For IV this is number-of-ivs. */
__be32 size;
} __attribute__((__packed__));
} __packed;
/* Initial Value file format */
#define B43legacy_IV_OFFSET_MASK 0x7FFF
......@@ -382,8 +382,8 @@ struct b43legacy_iv {
union {
__be16 d16;
__be32 d32;
} data __attribute__((__packed__));
} __attribute__((__packed__));
} data __packed;
} __packed;
#define B43legacy_PHYMODE(phytype) (1 << (phytype))
#define B43legacy_PHYMODE_B B43legacy_PHYMODE \
......
......@@ -72,7 +72,7 @@
struct b43legacy_dmadesc32 {
__le32 control;
__le32 address;
} __attribute__((__packed__));
} __packed;
#define B43legacy_DMA32_DCTL_BYTECNT 0x00001FFF
#define B43legacy_DMA32_DCTL_ADDREXT_MASK 0x00030000
#define B43legacy_DMA32_DCTL_ADDREXT_SHIFT 16
......@@ -147,7 +147,7 @@ struct b43legacy_dmadesc64 {
__le32 control1;
__le32 address_low;
__le32 address_high;
} __attribute__((__packed__));
} __packed;
#define B43legacy_DMA64_DCTL0_DTABLEEND 0x10000000
#define B43legacy_DMA64_DCTL0_IRQ 0x20000000
#define B43legacy_DMA64_DCTL0_FRAMEEND 0x40000000
......@@ -162,8 +162,8 @@ struct b43legacy_dmadesc_generic {
union {
struct b43legacy_dmadesc32 dma32;
struct b43legacy_dmadesc64 dma64;
} __attribute__((__packed__));
} __attribute__((__packed__));
} __packed;
} __packed;
/* Misc DMA constants */
......
......@@ -9,8 +9,8 @@
union { \
__le32 data; \
__u8 raw[size]; \
} __attribute__((__packed__)); \
} __attribute__((__packed__))
} __packed; \
} __packed
/* struct b43legacy_plcp_hdr4 */
_b43legacy_declare_plcp_hdr(4);
......@@ -39,7 +39,7 @@ struct b43legacy_txhdr_fw3 {
struct b43legacy_plcp_hdr6 rts_plcp; /* RTS PLCP */
__u8 rts_frame[18]; /* The RTS frame (if used) */
struct b43legacy_plcp_hdr6 plcp;
} __attribute__((__packed__));
} __packed;
/* MAC TX control */
#define B43legacy_TX4_MAC_KEYIDX 0x0FF00000 /* Security key index */
......@@ -123,7 +123,7 @@ struct b43legacy_hwtxstatus {
__le16 seq;
u8 phy_stat;
PAD_BYTES(1);
} __attribute__((__packed__));
} __packed;
/* Receive header for v3 firmware. */
......@@ -138,7 +138,7 @@ struct b43legacy_rxhdr_fw3 {
__le16 mac_status; /* MAC RX status */
__le16 mac_time;
__le16 channel;
} __attribute__((__packed__));
} __packed;
/* PHY RX Status 0 */
......
......@@ -19,35 +19,35 @@ struct hostap_ieee80211_mgmt {
__le16 status_code;
/* possibly followed by Challenge text */
u8 variable[0];
} __attribute__ ((packed)) auth;
} __packed auth;
struct {
__le16 reason_code;
} __attribute__ ((packed)) deauth;
} __packed deauth;
struct {
__le16 capab_info;
__le16 listen_interval;
/* followed by SSID and Supported rates */
u8 variable[0];
} __attribute__ ((packed)) assoc_req;
} __packed assoc_req;
struct {
__le16 capab_info;
__le16 status_code;
__le16 aid;
/* followed by Supported rates */
u8 variable[0];
} __attribute__ ((packed)) assoc_resp, reassoc_resp;
} __packed assoc_resp, reassoc_resp;
struct {
__le16 capab_info;
__le16 listen_interval;
u8 current_ap[6];
/* followed by SSID and Supported rates */
u8 variable[0];
} __attribute__ ((packed)) reassoc_req;
} __packed reassoc_req;
struct {
__le16 reason_code;
} __attribute__ ((packed)) disassoc;
} __packed disassoc;
struct {
} __attribute__ ((packed)) probe_req;
} __packed probe_req;
struct {
u8 timestamp[8];
__le16 beacon_int;
......@@ -55,9 +55,9 @@ struct hostap_ieee80211_mgmt {
/* followed by some of SSID, Supported rates,
* FH Params, DS Params, CF Params, IBSS Params, TIM */
u8 variable[0];
} __attribute__ ((packed)) beacon, probe_resp;
} __packed beacon, probe_resp;
} u;
} __attribute__ ((packed));
} __packed;
#define IEEE80211_MGMT_HDR_LEN 24
......
......@@ -179,7 +179,7 @@ struct hfa384x_comp_ident
__le16 variant;
__le16 major;
__le16 minor;
} __attribute__ ((packed));
} __packed;
#define HFA384X_COMP_ID_PRI 0x15
#define HFA384X_COMP_ID_STA 0x1f
......@@ -192,14 +192,14 @@ struct hfa384x_sup_range
__le16 variant;
__le16 bottom;
__le16 top;
} __attribute__ ((packed));
} __packed;
struct hfa384x_build_id
{
__le16 pri_seq;
__le16 sec_seq;
} __attribute__ ((packed));
} __packed;
/* FD01 - Download Buffer */
struct hfa384x_rid_download_buffer
......@@ -207,14 +207,14 @@ struct hfa384x_rid_download_buffer
__le16 page;
__le16 offset;
__le16 length;
} __attribute__ ((packed));
} __packed;
/* BSS connection quality (RID FD43 range, RID FD51 dBm-normalized) */
struct hfa384x_comms_quality {
__le16 comm_qual; /* 0 .. 92 */
__le16 signal_level; /* 27 .. 154 */
__le16 noise_level; /* 27 .. 154 */
} __attribute__ ((packed));
} __packed;
/* netdevice private ioctls (used, e.g., with iwpriv from user space) */
......
......@@ -31,14 +31,14 @@ struct linux_wlan_ng_val {
u32 did;
u16 status, len;
u32 data;
} __attribute__ ((packed));
} __packed;
struct linux_wlan_ng_prism_hdr {
u32 msgcode, msglen;
char devname[16];
struct linux_wlan_ng_val hosttime, mactime, channel, rssi, sq, signal,
noise, rate, istx, frmlen;
} __attribute__ ((packed));
} __packed;
struct linux_wlan_ng_cap_hdr {
__be32 version;
......@@ -55,7 +55,7 @@ struct linux_wlan_ng_cap_hdr {
__be32 ssi_noise;
__be32 preamble;
__be32 encoding;
} __attribute__ ((packed));
} __packed;
struct hostap_radiotap_rx {
struct ieee80211_radiotap_header hdr;
......@@ -66,7 +66,7 @@ struct hostap_radiotap_rx {
__le16 chan_flags;
s8 dbm_antsignal;
s8 dbm_antnoise;
} __attribute__ ((packed));
} __packed;
#define LWNG_CAP_DID_BASE (4 | (1 << 6)) /* section 4, group 1 */
#define LWNG_CAPHDR_VERSION 0x80211001
......@@ -97,7 +97,7 @@ struct hfa384x_rx_frame {
__be16 len;
/* followed by frame data; max 2304 bytes */
} __attribute__ ((packed));
} __packed;
struct hfa384x_tx_frame {
......@@ -126,14 +126,14 @@ struct hfa384x_tx_frame {
__be16 len;
/* followed by frame data; max 2304 bytes */
} __attribute__ ((packed));
} __packed;
struct hfa384x_rid_hdr
{
__le16 len;
__le16 rid;
} __attribute__ ((packed));
} __packed;
/* Macro for converting signal levels (range 27 .. 154) to wireless ext
......@@ -145,24 +145,24 @@ struct hfa384x_rid_hdr
struct hfa384x_scan_request {
__le16 channel_list;
__le16 txrate; /* HFA384X_RATES_* */
} __attribute__ ((packed));
} __packed;
struct hfa384x_hostscan_request {
__le16 channel_list;
__le16 txrate;
__le16 target_ssid_len;
u8 target_ssid[32];
} __attribute__ ((packed));
} __packed;
struct hfa384x_join_request {
u8 bssid[6];
__le16 channel;
} __attribute__ ((packed));
} __packed;
struct hfa384x_info_frame {
__le16 len;
__le16 type;
} __attribute__ ((packed));
} __packed;
struct hfa384x_comm_tallies {
__le16 tx_unicast_frames;
......@@ -186,7 +186,7 @@ struct hfa384x_comm_tallies {
__le16 rx_discards_wep_undecryptable;
__le16 rx_message_in_msg_fragments;
__le16 rx_message_in_bad_msg_fragments;
} __attribute__ ((packed));
} __packed;
struct hfa384x_comm_tallies32 {
__le32 tx_unicast_frames;
......@@ -210,7 +210,7 @@ struct hfa384x_comm_tallies32 {
__le32 rx_discards_wep_undecryptable;
__le32 rx_message_in_msg_fragments;
__le32 rx_message_in_bad_msg_fragments;
} __attribute__ ((packed));
} __packed;
struct hfa384x_scan_result_hdr {
__le16 reserved;
......@@ -219,7 +219,7 @@ struct hfa384x_scan_result_hdr {
#define HFA384X_SCAN_HOST_INITIATED 1
#define HFA384X_SCAN_FIRMWARE_INITIATED 2
#define HFA384X_SCAN_INQUIRY_FROM_HOST 3
} __attribute__ ((packed));
} __packed;
#define HFA384X_SCAN_MAX_RESULTS 32
......@@ -234,7 +234,7 @@ struct hfa384x_scan_result {
u8 ssid[32];
u8 sup_rates[10];
__le16 rate;
} __attribute__ ((packed));
} __packed;
struct hfa384x_hostscan_result {
__le16 chid;
......@@ -248,7 +248,7 @@ struct hfa384x_hostscan_result {
u8 sup_rates[10];
__le16 rate;
__le16 atim;
} __attribute__ ((packed));
} __packed;
struct comm_tallies_sums {
unsigned int tx_unicast_frames;
......
......@@ -5233,7 +5233,7 @@ struct security_info_params {
u8 auth_mode;
u8 replay_counters_number;
u8 unicast_using_group;
} __attribute__ ((packed));
} __packed;
static int ipw2100_set_security_information(struct ipw2100_priv *priv,
int auth_mode,
......@@ -8475,7 +8475,7 @@ struct ipw2100_fw_header {
short mode;
unsigned int fw_size;
unsigned int uc_size;
} __attribute__ ((packed));
} __packed;
static int ipw2100_mod_firmware_load(struct ipw2100_fw *fw)
{
......
......@@ -164,7 +164,7 @@ struct bd_status {
} fields;
u8 field;
} info;