]> git.kernelconcepts.de Git - mv-sheeva.git/commitdiff
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
authorJohn W. Linville <linville@tuxdriver.com>
Tue, 13 Jul 2010 19:57:29 +0000 (15:57 -0400)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 13 Jul 2010 19:57:29 +0000 (15:57 -0400)
Conflicts:
drivers/net/wireless/wl12xx/wl1271_cmd.h

13 files changed:
1  2 
MAINTAINERS
drivers/net/wireless/iwlwifi/iwl-commands.h
drivers/net/wireless/iwlwifi/iwl-dev.h
drivers/net/wireless/iwlwifi/iwl-eeprom.h
drivers/net/wireless/iwlwifi/iwl-fh.h
drivers/net/wireless/prism54/isl_ioctl.c
drivers/net/wireless/rt2x00/rt2800.h
drivers/net/wireless/wl12xx/wl1271.h
drivers/net/wireless/wl12xx/wl1271_acx.h
drivers/net/wireless/wl12xx/wl1271_cmd.h
drivers/net/wireless/wl12xx/wl1271_event.h
net/mac80211/cfg.c
net/wireless/nl80211.c

diff --combined MAINTAINERS
index 2ebb56710f4d1b883f1ec379b312684533b6c57a,7faf7296b8438f46bbf9e526380c813e0af8bac8..bb6493bfe08ac74bad0645a8b6bfd8f223e61677
@@@ -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>
@@@ -313,11 -320,9 +313,9 @@@ S:        Maintaine
  F:    drivers/hwmon/adm1029.c
  
  ADM8211 WIRELESS DRIVER
- M:    Michael Wu <flamingice@sourmilk.net>
  L:    linux-wireless@vger.kernel.org
  W:    http://linuxwireless.org/
- T:    git git://git.kernel.org/pub/scm/linux/kernel/git/mwu/mac80211-drivers.git
- S:    Maintained
+ S:    Orphan
  F:    drivers/net/wireless/adm8211.*
  
  ADT746X FAN DRIVER
@@@ -969,18 -974,6 +967,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 -2880,6 +2885,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
@@@ -3329,17 -3315,15 +3327,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>
@@@ -4251,10 -4235,9 +4249,9 @@@ F:     include/scsi/osd_
  F:    fs/exofs/
  
  P54 WIRELESS DRIVER
- M:    Michael Wu <flamingice@sourmilk.net>
+ M:    Christian Lamparter <chunkeey@googlemail.com>
  L:    linux-wireless@vger.kernel.org
- W:    http://prism54.org
- T:    git git://git.kernel.org/pub/scm/linux/kernel/git/mwu/mac80211-drivers.git
+ W:    http://wireless.kernel.org/en/users/Drivers/p54
  S:    Maintained
  F:    drivers/net/wireless/p54/
  
@@@ -4626,14 -4609,6 +4623,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
@@@ -4774,12 -4749,6 +4771,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
@@@ -4834,9 -4803,6 +4831,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>
@@@ -5005,12 -4971,6 +5002,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:)
index acf8e980b1fe242208b3c3901b98e899f1df1703,a587999d07dbef4bc29c2587e03c19da1a114920..8d2db9d22045260d7ae1d53ba0dec3344be88b48
@@@ -97,6 -97,7 +97,7 @@@ enum 
        REPLY_ADD_STA = 0x18,
        REPLY_REMOVE_STA = 0x19,
        REPLY_REMOVE_ALL_STA = 0x1a,    /* not used */
+       REPLY_TXFIFO_FLUSH = 0x1e,
  
        /* Security */
        REPLY_WEPKEY = 0x20,
@@@ -227,7 -228,7 +228,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 -259,7 +259,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 -390,7 +390,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 -413,7 +413,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 -479,7 +479,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 -571,7 +571,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 -583,7 +583,7 @@@ struct iwl_error_resp 
        __le16 bad_cmd_seq_num;
        __le32 error_info;
        __le64 timestamp;
 -} __attribute__ ((packed));
 +} __packed;
  
  /******************************************************************************
   * (1)
@@@ -718,7 -719,7 +719,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 -775,7 +775,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 -817,7 +817,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 -830,7 +830,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 -861,7 +861,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 -882,7 +882,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 -891,7 +891,7 @@@ struct iwl_csa_notification 
        __le16 band;
        __le16 channel;
        __le32 status;          /* 0 - OK, 1 - fail */
 -} __attribute__ ((packed));
 +} __packed;
  
  /******************************************************************************
   * (2)
@@@ -920,7 -921,7 +921,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)
  #define IWL3945_STATION_COUNT 25
  #define IWL4965_BROADCAST_ID  31
  #define       IWL4965_STATION_COUNT   32
- #define IWL5000_BROADCAST_ID  15
- #define       IWL5000_STATION_COUNT   16
+ #define IWLAGN_BROADCAST_ID   15
+ #define       IWLAGN_STATION_COUNT    16
  
  #define       IWL_STATION_COUNT       32      /* MAX(3945,4965)*/
  #define       IWL_INVALID_STATION     255
@@@ -1014,7 -1015,7 +1015,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 -1049,7 +1049,7 @@@ struct sta_id_modify 
        u8 sta_id;
        u8 modify_mask;
        __le16 reserved2;
 -} __attribute__ ((packed));
 +} __packed;
  
  /*
   * REPLY_ADD_STA = 0x18 (command)
@@@ -1102,7 -1103,7 +1103,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,8 -1208,45 +1208,45 @@@ struct iwl_rem_sta_cmd 
        u8 reserved[3];
        u8 addr[ETH_ALEN]; /* MAC addr of the first station */
        u8 reserved2[2];
 -} __attribute__ ((packed));
 +} __packed;
  
