]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
authorDavid S. Miller <davem@davemloft.net>
Fri, 11 Jun 2010 18:34:06 +0000 (11:34 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 11 Jun 2010 18:34:06 +0000 (11:34 -0700)
Conflicts:
drivers/net/wireless/wl12xx/wl1271.h
drivers/net/wireless/wl12xx/wl1271_cmd.h

20 files changed:
1  2 
MAINTAINERS
drivers/net/wireless/ipw2x00/ipw2100.c
drivers/net/wireless/iwlwifi/iwl-commands.h
drivers/net/wireless/iwlwifi/iwl-dev.h
drivers/net/wireless/mwl8k.c
drivers/net/wireless/orinoco/hermes_dld.c
drivers/net/wireless/orinoco/orinoco_usb.c
drivers/net/wireless/orinoco/wext.c
drivers/net/wireless/prism54/isl_ioctl.c
drivers/net/wireless/rndis_wlan.c
drivers/net/wireless/rt2x00/rt2800.h
drivers/net/wireless/wl12xx/wl1271.h
drivers/net/wireless/wl12xx/wl1271_cmd.h
drivers/net/wireless/wl12xx/wl1271_ini.h
drivers/net/wireless/wl12xx/wl1271_tx.h
include/net/cfg80211.h
net/mac80211/cfg.c
net/mac80211/ieee80211_i.h
net/mac80211/rx.c
net/mac80211/sta_info.c

diff --combined MAINTAINERS
index 13608bd2e7913941bae445f08c201912f798c2fd,83be538d26c406c6ed3086cf36457055372ef8c1..0924a76da873e5ac5cde0cc761f9b29c36a6b993
@@@ -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,7 -2966,6 +2978,6 @@@ F:      drivers/net/ixgb
  F:    drivers/net/ixgbe/
  
  INTEL PRO/WIRELESS 2100 NETWORK CONNECTION SUPPORT
- M:    Zhu Yi <yi.zhu@intel.com>
  M:    Reinette Chatre <reinette.chatre@intel.com>
  M:    Intel Linux Wireless <ilw@linux.intel.com>
  L:    linux-wireless@vger.kernel.org
@@@ -2988,7 -2975,6 +2987,6 @@@ F:      Documentation/networking/README.ipw2
  F:    drivers/net/wireless/ipw2x00/ipw2100.*
  
  INTEL PRO/WIRELESS 2915ABG NETWORK CONNECTION SUPPORT
- M:    Zhu Yi <yi.zhu@intel.com>
  M:    Reinette Chatre <reinette.chatre@intel.com>
  M:    Intel Linux Wireless <ilw@linux.intel.com>
  L:    linux-wireless@vger.kernel.org
@@@ -3019,8 -3005,8 +3017,8 @@@ F:      drivers/net/wimax/i2400m
  F:    include/linux/wimax/i2400m.h
  
  INTEL WIRELESS WIFI LINK (iwlwifi)
- M:    Zhu Yi <yi.zhu@intel.com>
  M:    Reinette Chatre <reinette.chatre@intel.com>
+ M:    Wey-Yi Guy <wey-yi.w.guy@intel.com>
  M:    Intel Linux Wireless <ilw@linux.intel.com>
  L:    linux-wireless@vger.kernel.org
  W:    http://intellinuxwireless.org
@@@ -3030,7 -3016,6 +3028,6 @@@ F:      drivers/net/wireless/iwlwifi
  
  INTEL WIRELESS MULTICOMM 3200 WIFI (iwmc3200wifi)
  M:    Samuel Ortiz <samuel.ortiz@intel.com>
- M:    Zhu Yi <yi.zhu@intel.com>
  M:    Intel Linux Wireless <ilw@linux.intel.com>
  L:    linux-wireless@vger.kernel.org
  S:    Supported
@@@ -3338,17 -3323,15 +3335,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>
@@@ -4635,14 -4618,6 +4632,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
@@@ -4783,12 -4758,6 +4780,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
@@@ -4843,9 -4812,6 +4840,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>
@@@ -5014,12 -4980,6 +5011,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 4264fc091ada29e87e360383cabe157cd1973aa1,18ebd602670d1fa9f716de1de675248f196e56bb..56350d571960ce069c0e01bf6f22c08117e47297
@@@ -3467,10 -3467,8 +3467,8 @@@ static int ipw2100_msg_allocate(struct 
        dma_addr_t p;
  
        priv->msg_buffers =
-           (struct ipw2100_tx_packet *)kmalloc(IPW_COMMAND_POOL_SIZE *
-                                               sizeof(struct
-                                                      ipw2100_tx_packet),
-                                               GFP_KERNEL);
+           kmalloc(IPW_COMMAND_POOL_SIZE * sizeof(struct ipw2100_tx_packet),
+                   GFP_KERNEL);
        if (!priv->msg_buffers) {
                printk(KERN_ERR DRV_NAME ": %s: PCI alloc failed for msg "
                       "buffers.\n", priv->net_dev->name);
@@@ -4499,10 -4497,8 +4497,8 @@@ static int ipw2100_tx_allocate(struct i
        }
  
        priv->tx_buffers =
-           (struct ipw2100_tx_packet *)kmalloc(TX_PENDED_QUEUE_LENGTH *
-                                               sizeof(struct
-                                                      ipw2100_tx_packet),
-                                               GFP_ATOMIC);
+           kmalloc(TX_PENDED_QUEUE_LENGTH * sizeof(struct ipw2100_tx_packet),
+                   GFP_ATOMIC);
        if (!priv->tx_buffers) {
                printk(KERN_ERR DRV_NAME
                       ": %s: alloc failed form tx buffers.\n",
@@@ -4651,9 -4647,9 +4647,9 @@@ static int ipw2100_rx_allocate(struct i
        /*
         * allocate packets
         */
-       priv->rx_buffers = (struct ipw2100_rx_packet *)
-           kmalloc(RX_QUEUE_LENGTH * sizeof(struct ipw2100_rx_packet),
-                   GFP_KERNEL);
+       priv->rx_buffers = kmalloc(RX_QUEUE_LENGTH *
+                                  sizeof(struct ipw2100_rx_packet),
+                                  GFP_KERNEL);
        if (!priv->rx_buffers) {
                IPW_DEBUG_INFO("can't allocate rx packet buffer table\n");
  
@@@ -5233,7 -5229,7 +5229,7 @@@ struct security_info_params 
        u8 auth_mode;
        u8 replay_counters_number;
        u8 unicast_using_group;
 -} __attribute__ ((packed));
 +} __packed;
  
  static int ipw2100_set_security_information(struct ipw2100_priv *priv,
                                            int auth_mode,
@@@ -8475,7 -8471,7 +8471,7 @@@ struct ipw2100_fw_header 
        short mode;
        unsigned int fw_size;
        unsigned int uc_size;
 -} __attribute__ ((packed));
 +} __packed;
  
  static int ipw2100_mod_firmware_load(struct ipw2100_fw *fw)
  {
index 73d2d59bc1df1beec241fb0464177f86df48433d,d5938e43c5dca6df84e729c3d69b5d41d4813fc2..c579965ec55655c357b00ae0e01f66e0a29c5683
@@@ -95,7 -95,7 +95,7 @@@ enum 
  
        /* Multi-Station support */
        REPLY_ADD_STA = 0x18,
-       REPLY_REMOVE_STA = 0x19,        /* not used */
+       REPLY_REMOVE_STA = 0x19,
        REPLY_REMOVE_ALL_STA = 0x1a,    /* not used */
  
        /* Security */
@@@ -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)
  
  /* Special, dedicated locations within device's station table */
  #define       IWL_AP_ID               0
- #define IWL_MULTICAST_ID      1
  #define       IWL_STA_ID              2
  #define       IWL3945_BROADCAST_ID    24
  #define IWL3945_STATION_COUNT 25
@@@ -1015,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
@@@ -1049,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)
@@@ -1103,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)
@@@ -1208,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
@@@ -1220,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
@@@ -1282,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)
@@@ -1311,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))
  
@@@ -1327,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;
  
  
  /*
@@@ -1365,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 {
        __le16 byte_count;
        __le16 reserved;
 -} __attribute__ ((packed));
 +} __packed;
  
  
  /******************************************************************************
@@@ -1557,7 -1556,7 +1556,7 @@@ struct iwl3945_tx_cmd 
         */
        u8 payload[0];
        struct ieee80211_hdr hdr[0];
 -} __attribute__ ((packed));
 +} __packed;
  
  /*
   * REPLY_TX = 0x1c (response)
@@@ -1569,7 -1568,7 +1568,7 @@@ struct iwl3945_tx_resp 
        u8 rate;
        __le32 wireless_media_time;
        __le32 status;          /* TX status */
 -} __attribute__ ((packed));
 +} __packed;
  
  
  /*
@@@ -1581,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.
   *
@@@ -1826,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
@@@ -1927,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)
   *
@@@ -1945,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)
@@@ -1958,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;
  
  
  /**
@@@ -1987,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 */
@@@ -2040,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)
@@@ -2081,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)
@@@ -2287,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:
@@@ -2328,7 -2327,7 +2327,7 @@@ struct iwl_bt_cmd 
        u8 reserved;
        __le32 kill_ack_mask;
        __le32 kill_cts_mask;
 -} __attribute__ ((packed));
 +} __packed;
  
  /******************************************************************************
   * (6)
@@@ -2353,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)
@@@ -2372,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)
@@@ -2383,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,
@@@ -2406,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),
@@@ -2448,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)
@@@ -2504,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)
@@@ -2527,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
@@@ -2570,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)
@@@ -2622,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))))
@@@ -2641,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))))
@@@ -2658,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
@@@ -2764,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)
@@@ -2833,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;
@@@ -2849,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)
@@@ -2861,7 -2860,7 +2860,7 @@@ struct iwl_scancomplete_notification 
        u8 last_channel;
        __le32 tsf_low;
        __le32 tsf_high;
 -} __attribute__ ((packed));
 +} __packed;
  
  
  /******************************************************************************
@@@ -2879,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)
@@@ -2898,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)
@@@ -2932,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 */
  
@@@ -2952,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)
  
@@@ -3075,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
@@@ -3096,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)
@@@ -3214,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;
  
  
  /*
@@@ -3253,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;
  
  
  /**
@@@ -3536,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 {
@@@ -3590,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)
@@@ -3613,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
@@@ -3749,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 */
  
@@@ -3766,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
@@@ -3810,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;
  
  
  /******************************************************************************
@@@ -3858,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);
  
index a36a6ef45aae16a2ea6e85865267f1767cffcf85,52c3cdda8367f55b01fee759742a8dc1fe50afe2..fc6072cdd96fdc4f46f417ce23e5560d7d9879d3
  #include "iwl-power.h"
  #include "iwl-agn-rs.h"
  
- /* configuration for the iwl4965 */
- extern struct iwl_cfg iwl4965_agn_cfg;
- extern struct iwl_cfg iwl5300_agn_cfg;
- extern struct iwl_cfg iwl5100_agn_cfg;
- extern struct iwl_cfg iwl5350_agn_cfg;
- extern struct iwl_cfg iwl5100_bgn_cfg;
- extern struct iwl_cfg iwl5100_abg_cfg;
- extern struct iwl_cfg iwl5150_agn_cfg;
- extern struct iwl_cfg iwl5150_abg_cfg;
- extern struct iwl_cfg iwl6000g2a_2agn_cfg;
- extern struct iwl_cfg iwl6000i_2agn_cfg;
- extern struct iwl_cfg iwl6000i_2abg_cfg;
- extern struct iwl_cfg iwl6000i_2bg_cfg;
- extern struct iwl_cfg iwl6000_3agn_cfg;
- extern struct iwl_cfg iwl6050_2agn_cfg;
- extern struct iwl_cfg iwl6050_2abg_cfg;
- extern struct iwl_cfg iwl1000_bgn_cfg;
- extern struct iwl_cfg iwl1000_bg_cfg;
  struct iwl_tx_queue;
  
  /* CT-KILL constants */
