Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
authorDavid S. Miller <davem@davemloft.net>
Thu, 17 Jun 2010 21:19:06 +0000 (14:19 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 17 Jun 2010 21:19:06 +0000 (14:19 -0700)
12 files changed:
1  2 
MAINTAINERS
drivers/net/wireless/hostap/hostap_wlan.h
drivers/net/wireless/iwlwifi/iwl-commands.h
drivers/net/wireless/iwlwifi/iwl-dev.h
drivers/net/wireless/rt2x00/rt2800.h
drivers/net/wireless/zd1211rw/zd_mac.h
include/net/cfg80211.h
net/mac80211/cfg.c
net/mac80211/ieee80211_i.h
net/mac80211/rx.c
net/mac80211/sta_info.c
net/wireless/nl80211.c

diff --combined MAINTAINERS
@@@ -131,12 -131,19 +131,12 @@@ L:      netdev@vger.kernel.or
  S:    Maintained
  F:    drivers/net/typhoon*
  
 -3W-9XXX SATA-RAID CONTROLLER DRIVER
 -M:    Adam Radford <linuxraid@amcc.com>
 +3WARE SAS/SATA-RAID SCSI DRIVERS (3W-XXXX, 3W-9XXX, 3W-SAS)
 +M:    Adam Radford <linuxraid@lsi.com>
  L:    linux-scsi@vger.kernel.org
 -W:    http://www.amcc.com
 +W:    http://www.lsi.com
  S:    Supported
 -F:    drivers/scsi/3w-9xxx*
 -
 -3W-XXXX ATA-RAID CONTROLLER DRIVER
 -M:    Adam Radford <linuxraid@amcc.com>
 -L:    linux-scsi@vger.kernel.org
 -W:    http://www.amcc.com
 -S:    Supported
 -F:    drivers/scsi/3w-xxxx*
 +F:    drivers/scsi/3w-*
  
  53C700 AND 53C700-66 SCSI DRIVER
  M:    "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
@@@ -969,18 -976,6 +969,18 @@@ M:       Wan ZongShun <mcuos.com@gmail.com
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
  W:    http://www.mcuos.com
  S:    Maintained
 +F:    arch/arm/mach-w90x900/
 +F:    arch/arm/mach-nuc93x/
 +F:    drivers/input/keyboard/w90p910_keypad.c
 +F:    drivers/input/touchscreen/w90p910_ts.c
 +F:    drivers/watchdog/nuc900_wdt.c
 +F:    drivers/net/arm/w90p910_ether.c
 +F:    drivers/mtd/nand/w90p910_nand.c
 +F:    drivers/rtc/rtc-nuc900.c
 +F:    drivers/spi/spi_nuc900.c
 +F:    drivers/usb/host/ehci-w90x900.c
 +F:    drivers/video/nuc900fb.c
 +F:    drivers/sound/soc/nuc900/
  
  ARM/U300 MACHINE SUPPORT
  M:    Linus Walleij <linus.walleij@stericsson.com>
@@@ -2887,13 -2882,6 +2887,13 @@@ T:    git git://git.kernel.org/pub/scm/lin
  S:    Maintained
  F:    drivers/input/
  
 +INTEL IDLE DRIVER
 +M:    Len Brown <lenb@kernel.org>
 +L:    linux-pm@lists.linux-foundation.org
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-idle-2.6.git
 +S:    Supported
 +F:    drivers/idle/intel_idle.c
 +
  INTEL FRAMEBUFFER DRIVER (excluding 810 and 815)
  M:    Maik Broemme <mbroemme@plusserver.de>
  L:    linux-fbdev@vger.kernel.org
@@@ -2978,20 -2966,14 +2978,14 @@@ F:   drivers/net/ixgb
  F:    drivers/net/ixgbe/
  
  INTEL PRO/WIRELESS 2100 NETWORK CONNECTION SUPPORT
- M:    Reinette Chatre <reinette.chatre@intel.com>
- M:    Intel Linux Wireless <ilw@linux.intel.com>
  L:    linux-wireless@vger.kernel.org
- W:    http://ipw2100.sourceforge.net
- S:    Odd Fixes
+ S:    Orphan
  F:    Documentation/networking/README.ipw2100
  F:    drivers/net/wireless/ipw2x00/ipw2100.*
  
  INTEL PRO/WIRELESS 2915ABG NETWORK CONNECTION SUPPORT
- M:    Reinette Chatre <reinette.chatre@intel.com>
- M:    Intel Linux Wireless <ilw@linux.intel.com>
  L:    linux-wireless@vger.kernel.org
- W:    http://ipw2200.sourceforge.net
- S:    Odd Fixes
+ S:    Orphan
  F:    Documentation/networking/README.ipw2200
  F:    drivers/net/wireless/ipw2x00/ipw2200.*
  
@@@ -3335,17 -3317,15 +3329,17 @@@ F:   include/linux/key-type.
  F:    include/keys/
  F:    security/keys/
  
 -KGDB
 +KGDB / KDB /debug_core
  M:    Jason Wessel <jason.wessel@windriver.com>
 +W:    http://kgdb.wiki.kernel.org/
  L:    kgdb-bugreport@lists.sourceforge.net
  S:    Maintained
  F:    Documentation/DocBook/kgdb.tmpl
  F:    drivers/misc/kgdbts.c
  F:    drivers/serial/kgdboc.c
 +F:    include/linux/kdb.h
  F:    include/linux/kgdb.h
 -F:    kernel/kgdb.c
 +F:    kernel/debug/
  
  KMEMCHECK
  M:    Vegard Nossum <vegardno@ifi.uio.no>
@@@ -4632,14 -4612,6 +4626,14 @@@ S:    Supporte
  F:    Documentation/scsi/LICENSE.qla2xxx
  F:    drivers/scsi/qla2xxx/
  
 +QLOGIC QLA4XXX iSCSI DRIVER
 +M:    Ravi Anand <ravi.anand@qlogic.com>
 +M:    Vikas Chaudhary <vikas.chaudhary@qlogic.com>
 +M:    iscsi-driver@qlogic.com
 +L:    linux-scsi@vger.kernel.org
 +S:    Supported
 +F:    drivers/scsi/qla4xxx/
 +
  QLOGIC QLA3XXX NETWORK DRIVER
  M:    Ron Mercer <ron.mercer@qlogic.com>
  M:    linux-driver@qlogic.com
@@@ -4780,12 -4752,6 +4774,12 @@@ S:    Maintaine
  F:    Documentation/rfkill.txt
  F:    net/rfkill/
  
 +RICOH SMARTMEDIA/XD DRIVER
 +M:    Maxim Levitsky <maximlevitsky@gmail.com>
 +S:    Maintained
 +F:    drivers/mtd/nand/r822.c
 +F:    drivers/mtd/nand/r822.h
 +
  RISCOM8 DRIVER
  S:    Orphan
  F:    Documentation/serial/riscom8.txt
@@@ -4840,9 -4806,6 +4834,9 @@@ W:      http://www.ibm.com/developerworks/li
  S:    Supported
  F:    arch/s390/
  F:    drivers/s390/
 +F:    fs/partitions/ibm.c
 +F:    Documentation/s390/
 +F:    Documentation/DocBook/s390*
  
  S390 NETWORK DRIVERS
  M:    Ursula Braun <ursula.braun@de.ibm.com>
@@@ -5011,12 -4974,6 +5005,12 @@@ L:    linux-mmc@vger.kernel.or
  S:    Maintained
  F:    drivers/mmc/host/sdhci-s3c.c
  
 +SECURE DIGITAL HOST CONTROLLER INTERFACE (SDHCI) ST SPEAR DRIVER
 +M:    Viresh Kumar <viresh.kumar@st.com>
 +L:    linux-mmc@vger.kernel.org
 +S:    Maintained
 +F:    drivers/mmc/host/sdhci-spear.c
 +
  SECURITY SUBSYSTEM
  M:    James Morris <jmorris@namei.org>
  L:    linux-security-module@vger.kernel.org (suggested Cc:)
@@@ -31,14 -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 +55,7 @@@
        __be32 ssi_noise;
        __be32 preamble;
        __be32 encoding;
 -} __attribute__ ((packed));
 +} __packed;
  
  struct hostap_radiotap_rx {
        struct ieee80211_radiotap_header hdr;
@@@ -66,7 -66,7 +66,7 @@@
        __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 +97,7 @@@ struct hfa384x_rx_frame 
        __be16 len;
  
        /* followed by frame data; max 2304 bytes */
 -} __attribute__ ((packed));
 +} __packed;
  
  
  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
  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;
        __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;
        __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;
  #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 +234,7 @@@ struct hfa384x_scan_result 
        u8 ssid[32];
        u8 sup_rates[10];
        __le16 rate;
 -} __attribute__ ((packed));
 +} __packed;
  
  struct hfa384x_hostscan_result {
        __le16 chid;
        u8 sup_rates[10];
        __le16 rate;
        __le16 atim;
 -} __attribute__ ((packed));
 +} __packed;
  
  struct comm_tallies_sums {
        unsigned int tx_unicast_frames;
@@@ -654,7 -654,7 +654,7 @@@ struct local_info 
        rwlock_t iface_lock; /* hostap_interfaces read lock; use write lock
                              * when removing entries from the list.
                              * TX and RX paths can use read lock. */
-       spinlock_t cmdlock, baplock, lock;
+       spinlock_t cmdlock, baplock, lock, irq_init_lock;
        struct mutex rid_bap_mtx;
        u16 infofid; /* MAC buffer id for info frame */
        /* txfid, intransmitfid, next_txtid, and next_alloc are protected by
@@@ -227,7 -227,7 +227,7 @@@ struct iwl_cmd_header 
  
        /* command or response/notification data follows immediately */
        u8 data[0];
 -} __attribute__ ((packed));
 +} __packed;
  
  
  /**
  struct iwl3945_tx_power {
        u8 tx_gain;             /* gain for analog radio */
        u8 dsp_atten;           /* gain for DSP */
 -} __attribute__ ((packed));
 +} __packed;
  
  /**
   * struct iwl3945_power_per_rate
@@@ -258,7 -258,7 +258,7 @@@ struct iwl3945_power_per_rate 
        u8 rate;                /* plcp */
        struct iwl3945_tx_power tpc;
        u8 reserved;
 -} __attribute__ ((packed));
 +} __packed;
  
  /**
   * iwlagn rate_n_flags bit fields
@@@ -389,7 -389,7 +389,7 @@@ union iwl4965_tx_power_dual_stream 
   */
  struct tx_power_dual_stream {
        __le32 dw;
 -} __attribute__ ((packed));
 +} __packed;
  
  /**
   * struct iwl4965_tx_power_db
   */
  struct iwl4965_tx_power_db {
        struct tx_power_dual_stream power_tbl[POWER_TABLE_NUM_ENTRIES];
 -} __attribute__ ((packed));
 +} __packed;
  
  /**
   * Command REPLY_TX_POWER_DBM_CMD = 0x98
@@@ -412,7 -412,7 +412,7 @@@ struct iwl5000_tx_power_dbm_cmd 
        u8 flags;
        s8 srv_chan_lmt; /*in half-dBm (e.g. 30 = 15 dBm) */
        u8 reserved;
 -} __attribute__ ((packed));
 +} __packed;
  
  /**
   * Command TX_ANT_CONFIGURATION_CMD = 0x98
   */
  struct iwl_tx_ant_config_cmd {
        __le32 valid;
 -} __attribute__ ((packed));
 +} __packed;
  
  /******************************************************************************
   * (0a)
@@@ -478,7 -478,7 +478,7 @@@ struct iwl_init_alive_resp 
        __le32 therm_r4[2];     /* signed */
        __le32 tx_atten[5][2];  /* signed MIMO gain comp, 5 freq groups,
                                 * 2 Tx chains */
 -} __attribute__ ((packed));
 +} __packed;
  
  
  /**
@@@ -570,7 -570,7 +570,7 @@@ struct iwl_alive_resp 
        __le32 error_event_table_ptr;   /* SRAM address for error log */
        __le32 timestamp;
        __le32 is_valid;
 -} __attribute__ ((packed));
 +} __packed;
  
  /*
   * REPLY_ERROR = 0x2 (response only, not a command)
@@@ -582,7 -582,7 +582,7 @@@ struct iwl_error_resp 
        __le16 bad_cmd_seq_num;
        __le32 error_info;
        __le64 timestamp;
 -} __attribute__ ((packed));
 +} __packed;
  
  /******************************************************************************
   * (1)
@@@ -718,7 -718,7 +718,7 @@@ struct iwl3945_rxon_cmd 
        __le32 filter_flags;
        __le16 channel;
        __le16 reserved5;
 -} __attribute__ ((packed));
 +} __packed;
  
  struct iwl4965_rxon_cmd {
        u8 node_addr[6];
        __le16 channel;
        u8 ofdm_ht_single_stream_basic_rates;
        u8 ofdm_ht_dual_stream_basic_rates;
 -} __attribute__ ((packed));
 +} __packed;
  
  /* 5000 HW just extend this command */
  struct iwl_rxon_cmd {
        u8 reserved5;
        __le16 acquisition_data;
        __le16 reserved6;
 -} __attribute__ ((packed));
 +} __packed;
  
  /*
   * REPLY_RXON_ASSOC = 0x11 (command, has simple generic response)
@@@ -774,7 -774,7 +774,7 @@@ struct iwl3945_rxon_assoc_cmd 
        u8 ofdm_basic_rates;
        u8 cck_basic_rates;
        __le16 reserved;
 -} __attribute__ ((packed));
 +} __packed;
  
  struct iwl4965_rxon_assoc_cmd {
        __le32 flags;
        u8 ofdm_ht_dual_stream_basic_rates;
        __le16 rx_chain_select_flags;
        __le16 reserved;
 -} __attribute__ ((packed));
 +} __packed;
  
  struct iwl5000_rxon_assoc_cmd {
        __le32 flags;
        __le16 rx_chain_select_flags;
        __le16 acquisition_data;
        __le32 reserved3;
 -} __attribute__ ((packed));
 +} __packed;
  
  #define IWL_CONN_MAX_LISTEN_INTERVAL  10
  #define IWL_MAX_UCODE_BEACON_INTERVAL 4 /* 4096 */