+ #define IWL_TX_FIFO_BK_MSK            cpu_to_le32(BIT(0))
+ #define IWL_TX_FIFO_BE_MSK            cpu_to_le32(BIT(1))
+ #define IWL_TX_FIFO_VI_MSK            cpu_to_le32(BIT(2))
+ #define IWL_TX_FIFO_VO_MSK            cpu_to_le32(BIT(3))
+ #define IWL_AGG_TX_QUEUE_MSK          cpu_to_le32(0xffc00)
+ #define IWL_DROP_SINGLE               0
+ #define IWL_DROP_SELECTED     1
+ #define IWL_DROP_ALL          2
+ /*
+  * REPLY_TXFIFO_FLUSH = 0x1e(command and response)
+  *
+  * When using full FIFO flush this command checks the scheduler HW block WR/RD
+  * pointers to check if all the frames were transferred by DMA into the
+  * relevant TX FIFO queue. Only when the DMA is finished and the queue is
+  * empty the command can finish.
+  * This command is used to flush the TXFIFO from transmit commands, it may
+  * operate on single or multiple queues, the command queue can't be flushed by
+  * this command. The command response is returned when all the queue flush
+  * operations are done. Each TX command flushed return response with the FLUSH
+  * status set in the TX response status. When FIFO flush operation is used,
+  * the flush operation ends when both the scheduler DMA done and TXFIFO empty
+  * are set.
+  *
+  * @fifo_control: bit mask for which queues to flush
+  * @flush_control: flush controls
+  *    0: Dump single MSDU
+  *    1: Dump multiple MSDU according to PS, INVALID STA, TTL, TID disable.
+  *    2: Dump all FIFO
+  */
+ struct iwl_txfifo_flush_cmd {
+       __le32 fifo_control;
+       __le16 flush_control;
+       __le16 reserved;
+ } __attribute__ ((packed));
  /*
   * REPLY_WEP_KEY = 0x20
   */
@@@ -1219,7 -1257,7 +1257,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 -1319,7 +1319,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 -1348,7 +1348,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 -1364,7 +1364,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 -1402,12 +1402,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 iwl_rx_mpdu_res_start {
        __le16 byte_count;
        __le16 reserved;
 -} __attribute__ ((packed));
 +} __packed;
  
  
  /******************************************************************************
@@@ -1568,7 -1606,7 +1606,7 @@@ struct iwl3945_tx_cmd 
         */
        u8 payload[0];
        struct ieee80211_hdr hdr[0];
 -} __attribute__ ((packed));
 +} __packed;
  
  /*
   * REPLY_TX = 0x1c (response)
@@@ -1580,7 -1618,7 +1618,7 @@@ struct iwl3945_tx_resp 
        u8 rate;
        __le32 wireless_media_time;
        __le32 status;          /* TX status */
 -} __attribute__ ((packed));
 +} __packed;
  
  
  /*
@@@ -1592,7 -1630,7 +1630,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.
   *
@@@ -1837,7 -1875,7 +1875,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
@@@ -1938,7 -1976,7 +1976,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)
   *
@@@ -1956,7 -1994,7 +1994,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)
@@@ -1969,14 -2007,14 +2007,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;
  
  
  /**
@@@ -1998,13 -2036,13 +2036,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 */
@@@ -2051,7 -2089,7 +2089,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)
@@@ -2092,7 -2130,7 +2130,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)
@@@ -2298,7 -2336,7 +2336,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:
@@@ -2339,7 -2377,7 +2377,7 @@@ struct iwl_bt_cmd 
        u8 reserved;
        __le32 kill_ack_mask;
        __le32 kill_cts_mask;
 -} __attribute__ ((packed));
 +} __packed;
  
  /******************************************************************************
   * (6)
@@@ -2364,7 -2402,7 +2402,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)
@@@ -2383,7 -2421,7 +2421,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)
@@@ -2394,7 -2432,7 +2432,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,
@@@ -2417,13 -2455,13 +2455,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),
@@@ -2459,7 -2497,7 +2497,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)
@@@ -2515,7 -2553,7 +2553,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)
@@@ -2538,7 -2576,7 +2576,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
@@@ -2581,14 -2619,14 +2619,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)
@@@ -2633,7 -2671,7 +2671,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))))
@@@ -2652,7 -2690,7 +2690,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))))
@@@ -2669,7 -2707,7 +2707,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
@@@ -2775,7 -2813,7 +2813,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)
@@@ -2844,7 -2882,7 +2882,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;
@@@ -2860,7 -2898,7 +2898,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)
@@@ -2872,7 -2910,7 +2910,7 @@@ struct iwl_scancomplete_notification 
        u8 last_channel;
        __le32 tsf_low;
        __le32 tsf_high;
 -} __attribute__ ((packed));
 +} __packed;
  
  
  /******************************************************************************
@@@ -2890,14 -2928,14 +2928,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)
@@@ -2909,7 -2947,7 +2947,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)
@@@ -2943,7 -2981,7 +2981,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 */
  
@@@ -2963,7 -3001,7 +3001,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)
  
@@@ -3086,14 -3124,14 +3124,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
@@@ -3107,7 -3145,7 +3145,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)
@@@ -3225,14 -3263,14 +3263,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;
  
  
  /*
@@@ -3264,7 -3302,7 +3302,7 @@@ struct iwl_missed_beacon_notif 
        __le32 total_missed_becons;
        __le32 num_expected_beacons;
        __le32 num_recvd_beacons;
 -} __attribute__ ((packed));
 +} __packed;
  
  
  /******************************************************************************
  #define HD_AUTO_CORR40_X4_TH_ADD_MIN_INDEX          (9)
  #define HD_OFDM_ENERGY_TH_IN_INDEX                  (10)
  
+ /*
+  * Additional table entries in enhance SENSITIVITY_CMD
+  */
+ #define HD_INA_NON_SQUARE_DET_OFDM_INDEX              (11)
+ #define HD_INA_NON_SQUARE_DET_CCK_INDEX                       (12)
+ #define HD_CORR_11_INSTEAD_OF_CORR_9_EN_INDEX         (13)
+ #define HD_OFDM_NON_SQUARE_DET_SLOPE_MRC_INDEX                (14)
+ #define HD_OFDM_NON_SQUARE_DET_INTERCEPT_MRC_INDEX    (15)
+ #define HD_OFDM_NON_SQUARE_DET_SLOPE_INDEX            (16)
+ #define HD_OFDM_NON_SQUARE_DET_INTERCEPT_INDEX                (17)
+ #define HD_CCK_NON_SQUARE_DET_SLOPE_MRC_INDEX         (18)
+ #define HD_CCK_NON_SQUARE_DET_INTERCEPT_MRC_INDEX     (19)
+ #define HD_CCK_NON_SQUARE_DET_SLOPE_INDEX             (20)
+ #define HD_CCK_NON_SQUARE_DET_INTERCEPT_INDEX         (21)
+ #define HD_RESERVED                                   (22)
+ /* number of entries for enhanced tbl */
+ #define ENHANCE_HD_TABLE_SIZE  (23)
+ /* number of additional entries for enhanced tbl */
+ #define ENHANCE_HD_TABLE_ENTRIES  (ENHANCE_HD_TABLE_SIZE - HD_TABLE_SIZE)
+ #define HD_INA_NON_SQUARE_DET_OFDM_DATA                       cpu_to_le16(0)
+ #define HD_INA_NON_SQUARE_DET_CCK_DATA                        cpu_to_le16(0)
+ #define HD_CORR_11_INSTEAD_OF_CORR_9_EN_DATA          cpu_to_le16(0)
+ #define HD_OFDM_NON_SQUARE_DET_SLOPE_MRC_DATA         cpu_to_le16(668)
+ #define HD_OFDM_NON_SQUARE_DET_INTERCEPT_MRC_DATA     cpu_to_le16(4)
+ #define HD_OFDM_NON_SQUARE_DET_SLOPE_DATA             cpu_to_le16(486)
+ #define HD_OFDM_NON_SQUARE_DET_INTERCEPT_DATA         cpu_to_le16(37)
+ #define HD_CCK_NON_SQUARE_DET_SLOPE_MRC_DATA          cpu_to_le16(853)
+ #define HD_CCK_NON_SQUARE_DET_INTERCEPT_MRC_DATA      cpu_to_le16(4)
+ #define HD_CCK_NON_SQUARE_DET_SLOPE_DATA              cpu_to_le16(476)
+ #define HD_CCK_NON_SQUARE_DET_INTERCEPT_DATA          cpu_to_le16(99)
  /* Control field in struct iwl_sensitivity_cmd */
  #define SENSITIVITY_CMD_CONTROL_DEFAULT_TABLE cpu_to_le16(0)
  #define SENSITIVITY_CMD_CONTROL_WORK_TABLE    cpu_to_le16(1)
  struct iwl_sensitivity_cmd {
        __le16 control;                 /* always use "1" */
        __le16 table[HD_TABLE_SIZE];    /* use HD_* as index */
 -} __attribute__ ((packed));
 +} __packed;
  