@@@ -133,8 -114,8 +114,8 @@@ struct iwl_cmd_meta 
         * structure is stored at the end of the shared queue memory. */
        u32 flags;
  
-       DECLARE_PCI_UNMAP_ADDR(mapping)
-       DECLARE_PCI_UNMAP_LEN(len)
+       DEFINE_DMA_UNMAP_ADDR(mapping);
+       DEFINE_DMA_UNMAP_LEN(len);
  };
  
  /*
@@@ -157,11 -138,11 +138,11 @@@ 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 {
-       struct sk_buff *skb[IWL_NUM_OF_TBS - 1];
+       struct sk_buff *skb;
  };
  
  /**
@@@ -343,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))
  
@@@ -433,7 -414,7 +414,7 @@@ struct iwl_ht_agg 
  
  
  struct iwl_tid_data {
-       u16 seq_number;
+       u16 seq_number; /* agn only */
        u16 tfds_in_queue;
        struct iwl_ht_agg agg;
  };
@@@ -583,6 -564,12 +564,12 @@@ enum iwl_ucode_tlv_type 
        IWL_UCODE_TLV_INIT_DATA         = 4,
        IWL_UCODE_TLV_BOOT              = 5,
        IWL_UCODE_TLV_PROBE_MAX_LEN     = 6, /* a u32 value */
+       IWL_UCODE_TLV_RUNT_EVTLOG_PTR   = 8,
+       IWL_UCODE_TLV_RUNT_EVTLOG_SIZE  = 9,
+       IWL_UCODE_TLV_RUNT_ERRLOG_PTR   = 10,
+       IWL_UCODE_TLV_INIT_EVTLOG_PTR   = 11,
+       IWL_UCODE_TLV_INIT_EVTLOG_SIZE  = 12,
+       IWL_UCODE_TLV_INIT_ERRLOG_PTR   = 13,
  };
  
  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
  
@@@ -675,6 -662,7 +662,7 @@@ struct iwl_sensitivity_ranges 
   * @sw_crypto: 0 for hw, 1 for sw
   * @max_xxx_size: for ucode uses
   * @ct_kill_threshold: temperature threshold
+  * @beacon_time_tsf_bits: number of valid tsf bits for beacon time
   * @calib_init_cfg: setup initial calibrations for the hw
   * @struct iwl_sensitivity_ranges: range of sensitivity values
   */
@@@ -701,6 -689,7 +689,7 @@@ struct iwl_hw_params 
        u32 ct_kill_threshold; /* value in hw-dependent units */
        u32 ct_kill_exit_threshold; /* value in hw-dependent units */
                                    /* for 1000, 6000 series and up */
+       u16 beacon_time_tsf_bits;
        u32 calib_init_cfg;
        const struct iwl_sensitivity_ranges *sens;
  };
@@@ -1075,6 -1064,20 +1064,20 @@@ struct iwl_force_reset 
        unsigned long last_force_reset_jiffies;
  };
  
+ /* extend beacon time format bit shifting  */
+ /*
+  * for _3945 devices
+  * bits 31:24 - extended
+  * bits 23:0  - interval
+  */
+ #define IWL3945_EXT_BEACON_TIME_POS   24
+ /*
+  * for _agn devices
+  * bits 31:22 - extended
+  * bits 21:0  - interval
+  */
+ #define IWLAGN_EXT_BEACON_TIME_POS    22
  struct iwl_priv {
  
        /* ieee device used by generic ieee processing code */
        /* force reset */
        struct iwl_force_reset force_reset[IWL_MAX_FORCE_RESET];
  
-       /* we allocate array of iwl4965_channel_info for NIC's valid channels.
+       /* we allocate array of iwl_channel_info for NIC's valid channels.
         *    Access via channel # using indirect index array */
        struct iwl_channel_info *channel_info;  /* channel info array */
        u8 channel_count;       /* # of channels */
        void *scan_cmd;
        enum ieee80211_band scan_band;
        struct cfg80211_scan_request *scan_request;
+       struct ieee80211_vif *scan_vif;
        bool is_internal_short_scan;
        u8 scan_tx_ant[IEEE80211_NUM_BANDS];
        u8 mgmt_tx_ant;
        struct iwl_switch_rxon switch_rxon;
  
        /* 1st responses from initialize and runtime uCode images.
-        * 4965's initialize alive response contains some calibration data. */
+        * _agn's initialize alive response contains some calibration data. */
        struct iwl_init_alive_resp card_alive_init;
        struct iwl_alive_resp card_alive;
  
        struct iwl_tt_mgmt thermal_throttle;
  
        struct iwl_notif_statistics statistics;
- #ifdef CONFIG_IWLWIFI_DEBUG
+ #ifdef CONFIG_IWLWIFI_DEBUGFS
        struct iwl_notif_statistics accum_statistics;
        struct iwl_notif_statistics delta_statistics;
        struct iwl_notif_statistics max_delta;
  
        /* context information */
        u8 bssid[ETH_ALEN]; /* used only on 3945 but filled by core */
-       u8 mac_addr[ETH_ALEN];
  
-       /*station table variables */
+       /* station table variables */
+       /* Note: if lock and sta_lock are needed, lock must be acquired first */
        spinlock_t sta_lock;
        int num_stations;
        struct iwl_station_entry stations[IWL_STATION_COUNT];
                        struct delayed_work rfkill_poll;
  
                        struct iwl3945_notif_statistics statistics;
- #ifdef CONFIG_IWLWIFI_DEBUG
+ #ifdef CONFIG_IWLWIFI_DEBUGFS
                        struct iwl3945_notif_statistics accum_statistics;
                        struct iwl3945_notif_statistics delta_statistics;
                        struct iwl3945_notif_statistics max_delta;
                        bool last_phy_res_valid;
  
                        struct completion firmware_loading_complete;
+                       u32 init_evtlog_ptr, init_evtlog_size, init_errlog_ptr;
+                       u32 inst_evtlog_ptr, inst_evtlog_size, inst_errlog_ptr;
                } _agn;
  #endif
        };
        /* debugging info */
        u32 debug_level; /* per device debugging will override global
                            iwl_debug_level if set */
-       u32 framecnt_to_us;
-       atomic_t restrict_refcnt;
-       bool disable_ht40;
+ #endif /* CONFIG_IWLWIFI_DEBUG */
  #ifdef CONFIG_IWLWIFI_DEBUGFS
        /* debugfs */
        u16 tx_traffic_idx;
        u8 *rx_traffic;
        struct dentry *debugfs_dir;
        u32 dbgfs_sram_offset, dbgfs_sram_len;
+       bool disable_ht40;
  #endif /* CONFIG_IWLWIFI_DEBUGFS */
- #endif /* CONFIG_IWLWIFI_DEBUG */
  
        struct work_struct txpower_work;
        u32 disable_sens_cal;
@@@ -1419,9 -1425,9 +1425,9 @@@ static inline u32 iwl_get_debug_level(s
  static inline struct ieee80211_hdr *iwl_tx_queue_get_hdr(struct iwl_priv *priv,
                                                         int txq_id, int idx)
  {
-       if (priv->txq[txq_id].txb[idx].skb[0])
+       if (priv->txq[txq_id].txb[idx].skb)
                return (struct ieee80211_hdr *)priv->txq[txq_id].
-                               txb[idx].skb[0]->data;
+                               txb[idx].skb->data;
        return NULL;
  }
  
index 60a819107a8c0d9194988acf16d82298ba2d802c,cd37b2ac535608f292b9c421bfd6eb2c0d041fb6..c019fdc131c0a0f24ed382607044d398c0abedb2
@@@ -109,7 -109,7 +109,7 @@@ struct mwl8k_rx_queue 
        dma_addr_t rxd_dma;
        struct {
                struct sk_buff *skb;
-               DECLARE_PCI_UNMAP_ADDR(dma)
+               DEFINE_DMA_UNMAP_ADDR(dma);
        } *buf;
  };
  
@@@ -426,7 -426,7 +426,7 @@@ struct mwl8k_cmd_pkt 
        __u8    macid;
        __le16  result;
        char    payload[0];
 -} __attribute__((packed));
 +} __packed;
  
  /*
   * Firmware loading.
@@@ -632,7 -632,7 +632,7 @@@ struct mwl8k_dma_data 
        __le16 fwlen;
        struct ieee80211_hdr wh;
        char data[0];
 -} __attribute__((packed));
 +} __packed;
  
  /* Routines to add/remove DMA header from skb.  */
  static inline void mwl8k_remove_dma_header(struct sk_buff *skb, __le16 qos)
@@@ -711,7 -711,7 +711,7 @@@ struct mwl8k_rxd_8366_ap 
        __u8 rx_status;
        __u8 channel;
        __u8 rx_ctrl;
 -} __attribute__((packed));
 +} __packed;
  
  #define MWL8K_8366_AP_RATE_INFO_MCS_FORMAT    0x80
  #define MWL8K_8366_AP_RATE_INFO_40MHZ         0x40
@@@ -806,7 -806,7 +806,7 @@@ struct mwl8k_rxd_sta 
        __u8 rx_ctrl;
        __u8 rx_status;
        __u8 pad2[2];
 -} __attribute__((packed));
 +} __packed;
  
  #define MWL8K_STA_RATE_INFO_SHORTPRE          0x8000
  #define MWL8K_STA_RATE_INFO_ANTSELECT(x)      (((x) >> 11) & 0x3)