@@@ -816,7 -816,7 +816,7 @@@ struct iwl_rxon_time_cmd 
        __le32 beacon_init_val;
        __le16 listen_interval;
        __le16 reserved;
 -} __attribute__ ((packed));
 +} __packed;
  
  /*
   * REPLY_CHANNEL_SWITCH = 0x72 (command, has simple generic response)
@@@ -829,7 -829,7 +829,7 @@@ struct iwl3945_channel_switch_cmd 
        __le32 rxon_filter_flags;
        __le32 switch_time;
        struct iwl3945_power_per_rate power[IWL_MAX_RATES];
 -} __attribute__ ((packed));
 +} __packed;
  
  struct iwl4965_channel_switch_cmd {
        u8 band;
        __le32 rxon_filter_flags;
        __le32 switch_time;
        struct iwl4965_tx_power_db tx_power;
 -} __attribute__ ((packed));
 +} __packed;
  
  /**
   * struct iwl5000_channel_switch_cmd
@@@ -860,7 -860,7 +860,7 @@@ struct iwl5000_channel_switch_cmd 
        __le32 rxon_filter_flags;
        __le32 switch_time;
        __le32 reserved[2][IWL_PWR_NUM_HT_OFDM_ENTRIES + IWL_PWR_CCK_ENTRIES];
 -} __attribute__ ((packed));
 +} __packed;
  
  /**
   * struct iwl6000_channel_switch_cmd
@@@ -881,7 -881,7 +881,7 @@@ struct iwl6000_channel_switch_cmd 
        __le32 rxon_filter_flags;
        __le32 switch_time;
        __le32 reserved[3][IWL_PWR_NUM_HT_OFDM_ENTRIES + IWL_PWR_CCK_ENTRIES];
 -} __attribute__ ((packed));
 +} __packed;
  
  /*
   * CHANNEL_SWITCH_NOTIFICATION = 0x73 (notification only, not a command)
@@@ -890,7 -890,7 +890,7 @@@ struct iwl_csa_notification 
        __le16 band;
        __le16 channel;
        __le32 status;          /* 0 - OK, 1 - fail */
 -} __attribute__ ((packed));
 +} __packed;
  
  /******************************************************************************
   * (2)
@@@ -920,7 -920,7 +920,7 @@@ struct iwl_ac_qos 
        u8 aifsn;
        u8 reserved1;
        __le16 edca_txop;
 -} __attribute__ ((packed));
 +} __packed;
  
  /* QoS flags defines */
  #define QOS_PARAM_FLG_UPDATE_EDCA_MSK cpu_to_le32(0x01)
  struct iwl_qosparam_cmd {
        __le32 qos_flags;
        struct iwl_ac_qos ac[AC_NUM];
 -} __attribute__ ((packed));
 +} __packed;
  
  /******************************************************************************
   * (3)
@@@ -1014,7 -1014,7 +1014,7 @@@ struct iwl4965_keyinfo 
        u8 key_offset;
        u8 reserved2;
        u8 key[16];             /* 16-byte unicast decryption key */
 -} __attribute__ ((packed));
 +} __packed;
  
  /* 5000 */
  struct iwl_keyinfo {
        __le64 tx_secur_seq_cnt;
        __le64 hw_tkip_mic_rx_key;
        __le64 hw_tkip_mic_tx_key;
 -} __attribute__ ((packed));
 +} __packed;
  
  /**
   * struct sta_id_modify
@@@ -1048,7 -1048,7 +1048,7 @@@ struct sta_id_modify 
        u8 sta_id;
        u8 modify_mask;
        __le16 reserved2;
 -} __attribute__ ((packed));
 +} __packed;
  
  /*
   * REPLY_ADD_STA = 0x18 (command)
@@@ -1102,7 -1102,7 +1102,7 @@@ struct iwl3945_addsta_cmd 
        /* Starting Sequence Number for added block-ack support.
         * Set modify_mask bit STA_MODIFY_ADDBA_TID_MSK to use this field. */
        __le16 add_immediate_ba_ssn;
 -} __attribute__ ((packed));
 +} __packed;
  
  struct iwl4965_addsta_cmd {
        u8 mode;                /* 1: modify existing, 0: add new station */
        __le16 sleep_tx_count;
  
        __le16 reserved2;
 -} __attribute__ ((packed));
 +} __packed;
  
  /* 5000 */
  struct iwl_addsta_cmd {
        __le16 sleep_tx_count;
  
        __le16 reserved2;
 -} __attribute__ ((packed));
 +} __packed;
  
  
  #define ADD_STA_SUCCESS_MSK           0x1
   */
  struct iwl_add_sta_resp {
        u8 status;      /* ADD_STA_* */
 -} __attribute__ ((packed));
 +} __packed;
  
  #define REM_STA_SUCCESS_MSK              0x1
  /*
   */
  struct iwl_rem_sta_resp {
        u8 status;
 -} __attribute__ ((packed));
 +} __packed;
  
  /*
   *  REPLY_REM_STA = 0x19 (command)
@@@ -1207,7 -1207,7 +1207,7 @@@ struct iwl_rem_sta_cmd 
        u8 reserved[3];
        u8 addr[ETH_ALEN]; /* MAC addr of the first station */
        u8 reserved2[2];
 -} __attribute__ ((packed));
 +} __packed;
  
  /*
   * REPLY_WEP_KEY = 0x20
@@@ -1219,7 -1219,7 +1219,7 @@@ struct iwl_wep_key 
        u8 key_size;
        u8 reserved2[3];
        u8 key[16];
 -} __attribute__ ((packed));
 +} __packed;
  
  struct iwl_wep_cmd {
        u8 num_keys;
        u8 flags;
        u8 reserved;
        struct iwl_wep_key key[0];
 -} __attribute__ ((packed));
 +} __packed;
  
  #define WEP_KEY_WEP_TYPE 1
  #define WEP_KEYS_MAX 4
@@@ -1281,7 -1281,7 +1281,7 @@@ struct iwl3945_rx_frame_stats 
        __le16 sig_avg;
        __le16 noise_diff;
        u8 payload[0];
 -} __attribute__ ((packed));
 +} __packed;
  
  struct iwl3945_rx_frame_hdr {
        __le16 channel;
        u8 rate;
        __le16 len;
        u8 payload[0];
 -} __attribute__ ((packed));
 +} __packed;
  
  struct iwl3945_rx_frame_end {
        __le32 status;
        __le64 timestamp;
        __le32 beacon_timestamp;
 -} __attribute__ ((packed));
 +} __packed;
  
  /*
   * REPLY_3945_RX = 0x1b (response only, not a command)
@@@ -1310,7 -1310,7 +1310,7 @@@ struct iwl3945_rx_frame 
        struct iwl3945_rx_frame_stats stats;
        struct iwl3945_rx_frame_hdr hdr;
        struct iwl3945_rx_frame_end end;
 -} __attribute__ ((packed));
 +} __packed;
  
  #define IWL39_RX_FRAME_SIZE   (4 + sizeof(struct iwl3945_rx_frame))
  
@@@ -1326,7 -1326,7 +1326,7 @@@ struct iwl4965_rx_non_cfg_phy 
        __le16 agc_info;        /* agc code 0:6, agc dB 7:13, reserved 14:15 */
        u8 rssi_info[6];        /* we use even entries, 0/2/4 for A/B/C rssi */
        u8 pad[0];
 -} __attribute__ ((packed));
 +} __packed;
  
  
  #define IWL50_RX_RES_PHY_CNT 8
  
  struct iwl5000_non_cfg_phy {
        __le32 non_cfg_phy[IWL50_RX_RES_PHY_CNT];  /* up to 8 phy entries */
 -} __attribute__ ((packed));
 +} __packed;
  
  
  /*
@@@ -1364,12 -1364,12 +1364,12 @@@ struct iwl_rx_phy_res 
        __le32 rate_n_flags;    /* RATE_MCS_* */
        __le16 byte_count;      /* frame's byte-count */
        __le16 reserved3;
 -} __attribute__ ((packed));
 +} __packed;
  
