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
......@@ -334,7 +334,7 @@ struct txd_desc {
u32 va_lo;
u32 va_hi;
struct pbl pbl[0]; /* Fragments */
} __attribute__ ((packed));
} __packed;
/* Register region size */
#define BDX_REGS_SIZE 0x1000
......
......@@ -262,13 +262,13 @@ struct de_srom_media_block {
u16 csr13;
u16 csr14;
u16 csr15;
} __attribute__((packed));
} __packed;
struct de_srom_info_leaf {
u16 default_media;
u8 n_blocks;
u8 unused;
} __attribute__((packed));
} __packed;
struct de_desc {
__le32 opts1;
......
......@@ -255,7 +255,7 @@ struct typhoon_shared {
struct rx_free rxBuff[RXFREE_ENTRIES] __3xp_aligned;
u32 zeroWord;
struct tx_desc txHi[TXHI_ENTRIES];
} __attribute__ ((packed));
} __packed;
struct rxbuff_ent {
struct sk_buff *skb;
......
......@@ -77,7 +77,7 @@ struct typhoon_indexes {
volatile __le32 cmdCleared;
volatile __le32 respReady;
volatile __le32 rxHiReady;
} __attribute__ ((packed));
} __packed;
/* The host<->Typhoon interface
* Our means of communicating where things are
......@@ -125,7 +125,7 @@ struct typhoon_interface {
__le32 rxHiAddr;
__le32 rxHiAddrHi;
__le32 rxHiSize;
} __attribute__ ((packed));
} __packed;
/* The Typhoon transmit/fragment descriptor
*
......@@ -187,7 +187,7 @@ struct tx_desc {
#define TYPHOON_TX_PF_VLAN_MASK cpu_to_le32(0x0ffff000)
#define TYPHOON_TX_PF_INTERNAL cpu_to_le32(0xf0000000)
#define TYPHOON_TX_PF_VLAN_TAG_SHIFT 12
} __attribute__ ((packed));
} __packed;
/* The TCP Segmentation offload option descriptor
*
......@@ -208,7 +208,7 @@ struct tcpopt_desc {
__le32 respAddrLo;
__le32 bytesTx;
__le32 status;
} __attribute__ ((packed));
} __packed;
/* The IPSEC Offload descriptor
*
......@@ -227,7 +227,7 @@ struct ipsec_desc {
__le32 sa1;
__le32 sa2;
__le32 reserved;
} __attribute__ ((packed));
} __packed;
/* The Typhoon receive descriptor (Updated by NIC)
*
......@@ -284,7 +284,7 @@ struct rx_desc {
#define TYPHOON_RX_UNKNOWN_SA cpu_to_le16(0x0100)
#define TYPHOON_RX_ESP_FORMAT_ERR cpu_to_le16(0x0200)
__be32 vlanTag;
} __attribute__ ((packed));
} __packed;
/* The Typhoon free buffer descriptor, used to give a buffer to the NIC
*
......@@ -301,7 +301,7 @@ struct rx_free {
__le32 physAddrHi;
u32 virtAddr;
u32 virtAddrHi;
} __attribute__ ((packed));
} __packed;
/* The Typhoon command descriptor, used for commands and responses
*
......@@ -347,7 +347,7 @@ struct cmd_desc {
__le16 parm1;
__le32 parm2;
__le32 parm3;
} __attribute__ ((packed));
} __packed;
/* The Typhoon response descriptor, see command descriptor for details
*/
......@@ -359,7 +359,7 @@ struct resp_desc {
__le16 parm1;
__le32 parm2;
__le32 parm3;
} __attribute__ ((packed));
} __packed;
#define INIT_COMMAND_NO_RESPONSE(x, command) \
do { struct cmd_desc *_ptr = (x); \
......@@ -427,7 +427,7 @@ struct stats_resp {
#define TYPHOON_LINK_HALF_DUPLEX cpu_to_le32(0x00000000)
__le32 unused2;
__le32 unused3;
} __attribute__ ((packed));
} __packed;
/* TYPHOON_CMD_XCVR_SELECT xcvr values (resp.parm1)
*/
......@@ -488,7 +488,7 @@ struct sa_descriptor {
u32 index;
u32 unused;
u32 unused2;
} __attribute__ ((packed));
} __packed;
/* TYPHOON_CMD_SET_OFFLOAD_TASKS bits (cmd.parm2 (Tx) & cmd.parm3 (Rx))
* This is all for IPv4.
......@@ -518,14 +518,14 @@ struct typhoon_file_header {
__le32 numSections;
__le32 startAddr;
__le32 hmacDigest[5];
} __attribute__ ((packed));
} __packed;
struct typhoon_section_header {
__le32 len;
u16 checksum;
u16 reserved;
__le32 startAddr;
} __attribute__ ((packed));
} __packed;
/* The Typhoon Register offsets
*/
......
......@@ -106,7 +106,7 @@ struct ucc_geth {
u32 scar; /* Statistics carry register */
u32 scam; /* Statistics caryy mask register */
u8 res5[0x200 - 0x1c4];
} __attribute__ ((packed));
} __packed;
/* UCC GETH TEMODR Register */
#define TEMODER_TX_RMON_STATISTICS_ENABLE 0x0100 /* enable Tx statistics
......@@ -420,11 +420,11 @@ struct ucc_geth {
struct ucc_geth_thread_data_tx {
u8 res0[104];
} __attribute__ ((packed));
} __packed;
struct ucc_geth_thread_data_rx {
u8 res0[40];
} __attribute__ ((packed));
} __packed;
/* Send Queue Queue-Descriptor */
struct ucc_geth_send_queue_qd {
......@@ -432,19 +432,19 @@ struct ucc_geth_send_queue_qd {
u8 res0[0x8];
u32 last_bd_completed_address;/* initialize to last entry in BD ring */
u8 res1[0x30];
} __attribute__ ((packed));
} __packed;
struct ucc_geth_send_queue_mem_region {
struct ucc_geth_send_queue_qd sqqd[NUM_TX_QUEUES];
} __attribute__ ((packed));
} __packed;
struct ucc_geth_thread_tx_pram {
u8 res0[64];
} __attribute__ ((packed));
} __packed;
struct ucc_geth_thread_rx_pram {
u8 res0[128];
} __attribute__ ((packed));
} __packed;
#define THREAD_RX_PRAM_ADDITIONAL_FOR_EXTENDED_FILTERING 64
#define THREAD_RX_PRAM_ADDITIONAL_FOR_EXTENDED_FILTERING_8 64
......@@ -484,7 +484,7 @@ struct ucc_geth_scheduler {
/**< weight factor for queues */
u32 minw; /* temporary variable handled by QE */
u8 res1[0x70 - 0x64];
} __attribute__ ((packed));
} __packed;
struct ucc_geth_tx_firmware_statistics_pram {
u32 sicoltx; /* single collision */
......@@ -506,7 +506,7 @@ struct ucc_geth_tx_firmware_statistics_pram {
and 1518 octets */
u32 txpktsjumbo; /* total packets (including bad) between 1024
and MAXLength octets */
} __attribute__ ((packed));
} __packed;
struct ucc_geth_rx_firmware_statistics_pram {
u32 frrxfcser; /* frames with crc error */
......@@ -540,7 +540,7 @@ struct ucc_geth_rx_firmware_statistics_pram {
replaced */
u32 insertvlan; /* total frames that had their VLAN tag
inserted */
} __attribute__ ((packed));
} __packed;
struct ucc_geth_rx_interrupt_coalescing_entry {
u32 interruptcoalescingmaxvalue; /* interrupt coalescing max
......@@ -548,23 +548,23 @@ struct ucc_geth_rx_interrupt_coalescing_entry {
u32 interruptcoalescingcounter; /* interrupt coalescing counter,
initialize to
interruptcoalescingmaxvalue */
} __attribute__ ((packed));
} __packed;
struct ucc_geth_rx_interrupt_coalescing_table {
struct ucc_geth_rx_interrupt_coalescing_entry coalescingentry[NUM_RX_QUEUES];
/**< interrupt coalescing entry */
} __attribute__ ((packed));
} __packed;
struct ucc_geth_rx_prefetched_bds {
struct qe_bd bd[NUM_BDS_IN_PREFETCHED_BDS]; /* prefetched bd */
} __attribute__ ((packed));
} __packed;
struct ucc_geth_rx_bd_queues_entry {
u32 bdbaseptr; /* BD base pointer */
u32 bdptr; /* BD pointer */
u32 externalbdbaseptr; /* external BD base pointer */
u32 externalbdptr; /* external BD pointer */
} __attribute__ ((packed));
} __packed;
struct ucc_geth_tx_global_pram {
u16 temoder;
......@@ -580,13 +580,13 @@ struct ucc_geth_tx_global_pram {
u32 tqptr; /* a base pointer to the Tx Queues Memory
Region */
u8 res2[0x80 - 0x74];
} __attribute__ ((packed));
} __packed;
/* structure representing Extended Filtering Global Parameters in PRAM */
struct ucc_geth_exf_global_pram {
u32 l2pcdptr; /* individual address filter, high */
u8 res0[0x10 - 0x04];
} __attribute__ ((packed));
} __packed;
struct ucc_geth_rx_global_pram {
u32 remoder; /* ethernet mode reg. */
......@@ -620,7 +620,7 @@ struct ucc_geth_rx_global_pram {
u32 exfGlobalParam; /* base address for extended filtering global
parameters */
u8 res6[0x100 - 0xC4]; /* Initialize to zero */
} __attribute__ ((packed));
} __packed;
#define GRACEFUL_STOP_ACKNOWLEDGE_RX 0x01
......@@ -639,7 +639,7 @@ struct ucc_geth_init_pram {
u32 txglobal; /* tx global */
u32 txthread[ENET_INIT_PARAM_MAX_ENTRIES_TX]; /* tx threads */
u8 res3[0x1];
} __attribute__ ((packed));
} __packed;
#define ENET_INIT_PARAM_RGF_SHIFT (32 - 4)
#define ENET_INIT_PARAM_TGF_SHIFT (32 - 8)
......@@ -661,7 +661,7 @@ struct ucc_geth_82xx_enet_address {
u16 h; /* address (MSB) */
u16 m; /* address */
u16 l; /* address (LSB) */
} __attribute__ ((packed));
} __packed;
/* structure representing 82xx Address Filtering PRAM */
struct ucc_geth_82xx_address_filtering_pram {
......@@ -672,7 +672,7 @@ struct ucc_geth_82xx_address_filtering_pram {
struct ucc_geth_82xx_enet_address __iomem taddr;
struct ucc_geth_82xx_enet_address __iomem paddr[NUM_OF_PADDRS];
u8 res0[0x40 - 0x38];
} __attribute__ ((packed));
} __packed;
/* GETH Tx firmware statistics structure, used when calling
UCC_GETH_GetStatistics. */
......@@ -696,7 +696,7 @@ struct ucc_geth_tx_firmware_statistics {
and 1518 octets */
u32 txpktsjumbo; /* total packets (including bad) between 1024
and MAXLength octets */
} __attribute__ ((packed));
} __packed;
/* GETH Rx firmware statistics structure, used when calling
UCC_GETH_GetStatistics. */
......@@ -732,7 +732,7 @@ struct ucc_geth_rx_firmware_statistics {
replaced */
u32 insertvlan; /* total frames that had their VLAN tag
inserted */
} __attribute__ ((packed));
} __packed;
/* GETH hardware statistics structure, used when calling
UCC_GETH_GetStatistics. */
......@@ -781,7 +781,7 @@ struct ucc_geth_hardware_statistics {
u32 rbca; /* Total number of frames received successfully
that had destination address equal to the
broadcast address */
} __attribute__ ((packed));
} __packed;
/* UCC GETH Tx errors returned via TxConf callback */
#define TX_ERRORS_DEF 0x0200
......
......@@ -179,7 +179,7 @@ struct ax88172_int_data {
__le16 res2;
u8 status;
__le16 res3;
} __attribute__ ((packed));
} __packed;
static int asix_read_cmd(struct usbnet *dev, u8 cmd, u16 value, u16 index,
u16 size, void *data)
......
......@@ -211,7 +211,7 @@ struct hso_serial_state_notification {
u16 wIndex;
u16 wLength;
u16 UART_state_bitmap;
} __attribute__((packed));
} __packed;
struct hso_tiocmget {
struct mutex mutex;
......
......@@ -207,7 +207,7 @@ struct kaweth_ethernet_configuration
__le16 segment_size;
__u16 max_multicast_filters;
__u8 reserved3;
} __attribute__ ((packed));
} __packed;
/****************************************************************
* kaweth_device
......
......@@ -64,13 +64,13 @@ struct nc_header { // packed:
// all else is optional, and must start with:
// __le16 vendorId; // from usb-if
// __le16 productId;
} __attribute__((__packed__));
} __packed;
#define PAD_BYTE ((unsigned char)0xAC)
struct nc_trailer {
__le16 packet_id;
} __attribute__((__packed__));
} __packed;
// packets may use FLAG_FRAMING_NC and optional pad
#define FRAMED_SIZE(mtu) (sizeof (struct nc_header) \
......
......@@ -165,7 +165,7 @@ struct lsi_umts {
u8 gw_addr_len; /* NW-supplied GW address len */
u8 gw_addr[16]; /* NW-supplied GW address (bigendian) */
u8 reserved[8];
} __attribute__ ((packed));
} __packed;
#define SIERRA_NET_LSI_COMMON_LEN 4
#define SIERRA_NET_LSI_UMTS_LEN (sizeof(struct lsi_umts))
......
......@@ -193,7 +193,7 @@ struct rx_desc {
__le32 pa_low; /* Low 32 bit PCI address */
__le16 pa_high; /* Next 16 bit PCI address (48 total) */
__le16 size; /* bits 0--14 - frame size, bit 15 - enable int. */
} __attribute__ ((__packed__));
} __packed;
/*
* Transmit descriptor
......@@ -208,7 +208,7 @@ struct tdesc1 {
__le16 vlan;
u8 TCR;
u8 cmd; /* bits 0--1 - TCPLS, bits 4--7 - CMDZ */
} __attribute__ ((__packed__));
} __packed;
enum {
TD_QUEUE = cpu_to_le16(0x8000)
......@@ -218,7 +218,7 @@ struct td_buf {
__le32 pa_low;
__le16 pa_high;
__le16 size; /* bits 0--13 - size, bit 15 - queue */
} __attribute__ ((__packed__));
} __packed;
struct tx_desc {
struct tdesc0 tdesc0;
......@@ -1096,7 +1096,7 @@ struct mac_regs {
volatile __le16 PatternCRC[8]; /* 0xB0 */
volatile __le32 ByteMask[4][4]; /* 0xC0 */
} __attribute__ ((__packed__));
} __packed;
enum hw_mib {
......@@ -1216,7 +1216,7 @@ struct arp_packet {
u8 ar_sip[4];
u8 ar_tha[ETH_ALEN];
u8 ar_tip[4];
} __attribute__ ((__packed__));
} __packed;
struct _magic_packet {
u8 dest_mac[6];
......@@ -1224,7 +1224,7 @@ struct _magic_packet {
__be16 type;
u8 MAC[16][6];
u8 password[6];
} __attribute__ ((__packed__));
} __packed;
/*
* Store for chip context when saving and restoring status. Not
......
......@@ -153,7 +153,7 @@ typedef struct {
u16 len; /* Data Length */
u8 stat; /* Status */
u8 unused; /* pads to 2-byte boundary */
}__attribute__ ((packed)) pkt_desc;
}__packed pkt_desc;
/* Packet Descriptor Status bits */
......
......@@ -36,7 +36,7 @@ struct hdlc_header {
u8 address;
u8 control;
__be16 protocol;
}__attribute__ ((packed));
}__packed;
struct cisco_packet {
......@@ -45,7 +45,7 @@ struct cisco_packet {
__be32 par2;
__be16 rel; /* reliability */
__be32 time;
}__attribute__ ((packed));
}__packed;
#define CISCO_PACKET_LEN 18
#define CISCO_BIG_PACKET_LEN 20
......
......@@ -112,7 +112,7 @@ typedef struct {
unsigned de: 1;
unsigned ea2: 1;
#endif
}__attribute__ ((packed)) fr_hdr;
}__packed fr_hdr;
typedef struct pvc_device_struct {
......
......@@ -330,7 +330,7 @@ struct _dlci_stat
{
short dlci;
char flags;
} __attribute__((packed));
} __packed;
struct _frad_stat
{
......
......@@ -848,7 +848,7 @@ struct i2400m_cmd_enter_power_save {
struct i2400m_l3l4_hdr hdr;
struct i2400m_tlv_hdr tlv;
__le32 val;
} __attribute__((packed));
} __packed;
/*
......
......@@ -651,7 +651,7 @@ static int i2400m_download_chunk(struct i2400m *i2400m, const void *chunk,
struct {
struct i2400m_bootrom_header cmd;
u8 cmd_payload[chunk_len];
} __attribute__((packed)) *buf;
} __packed *buf;
struct i2400m_bootrom_header ack;
d_fnstart(5, dev, "(i2400m %p chunk %p __chunk_len %zu addr 0x%08lx "
......@@ -794,7 +794,7 @@ int i2400m_dnload_finalize(struct i2400m *i2400m,
struct {
struct i2400m_bootrom_header cmd;
u8 cmd_pl[0];
} __attribute__((packed)) *cmd_buf;
} __packed *cmd_buf;
size_t signature_block_offset, signature_block_size;
d_fnstart(3, dev, "offset %zu\n", offset);
......@@ -1029,7 +1029,7 @@ int i2400m_read_mac_addr(struct i2400m *i2400m)
struct {
struct i2400m_bootrom_header ack;
u8 ack_pl[16];
} __attribute__((packed)) ack_buf;
} __packed ack_buf;
d_fnstart(5, dev, "(i2400m %p)\n", i2400m);
cmd = i2400m->bm_cmd_buf;
......@@ -1115,7 +1115,7 @@ int i2400m_dnload_init_signed(struct i2400m *i2400m,
struct {
struct i2400m_bootrom_header cmd;
struct i2400m_bcf_hdr cmd_pl;
} __attribute__((packed)) *cmd_buf;
} __packed *cmd_buf;
struct i2400m_bootrom_header ack;
d_fnstart(5, dev, "(i2400m %p bcf_hdr %p)\n", i2400m, bcf_hdr);
......
......@@ -91,7 +91,7 @@ int i2400m_op_rfkill_sw_toggle(struct wimax_dev *wimax_dev,
struct {
struct i2400m_l3l4_hdr hdr;
struct i2400m_tlv_rf_operation sw_rf;
} __attribute__((packed)) *cmd;
} __packed *cmd;
char strerr[32];
d_fnstart(4, dev, "(wimax_dev %p state %d)\n", wimax_dev, state);
......
......@@ -80,7 +80,7 @@ struct adm8211_csr {
__le32 FEMR; /* 0x104 */
__le32 FPSR; /* 0x108 */
__le32 FFER; /* 0x10C */
} __attribute__ ((packed));
} __packed;
/* CSR0 - PAR (PCI Address Register) */
#define ADM8211_PAR_MWIE (1 << 24)
......@@ -484,7 +484,7 @@ struct adm8211_tx_hdr {
u8 entry_control; // huh??
u16 reserved_1;
u32 reserved_2;
} __attribute__ ((packed));
} __packed;
#define RX_COPY_BREAK 128
......@@ -531,7 +531,7 @@ struct adm8211_eeprom {
u8 lnags_threshold[14]; /* 0x70 */
__le16 checksum; /* 0x7E */
u8 cis_data[0]; /* 0x80, 384 bytes */
} __attribute__ ((packed));
} __packed;
struct adm8211_priv {
struct pci_dev *pdev;
......
......@@ -506,20 +506,20 @@ struct WepKeyRid {
u8 mac[ETH_ALEN];
__le16 klen;
u8 key[16];
} __attribute__ ((packed));
} __packed;
/* These structures are from the Aironet's PC4500 Developers Manual */
typedef struct Ssid Ssid;
struct Ssid {
__le16 len;
u8 ssid[32];
} __attribute__ ((packed));
} __packed;
typedef struct SsidRid SsidRid;
struct SsidRid {
__le16 len;
Ssid ssids[3];
} __attribute__ ((packed));
} __packed;
typedef struct ModulationRid ModulationRid;
struct ModulationRid {
......@@ -528,7 +528,7 @@ struct ModulationRid {
#define MOD_DEFAULT cpu_to_le16(0)
#define MOD_CCK cpu_to_le16(1)
#define MOD_MOK cpu_to_le16(2)
} __attribute__ ((packed));
} __packed;
typedef struct ConfigRid ConfigRid;
struct ConfigRid {
......@@ -652,7 +652,7 @@ struct ConfigRid {
#define MAGIC_STAY_IN_CAM (1<<10)
u8 magicControl;
__le16 autoWake;
} __attribute__ ((packed));
} __packed;
typedef struct StatusRid StatusRid;
struct StatusRid {
......@@ -711,20 +711,20 @@ struct StatusRid {
#define STAT_LEAPFAILED 91
#define STAT_LEAPTIMEDOUT 92
#define STAT_LEAPCOMPLETE 93
} __attribute__ ((packed));
} __packed;
typedef struct StatsRid StatsRid;
struct StatsRid {
__le16 len;
__le16 spacer;
__le32 vals[100];
} __attribute__ ((packed));
} __packed;
typedef struct APListRid APListRid;
struct APListRid {
__le16 len;
u8 ap[4][ETH_ALEN];
} __attribute__ ((packed));
} __packed;
typedef struct CapabilityRid CapabilityRid;
struct CapabilityRid {
......@@ -754,7 +754,7 @@ struct CapabilityRid {
__le16 bootBlockVer;
__le16 requiredHard;
__le16 extSoftCap;