@@@ -963,7 -963,7 +963,7 @@@ static int rxq_refill(struct ieee80211_
                if (rxq->tail == MWL8K_RX_DESCS)
                        rxq->tail = 0;
                rxq->buf[rx].skb = skb;
-               pci_unmap_addr_set(&rxq->buf[rx], dma, addr);
+               dma_unmap_addr_set(&rxq->buf[rx], dma, addr);
  
                rxd = rxq->rxd + (rx * priv->rxd_ops->rxd_size);
                priv->rxd_ops->rxd_refill(rxd, addr, MWL8K_RX_MAXSZ);
@@@ -984,9 -984,9 +984,9 @@@ static void mwl8k_rxq_deinit(struct iee
        for (i = 0; i < MWL8K_RX_DESCS; i++) {
                if (rxq->buf[i].skb != NULL) {
                        pci_unmap_single(priv->pdev,
-                                        pci_unmap_addr(&rxq->buf[i], dma),
+                                        dma_unmap_addr(&rxq->buf[i], dma),
                                         MWL8K_RX_MAXSZ, PCI_DMA_FROMDEVICE);
-                       pci_unmap_addr_set(&rxq->buf[i], dma, 0);
+                       dma_unmap_addr_set(&rxq->buf[i], dma, 0);
  
                        kfree_skb(rxq->buf[i].skb);
                        rxq->buf[i].skb = NULL;
@@@ -1060,9 -1060,9 +1060,9 @@@ static int rxq_process(struct ieee80211
                rxq->buf[rxq->head].skb = NULL;
  
                pci_unmap_single(priv->pdev,
-                                pci_unmap_addr(&rxq->buf[rxq->head], dma),
+                                dma_unmap_addr(&rxq->buf[rxq->head], dma),
                                 MWL8K_RX_MAXSZ, PCI_DMA_FROMDEVICE);
-               pci_unmap_addr_set(&rxq->buf[rxq->head], dma, 0);
+               dma_unmap_addr_set(&rxq->buf[rxq->head], dma, 0);
  
                rxq->head++;
                if (rxq->head == MWL8K_RX_DESCS)
@@@ -1120,7 -1120,7 +1120,7 @@@ struct mwl8k_tx_desc 
        __le16 rate_info;
        __u8 peer_id;
        __u8 tx_frag_cnt;
 -} __attribute__((packed));
 +} __packed;
  
  #define MWL8K_TX_DESCS                128
  
@@@ -1666,7 -1666,7 +1666,7 @@@ struct mwl8k_cmd_get_hw_spec_sta 
        __le32 caps2;
        __le32 num_tx_desc_per_queue;
        __le32 total_rxd;
 -} __attribute__((packed));
 +} __packed;
  
  #define MWL8K_CAP_MAX_AMSDU           0x20000000
  #define MWL8K_CAP_GREENFIELD          0x08000000
@@@ -1810,7 -1810,7 +1810,7 @@@ struct mwl8k_cmd_get_hw_spec_ap 
        __le32 wcbbase1;
        __le32 wcbbase2;
        __le32 wcbbase3;
 -} __attribute__((packed));
 +} __packed;
  
  static int mwl8k_cmd_get_hw_spec_ap(struct ieee80211_hw *hw)
  {
@@@ -1883,7 -1883,7 +1883,7 @@@ struct mwl8k_cmd_set_hw_spec 
        __le32 flags;
        __le32 num_tx_desc_per_queue;
        __le32 total_rxd;
 -} __attribute__((packed));
 +} __packed;
  
  #define MWL8K_SET_HW_SPEC_FLAG_HOST_DECR_MGMT         0x00000080
  #define MWL8K_SET_HW_SPEC_FLAG_HOSTFORM_PROBERESP     0x00000020
@@@ -1985,7 -1985,7 +1985,7 @@@ __mwl8k_cmd_mac_multicast_adr(struct ie
  struct mwl8k_cmd_get_stat {
        struct mwl8k_cmd_pkt header;
        __le32 stats[64];
 -} __attribute__((packed));
 +} __packed;
  
  #define MWL8K_STAT_ACK_FAILURE        9
  #define MWL8K_STAT_RTS_FAILURE        12
@@@ -2029,7 -2029,7 +2029,7 @@@ struct mwl8k_cmd_radio_control 
        __le16 action;
        __le16 control;
        __le16 radio_on;
 -} __attribute__((packed));
 +} __packed;
  
  static int
  mwl8k_cmd_radio_control(struct ieee80211_hw *hw, bool enable, bool force)
@@@ -2092,7 -2092,7 +2092,7 @@@ struct mwl8k_cmd_rf_tx_power 
        __le16 current_level;
        __le16 reserved;
        __le16 power_level_list[MWL8K_TX_POWER_LEVEL_TOTAL];
 -} __attribute__((packed));
 +} __packed;
  
  static int mwl8k_cmd_rf_tx_power(struct ieee80211_hw *hw, int dBm)
  {
@@@ -2121,7 -2121,7 +2121,7 @@@ struct mwl8k_cmd_rf_antenna 
        struct mwl8k_cmd_pkt header;
        __le16 antenna;
        __le16 mode;
 -} __attribute__((packed));
 +} __packed;
  
  #define MWL8K_RF_ANTENNA_RX           1
  #define MWL8K_RF_ANTENNA_TX           2
@@@ -2182,7 -2182,7 +2182,7 @@@ static int mwl8k_cmd_set_beacon(struct 
   */
  struct mwl8k_cmd_set_pre_scan {
        struct mwl8k_cmd_pkt header;
 -} __attribute__((packed));
 +} __packed;
  
  static int mwl8k_cmd_set_pre_scan(struct ieee80211_hw *hw)
  {
@@@ -2209,7 -2209,7 +2209,7 @@@ struct mwl8k_cmd_set_post_scan 
        struct mwl8k_cmd_pkt header;
        __le32 isibss;
        __u8 bssid[ETH_ALEN];
 -} __attribute__((packed));
 +} __packed;
  
  static int
  mwl8k_cmd_set_post_scan(struct ieee80211_hw *hw, const __u8 *mac)
@@@ -2240,7 -2240,7 +2240,7 @@@ struct mwl8k_cmd_set_rf_channel 
        __le16 action;
        __u8 current_channel;
        __le32 channel_flags;
 -} __attribute__((packed));
 +} __packed;
  
  static int mwl8k_cmd_set_rf_channel(struct ieee80211_hw *hw,
                                    struct ieee80211_conf *conf)
@@@ -2293,7 -2293,7 +2293,7 @@@ struct mwl8k_cmd_update_set_aid 
        __u8    bssid[ETH_ALEN];
        __le16  protection_mode;
        __u8    supp_rates[14];
 -} __attribute__((packed));
 +} __packed;
  
  static void legacy_rate_mask_to_array(u8 *rates, u32 mask)
  {
@@@ -2364,7 -2364,7 +2364,7 @@@ struct mwl8k_cmd_set_rate 
        /* Bitmap for supported MCS codes.  */
        __u8    mcs_set[16];
        __u8    reserved[16];
 -} __attribute__((packed));
 +} __packed;
  
  static int
  mwl8k_cmd_set_rate(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
@@@ -2397,7 -2397,7 +2397,7 @@@ struct mwl8k_cmd_finalize_join 
        struct mwl8k_cmd_pkt header;
        __le32 sleep_interval;  /* Number of beacon periods to sleep */
        __u8 beacon_data[MWL8K_FJ_BEACON_MAXLEN];
 -} __attribute__((packed));
 +} __packed;
  
  static int mwl8k_cmd_finalize_join(struct ieee80211_hw *hw, void *frame,
                                   int framelen, int dtim)
@@@ -2436,7 -2436,7 +2436,7 @@@ struct mwl8k_cmd_set_rts_threshold 
        struct mwl8k_cmd_pkt header;
        __le16 action;
        __le16 threshold;
 -} __attribute__((packed));
 +} __packed;
  
  static int
  mwl8k_cmd_set_rts_threshold(struct ieee80211_hw *hw, int rts_thresh)
@@@ -2466,7 -2466,7 +2466,7 @@@ struct mwl8k_cmd_set_slot 
        struct mwl8k_cmd_pkt header;
        __le16 action;
        __u8 short_slot;
 -} __attribute__((packed));
 +} __packed;
  
  static int mwl8k_cmd_set_slot(struct ieee80211_hw *hw, bool short_slot_time)
  {
@@@ -2528,7 -2528,7 +2528,7 @@@ struct mwl8k_cmd_set_edca_params 
                        __u8 txq;
                } sta;
        };
 -} __attribute__((packed));
 +} __packed;
  
  #define MWL8K_SET_EDCA_CW     0x01
  #define MWL8K_SET_EDCA_TXOP   0x02
@@@ -2579,7 -2579,7 +2579,7 @@@ mwl8k_cmd_set_edca_params(struct ieee80
  struct mwl8k_cmd_set_wmm_mode {
        struct mwl8k_cmd_pkt header;
        __le16 action;
 -} __attribute__((packed));
 +} __packed;
  
  static int mwl8k_cmd_set_wmm_mode(struct ieee80211_hw *hw, bool enable)
  {
@@@ -2612,7 -2612,7 +2612,7 @@@ struct mwl8k_cmd_mimo_config 
        __le32 action;
        __u8 rx_antenna_map;
        __u8 tx_antenna_map;
 -} __attribute__((packed));
 +} __packed;
  
  static int mwl8k_cmd_mimo_config(struct ieee80211_hw *hw, __u8 rx, __u8 tx)
  {
@@@ -2652,7 -2652,7 +2652,7 @@@ struct mwl8k_cmd_use_fixed_rate_sta 
        __le32 rate_type;
        __le32 reserved1;
        __le32 reserved2;
 -} __attribute__((packed));
 +} __packed;
  
  #define MWL8K_USE_AUTO_RATE   0x0002
  #define MWL8K_UCAST_RATE      0
@@@ -2694,7 -2694,7 +2694,7 @@@ struct mwl8k_cmd_use_fixed_rate_ap 
        u8 multicast_rate;
        u8 multicast_rate_type;
        u8 management_rate;
 -} __attribute__((packed));
 +} __packed;
  
  static int
  mwl8k_cmd_use_fixed_rate_ap(struct ieee80211_hw *hw, int mcast, int mgmt)
  struct mwl8k_cmd_enable_sniffer {
        struct mwl8k_cmd_pkt header;
        __le32 action;
 -} __attribute__((packed));
 +} __packed;
  
  static int mwl8k_cmd_enable_sniffer(struct ieee80211_hw *hw, bool enable)
  {
@@@ -2757,7 -2757,7 +2757,7 @@@ struct mwl8k_cmd_set_mac_addr 
                } mbss;
                __u8 mac_addr[ETH_ALEN];
        };
 -} __attribute__((packed));
 +} __packed;
  
  #define MWL8K_MAC_TYPE_PRIMARY_CLIENT         0
  #define MWL8K_MAC_TYPE_SECONDARY_CLIENT               1
@@@ -2812,7 -2812,7 +2812,7 @@@ struct mwl8k_cmd_set_rate_adapt_mode 
        struct mwl8k_cmd_pkt header;
        __le16 action;
        __le16 mode;
 -} __attribute__((packed));
 +} __packed;
  
  static int mwl8k_cmd_set_rateadapt_mode(struct ieee80211_hw *hw, __u16 mode)
  {
  struct mwl8k_cmd_bss_start {
        struct mwl8k_cmd_pkt header;
        __le32 enable;
 -} __attribute__((packed));
 +} __packed;
  
  static int mwl8k_cmd_bss_start(struct ieee80211_hw *hw,
                               struct ieee80211_vif *vif, int enable)
@@@ -2885,7 -2885,7 +2885,7 @@@ struct mwl8k_cmd_set_new_stn 
        __u8 add_qos_info;
        __u8 is_qos_sta;
        __le32 fw_sta_ptr;
 -} __attribute__((packed));
 +} __packed;
  
  #define MWL8K_STA_ACTION_ADD          0
  #define MWL8K_STA_ACTION_REMOVE               2
@@@ -2978,7 -2978,7 +2978,7 @@@ struct ewc_ht_info 
        __le16  control1;
        __le16  control2;
        __le16  control3;
 -} __attribute__((packed));
 +} __packed;
  
  struct peer_capability_info {
        /* Peer type - AP vs. STA.  */
        __u8    pad2;
        __u8    station_id;
        __le16  amsdu_enabled;
 -} __attribute__((packed));
 +} __packed;
  
  struct mwl8k_cmd_update_stadb {
        struct mwl8k_cmd_pkt header;
  
        /* Peer info - valid during add/update.  */
        struct peer_capability_info     peer_info;
 -} __attribute__((packed));
 +} __packed;
  
  #define MWL8K_STA_DB_MODIFY_ENTRY     1
  #define MWL8K_STA_DB_DEL_ENTRY                2