+ /*
+  *
+  */
+ struct iwl_enhance_sensitivity_cmd {
+       __le16 control;                 /* always use "1" */
+       __le16 enhance_table[ENHANCE_HD_TABLE_SIZE];    /* use HD_* as index */
+ } __attribute__ ((packed));
  
  /**
   * REPLY_PHY_CALIBRATION_CMD = 0xb0 (command, has simple generic response)
@@@ -3547,31 -3628,31 +3628,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 {
@@@ -3601,7 -3682,7 +3682,7 @@@ struct iwl_calib_chain_noise_gain_cmd 
        u8 delta_gain_1;
        u8 delta_gain_2;
        u8 pad[2];
 -} __attribute__ ((packed));
 +} __packed;
  
  /******************************************************************************
   * (12)
@@@ -3624,7 -3705,7 +3705,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
@@@ -3760,7 -3841,7 +3841,7 @@@ struct iwl_wimax_coex_event_entry 
        u8 win_medium_prio;
        u8 reserved;
        u8 flags;
 -} __attribute__ ((packed));
 +} __packed;
  
  /* COEX flag masks */
  
@@@ -3777,7 -3858,7 +3858,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
@@@ -3821,11 -3902,11 +3902,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;
  
  
  /******************************************************************************
@@@ -3869,7 -3950,7 +3950,7 @@@ struct iwl_rx_packet 
                __le32 status;
                u8 raw[0];
        } u;
 -} __attribute__ ((packed));
 +} __packed;
  
  int iwl_agn_check_rxon_cmd(struct iwl_priv *priv);
  
index 728752aa1bb528ce46de02518c06f9544b66e949,dff1b17d5ea8913e2226d88b8673843be24d313c..c4dba62b74af89557ef8e85207015921089c1f47
@@@ -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))
  
@@@ -570,6 -570,7 +570,7 @@@ enum iwl_ucode_tlv_type 
        IWL_UCODE_TLV_INIT_EVTLOG_PTR   = 11,
        IWL_UCODE_TLV_INIT_EVTLOG_SIZE  = 12,
        IWL_UCODE_TLV_INIT_ERRLOG_PTR   = 13,
+       IWL_UCODE_TLV_ENHANCE_SENS_TBL  = 14,
  };
  
  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
  
@@@ -1193,7 -1194,9 +1194,9 @@@ struct iwl_priv 
        u8 start_calib;
        struct iwl_sensitivity_data sensitivity_data;
        struct iwl_chain_noise_data chain_noise_data;
+       bool enhance_sensitivity_table;
        __le16 sensitivity_tbl[HD_TABLE_SIZE];
+       __le16 enhance_sensitivity_tbl[ENHANCE_HD_TABLE_ENTRIES];
  
        struct iwl_ht_config current_ht_config;
  
        struct work_struct ct_enter;
        struct work_struct ct_exit;
        struct work_struct start_internal_scan;
+       struct work_struct tx_flush;
  
        struct tasklet_struct irq_tasklet;
  
index 5488006491a2c20769ea4cc82a0ef5a89a5f4b43,f8b707d0d8a27f9690476d13824dc41a918a901b..3452dfa7b571b469c6c416a54d3a99dcb0ba4491
@@@ -118,7 -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 +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)
  #define EEPROM_6050_TX_POWER_VERSION    (4)
  #define EEPROM_6050_EEPROM_VERSION    (0x532)
  
+ /* 6x50g2 Specific */
+ #define EEPROM_6050G2_TX_POWER_VERSION    (6)
+ #define EEPROM_6050G2_EEPROM_VERSION  (0x553)
  /* 6x00g2 Specific */
  #define EEPROM_6000G2_TX_POWER_VERSION    (6)
  #define EEPROM_6000G2_EEPROM_VERSION  (0x709)
@@@ -312,7 -316,7 +316,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 -332,7 +332,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 -349,7 +349,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 -378,7 +378,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
index a3fcbb5f2c706684c05a21ef6a055f3b87b11341,dd896f28c9313a2780f41b8f4c3716ce6258856f..55b8370bc6d4a6ff7cfe57bad3a18f2cfe094e43
   */
  #define FH_TSSR_TX_ERROR_REG          (FH_TSSR_LOWER_BOUND + 0x018)
  
- #define FH_TSSR_TX_STATUS_REG_BIT_BUFS_EMPTY(_chnl) ((1 << (_chnl)) << 24)
- #define FH_TSSR_TX_STATUS_REG_BIT_NO_PEND_REQ(_chnl) ((1 << (_chnl)) << 16)
- #define FH_TSSR_TX_STATUS_REG_MSK_CHNL_IDLE(_chnl) \
-       (FH_TSSR_TX_STATUS_REG_BIT_BUFS_EMPTY(_chnl) | \
-       FH_TSSR_TX_STATUS_REG_BIT_NO_PEND_REQ(_chnl))
+ #define FH_TSSR_TX_STATUS_REG_MSK_CHNL_IDLE(_chnl) ((1 << (_chnl)) << 16)
  
  /* Tx service channels */
  #define FH_SRVC_CHNL          (9)
