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
......@@ -157,7 +157,7 @@ struct iwl_queue {
* space more than this */
int high_mark; /* high watermark, stop queue if free
* space less than this */
} __attribute__ ((packed));
} __packed;
/* One for each TFD */
struct iwl_tx_info {
......@@ -343,8 +343,8 @@ struct iwl_device_cmd {
struct iwl_tx_cmd tx;
struct iwl6000_channel_switch_cmd chswitch;
u8 payload[DEF_CMD_PAYLOAD_SIZE];
} __attribute__ ((packed)) cmd;
} __attribute__ ((packed));
} __packed cmd;
} __packed;
#define TFD_MAX_PAYLOAD_SIZE (sizeof(struct iwl_device_cmd))
......@@ -590,7 +590,7 @@ struct iwl_ucode_tlv {
__le16 alternative; /* see comment */
__le32 length; /* not including type/length fields */
u8 data[0];
} __attribute__ ((packed));
} __packed;
#define IWL_TLV_UCODE_MAGIC 0x0a4c5749
......
......@@ -118,7 +118,7 @@ enum {
struct iwl_eeprom_channel {
u8 flags; /* EEPROM_CHANNEL_* flags copied from EEPROM */
s8 max_power_avg; /* max power (dBm) on this chnl, limit 31 */
} __attribute__ ((packed));
} __packed;
/**
* iwl_eeprom_enhanced_txpwr structure
......@@ -144,7 +144,7 @@ struct iwl_eeprom_enhanced_txpwr {
s8 reserved;
s8 mimo2_max;
s8 mimo3_max;
} __attribute__ ((packed));
} __packed;
/* 3945 Specific */
#define EEPROM_3945_EEPROM_VERSION (0x2f)
......@@ -312,7 +312,7 @@ struct iwl_eeprom_calib_measure {
u8 gain_idx; /* Index into gain table */
u8 actual_pow; /* Measured RF output power, half-dBm */
s8 pa_det; /* Power amp detector level (not used) */
} __attribute__ ((packed));
} __packed;
/*
......@@ -328,7 +328,7 @@ struct iwl_eeprom_calib_ch_info {
struct iwl_eeprom_calib_measure
measurements[EEPROM_TX_POWER_TX_CHAINS]
[EEPROM_TX_POWER_MEASUREMENTS];
} __attribute__ ((packed));
} __packed;
/*
* txpower subband info.
......@@ -345,7 +345,7 @@ struct iwl_eeprom_calib_subband_info {
u8 ch_to; /* channel number of highest channel in subband */
struct iwl_eeprom_calib_ch_info ch1;
struct iwl_eeprom_calib_ch_info ch2;
} __attribute__ ((packed));
} __packed;
/*
......@@ -374,7 +374,7 @@ struct iwl_eeprom_calib_info {
__le16 voltage; /* signed */
struct iwl_eeprom_calib_subband_info
band_info[EEPROM_TX_POWER_BANDS];
} __attribute__ ((packed));
} __packed;
#define ADDRESS_MSK 0x0000FFFF
......
......@@ -449,7 +449,7 @@ struct iwl_rb_status {
__le16 finished_rb_num;
__le16 finished_fr_nam;
__le32 __unused; /* 3945 only */
} __attribute__ ((packed));
} __packed;
#define TFD_QUEUE_SIZE_MAX (256)
......@@ -475,7 +475,7 @@ static inline u8 iwl_get_dma_hi_addr(dma_addr_t addr)
struct iwl_tfd_tb {
__le32 lo;
__le16 hi_n_len;
} __attribute__((packed));
} __packed;
/**
* struct iwl_tfd
......@@ -510,7 +510,7 @@ struct iwl_tfd {
u8 num_tbs;
struct iwl_tfd_tb tbs[IWL_NUM_OF_TBS];
__le32 __pad;
} __attribute__ ((packed));
} __packed;
/* Keep Warm Size */
#define IWL_KW_SIZE 0x1000 /* 4k */
......
......@@ -42,7 +42,7 @@ struct ieee80211_basic_report {
__le64 start_time;
__le16 duration;
u8 map;
} __attribute__ ((packed));
} __packed;
enum { /* ieee80211_measurement_request.mode */
/* Bit 0 is reserved */
......@@ -63,13 +63,13 @@ struct ieee80211_measurement_params {
u8 channel;
__le64 start_time;
__le16 duration;
} __attribute__ ((packed));
} __packed;
struct ieee80211_info_element {
u8 id;
u8 len;
u8 data[0];
} __attribute__ ((packed));
} __packed;
struct ieee80211_measurement_request {
struct ieee80211_info_element ie;
......@@ -77,7 +77,7 @@ struct ieee80211_measurement_request {
u8 mode;
u8 type;
struct ieee80211_measurement_params params[0];
} __attribute__ ((packed));
} __packed;
struct ieee80211_measurement_report {
struct ieee80211_info_element ie;
......@@ -87,6 +87,6 @@ struct ieee80211_measurement_report {
union {
struct ieee80211_basic_report basic[0];
} u;
} __attribute__ ((packed));
} __packed;
#endif
......@@ -56,7 +56,7 @@
struct iwm_umac_cmd_reset {
__le32 flags;
} __attribute__ ((packed));
} __packed;
#define UMAC_PARAM_TBL_ORD_FIX 0x0
#define UMAC_PARAM_TBL_ORD_VAR 0x1
......@@ -220,37 +220,37 @@ struct iwm_umac_cmd_set_param_fix {
__le16 tbl;
__le16 key;
__le32 value;
} __attribute__ ((packed));
} __packed;
struct iwm_umac_cmd_set_param_var {
__le16 tbl;
__le16 key;
__le16 len;
__le16 reserved;
} __attribute__ ((packed));
} __packed;
struct iwm_umac_cmd_get_param {
__le16 tbl;
__le16 key;
} __attribute__ ((packed));
} __packed;
struct iwm_umac_cmd_get_param_resp {
__le16 tbl;
__le16 key;
__le16 len;
__le16 reserved;
} __attribute__ ((packed));
} __packed;
struct iwm_umac_cmd_eeprom_proxy_hdr {
__le32 type;
__le32 offset;
__le32 len;
} __attribute__ ((packed));
} __packed;
struct iwm_umac_cmd_eeprom_proxy {
struct iwm_umac_cmd_eeprom_proxy_hdr hdr;
u8 buf[0];
} __attribute__ ((packed));
} __packed;
#define IWM_UMAC_CMD_EEPROM_TYPE_READ 0x1
#define IWM_UMAC_CMD_EEPROM_TYPE_WRITE 0x2
......@@ -267,13 +267,13 @@ struct iwm_umac_channel_info {
u8 reserved;
u8 flags;
__le32 channels_mask;
} __attribute__ ((packed));
} __packed;
struct iwm_umac_cmd_get_channel_list {
__le16 count;
__le16 reserved;
struct iwm_umac_channel_info ch[0];
} __attribute__ ((packed));
} __packed;
/* UMAC WiFi interface commands */
......@@ -304,7 +304,7 @@ struct iwm_umac_ssid {
u8 ssid_len;
u8 ssid[IEEE80211_MAX_SSID_LEN];
u8 reserved[3];
} __attribute__ ((packed));
} __packed;
struct iwm_umac_cmd_scan_request {
struct iwm_umac_wifi_if hdr;
......@@ -314,7 +314,7 @@ struct iwm_umac_cmd_scan_request {
u8 timeout; /* In seconds */
u8 reserved;
struct iwm_umac_ssid ssids[UMAC_WIFI_IF_PROBE_OPTION_MAX];
} __attribute__ ((packed));
} __packed;
#define UMAC_CIPHER_TYPE_NONE 0xFF
#define UMAC_CIPHER_TYPE_USE_GROUPCAST 0x00
......@@ -357,7 +357,7 @@ struct iwm_umac_security {
u8 ucast_cipher;
u8 mcast_cipher;
u8 flags;
} __attribute__ ((packed));
} __packed;
struct iwm_umac_ibss {
u8 beacon_interval; /* in millisecond */
......@@ -366,7 +366,7 @@ struct iwm_umac_ibss {
u8 band;
u8 channel;
u8 reserved[3];
} __attribute__ ((packed));
} __packed;
#define UMAC_MODE_BSS 0
#define UMAC_MODE_IBSS 1
......@@ -385,13 +385,13 @@ struct iwm_umac_profile {
__le16 flags;
u8 wireless_mode;
u8 bss_num;
} __attribute__ ((packed));
} __packed;
struct iwm_umac_invalidate_profile {
struct iwm_umac_wifi_if hdr;
u8 reason;
u8 reserved[3];
} __attribute__ ((packed));
} __packed;
/* Encryption key commands */
struct iwm_umac_key_wep40 {
......@@ -400,7 +400,7 @@ struct iwm_umac_key_wep40 {
u8 key[WLAN_KEY_LEN_WEP40];
u8 static_key;
u8 reserved[2];
} __attribute__ ((packed));
} __packed;
struct iwm_umac_key_wep104 {
struct iwm_umac_wifi_if hdr;
......@@ -408,7 +408,7 @@ struct iwm_umac_key_wep104 {
u8 key[WLAN_KEY_LEN_WEP104];
u8 static_key;
u8 reserved[2];
} __attribute__ ((packed));
} __packed;
#define IWM_TKIP_KEY_SIZE 16
#define IWM_TKIP_MIC_SIZE 8
......@@ -420,7 +420,7 @@ struct iwm_umac_key_tkip {
u8 tkip_key[IWM_TKIP_KEY_SIZE];
u8 mic_rx_key[IWM_TKIP_MIC_SIZE];
u8 mic_tx_key[IWM_TKIP_MIC_SIZE];
} __attribute__ ((packed));
} __packed;
struct iwm_umac_key_ccmp {
struct iwm_umac_wifi_if hdr;
......@@ -428,27 +428,27 @@ struct iwm_umac_key_ccmp {
u8 iv_count[6];
u8 reserved[2];
u8 key[WLAN_KEY_LEN_CCMP];
} __attribute__ ((packed));
} __packed;
struct iwm_umac_key_remove {
struct iwm_umac_wifi_if hdr;
struct iwm_umac_key_hdr key_hdr;
} __attribute__ ((packed));
} __packed;
struct iwm_umac_tx_key_id {
struct iwm_umac_wifi_if hdr;
u8 key_idx;
u8 reserved[3];
} __attribute__ ((packed));
} __packed;
struct iwm_umac_pwr_trigger {
struct iwm_umac_wifi_if hdr;
__le32 reseved;
} __attribute__ ((packed));
} __packed;
struct iwm_umac_cmd_stats_req {
__le32 flags;
} __attribute__ ((packed));
} __packed;
struct iwm_umac_cmd_stop_resume_tx {
u8 flags;
......@@ -456,7 +456,7 @@ struct iwm_umac_cmd_stop_resume_tx {
__le16 stop_resume_tid_msk;
__le16 last_seq_num[IWM_UMAC_TID_NR];
u16 reserved;
} __attribute__ ((packed));
} __packed;
#define IWM_CMD_PMKID_ADD 1
#define IWM_CMD_PMKID_DEL 2
......@@ -468,7 +468,7 @@ struct iwm_umac_pmkid_update {
u8 bssid[ETH_ALEN];
__le16 reserved;
u8 pmkid[WLAN_PMKID_LEN];
} __attribute__ ((packed));
} __packed;
/* LMAC commands */
int iwm_read_mac(struct iwm_priv *iwm, u8 *mac);
......
......@@ -162,7 +162,7 @@ struct iwm_umac_key_hdr {
u8 mac[ETH_ALEN];
u8 key_idx;
u8 multicast; /* BCast encrypt & BCast decrypt of frames FROM mac */
} __attribute__ ((packed));
} __packed;
struct iwm_key {
struct iwm_umac_key_hdr hdr;
......
......@@ -43,7 +43,7 @@ struct iwm_lmac_hdr {
u8 id;
u8 flags;
__le16 seq_num;
} __attribute__ ((packed));
} __packed;
/* LMAC commands */
#define CALIB_CFG_FLAG_SEND_COMPLETE_NTFY_AFTER_MSK 0x1
......@@ -54,23 +54,23 @@ struct iwm_lmac_cal_cfg_elt {
__le32 send_res; /* 1 for sending back results */
__le32 apply_res; /* 1 for applying calibration results to HW */
__le32 reserved;
} __attribute__ ((packed));
} __packed;
struct iwm_lmac_cal_cfg_status {
struct iwm_lmac_cal_cfg_elt init;
struct iwm_lmac_cal_cfg_elt periodic;
__le32 flags; /* CALIB_CFG_FLAG_SEND_COMPLETE_NTFY_AFTER_MSK */
} __attribute__ ((packed));
} __packed;
struct iwm_lmac_cal_cfg_cmd {
struct iwm_lmac_cal_cfg_status ucode_cfg;
struct iwm_lmac_cal_cfg_status driver_cfg;
__le32 reserved;
} __attribute__ ((packed));
} __packed;
struct iwm_lmac_cal_cfg_resp {
__le32 status;
} __attribute__ ((packed));
} __packed;
#define IWM_CARD_STATE_SW_HW_ENABLED 0x00
#define IWM_CARD_STATE_HW_DISABLED 0x01
......@@ -80,7 +80,7 @@ struct iwm_lmac_cal_cfg_resp {
struct iwm_lmac_card_state {
__le32 flags;
} __attribute__ ((packed));
} __packed;
/**
* COEX_PRIORITY_TABLE_CMD
......@@ -131,7 +131,7 @@ struct coex_event {
u8 win_med_prio;
u8 reserved;
u8 flags;
} __attribute__ ((packed));
} __packed;
#define COEX_FLAGS_STA_TABLE_VALID_MSK 0x1
#define COEX_FLAGS_UNASSOC_WAKEUP_UMASK_MSK 0x4
......@@ -142,7 +142,7 @@ struct iwm_coex_prio_table_cmd {
u8 flags;
u8 reserved[3];
struct coex_event sta_prio[COEX_EVENTS_NUM];
} __attribute__ ((packed));
} __packed;
/* Coexistence definitions
*
......@@ -192,7 +192,7 @@ struct iwm_ct_kill_cfg_cmd {
u32 exit_threshold;
u32 reserved;
u32 entry_threshold;
} __attribute__ ((packed));
} __packed;
/* LMAC OP CODES */
......@@ -428,7 +428,7 @@ struct iwm_lmac_calib_hdr {
u8 first_grp;
u8 grp_num;
u8 all_data_valid;
} __attribute__ ((packed));
} __packed;
#define IWM_LMAC_CALIB_FREQ_GROUPS_NR 7
#define IWM_CALIB_FREQ_GROUPS_NR 5
......@@ -437,20 +437,20 @@ struct iwm_lmac_calib_hdr {
struct iwm_calib_rxiq_entry {
u16 ptam_postdist_ars;
u16 ptam_postdist_arc;
} __attribute__ ((packed));
} __packed;
struct iwm_calib_rxiq_group {
struct iwm_calib_rxiq_entry mode[IWM_CALIB_DC_MODES_NR];
} __attribute__ ((packed));
} __packed;
struct iwm_lmac_calib_rxiq {
struct iwm_calib_rxiq_group group[IWM_LMAC_CALIB_FREQ_GROUPS_NR];
} __attribute__ ((packed));
} __packed;
struct iwm_calib_rxiq {
struct iwm_lmac_calib_hdr hdr;
struct iwm_calib_rxiq_group group[IWM_CALIB_FREQ_GROUPS_NR];
} __attribute__ ((packed));
} __packed;
#define LMAC_STA_ID_SEED 0x0f
#define LMAC_STA_ID_POS 0
......@@ -463,7 +463,7 @@ struct iwm_lmac_power_report {
u8 pa_integ_res_A[3];
u8 pa_integ_res_B[3];
u8 pa_integ_res_C[3];
} __attribute__ ((packed));
} __packed;
struct iwm_lmac_tx_resp {
u8 frame_cnt; /* 1-no aggregation, greater then 1 - aggregation */
......@@ -479,6 +479,6 @@ struct iwm_lmac_tx_resp {
u8 ra_tid;
__le16 frame_ctl;
__le32 status;
} __attribute__ ((packed));
} __packed;
#endif
......@@ -42,19 +42,19 @@
struct iwm_udma_in_hdr {
__le32 cmd;
__le32 size;
} __attribute__ ((packed));
} __packed;
struct iwm_udma_out_nonwifi_hdr {
__le32 cmd;
__le32 addr;
__le32 op1_sz;
__le32 op2;
} __attribute__ ((packed));
} __packed;
struct iwm_udma_out_wifi_hdr {
__le32 cmd;
__le32 meta_data;
} __attribute__ ((packed));
} __packed;
/* Sequence numbering */
#define UMAC_WIFI_SEQ_NUM_BASE 1
......@@ -408,12 +408,12 @@ struct iwm_rx_ticket {
__le16 flags;
u8 payload_offset; /* includes: MAC header, pad, IV */
u8 tail_len; /* includes: MIC, ICV, CRC (w/o STATUS) */
} __attribute__ ((packed));
} __packed;
struct iwm_rx_mpdu_hdr {
__le16 len;
__le16 reserved;
} __attribute__ ((packed));
} __packed;
/* UMAC SW WIFI API */
......@@ -421,31 +421,31 @@ struct iwm_dev_cmd_hdr {
u8 cmd;
u8 flags;
__le16 seq_num;
} __attribute__ ((packed));
} __packed;
struct iwm_umac_fw_cmd_hdr {
__le32 meta_data;
struct iwm_dev_cmd_hdr cmd;
} __attribute__ ((packed));
} __packed;
struct iwm_umac_wifi_out_hdr {
struct iwm_udma_out_wifi_hdr hw_hdr;
struct iwm_umac_fw_cmd_hdr sw_hdr;
} __attribute__ ((packed));
} __packed;
struct iwm_umac_nonwifi_out_hdr {
struct iwm_udma_out_nonwifi_hdr hw_hdr;
} __attribute__ ((packed));
} __packed;
struct iwm_umac_wifi_in_hdr {
struct iwm_udma_in_hdr hw_hdr;
struct iwm_umac_fw_cmd_hdr sw_hdr;
} __attribute__ ((packed));
} __packed;
struct iwm_umac_nonwifi_in_hdr {
struct iwm_udma_in_hdr hw_hdr;
__le32 time_stamp;
} __attribute__ ((packed));
} __packed;
#define IWM_UMAC_PAGE_SIZE 0x200
......@@ -521,7 +521,7 @@ struct iwm_umac_notif_wifi_if {
u8 status;
u8 flags;
__le16 buf_size;
} __attribute__ ((packed));
} __packed;
#define UMAC_ROAM_REASON_FIRST_SELECTION 0x1
#define UMAC_ROAM_REASON_AP_DEAUTH 0x2
......@@ -535,7 +535,7 @@ struct iwm_umac_notif_assoc_start {
__le32 roam_reason;
u8 bssid[ETH_ALEN];
u8 reserved[2];
} __attribute__ ((packed));
} __packed;
#define UMAC_ASSOC_COMPLETE_SUCCESS 0x0
#define UMAC_ASSOC_COMPLETE_FAILURE 0x1
......@@ -546,7 +546,7 @@ struct iwm_umac_notif_assoc_complete {
u8 bssid[ETH_ALEN];
u8 band;
u8 channel;
} __attribute__ ((packed));
} __packed;
#define UMAC_PROFILE_INVALID_ASSOC_TIMEOUT 0x0
#define UMAC_PROFILE_INVALID_ROAM_TIMEOUT 0x1
......@@ -556,7 +556,7 @@ struct iwm_umac_notif_assoc_complete {
struct iwm_umac_notif_profile_invalidate {
struct iwm_umac_notif_wifi_if mlme_hdr;
__le32 reason;
} __attribute__ ((packed));
} __packed;
#define UMAC_SCAN_RESULT_SUCCESS 0x0
#define UMAC_SCAN_RESULT_ABORTED 0x1
......@@ -568,7 +568,7 @@ struct iwm_umac_notif_scan_complete {
__le32 type;
__le32 result;
u8 seq_num;
} __attribute__ ((packed));
} __packed;
#define UMAC_OPCODE_ADD_MODIFY 0x0
#define UMAC_OPCODE_REMOVE 0x1
......@@ -582,7 +582,7 @@ struct iwm_umac_notif_sta_info {
u8 mac_addr[ETH_ALEN];
u8 sta_id; /* bits 0-3: station ID, bits 4-7: station color */
u8 flags;
} __attribute__ ((packed));
} __packed;
#define UMAC_BAND_2GHZ 0
#define UMAC_BAND_5GHZ 1
......@@ -601,7 +601,7 @@ struct iwm_umac_notif_bss_info {
s8 rssi;
u8 reserved;
u8 frame_buf[1];
} __attribute__ ((packed));
} __packed;
#define IWM_BSS_REMOVE_INDEX_MSK 0x0fff
#define IWM_BSS_REMOVE_FLAGS_MSK 0xfc00
......@@ -614,13 +614,13 @@ struct iwm_umac_notif_bss_removed {
struct iwm_umac_notif_wifi_if mlme_hdr;
__le32 count;
__le16 entries[0];
} __attribute__ ((packed));
} __packed;
struct iwm_umac_notif_mgt_frame {
struct iwm_umac_notif_wifi_if mlme_hdr;
__le16 len;
u8 frame[1];
} __attribute__ ((packed));
} __packed;
struct iwm_umac_notif_alive {
struct iwm_umac_wifi_in_hdr hdr;
......@@ -630,13 +630,13 @@ struct iwm_umac_notif_alive {