index 55741caa2b827ff905a72f7955c82271f7a120b9,f750f49bbd4e6c6cc63102ab15081c8d975379bb..2b2b9a1a979c95aa4a0ed84a38ea620264c0c4bd
@@@ -65,10 -65,10 +65,10 @@@ struct dblock 
        __le32 addr;            /* adapter address where to write the block */
        __le16 len;             /* length of the data only, in bytes */
        char data[0];           /* data to be written */
 -} __attribute__ ((packed));
 +} __packed;
  
  /*
-  * Plug Data References are located in in the image after the last data
+  * Plug Data References are located in the image after the last data
   * block.  They refer to areas in the adapter memory where the plug data
   * items with matching ID should be written.
   */
@@@ -77,7 -77,7 +77,7 @@@ struct pdr 
        __le32 addr;            /* adapter address where to write the data */
        __le32 len;             /* expected length of the data, in bytes */
        char next[0];           /* next PDR starts here */
 -} __attribute__ ((packed));
 +} __packed;
  
  /*
   * Plug Data Items are located in the EEPROM read from the adapter by
@@@ -88,7 -88,7 +88,7 @@@ struct pdi 
        __le16 len;             /* length of ID and data, in words */
        __le16 id;              /* record ID */
        char data[0];           /* plug data */
 -} __attribute__ ((packed));
 +} __packed;
  
  /*** FW data block access functions ***/
  
@@@ -317,7 -317,7 +317,7 @@@ static const struct {                                                      
        __le16 len;                                                     \
        __le16 id;                                                      \
        u8 val[length];                                                 \
 -} __attribute__ ((packed)) default_pdr_data_##pid = {                 \
 +} __packed default_pdr_data_##pid = {                 \
        cpu_to_le16((sizeof(default_pdr_data_##pid)/                    \
                                sizeof(__le16)) - 1),                   \
        cpu_to_le16(pid),                                               \
index 11536ef17ba3cfcb73937ff69832e37c9d9f7fcf,020da76c9558a4dd385a00031dfb5086757ab90e..1558381998eed67f6e540e60cbfd87f8125b9f7a
@@@ -90,7 -90,7 +90,7 @@@ struct header_struct 
        /* SNAP */
        u8 oui[3];
        __be16 ethertype;
 -} __attribute__ ((packed));
 +} __packed;
  
  struct ez_usb_fw {
        u16 size;
@@@ -222,7 -222,7 +222,7 @@@ struct ezusb_packet 
        __le16 hermes_len;
        __le16 hermes_rid;
        u8 data[0];
 -} __attribute__ ((packed));
 +} __packed;
  
  /* Table of devices that work or may work with this driver */
  static struct usb_device_id ezusb_table[] = {
@@@ -356,12 -356,10 +356,10 @@@ static struct request_context *ezusb_al
  {
        struct request_context *ctx;
  
-       ctx = kmalloc(sizeof(*ctx), GFP_ATOMIC);
+       ctx = kzalloc(sizeof(*ctx), GFP_ATOMIC);
        if (!ctx)
                return NULL;
  
-       memset(ctx, 0, sizeof(*ctx));
        ctx->buf = kmalloc(BULK_BUF_SIZE, GFP_ATOMIC);
        if (!ctx->buf) {
                kfree(ctx);
index 9f86a272cb783b4a44e585f7ff6ec0c03c6b525c,a63108c6df7d9cd6586312b24b8a176ece7a1cc8..cf7be1eb612495b699dc2e0cdc8fe17650c26736
@@@ -128,7 -128,7 +128,7 @@@ static struct iw_statistics *orinoco_ge
        } else {
                struct {
                        __le16 qual, signal, noise, unused;
 -              } __attribute__ ((packed)) cq;
 +              } __packed cq;
  
                err = HERMES_READ_RECORD(hw, USER_BAP,
                                         HERMES_RID_COMMSQUALITY, &cq);
@@@ -993,11 -993,9 +993,9 @@@ static int orinoco_ioctl_set_genie(stru
                return -EINVAL;
  
        if (wrqu->data.length) {
-               buf = kmalloc(wrqu->data.length, GFP_KERNEL);
+               buf = kmemdup(extra, wrqu->data.length, GFP_KERNEL);
                if (buf == NULL)
                        return -ENOMEM;
-               memcpy(buf, extra, wrqu->data.length);
        } else
                buf = NULL;
  
index 13730a807002ae9f32fd833aa7e9c6f938ee9219,236e37526d07faaf65213490c9af7f79cabbed61..912fdc022d080d7c9669b76aa94c0249033c09f9
@@@ -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 };
@@@ -2751,14 -2751,9 +2751,9 @@@ prism54_hostapd(struct net_device *ndev
             p->length > PRISM2_HOSTAPD_MAX_BUF_SIZE || !p->pointer)
                 return -EINVAL;
  
-        param = kmalloc(p->length, GFP_KERNEL);
-        if (param == NULL)
-                return -ENOMEM;
-        if (copy_from_user(param, p->pointer, p->length)) {
-                kfree(param);
-                return -EFAULT;
-        }
+       param = memdup_user(p->pointer, p->length);
+       if (IS_ERR(param))
+               return PTR_ERR(param);
  
         switch (param->cmd) {
         case PRISM2_SET_ENCRYPTION:
index 989b0561c01b9cdb315f55fad07e39a655225638,4102cca54882b3ce033dfdc3c8c7c627363352f5..5e7f344b000d57741a8a789a4927cd76fccd773c
@@@ -238,19 -238,19 +238,19 @@@ struct ndis_80211_auth_request 
        u8 bssid[6];
        u8 padding[2];
        __le32 flags;
 -} __attribute__((packed));
 +} __packed;
  
  struct ndis_80211_pmkid_candidate {
        u8 bssid[6];
        u8 padding[2];
        __le32 flags;
 -} __attribute__((packed));
 +} __packed;
  
  struct ndis_80211_pmkid_cand_list {
        __le32 version;
        __le32 num_candidates;
        struct ndis_80211_pmkid_candidate candidate_list[0];
 -} __attribute__((packed));
 +} __packed;
  
  struct ndis_80211_status_indication {
        __le32 status_type;
                struct ndis_80211_auth_request          auth_request[0];
                struct ndis_80211_pmkid_cand_list       cand_list;
        } u;
 -} __attribute__((packed));
 +} __packed;
  
  struct ndis_80211_ssid {
        __le32 length;
        u8 essid[NDIS_802_11_LENGTH_SSID];
 -} __attribute__((packed));
 +} __packed;
  
  struct ndis_80211_conf_freq_hop {
        __le32 length;
        __le32 hop_pattern;
        __le32 hop_set;
        __le32 dwell_time;
 -} __attribute__((packed));
 +} __packed;
  
  struct ndis_80211_conf {
        __le32 length;
        __le32 atim_window;
        __le32 ds_config;
        struct ndis_80211_conf_freq_hop fh_config;
 -} __attribute__((packed));
 +} __packed;
  
  struct ndis_80211_bssid_ex {
        __le32 length;
        u8 rates[NDIS_802_11_LENGTH_RATES_EX];
        __le32 ie_length;
        u8 ies[0];
 -} __attribute__((packed));
 +} __packed;
  
  struct ndis_80211_bssid_list_ex {
        __le32 num_items;
        struct ndis_80211_bssid_ex bssid[0];
 -} __attribute__((packed));
 +} __packed;
  
  struct ndis_80211_fixed_ies {
        u8 timestamp[8];
        __le16 beacon_interval;
        __le16 capabilities;
 -} __attribute__((packed));
 +} __packed;
  
  struct ndis_80211_wep_key {
        __le32 size;
        __le32 index;
        __le32 length;
        u8 material[32];
 -} __attribute__((packed));
 +} __packed;
  
  struct ndis_80211_key {
        __le32 size;
        u8 padding[6];
        u8 rsc[8];
        u8 material[32];
 -} __attribute__((packed));
 +} __packed;
  
  struct ndis_80211_remove_key {
        __le32 size;
        __le32 index;
        u8 bssid[6];
        u8 padding[2];
 -} __attribute__((packed));
 +} __packed;
  
  struct ndis_config_param {
        __le32 name_offs;
        __le32 type;
        __le32 value_offs;
        __le32 value_length;
 -} __attribute__((packed));
 +} __packed;
  
  struct ndis_80211_assoc_info {
        __le32 length;
        } resp_ie;
        __le32 resp_ie_length;
        __le32 offset_resp_ies;
 -} __attribute__((packed));
 +} __packed;
  
  struct ndis_80211_auth_encr_pair {
        __le32 auth_mode;
        __le32 encr_mode;
 -} __attribute__((packed));
 +} __packed;
  
  struct ndis_80211_capability {
        __le32 length;
        __le32 num_pmkids;
        __le32 num_auth_encr_pair;
        struct ndis_80211_auth_encr_pair auth_encr_pair[0];
 -} __attribute__((packed));
 +} __packed;
  
  struct ndis_80211_bssid_info {
        u8 bssid[6];
@@@ -2495,8 -2495,7 +2495,7 @@@ static int rndis_flush_pmksa(struct wip
  static void rndis_wlan_do_link_up_work(struct usbnet *usbdev)
  {
        struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev);
-       struct ndis_80211_assoc_info *info;
-       u8 assoc_buf[sizeof(*info) + IW_CUSTOM_MAX + 32];
+       struct ndis_80211_assoc_info *info = NULL;
        u8 bssid[ETH_ALEN];
        int resp_ie_len, req_ie_len;
        u8 *req_ie, *resp_ie;
        resp_ie = NULL;
  
        if (priv->infra_mode == NDIS_80211_INFRA_INFRA) {
-               memset(assoc_buf, 0, sizeof(assoc_buf));
-               info = (void *)assoc_buf;
+               info = kzalloc(CONTROL_BUFFER_SIZE, GFP_KERNEL);
+               if (!info) {
+                       /* No memory? Try resume work later */
+                       set_bit(WORK_LINK_UP, &priv->work_pending);
+                       queue_work(priv->workqueue, &priv->work);
+                       return;
+               }
  
-               /* Get association info IEs from device and send them back to
-                * userspace. */
-               ret = get_association_info(usbdev, info, sizeof(assoc_buf));
+               /* Get association info IEs from device. */
+               ret = get_association_info(usbdev, info, CONTROL_BUFFER_SIZE);
                if (!ret) {
                        req_ie_len = le32_to_cpu(info->req_ie_length);
                        if (req_ie_len > 0) {
                                offset = le32_to_cpu(info->offset_req_ies);
+                               if (offset > CONTROL_BUFFER_SIZE)
+                                       offset = CONTROL_BUFFER_SIZE;
                                req_ie = (u8 *)info + offset;
+                               if (offset + req_ie_len > CONTROL_BUFFER_SIZE)
+                                       req_ie_len =
+                                               CONTROL_BUFFER_SIZE - offset;
                        }
  
                        resp_ie_len = le32_to_cpu(info->resp_ie_length);
                        if (resp_ie_len > 0) {
                                offset = le32_to_cpu(info->offset_resp_ies);
+                               if (offset > CONTROL_BUFFER_SIZE)
+                                       offset = CONTROL_BUFFER_SIZE;
                                resp_ie = (u8 *)info + offset;
+                               if (offset + resp_ie_len > CONTROL_BUFFER_SIZE)
+                                       resp_ie_len =
+                                               CONTROL_BUFFER_SIZE - offset;
                        }
                }
        } else if (WARN_ON(priv->infra_mode != NDIS_80211_INFRA_ADHOC))
        } else if (priv->infra_mode == NDIS_80211_INFRA_ADHOC)
                cfg80211_ibss_joined(usbdev->net, bssid, GFP_KERNEL);
  
+       if (info != NULL)
+               kfree(info);
        priv->connected = true;
        memcpy(priv->bssid, bssid, ETH_ALEN);
  
index 0b17934cf6a98ea3e9ac0347a348010cd8d9d50b,16bfaa8c4477a3b75f3da9fce8494a962ee30dce..317b7807175e16713c63b5bf6c87e468e2231e00
@@@ -63,7 -63,6 +63,6 @@@
   */
  #define REV_RT2860C                   0x0100
  #define REV_RT2860D                   0x0101
- #define REV_RT2870D                   0x0101
  #define REV_RT2872E                   0x0200
  #define REV_RT3070E                   0x0200
  #define REV_RT3070F                   0x0201
   * Registers.
   */
  
+ /*
+  * E2PROM_CSR: PCI EEPROM control register.
+  * RELOAD: Write 1 to reload eeprom content.
+  * TYPE: 0: 93c46, 1:93c66.
+  * LOAD_STATUS: 1:loading, 0:done.
+  */
+ #define E2PROM_CSR                    0x0004
+ #define E2PROM_CSR_DATA_CLOCK         FIELD32(0x00000001)
+ #define E2PROM_CSR_CHIP_SELECT                FIELD32(0x00000002)
+ #define E2PROM_CSR_DATA_IN            FIELD32(0x00000004)
+ #define E2PROM_CSR_DATA_OUT           FIELD32(0x00000008)
+ #define E2PROM_CSR_TYPE                       FIELD32(0x00000030)
+ #define E2PROM_CSR_LOAD_STATUS                FIELD32(0x00000040)
+ #define E2PROM_CSR_RELOAD             FIELD32(0x00000080)
  /*
   * OPT_14: Unknown register used by rt3xxx devices.
   */
  #define RX_CRX_IDX                    0x0298
  #define RX_DRX_IDX                    0x029c
  
+ /*
+  * USB_DMA_CFG
+  * RX_BULK_AGG_TIMEOUT: Rx Bulk Aggregation TimeOut in unit of 33ns.
+  * RX_BULK_AGG_LIMIT: Rx Bulk Aggregation Limit in unit of 256 bytes.
+  * PHY_CLEAR: phy watch dog enable.
+  * TX_CLEAR: Clear USB DMA TX path.
+  * TXOP_HALT: Halt TXOP count down when TX buffer is full.
+  * RX_BULK_AGG_EN: Enable Rx Bulk Aggregation.
+  * RX_BULK_EN: Enable USB DMA Rx.
+  * TX_BULK_EN: Enable USB DMA Tx.
+  * EP_OUT_VALID: OUT endpoint data valid.
+  * RX_BUSY: USB DMA RX FSM busy.
+  * TX_BUSY: USB DMA TX FSM busy.
+  */
+ #define USB_DMA_CFG                   0x02a0
+ #define USB_DMA_CFG_RX_BULK_AGG_TIMEOUT       FIELD32(0x000000ff)
+ #define USB_DMA_CFG_RX_BULK_AGG_LIMIT FIELD32(0x0000ff00)
+ #define USB_DMA_CFG_PHY_CLEAR         FIELD32(0x00010000)
+ #define USB_DMA_CFG_TX_CLEAR          FIELD32(0x00080000)
+ #define USB_DMA_CFG_TXOP_HALT         FIELD32(0x00100000)
+ #define USB_DMA_CFG_RX_BULK_AGG_EN    FIELD32(0x00200000)
+ #define USB_DMA_CFG_RX_BULK_EN                FIELD32(0x00400000)
+ #define USB_DMA_CFG_TX_BULK_EN                FIELD32(0x00800000)
+ #define USB_DMA_CFG_EP_OUT_VALID      FIELD32(0x3f000000)
+ #define USB_DMA_CFG_RX_BUSY           FIELD32(0x40000000)
+ #define USB_DMA_CFG_TX_BUSY           FIELD32(0x80000000)
+ /*
+  * US_CYC_CNT
+  */
+ #define US_CYC_CNT                    0x02a4
+ #define US_CYC_CNT_CLOCK_CYCLE                FIELD32(0x000000ff)
  /*
   * PBF_SYS_CTRL
   * HOST_RAM_WRITE: enable Host program ram write selection
  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:
index 9af14646c27867582e319c52476749beb1880f4a,1b52ce6a84d71b10af1fb9bd919d1cf324329f5d..ec09f0d40ca22e88d22a94bb7556216ffcdf3951
@@@ -33,6 -33,7 +33,7 @@@
  #include <net/mac80211.h>
  
  #include "wl1271_conf.h"
+ #include "wl1271_ini.h"
  
  #define DRIVER_NAME "wl1271"
  #define DRIVER_PREFIX DRIVER_NAME ": "
@@@ -116,33 -117,6 +117,6 @@@ enum 
  #define WL1271_TX_SECURITY_LO16(s) ((u16)((s) & 0xffff))
  #define WL1271_TX_SECURITY_HI32(s) ((u32)(((s) >> 16) & 0xffffffff))
  
- /* NVS data structure */
- #define WL1271_NVS_SECTION_SIZE                  468
- #define WL1271_NVS_GENERAL_PARAMS_SIZE            57
- #define WL1271_NVS_GENERAL_PARAMS_SIZE_PADDED \
-       (WL1271_NVS_GENERAL_PARAMS_SIZE + 1)
- #define WL1271_NVS_STAT_RADIO_PARAMS_SIZE         17
- #define WL1271_NVS_STAT_RADIO_PARAMS_SIZE_PADDED \
-       (WL1271_NVS_STAT_RADIO_PARAMS_SIZE + 1)
- #define WL1271_NVS_DYN_RADIO_PARAMS_SIZE          65
- #define WL1271_NVS_DYN_RADIO_PARAMS_SIZE_PADDED \
-       (WL1271_NVS_DYN_RADIO_PARAMS_SIZE + 1)
- #define WL1271_NVS_FEM_COUNT                       2
- #define WL1271_NVS_INI_SPARE_SIZE                124
- struct wl1271_nvs_file {
-       /* NVS section */
-       u8 nvs[WL1271_NVS_SECTION_SIZE];
-       /* INI section */
-       u8 general_params[WL1271_NVS_GENERAL_PARAMS_SIZE_PADDED];
-       u8 stat_radio_params[WL1271_NVS_STAT_RADIO_PARAMS_SIZE_PADDED];
-       u8 dyn_radio_params[WL1271_NVS_FEM_COUNT]
-                          [WL1271_NVS_DYN_RADIO_PARAMS_SIZE_PADDED];
-       u8 ini_spare[WL1271_NVS_INI_SPARE_SIZE];
- } __packed;
  /*
   * Enable/disable 802.11a support for WL1273
   */
@@@ -317,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;
        u8 state;
        u8 ssid[IW_ESSID_MAX_SIZE+1];
        size_t ssid_len;
@@@ -375,6 -350,7 +350,7 @@@ struct wl1271 
  #define WL1271_FLAG_IRQ_PENDING        (9)
  #define WL1271_FLAG_IRQ_RUNNING       (10)
  #define WL1271_FLAG_IDLE              (11)
+ #define WL1271_FLAG_IDLE_REQUESTED    (12)
        unsigned long flags;
  
        struct wl1271_partition_set part;
  
        /* Pending TX frames */
        struct sk_buff *tx_frames[ACX_TX_DESCRIPTORS];
+       int tx_frames_cnt;
  
        /* Security sequence number counters */
        u8 tx_security_last_seq;
index d88faf9d26427bcb22b2dff225bd5e1e247a2a5c,68001dffe7164d4b6259a5815d3956596d4f53e4..f5745d829c9b021ce8513ec5741ee2e9a4fe4c78
@@@ -42,7 -42,7 +42,7 @@@ int wl1271_cmd_ps_mode(struct wl1271 *w
  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,
-                   const u8 *ie, size_t ie_len, u8 active_scan,
+                   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);
@@@ -136,14 -136,14 +136,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 -196,7 +196,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 -243,14 +243,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 -266,7 +266,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 -278,7 +278,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 -298,7 +298,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,7 -348,7 +348,7 @@@ 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
@@@ -385,7 -385,7 +385,7 @@@ struct basic_scan_params 
        u8 use_ssid_list;
        u8 scan_tag;
        u8 padding2;
 -} __attribute__ ((packed));
 +} __packed;
  
  struct basic_scan_channel_params {
        /* Duration in TU to wait for frames on a channel for active scan */
        u8 dfs_candidate;
        u8 activity_detected;
        u8 pad;
 -} __attribute__ ((packed));
 +} __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];
 -} __attribute__ ((packed));
 +} __packed;
  
  struct wl1271_cmd_trigger_scan_to {
        struct wl1271_cmd_header header;
  
        __le32 timeout;
 -} __attribute__ ((packed));
 +} __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,