- struct iwl4965_rx_mpdu_res_start {
+ struct iwl_rx_mpdu_res_start {
        __le16 byte_count;
        __le16 reserved;
 -} __attribute__ ((packed));
 +} __packed;
  
  
  /******************************************************************************
@@@ -1556,7 -1556,7 +1556,7 @@@ struct iwl3945_tx_cmd 
         */
        u8 payload[0];
        struct ieee80211_hdr hdr[0];
 -} __attribute__ ((packed));
 +} __packed;
  
  /*
   * REPLY_TX = 0x1c (response)
@@@ -1568,7 -1568,7 +1568,7 @@@ struct iwl3945_tx_resp 
        u8 rate;
        __le32 wireless_media_time;
        __le32 status;          /* TX status */
 -} __attribute__ ((packed));
 +} __packed;
  
  
  /*
@@@ -1580,7 -1580,7 +1580,7 @@@ struct iwl_dram_scratch 
        u8 try_cnt;             /* Tx attempts */
        u8 bt_kill_cnt;         /* Tx attempts blocked by Bluetooth device */
        __le16 reserved;
 -} __attribute__ ((packed));
 +} __packed;
  
  struct iwl_tx_cmd {
        /*
         */
        u8 payload[0];
        struct ieee80211_hdr hdr[0];
 -} __attribute__ ((packed));
 +} __packed;
  
  /* TX command response is sent after *3945* transmission attempts.
   *
@@@ -1825,7 -1825,7 +1825,7 @@@ enum 
  struct agg_tx_status {
        __le16 status;
        __le16 sequence;
 -} __attribute__ ((packed));
 +} __packed;
  
  struct iwl4965_tx_resp {
        u8 frame_count;         /* 1 no aggregation, >1 aggregation */
                __le32 status;
                struct agg_tx_status agg_status[0]; /* for each agg frame */
        } u;
 -} __attribute__ ((packed));
 +} __packed;
  
  /*
   * definitions for initial rate index field
@@@ -1926,7 -1926,7 +1926,7 @@@ struct iwl5000_tx_resp 
         */
        struct agg_tx_status status;    /* TX status (in aggregation -
                                         * status of 1st frame) */
 -} __attribute__ ((packed));
 +} __packed;
  /*
   * REPLY_COMPRESSED_BA = 0xc5 (response only, not a command)
   *
@@@ -1944,7 -1944,7 +1944,7 @@@ struct iwl_compressed_ba_resp 
        __le64 bitmap;
        __le16 scd_flow;
        __le16 scd_ssn;
 -} __attribute__ ((packed));
 +} __packed;
  
  /*
   * REPLY_TX_PWR_TABLE_CMD = 0x97 (command, has simple generic response)
@@@ -1957,14 -1957,14 +1957,14 @@@ struct iwl3945_txpowertable_cmd 
        u8 reserved;
        __le16 channel;
        struct iwl3945_power_per_rate power[IWL_MAX_RATES];
 -} __attribute__ ((packed));
 +} __packed;
  
  struct iwl4965_txpowertable_cmd {
        u8 band;                /* 0: 5 GHz, 1: 2.4 GHz */
        u8 reserved;
        __le16 channel;
        struct iwl4965_tx_power_db tx_power;
 -} __attribute__ ((packed));
 +} __packed;
  
  
  /**
@@@ -1986,13 -1986,13 +1986,13 @@@ struct iwl3945_rate_scaling_info 
        __le16 rate_n_flags;
        u8 try_cnt;
        u8 next_rate_index;
 -} __attribute__ ((packed));
 +} __packed;
  
  struct iwl3945_rate_scaling_cmd {
        u8 table_id;
        u8 reserved[3];
        struct iwl3945_rate_scaling_info table[IWL_MAX_RATES];
 -} __attribute__ ((packed));
 +} __packed;
  
  
  /*RS_NEW_API: only TLC_RTS remains and moved to bit 0 */
@@@ -2039,7 -2039,7 +2039,7 @@@ struct iwl_link_qual_general_params 
         * TX FIFOs above 3 use same value (typically 0) as TX FIFO 3.
         */
        u8 start_rate_index[LINK_QUAL_AC_NUM];
 -} __attribute__ ((packed));
 +} __packed;
  
  #define LINK_QUAL_AGG_TIME_LIMIT_DEF  (4000) /* 4 milliseconds */
  #define LINK_QUAL_AGG_TIME_LIMIT_MAX  (65535)
@@@ -2080,7 -2080,7 +2080,7 @@@ struct iwl_link_qual_agg_params 
        u8 agg_frame_cnt_limit;
  
        __le32 reserved;
 -} __attribute__ ((packed));
 +} __packed;
  
  /*
   * REPLY_TX_LINK_QUALITY_CMD = 0x4e (command, has simple generic response)
@@@ -2286,7 -2286,7 +2286,7 @@@ struct iwl_link_quality_cmd 
                __le32 rate_n_flags;    /* RATE_MCS_*, IWL_RATE_* */
        } rs_table[LINK_QUAL_MAX_RETRY_NUM];
        __le32 reserved2;
 -} __attribute__ ((packed));
 +} __packed;
  
  /*
   * BT configuration enable flags:
@@@ -2327,7 -2327,7 +2327,7 @@@ struct iwl_bt_cmd 
        u8 reserved;
        __le32 kill_ack_mask;
        __le32 kill_cts_mask;
 -} __attribute__ ((packed));
 +} __packed;
  
  /******************************************************************************
   * (6)
@@@ -2352,7 -2352,7 +2352,7 @@@ struct iwl_measure_channel 
        u8 channel;             /* channel to measure */
        u8 type;                /* see enum iwl_measure_type */
        __le16 reserved;
 -} __attribute__ ((packed));
 +} __packed;
  
  /*
   * REPLY_SPECTRUM_MEASUREMENT_CMD = 0x74 (command)
@@@ -2371,7 -2371,7 +2371,7 @@@ struct iwl_spectrum_cmd 
        __le16 channel_count;   /* minimum 1, maximum 10 */
        __le16 reserved3;
        struct iwl_measure_channel channels[10];
 -} __attribute__ ((packed));
 +} __packed;
  
  /*
   * REPLY_SPECTRUM_MEASUREMENT_CMD = 0x74 (response)
@@@ -2382,7 -2382,7 +2382,7 @@@ struct iwl_spectrum_resp 
        __le16 status;          /* 0 - command will be handled
                                 * 1 - cannot handle (conflicts with another
                                 *     measurement) */
 -} __attribute__ ((packed));
 +} __packed;
  
  enum iwl_measurement_state {
        IWL_MEASUREMENT_START = 0,
@@@ -2405,13 -2405,13 +2405,13 @@@ enum iwl_measurement_status 
  struct iwl_measurement_histogram {
        __le32 ofdm[NUM_ELEMENTS_IN_HISTOGRAM]; /* in 0.8usec counts */
        __le32 cck[NUM_ELEMENTS_IN_HISTOGRAM];  /* in 1usec counts */
 -} __attribute__ ((packed));
 +} __packed;
  
  /* clear channel availability counters */
  struct iwl_measurement_cca_counters {
        __le32 ofdm;
        __le32 cck;
 -} __attribute__ ((packed));
 +} __packed;
  
  enum iwl_measure_type {
        IWL_MEASURE_BASIC = (1 << 0),
@@@ -2447,7 -2447,7 +2447,7 @@@ struct iwl_spectrum_notification 
        struct iwl_measurement_histogram histogram;
        __le32 stop_time;       /* lower 32-bits of TSF */
        __le32 status;          /* see iwl_measurement_status */
 -} __attribute__ ((packed));
 +} __packed;
  
  /******************************************************************************
   * (7)
@@@ -2503,7 -2503,7 +2503,7 @@@ struct iwl3945_powertable_cmd 
        __le32 rx_data_timeout;
        __le32 tx_data_timeout;
        __le32 sleep_interval[IWL_POWER_VEC_SIZE];
 -} __attribute__ ((packed));
 +} __packed;
  
  struct iwl_powertable_cmd {
        __le16 flags;
        __le32 tx_data_timeout;
        __le32 sleep_interval[IWL_POWER_VEC_SIZE];
        __le32 keep_alive_beacons;
 -} __attribute__ ((packed));
 +} __packed;
  
  /*
   * PM_SLEEP_NOTIFICATION = 0x7A (notification only, not a command)
@@@ -2526,7 -2526,7 +2526,7 @@@ struct iwl_sleep_notification 
        __le32 sleep_time;
        __le32 tsf_low;
        __le32 bcon_timer;
 -} __attribute__ ((packed));
 +} __packed;
  
  /* Sleep states.  3945 and 4965 identical. */
  enum {
  #define CARD_STATE_CMD_HALT    0x02   /* Power down permanently */
  struct iwl_card_state_cmd {
        __le32 status;          /* CARD_STATE_CMD_* request new power state */
 -} __attribute__ ((packed));
 +} __packed;
  
  /*
   * CARD_STATE_NOTIFICATION = 0xa1 (notification only, not a command)
   */
  struct iwl_card_state_notif {
        __le32 flags;
 -} __attribute__ ((packed));
 +} __packed;
  
  #define HW_CARD_DISABLED   0x01
  #define SW_CARD_DISABLED   0x02