@@@ -449,7 -444,7 +444,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 -470,7 +470,7 @@@ static inline u8 iwl_get_dma_hi_addr(dm
  struct iwl_tfd_tb {
        __le32 lo;
        __le16 hi_n_len;
 -} __attribute__((packed));
 +} __packed;
  
  /**
   * struct iwl_tfd
@@@ -510,7 -505,7 +505,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 */
index 912fdc022d080d7c9669b76aa94c0249033c09f9,2e656bb7e14e9b3d48687ea273257e77ac54b222..77cd65db8500b2363496721702777cd280e3bb15
@@@ -2067,7 -2067,7 +2067,7 @@@ send_simple_event(islpci_private *priv
        memptr = kmalloc(IW_CUSTOM_MAX, GFP_KERNEL);
        if (!memptr)
                return;
-       BUG_ON(n > IW_CUSTOM_MAX);
+       BUG_ON(n >= IW_CUSTOM_MAX);
        wrqu.data.pointer = memptr;
        wrqu.data.length = n;
        strcpy(memptr, str);
@@@ -2101,7 -2101,7 +2101,7 @@@ struct ieee80211_beacon_phdr 
        u8 timestamp[8];
        u16 beacon_int;
        u16 capab_info;
 -} __attribute__ ((packed));
 +} __packed;
  
  #define WLAN_EID_GENERIC 0xdd
  static u8 wpa_oid[4] = { 0x00, 0x50, 0xf2, 1 };
index 552f9f4c73d69b33bda221720e339bbaf16c56b3,dc93e14f7ab7905ce2b2c13c254e7d6cf2cb277e..ed4ebcdde7c9c4155c58807cd5aae839a39ea63e
@@@ -74,7 -74,7 +74,7 @@@
   * Signal information.
   * Default offset is required for RSSI <-> dBm conversion.
   */
- #define DEFAULT_RSSI_OFFSET           120 /* FIXME */
+ #define DEFAULT_RSSI_OFFSET           120
  
  /*
   * Register layout information.
  #define TBTT_TIMER                    0x1124
  
  /*
-  * INT_TIMER_CFG:
+  * INT_TIMER_CFG: timer configuration
+  * PRE_TBTT_TIMER: leadtime to tbtt for pretbtt interrupt in units of 1/16 TU
+  * GP_TIMER: period of general purpose timer in units of 1/16 TU
   */
  #define INT_TIMER_CFG                 0x1128
+ #define INT_TIMER_CFG_PRE_TBTT_TIMER  FIELD32(0x0000ffff)
+ #define INT_TIMER_CFG_GP_TIMER                FIELD32(0xffff0000)
  
  /*
   * INT_TIMER_EN: GP-timer and pre-tbtt Int enable
   */
  #define INT_TIMER_EN                  0x112c
+ #define INT_TIMER_EN_PRE_TBTT_TIMER   FIELD32(0x00000001)
+ #define INT_TIMER_EN_GP_TIMER         FIELD32(0x00000002)
  
  /*
   * CH_IDLE_STA: channel idle time
   */
  #define EDCA_TID_AC_MAP                       0x1310
  
+ /*
+  * TX_PWR_CFG:
+  */
+ #define TX_PWR_CFG_RATE0              FIELD32(0x0000000f)
+ #define TX_PWR_CFG_RATE1              FIELD32(0x000000f0)
+ #define TX_PWR_CFG_RATE2              FIELD32(0x00000f00)
+ #define TX_PWR_CFG_RATE3              FIELD32(0x0000f000)
+ #define TX_PWR_CFG_RATE4              FIELD32(0x000f0000)
+ #define TX_PWR_CFG_RATE5              FIELD32(0x00f00000)
+ #define TX_PWR_CFG_RATE6              FIELD32(0x0f000000)
+ #define TX_PWR_CFG_RATE7              FIELD32(0xf0000000)
  /*
   * TX_PWR_CFG_0:
   */
  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 EEPROM_TXPOWER_A_2            FIELD16(0xff00)
  
  /*
-  * EEPROM TXpower byrate: 20MHZ power
+  * EEPROM TXPOWER by rate: tx power per tx rate for HT20 mode
   */
  #define EEPROM_TXPOWER_BYRATE         0x006f
+ #define EEPROM_TXPOWER_BYRATE_SIZE    9
+ #define EEPROM_TXPOWER_BYRATE_RATE0   FIELD16(0x000f)
+ #define EEPROM_TXPOWER_BYRATE_RATE1   FIELD16(0x00f0)
+ #define EEPROM_TXPOWER_BYRATE_RATE2   FIELD16(0x0f00)
+ #define EEPROM_TXPOWER_BYRATE_RATE3   FIELD16(0xf000)
  
  /*
   * EEPROM BBP.
index ec09f0d40ca22e88d22a94bb7556216ffcdf3951,b7c2995d4f40778c989129ca03dc397ff550d9ca..53d47d7a2a1ddf757c59194ffc60940f9e12d804
@@@ -291,7 -291,7 +291,7 @@@ struct wl1271_fw_status 
        __le32 tx_released_blks[NUM_TX_QUEUES];
        __le32 fw_localtime;
        __le32 padding[2];
 -} __attribute__ ((packed));
 +} __packed;
  
  struct wl1271_rx_mem_pool_addr {
        u32 addr;
  
  struct wl1271_scan {
        struct cfg80211_scan_request *req;
+       bool *scanned_ch;
        u8 state;
        u8 ssid[IW_ESSID_MAX_SIZE+1];
        size_t ssid_len;
-       u8 active;
-       u8 high_prio;
-       u8 probe_requests;
  };
  
  struct wl1271_if_operations {
@@@ -343,14 -341,14 +341,14 @@@ struct wl1271 
  #define WL1271_FLAG_JOINED             (2)
  #define WL1271_FLAG_GPIO_POWER         (3)
  #define WL1271_FLAG_TX_QUEUE_STOPPED   (4)
- #define WL1271_FLAG_SCANNING           (5)
- #define WL1271_FLAG_IN_ELP             (6)
- #define WL1271_FLAG_PSM                (7)
- #define WL1271_FLAG_PSM_REQUESTED      (8)
- #define WL1271_FLAG_IRQ_PENDING        (9)
- #define WL1271_FLAG_IRQ_RUNNING       (10)
- #define WL1271_FLAG_IDLE              (11)
- #define WL1271_FLAG_IDLE_REQUESTED    (12)
+ #define WL1271_FLAG_IN_ELP             (5)
+ #define WL1271_FLAG_PSM                (6)
+ #define WL1271_FLAG_PSM_REQUESTED      (7)
+ #define WL1271_FLAG_IRQ_PENDING        (8)
+ #define WL1271_FLAG_IRQ_RUNNING        (9)
+ #define WL1271_FLAG_IDLE              (10)
+ #define WL1271_FLAG_IDLE_REQUESTED    (11)
+ #define WL1271_FLAG_PSPOLL_FAILURE    (12)
        unsigned long flags;
  
        struct wl1271_partition_set part;
  
        struct completion *elp_compl;
        struct delayed_work elp_work;
+       struct delayed_work pspoll_work;
+       /* counter for ps-poll delivery failures */
+       int ps_poll_failures;
  
        /* retry counter for PSM entries */
        u8 psm_entry_retry;