@@@ -439,25 -439,31 +439,31 @@@ struct wl1271_general_parms_cmd 
  
        struct wl1271_cmd_test_header test;
  
-       u8 params[WL1271_NVS_GENERAL_PARAMS_SIZE];
-       s8 reserved[23];
- } __packed;
+       struct wl1271_ini_general_params general_params;
  
- #define WL1271_STAT_RADIO_PARAMS_5_SIZE    29
- #define WL1271_DYN_RADIO_PARAMS_5_SIZE    104
+       u8 sr_debug_table[WL1271_INI_MAX_SMART_REFLEX_PARAM];
+       u8 sr_sen_n_p;
+       u8 sr_sen_n_p_gain;
+       u8 sr_sen_nrn;
+       u8 sr_sen_prn;
+       u8 padding[3];
 -} __attribute__ ((packed));
++} __packed;
  
  struct wl1271_radio_parms_cmd {
        struct wl1271_cmd_header header;
  
        struct wl1271_cmd_test_header test;
  
-       u8 stat_radio_params[WL1271_NVS_STAT_RADIO_PARAMS_SIZE];
-       u8 stat_radio_params_5[WL1271_STAT_RADIO_PARAMS_5_SIZE];
+       /* Static radio parameters */
+       struct wl1271_ini_band_params_2 static_params_2;
+       struct wl1271_ini_band_params_5 static_params_5;
  
-       u8 dyn_radio_params[WL1271_NVS_DYN_RADIO_PARAMS_SIZE];
-       u8 reserved;
-       u8 dyn_radio_params_5[WL1271_DYN_RADIO_PARAMS_5_SIZE];
+       /* Dynamic radio parameters */
+       struct wl1271_ini_fem_params_2 dyn_params_2;
+       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
@@@ -501,7 -507,7 +507,7 @@@ struct wl1271_cmd_cal_p2g 
  
        u8  sub_band_mask;
        u8  padding2;
 -} __attribute__ ((packed));
 +} __packed;
  
  
  /*
@@@ -529,6 -535,6 +535,6 @@@ struct wl1271_cmd_disconnect 
        u8  type;
  
        u8  padding;
 -} __attribute__ ((packed));
 +} __packed;
  
  #endif /* __WL1271_CMD_H__ */