@@@ -2569,14 -2569,14 +2569,14 @@@ struct iwl_ct_kill_config 
        __le32   reserved;
        __le32   critical_temperature_M;
        __le32   critical_temperature_R;
 -}  __attribute__ ((packed));
 +}  __packed;
  
  /* 1000, and 6x00 */
  struct iwl_ct_kill_throttling_config {
        __le32   critical_temperature_exit;
        __le32   reserved;
        __le32   critical_temperature_enter;
 -}  __attribute__ ((packed));
 +}  __packed;
  
  /******************************************************************************
   * (8)
@@@ -2621,7 -2621,7 +2621,7 @@@ struct iwl3945_scan_channel 
        struct iwl3945_tx_power tpc;
        __le16 active_dwell;    /* in 1024-uSec TU (time units), typ 5-50 */
        __le16 passive_dwell;   /* in 1024-uSec TU (time units), typ 20-500 */
 -} __attribute__ ((packed));
 +} __packed;
  
  /* set number of direct probes u8 type */
  #define IWL39_SCAN_PROBE_MASK(n) ((BIT(n) | (BIT(n) - BIT(1))))
@@@ -2640,7 -2640,7 +2640,7 @@@ struct iwl_scan_channel 
        u8 dsp_atten;           /* gain for DSP */
        __le16 active_dwell;    /* in 1024-uSec TU (time units), typ 5-50 */
        __le16 passive_dwell;   /* in 1024-uSec TU (time units), typ 20-500 */
 -} __attribute__ ((packed));
 +} __packed;
  
  /* set number of direct probes __le32 type */
  #define IWL_SCAN_PROBE_MASK(n)        cpu_to_le32((BIT(n) | (BIT(n) - BIT(1))))
@@@ -2657,7 -2657,7 +2657,7 @@@ struct iwl_ssid_ie 
        u8 id;
        u8 len;
        u8 ssid[32];
 -} __attribute__ ((packed));
 +} __packed;
  
  #define PROBE_OPTION_MAX_3945         4
  #define PROBE_OPTION_MAX              20
@@@ -2763,7 -2763,7 +2763,7 @@@ struct iwl3945_scan_cmd 
         * before requesting another scan.
         */
        u8 data[0];
 -} __attribute__ ((packed));
 +} __packed;
  
  struct iwl_scan_cmd {
        __le16 len;
         * before requesting another scan.
         */
        u8 data[0];
 -} __attribute__ ((packed));
 +} __packed;
  
  /* Can abort will notify by complete notification with abort status. */
  #define CAN_ABORT_STATUS      cpu_to_le32(0x1)
   */
  struct iwl_scanreq_notification {
        __le32 status;          /* 1: okay, 2: cannot fulfill request */
 -} __attribute__ ((packed));
 +} __packed;
  
  /*
   * SCAN_START_NOTIFICATION = 0x82 (notification only, not a command)
@@@ -2832,7 -2832,7 +2832,7 @@@ struct iwl_scanstart_notification 
        u8 band;
        u8 reserved[2];
        __le32 status;
 -} __attribute__ ((packed));
 +} __packed;
  
  #define  SCAN_OWNER_STATUS 0x1;
  #define  MEASURE_OWNER_STATUS 0x2;
@@@ -2848,7 -2848,7 +2848,7 @@@ struct iwl_scanresults_notification 
        __le32 tsf_low;
        __le32 tsf_high;
        __le32 statistics[NUMBER_OF_STATISTICS];
 -} __attribute__ ((packed));
 +} __packed;
  
  /*
   * SCAN_COMPLETE_NOTIFICATION = 0x84 (notification only, not a command)
@@@ -2860,7 -2860,7 +2860,7 @@@ struct iwl_scancomplete_notification 
        u8 last_channel;
        __le32 tsf_low;
        __le32 tsf_high;
 -} __attribute__ ((packed));
 +} __packed;
  
  
  /******************************************************************************
@@@ -2878,14 -2878,14 +2878,14 @@@ struct iwl3945_beacon_notif 
        __le32 low_tsf;
        __le32 high_tsf;
        __le32 ibss_mgr_status;
 -} __attribute__ ((packed));
 +} __packed;
  
  struct iwl4965_beacon_notif {
        struct iwl4965_tx_resp beacon_notify_hdr;
        __le32 low_tsf;
        __le32 high_tsf;
        __le32 ibss_mgr_status;
 -} __attribute__ ((packed));
 +} __packed;
  
  /*
   * REPLY_TX_BEACON = 0x91 (command, has simple generic response)
@@@ -2897,7 -2897,7 +2897,7 @@@ struct iwl3945_tx_beacon_cmd 
        u8 tim_size;
        u8 reserved1;
        struct ieee80211_hdr frame[0];  /* beacon frame */
 -} __attribute__ ((packed));
 +} __packed;
  
  struct iwl_tx_beacon_cmd {
        struct iwl_tx_cmd tx;
        u8 tim_size;
        u8 reserved1;
        struct ieee80211_hdr frame[0];  /* beacon frame */
 -} __attribute__ ((packed));
 +} __packed;
  
  /******************************************************************************
   * (10)
@@@ -2931,7 -2931,7 +2931,7 @@@ struct rate_histogram 
                __le32 b[SUP_RATE_11B_MAX_NUM_CHANNELS];
                __le32 g[SUP_RATE_11G_MAX_NUM_CHANNELS];
        } failed;
 -} __attribute__ ((packed));
 +} __packed;
  
  /* statistics command response */
  
@@@ -2951,7 -2951,7 +2951,7 @@@ struct iwl39_statistics_rx_phy 
        __le32 rxe_frame_limit_overrun;
        __le32 sent_ack_cnt;
        __le32 sent_cts_cnt;
 -} __attribute__ ((packed));
 +} __packed;
  
  struct iwl39_statistics_rx_non_phy {
        __le32 bogus_cts;       /* CTS received when not expecting CTS */
                                 * filtering process */
        __le32 non_channel_beacons;     /* beacons with our bss id but not on
                                         * our serving channel */
 -} __attribute__ ((packed));
 +} __packed;
  
  struct iwl39_statistics_rx {
        struct iwl39_statistics_rx_phy ofdm;
        struct iwl39_statistics_rx_phy cck;
        struct iwl39_statistics_rx_non_phy general;
 -} __attribute__ ((packed));
 +} __packed;
  
  struct iwl39_statistics_tx {
        __le32 preamble_cnt;
        __le32 ack_timeout;
        __le32 expected_ack_cnt;
        __le32 actual_ack_cnt;
 -} __attribute__ ((packed));
 +} __packed;
  
  struct statistics_dbg {
        __le32 burst_check;
        __le32 burst_count;
        __le32 reserved[4];
 -} __attribute__ ((packed));
 +} __packed;
  
  struct iwl39_statistics_div {
        __le32 tx_on_a;
        __le32 tx_on_b;
        __le32 exec_time;
        __le32 probe_time;
 -} __attribute__ ((packed));
 +} __packed;
  
  struct iwl39_statistics_general {
        __le32 temperature;
        __le32 slots_idle;
        __le32 ttl_timestamp;
        struct iwl39_statistics_div div;
 -} __attribute__ ((packed));
 +} __packed;
  
  struct statistics_rx_phy {
        __le32 ina_cnt;
        __le32 mh_format_err;
        __le32 re_acq_main_rssi_sum;
        __le32 reserved3;
 -} __attribute__ ((packed));
 +} __packed;
  
  struct statistics_rx_ht_phy {
        __le32 plcp_err;
        __le32 agg_mpdu_cnt;
        __le32 agg_cnt;
        __le32 unsupport_mcs;
 -} __attribute__ ((packed));
 +} __packed;
  
  #define INTERFERENCE_DATA_AVAILABLE      cpu_to_le32(1)
  