index 4c87e601df2f07fb8a919020deb890b0b0433278,dc9839070495c5deb642bd79f16d3d0db731cbfa..4235bc56f750eb4b40b036952cd246dc2e67db6c
@@@ -75,7 -75,7 +75,7 @@@ struct acx_header 
  
        /* payload length (not including headers */
        __le16 len;
 -} __attribute__ ((packed));
 +} __packed;
  
  struct acx_error_counter {
        struct acx_header header;
@@@ -98,7 -98,7 +98,7 @@@
        /* the number of missed sequence numbers in the squentially */
        /* values of frames seq numbers */
        __le32 seq_num_miss;
 -} __attribute__ ((packed));
 +} __packed;
  
  struct acx_revision {
        struct acx_header header;
         * bits 24 - 31: Chip ID - The WiLink chip ID.
         */
        __le32 hw_version;
 -} __attribute__ ((packed));
 +} __packed;
  
  enum wl1271_psm_mode {
        /* Active mode */
@@@ -149,7 -149,7 +149,7 @@@ struct acx_sleep_auth 
        /* 2 - ELP mode: Deep / Max sleep*/
        u8  sleep_auth;
        u8  padding[3];
 -} __attribute__ ((packed));
 +} __packed;
  
  enum {
        HOSTIF_PCI_MASTER_HOST_INDIRECT,
@@@ -187,7 -187,7 +187,7 @@@ struct acx_rx_msdu_lifetime 
         * firmware discards the MSDU.
         */
        __le32 lifetime;
 -} __attribute__ ((packed));
 +} __packed;
  
  /*
   * RX Config Options Table
@@@ -275,13 -275,13 +275,13 @@@ struct acx_rx_config 
  
        __le32 config_options;
        __le32 filter_options;
 -} __attribute__ ((packed));
 +} __packed;
  
  struct acx_packet_detection {
        struct acx_header header;
  
        __le32 threshold;
 -} __attribute__ ((packed));
 +} __packed;
  
  
  enum acx_slot_type {
@@@ -299,7 -299,7 +299,7 @@@ struct acx_slot 
        u8 wone_index; /* Reserved */
        u8 slot_time;
        u8 reserved[6];
 -} __attribute__ ((packed));
 +} __packed;
  
  
  #define ACX_MC_ADDRESS_GROUP_MAX      (8)
@@@ -312,21 -312,21 +312,21 @@@ struct acx_dot11_grp_addr_tbl 
        u8 num_groups;
        u8 pad[2];
        u8 mac_table[ADDRESS_GROUP_MAX_LEN];
 -} __attribute__ ((packed));
 +} __packed;
  
  struct acx_rx_timeout {
        struct acx_header header;
  
        __le16 ps_poll_timeout;
        __le16 upsd_timeout;
 -} __attribute__ ((packed));
 +} __packed;
  
  struct acx_rts_threshold {
        struct acx_header header;
  
        __le16 threshold;
        u8 pad[2];
 -} __attribute__ ((packed));
 +} __packed;
  
  struct acx_beacon_filter_option {
        struct acx_header header;
         */
        u8 max_num_beacons;
        u8 pad[2];
 -} __attribute__ ((packed));
 +} __packed;
  
  /*
   * ACXBeaconFilterEntry (not 221)
@@@ -383,21 -383,21 +383,21 @@@ struct acx_beacon_filter_ie_table 
        u8 num_ie;
        u8 pad[3];
        u8 table[BEACON_FILTER_TABLE_MAX_SIZE];
 -} __attribute__ ((packed));
 +} __packed;
  
  struct acx_conn_monit_params {
         struct acx_header header;
  
         __le32 synch_fail_thold; /* number of beacons missed */
         __le32 bss_lose_timeout; /* number of TU's from synch fail */
 -} __attribute__ ((packed));
 +} __packed;
  
  struct acx_bt_wlan_coex {
        struct acx_header header;
  
        u8 enable;
        u8 pad[3];
 -} __attribute__ ((packed));
 +} __packed;
  
  struct acx_bt_wlan_coex_param {
        struct acx_header header;
        __le32 params[CONF_SG_PARAMS_MAX];
        u8 param_idx;
        u8 padding[3];
 -} __attribute__ ((packed));
 +} __packed;
  
  struct acx_dco_itrim_params {
        struct acx_header header;
        u8 enable;
        u8 padding[3];
        __le32 timeout;
 -} __attribute__ ((packed));
 +} __packed;
  
  struct acx_energy_detection {
        struct acx_header header;
        __le16 rx_cca_threshold;
        u8 tx_energy_detection;
        u8 pad;
 -} __attribute__ ((packed));
 +} __packed;
  
  struct acx_beacon_broadcast {
        struct acx_header header;
        /* Consecutive PS Poll failures before updating the host */
        u8 ps_poll_threshold;
        u8 pad[2];
 -} __attribute__ ((packed));
 +} __packed;
  
  struct acx_event_mask {
        struct acx_header header;
  
        __le32 event_mask;
        __le32 high_event_mask; /* Unused */
 -} __attribute__ ((packed));
 +} __packed;
  
  #define CFG_RX_FCS            BIT(2)
  #define CFG_RX_ALL_GOOD               BIT(3)