index 0000000000000000000000000000000000000000,0fb156a5af1289f89a7d4b6f6e4ea0370e5cc740..2313047d401524ad62b4b396f3462cafe94e1060
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,123 +1,123 @@@
 -} __attribute__ ((packed));
+ /*
+  * This file is part of wl1271
+  *
+  * Copyright (C) 2010 Nokia Corporation
+  *
+  * Contact: Luciano Coelho <luciano.coelho@nokia.com>
+  *
+  * This program is free software; you can redistribute it and/or
+  * modify it under the terms of the GNU General Public License
+  * version 2 as published by the Free Software Foundation.
+  *
+  * This program is distributed in the hope that it will be useful, but
+  * WITHOUT ANY WARRANTY; without even the implied warranty of
+  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  * General Public License for more details.
+  *
+  * You should have received a copy of the GNU General Public License
+  * along with this program; if not, write to the Free Software
+  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+  * 02110-1301 USA
+  *
+  */
+ #ifndef __WL1271_INI_H__
+ #define __WL1271_INI_H__
+ #define WL1271_INI_MAX_SMART_REFLEX_PARAM 16
+ struct wl1271_ini_general_params {
+       u8 ref_clock;
+       u8 settling_time;
+       u8 clk_valid_on_wakeup;
+       u8 dc2dc_mode;
+       u8 dual_mode_select;
+       u8 tx_bip_fem_auto_detect;
+       u8 tx_bip_fem_manufacturer;
+       u8 general_settings;
+       u8 sr_state;
+       u8 srf1[WL1271_INI_MAX_SMART_REFLEX_PARAM];
+       u8 srf2[WL1271_INI_MAX_SMART_REFLEX_PARAM];
+       u8 srf3[WL1271_INI_MAX_SMART_REFLEX_PARAM];
 -} __attribute__ ((packed));
++} __packed;
+ #define WL1271_INI_RSSI_PROCESS_COMPENS_SIZE 15
+ struct wl1271_ini_band_params_2 {
+       u8 rx_trace_insertion_loss;
+       u8 tx_trace_loss;
+       u8 rx_rssi_process_compens[WL1271_INI_RSSI_PROCESS_COMPENS_SIZE];
 -} __attribute__ ((packed));
++} __packed;
+ #define WL1271_INI_RATE_GROUP_COUNT 6
+ #define WL1271_INI_CHANNEL_COUNT_2 14
+ struct wl1271_ini_fem_params_2 {
+       __le16 tx_bip_ref_pd_voltage;
+       u8 tx_bip_ref_power;
+       u8 tx_bip_ref_offset;
+       u8 tx_per_rate_pwr_limits_normal[WL1271_INI_RATE_GROUP_COUNT];
+       u8 tx_per_rate_pwr_limits_degraded[WL1271_INI_RATE_GROUP_COUNT];
+       u8 tx_per_rate_pwr_limits_extreme[WL1271_INI_RATE_GROUP_COUNT];
+       u8 tx_per_chan_pwr_limits_11b[WL1271_INI_CHANNEL_COUNT_2];
+       u8 tx_per_chan_pwr_limits_ofdm[WL1271_INI_CHANNEL_COUNT_2];
+       u8 tx_pd_vs_rate_offsets[WL1271_INI_RATE_GROUP_COUNT];
+       u8 tx_ibias[WL1271_INI_RATE_GROUP_COUNT];
+       u8 rx_fem_insertion_loss;
+       u8 degraded_low_to_normal_thr;
+       u8 normal_to_degraded_high_thr;
 -} __attribute__ ((packed));
++} __packed;
+ #define WL1271_INI_CHANNEL_COUNT_5 35
+ #define WL1271_INI_SUB_BAND_COUNT_5 7
+ struct wl1271_ini_band_params_5 {
+       u8 rx_trace_insertion_loss[WL1271_INI_SUB_BAND_COUNT_5];
+       u8 tx_trace_loss[WL1271_INI_SUB_BAND_COUNT_5];
+       u8 rx_rssi_process_compens[WL1271_INI_RSSI_PROCESS_COMPENS_SIZE];
 -} __attribute__ ((packed));
++} __packed;
+ struct wl1271_ini_fem_params_5 {
+       __le16 tx_bip_ref_pd_voltage[WL1271_INI_SUB_BAND_COUNT_5];
+       u8 tx_bip_ref_power[WL1271_INI_SUB_BAND_COUNT_5];
+       u8 tx_bip_ref_offset[WL1271_INI_SUB_BAND_COUNT_5];
+       u8 tx_per_rate_pwr_limits_normal[WL1271_INI_RATE_GROUP_COUNT];
+       u8 tx_per_rate_pwr_limits_degraded[WL1271_INI_RATE_GROUP_COUNT];
+       u8 tx_per_rate_pwr_limits_extreme[WL1271_INI_RATE_GROUP_COUNT];
+       u8 tx_per_chan_pwr_limits_ofdm[WL1271_INI_CHANNEL_COUNT_5];
+       u8 tx_pd_vs_rate_offsets[WL1271_INI_RATE_GROUP_COUNT];
+       u8 tx_ibias[WL1271_INI_RATE_GROUP_COUNT];
+       u8 rx_fem_insertion_loss[WL1271_INI_SUB_BAND_COUNT_5];
+       u8 degraded_low_to_normal_thr;
+       u8 normal_to_degraded_high_thr;
 -} __attribute__ ((packed));