@@@ -3074,14 -3074,14 +3074,14 @@@ struct statistics_rx_non_phy 
        __le32 beacon_energy_a;
        __le32 beacon_energy_b;
        __le32 beacon_energy_c;
 -} __attribute__ ((packed));
 +} __packed;
  
  struct statistics_rx {
        struct statistics_rx_phy ofdm;
        struct statistics_rx_phy cck;
        struct statistics_rx_non_phy general;
        struct statistics_rx_ht_phy ofdm_ht;
 -} __attribute__ ((packed));
 +} __packed;
  
  /**
   * struct statistics_tx_power - current tx power
@@@ -3095,7 -3095,7 +3095,7 @@@ struct statistics_tx_power 
        u8 ant_b;
        u8 ant_c;
        u8 reserved;
 -} __attribute__ ((packed));
 +} __packed;
  
  struct statistics_tx_non_phy_agg {
        __le32 ba_timeout;
        __le32 underrun;
        __le32 bt_prio_kill;
        __le32 rx_ba_rsp_cnt;
 -} __attribute__ ((packed));
 +} __packed;
  
  struct statistics_tx {
        __le32 preamble_cnt;
         */
        struct statistics_tx_power tx_power;
        __le32 reserved1;
 -} __attribute__ ((packed));
 +} __packed;
  
  
  struct statistics_div {
        __le32 probe_time;
        __le32 reserved1;
        __le32 reserved2;
 -} __attribute__ ((packed));
 +} __packed;
  
  struct statistics_general {
        __le32 temperature;   /* radio temperature */
        __le32 num_of_sos_states;
        __le32 reserved2;
        __le32 reserved3;
 -} __attribute__ ((packed));
 +} __packed;
  
  #define UCODE_STATISTICS_CLEAR_MSK            (0x1 << 0)
  #define UCODE_STATISTICS_FREQUENCY_MSK                (0x1 << 1)
  #define IWL_STATS_CONF_DISABLE_NOTIF cpu_to_le32(0x2)/* see above */
  struct iwl_statistics_cmd {
        __le32 configuration_flags;     /* IWL_STATS_CONF_* */
 -} __attribute__ ((packed));
 +} __packed;
  
  /*
   * STATISTICS_NOTIFICATION = 0x9d (notification only, not a command)
@@@ -3213,14 -3213,14 +3213,14 @@@ struct iwl3945_notif_statistics 
        struct iwl39_statistics_rx rx;
        struct iwl39_statistics_tx tx;
        struct iwl39_statistics_general general;
 -} __attribute__ ((packed));
 +} __packed;
  
  struct iwl_notif_statistics {
        __le32 flag;
        struct statistics_rx rx;
        struct statistics_tx tx;
        struct statistics_general general;
 -} __attribute__ ((packed));
 +} __packed;
  
  
  /*
@@@ -3252,7 -3252,7 +3252,7 @@@ struct iwl_missed_beacon_notif 
        __le32 total_missed_becons;
        __le32 num_expected_beacons;
        __le32 num_recvd_beacons;
 -} __attribute__ ((packed));
 +} __packed;
  
  
  /******************************************************************************
  struct iwl_sensitivity_cmd {
        __le16 control;                 /* always use "1" */
        __le16 table[HD_TABLE_SIZE];    /* use HD_* as index */
 -} __attribute__ ((packed));
 +} __packed;
  
  
  /**
@@@ -3535,31 -3535,31 +3535,31 @@@ struct iwl_calib_cfg_elmnt_s 
        __le32 send_res;
        __le32 apply_res;
        __le32 reserved;
 -} __attribute__ ((packed));
 +} __packed;
  
  struct iwl_calib_cfg_status_s {
        struct iwl_calib_cfg_elmnt_s once;
        struct iwl_calib_cfg_elmnt_s perd;
        __le32 flags;
 -} __attribute__ ((packed));
 +} __packed;
  
  struct iwl_calib_cfg_cmd {
        struct iwl_calib_cfg_status_s ucd_calib_cfg;
        struct iwl_calib_cfg_status_s drv_calib_cfg;
        __le32 reserved1;
 -} __attribute__ ((packed));
 +} __packed;
  
  struct iwl_calib_hdr {
        u8 op_code;
        u8 first_group;
        u8 groups_num;
        u8 data_valid;
 -} __attribute__ ((packed));
 +} __packed;
  
  struct iwl_calib_cmd {
        struct iwl_calib_hdr hdr;
        u8 data[0];
 -} __attribute__ ((packed));
 +} __packed;
  
  /* IWL_PHY_CALIBRATE_DIFF_GAIN_CMD (7) */
  struct iwl_calib_diff_gain_cmd {
        s8 diff_gain_b;
        s8 diff_gain_c;
        u8 reserved1;
 -} __attribute__ ((packed));
 +} __packed;
  
  struct iwl_calib_xtal_freq_cmd {
        struct iwl_calib_hdr hdr;
        u8 cap_pin1;
        u8 cap_pin2;
        u8 pad[2];
 -} __attribute__ ((packed));
 +} __packed;
  
  /* IWL_PHY_CALIBRATE_CHAIN_NOISE_RESET_CMD */
  struct iwl_calib_chain_noise_reset_cmd {
@@@ -3589,7 -3589,7 +3589,7 @@@ struct iwl_calib_chain_noise_gain_cmd 
        u8 delta_gain_1;
        u8 delta_gain_2;
        u8 pad[2];
 -} __attribute__ ((packed));
 +} __packed;
  
  /******************************************************************************
   * (12)
@@@ -3612,7 -3612,7 +3612,7 @@@ struct iwl_led_cmd 
        u8 on;                  /* # intervals on while blinking;
                                 * "0", regardless of "off", turns LED off */
        u8 reserved;
 -} __attribute__ ((packed));
 +} __packed;
  
  /*
   * station priority table entries
@@@ -3748,7 -3748,7 +3748,7 @@@ struct iwl_wimax_coex_event_entry 
        u8 win_medium_prio;
        u8 reserved;
        u8 flags;
 -} __attribute__ ((packed));
 +} __packed;
  
  /* COEX flag masks */
  
@@@ -3765,7 -3765,7 +3765,7 @@@ struct iwl_wimax_coex_cmd 
        u8 flags;
        u8 reserved[3];
        struct iwl_wimax_coex_event_entry sta_prio[COEX_NUM_OF_EVENTS];
 -} __attribute__ ((packed));
 +} __packed;
  
  /*
   * Coexistence MEDIUM NOTIFICATION
  struct iwl_coex_medium_notification {
        __le32 status;
        __le32 events;
 -} __attribute__ ((packed));
 +} __packed;
  
  /*
   * Coexistence EVENT  Command
@@@ -3809,11 -3809,11 +3809,11 @@@ struct iwl_coex_event_cmd 
        u8 flags;
        u8 event;
        __le16 reserved;
 -} __attribute__ ((packed));
 +} __packed;
  
  struct iwl_coex_event_resp {
        __le32 status;
 -} __attribute__ ((packed));
 +} __packed;
  
  
  /******************************************************************************
@@@ -3857,7 -3857,7 +3857,7 @@@ struct iwl_rx_packet 
                __le32 status;
                u8 raw[0];
        } u;
 -} __attribute__ ((packed));
 +} __packed;
  
  int iwl_agn_check_rxon_cmd(struct iwl_priv *priv);
  
@@@ -138,7 -138,7 +138,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 {
@@@ -324,8 -324,8 +324,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))
  
@@@ -348,7 -348,7 +348,7 @@@ struct iwl_host_cmd 
  /**
   * struct iwl_rx_queue - Rx queue
   * @bd: driver's pointer to buffer of receive buffer descriptors (rbd)
-  * @dma_addr: bus address of buffer of receive buffer descriptors (rbd)
+  * @bd_dma: bus address of buffer of receive buffer descriptors (rbd)
   * @read: Shared index to newest available Rx buffer
   * @write: Shared index to oldest written Rx packet
   * @free_count: Number of pre-allocated buffers in rx_free
   */
  struct iwl_rx_queue {
        __le32 *bd;
-       dma_addr_t dma_addr;
+       dma_addr_t bd_dma;
        struct iwl_rx_mem_buffer pool[RX_QUEUE_SIZE + RX_FREE_BUFFERS];
        struct iwl_rx_mem_buffer *queue[RX_QUEUE_SIZE];
        u32 read;
@@@ -577,7 -577,7 +577,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
  
  struct mac_wcid_entry {
        u8 mac[6];
        u8 reserved[2];
 -} __attribute__ ((packed));
 +} __packed;
  
  struct hw_key_entry {
        u8 key[16];
        u8 tx_mic[8];
        u8 rx_mic[8];
 -} __attribute__ ((packed));
 +} __packed;
  
  struct mac_iveiv_entry {
        u8 iv[8];
 -} __attribute__ ((packed));
 +} __packed;
  
  /*
   * MAC_WCID_ATTRIBUTE:
  #define MAC_WCID_ATTRIBUTE_CIPHER     FIELD32(0x0000000e)
  #define MAC_WCID_ATTRIBUTE_BSS_IDX    FIELD32(0x00000070)
  #define MAC_WCID_ATTRIBUTE_RX_WIUDF   FIELD32(0x00000380)
+ #define MAC_WCID_ATTRIBUTE_CIPHER_EXT FIELD32(0x00000400)
+ #define MAC_WCID_ATTRIBUTE_BSS_IDX_EXT        FIELD32(0x00000800)
+ #define MAC_WCID_ATTRIBUTE_WAPI_MCBC  FIELD32(0x00008000)
+ #define MAC_WCID_ATTRIBUTE_WAPI_KEY_IDX       FIELD32(0xff000000)
  
  /*
   * SHARED_KEY_MODE:
   */
  
  /*
-  * BBP 1: TX Antenna
+  * BBP 1: TX Antenna & Power
+  * POWER: 0 - normal, 1 - drop tx power by 6dBm, 2 - drop tx power by 12dBm,
+  *    3 - increase tx power by 6dBm
   */
  #define BBP1_TX_POWER                 FIELD8(0x07)
  #define BBP1_TX_ANTENNA                       FIELD8(0x18)
@@@ -35,7 -35,7 +35,7 @@@ struct zd_ctrlset 
        __le16 current_length;
        u8     service;
        __le16  next_frame_length;
 -} __attribute__((packed));
 +} __packed;
  
  #define ZD_CS_RESERVED_SIZE   25
  
  struct rx_length_info {
        __le16 length[3];
        __le16 tag;
 -} __attribute__((packed));
 +} __packed;
  
  #define RX_LENGTH_INFO_TAG            0x697e
  
@@@ -117,7 -117,7 +117,7 @@@ struct rx_status 
        u8 signal_quality_ofdm;
        u8 decryption_type;
        u8 frame_status;
 -} __attribute__((packed));
 +} __packed;
  
  /* rx_status field decryption_type */
  #define ZD_RX_NO_WEP  0