@@@ -488,14 -488,14 +488,14 @@@ struct acx_feature_config 
  
        __le32 options;
        __le32 data_flow_options;
 -} __attribute__ ((packed));
 +} __packed;
  
  struct acx_current_tx_power {
        struct acx_header header;
  
        u8  current_tx_power;
        u8  padding[3];
 -} __attribute__ ((packed));
 +} __packed;
  
  struct acx_wake_up_condition {
        struct acx_header header;
        u8 wake_up_event; /* Only one bit can be set */
        u8 listen_interval;
        u8 pad[2];
 -} __attribute__ ((packed));
 +} __packed;
  
  struct acx_aid {
        struct acx_header header;
         */
        __le16 aid;
        u8 pad[2];
 -} __attribute__ ((packed));
 +} __packed;
  
  enum acx_preamble_type {
        ACX_PREAMBLE_LONG = 0,
@@@ -529,7 -529,7 +529,7 @@@ struct acx_preamble 
         */
        u8 preamble;
        u8 padding[3];
 -} __attribute__ ((packed));
 +} __packed;
  
  enum acx_ctsprotect_type {
        CTSPROTECT_DISABLE = 0,
@@@ -540,11 -540,11 +540,11 @@@ struct acx_ctsprotect 
        struct acx_header header;
        u8 ctsprotect;
        u8 padding[3];
 -} __attribute__ ((packed));
 +} __packed;
  
  struct acx_tx_statistics {
        __le32 internal_desc_overflow;
 -}  __attribute__ ((packed));
 +}  __packed;
  
  struct acx_rx_statistics {
        __le32 out_of_mem;
        __le32 xfr_hint_trig;
        __le32 path_reset;
        __le32 reset_counter;
 -} __attribute__ ((packed));
 +} __packed;
  
  struct acx_dma_statistics {
        __le32 rx_requested;
        __le32 rx_errors;
        __le32 tx_requested;
        __le32 tx_errors;
 -}  __attribute__ ((packed));
 +}  __packed;
  
  struct acx_isr_statistics {
        /* host command complete */
  
        /* (INT_STS_ND & INT_TRIG_LOW_RSSI) */
        __le32 low_rssi;
 -} __attribute__ ((packed));
 +} __packed;
  
  struct acx_wep_statistics {
        /* WEP address keys configured */
  
        /* WEP decrypt interrupts */
        __le32 interrupt;
 -} __attribute__ ((packed));
 +} __packed;
  
  #define ACX_MISSED_BEACONS_SPREAD 10
  
@@@ -703,12 -703,12 +703,12 @@@ struct acx_pwr_statistics 
  
        /* the number of beacons in awake mode */
        __le32 rcvd_awake_beacons;
 -} __attribute__ ((packed));
 +} __packed;
  
  struct acx_mic_statistics {
        __le32 rx_pkts;
        __le32 calc_failure;
 -} __attribute__ ((packed));
 +} __packed;
  
  struct acx_aes_statistics {
        __le32 encrypt_fail;
        __le32 decrypt_packets;
        __le32 encrypt_interrupt;
        __le32 decrypt_interrupt;
 -} __attribute__ ((packed));
 +} __packed;
  
  struct acx_event_statistics {
        __le32 heart_beat;
        __le32 oom_late;
        __le32 phy_transmit_error;
        __le32 tx_stuck;
 -} __attribute__ ((packed));
 +} __packed;
  
  struct acx_ps_statistics {
        __le32 pspoll_timeouts;
        __le32 pspoll_max_apturn;
        __le32 pspoll_utilization;
        __le32 upsd_utilization;
 -} __attribute__ ((packed));
 +} __packed;
  
  struct acx_rxpipe_statistics {
        __le32 rx_prep_beacon_drop;
        __le32 beacon_buffer_thres_host_int_trig_rx_data;
        __le32 missed_beacon_host_int_trig_rx_data;
        __le32 tx_xfr_host_int_trig_rx_data;
 -} __attribute__ ((packed));
 +} __packed;
  
  struct acx_statistics {
        struct acx_header header;
        struct acx_event_statistics event;
        struct acx_ps_statistics ps;
        struct acx_rxpipe_statistics rxpipe;
 -} __attribute__ ((packed));
 +} __packed;
  
  struct acx_rate_class {
        __le32 enabled_rates;
@@@ -780,7 -780,7 +780,7 @@@ struct acx_rate_policy 
  
        __le32 rate_class_cnt;
        struct acx_rate_class rate_class[CONF_TX_MAX_RATE_CLASSES];
 -} __attribute__ ((packed));
 +} __packed;
  
  struct acx_ac_cfg {
        struct acx_header header;
        u8 aifsn;
        u8 reserved;
        __le16 tx_op_limit;
 -} __attribute__ ((packed));
 +} __packed;
  
  struct acx_tid_config {
        struct acx_header header;
        u8 ack_policy;
        u8 padding[3];
        __le32 apsd_conf[2];
 -} __attribute__ ((packed));
 +} __packed;
  
  struct acx_frag_threshold {
        struct acx_header header;
        __le16 frag_threshold;
        u8 padding[2];
 -} __attribute__ ((packed));
 +} __packed;
  
  struct acx_tx_config_options {
        struct acx_header header;
        __le16 tx_compl_timeout;     /* msec */
        __le16 tx_compl_threshold;   /* number of packets */
 -} __attribute__ ((packed));
 +} __packed;
  
  #define ACX_RX_MEM_BLOCKS     70
  #define ACX_TX_MIN_MEM_BLOCKS 40
@@@ -828,7 -828,7 +828,7 @@@ struct wl1271_acx_config_memory 
        u8 num_stations;
        u8 num_ssid_profiles;
        __le32 total_tx_descriptors;
 -} __attribute__ ((packed));
 +} __packed;
  
  struct wl1271_acx_mem_map {
        struct acx_header header;
        u8 *rx_cbuf;
        __le32 rx_ctrl;
        __le32 tx_ctrl;
 -} __attribute__ ((packed));
 +} __packed;
  
  struct wl1271_acx_rx_config_opt {
        struct acx_header header;
        __le16 timeout;
        u8 queue_type;
        u8 reserved;
 -} __attribute__ ((packed));
 +} __packed;
  
  
  struct wl1271_acx_bet_enable {
        u8 enable;
        u8 max_consecutive;
        u8 padding[2];
 -} __attribute__ ((packed));
 +} __packed;
  
  #define ACX_IPV4_VERSION 4
  #define ACX_IPV6_VERSION 6