++} __packed;
+ /* NVS data structure */
+ #define WL1271_INI_NVS_SECTION_SIZE                468
+ #define WL1271_INI_FEM_MODULE_COUNT                  2
+ #define WL1271_INI_LEGACY_NVS_FILE_SIZE              800
+ struct wl1271_nvs_file {
+       /* NVS section */
+       u8 nvs[WL1271_INI_NVS_SECTION_SIZE];
+       /* INI section */
+       struct wl1271_ini_general_params general_params;
+       u8 padding1;
+       struct wl1271_ini_band_params_2 stat_radio_params_2;
+       u8 padding2;
+       struct {
+               struct wl1271_ini_fem_params_2 params;
+               u8 padding;
+       } dyn_radio_params_2[WL1271_INI_FEM_MODULE_COUNT];
+       struct wl1271_ini_band_params_5 stat_radio_params_5;
+       u8 padding3;
+       struct {
+               struct wl1271_ini_fem_params_5 params;
+               u8 padding;
+       } dyn_radio_params_5[WL1271_INI_FEM_MODULE_COUNT];
++} __packed;
+ #endif
index 91d0adb0ea4093b1f60516f8588f974b792536f1,0ae00637933e57a0cdb6b97f70768f9e6c6dc1a5..48bf92621c03390f9d6e40efa51f79674c766108
@@@ -80,7 -80,7 +80,7 @@@ struct wl1271_tx_hw_descr 
        /* Identifier of the remote STA in IBSS, 1 in infra-BSS */
        u8 aid;
        u8 reserved;
 -} __attribute__ ((packed));
 +} __packed;
  
  enum wl1271_tx_hw_res_status {
        TX_SUCCESS          = 0,
@@@ -115,13 -115,13 +115,13 @@@ struct wl1271_tx_hw_res_descr 
        u8 rate_class_index;
        /* for 4-byte alignment. */
        u8 spare;
 -} __attribute__ ((packed));
 +} __packed;
  
  struct wl1271_tx_hw_res_if {
        __le32 tx_result_fw_counter;
        __le32 tx_result_host_counter;
        struct wl1271_tx_hw_res_descr tx_results_queue[TX_HW_RESULT_QUEUE_LEN];
 -} __attribute__ ((packed));
 +} __packed;
  
  static inline int wl1271_tx_get_queue(int queue)
  {
@@@ -158,6 -158,7 +158,7 @@@ static inline int wl1271_tx_ac_to_tid(i
  
  void wl1271_tx_work(struct work_struct *work);
  void wl1271_tx_complete(struct wl1271 *wl);
+ void wl1271_tx_reset(struct wl1271 *wl);
  void wl1271_tx_flush(struct wl1271 *wl);
  u8 wl1271_rate_to_idx(struct wl1271 *wl, int rate);
  u32 wl1271_tx_enabled_rates_get(struct wl1271 *wl, u32 rate_set);
diff --combined include/net/cfg80211.h
index e7ebeb8bdf71480f4095b764c6c82cc3f81fc7ce,22ab9d88cf4a6b68b67b28e532f386545613c4d0..a56bac1e69e03592f1e7d344fb757786574d953e
@@@ -37,6 -37,7 +37,7 @@@
   *
   * @IEEE80211_BAND_2GHZ: 2.4GHz ISM band
   * @IEEE80211_BAND_5GHZ: around 5GHz band (4.9-5.7)
+  * @IEEE80211_NUM_BANDS: number of defined bands
   */
  enum ieee80211_band {
        IEEE80211_BAND_2GHZ = NL80211_BAND_2GHZ,
@@@ -89,7 -90,7 +90,7 @@@ enum ieee80211_channel_flags 
   * @max_power: maximum transmission power (in dBm)
   * @beacon_found: helper to regulatory code to indicate when a beacon
   *    has been found on this channel. Use regulatory_hint_found_beacon()
-  *    to enable this, this is is useful only on 5 GHz band.
+  *    to enable this, this is useful only on 5 GHz band.
   * @orig_mag: internal use
   * @orig_mpwr: internal use
   */
@@@ -188,6 -189,7 +189,7 @@@ struct ieee80211_sta_ht_cap 
   *    in this band. Must be sorted to give a valid "supported
   *    rates" IE, i.e. CCK rates first, then OFDM.
   * @n_bitrates: Number of bitrates in @bitrates
+  * @ht_cap: HT capabilities in this band
   */
  struct ieee80211_supported_band {
        struct ieee80211_channel *channels;
@@@ -225,6 -227,7 +227,7 @@@ struct vif_params 
   * @seq: sequence counter (IV/PN) for TKIP and CCMP keys, only used
   *    with the get_key() callback, must be in little endian,
   *    length given by @seq_len.
+  * @seq_len: length of @seq.
   */
  struct key_params {
        u8 *key;
  /**
   * enum survey_info_flags - survey information flags
   *
+  * @SURVEY_INFO_NOISE_DBM: noise (in dBm) was filled in
+  *
   * Used by the driver to indicate which info in &struct survey_info
   * it has filled in during the get_survey().
   */
@@@ -247,13 -252,13 +252,13 @@@ enum survey_info_flags 
  /**
   * struct survey_info - channel survey response
   *
-  * Used by dump_survey() to report back per-channel survey information.
-  *
   * @channel: the channel this survey record reports, mandatory
   * @filled: bitflag of flags from &enum survey_info_flags
   * @noise: channel noise in dBm. This and all following fields are
   *     optional
   *
+  * Used by dump_survey() to report back per-channel survey information.
+  *
   * This structure can later be expanded with things like
   * channel duty cycle etc.
   */
@@@ -288,7 -293,7 +293,7 @@@ struct beacon_parameters 
   *
   * @PLINK_ACTION_INVALID: action 0 is reserved
   * @PLINK_ACTION_OPEN: start mesh peer link establishment
-  * @PLINK_ACTION_BLOCL: block traffic from this mesh peer
+  * @PLINK_ACTION_BLOCK: block traffic from this mesh peer
   */
  enum plink_actions {
        PLINK_ACTION_INVALID,
   *    (bitmask of BIT(NL80211_STA_FLAG_...))
   * @listen_interval: listen interval or -1 for no change
   * @aid: AID or zero for no change
+  * @plink_action: plink action to take
+  * @ht_capa: HT capabilities of station
   */
  struct station_parameters {
        u8 *supported_rates;
@@@ -448,13 -455,13 +455,13 @@@ enum monitor_flags 
   * Used by the driver to indicate which info in &struct mpath_info it has filled
   * in during get_station() or dump_station().
   *
-  * MPATH_INFO_FRAME_QLEN: @frame_qlen filled
-  * MPATH_INFO_SN: @sn filled
-  * MPATH_INFO_METRIC: @metric filled
-  * MPATH_INFO_EXPTIME: @exptime filled
-  * MPATH_INFO_DISCOVERY_TIMEOUT: @discovery_timeout filled
-  * MPATH_INFO_DISCOVERY_RETRIES: @discovery_retries filled
-  * MPATH_INFO_FLAGS: @flags filled
+  * @MPATH_INFO_FRAME_QLEN: @frame_qlen filled
+  * @MPATH_INFO_SN: @sn filled
+  * @MPATH_INFO_METRIC: @metric filled
+  * @MPATH_INFO_EXPTIME: @exptime filled
+  * @MPATH_INFO_DISCOVERY_TIMEOUT: @discovery_timeout filled
+  * @MPATH_INFO_DISCOVERY_RETRIES: @discovery_retries filled
+  * @MPATH_INFO_FLAGS: @flags filled
   */
  enum mpath_info_flags {
        MPATH_INFO_FRAME_QLEN           = BIT(0),
@@@ -587,6 -594,7 +594,7 @@@ struct cfg80211_ssid 
   * @ie_len: length of ie in octets
   * @wiphy: the wiphy this was for
   * @dev: the interface
+  * @aborted: (internal) scan request was notified as aborted
   */
  struct cfg80211_scan_request {
        struct cfg80211_ssid *ssids;
@@@ -623,6 -631,7 +631,7 @@@ enum cfg80211_signal_type 
   * This structure describes a BSS (which may also be a mesh network)
   * for use in scan results and similar.
   *
+  * @channel: channel this BSS is on
   * @bssid: BSSID of the BSS
   * @tsf: timestamp of last received update
   * @beacon_interval: the beacon interval as from the frame
@@@ -826,8 -835,8 +835,8 @@@ struct cfg80211_ibss_params 
   * @ssid: SSID
   * @ssid_len: Length of ssid in octets
   * @auth_type: Authentication type (algorithm)
-  * @assoc_ie: IEs for association request
-  * @assoc_ie_len: Length of assoc_ie in octets
+  * @ie: IEs for association request
+  * @ie_len: Length of assoc_ie in octets
   * @privacy: indicates whether privacy-enabled APs should be used
   * @crypto: crypto settings
   * @key_len: length of WEP key for shared key authentication
@@@ -850,10 -859,11 +859,11 @@@ struct cfg80211_connect_params 
  
  /**
   * enum wiphy_params_flags - set_wiphy_params bitfield values
-  * WIPHY_PARAM_RETRY_SHORT: wiphy->retry_short has changed
-  * WIPHY_PARAM_RETRY_LONG: wiphy->retry_long has changed
-  * WIPHY_PARAM_FRAG_THRESHOLD: wiphy->frag_threshold has changed
-  * WIPHY_PARAM_RTS_THRESHOLD: wiphy->rts_threshold has changed
+  * @WIPHY_PARAM_RETRY_SHORT: wiphy->retry_short has changed
+  * @WIPHY_PARAM_RETRY_LONG: wiphy->retry_long has changed
+  * @WIPHY_PARAM_FRAG_THRESHOLD: wiphy->frag_threshold has changed
+  * @WIPHY_PARAM_RTS_THRESHOLD: wiphy->rts_threshold has changed
+  * @WIPHY_PARAM_COVERAGE_CLASS: coverage class changed
   */
  enum wiphy_params_flags {
        WIPHY_PARAM_RETRY_SHORT         = 1 << 0,
@@@ -949,10 -959,16 +959,16 @@@ struct cfg80211_pmksa 
   * @del_beacon: Remove beacon configuration and stop sending the beacon.
   *
   * @add_station: Add a new station.
-  *
   * @del_station: Remove a station; @mac may be NULL to remove all stations.
-  *
   * @change_station: Modify a given station.
+  * @get_station: get station information for the station identified by @mac
+  * @dump_station: dump station callback -- resume dump at index @idx
+  *
+  * @add_mpath: add a fixed mesh path
+  * @del_mpath: delete a given mesh path
+  * @change_mpath: change a given mesh path
+  * @get_mpath: get a mesh path for the given parameters
+  * @dump_mpath: dump mesh path callback -- resume dump at index @idx
   *
   * @get_mesh_params: Put the current mesh parameters into *params
   *
   *    The mask is a bitfield which tells us which parameters to
   *    set, and which to leave alone.
   *
-  * @set_mesh_cfg: set mesh parameters (by now, just mesh id)
-  *
   * @change_bss: Modify parameters for a given BSS.
   *
   * @set_txq_params: Set TX queue parameters
   * @get_tx_power: store the current TX power into the dbm variable;
   *    return 0 if successful
   *
+  * @set_wds_peer: set the WDS peer for a WDS interface
+  *
   * @rfkill_poll: polls the hw rfkill line, use cfg80211 reporting
   *    functions to adjust rfkill hw state
   *
   *
   * @testmode_cmd: run a test mode command
   *
+  * @set_bitrate_mask: set the bitrate mask configuration
+  *
   * @set_pmksa: Cache a PMKID for a BSSID. This is mostly useful for fullmac
   *    devices running firmwares capable of generating the (re) association
   *    RSN IE. It allows for faster roaming between WPA2 BSSIDs.
@@@ -1168,6 -1186,7 +1186,7 @@@ struct cfg80211_ops 
        int     (*action)(struct wiphy *wiphy, struct net_device *dev,
                          struct ieee80211_channel *chan,
                          enum nl80211_channel_type channel_type,
+                         bool channel_type_valid,
                          const u8 *buf, size_t len, u64 *cookie);
  
        int     (*set_power_mgmt)(struct wiphy *wiphy, struct net_device *dev,
@@@ -1230,8 -1249,6 +1249,6 @@@ struct mac_address 
  
  /**
   * struct wiphy - wireless hardware description
-  * @idx: the wiphy index assigned to this item
-  * @class_dev: the class device representing /sys/class/ieee80211/<wiphy-name>
   * @reg_notifier: the driver's regulatory notification callback
   * @regd: the driver's regulatory domain, if one was requested via
   *    the regulatory_hint() API. This can be used by the driver
   * @frag_threshold: Fragmentation threshold (dot11FragmentationThreshold);
   *    -1 = fragmentation disabled, only odd values >= 256 used
   * @rts_threshold: RTS threshold (dot11RTSThreshold); -1 = RTS/CTS disabled
-  * @net: the network namespace this wiphy currently lives in
+  * @_net: the network namespace this wiphy currently lives in
   * @perm_addr: permanent MAC address of this device
   * @addr_mask: If the device supports multiple MAC addresses by masking,
   *    set this to a mask with variable bits set to 1, e.g. if the last
   *    by default for perm_addr. In this case, the mask should be set to
   *    all-zeroes. In this case it is assumed that the device can handle
   *    the same number of arbitrary MAC addresses.
+  * @debugfsdir: debugfs directory used for this wiphy, will be renamed
+  *    automatically on wiphy renames
+  * @dev: (virtual) struct device for this wiphy
+  * @wext: wireless extension handlers
+  * @priv: driver private data (sized according to wiphy_new() parameter)
+  * @interface_modes: bitmask of interfaces types valid for this wiphy,
+  *    must be set by driver
+  * @flags: wiphy flags, see &enum wiphy_flags
+  * @bss_priv_size: each BSS struct has private data allocated with it,
+  *    this variable determines its size
+  * @max_scan_ssids: maximum number of SSIDs the device can scan for in
+  *    any given scan
+  * @max_scan_ie_len: maximum length of user-controlled IEs device can
+  *    add to probe request frames transmitted during a scan, must not
+  *    include fixed IEs like supported rates
+  * @coverage_class: current coverage class
+  * @fw_version: firmware version for ethtool reporting
+  * @hw_version: hardware version for ethtool reporting
+  * @max_num_pmkids: maximum number of PMKIDs supported by device
+  * @privid: a pointer that drivers can use to identify if an arbitrary
+  *    wiphy is theirs, e.g. in global notifiers
+  * @bands: information about bands/channels supported by this device
   */
  struct wiphy {
        /* assign these fields before you register the 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
@@@ -1460,13 -1510,14 +1499,14 @@@ struct cfg80211_cached_keys
   * @ssid: (private) Used by the internal configuration code
   * @ssid_len: (private) Used by the internal configuration code
   * @wext: (private) Used by the internal wireless extensions compat code
-  * @wext_bssid: (private) Used by the internal wireless extensions compat code
   * @use_4addr: indicates 4addr mode is used on this interface, must be
   *    set by driver (if supported) on add_interface BEFORE registering the
   *    netdev and may otherwise be used by driver read-only, will be update
   *    by cfg80211 on change_interface
   * @action_registrations: list of registrations for action frames
   * @action_registrations_lock: lock for the list
+  * @mtx: mutex used to lock data in this struct
+  * @cleanup_work: work struct used for cleanup that can't be done directly
   */
  struct wireless_dev {
        struct wiphy *wiphy;
@@@ -1540,11 -1591,13 +1580,13 @@@ static inline void *wdev_priv(struct wi
  
  /**
   * ieee80211_channel_to_frequency - convert channel number to frequency
+  * @chan: channel number
   */
  extern int ieee80211_channel_to_frequency(int chan);
  
  /**
   * ieee80211_frequency_to_channel - convert frequency to channel number
+  * @freq: center frequency
   */
  extern int ieee80211_frequency_to_channel(int freq);
  
@@@ -1559,6 -1612,8 +1601,8 @@@ extern struct ieee80211_channel *__ieee
                                                         int freq);
  /**
   * ieee80211_get_channel - get channel struct from wiphy for specified frequency
+  * @wiphy: the struct wiphy to get the channel for
+  * @freq: the center frequency of the channel
   */
  static inline struct ieee80211_channel *
  ieee80211_get_channel(struct wiphy *wiphy, int freq)
@@@ -1619,9 -1674,6 +1663,6 @@@ struct ieee80211_radiotap_vendor_namesp
   * @is_radiotap_ns: indicates whether the current namespace is the default
   *    radiotap namespace or not
   *
-  * @overrides: override standard radiotap fields
-  * @n_overrides: number of overrides
-  *
   * @_rtheader: pointer to the radiotap header we are walking through
   * @_max_length: length of radiotap header in cpu byte ordering
   * @_arg_index: next argument index
@@@ -1937,10 -1989,12 +1978,12 @@@ int cfg80211_wext_giwap(struct net_devi
  void cfg80211_scan_done(struct cfg80211_scan_request *request, bool aborted);
  
  /**
-  * cfg80211_inform_bss - inform cfg80211 of a new BSS
+  * cfg80211_inform_bss_frame - inform cfg80211 of a received BSS frame
   *
   * @wiphy: the wiphy reporting the BSS
-  * @bss: the found BSS
+  * @channel: The channel the frame was received on
+  * @mgmt: the management frame (probe response or beacon)
+  * @len: length of the management frame
   * @signal: the signal strength, type depends on the wiphy's signal_type
   * @gfp: context flags
   *
@@@ -1953,6 -2007,23 +1996,23 @@@ cfg80211_inform_bss_frame(struct wiphy 
                          struct ieee80211_mgmt *mgmt, size_t len,
                          s32 signal, gfp_t gfp);
  
+ /**
+  * cfg80211_inform_bss - inform cfg80211 of a new BSS
+  *
+  * @wiphy: the wiphy reporting the BSS
+  * @channel: The channel the frame was received on
+  * @bssid: the BSSID of the BSS
+  * @timestamp: the TSF timestamp sent by the peer
+  * @capability: the capability field sent by the peer
+  * @beacon_interval: the beacon interval announced by the peer
+  * @ie: additional IEs sent by the peer
+  * @ielen: length of the additional IEs
+  * @signal: the signal strength, type depends on the wiphy's signal_type
+  * @gfp: context flags
+  *
+  * This informs cfg80211 that BSS information was found and
+  * the BSS should be updated/added.
+  */
  struct cfg80211_bss*
  cfg80211_inform_bss(struct wiphy *wiphy,
                    struct ieee80211_channel *channel,
diff --combined net/mac80211/cfg.c
index a2ed0f7b5568f77c315079c5e131dfcbbf976a0c,952845e7072a03f36a884e227f0c1cc9a82a27a3..1f76d048388b3d21a6d9d7c428a63581ccd52e70
@@@ -120,6 -120,9 +120,9 @@@ static int ieee80211_add_key(struct wip
        struct ieee80211_key *key;
        int err;
  
+       if (!netif_running(dev))
+               return -ENETDOWN;
        sdata = IEEE80211_DEV_TO_SUB_IF(dev);
  
        switch (params->cipher) {
        if (!key)
                return -ENOMEM;
  
-       rcu_read_lock();
+       mutex_lock(&sdata->local->sta_mtx);
  
        if (mac_addr) {
                sta = sta_info_get_bss(sdata, mac_addr);
  
        err = 0;
   out_unlock:
-       rcu_read_unlock();
+       mutex_unlock(&sdata->local->sta_mtx);
  
        return err;
  }
@@@ -174,7 -177,7 +177,7 @@@ static int ieee80211_del_key(struct wip
  
        sdata = IEEE80211_DEV_TO_SUB_IF(dev);
  
-       rcu_read_lock();
+       mutex_lock(&sdata->local->sta_mtx);
  
        if (mac_addr) {
                ret = -ENOENT;
  
        ret = 0;
   out_unlock:
-       rcu_read_unlock();
+       mutex_unlock(&sdata->local->sta_mtx);
  
        return ret;
  }
@@@ -305,15 -308,10 +308,10 @@@ static int ieee80211_config_default_key
                                        struct net_device *dev,
                                        u8 key_idx)
  {
-       struct ieee80211_sub_if_data *sdata;
-       rcu_read_lock();
+       struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
  
-       sdata = IEEE80211_DEV_TO_SUB_IF(dev);
        ieee80211_set_default_key(sdata, key_idx);
  
-       rcu_read_unlock();
        return 0;
  }
  
@@@ -600,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)
  {
@@@ -1554,10 -1552,12 +1552,12 @@@ static int ieee80211_cancel_remain_on_c
  static int ieee80211_action(struct wiphy *wiphy, struct net_device *dev,
                            struct ieee80211_channel *chan,
                            enum nl80211_channel_type channel_type,
+                           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, buf, len, cookie);
+                                   channel_type, channel_type_valid,
+                                   buf, len, cookie);
  }
  
  struct cfg80211_ops mac80211_config_ops = {
index ec3e5c3e27bd880ec7f222c2c2bf6fc32c25ef71,4d3883e20fc14b287ef166132934b34a9f383d30..1e779e833473d00349d9ed263e63651c93959933
@@@ -746,10 -746,10 +746,10 @@@ struct ieee80211_local 
        struct mutex iflist_mtx;
  
        /*
-        * Key lock, protects sdata's key_list and sta_info's
+        * Key mutex, protects sdata's key_list and sta_info's
         * key pointers (write access, they're RCU.)
         */
-       spinlock_t key_lock;
+       struct mutex key_mtx;
  
  
        /* Scanning and BSS list */
        struct work_struct dynamic_ps_disable_work;
        struct timer_list dynamic_ps_timer;
        struct notifier_block network_latency_notifier;
+       struct notifier_block ifa_notifier;
  
        int user_power_level; /* in dBm */
        int power_constr_level; /* in dBm */
@@@ -988,6 -989,7 +989,7 @@@ int ieee80211_mgd_disassoc(struct ieee8
  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);
@@@ -996,6 -998,7 +998,7 @@@ void ieee80211_send_pspoll(struct ieee8
  void ieee80211_recalc_ps(struct ieee80211_local *local, s32 latency);
  int ieee80211_max_network_latency(struct notifier_block *nb,
                                  unsigned long data, void *dummy);
+ int ieee80211_set_arp_filter(struct ieee80211_sub_if_data *sdata);
  void ieee80211_sta_process_chanswitch(struct ieee80211_sub_if_data *sdata,
                                      struct ieee80211_channel_sw_ie *sw_elem,
                                      struct ieee80211_bss *bss,
@@@ -1084,7 -1087,7 +1087,7 @@@ struct ieee80211_tx_status_rtap_hdr 
        u8 padding_for_rate;
        __le16 tx_flags;
        u8 data_retries;
 -} __attribute__ ((packed));
 +} __packed;
  
  
  /* HT */
diff --combined net/mac80211/rx.c
index dd232061e4c443f29eb271351b44d05efa2f0861,6e7d6d48fe1e88a6688dc85c6fab286d50a6c0cc..6a15632e7ecaf9221036fc8dc7b005bbe2fbc117
@@@ -825,6 -825,7 +825,7 @@@ ieee80211_rx_h_decrypt(struct ieee80211
        ieee80211_rx_result result = RX_DROP_UNUSABLE;
        struct ieee80211_key *stakey = NULL;
        int mmie_keyidx = -1;
+       __le16 fc;
  
        /*
         * Key selection 101
        if (rx->sta)
                stakey = rcu_dereference(rx->sta->key);
  
-       if (!ieee80211_has_protected(hdr->frame_control))
+       fc = hdr->frame_control;
+       if (!ieee80211_has_protected(fc))
                mmie_keyidx = ieee80211_get_mmie_keyidx(rx->skb);
  
        if (!is_multicast_ether_addr(hdr->addr1) && stakey) {
                rx->key = stakey;
                /* Skip decryption if the frame is not protected. */
-               if (!ieee80211_has_protected(hdr->frame_control))
+               if (!ieee80211_has_protected(fc))
                        return RX_CONTINUE;
        } else if (mmie_keyidx >= 0) {
                /* Broadcast/multicast robust management frame / BIP */
                    mmie_keyidx >= NUM_DEFAULT_KEYS + NUM_DEFAULT_MGMT_KEYS)
                        return RX_DROP_MONITOR; /* unexpected BIP keyidx */
                rx->key = rcu_dereference(rx->sdata->keys[mmie_keyidx]);
-       } else if (!ieee80211_has_protected(hdr->frame_control)) {
+       } else if (!ieee80211_has_protected(fc)) {
                /*
                 * The frame was not protected, so skip decryption. However, we
                 * need to set rx->key if there is a key that could have been
                 * have been expected.
                 */
                struct ieee80211_key *key = NULL;
-               if (ieee80211_is_mgmt(hdr->frame_control) &&
+               if (ieee80211_is_mgmt(fc) &&
                    is_multicast_ether_addr(hdr->addr1) &&
                    (key = rcu_dereference(rx->sdata->default_mgmt_key)))
                        rx->key = key;
                    (status->flag & RX_FLAG_IV_STRIPPED))
                        return RX_CONTINUE;
  
-               hdrlen = ieee80211_hdrlen(hdr->frame_control);
+               hdrlen = ieee80211_hdrlen(fc);
  
                if (rx->skb->len < 8 + hdrlen)
                        return RX_DROP_UNUSABLE; /* TODO: count this? */
  
        if (skb_linearize(rx->skb))
                return RX_DROP_UNUSABLE;
-       hdr = (struct ieee80211_hdr *)rx->skb->data;
-       /* Check for weak IVs if possible */
-       if (rx->sta && rx->key->conf.alg == ALG_WEP &&
-           ieee80211_is_data(hdr->frame_control) &&
-           (!(status->flag & RX_FLAG_IV_STRIPPED) ||
-            !(status->flag & RX_FLAG_DECRYPTED)) &&
-           ieee80211_wep_is_weak_iv(rx->skb, rx->key))
-               rx->sta->wep_weak_iv_count++;
+       /* the hdr variable is invalid now! */
  
        switch (rx->key->conf.alg) {
        case ALG_WEP:
+               /* Check for weak IVs if possible */
+               if (rx->sta && ieee80211_is_data(fc) &&
+                   (!(status->flag & RX_FLAG_IV_STRIPPED) ||
+                    !(status->flag & RX_FLAG_DECRYPTED)) &&
+                   ieee80211_wep_is_weak_iv(rx->skb, rx->key))
+                       rx->sta->wep_weak_iv_count++;
                result = ieee80211_crypto_wep_decrypt(rx);
                break;
        case ALG_TKIP:
@@@ -1852,7 -1853,12 +1853,12 @@@ ieee80211_rx_h_ctrl(struct ieee80211_rx
                return RX_QUEUED;
        }
  
-       return RX_CONTINUE;
+       /*
+        * After this point, we only want management frames,
+        * so we can drop all remaining control frames to
+        * cooked monitor interfaces.
+        */
+       return RX_DROP_MONITOR;
  }
  
  static void ieee80211_process_sa_query_req(struct ieee80211_sub_if_data *sdata,
@@@ -1944,6 -1950,9 +1950,9 @@@ 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 +
@@@ -2148,7 -2157,7 +2157,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
index ba9360a475b0c15f657017f5ca5b93997a70dd49,c426c572d98450af118cec5b639bc4aaa39ec9f6..4607da9a6ff74b0ea38df13bb82add54bd3ed558
@@@ -259,7 -259,7 +259,7 @@@ struct sta_info *sta_info_alloc(struct 
        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",
@@@ -648,14 -648,6 +648,6 @@@ static int __must_check __sta_info_dest
  
        if (sta->key) {
                ieee80211_key_free(sta->key);
-               /*
-                * We have only unlinked the key, and actually destroying it
-                * may mean it is removed from hardware which requires that
-                * the key->sta pointer is still valid, so flush the key todo
-                * list here.
-                */
-               ieee80211_key_todo();
                WARN_ON(sta->key);
        }