@@@ -153,7 -153,7 +153,7 @@@ struct tx_status 
        u8 mac[ETH_ALEN];
        u8 retry;
        u8 failure;
 -} __attribute__((packed));
 +} __packed;
  
  enum mac_flags {
        MAC_FIXED_CHANNEL = 0x01,
@@@ -212,8 -212,9 +212,9 @@@ struct zd_mac 
  #define ZD_REGDOMAIN_ETSI     0x30
  #define ZD_REGDOMAIN_SPAIN    0x31
  #define ZD_REGDOMAIN_FRANCE   0x32
- #define ZD_REGDOMAIN_JAPAN_ADD        0x40
+ #define ZD_REGDOMAIN_JAPAN_2  0x40
  #define ZD_REGDOMAIN_JAPAN    0x41
+ #define ZD_REGDOMAIN_JAPAN_3  0x49
  
  enum {
        MIN_CHANNEL24 = 1,
  struct ofdm_plcp_header {
        u8 prefix[3];
        __le16 service;
 -} __attribute__((packed));
 +} __packed;
  
  static inline u8 zd_ofdm_plcp_header_rate(const struct ofdm_plcp_header *header)
  {
@@@ -252,7 -253,7 +253,7 @@@ struct cck_plcp_header 
        u8 service;
        __le16 length;
        __le16 crc16;
 -} __attribute__((packed));
 +} __packed;
  
  static inline u8 zd_cck_plcp_header_signal(const struct cck_plcp_header *header)
  {
diff --combined include/net/cfg80211.h
@@@ -810,6 -810,7 +810,7 @@@ struct cfg80211_disassoc_request 
   * @beacon_interval: beacon interval to use
   * @privacy: this is a protected network, keys will be configured
   *    after joining
+  * @basic_rates: bitmap of basic rates to use when creating the IBSS
   */
  struct cfg80211_ibss_params {
        u8 *ssid;
        u8 *ie;
        u8 ssid_len, ie_len;
        u16 beacon_interval;
+       u32 basic_rates;
        bool channel_fixed;
        bool privacy;
  };
@@@ -1369,15 -1371,26 +1371,15 @@@ struct wiphy 
        char priv[0] __attribute__((__aligned__(NETDEV_ALIGN)));
  };
  
 -#ifdef CONFIG_NET_NS
  static inline struct net *wiphy_net(struct wiphy *wiphy)
  {
 -      return wiphy->_net;
 +      return read_pnet(&wiphy->_net);
  }
  
  static inline void wiphy_net_set(struct wiphy *wiphy, struct net *net)
  {
 -      wiphy->_net = net;
 +      write_pnet(&wiphy->_net, net);
  }
 -#else
 -static inline struct net *wiphy_net(struct wiphy *wiphy)
 -{
 -      return &init_net;
 -}
 -
 -static inline void wiphy_net_set(struct wiphy *wiphy, struct net *net)
 -{
 -}
 -#endif
  
  /**
   * wiphy_priv - return priv from wiphy
diff --combined net/mac80211/cfg.c
@@@ -598,7 -598,7 +598,7 @@@ struct iapp_layer2_update 
        u8 ssap;                /* 0 */
        u8 control;
        u8 xid_info[3];
 -} __attribute__ ((packed));
 +} __packed;
  
  static void ieee80211_send_layer2_update(struct sta_info *sta)
  {
@@@ -1446,7 -1446,6 +1446,6 @@@ static int ieee80211_set_power_mgmt(str
  {
        struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
        struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
-       struct ieee80211_conf *conf = &local->hw.conf;
  
        if (sdata->vif.type != NL80211_IFTYPE_STATION)
                return -EOPNOTSUPP;
                return -EOPNOTSUPP;
  
        if (enabled == sdata->u.mgd.powersave &&
-           timeout == conf->dynamic_ps_forced_timeout)
+           timeout == local->dynamic_ps_forced_timeout)
                return 0;
  
        sdata->u.mgd.powersave = enabled;
-       conf->dynamic_ps_forced_timeout = timeout;
+       local->dynamic_ps_forced_timeout = timeout;
  
        /* no change, but if automatic follow powersave */
        mutex_lock(&sdata->u.mgd.mtx);
@@@ -1555,9 -1554,55 +1554,55 @@@ static int ieee80211_action(struct wiph
                            bool channel_type_valid,
                            const u8 *buf, size_t len, u64 *cookie)
  {
-       return ieee80211_mgd_action(IEEE80211_DEV_TO_SUB_IF(dev), chan,
-                                   channel_type, channel_type_valid,
-                                   buf, len, cookie);
+       struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
+       struct ieee80211_local *local = sdata->local;
+       struct sk_buff *skb;
+       struct sta_info *sta;
+       const struct ieee80211_mgmt *mgmt = (void *)buf;
+       u32 flags = IEEE80211_TX_INTFL_NL80211_FRAME_TX |
+                   IEEE80211_TX_CTL_REQ_TX_STATUS;
+       /* Check that we are on the requested channel for transmission */
+       if (chan != local->tmp_channel &&
+           chan != local->oper_channel)
+               return -EBUSY;
+       if (channel_type_valid &&
+           (channel_type != local->tmp_channel_type &&
+            channel_type != local->_oper_channel_type))
+               return -EBUSY;
+       switch (sdata->vif.type) {
+       case NL80211_IFTYPE_ADHOC:
+               if (mgmt->u.action.category == WLAN_CATEGORY_PUBLIC)
+                       break;
+               rcu_read_lock();
+               sta = sta_info_get(sdata, mgmt->da);
+               rcu_read_unlock();
+               if (!sta)
+                       return -ENOLINK;
+               break;
+       case NL80211_IFTYPE_STATION:
+               if (!(sdata->u.mgd.flags & IEEE80211_STA_MFP_ENABLED))
+                       flags |= IEEE80211_TX_INTFL_DONT_ENCRYPT;
+               break;
+       default:
+               return -EOPNOTSUPP;
+       }
+       skb = dev_alloc_skb(local->hw.extra_tx_headroom + len);
+       if (!skb)
+               return -ENOMEM;
+       skb_reserve(skb, local->hw.extra_tx_headroom);
+       memcpy(skb_put(skb, len), buf, len);
+       IEEE80211_SKB_CB(skb)->flags = flags;
+       skb->dev = sdata->dev;
+       ieee80211_tx_skb(sdata, skb);
+       *cookie = (unsigned long) skb;
+       return 0;
  }
  
  struct cfg80211_ops mac80211_config_ops = {
@@@ -325,7 -325,6 +325,6 @@@ struct ieee80211_if_managed 
        struct timer_list conn_mon_timer;
        struct timer_list bcn_mon_timer;
        struct timer_list chswitch_timer;
-       struct work_struct work;
        struct work_struct monitor_work;
        struct work_struct chswitch_work;
        struct work_struct beacon_connection_loss_work;
  
        u16 aid;
  
-       struct sk_buff_head skb_queue;
        unsigned long timers_running; /* used for quiesce/restart */
        bool powersave; /* powersave requested for this iface */
        enum ieee80211_smps_mode req_smps, /* requested smps mode */
@@@ -386,13 -383,12 +383,12 @@@ enum ieee80211_ibss_request 
  
  struct ieee80211_if_ibss {
        struct timer_list timer;
-       struct work_struct work;
-       struct sk_buff_head skb_queue;
  
        unsigned long request;
        unsigned long last_scan_completed;
  
+       u32 basic_rates;
        bool timer_running;
  
        bool fixed_bssid;
  };
  
  struct ieee80211_if_mesh {
-       struct work_struct work;
        struct timer_list housekeeping_timer;
        struct timer_list mesh_path_timer;
        struct timer_list mesh_path_root_timer;
-       struct sk_buff_head skb_queue;
  
        unsigned long timers_running;
  
@@@ -517,6 -511,11 +511,11 @@@ struct ieee80211_sub_if_data 
  
        u16 sequence_number;
  
+       struct work_struct work;
+       struct sk_buff_head skb_queue;
+       bool arp_filter_state;
        /*
         * AP this belongs to: self in AP mode and
         * corresponding AP in VLAN mode, NULL for
@@@ -569,11 -568,15 +568,15 @@@ ieee80211_sdata_set_mesh_id(struct ieee
  #endif
  }
  
+ enum sdata_queue_type {
+       IEEE80211_SDATA_QUEUE_TYPE_FRAME        = 0,
+       IEEE80211_SDATA_QUEUE_AGG_START         = 1,
+       IEEE80211_SDATA_QUEUE_AGG_STOP          = 2,
+ };
  enum {
        IEEE80211_RX_MSG        = 1,
        IEEE80211_TX_STATUS_MSG = 2,
-       IEEE80211_DELBA_MSG     = 3,
-       IEEE80211_ADDBA_MSG     = 4,
  };
  
  enum queue_stop_reason {
@@@ -724,13 -727,7 +727,7 @@@ struct ieee80211_local 
        struct sk_buff_head pending[IEEE80211_MAX_QUEUES];
        struct tasklet_struct tx_pending_tasklet;
  
-       /*
-        * This lock is used to prevent concurrent A-MPDU
-        * session start/stop processing, this thus also
-        * synchronises the ->ampdu_action() callback to
-        * drivers and limits it to one at a time.
-        */
-       spinlock_t ampdu_lock;
+       atomic_t agg_queue_stop[IEEE80211_MAX_QUEUES];
  
        /* number of interfaces with corresponding IFF_ flags */
        atomic_t iff_allmultis, iff_promiscs;
        struct notifier_block network_latency_notifier;
        struct notifier_block ifa_notifier;
  
+       /*
+        * The dynamic ps timeout configured from user space via WEXT -
+        * this will override whatever chosen by mac80211 internally.
+        */
+       int dynamic_ps_forced_timeout;
        int user_power_level; /* in dBm */
        int power_constr_level; /* in dBm */
  
@@@ -875,9 -878,8 +878,8 @@@ IEEE80211_DEV_TO_SUB_IF(struct net_devi
        return netdev_priv(dev);
  }
  
- /* this struct represents 802.11n's RA/TID combination along with our vif */
+ /* this struct represents 802.11n's RA/TID combination */
  struct ieee80211_ra_tid {
-       struct ieee80211_vif *vif;
        u8 ra[ETH_ALEN];
        u16 tid;
  };
@@@ -986,13 -988,6 +988,6 @@@ int ieee80211_mgd_deauth(struct ieee802
  int ieee80211_mgd_disassoc(struct ieee80211_sub_if_data *sdata,
                           struct cfg80211_disassoc_request *req,
                           void *cookie);
- int ieee80211_mgd_action(struct ieee80211_sub_if_data *sdata,
-                        struct ieee80211_channel *chan,
-                        enum nl80211_channel_type channel_type,
-                        bool channel_type_valid,
-                        const u8 *buf, size_t len, u64 *cookie);
- ieee80211_rx_result ieee80211_sta_rx_mgmt(struct ieee80211_sub_if_data *sdata,
-                                         struct sk_buff *skb);
  void ieee80211_send_pspoll(struct ieee80211_local *local,
                           struct ieee80211_sub_if_data *sdata);
  void ieee80211_recalc_ps(struct ieee80211_local *local, s32 latency);
@@@ -1005,12 -1000,13 +1000,13 @@@ void ieee80211_sta_process_chanswitch(s
                                      u64 timestamp);
  void ieee80211_sta_quiesce(struct ieee80211_sub_if_data *sdata);
  void ieee80211_sta_restart(struct ieee80211_sub_if_data *sdata);
+ void ieee80211_sta_work(struct ieee80211_sub_if_data *sdata);
+ void ieee80211_sta_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata,
+                                 struct sk_buff *skb);
  
  /* IBSS code */
  void ieee80211_ibss_notify_scan_completed(struct ieee80211_local *local);
  void ieee80211_ibss_setup_sdata(struct ieee80211_sub_if_data *sdata);
- ieee80211_rx_result
- ieee80211_ibss_rx_mgmt(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb);
  struct sta_info *ieee80211_ibss_add_sta(struct ieee80211_sub_if_data *sdata,
                                        u8 *bssid, u8 *addr, u32 supp_rates,
                                        gfp_t gfp);
@@@ -1019,6 -1015,14 +1015,14 @@@ int ieee80211_ibss_join(struct ieee8021
  int ieee80211_ibss_leave(struct ieee80211_sub_if_data *sdata);
  void ieee80211_ibss_quiesce(struct ieee80211_sub_if_data *sdata);
  void ieee80211_ibss_restart(struct ieee80211_sub_if_data *sdata);
+ void ieee80211_ibss_work(struct ieee80211_sub_if_data *sdata);
+ void ieee80211_ibss_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata,
+                                  struct sk_buff *skb);
+ /* mesh code */
+ void ieee80211_mesh_work(struct ieee80211_sub_if_data *sdata);
+ void ieee80211_mesh_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata,
+                                  struct sk_buff *skb);
  
  /* scan/BSS handling */
  void ieee80211_scan_work(struct work_struct *work);
@@@ -1087,7 -1091,7 +1091,7 @@@ struct ieee80211_tx_status_rtap_hdr 
        u8 padding_for_rate;
        __le16 tx_flags;
        u8 data_retries;
 -} __attribute__ ((packed));
 +} __packed;
  
  
  /* HT */
@@@ -1102,6 -1106,8 +1106,8 @@@ int ieee80211_send_smps_action(struct i
                               enum ieee80211_smps_mode smps, const u8 *da,
                               const u8 *bssid);
  
+ void ___ieee80211_stop_rx_ba_session(struct sta_info *sta, u16 tid,
+                                    u16 initiator, u16 reason);
  void __ieee80211_stop_rx_ba_session(struct sta_info *sta, u16 tid,
                                    u16 initiator, u16 reason);
  void ieee80211_sta_tear_down_BA_sessions(struct sta_info *sta);
@@@ -1121,6 -1127,10 +1127,10 @@@ int __ieee80211_stop_tx_ba_session(stru
                                   enum ieee80211_back_parties initiator);
  int ___ieee80211_stop_tx_ba_session(struct sta_info *sta, u16 tid,
                                    enum ieee80211_back_parties initiator);
+ void ieee80211_start_tx_ba_cb(struct ieee80211_vif *vif, u8 *ra, u16 tid);
+ void ieee80211_stop_tx_ba_cb(struct ieee80211_vif *vif, u8 *ra, u8 tid);
+ void ieee80211_ba_session_work(struct work_struct *work);
+ void ieee80211_tx_ba_session_handle_start(struct sta_info *sta, int tid);
  
  /* Spectrum management */
  void ieee80211_process_measurement_req(struct ieee80211_sub_if_data *sdata,
diff --combined net/mac80211/rx.c
@@@ -719,16 -719,13 +719,13 @@@ static void ieee80211_rx_reorder_ampdu(
  
        tid = *ieee80211_get_qos_ctl(hdr) & IEEE80211_QOS_CTL_TID_MASK;
  
-       spin_lock(&sta->lock);
-       if (!sta->ampdu_mlme.tid_active_rx[tid])
-               goto dont_reorder_unlock;
-       tid_agg_rx = sta->ampdu_mlme.tid_rx[tid];
+       tid_agg_rx = rcu_dereference(sta->ampdu_mlme.tid_rx[tid]);
+       if (!tid_agg_rx)
+               goto dont_reorder;
  
        /* qos null data frames are excluded */
        if (unlikely(hdr->frame_control & cpu_to_le16(IEEE80211_STYPE_NULLFUNC)))
-               goto dont_reorder_unlock;
+               goto dont_reorder;
  
        /* new, potentially un-ordered, ampdu frame - process it */
  
        /* if this mpdu is fragmented - terminate rx aggregation session */
        sc = le16_to_cpu(hdr->seq_ctrl);
        if (sc & IEEE80211_SCTL_FRAG) {
-               spin_unlock(&sta->lock);
-               __ieee80211_stop_rx_ba_session(sta, tid, WLAN_BACK_RECIPIENT,
-                                              WLAN_REASON_QSTA_REQUIRE_SETUP);
-               dev_kfree_skb(skb);
+               skb->pkt_type = IEEE80211_SDATA_QUEUE_TYPE_FRAME;
+               skb_queue_tail(&rx->sdata->skb_queue, skb);
+               ieee80211_queue_work(&local->hw, &rx->sdata->work);
                return;
        }
  
-       if (ieee80211_sta_manage_reorder_buf(hw, tid_agg_rx, skb, frames)) {
-               spin_unlock(&sta->lock);
+       /*
+        * No locking needed -- we will only ever process one
+        * RX packet at a time, and thus own tid_agg_rx. All
+        * other code manipulating it needs to (and does) make
+        * sure that we cannot get to it any more before doing
+        * anything with it.
+        */
+       if (ieee80211_sta_manage_reorder_buf(hw, tid_agg_rx, skb, frames))
                return;
-       }
  
-  dont_reorder_unlock:
-       spin_unlock(&sta->lock);
   dont_reorder:
        __skb_queue_tail(frames, skb);
  }
@@@ -1268,11 -1267,13 +1267,13 @@@ ieee80211_rx_h_defragment(struct ieee80
                                                 rx->queue, &(rx->skb));
                if (rx->key && rx->key->conf.alg == ALG_CCMP &&
                    ieee80211_has_protected(fc)) {
+                       int queue = ieee80211_is_mgmt(fc) ?
+                               NUM_RX_DATA_QUEUES : rx->queue;
                        /* Store CCMP PN so that we can verify that the next
                         * fragment has a sequential PN value. */
                        entry->ccmp = 1;
                        memcpy(entry->last_pn,
-                              rx->key->u.ccmp.rx_pn[rx->queue],
+                              rx->key->u.ccmp.rx_pn[queue],
                               CCMP_PN_LEN);
                }
                return RX_QUEUED;
        if (entry->ccmp) {
                int i;
                u8 pn[CCMP_PN_LEN], *rpn;
+               int queue;
                if (!rx->key || rx->key->conf.alg != ALG_CCMP)
                        return RX_DROP_UNUSABLE;
                memcpy(pn, entry->last_pn, CCMP_PN_LEN);
                        if (pn[i])
                                break;
                }
-               rpn = rx->key->u.ccmp.rx_pn[rx->queue];
+               queue = ieee80211_is_mgmt(fc) ?
+                       NUM_RX_DATA_QUEUES : rx->queue;
+               rpn = rx->key->u.ccmp.rx_pn[queue];
                if (memcmp(pn, rpn, CCMP_PN_LEN))
                        return RX_DROP_UNUSABLE;
                memcpy(entry->last_pn, pn, CCMP_PN_LEN);
@@@ -1830,13 -1834,11 +1834,11 @@@ ieee80211_rx_h_ctrl(struct ieee80211_rx
                                  &bar_data, sizeof(bar_data)))
                        return RX_DROP_MONITOR;
  
-               spin_lock(&rx->sta->lock);
                tid = le16_to_cpu(bar_data.control) >> 12;
-               if (!rx->sta->ampdu_mlme.tid_active_rx[tid]) {
-                       spin_unlock(&rx->sta->lock);
+               tid_agg_rx = rcu_dereference(rx->sta->ampdu_mlme.tid_rx[tid]);
+               if (!tid_agg_rx)
                        return RX_DROP_MONITOR;
-               }
-               tid_agg_rx = rx->sta->ampdu_mlme.tid_rx[tid];
  
                start_seq_num = le16_to_cpu(bar_data.start_seq_num) >> 4;
  
                ieee80211_release_reorder_frames(hw, tid_agg_rx, start_seq_num,
                                                 frames);
                kfree_skb(skb);
-               spin_unlock(&rx->sta->lock);
                return RX_QUEUED;
        }
  