@@@ -905,7 -905,7 +905,7 @@@ struct wl1271_acx_arp_filter 
                               requests directed to this IP address will pass
                               through. For IPv4, the first four bytes are
                               used. */
 -} __attribute__((packed));
 +} __packed;
  
  struct wl1271_acx_pm_config {
        struct acx_header header;
        __le32 host_clk_settling_time;
        u8 host_fast_wakeup_support;
        u8 padding[3];
 -} __attribute__ ((packed));
 +} __packed;
  
  struct wl1271_acx_keep_alive_mode {
        struct acx_header header;
  
        u8 enabled;
        u8 padding[3];
 -} __attribute__ ((packed));
 +} __packed;
  
  enum {
        ACX_KEEP_ALIVE_NO_TX = 0,
@@@ -940,7 -940,7 +940,7 @@@ struct wl1271_acx_keep_alive_config 
        u8 tpl_validation;
        u8 trigger;
        u8 padding;
 -} __attribute__ ((packed));
 +} __packed;
  
  enum {
        WL1271_ACX_TRIG_TYPE_LEVEL = 0,
@@@ -993,6 -993,17 +993,17 @@@ struct wl1271_acx_rssi_snr_avg_weights 
        u8 snr_data;
  };
  
+ struct wl1271_acx_fw_tsf_information {
+       struct acx_header header;
+       __le32 current_tsf_high;
+       __le32 current_tsf_low;
+       __le32 last_bttt_high;
+       __le32 last_tbtt_low;
+       u8 last_dtim_count;
+       u8 padding[3];
+ } __packed;
  enum {
        ACX_WAKE_UP_CONDITIONS      = 0x0002,
        ACX_MEM_CFG                 = 0x0003,
@@@ -1106,13 -1117,13 +1117,13 @@@ int wl1271_acx_init_mem_config(struct w
  int wl1271_acx_init_rx_interrupt(struct wl1271 *wl);
  int wl1271_acx_smart_reflex(struct wl1271 *wl);
  int wl1271_acx_bet_enable(struct wl1271 *wl, bool enable);
- int wl1271_acx_arp_ip_filter(struct wl1271 *wl, bool enable, u8 *address,
-                            u8 version);
+ int wl1271_acx_arp_ip_filter(struct wl1271 *wl, bool enable, __be32 address);
  int wl1271_acx_pm_config(struct wl1271 *wl);
  int wl1271_acx_keep_alive_mode(struct wl1271 *wl, bool enable);
  int wl1271_acx_keep_alive_config(struct wl1271 *wl, u8 index, u8 tpl_valid);
  int wl1271_acx_rssi_snr_trigger(struct wl1271 *wl, bool enable,
                                s16 thold, u8 hyst);
  int wl1271_acx_rssi_snr_avg_weights(struct wl1271 *wl);
+ int wl1271_acx_tsf_info(struct wl1271 *wl, u64 *mactime);
  
  #endif /* __WL1271_ACX_H__ */
index f5745d829c9b021ce8513ec5741ee2e9a4fe4c78,34cd013ae5b0beab832160af92f625705968aef9..af577ee8eb0257c4585c86518f776b98d380e387
@@@ -41,9 -41,6 +41,6 @@@ int wl1271_cmd_data_path(struct wl1271 
  int wl1271_cmd_ps_mode(struct wl1271 *wl, u8 ps_mode, bool send);
  int wl1271_cmd_read_memory(struct wl1271 *wl, u32 addr, void *answer,
                           size_t len);
- int wl1271_cmd_scan(struct wl1271 *wl, const u8 *ssid, size_t ssid_len,
-                   struct cfg80211_scan_request *req, u8 active_scan,
-                   u8 high_prio, u8 band, u8 probe_requests);
  int wl1271_cmd_template_set(struct wl1271 *wl, u16 template_id,
                            void *buf, size_t buf_len, int index, u32 rates);
  int wl1271_cmd_build_null_data(struct wl1271 *wl);
@@@ -136,14 -133,14 +133,14 @@@ struct wl1271_cmd_header 
        __le16 status;
        /* payload */
        u8 data[0];
 -} __attribute__ ((packed));
 +} __packed;
  
  #define WL1271_CMD_MAX_PARAMS 572
  
  struct wl1271_command {
        struct wl1271_cmd_header header;
        u8  parameters[WL1271_CMD_MAX_PARAMS];
 -} __attribute__ ((packed));
 +} __packed;
  
  enum {
        CMD_MAILBOX_IDLE                =  0,
@@@ -196,7 -193,7 +193,7 @@@ struct cmd_read_write_memory 
           of this field is the Host in WRITE command or the Wilink in READ
           command. */
        u8 value[MAX_READ_SIZE];
 -} __attribute__ ((packed));
 +} __packed;
  
  #define CMDMBOX_HEADER_LEN 4
  #define CMDMBOX_INFO_ELEM_HEADER_LEN 4
@@@ -243,14 -240,14 +240,14 @@@ struct wl1271_cmd_join 
        u8 ssid[IW_ESSID_MAX_SIZE];
        u8 ctrl; /* JOIN_CMD_CTRL_* */
        u8 reserved[3];
 -} __attribute__ ((packed));
 +} __packed;
  
  struct cmd_enabledisable_path {
        struct wl1271_cmd_header header;
  
        u8 channel;
        u8 padding[3];
 -} __attribute__ ((packed));
 +} __packed;
  
  #define WL1271_RATE_AUTOMATIC  0
  
@@@ -266,7 -263,7 +263,7 @@@ struct wl1271_cmd_template_set 
        u8 aflags;
        u8 reserved;
        u8 template_data[WL1271_CMD_TEMPL_MAX_SIZE];
 -} __attribute__ ((packed));
 +} __packed;
  
  #define TIM_ELE_ID    5
  #define PARTIAL_VBM_MAX    251
@@@ -278,7 -275,7 +275,7 @@@ struct wl1271_tim 
        u8 dtim_period;
        u8 bitmap_ctrl;
        u8 pvb_field[PARTIAL_VBM_MAX]; /* Partial Virtual Bitmap */
 -} __attribute__ ((packed));
 +} __packed;
  
  enum wl1271_cmd_ps_mode {
        STATION_ACTIVE_MODE,
@@@ -298,7 -295,7 +295,7 @@@ struct wl1271_cmd_ps_params 
          */
        u8 hang_over_period;
        __le32 null_data_rate;
 -} __attribute__ ((packed));
 +} __packed;
  
  /* HW encryption keys */
  #define NUM_ACCESS_CATEGORIES_COPY 4
@@@ -348,77 -345,12 +345,12 @@@ struct wl1271_cmd_set_keys 
        u8 key[MAX_KEY_SIZE];
        __le16 ac_seq_num16[NUM_ACCESS_CATEGORIES_COPY];
        __le32 ac_seq_num32[NUM_ACCESS_CATEGORIES_COPY];
 -} __attribute__ ((packed));
 +} __packed;
  