@@@ -1950,30 -1951,27 +1951,27 @@@ ieee80211_rx_h_action(struct ieee80211_
                if (len < IEEE80211_MIN_ACTION_SIZE + 1)
                        break;
  
-               if (sdata->vif.type == NL80211_IFTYPE_STATION)
-                       return ieee80211_sta_rx_mgmt(sdata, rx->skb);
                switch (mgmt->u.action.u.addba_req.action_code) {
                case WLAN_ACTION_ADDBA_REQ:
                        if (len < (IEEE80211_MIN_ACTION_SIZE +
                                   sizeof(mgmt->u.action.u.addba_req)))
-                               return RX_DROP_MONITOR;
-                       ieee80211_process_addba_request(local, rx->sta, mgmt, len);
-                       goto handled;
+                               goto invalid;
+                       break;
                case WLAN_ACTION_ADDBA_RESP:
                        if (len < (IEEE80211_MIN_ACTION_SIZE +
                                   sizeof(mgmt->u.action.u.addba_resp)))
-                               break;
-                       ieee80211_process_addba_resp(local, rx->sta, mgmt, len);
-                       goto handled;
+                               goto invalid;
+                       break;
                case WLAN_ACTION_DELBA:
                        if (len < (IEEE80211_MIN_ACTION_SIZE +
                                   sizeof(mgmt->u.action.u.delba)))
-                               break;
-                       ieee80211_process_delba(sdata, rx->sta, mgmt, len);
-                       goto handled;
+                               goto invalid;
+                       break;
+               default:
+                       goto invalid;
                }
-               break;
+               goto queue;
        case WLAN_CATEGORY_SPECTRUM_MGMT:
                if (local->hw.conf.channel->band != IEEE80211_BAND_5GHZ)
                        break;
                        if (memcmp(mgmt->bssid, sdata->u.mgd.bssid, ETH_ALEN))
                                break;
  
-                       return ieee80211_sta_rx_mgmt(sdata, rx->skb);
+                       goto queue;
                }
                break;
        case WLAN_CATEGORY_SA_QUERY:
                break;
        case WLAN_CATEGORY_MESH_PLINK:
        case WLAN_CATEGORY_MESH_PATH_SEL:
-               if (ieee80211_vif_is_mesh(&sdata->vif))
-                       return ieee80211_mesh_rx_mgmt(sdata, rx->skb);
-               break;
+               if (!ieee80211_vif_is_mesh(&sdata->vif))
+                       break;
+               goto queue;
        }
  
+  invalid:
        /*
         * For AP mode, hostapd is responsible for handling any action
         * frames that we didn't handle, including returning unknown
         */
        status = IEEE80211_SKB_RXCB(rx->skb);
  
-       if (sdata->vif.type == NL80211_IFTYPE_STATION &&
-           cfg80211_rx_action(rx->sdata->dev, status->freq,
+       if (cfg80211_rx_action(rx->sdata->dev, status->freq,
                               rx->skb->data, rx->skb->len,
                               GFP_ATOMIC))
                goto handled;
                rx->sta->rx_packets++;
        dev_kfree_skb(rx->skb);
        return RX_QUEUED;
+  queue:
+       rx->skb->pkt_type = IEEE80211_SDATA_QUEUE_TYPE_FRAME;
+       skb_queue_tail(&sdata->skb_queue, rx->skb);
+       ieee80211_queue_work(&local->hw, &sdata->work);
+       if (rx->sta)
+               rx->sta->rx_packets++;
+       return RX_QUEUED;
  }
  
  static ieee80211_rx_result debug_noinline
@@@ -2081,10 -2087,15 +2087,15 @@@ ieee80211_rx_h_mgmt(struct ieee80211_rx
  {
        struct ieee80211_sub_if_data *sdata = rx->sdata;
        ieee80211_rx_result rxs;
+       struct ieee80211_mgmt *mgmt = (void *)rx->skb->data;
+       __le16 stype;
  
        if (!(rx->flags & IEEE80211_RX_RA_MATCH))
                return RX_DROP_MONITOR;
  
+       if (rx->skb->len < 24)
+               return RX_DROP_MONITOR;
        if (ieee80211_drop_unencrypted_mgmt(rx))
                return RX_DROP_UNUSABLE;
  
        if (rxs != RX_CONTINUE)
                return rxs;
  
-       if (ieee80211_vif_is_mesh(&sdata->vif))
-               return ieee80211_mesh_rx_mgmt(sdata, rx->skb);
+       stype = mgmt->frame_control & cpu_to_le16(IEEE80211_FCTL_STYPE);
  
-       if (sdata->vif.type == NL80211_IFTYPE_ADHOC)
-               return ieee80211_ibss_rx_mgmt(sdata, rx->skb);
+       if (!ieee80211_vif_is_mesh(&sdata->vif) &&
+           sdata->vif.type != NL80211_IFTYPE_ADHOC &&
+           sdata->vif.type != NL80211_IFTYPE_STATION)
+               return RX_DROP_MONITOR;
+       switch (stype) {
+       case cpu_to_le16(IEEE80211_STYPE_BEACON):
+       case cpu_to_le16(IEEE80211_STYPE_PROBE_RESP):
+               /* process for all: mesh, mlme, ibss */
+               break;
+       case cpu_to_le16(IEEE80211_STYPE_DEAUTH):
+       case cpu_to_le16(IEEE80211_STYPE_DISASSOC):
+               /* process only for station */
+               if (sdata->vif.type != NL80211_IFTYPE_STATION)
+                       return RX_DROP_MONITOR;
+               break;
+       case cpu_to_le16(IEEE80211_STYPE_PROBE_REQ):
+       case cpu_to_le16(IEEE80211_STYPE_AUTH):
+               /* process only for ibss */
+               if (sdata->vif.type != NL80211_IFTYPE_ADHOC)
+                       return RX_DROP_MONITOR;
+               break;
+       default:
+               return RX_DROP_MONITOR;
+       }
  
-       if (sdata->vif.type == NL80211_IFTYPE_STATION)
-               return ieee80211_sta_rx_mgmt(sdata, rx->skb);
+       /* queue up frame and kick off work to process it */
+       rx->skb->pkt_type = IEEE80211_SDATA_QUEUE_TYPE_FRAME;
+       skb_queue_tail(&sdata->skb_queue, rx->skb);
+       ieee80211_queue_work(&rx->local->hw, &sdata->work);
+       if (rx->sta)
+               rx->sta->rx_packets++;
  
-       return RX_DROP_MONITOR;
+       return RX_QUEUED;
  }
  
  static void ieee80211_rx_michael_mic_report(struct ieee80211_hdr *hdr,
@@@ -2157,7 -2194,7 +2194,7 @@@ static void ieee80211_rx_cooked_monitor
                u8 rate_or_pad;
                __le16 chan_freq;
                __le16 chan_flags;
 -      } __attribute__ ((packed)) *rthdr;
 +      } __packed *rthdr;
        struct sk_buff *skb = rx->skb, *skb2;
        struct net_device *prev_dev = NULL;
        struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb);
diff --combined net/mac80211/sta_info.c
@@@ -235,6 -235,8 +235,8 @@@ struct sta_info *sta_info_alloc(struct 
        spin_lock_init(&sta->lock);
        spin_lock_init(&sta->flaglock);
        INIT_WORK(&sta->drv_unblock_wk, sta_unblock);
+       INIT_WORK(&sta->ampdu_mlme.work, ieee80211_ba_session_work);
+       mutex_init(&sta->ampdu_mlme.mtx);
  
        memcpy(sta->sta.addr, addr, ETH_ALEN);
        sta->local = local;
        }
  
        for (i = 0; i < STA_TID_NUM; i++) {
-               /* timer_to_tid must be initialized with identity mapping to
-                * enable session_timer's data differentiation. refer to
-                * sta_rx_agg_session_timer_expired for useage */
+               /*
+                * timer_to_tid must be initialized with identity mapping
+                * to enable session_timer's data differentiation. See
+                * sta_rx_agg_session_timer_expired for usage.
+                */
                sta->timer_to_tid[i] = i;
-               /* tx */
-               sta->ampdu_mlme.tid_state_tx[i] = HT_AGG_STATE_IDLE;
-               sta->ampdu_mlme.tid_tx[i] = NULL;
-               sta->ampdu_mlme.addba_req_num[i] = 0;
        }
        skb_queue_head_init(&sta->ps_tx_buf);
        skb_queue_head_init(&sta->tx_filtered);
  
        for (i = 0; i < NUM_RX_DATA_QUEUES; i++)
 -              sta->last_seq_ctrl[i] = cpu_to_le16(USHORT_MAX);
 +              sta->last_seq_ctrl[i] = cpu_to_le16(USHRT_MAX);
  
  #ifdef CONFIG_MAC80211_VERBOSE_DEBUG
        printk(KERN_DEBUG "%s: Allocated STA %pM\n",
diff --combined net/wireless/nl80211.c
@@@ -1107,7 -1107,7 +1107,7 @@@ static int nl80211_valid_4addr(struct c
                               enum nl80211_iftype iftype)
  {
        if (!use_4addr) {
 -              if (netdev && netdev->br_port)
 +              if (netdev && (netdev->priv_flags & IFF_BRIDGE_PORT))
                        return -EBUSY;
                return 0;
        }
@@@ -3955,6 -3955,55 +3955,55 @@@ static int nl80211_join_ibss(struct sk_
                }
        }
  
+       if (info->attrs[NL80211_ATTR_BSS_BASIC_RATES]) {
+               u8 *rates =
+                       nla_data(info->attrs[NL80211_ATTR_BSS_BASIC_RATES]);
+               int n_rates =
+                       nla_len(info->attrs[NL80211_ATTR_BSS_BASIC_RATES]);
+               struct ieee80211_supported_band *sband =
+                       wiphy->bands[ibss.channel->band];
+               int i, j;
+               if (n_rates == 0) {
+                       err = -EINVAL;
+                       goto out;
+               }
+               for (i = 0; i < n_rates; i++) {
+                       int rate = (rates[i] & 0x7f) * 5;
+                       bool found = false;
+                       for (j = 0; j < sband->n_bitrates; j++) {
+                               if (sband->bitrates[j].bitrate == rate) {
+                                       found = true;
+                                       ibss.basic_rates |= BIT(j);
+                                       break;
+                               }
+                       }
+                       if (!found) {
+                               err = -EINVAL;
+                               goto out;
+                       }
+               }
+       } else {
+               /*
+               * If no rates were explicitly configured,
+               * use the mandatory rate set for 11b or
+               * 11a for maximum compatibility.
+               */
+               struct ieee80211_supported_band *sband =
+                       wiphy->bands[ibss.channel->band];
+               int j;
+               u32 flag = ibss.channel->band == IEEE80211_BAND_5GHZ ?
+                       IEEE80211_RATE_MANDATORY_A :
+                       IEEE80211_RATE_MANDATORY_B;
+               for (j = 0; j < sband->n_bitrates; j++) {
+                       if (sband->bitrates[j].flags & flag)
+                               ibss.basic_rates |= BIT(j);
+               }
+       }
        err = cfg80211_join_ibss(rdev, dev, &ibss, connkeys);
  
  out:
@@@ -4653,7 -4702,8 +4702,8 @@@ static int nl80211_register_action(stru
        if (err)
                goto unlock_rtnl;
  
-       if (dev->ieee80211_ptr->iftype != NL80211_IFTYPE_STATION) {
+       if (dev->ieee80211_ptr->iftype != NL80211_IFTYPE_STATION &&
+           dev->ieee80211_ptr->iftype != NL80211_IFTYPE_ADHOC) {
                err = -EOPNOTSUPP;
                goto out;
        }
@@@ -4703,7 -4753,8 +4753,8 @@@ static int nl80211_action(struct sk_buf
                goto out;
        }
  
-       if (dev->ieee80211_ptr->iftype != NL80211_IFTYPE_STATION) {
+       if (dev->ieee80211_ptr->iftype != NL80211_IFTYPE_STATION &&
+           dev->ieee80211_ptr->iftype != NL80211_IFTYPE_ADHOC) {
                err = -EOPNOTSUPP;
                goto out;
        }