- #define WL1271_SCAN_MAX_CHANNELS       24
- #define WL1271_SCAN_DEFAULT_TAG        1
- #define WL1271_SCAN_CURRENT_TX_PWR     0
- #define WL1271_SCAN_OPT_ACTIVE         0
- #define WL1271_SCAN_OPT_PASSIVE              1
- #define WL1271_SCAN_OPT_PRIORITY_HIGH  4
- #define WL1271_SCAN_CHAN_MIN_DURATION  30000  /* TU */
- #define WL1271_SCAN_CHAN_MAX_DURATION  60000  /* TU */
- #define WL1271_SCAN_BAND_2_4_GHZ 0
- #define WL1271_SCAN_BAND_5_GHZ 1
- #define WL1271_SCAN_BAND_DUAL 2
- struct basic_scan_params {
-       __le32 rx_config_options;
-       __le32 rx_filter_options;
-       /* Scan option flags (WL1271_SCAN_OPT_*) */
-       __le16 scan_options;
-       /* Number of scan channels in the list (maximum 30) */
-       u8 num_channels;
-       /* This field indicates the number of probe requests to send
-          per channel for an active scan */
-       u8 num_probe_requests;
-       /* Rate bit field for sending the probes */
-       __le32 tx_rate;
-       u8 tid_trigger;
-       u8 ssid_len;
-       /* in order to align */
-       u8 padding1[2];
-       u8 ssid[IW_ESSID_MAX_SIZE];
-       /* Band to scan */
-       u8 band;
-       u8 use_ssid_list;
-       u8 scan_tag;
-       u8 padding2;
- } __packed;
- struct basic_scan_channel_params {
-       /* Duration in TU to wait for frames on a channel for active scan */
-       __le32 min_duration;
-       __le32 max_duration;
-       __le32 bssid_lsb;
-       __le16 bssid_msb;
-       u8 early_termination;
-       u8 tx_power_att;
-       u8 channel;
-       /* FW internal use only! */
-       u8 dfs_candidate;
-       u8 activity_detected;
-       u8 pad;
- } __packed;
- struct wl1271_cmd_scan {
-       struct wl1271_cmd_header header;
-       struct basic_scan_params params;
-       struct basic_scan_channel_params channels[WL1271_SCAN_MAX_CHANNELS];
- } __packed;
- struct wl1271_cmd_trigger_scan_to {
-       struct wl1271_cmd_header header;
-       __le32 timeout;
- } __packed;
  struct wl1271_cmd_test_header {
        u8 id;
        u8 padding[3];
 -} __attribute__ ((packed));
 +} __packed;
  
  enum wl1271_channel_tune_bands {
        WL1271_CHANNEL_TUNE_BAND_2_4,
@@@ -447,7 -379,7 +379,7 @@@ struct wl1271_general_parms_cmd 
        u8 sr_sen_nrn;
        u8 sr_sen_prn;
        u8 padding[3];
 -} __attribute__ ((packed));
 +} __packed;
  
  struct wl1271_radio_parms_cmd {
        struct wl1271_cmd_header header;
        u8 padding2;
        struct wl1271_ini_fem_params_5 dyn_params_5;
        u8 padding3[2];
 -} __attribute__ ((packed));
 +} __packed;
  
  struct wl1271_cmd_cal_channel_tune {
        struct wl1271_cmd_header header;
        u8 channel;
  
        __le16 radio_status;
 -} __attribute__ ((packed));
 +} __packed;
  
  struct wl1271_cmd_cal_update_ref_point {
        struct wl1271_cmd_header header;
        __le32 ref_detector;
        u8  sub_band;
        u8  padding[3];
 -} __attribute__ ((packed));
 +} __packed;
  
  #define MAX_TLV_LENGTH         400
  #define       MAX_NVS_VERSION_LENGTH 12
@@@ -507,7 -439,7 +439,7 @@@ struct wl1271_cmd_cal_p2g 
  
        u8  sub_band_mask;
        u8  padding2;
 -} __attribute__ ((packed));
 +} __packed;
  
  
  /*
@@@ -535,6 -467,6 +467,6 @@@ struct wl1271_cmd_disconnect 
        u8  type;
  
        u8  padding;
 -} __attribute__ ((packed));
 +} __packed;
  
  #endif /* __WL1271_CMD_H__ */
index 43d5aeae17830473d608cacba95e2095d7ef6f90,9fb5a940b1a5abd4298f43f10bea487e3ef3480b..e4751667cf5ef905b8c842883beb3a037b392c90
@@@ -85,7 -85,7 +85,7 @@@ struct event_debug_report 
        __le32 report_1;
        __le32 report_2;
        __le32 report_3;
 -} __attribute__ ((packed));
 +} __packed;
  
  #define NUM_OF_RSSI_SNR_TRIGGERS 8
  
@@@ -116,10 -116,11 +116,11 @@@ struct event_mailbox 
        u8 ps_status;
  
        u8 reserved_5[29];
 -} __attribute__ ((packed));
 +} __packed;
  
  int wl1271_event_unmask(struct wl1271 *wl);
  void wl1271_event_mbox_config(struct wl1271 *wl);
  int wl1271_event_handle(struct wl1271 *wl, u8 mbox);
+ void wl1271_pspoll_work(struct work_struct *work);
  
  #endif
diff --combined net/mac80211/cfg.c
index 9eb02a34088989d68ff9ec499b0541ed3c962c85,5b8b4460b69f95f69dcd9e9786bb02d2b459aaa5..5e56e91c92c47f7b7ff97b0117ca5a9654cb5997
@@@ -143,6 -143,11 +143,11 @@@ static int ieee80211_add_key(struct wip
                return -EINVAL;
        }
  
+       /* reject WEP and TKIP keys if WEP failed to initialize */
+       if ((alg == ALG_WEP || alg == ALG_TKIP) &&
+           IS_ERR(sdata->local->wep_tx_tfm))
+               return -EINVAL;
        key = ieee80211_key_alloc(alg, key_idx, params->key_len, params->key,
                                  params->seq_len, params->seq);
        if (!key)
@@@ -595,7 -600,7 +600,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)
  {
diff --combined net/wireless/nl80211.c
index 85285b43d3744c5abeef766ba86a6558f974b477,cea595e2ed4dbd6bf435764760c9810d18ffec41..fbfac588297cd248337f9ea2cfd2d1bd52ea686d
@@@ -877,7 -877,7 +877,7 @@@ static int nl80211_set_wiphy(struct sk_
                int idx, mbm = 0;
  
                if (!rdev->ops->set_tx_power) {
-                       return -EOPNOTSUPP;
+                       result = -EOPNOTSUPP;
                        goto bad_res;
                }
  
@@@ -1138,7 -1138,7 +1138,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;
        }