aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/wireless/airo.c24
-rw-r--r--drivers/net/wireless/ath/ath5k/base.c65
-rw-r--r--drivers/net/wireless/ath/ath5k/base.h4
-rw-r--r--drivers/net/wireless/ath/ath5k/debug.c2
-rw-r--r--drivers/net/wireless/ath/ath9k/ar9002_hw.c66
-rw-r--r--drivers/net/wireless/ath/ath9k/ar9002_initvals.h1961
-rw-r--r--drivers/net/wireless/ath/ath9k/ar9003_mac.c31
-rw-r--r--drivers/net/wireless/ath/ath9k/eeprom_4k.c7
-rw-r--r--drivers/net/wireless/ath/ath9k/eeprom_9287.c4
-rw-r--r--drivers/net/wireless/ath/ath9k/eeprom_def.c7
-rw-r--r--drivers/net/wireless/ath/ath9k/htc_drv_main.c18
-rw-r--r--drivers/net/wireless/ath/ath9k/init.c2
-rw-r--r--drivers/net/wireless/ath/ath9k/main.c21
-rw-r--r--drivers/net/wireless/ath/ath9k/xmit.c19
-rw-r--r--drivers/net/wireless/b43/main.c2
-rw-r--r--drivers/net/wireless/b43/phy_g.c2
-rw-r--r--drivers/net/wireless/b43/phy_lp.c8
-rw-r--r--drivers/net/wireless/b43/phy_n.c16
-rw-r--r--drivers/net/wireless/b43/wa.c8
-rw-r--r--drivers/net/wireless/ipw2x00/ipw2100.c2
-rw-r--r--drivers/net/wireless/ipw2x00/libipw_module.c4
-rw-r--r--drivers/net/wireless/ipw2x00/libipw_wx.c4
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-4965.c1
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-debugfs.c7
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-commands.h7
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.c18
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-debugfs.c10
-rw-r--r--drivers/net/wireless/libertas/cfg.c6
-rw-r--r--drivers/net/wireless/libertas/debugfs.c4
-rw-r--r--drivers/net/wireless/libertas/host.h6
-rw-r--r--drivers/net/wireless/mwl8k.c22
-rw-r--r--drivers/net/wireless/orinoco/orinoco_usb.c10
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00dump.h2
-rw-r--r--drivers/net/wireless/rtl818x/rtl8180_dev.c11
-rw-r--r--include/net/cfg80211.h4
-rw-r--r--include/net/mac80211.h11
-rw-r--r--include/net/regulatory.h1
-rw-r--r--net/mac80211/cfg.c4
-rw-r--r--net/mac80211/ht.c2
-rw-r--r--net/mac80211/ibss.c92
-rw-r--r--net/mac80211/ieee80211_i.h7
-rw-r--r--net/mac80211/iface.c6
-rw-r--r--net/mac80211/mlme.c13
-rw-r--r--net/mac80211/util.c7
-rw-r--r--net/mac80211/wep.c5
-rw-r--r--net/wireless/core.c14
-rw-r--r--net/wireless/genregdb.awk1
-rw-r--r--net/wireless/lib80211_crypt_tkip.c2
-rw-r--r--net/wireless/reg.c654
-rw-r--r--net/wireless/scan.c5
-rw-r--r--net/wireless/sme.c2
-rw-r--r--net/wireless/wext-compat.c1
52 files changed, 315 insertions, 2897 deletions
diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c
index 6b605df8a923..1d05445d4ba3 100644
--- a/drivers/net/wireless/airo.c
+++ b/drivers/net/wireless/airo.c
@@ -2931,8 +2931,8 @@ err_out_res:
2931 release_region( dev->base_addr, 64 ); 2931 release_region( dev->base_addr, 64 );
2932err_out_nets: 2932err_out_nets:
2933 airo_networks_free(ai); 2933 airo_networks_free(ai);
2934 del_airo_dev(ai);
2935err_out_free: 2934err_out_free:
2935 del_airo_dev(ai);
2936 free_netdev(dev); 2936 free_netdev(dev);
2937 return NULL; 2937 return NULL;
2938} 2938}
@@ -4657,7 +4657,7 @@ static ssize_t proc_write( struct file *file,
4657 loff_t *offset ) 4657 loff_t *offset )
4658{ 4658{
4659 loff_t pos = *offset; 4659 loff_t pos = *offset;
4660 struct proc_data *priv = (struct proc_data*)file->private_data; 4660 struct proc_data *priv = file->private_data;
4661 4661
4662 if (!priv->wbuffer) 4662 if (!priv->wbuffer)
4663 return -EINVAL; 4663 return -EINVAL;
@@ -4689,7 +4689,7 @@ static int proc_status_open(struct inode *inode, struct file *file)
4689 4689
4690 if ((file->private_data = kzalloc(sizeof(struct proc_data ), GFP_KERNEL)) == NULL) 4690 if ((file->private_data = kzalloc(sizeof(struct proc_data ), GFP_KERNEL)) == NULL)
4691 return -ENOMEM; 4691 return -ENOMEM;
4692 data = (struct proc_data *)file->private_data; 4692 data = file->private_data;
4693 if ((data->rbuffer = kmalloc( 2048, GFP_KERNEL )) == NULL) { 4693 if ((data->rbuffer = kmalloc( 2048, GFP_KERNEL )) == NULL) {
4694 kfree (file->private_data); 4694 kfree (file->private_data);
4695 return -ENOMEM; 4695 return -ENOMEM;
@@ -4772,7 +4772,7 @@ static int proc_stats_rid_open( struct inode *inode,
4772 4772
4773 if ((file->private_data = kzalloc(sizeof(struct proc_data ), GFP_KERNEL)) == NULL) 4773 if ((file->private_data = kzalloc(sizeof(struct proc_data ), GFP_KERNEL)) == NULL)
4774 return -ENOMEM; 4774 return -ENOMEM;
4775 data = (struct proc_data *)file->private_data; 4775 data = file->private_data;
4776 if ((data->rbuffer = kmalloc( 4096, GFP_KERNEL )) == NULL) { 4776 if ((data->rbuffer = kmalloc( 4096, GFP_KERNEL )) == NULL) {
4777 kfree (file->private_data); 4777 kfree (file->private_data);
4778 return -ENOMEM; 4778 return -ENOMEM;
@@ -5045,7 +5045,7 @@ static int proc_config_open(struct inode *inode, struct file *file)
5045 5045
5046 if ((file->private_data = kzalloc(sizeof(struct proc_data ), GFP_KERNEL)) == NULL) 5046 if ((file->private_data = kzalloc(sizeof(struct proc_data ), GFP_KERNEL)) == NULL)
5047 return -ENOMEM; 5047 return -ENOMEM;
5048 data = (struct proc_data *)file->private_data; 5048 data = file->private_data;
5049 if ((data->rbuffer = kmalloc( 2048, GFP_KERNEL )) == NULL) { 5049 if ((data->rbuffer = kmalloc( 2048, GFP_KERNEL )) == NULL) {
5050 kfree (file->private_data); 5050 kfree (file->private_data);
5051 return -ENOMEM; 5051 return -ENOMEM;
@@ -5127,7 +5127,7 @@ static int proc_config_open(struct inode *inode, struct file *file)
5127 5127
5128static void proc_SSID_on_close(struct inode *inode, struct file *file) 5128static void proc_SSID_on_close(struct inode *inode, struct file *file)
5129{ 5129{
5130 struct proc_data *data = (struct proc_data *)file->private_data; 5130 struct proc_data *data = file->private_data;
5131 struct proc_dir_entry *dp = PDE(inode); 5131 struct proc_dir_entry *dp = PDE(inode);
5132 struct net_device *dev = dp->data; 5132 struct net_device *dev = dp->data;
5133 struct airo_info *ai = dev->ml_priv; 5133 struct airo_info *ai = dev->ml_priv;
@@ -5163,7 +5163,7 @@ static void proc_SSID_on_close(struct inode *inode, struct file *file)
5163} 5163}
5164 5164
5165static void proc_APList_on_close( struct inode *inode, struct file *file ) { 5165static void proc_APList_on_close( struct inode *inode, struct file *file ) {
5166 struct proc_data *data = (struct proc_data *)file->private_data; 5166 struct proc_data *data = file->private_data;
5167 struct proc_dir_entry *dp = PDE(inode); 5167 struct proc_dir_entry *dp = PDE(inode);
5168 struct net_device *dev = dp->data; 5168 struct net_device *dev = dp->data;
5169 struct airo_info *ai = dev->ml_priv; 5169 struct airo_info *ai = dev->ml_priv;
@@ -5309,7 +5309,7 @@ static void proc_wepkey_on_close( struct inode *inode, struct file *file ) {
5309 5309
5310 memset(key, 0, sizeof(key)); 5310 memset(key, 0, sizeof(key));
5311 5311
5312 data = (struct proc_data *)file->private_data; 5312 data = file->private_data;
5313 if ( !data->writelen ) return; 5313 if ( !data->writelen ) return;
5314 5314
5315 if (data->wbuffer[0] >= '0' && data->wbuffer[0] <= '3' && 5315 if (data->wbuffer[0] >= '0' && data->wbuffer[0] <= '3' &&
@@ -5363,7 +5363,7 @@ static int proc_wepkey_open( struct inode *inode, struct file *file )
5363 if ((file->private_data = kzalloc(sizeof(struct proc_data ), GFP_KERNEL)) == NULL) 5363 if ((file->private_data = kzalloc(sizeof(struct proc_data ), GFP_KERNEL)) == NULL)
5364 return -ENOMEM; 5364 return -ENOMEM;
5365 memset(&wkr, 0, sizeof(wkr)); 5365 memset(&wkr, 0, sizeof(wkr));
5366 data = (struct proc_data *)file->private_data; 5366 data = file->private_data;
5367 if ((data->rbuffer = kzalloc( 180, GFP_KERNEL )) == NULL) { 5367 if ((data->rbuffer = kzalloc( 180, GFP_KERNEL )) == NULL) {
5368 kfree (file->private_data); 5368 kfree (file->private_data);
5369 return -ENOMEM; 5369 return -ENOMEM;
@@ -5409,7 +5409,7 @@ static int proc_SSID_open(struct inode *inode, struct file *file)
5409 5409
5410 if ((file->private_data = kzalloc(sizeof(struct proc_data ), GFP_KERNEL)) == NULL) 5410 if ((file->private_data = kzalloc(sizeof(struct proc_data ), GFP_KERNEL)) == NULL)
5411 return -ENOMEM; 5411 return -ENOMEM;
5412 data = (struct proc_data *)file->private_data; 5412 data = file->private_data;
5413 if ((data->rbuffer = kmalloc( 104, GFP_KERNEL )) == NULL) { 5413 if ((data->rbuffer = kmalloc( 104, GFP_KERNEL )) == NULL) {
5414 kfree (file->private_data); 5414 kfree (file->private_data);
5415 return -ENOMEM; 5415 return -ENOMEM;
@@ -5453,7 +5453,7 @@ static int proc_APList_open( struct inode *inode, struct file *file ) {
5453 5453
5454 if ((file->private_data = kzalloc(sizeof(struct proc_data ), GFP_KERNEL)) == NULL) 5454 if ((file->private_data = kzalloc(sizeof(struct proc_data ), GFP_KERNEL)) == NULL)
5455 return -ENOMEM; 5455 return -ENOMEM;
5456 data = (struct proc_data *)file->private_data; 5456 data = file->private_data;
5457 if ((data->rbuffer = kmalloc( 104, GFP_KERNEL )) == NULL) { 5457 if ((data->rbuffer = kmalloc( 104, GFP_KERNEL )) == NULL) {
5458 kfree (file->private_data); 5458 kfree (file->private_data);
5459 return -ENOMEM; 5459 return -ENOMEM;
@@ -5495,7 +5495,7 @@ static int proc_BSSList_open( struct inode *inode, struct file *file ) {
5495 5495
5496 if ((file->private_data = kzalloc(sizeof(struct proc_data ), GFP_KERNEL)) == NULL) 5496 if ((file->private_data = kzalloc(sizeof(struct proc_data ), GFP_KERNEL)) == NULL)
5497 return -ENOMEM; 5497 return -ENOMEM;
5498 data = (struct proc_data *)file->private_data; 5498 data = file->private_data;
5499 if ((data->rbuffer = kmalloc( 1024, GFP_KERNEL )) == NULL) { 5499 if ((data->rbuffer = kmalloc( 1024, GFP_KERNEL )) == NULL) {
5500 kfree (file->private_data); 5500 kfree (file->private_data);
5501 return -ENOMEM; 5501 return -ENOMEM;
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index 20328bdd138b..0d5de2574dd1 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -388,7 +388,7 @@ static int ath5k_init(struct ath5k_softc *sc);
388static int ath5k_stop_locked(struct ath5k_softc *sc); 388static int ath5k_stop_locked(struct ath5k_softc *sc);
389static int ath5k_stop_hw(struct ath5k_softc *sc); 389static int ath5k_stop_hw(struct ath5k_softc *sc);
390static irqreturn_t ath5k_intr(int irq, void *dev_id); 390static irqreturn_t ath5k_intr(int irq, void *dev_id);
391static void ath5k_tasklet_reset(unsigned long data); 391static void ath5k_reset_work(struct work_struct *work);
392 392
393static void ath5k_tasklet_calibrate(unsigned long data); 393static void ath5k_tasklet_calibrate(unsigned long data);
394 394
@@ -831,11 +831,12 @@ ath5k_attach(struct pci_dev *pdev, struct ieee80211_hw *hw)
831 831
832 tasklet_init(&sc->rxtq, ath5k_tasklet_rx, (unsigned long)sc); 832 tasklet_init(&sc->rxtq, ath5k_tasklet_rx, (unsigned long)sc);
833 tasklet_init(&sc->txtq, ath5k_tasklet_tx, (unsigned long)sc); 833 tasklet_init(&sc->txtq, ath5k_tasklet_tx, (unsigned long)sc);
834 tasklet_init(&sc->restq, ath5k_tasklet_reset, (unsigned long)sc);
835 tasklet_init(&sc->calib, ath5k_tasklet_calibrate, (unsigned long)sc); 834 tasklet_init(&sc->calib, ath5k_tasklet_calibrate, (unsigned long)sc);
836 tasklet_init(&sc->beacontq, ath5k_tasklet_beacon, (unsigned long)sc); 835 tasklet_init(&sc->beacontq, ath5k_tasklet_beacon, (unsigned long)sc);
837 tasklet_init(&sc->ani_tasklet, ath5k_tasklet_ani, (unsigned long)sc); 836 tasklet_init(&sc->ani_tasklet, ath5k_tasklet_ani, (unsigned long)sc);
838 837
838 INIT_WORK(&sc->reset_work, ath5k_reset_work);
839
839 ret = ath5k_eeprom_read_mac(ah, mac); 840 ret = ath5k_eeprom_read_mac(ah, mac);
840 if (ret) { 841 if (ret) {
841 ATH5K_ERR(sc, "unable to read address from EEPROM: 0x%04x\n", 842 ATH5K_ERR(sc, "unable to read address from EEPROM: 0x%04x\n",
@@ -1727,8 +1728,6 @@ ath5k_rx_stop(struct ath5k_softc *sc)
1727 ath5k_hw_stop_rx_dma(ah); /* disable DMA engine */ 1728 ath5k_hw_stop_rx_dma(ah); /* disable DMA engine */
1728 1729
1729 ath5k_debug_printrxbuffs(sc, ah); 1730 ath5k_debug_printrxbuffs(sc, ah);
1730
1731 sc->rxlink = NULL; /* just in case */
1732} 1731}
1733 1732
1734static unsigned int 1733static unsigned int
@@ -2294,8 +2293,8 @@ err_unmap:
2294 * frame contents are done as needed and the slot time is 2293 * frame contents are done as needed and the slot time is
2295 * also adjusted based on current state. 2294 * also adjusted based on current state.
2296 * 2295 *
2297 * This is called from software irq context (beacontq or restq 2296 * This is called from software irq context (beacontq tasklets)
2298 * tasklets) or user context from ath5k_beacon_config. 2297 * or user context from ath5k_beacon_config.
2299 */ 2298 */
2300static void 2299static void
2301ath5k_beacon_send(struct ath5k_softc *sc) 2300ath5k_beacon_send(struct ath5k_softc *sc)
@@ -2328,7 +2327,7 @@ ath5k_beacon_send(struct ath5k_softc *sc)
2328 sc->bmisscount); 2327 sc->bmisscount);
2329 ATH5K_DBG(sc, ATH5K_DEBUG_RESET, 2328 ATH5K_DBG(sc, ATH5K_DEBUG_RESET,
2330 "stuck beacon, resetting\n"); 2329 "stuck beacon, resetting\n");
2331 tasklet_schedule(&sc->restq); 2330 ieee80211_queue_work(sc->hw, &sc->reset_work);
2332 } 2331 }
2333 return; 2332 return;
2334 } 2333 }
@@ -2632,12 +2631,20 @@ ath5k_stop_locked(struct ath5k_softc *sc)
2632 if (!test_bit(ATH_STAT_INVALID, sc->status)) { 2631 if (!test_bit(ATH_STAT_INVALID, sc->status)) {
2633 ath5k_rx_stop(sc); 2632 ath5k_rx_stop(sc);
2634 ath5k_hw_phy_disable(ah); 2633 ath5k_hw_phy_disable(ah);
2635 } else 2634 }
2636 sc->rxlink = NULL;
2637 2635
2638 return 0; 2636 return 0;
2639} 2637}
2640 2638
2639static void stop_tasklets(struct ath5k_softc *sc)
2640{
2641 tasklet_kill(&sc->rxtq);
2642 tasklet_kill(&sc->txtq);
2643 tasklet_kill(&sc->calib);
2644 tasklet_kill(&sc->beacontq);
2645 tasklet_kill(&sc->ani_tasklet);
2646}
2647
2641/* 2648/*
2642 * Stop the device, grabbing the top-level lock to protect 2649 * Stop the device, grabbing the top-level lock to protect
2643 * against concurrent entry through ath5k_init (which can happen 2650 * against concurrent entry through ath5k_init (which can happen
@@ -2682,12 +2689,7 @@ ath5k_stop_hw(struct ath5k_softc *sc)
2682 mmiowb(); 2689 mmiowb();
2683 mutex_unlock(&sc->lock); 2690 mutex_unlock(&sc->lock);
2684 2691
2685 tasklet_kill(&sc->rxtq); 2692 stop_tasklets(sc);
2686 tasklet_kill(&sc->txtq);
2687 tasklet_kill(&sc->restq);
2688 tasklet_kill(&sc->calib);
2689 tasklet_kill(&sc->beacontq);
2690 tasklet_kill(&sc->ani_tasklet);
2691 2693
2692 ath5k_rfkill_hw_stop(sc->ah); 2694 ath5k_rfkill_hw_stop(sc->ah);
2693 2695
@@ -2737,7 +2739,7 @@ ath5k_intr(int irq, void *dev_id)
2737 */ 2739 */
2738 ATH5K_DBG(sc, ATH5K_DEBUG_RESET, 2740 ATH5K_DBG(sc, ATH5K_DEBUG_RESET,
2739 "fatal int, resetting\n"); 2741 "fatal int, resetting\n");
2740 tasklet_schedule(&sc->restq); 2742 ieee80211_queue_work(sc->hw, &sc->reset_work);
2741 } else if (unlikely(status & AR5K_INT_RXORN)) { 2743 } else if (unlikely(status & AR5K_INT_RXORN)) {
2742 /* 2744 /*
2743 * Receive buffers are full. Either the bus is busy or 2745 * Receive buffers are full. Either the bus is busy or
@@ -2752,7 +2754,7 @@ ath5k_intr(int irq, void *dev_id)
2752 if (ah->ah_mac_srev < AR5K_SREV_AR5212) { 2754 if (ah->ah_mac_srev < AR5K_SREV_AR5212) {
2753 ATH5K_DBG(sc, ATH5K_DEBUG_RESET, 2755 ATH5K_DBG(sc, ATH5K_DEBUG_RESET,
2754 "rx overrun, resetting\n"); 2756 "rx overrun, resetting\n");
2755 tasklet_schedule(&sc->restq); 2757 ieee80211_queue_work(sc->hw, &sc->reset_work);
2756 } 2758 }
2757 else 2759 else
2758 tasklet_schedule(&sc->rxtq); 2760 tasklet_schedule(&sc->rxtq);
@@ -2766,7 +2768,7 @@ ath5k_intr(int irq, void *dev_id)
2766 * RXE bit is written, but it doesn't work at 2768 * RXE bit is written, but it doesn't work at
2767 * least on older hardware revs. 2769 * least on older hardware revs.
2768 */ 2770 */
2769 sc->rxlink = NULL; 2771 sc->stats.rxeol_intr++;
2770 } 2772 }
2771 if (status & AR5K_INT_TXURN) { 2773 if (status & AR5K_INT_TXURN) {
2772 /* bump tx trigger level */ 2774 /* bump tx trigger level */
@@ -2799,14 +2801,6 @@ ath5k_intr(int irq, void *dev_id)
2799 return IRQ_HANDLED; 2801 return IRQ_HANDLED;
2800} 2802}
2801 2803
2802static void
2803ath5k_tasklet_reset(unsigned long data)
2804{
2805 struct ath5k_softc *sc = (void *)data;
2806
2807 ath5k_reset(sc, sc->curchan);
2808}
2809
2810/* 2804/*
2811 * Periodically recalibrate the PHY to account 2805 * Periodically recalibrate the PHY to account
2812 * for temperature/environment changes. 2806 * for temperature/environment changes.
@@ -2830,7 +2824,7 @@ ath5k_tasklet_calibrate(unsigned long data)
2830 * to load new gain values. 2824 * to load new gain values.
2831 */ 2825 */
2832 ATH5K_DBG(sc, ATH5K_DEBUG_RESET, "calibration, resetting\n"); 2826 ATH5K_DBG(sc, ATH5K_DEBUG_RESET, "calibration, resetting\n");
2833 ath5k_reset(sc, sc->curchan); 2827 ieee80211_queue_work(sc->hw, &sc->reset_work);
2834 } 2828 }
2835 if (ath5k_hw_phy_calibrate(ah, sc->curchan)) 2829 if (ath5k_hw_phy_calibrate(ah, sc->curchan))
2836 ATH5K_ERR(sc, "calibration of channel %u failed\n", 2830 ATH5K_ERR(sc, "calibration of channel %u failed\n",
@@ -2934,6 +2928,8 @@ drop_packet:
2934/* 2928/*
2935 * Reset the hardware. If chan is not NULL, then also pause rx/tx 2929 * Reset the hardware. If chan is not NULL, then also pause rx/tx
2936 * and change to the given channel. 2930 * and change to the given channel.
2931 *
2932 * This should be called with sc->lock.
2937 */ 2933 */
2938static int 2934static int
2939ath5k_reset(struct ath5k_softc *sc, struct ieee80211_channel *chan) 2935ath5k_reset(struct ath5k_softc *sc, struct ieee80211_channel *chan)
@@ -2943,8 +2939,11 @@ ath5k_reset(struct ath5k_softc *sc, struct ieee80211_channel *chan)
2943 2939
2944 ATH5K_DBG(sc, ATH5K_DEBUG_RESET, "resetting\n"); 2940 ATH5K_DBG(sc, ATH5K_DEBUG_RESET, "resetting\n");
2945 2941
2942 ath5k_hw_set_imr(ah, 0);
2943 synchronize_irq(sc->pdev->irq);
2944 stop_tasklets(sc);
2945
2946 if (chan) { 2946 if (chan) {
2947 ath5k_hw_set_imr(ah, 0);
2948 ath5k_txq_cleanup(sc); 2947 ath5k_txq_cleanup(sc);
2949 ath5k_rx_stop(sc); 2948 ath5k_rx_stop(sc);
2950 2949
@@ -2990,6 +2989,16 @@ err:
2990 return ret; 2989 return ret;
2991} 2990}
2992 2991
2992static void ath5k_reset_work(struct work_struct *work)
2993{
2994 struct ath5k_softc *sc = container_of(work, struct ath5k_softc,
2995 reset_work);
2996
2997 mutex_lock(&sc->lock);
2998 ath5k_reset(sc, sc->curchan);
2999 mutex_unlock(&sc->lock);
3000}
3001
2993static int ath5k_start(struct ieee80211_hw *hw) 3002static int ath5k_start(struct ieee80211_hw *hw)
2994{ 3003{
2995 return ath5k_init(hw->priv); 3004 return ath5k_init(hw->priv);
diff --git a/drivers/net/wireless/ath/ath5k/base.h b/drivers/net/wireless/ath/ath5k/base.h
index 56221bc7c8cd..dc1241f9c4e8 100644
--- a/drivers/net/wireless/ath/ath5k/base.h
+++ b/drivers/net/wireless/ath/ath5k/base.h
@@ -47,6 +47,7 @@
47#include <linux/if_ether.h> 47#include <linux/if_ether.h>
48#include <linux/leds.h> 48#include <linux/leds.h>
49#include <linux/rfkill.h> 49#include <linux/rfkill.h>
50#include <linux/workqueue.h>
50 51
51#include "ath5k.h" 52#include "ath5k.h"
52#include "debug.h" 53#include "debug.h"
@@ -136,6 +137,7 @@ struct ath5k_statistics {
136 137
137 unsigned int mib_intr; 138 unsigned int mib_intr;
138 unsigned int rxorn_intr; 139 unsigned int rxorn_intr;
140 unsigned int rxeol_intr;
139}; 141};
140 142
141#if CHAN_DEBUG 143#if CHAN_DEBUG
@@ -189,7 +191,7 @@ struct ath5k_softc {
189 unsigned int led_pin, /* GPIO pin for driving LED */ 191 unsigned int led_pin, /* GPIO pin for driving LED */
190 led_on; /* pin setting for LED on */ 192 led_on; /* pin setting for LED on */
191 193
192 struct tasklet_struct restq; /* reset tasklet */ 194 struct work_struct reset_work; /* deferred chip reset */
193 195
194 unsigned int rxbufsize; /* rx size based on mtu */ 196 unsigned int rxbufsize; /* rx size based on mtu */
195 struct list_head rxbuf; /* receive buffer */ 197 struct list_head rxbuf; /* receive buffer */
diff --git a/drivers/net/wireless/ath/ath5k/debug.c b/drivers/net/wireless/ath/ath5k/debug.c
index 8c638865c712..ebb9c237a0d5 100644
--- a/drivers/net/wireless/ath/ath5k/debug.c
+++ b/drivers/net/wireless/ath/ath5k/debug.c
@@ -279,7 +279,7 @@ static ssize_t write_file_reset(struct file *file,
279{ 279{
280 struct ath5k_softc *sc = file->private_data; 280 struct ath5k_softc *sc = file->private_data;
281 ATH5K_DBG(sc, ATH5K_DEBUG_RESET, "debug file triggered reset\n"); 281 ATH5K_DBG(sc, ATH5K_DEBUG_RESET, "debug file triggered reset\n");
282 tasklet_schedule(&sc->restq); 282 ieee80211_queue_work(sc->hw, &sc->reset_work);
283 return count; 283 return count;
284} 284}
285 285
diff --git a/drivers/net/wireless/ath/ath9k/ar9002_hw.c b/drivers/net/wireless/ath/ath9k/ar9002_hw.c
index 75b80d13ff91..303c63da5ea3 100644
--- a/drivers/net/wireless/ath/ath9k/ar9002_hw.c
+++ b/drivers/net/wireless/ath/ath9k/ar9002_hw.c
@@ -85,21 +85,6 @@ static void ar9002_hw_init_mode_regs(struct ath_hw *ah)
85 ar9287PciePhy_clkreq_always_on_L1_9287_1_1, 85 ar9287PciePhy_clkreq_always_on_L1_9287_1_1,
86 ARRAY_SIZE(ar9287PciePhy_clkreq_always_on_L1_9287_1_1), 86 ARRAY_SIZE(ar9287PciePhy_clkreq_always_on_L1_9287_1_1),
87 2); 87 2);
88 } else if (AR_SREV_9287_10_OR_LATER(ah)) {
89 INIT_INI_ARRAY(&ah->iniModes, ar9287Modes_9287_1_0,
90 ARRAY_SIZE(ar9287Modes_9287_1_0), 6);
91 INIT_INI_ARRAY(&ah->iniCommon, ar9287Common_9287_1_0,
92 ARRAY_SIZE(ar9287Common_9287_1_0), 2);
93
94 if (ah->config.pcie_clock_req)
95 INIT_INI_ARRAY(&ah->iniPcieSerdes,
96 ar9287PciePhy_clkreq_off_L1_9287_1_0,
97 ARRAY_SIZE(ar9287PciePhy_clkreq_off_L1_9287_1_0), 2);
98 else
99 INIT_INI_ARRAY(&ah->iniPcieSerdes,
100 ar9287PciePhy_clkreq_always_on_L1_9287_1_0,
101 ARRAY_SIZE(ar9287PciePhy_clkreq_always_on_L1_9287_1_0),
102 2);
103 } else if (AR_SREV_9285_12_OR_LATER(ah)) { 88 } else if (AR_SREV_9285_12_OR_LATER(ah)) {
104 89
105 90
@@ -118,21 +103,6 @@ static void ar9002_hw_init_mode_regs(struct ath_hw *ah)
118 ARRAY_SIZE(ar9285PciePhy_clkreq_always_on_L1_9285_1_2), 103 ARRAY_SIZE(ar9285PciePhy_clkreq_always_on_L1_9285_1_2),
119 2); 104 2);
120 } 105 }
121 } else if (AR_SREV_9285_10_OR_LATER(ah)) {
122 INIT_INI_ARRAY(&ah->iniModes, ar9285Modes_9285,
123 ARRAY_SIZE(ar9285Modes_9285), 6);
124 INIT_INI_ARRAY(&ah->iniCommon, ar9285Common_9285,
125 ARRAY_SIZE(ar9285Common_9285), 2);
126
127 if (ah->config.pcie_clock_req) {
128 INIT_INI_ARRAY(&ah->iniPcieSerdes,
129 ar9285PciePhy_clkreq_off_L1_9285,
130 ARRAY_SIZE(ar9285PciePhy_clkreq_off_L1_9285), 2);
131 } else {
132 INIT_INI_ARRAY(&ah->iniPcieSerdes,
133 ar9285PciePhy_clkreq_always_on_L1_9285,
134 ARRAY_SIZE(ar9285PciePhy_clkreq_always_on_L1_9285), 2);
135 }
136 } else if (AR_SREV_9280_20_OR_LATER(ah)) { 106 } else if (AR_SREV_9280_20_OR_LATER(ah)) {
137 INIT_INI_ARRAY(&ah->iniModes, ar9280Modes_9280_2, 107 INIT_INI_ARRAY(&ah->iniModes, ar9280Modes_9280_2,
138 ARRAY_SIZE(ar9280Modes_9280_2), 6); 108 ARRAY_SIZE(ar9280Modes_9280_2), 6);
@@ -151,11 +121,6 @@ static void ar9002_hw_init_mode_regs(struct ath_hw *ah)
151 INIT_INI_ARRAY(&ah->iniModesAdditional, 121 INIT_INI_ARRAY(&ah->iniModesAdditional,
152 ar9280Modes_fast_clock_9280_2, 122 ar9280Modes_fast_clock_9280_2,
153 ARRAY_SIZE(ar9280Modes_fast_clock_9280_2), 3); 123 ARRAY_SIZE(ar9280Modes_fast_clock_9280_2), 3);
154 } else if (AR_SREV_9280_10_OR_LATER(ah)) {
155 INIT_INI_ARRAY(&ah->iniModes, ar9280Modes_9280,
156 ARRAY_SIZE(ar9280Modes_9280), 6);
157 INIT_INI_ARRAY(&ah->iniCommon, ar9280Common_9280,
158 ARRAY_SIZE(ar9280Common_9280), 2);
159 } else if (AR_SREV_9160_10_OR_LATER(ah)) { 124 } else if (AR_SREV_9160_10_OR_LATER(ah)) {
160 INIT_INI_ARRAY(&ah->iniModes, ar5416Modes_9160, 125 INIT_INI_ARRAY(&ah->iniModes, ar5416Modes_9160,
161 ARRAY_SIZE(ar5416Modes_9160), 6); 126 ARRAY_SIZE(ar5416Modes_9160), 6);
@@ -305,10 +270,6 @@ static void ar9002_hw_init_mode_gain_regs(struct ath_hw *ah)
305 INIT_INI_ARRAY(&ah->iniModesRxGain, 270 INIT_INI_ARRAY(&ah->iniModesRxGain,
306 ar9287Modes_rx_gain_9287_1_1, 271 ar9287Modes_rx_gain_9287_1_1,
307 ARRAY_SIZE(ar9287Modes_rx_gain_9287_1_1), 6); 272 ARRAY_SIZE(ar9287Modes_rx_gain_9287_1_1), 6);
308 else if (AR_SREV_9287_10(ah))
309 INIT_INI_ARRAY(&ah->iniModesRxGain,
310 ar9287Modes_rx_gain_9287_1_0,
311 ARRAY_SIZE(ar9287Modes_rx_gain_9287_1_0), 6);
312 else if (AR_SREV_9280_20(ah)) 273 else if (AR_SREV_9280_20(ah))
313 ar9280_20_hw_init_rxgain_ini(ah); 274 ar9280_20_hw_init_rxgain_ini(ah);
314 275
@@ -316,10 +277,6 @@ static void ar9002_hw_init_mode_gain_regs(struct ath_hw *ah)
316 INIT_INI_ARRAY(&ah->iniModesTxGain, 277 INIT_INI_ARRAY(&ah->iniModesTxGain,
317 ar9287Modes_tx_gain_9287_1_1, 278 ar9287Modes_tx_gain_9287_1_1,
318 ARRAY_SIZE(ar9287Modes_tx_gain_9287_1_1), 6); 279 ARRAY_SIZE(ar9287Modes_tx_gain_9287_1_1), 6);
319 } else if (AR_SREV_9287_10(ah)) {
320 INIT_INI_ARRAY(&ah->iniModesTxGain,
321 ar9287Modes_tx_gain_9287_1_0,
322 ARRAY_SIZE(ar9287Modes_tx_gain_9287_1_0), 6);
323 } else if (AR_SREV_9280_20(ah)) { 280 } else if (AR_SREV_9280_20(ah)) {
324 ar9280_20_hw_init_txgain_ini(ah); 281 ar9280_20_hw_init_txgain_ini(ah);
325 } else if (AR_SREV_9285_12_OR_LATER(ah)) { 282 } else if (AR_SREV_9285_12_OR_LATER(ah)) {
@@ -389,29 +346,6 @@ static void ar9002_hw_configpcipowersave(struct ath_hw *ah,
389 REG_WRITE(ah, INI_RA(&ah->iniPcieSerdes, i, 0), 346 REG_WRITE(ah, INI_RA(&ah->iniPcieSerdes, i, 0),
390 INI_RA(&ah->iniPcieSerdes, i, 1)); 347 INI_RA(&ah->iniPcieSerdes, i, 1));
391 } 348 }
392 } else if (AR_SREV_9280(ah) &&
393 (ah->hw_version.macRev == AR_SREV_REVISION_9280_10)) {
394 REG_WRITE(ah, AR_PCIE_SERDES, 0x9248fd00);
395 REG_WRITE(ah, AR_PCIE_SERDES, 0x24924924);
396
397 /* RX shut off when elecidle is asserted */
398 REG_WRITE(ah, AR_PCIE_SERDES, 0xa8000019);
399 REG_WRITE(ah, AR_PCIE_SERDES, 0x13160820);
400 REG_WRITE(ah, AR_PCIE_SERDES, 0xe5980560);
401
402 /* Shut off CLKREQ active in L1 */
403 if (ah->config.pcie_clock_req)
404 REG_WRITE(ah, AR_PCIE_SERDES, 0x401deffc);
405 else
406 REG_WRITE(ah, AR_PCIE_SERDES, 0x401deffd);
407
408 REG_WRITE(ah, AR_PCIE_SERDES, 0x1aaabe40);
409 REG_WRITE(ah, AR_PCIE_SERDES, 0xbe105554);
410 REG_WRITE(ah, AR_PCIE_SERDES, 0x00043007);
411
412 /* Load the new settings */
413 REG_WRITE(ah, AR_PCIE_SERDES2, 0x00000000);
414
415 } else { 349 } else {
416 ENABLE_REGWRITE_BUFFER(ah); 350 ENABLE_REGWRITE_BUFFER(ah);
417 351
diff --git a/drivers/net/wireless/ath/ath9k/ar9002_initvals.h b/drivers/net/wireless/ath/ath9k/ar9002_initvals.h
index 13b5e484c2ef..6203eed860dd 100644
--- a/drivers/net/wireless/ath/ath9k/ar9002_initvals.h
+++ b/drivers/net/wireless/ath/ath9k/ar9002_initvals.h
@@ -14,556 +14,6 @@
14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 */ 15 */
16 16
17static const u32 ar9280Modes_9280[][6] = {
18 {0x00001030, 0x00000230, 0x00000460, 0x000002c0, 0x00000160, 0x000001e0},
19 {0x00001070, 0x00000168, 0x000002d0, 0x00000318, 0x0000018c, 0x000001e0},
20 {0x000010b0, 0x00000e60, 0x00001cc0, 0x00007c70, 0x00003e38, 0x00001180},
21 {0x000010f0, 0x0000a000, 0x00014000, 0x00016000, 0x0000b000, 0x00014008},
22 {0x00008014, 0x03e803e8, 0x07d007d0, 0x10801080, 0x08400840, 0x06e006e0},
23 {0x0000801c, 0x128d8027, 0x128d804f, 0x12e00057, 0x12e0002b, 0x0988004f},
24 {0x00009804, 0x00000300, 0x000003c4, 0x000003c4, 0x00000300, 0x00000303},
25 {0x00009820, 0x02020200, 0x02020200, 0x02020200, 0x02020200, 0x02020200},
26 {0x00009824, 0x00000e0e, 0x00000e0e, 0x00000e0e, 0x00000e0e, 0x00000e0e},
27 {0x00009828, 0x0a020001, 0x0a020001, 0x0a020001, 0x0a020001, 0x0a020001},
28 {0x00009834, 0x00000e0e, 0x00000e0e, 0x00000e0e, 0x00000e0e, 0x00000e0e},
29 {0x00009838, 0x00000007, 0x00000007, 0x00000007, 0x00000007, 0x00000007},
30 {0x00009844, 0x1372161e, 0x1372161e, 0x137216a0, 0x137216a0, 0x137216a0},
31 {0x00009848, 0x00028566, 0x00028566, 0x00028563, 0x00028563, 0x00028563},
32 {0x0000a848, 0x00028566, 0x00028566, 0x00028563, 0x00028563, 0x00028563},
33 {0x00009850, 0x6d4000e2, 0x6d4000e2, 0x6d4000e2, 0x6d4000e2, 0x6d4000e2},
34 {0x00009858, 0x7ec82d2e, 0x7ec82d2e, 0x7ec82d2e, 0x7ec82d2e, 0x7ec82d2e},
35 {0x0000985c, 0x3139605e, 0x3139605e, 0x3139605e, 0x3139605e, 0x3139605e},
36 {0x00009860, 0x00049d18, 0x00049d18, 0x00049d20, 0x00049d20, 0x00049d18},
37 {0x0000c864, 0x0001ce00, 0x0001ce00, 0x0001ce00, 0x0001ce00, 0x0001ce00},
38 {0x00009868, 0x5ac64190, 0x5ac64190, 0x5ac64190, 0x5ac64190, 0x5ac64190},
39 {0x0000986c, 0x06903081, 0x06903081, 0x06903881, 0x06903881, 0x06903881},
40 {0x00009914, 0x000007d0, 0x000007d0, 0x00000898, 0x00000898, 0x000007d0},
41 {0x00009918, 0x0000000a, 0x00000014, 0x00000016, 0x0000000b, 0x00000016},
42 {0x00009924, 0xd00a8a07, 0xd00a8a07, 0xd00a8a0d, 0xd00a8a0d, 0xd00a8a0d},
43 {0x00009944, 0xdfbc1010, 0xdfbc1010, 0xdfbc1010, 0xdfbc1010, 0xdfbc1010},
44 {0x00009960, 0x00000010, 0x00000010, 0x00000010, 0x00000010, 0x00000010},
45 {0x0000a960, 0x00000010, 0x00000010, 0x00000010, 0x00000010, 0x00000010},
46 {0x00009964, 0x00000210, 0x00000210, 0x00000210, 0x00000210, 0x00000210},
47 {0x0000c9b8, 0x0000001a, 0x0000001a, 0x0000001a, 0x0000001a, 0x0000001a},
48 {0x0000c9bc, 0x00000600, 0x00000600, 0x00000c00, 0x00000c00, 0x00000c00},
49 {0x000099c0, 0x05eea6d4, 0x05eea6d4, 0x05eea6d4, 0x05eea6d4, 0x05eea6d4},
50 {0x000099c4, 0x06336f77, 0x06336f77, 0x06336f77, 0x06336f77, 0x06336f77},
51 {0x000099c8, 0x60f6532c, 0x60f6532c, 0x60f6532c, 0x60f6532c, 0x60f6532c},
52 {0x000099cc, 0x08f186c8, 0x08f186c8, 0x08f186c8, 0x08f186c8, 0x08f186c8},
53 {0x000099d0, 0x00046384, 0x00046384, 0x00046384, 0x00046384, 0x00046384},
54 {0x000099d4, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
55 {0x000099d8, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
56 {0x00009a00, 0x00008184, 0x00008184, 0x00000214, 0x00000214, 0x00000214},
57 {0x00009a04, 0x00008188, 0x00008188, 0x00000218, 0x00000218, 0x00000218},
58 {0x00009a08, 0x0000818c, 0x0000818c, 0x00000224, 0x00000224, 0x00000224},
59 {0x00009a0c, 0x00008190, 0x00008190, 0x00000228, 0x00000228, 0x00000228},
60 {0x00009a10, 0x00008194, 0x00008194, 0x0000022c, 0x0000022c, 0x0000022c},
61 {0x00009a14, 0x00008200, 0x00008200, 0x00000230, 0x00000230, 0x00000230},
62 {0x00009a18, 0x00008204, 0x00008204, 0x000002a4, 0x000002a4, 0x000002a4},
63 {0x00009a1c, 0x00008208, 0x00008208, 0x000002a8, 0x000002a8, 0x000002a8},
64 {0x00009a20, 0x0000820c, 0x0000820c, 0x000002ac, 0x000002ac, 0x000002ac},
65 {0x00009a24, 0x00008210, 0x00008210, 0x000002b0, 0x000002b0, 0x000002b0},
66 {0x00009a28, 0x00008214, 0x00008214, 0x000002b4, 0x000002b4, 0x000002b4},
67 {0x00009a2c, 0x00008280, 0x00008280, 0x000002b8, 0x000002b8, 0x000002b8},
68 {0x00009a30, 0x00008284, 0x00008284, 0x00000390, 0x00000390, 0x00000390},
69 {0x00009a34, 0x00008288, 0x00008288, 0x00000394, 0x00000394, 0x00000394},
70 {0x00009a38, 0x0000828c, 0x0000828c, 0x00000398, 0x00000398, 0x00000398},
71 {0x00009a3c, 0x00008290, 0x00008290, 0x00000334, 0x00000334, 0x00000334},
72 {0x00009a40, 0x00008300, 0x00008300, 0x00000338, 0x00000338, 0x00000338},
73 {0x00009a44, 0x00008304, 0x00008304, 0x000003ac, 0x000003ac, 0x000003ac},
74 {0x00009a48, 0x00008308, 0x00008308, 0x000003b0, 0x000003b0, 0x000003b0},
75 {0x00009a4c, 0x0000830c, 0x0000830c, 0x000003b4, 0x000003b4, 0x000003b4},
76 {0x00009a50, 0x00008310, 0x00008310, 0x000003b8, 0x000003b8, 0x000003b8},
77 {0x00009a54, 0x00008314, 0x00008314, 0x000003a5, 0x000003a5, 0x000003a5},
78 {0x00009a58, 0x00008380, 0x00008380, 0x000003a9, 0x000003a9, 0x000003a9},
79 {0x00009a5c, 0x00008384, 0x00008384, 0x000003ad, 0x000003ad, 0x000003ad},
80 {0x00009a60, 0x00008388, 0x00008388, 0x00008194, 0x00008194, 0x00008194},
81 {0x00009a64, 0x0000838c, 0x0000838c, 0x000081a0, 0x000081a0, 0x000081a0},
82 {0x00009a68, 0x00008390, 0x00008390, 0x0000820c, 0x0000820c, 0x0000820c},
83 {0x00009a6c, 0x00008394, 0x00008394, 0x000081a8, 0x000081a8, 0x000081a8},
84 {0x00009a70, 0x0000a380, 0x0000a380, 0x00008284, 0x00008284, 0x00008284},
85 {0x00009a74, 0x0000a384, 0x0000a384, 0x00008288, 0x00008288, 0x00008288},
86 {0x00009a78, 0x0000a388, 0x0000a388, 0x00008224, 0x00008224, 0x00008224},
87 {0x00009a7c, 0x0000a38c, 0x0000a38c, 0x00008290, 0x00008290, 0x00008290},
88 {0x00009a80, 0x0000a390, 0x0000a390, 0x00008300, 0x00008300, 0x00008300},
89 {0x00009a84, 0x0000a394, 0x0000a394, 0x00008304, 0x00008304, 0x00008304},
90 {0x00009a88, 0x0000a780, 0x0000a780, 0x00008308, 0x00008308, 0x00008308},
91 {0x00009a8c, 0x0000a784, 0x0000a784, 0x0000830c, 0x0000830c, 0x0000830c},
92 {0x00009a90, 0x0000a788, 0x0000a788, 0x00008380, 0x00008380, 0x00008380},
93 {0x00009a94, 0x0000a78c, 0x0000a78c, 0x00008384, 0x00008384, 0x00008384},
94 {0x00009a98, 0x0000a790, 0x0000a790, 0x00008700, 0x00008700, 0x00008700},
95 {0x00009a9c, 0x0000a794, 0x0000a794, 0x00008704, 0x00008704, 0x00008704},
96 {0x00009aa0, 0x0000ab84, 0x0000ab84, 0x00008708, 0x00008708, 0x00008708},
97 {0x00009aa4, 0x0000ab88, 0x0000ab88, 0x0000870c, 0x0000870c, 0x0000870c},
98 {0x00009aa8, 0x0000ab8c, 0x0000ab8c, 0x00008780, 0x00008780, 0x00008780},
99 {0x00009aac, 0x0000ab90, 0x0000ab90, 0x00008784, 0x00008784, 0x00008784},
100 {0x00009ab0, 0x0000ab94, 0x0000ab94, 0x00008b00, 0x00008b00, 0x00008b00},
101 {0x00009ab4, 0x0000af80, 0x0000af80, 0x00008b04, 0x00008b04, 0x00008b04},
102 {0x00009ab8, 0x0000af84, 0x0000af84, 0x00008b08, 0x00008b08, 0x00008b08},
103 {0x00009abc, 0x0000af88, 0x0000af88, 0x00008b0c, 0x00008b0c, 0x00008b0c},
104 {0x00009ac0, 0x0000af8c, 0x0000af8c, 0x00008b80, 0x00008b80, 0x00008b80},
105 {0x00009ac4, 0x0000af90, 0x0000af90, 0x00008b84, 0x00008b84, 0x00008b84},
106 {0x00009ac8, 0x0000af94, 0x0000af94, 0x00008b88, 0x00008b88, 0x00008b88},
107 {0x00009acc, 0x0000b380, 0x0000b380, 0x00008b8c, 0x00008b8c, 0x00008b8c},
108 {0x00009ad0, 0x0000b384, 0x0000b384, 0x00008b90, 0x00008b90, 0x00008b90},
109 {0x00009ad4, 0x0000b388, 0x0000b388, 0x00008f80, 0x00008f80, 0x00008f80},
110 {0x00009ad8, 0x0000b38c, 0x0000b38c, 0x00008f84, 0x00008f84, 0x00008f84},
111 {0x00009adc, 0x0000b390, 0x0000b390, 0x00008f88, 0x00008f88, 0x00008f88},
112 {0x00009ae0, 0x0000b394, 0x0000b394, 0x00008f8c, 0x00008f8c, 0x00008f8c},
113 {0x00009ae4, 0x0000b398, 0x0000b398, 0x00008f90, 0x00008f90, 0x00008f90},
114 {0x00009ae8, 0x0000b780, 0x0000b780, 0x0000930c, 0x0000930c, 0x0000930c},
115 {0x00009aec, 0x0000b784, 0x0000b784, 0x00009310, 0x00009310, 0x00009310},
116 {0x00009af0, 0x0000b788, 0x0000b788, 0x00009384, 0x00009384, 0x00009384},
117 {0x00009af4, 0x0000b78c, 0x0000b78c, 0x00009388, 0x00009388, 0x00009388},
118 {0x00009af8, 0x0000b790, 0x0000b790, 0x00009324, 0x00009324, 0x00009324},
119 {0x00009afc, 0x0000b794, 0x0000b794, 0x00009704, 0x00009704, 0x00009704},
120 {0x00009b00, 0x0000b798, 0x0000b798, 0x000096a4, 0x000096a4, 0x000096a4},
121 {0x00009b04, 0x0000d784, 0x0000d784, 0x000096a8, 0x000096a8, 0x000096a8},
122 {0x00009b08, 0x0000d788, 0x0000d788, 0x00009710, 0x00009710, 0x00009710},
123 {0x00009b0c, 0x0000d78c, 0x0000d78c, 0x00009714, 0x00009714, 0x00009714},
124 {0x00009b10, 0x0000d790, 0x0000d790, 0x00009720, 0x00009720, 0x00009720},
125 {0x00009b14, 0x0000f780, 0x0000f780, 0x00009724, 0x00009724, 0x00009724},
126 {0x00009b18, 0x0000f784, 0x0000f784, 0x00009728, 0x00009728, 0x00009728},
127 {0x00009b1c, 0x0000f788, 0x0000f788, 0x0000972c, 0x0000972c, 0x0000972c},
128 {0x00009b20, 0x0000f78c, 0x0000f78c, 0x000097a0, 0x000097a0, 0x000097a0},
129 {0x00009b24, 0x0000f790, 0x0000f790, 0x000097a4, 0x000097a4, 0x000097a4},
130 {0x00009b28, 0x0000f794, 0x0000f794, 0x000097a8, 0x000097a8, 0x000097a8},
131 {0x00009b2c, 0x0000f7a4, 0x0000f7a4, 0x000097b0, 0x000097b0, 0x000097b0},
132 {0x00009b30, 0x0000f7a8, 0x0000f7a8, 0x000097b4, 0x000097b4, 0x000097b4},
133 {0x00009b34, 0x0000f7ac, 0x0000f7ac, 0x000097b8, 0x000097b8, 0x000097b8},
134 {0x00009b38, 0x0000f7b0, 0x0000f7b0, 0x000097a5, 0x000097a5, 0x000097a5},
135 {0x00009b3c, 0x0000f7b4, 0x0000f7b4, 0x000097a9, 0x000097a9, 0x000097a9},
136 {0x00009b40, 0x0000f7a1, 0x0000f7a1, 0x000097ad, 0x000097ad, 0x000097ad},
137 {0x00009b44, 0x0000f7a5, 0x0000f7a5, 0x000097b1, 0x000097b1, 0x000097b1},
138 {0x00009b48, 0x0000f7a9, 0x0000f7a9, 0x000097b5, 0x000097b5, 0x000097b5},
139 {0x00009b4c, 0x0000f7ad, 0x0000f7ad, 0x000097b9, 0x000097b9, 0x000097b9},
140 {0x00009b50, 0x0000f7b1, 0x0000f7b1, 0x000097c5, 0x000097c5, 0x000097c5},
141 {0x00009b54, 0x0000f7b5, 0x0000f7b5, 0x000097c9, 0x000097c9, 0x000097c9},
142 {0x00009b58, 0x0000f7c5, 0x0000f7c5, 0x000097d1, 0x000097d1, 0x000097d1},
143 {0x00009b5c, 0x0000f7c9, 0x0000f7c9, 0x000097d5, 0x000097d5, 0x000097d5},
144 {0x00009b60, 0x0000f7cd, 0x0000f7cd, 0x000097d9, 0x000097d9, 0x000097d9},
145 {0x00009b64, 0x0000f7d1, 0x0000f7d1, 0x000097c6, 0x000097c6, 0x000097c6},
146 {0x00009b68, 0x0000f7d5, 0x0000f7d5, 0x000097ca, 0x000097ca, 0x000097ca},
147 {0x00009b6c, 0x0000f7c2, 0x0000f7c2, 0x000097ce, 0x000097ce, 0x000097ce},
148 {0x00009b70, 0x0000f7c6, 0x0000f7c6, 0x000097d2, 0x000097d2, 0x000097d2},
149 {0x00009b74, 0x0000f7ca, 0x0000f7ca, 0x000097d6, 0x000097d6, 0x000097d6},
150 {0x00009b78, 0x0000f7ce, 0x0000f7ce, 0x000097c3, 0x000097c3, 0x000097c3},
151 {0x00009b7c, 0x0000f7d2, 0x0000f7d2, 0x000097c7, 0x000097c7, 0x000097c7},
152 {0x00009b80, 0x0000f7d6, 0x0000f7d6, 0x000097cb, 0x000097cb, 0x000097cb},
153 {0x00009b84, 0x0000f7c3, 0x0000f7c3, 0x000097cf, 0x000097cf, 0x000097cf},
154 {0x00009b88, 0x0000f7c7, 0x0000f7c7, 0x000097d7, 0x000097d7, 0x000097d7},
155 {0x00009b8c, 0x0000f7cb, 0x0000f7cb, 0x000097db, 0x000097db, 0x000097db},
156 {0x00009b90, 0x0000f7d3, 0x0000f7d3, 0x000097db, 0x000097db, 0x000097db},
157 {0x00009b94, 0x0000f7d7, 0x0000f7d7, 0x000097db, 0x000097db, 0x000097db},
158 {0x00009b98, 0x0000f7db, 0x0000f7db, 0x000097db, 0x000097db, 0x000097db},
159 {0x00009b9c, 0x0000f7db, 0x0000f7db, 0x000097db, 0x000097db, 0x000097db},
160 {0x00009ba0, 0x0000f7db, 0x0000f7db, 0x000097db, 0x000097db, 0x000097db},
161 {0x00009ba4, 0x0000f7db, 0x0000f7db, 0x000097db, 0x000097db, 0x000097db},
162 {0x00009ba8, 0x0000f7db, 0x0000f7db, 0x000097db, 0x000097db, 0x000097db},
163 {0x00009bac, 0x0000f7db, 0x0000f7db, 0x000097db, 0x000097db, 0x000097db},
164 {0x00009bb0, 0x0000f7db, 0x0000f7db, 0x000097db, 0x000097db, 0x000097db},
165 {0x00009bb4, 0x0000f7db, 0x0000f7db, 0x000097db, 0x000097db, 0x000097db},
166 {0x00009bb8, 0x0000f7db, 0x0000f7db, 0x000097db, 0x000097db, 0x000097db},
167 {0x00009bbc, 0x0000f7db, 0x0000f7db, 0x000097db, 0x000097db, 0x000097db},
168 {0x00009bc0, 0x0000f7db, 0x0000f7db, 0x000097db, 0x000097db, 0x000097db},
169 {0x00009bc4, 0x0000f7db, 0x0000f7db, 0x000097db, 0x000097db, 0x000097db},
170 {0x00009bc8, 0x0000f7db, 0x0000f7db, 0x000097db, 0x000097db, 0x000097db},
171 {0x00009bcc, 0x0000f7db, 0x0000f7db, 0x000097db, 0x000097db, 0x000097db},
172 {0x00009bd0, 0x0000f7db, 0x0000f7db, 0x000097db, 0x000097db, 0x000097db},
173 {0x00009bd4, 0x0000f7db, 0x0000f7db, 0x000097db, 0x000097db, 0x000097db},
174 {0x00009bd8, 0x0000f7db, 0x0000f7db, 0x000097db, 0x000097db, 0x000097db},
175 {0x00009bdc, 0x0000f7db, 0x0000f7db, 0x000097db, 0x000097db, 0x000097db},
176 {0x00009be0, 0x0000f7db, 0x0000f7db, 0x000097db, 0x000097db, 0x000097db},
177 {0x00009be4, 0x0000f7db, 0x0000f7db, 0x000097db, 0x000097db, 0x000097db},
178 {0x00009be8, 0x0000f7db, 0x0000f7db, 0x000097db, 0x000097db, 0x000097db},
179 {0x00009bec, 0x0000f7db, 0x0000f7db, 0x000097db, 0x000097db, 0x000097db},
180 {0x00009bf0, 0x0000f7db, 0x0000f7db, 0x000097db, 0x000097db, 0x000097db},
181 {0x00009bf4, 0x0000f7db, 0x0000f7db, 0x000097db, 0x000097db, 0x000097db},
182 {0x00009bf8, 0x0000f7db, 0x0000f7db, 0x000097db, 0x000097db, 0x000097db},
183 {0x00009bfc, 0x0000f7db, 0x0000f7db, 0x000097db, 0x000097db, 0x000097db},
184 {0x0000a204, 0x00000444, 0x00000444, 0x00000444, 0x00000444, 0x00000444},
185 {0x0000a208, 0x803e4788, 0x803e4788, 0x803e4788, 0x803e4788, 0x803e4788},
186 {0x0000a20c, 0x000c6019, 0x000c6019, 0x000c6019, 0x000c6019, 0x000c6019},
187 {0x0000b20c, 0x000c6019, 0x000c6019, 0x000c6019, 0x000c6019, 0x000c6019},
188 {0x0000a21c, 0x1883800a, 0x1883800a, 0x1883800a, 0x1883800a, 0x1883800a},
189 {0x0000a230, 0x00000000, 0x00000000, 0x00000210, 0x00000108, 0x00000000},
190 {0x0000a274, 0x0a19c652, 0x0a19c652, 0x0a1aa652, 0x0a1aa652, 0x0a1aa652},
191 {0x0000a300, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
192 {0x0000a304, 0x00003002, 0x00003002, 0x00003002, 0x00003002, 0x00003002},
193 {0x0000a308, 0x00006004, 0x00006004, 0x00008009, 0x00008009, 0x00008009},
194 {0x0000a30c, 0x0000a006, 0x0000a006, 0x0000b00b, 0x0000b00b, 0x0000b00b},
195 {0x0000a310, 0x0000e012, 0x0000e012, 0x0000e012, 0x0000e012, 0x0000e012},
196 {0x0000a314, 0x00011014, 0x00011014, 0x00012048, 0x00012048, 0x00012048},
197 {0x0000a318, 0x0001504a, 0x0001504a, 0x0001604a, 0x0001604a, 0x0001604a},
198 {0x0000a31c, 0x0001904c, 0x0001904c, 0x0001a211, 0x0001a211, 0x0001a211},
199 {0x0000a320, 0x0001c04e, 0x0001c04e, 0x0001e213, 0x0001e213, 0x0001e213},
200 {0x0000a324, 0x00020092, 0x00020092, 0x0002121b, 0x0002121b, 0x0002121b},
201 {0x0000a328, 0x0002410a, 0x0002410a, 0x00024412, 0x00024412, 0x00024412},
202 {0x0000a32c, 0x0002710c, 0x0002710c, 0x00028414, 0x00028414, 0x00028414},
203 {0x0000a330, 0x0002b18b, 0x0002b18b, 0x0002b44a, 0x0002b44a, 0x0002b44a},
204 {0x0000a334, 0x0002e1cc, 0x0002e1cc, 0x00030649, 0x00030649, 0x00030649},
205 {0x0000a338, 0x000321ec, 0x000321ec, 0x0003364b, 0x0003364b, 0x0003364b},
206 {0x0000a33c, 0x000321ec, 0x000321ec, 0x00038a49, 0x00038a49, 0x00038a49},
207 {0x0000a340, 0x000321ec, 0x000321ec, 0x0003be48, 0x0003be48, 0x0003be48},
208 {0x0000a344, 0x000321ec, 0x000321ec, 0x0003ee4a, 0x0003ee4a, 0x0003ee4a},
209 {0x0000a348, 0x000321ec, 0x000321ec, 0x00042e88, 0x00042e88, 0x00042e88},
210 {0x0000a34c, 0x000321ec, 0x000321ec, 0x00046e8a, 0x00046e8a, 0x00046e8a},
211 {0x0000a350, 0x000321ec, 0x000321ec, 0x00049ec9, 0x00049ec9, 0x00049ec9},
212 {0x0000a354, 0x000321ec, 0x000321ec, 0x0004bf42, 0x0004bf42, 0x0004bf42},
213 {0x0000784c, 0x0e4f048c, 0x0e4f048c, 0x0e4d048c, 0x0e4d048c, 0x0e4d048c},
214 {0x00007854, 0x12031828, 0x12031828, 0x12035828, 0x12035828, 0x12035828},
215 {0x00007870, 0x807ec400, 0x807ec400, 0x807ec000, 0x807ec000, 0x807ec000},
216 {0x0000788c, 0x00010000, 0x00010000, 0x00110000, 0x00110000, 0x00110000},
217};
218
219static const u32 ar9280Common_9280[][2] = {
220 /* Addr allmodes */
221 {0x0000000c, 0x00000000},
222 {0x00000030, 0x00020015},
223 {0x00000034, 0x00000005},
224 {0x00000040, 0x00000000},
225 {0x00000044, 0x00000008},
226 {0x00000048, 0x00000008},
227 {0x0000004c, 0x00000010},
228 {0x00000050, 0x00000000},
229 {0x00000054, 0x0000001f},
230 {0x00000800, 0x00000000},
231 {0x00000804, 0x00000000},
232 {0x00000808, 0x00000000},
233 {0x0000080c, 0x00000000},
234 {0x00000810, 0x00000000},
235 {0x00000814, 0x00000000},
236 {0x00000818, 0x00000000},
237 {0x0000081c, 0x00000000},
238 {0x00000820, 0x00000000},
239 {0x00000824, 0x00000000},
240 {0x00001040, 0x002ffc0f},
241 {0x00001044, 0x002ffc0f},
242 {0x00001048, 0x002ffc0f},
243 {0x0000104c, 0x002ffc0f},
244 {0x00001050, 0x002ffc0f},
245 {0x00001054, 0x002ffc0f},
246 {0x00001058, 0x002ffc0f},
247 {0x0000105c, 0x002ffc0f},
248 {0x00001060, 0x002ffc0f},
249 {0x00001064, 0x002ffc0f},
250 {0x00001230, 0x00000000},
251 {0x00001270, 0x00000000},
252 {0x00001038, 0x00000000},
253 {0x00001078, 0x00000000},
254 {0x000010b8, 0x00000000},
255 {0x000010f8, 0x00000000},
256 {0x00001138, 0x00000000},
257 {0x00001178, 0x00000000},
258 {0x000011b8, 0x00000000},
259 {0x000011f8, 0x00000000},
260 {0x00001238, 0x00000000},
261 {0x00001278, 0x00000000},
262 {0x000012b8, 0x00000000},
263 {0x000012f8, 0x00000000},
264 {0x00001338, 0x00000000},
265 {0x00001378, 0x00000000},
266 {0x000013b8, 0x00000000},
267 {0x000013f8, 0x00000000},
268 {0x00001438, 0x00000000},
269 {0x00001478, 0x00000000},
270 {0x000014b8, 0x00000000},
271 {0x000014f8, 0x00000000},
272 {0x00001538, 0x00000000},
273 {0x00001578, 0x00000000},
274 {0x000015b8, 0x00000000},
275 {0x000015f8, 0x00000000},
276 {0x00001638, 0x00000000},
277 {0x00001678, 0x00000000},
278 {0x000016b8, 0x00000000},
279 {0x000016f8, 0x00000000},
280 {0x00001738, 0x00000000},
281 {0x00001778, 0x00000000},
282 {0x000017b8, 0x00000000},
283 {0x000017f8, 0x00000000},
284 {0x0000103c, 0x00000000},
285 {0x0000107c, 0x00000000},
286 {0x000010bc, 0x00000000},
287 {0x000010fc, 0x00000000},
288 {0x0000113c, 0x00000000},
289 {0x0000117c, 0x00000000},
290 {0x000011bc, 0x00000000},
291 {0x000011fc, 0x00000000},
292 {0x0000123c, 0x00000000},
293 {0x0000127c, 0x00000000},
294 {0x000012bc, 0x00000000},
295 {0x000012fc, 0x00000000},
296 {0x0000133c, 0x00000000},
297 {0x0000137c, 0x00000000},
298 {0x000013bc, 0x00000000},
299 {0x000013fc, 0x00000000},
300 {0x0000143c, 0x00000000},
301 {0x0000147c, 0x00000000},
302 {0x00004030, 0x00000002},
303 {0x0000403c, 0x00000002},
304 {0x00004024, 0x0000001f},
305 {0x00007010, 0x00000033},
306 {0x00007038, 0x000004c2},
307 {0x00008004, 0x00000000},
308 {0x00008008, 0x00000000},
309 {0x0000800c, 0x00000000},
310 {0x00008018, 0x00000700},
311 {0x00008020, 0x00000000},
312 {0x00008038, 0x00000000},
313 {0x0000803c, 0x00000000},
314 {0x00008048, 0x40000000},
315 {0x00008054, 0x00000000},
316 {0x00008058, 0x00000000},
317 {0x0000805c, 0x000fc78f},
318 {0x00008060, 0x0000000f},
319 {0x00008064, 0x00000000},
320 {0x00008070, 0x00000000},
321 {0x000080c0, 0x2a82301a},
322 {0x000080c4, 0x05dc01e0},
323 {0x000080c8, 0x1f402710},
324 {0x000080cc, 0x01f40000},
325 {0x000080d0, 0x00001e00},
326 {0x000080d4, 0x00000000},
327 {0x000080d8, 0x00400000},
328 {0x000080e0, 0xffffffff},
329 {0x000080e4, 0x0000ffff},
330 {0x000080e8, 0x003f3f3f},
331 {0x000080ec, 0x00000000},
332 {0x000080f0, 0x00000000},
333 {0x000080f4, 0x00000000},
334 {0x000080f8, 0x00000000},
335 {0x000080fc, 0x00020000},
336 {0x00008100, 0x00020000},
337 {0x00008104, 0x00000001},
338 {0x00008108, 0x00000052},
339 {0x0000810c, 0x00000000},
340 {0x00008110, 0x00000168},
341 {0x00008118, 0x000100aa},
342 {0x0000811c, 0x00003210},
343 {0x00008120, 0x08f04800},
344 {0x00008124, 0x00000000},
345 {0x00008128, 0x00000000},
346 {0x0000812c, 0x00000000},
347 {0x00008130, 0x00000000},
348 {0x00008134, 0x00000000},
349 {0x00008138, 0x00000000},
350 {0x0000813c, 0x00000000},
351 {0x00008144, 0x00000000},
352 {0x00008168, 0x00000000},
353 {0x0000816c, 0x00000000},
354 {0x00008170, 0x32143320},
355 {0x00008174, 0xfaa4fa50},
356 {0x00008178, 0x00000100},
357 {0x0000817c, 0x00000000},
358 {0x000081c4, 0x00000000},
359 {0x000081d0, 0x00003210},
360 {0x000081ec, 0x00000000},
361 {0x000081f0, 0x00000000},
362 {0x000081f4, 0x00000000},
363 {0x000081f8, 0x00000000},
364 {0x000081fc, 0x00000000},
365 {0x00008200, 0x00000000},
366 {0x00008204, 0x00000000},
367 {0x00008208, 0x00000000},
368 {0x0000820c, 0x00000000},
369 {0x00008210, 0x00000000},
370 {0x00008214, 0x00000000},
371 {0x00008218, 0x00000000},
372 {0x0000821c, 0x00000000},
373 {0x00008220, 0x00000000},
374 {0x00008224, 0x00000000},
375 {0x00008228, 0x00000000},
376 {0x0000822c, 0x00000000},
377 {0x00008230, 0x00000000},
378 {0x00008234, 0x00000000},
379 {0x00008238, 0x00000000},
380 {0x0000823c, 0x00000000},
381 {0x00008240, 0x00100000},
382 {0x00008244, 0x0010f400},
383 {0x00008248, 0x00000100},
384 {0x0000824c, 0x0001e800},
385 {0x00008250, 0x00000000},
386 {0x00008254, 0x00000000},
387 {0x00008258, 0x00000000},
388 {0x0000825c, 0x400000ff},
389 {0x00008260, 0x00080922},
390 {0x00008270, 0x00000000},
391 {0x00008274, 0x40000000},
392 {0x00008278, 0x003e4180},
393 {0x0000827c, 0x00000000},
394 {0x00008284, 0x0000002c},
395 {0x00008288, 0x0000002c},
396 {0x0000828c, 0x00000000},
397 {0x00008294, 0x00000000},
398 {0x00008298, 0x00000000},
399 {0x00008300, 0x00000000},
400 {0x00008304, 0x00000000},
401 {0x00008308, 0x00000000},
402 {0x0000830c, 0x00000000},
403 {0x00008310, 0x00000000},
404 {0x00008314, 0x00000000},
405 {0x00008318, 0x00000000},
406 {0x00008328, 0x00000000},
407 {0x0000832c, 0x00000007},
408 {0x00008330, 0x00000302},
409 {0x00008334, 0x00000e00},
410 {0x00008338, 0x00000000},
411 {0x0000833c, 0x00000000},
412 {0x00008340, 0x000107ff},
413 {0x00008344, 0x00000000},
414 {0x00009808, 0x00000000},
415 {0x0000980c, 0xaf268e30},
416 {0x00009810, 0xfd14e000},
417 {0x00009814, 0x9c0a9f6b},
418 {0x0000981c, 0x00000000},
419 {0x0000982c, 0x0000a000},
420 {0x00009830, 0x00000000},
421 {0x0000983c, 0x00200400},
422 {0x00009840, 0x206a01ae},
423 {0x0000984c, 0x0040233c},
424 {0x0000a84c, 0x0040233c},
425 {0x00009854, 0x00000044},
426 {0x00009900, 0x00000000},
427 {0x00009904, 0x00000000},
428 {0x00009908, 0x00000000},
429 {0x0000990c, 0x00000000},
430 {0x0000991c, 0x10000fff},
431 {0x00009920, 0x04900000},
432 {0x0000a920, 0x04900000},
433 {0x00009928, 0x00000001},
434 {0x0000992c, 0x00000004},
435 {0x00009934, 0x1e1f2022},
436 {0x00009938, 0x0a0b0c0d},
437 {0x0000993c, 0x00000000},
438 {0x00009948, 0x9280c00a},
439 {0x0000994c, 0x00020028},
440 {0x00009954, 0xe250a51e},
441 {0x00009958, 0x3388ffff},
442 {0x00009940, 0x00781204},
443 {0x0000c95c, 0x004b6a8e},
444 {0x0000c968, 0x000003ce},
445 {0x00009970, 0x190fb514},
446 {0x00009974, 0x00000000},
447 {0x00009978, 0x00000001},
448 {0x0000997c, 0x00000000},
449 {0x00009980, 0x00000000},
450 {0x00009984, 0x00000000},
451 {0x00009988, 0x00000000},
452 {0x0000998c, 0x00000000},
453 {0x00009990, 0x00000000},
454 {0x00009994, 0x00000000},
455 {0x00009998, 0x00000000},
456 {0x0000999c, 0x00000000},
457 {0x000099a0, 0x00000000},
458 {0x000099a4, 0x00000001},
459 {0x000099a8, 0x201fff00},
460 {0x000099ac, 0x006f00c4},
461 {0x000099b0, 0x03051000},
462 {0x000099b4, 0x00000820},
463 {0x000099dc, 0x00000000},
464 {0x000099e0, 0x00000000},
465 {0x000099e4, 0xaaaaaaaa},
466 {0x000099e8, 0x3c466478},
467 {0x000099ec, 0x0cc80caa},
468 {0x000099fc, 0x00001042},
469 {0x0000a210, 0x4080a333},
470 {0x0000a214, 0x40206c10},
471 {0x0000a218, 0x009c4060},
472 {0x0000a220, 0x01834061},
473 {0x0000a224, 0x00000400},
474 {0x0000a228, 0x000003b5},
475 {0x0000a22c, 0x23277200},
476 {0x0000a234, 0x20202020},
477 {0x0000a238, 0x20202020},
478 {0x0000a23c, 0x13c889af},
479 {0x0000a240, 0x38490a20},
480 {0x0000a244, 0x00007bb6},
481 {0x0000a248, 0x0fff3ffc},
482 {0x0000a24c, 0x00000001},
483 {0x0000a250, 0x001da000},
484 {0x0000a254, 0x00000000},
485 {0x0000a258, 0x0cdbd380},
486 {0x0000a25c, 0x0f0f0f01},
487 {0x0000a260, 0xdfa91f01},
488 {0x0000a268, 0x00000000},
489 {0x0000a26c, 0x0ebae9c6},
490 {0x0000b26c, 0x0ebae9c6},
491 {0x0000d270, 0x00820820},
492 {0x0000a278, 0x1ce739ce},
493 {0x0000a27c, 0x050701ce},
494 {0x0000a358, 0x7999aa0f},
495 {0x0000d35c, 0x07ffffef},
496 {0x0000d360, 0x0fffffe7},
497 {0x0000d364, 0x17ffffe5},
498 {0x0000d368, 0x1fffffe4},
499 {0x0000d36c, 0x37ffffe3},
500 {0x0000d370, 0x3fffffe3},
501 {0x0000d374, 0x57ffffe3},
502 {0x0000d378, 0x5fffffe2},
503 {0x0000d37c, 0x7fffffe2},
504 {0x0000d380, 0x7f3c7bba},
505 {0x0000d384, 0xf3307ff0},
506 {0x0000a388, 0x0c000000},
507 {0x0000a38c, 0x20202020},
508 {0x0000a390, 0x20202020},
509 {0x0000a394, 0x1ce739ce},
510 {0x0000a398, 0x000001ce},
511 {0x0000a39c, 0x00000001},
512 {0x0000a3a0, 0x00000000},
513 {0x0000a3a4, 0x00000000},
514 {0x0000a3a8, 0x00000000},
515 {0x0000a3ac, 0x00000000},
516 {0x0000a3b0, 0x00000000},
517 {0x0000a3b4, 0x00000000},
518 {0x0000a3b8, 0x00000000},
519 {0x0000a3bc, 0x00000000},
520 {0x0000a3c0, 0x00000000},
521 {0x0000a3c4, 0x00000000},
522 {0x0000a3c8, 0x00000246},
523 {0x0000a3cc, 0x20202020},
524 {0x0000a3d0, 0x20202020},
525 {0x0000a3d4, 0x20202020},
526 {0x0000a3dc, 0x1ce739ce},
527 {0x0000a3e0, 0x000001ce},
528 {0x0000a3e4, 0x00000000},
529 {0x0000a3e8, 0x18c43433},
530 {0x0000a3ec, 0x00f38081},
531 {0x00007800, 0x00040000},
532 {0x00007804, 0xdb005012},
533 {0x00007808, 0x04924914},
534 {0x0000780c, 0x21084210},
535 {0x00007810, 0x6d801300},
536 {0x00007814, 0x0019beff},
537 {0x00007818, 0x07e40000},
538 {0x0000781c, 0x00492000},
539 {0x00007820, 0x92492480},
540 {0x00007824, 0x00040000},
541 {0x00007828, 0xdb005012},
542 {0x0000782c, 0x04924914},
543 {0x00007830, 0x21084210},
544 {0x00007834, 0x6d801300},
545 {0x00007838, 0x0019beff},
546 {0x0000783c, 0x07e40000},
547 {0x00007840, 0x00492000},
548 {0x00007844, 0x92492480},
549 {0x00007848, 0x00120000},
550 {0x00007850, 0x54214514},
551 {0x00007858, 0x92592692},
552 {0x00007860, 0x52802000},
553 {0x00007864, 0x0a8e370e},
554 {0x00007868, 0xc0102850},
555 {0x0000786c, 0x812d4000},
556 {0x00007874, 0x001b6db0},
557 {0x00007878, 0x00376b63},
558 {0x0000787c, 0x06db6db6},
559 {0x00007880, 0x006d8000},
560 {0x00007884, 0xffeffffe},
561 {0x00007888, 0xffeffffe},
562 {0x00007890, 0x00060aeb},
563 {0x00007894, 0x5a108000},
564 {0x00007898, 0x2a850160},
565};
566
567static const u32 ar9280Modes_9280_2[][6] = { 17static const u32 ar9280Modes_9280_2[][6] = {
568 {0x00001030, 0x00000230, 0x00000460, 0x000002c0, 0x00000160, 0x000001e0}, 18 {0x00001030, 0x00000230, 0x00000460, 0x000002c0, 0x00000160, 0x000001e0},
569 {0x00001070, 0x00000168, 0x000002d0, 0x00000318, 0x0000018c, 0x000001e0}, 19 {0x00001070, 0x00000168, 0x000002d0, 0x00000318, 0x0000018c, 0x000001e0},
@@ -1469,662 +919,6 @@ static const u32 ar9280PciePhy_clkreq_always_on_L1_9280[][2] = {
1469 {0x00004044, 0x00000000}, 919 {0x00004044, 0x00000000},
1470}; 920};
1471 921
1472static const u32 ar9285Modes_9285[][6] = {
1473 {0x00001030, 0x00000230, 0x00000460, 0x000002c0, 0x00000160, 0x000001e0},
1474 {0x00001070, 0x00000168, 0x000002d0, 0x00000318, 0x0000018c, 0x000001e0},
1475 {0x000010b0, 0x00000e60, 0x00001cc0, 0x00007c70, 0x00003e38, 0x00001180},
1476 {0x000010f0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000008},
1477 {0x00008014, 0x03e803e8, 0x07d007d0, 0x10801600, 0x08400b00, 0x06e006e0},
1478 {0x0000801c, 0x128d8027, 0x128d804f, 0x12e00057, 0x12e0002b, 0x0988004f},
1479 {0x00008318, 0x00003e80, 0x00007d00, 0x00006880, 0x00003440, 0x00006880},
1480 {0x00009804, 0x00000300, 0x000003c4, 0x000003c4, 0x00000300, 0x00000303},
1481 {0x00009820, 0x02020200, 0x02020200, 0x02020200, 0x02020200, 0x02020200},
1482 {0x00009824, 0x00000e0e, 0x00000e0e, 0x00000e0e, 0x00000e0e, 0x00000e0e},
1483 {0x00009828, 0x0a020001, 0x0a020001, 0x0a020001, 0x0a020001, 0x0a020001},
1484 {0x00009834, 0x00000e0e, 0x00000e0e, 0x00000e0e, 0x00000e0e, 0x00000e0e},
1485 {0x00009838, 0x00000007, 0x00000007, 0x00000007, 0x00000007, 0x00000007},
1486 {0x00009840, 0x206a012e, 0x206a012e, 0x206a012e, 0x206a012e, 0x206a012e},
1487 {0x00009844, 0x0372161e, 0x0372161e, 0x03720020, 0x03720020, 0x037216a0},
1488 {0x00009848, 0x00001066, 0x00001066, 0x0000004e, 0x0000004e, 0x00001059},
1489 {0x00009850, 0x6d4000e2, 0x6d4000e2, 0x6d4000e2, 0x6d4000e2, 0x6d4000e2},
1490 {0x00009858, 0x7ec84d2e, 0x7ec84d2e, 0x7ec84d2e, 0x7ec84d2e, 0x7ec84d2e},
1491 {0x0000985c, 0x3139605e, 0x3139605e, 0x3136605e, 0x3136605e, 0x3139605e},
1492 {0x00009860, 0x00058d18, 0x00058d18, 0x00058d20, 0x00058d20, 0x00058d18},
1493 {0x00009864, 0x0000fe00, 0x0000fe00, 0x0001ce00, 0x0001ce00, 0x0001ce00},
1494 {0x00009868, 0x5ac640d0, 0x5ac640d0, 0x5ac640d0, 0x5ac640d0, 0x5ac640d0},
1495 {0x0000986c, 0x06903081, 0x06903081, 0x06903881, 0x06903881, 0x06903881},
1496 {0x00009914, 0x000007d0, 0x00000fa0, 0x00001130, 0x00000898, 0x000007d0},
1497 {0x00009918, 0x0000000a, 0x00000014, 0x00000016, 0x0000000b, 0x00000016},
1498 {0x00009924, 0xd00a8007, 0xd00a8007, 0xd00a800d, 0xd00a800d, 0xd00a800d},
1499 {0x00009944, 0xdfbc1010, 0xdfbc1010, 0xdfbc1020, 0xdfbc1020, 0xdfbc1010},
1500 {0x00009960, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
1501 {0x00009964, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
1502 {0x000099b8, 0x00cf4d1c, 0x00cf4d1c, 0x00cf4d1c, 0x00cf4d1c, 0x00cf4d1c},
1503 {0x000099bc, 0x00000600, 0x00000600, 0x00000c00, 0x00000c00, 0x00000c00},
1504 {0x000099c0, 0x05eea6d4, 0x05eea6d4, 0x05eea6d4, 0x05eea6d4, 0x05eea6d4},
1505 {0x000099c4, 0x06336f77, 0x06336f77, 0x06336f77, 0x06336f77, 0x06336f77},
1506 {0x000099c8, 0x60f65329, 0x60f65329, 0x60f65329, 0x60f65329, 0x60f65329},
1507 {0x000099cc, 0x08f186c8, 0x08f186c8, 0x08f186c8, 0x08f186c8, 0x08f186c8},
1508 {0x000099d0, 0x00046384, 0x00046384, 0x00046384, 0x00046384, 0x00046384},
1509 {0x000099d4, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
1510 {0x000099d8, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
1511 {0x00009a00, 0x00000000, 0x00000000, 0x00068084, 0x00068084, 0x00000000},
1512 {0x00009a04, 0x00000000, 0x00000000, 0x00068088, 0x00068088, 0x00000000},
1513 {0x00009a08, 0x00000000, 0x00000000, 0x0006808c, 0x0006808c, 0x00000000},
1514 {0x00009a0c, 0x00000000, 0x00000000, 0x00068100, 0x00068100, 0x00000000},
1515 {0x00009a10, 0x00000000, 0x00000000, 0x00068104, 0x00068104, 0x00000000},
1516 {0x00009a14, 0x00000000, 0x00000000, 0x00068108, 0x00068108, 0x00000000},
1517 {0x00009a18, 0x00000000, 0x00000000, 0x0006810c, 0x0006810c, 0x00000000},
1518 {0x00009a1c, 0x00000000, 0x00000000, 0x00068110, 0x00068110, 0x00000000},
1519 {0x00009a20, 0x00000000, 0x00000000, 0x00068114, 0x00068114, 0x00000000},
1520 {0x00009a24, 0x00000000, 0x00000000, 0x00068180, 0x00068180, 0x00000000},
1521 {0x00009a28, 0x00000000, 0x00000000, 0x00068184, 0x00068184, 0x00000000},
1522 {0x00009a2c, 0x00000000, 0x00000000, 0x00068188, 0x00068188, 0x00000000},
1523 {0x00009a30, 0x00000000, 0x00000000, 0x0006818c, 0x0006818c, 0x00000000},
1524 {0x00009a34, 0x00000000, 0x00000000, 0x00068190, 0x00068190, 0x00000000},
1525 {0x00009a38, 0x00000000, 0x00000000, 0x00068194, 0x00068194, 0x00000000},
1526 {0x00009a3c, 0x00000000, 0x00000000, 0x000681a0, 0x000681a0, 0x00000000},
1527 {0x00009a40, 0x00000000, 0x00000000, 0x0006820c, 0x0006820c, 0x00000000},
1528 {0x00009a44, 0x00000000, 0x00000000, 0x000681a8, 0x000681a8, 0x00000000},
1529 {0x00009a48, 0x00000000, 0x00000000, 0x00068284, 0x00068284, 0x00000000},
1530 {0x00009a4c, 0x00000000, 0x00000000, 0x00068288, 0x00068288, 0x00000000},
1531 {0x00009a50, 0x00000000, 0x00000000, 0x00068220, 0x00068220, 0x00000000},
1532 {0x00009a54, 0x00000000, 0x00000000, 0x00068290, 0x00068290, 0x00000000},
1533 {0x00009a58, 0x00000000, 0x00000000, 0x00068300, 0x00068300, 0x00000000},
1534 {0x00009a5c, 0x00000000, 0x00000000, 0x00068304, 0x00068304, 0x00000000},
1535 {0x00009a60, 0x00000000, 0x00000000, 0x00068308, 0x00068308, 0x00000000},
1536 {0x00009a64, 0x00000000, 0x00000000, 0x0006830c, 0x0006830c, 0x00000000},
1537 {0x00009a68, 0x00000000, 0x00000000, 0x00068380, 0x00068380, 0x00000000},
1538 {0x00009a6c, 0x00000000, 0x00000000, 0x00068384, 0x00068384, 0x00000000},
1539 {0x00009a70, 0x00000000, 0x00000000, 0x00068700, 0x00068700, 0x00000000},
1540 {0x00009a74, 0x00000000, 0x00000000, 0x00068704, 0x00068704, 0x00000000},
1541 {0x00009a78, 0x00000000, 0x00000000, 0x00068708, 0x00068708, 0x00000000},
1542 {0x00009a7c, 0x00000000, 0x00000000, 0x0006870c, 0x0006870c, 0x00000000},
1543 {0x00009a80, 0x00000000, 0x00000000, 0x00068780, 0x00068780, 0x00000000},
1544 {0x00009a84, 0x00000000, 0x00000000, 0x00068784, 0x00068784, 0x00000000},
1545 {0x00009a88, 0x00000000, 0x00000000, 0x00068b04, 0x00068b04, 0x00000000},
1546 {0x00009a8c, 0x00000000, 0x00000000, 0x00068b08, 0x00068b08, 0x00000000},
1547 {0x00009a90, 0x00000000, 0x00000000, 0x00068b08, 0x00068b08, 0x00000000},
1548 {0x00009a94, 0x00000000, 0x00000000, 0x00068b0c, 0x00068b0c, 0x00000000},
1549 {0x00009a98, 0x00000000, 0x00000000, 0x00068b80, 0x00068b80, 0x00000000},
1550 {0x00009a9c, 0x00000000, 0x00000000, 0x00068b84, 0x00068b84, 0x00000000},
1551 {0x00009aa0, 0x00000000, 0x00000000, 0x00068b88, 0x00068b88, 0x00000000},
1552 {0x00009aa4, 0x00000000, 0x00000000, 0x00068b8c, 0x00068b8c, 0x00000000},
1553 {0x00009aa8, 0x00000000, 0x00000000, 0x000b8b90, 0x000b8b90, 0x00000000},
1554 {0x00009aac, 0x00000000, 0x00000000, 0x000b8f80, 0x000b8f80, 0x00000000},
1555 {0x00009ab0, 0x00000000, 0x00000000, 0x000b8f84, 0x000b8f84, 0x00000000},
1556 {0x00009ab4, 0x00000000, 0x00000000, 0x000b8f88, 0x000b8f88, 0x00000000},
1557 {0x00009ab8, 0x00000000, 0x00000000, 0x000b8f8c, 0x000b8f8c, 0x00000000},
1558 {0x00009abc, 0x00000000, 0x00000000, 0x000b8f90, 0x000b8f90, 0x00000000},
1559 {0x00009ac0, 0x00000000, 0x00000000, 0x000bb30c, 0x000bb30c, 0x00000000},
1560 {0x00009ac4, 0x00000000, 0x00000000, 0x000bb310, 0x000bb310, 0x00000000},
1561 {0x00009ac8, 0x00000000, 0x00000000, 0x000bb384, 0x000bb384, 0x00000000},
1562 {0x00009acc, 0x00000000, 0x00000000, 0x000bb388, 0x000bb388, 0x00000000},
1563 {0x00009ad0, 0x00000000, 0x00000000, 0x000bb324, 0x000bb324, 0x00000000},
1564 {0x00009ad4, 0x00000000, 0x00000000, 0x000bb704, 0x000bb704, 0x00000000},
1565 {0x00009ad8, 0x00000000, 0x00000000, 0x000f96a4, 0x000f96a4, 0x00000000},
1566 {0x00009adc, 0x00000000, 0x00000000, 0x000f96a8, 0x000f96a8, 0x00000000},
1567 {0x00009ae0, 0x00000000, 0x00000000, 0x000f9710, 0x000f9710, 0x00000000},
1568 {0x00009ae4, 0x00000000, 0x00000000, 0x000f9714, 0x000f9714, 0x00000000},
1569 {0x00009ae8, 0x00000000, 0x00000000, 0x000f9720, 0x000f9720, 0x00000000},
1570 {0x00009aec, 0x00000000, 0x00000000, 0x000f9724, 0x000f9724, 0x00000000},
1571 {0x00009af0, 0x00000000, 0x00000000, 0x000f9728, 0x000f9728, 0x00000000},
1572 {0x00009af4, 0x00000000, 0x00000000, 0x000f972c, 0x000f972c, 0x00000000},
1573 {0x00009af8, 0x00000000, 0x00000000, 0x000f97a0, 0x000f97a0, 0x00000000},
1574 {0x00009afc, 0x00000000, 0x00000000, 0x000f97a4, 0x000f97a4, 0x00000000},
1575 {0x00009b00, 0x00000000, 0x00000000, 0x000fb7a8, 0x000fb7a8, 0x00000000},
1576 {0x00009b04, 0x00000000, 0x00000000, 0x000fb7b0, 0x000fb7b0, 0x00000000},
1577 {0x00009b08, 0x00000000, 0x00000000, 0x000fb7b4, 0x000fb7b4, 0x00000000},
1578 {0x00009b0c, 0x00000000, 0x00000000, 0x000fb7b8, 0x000fb7b8, 0x00000000},
1579 {0x00009b10, 0x00000000, 0x00000000, 0x000fb7a5, 0x000fb7a5, 0x00000000},
1580 {0x00009b14, 0x00000000, 0x00000000, 0x000fb7a9, 0x000fb7a9, 0x00000000},
1581 {0x00009b18, 0x00000000, 0x00000000, 0x000fb7ad, 0x000fb7ad, 0x00000000},
1582 {0x00009b1c, 0x00000000, 0x00000000, 0x000fb7b1, 0x000fb7b1, 0x00000000},
1583 {0x00009b20, 0x00000000, 0x00000000, 0x000fb7b5, 0x000fb7b5, 0x00000000},
1584 {0x00009b24, 0x00000000, 0x00000000, 0x000fb7b9, 0x000fb7b9, 0x00000000},
1585 {0x00009b28, 0x00000000, 0x00000000, 0x000fb7c5, 0x000fb7c5, 0x00000000},
1586 {0x00009b2c, 0x00000000, 0x00000000, 0x000fb7c9, 0x000fb7c9, 0x00000000},
1587 {0x00009b30, 0x00000000, 0x00000000, 0x000fb7d1, 0x000fb7d1, 0x00000000},
1588 {0x00009b34, 0x00000000, 0x00000000, 0x000fb7d5, 0x000fb7d5, 0x00000000},
1589 {0x00009b38, 0x00000000, 0x00000000, 0x000fb7d9, 0x000fb7d9, 0x00000000},
1590 {0x00009b3c, 0x00000000, 0x00000000, 0x000fb7c6, 0x000fb7c6, 0x00000000},
1591 {0x00009b40, 0x00000000, 0x00000000, 0x000fb7ca, 0x000fb7ca, 0x00000000},
1592 {0x00009b44, 0x00000000, 0x00000000, 0x000fb7ce, 0x000fb7ce, 0x00000000},
1593 {0x00009b48, 0x00000000, 0x00000000, 0x000fb7d2, 0x000fb7d2, 0x00000000},
1594 {0x00009b4c, 0x00000000, 0x00000000, 0x000fb7d6, 0x000fb7d6, 0x00000000},
1595 {0x00009b50, 0x00000000, 0x00000000, 0x000fb7c3, 0x000fb7c3, 0x00000000},
1596 {0x00009b54, 0x00000000, 0x00000000, 0x000fb7c7, 0x000fb7c7, 0x00000000},
1597 {0x00009b58, 0x00000000, 0x00000000, 0x000fb7cb, 0x000fb7cb, 0x00000000},
1598 {0x00009b5c, 0x00000000, 0x00000000, 0x000fb7cf, 0x000fb7cf, 0x00000000},
1599 {0x00009b60, 0x00000000, 0x00000000, 0x000fb7d7, 0x000fb7d7, 0x00000000},
1600 {0x00009b64, 0x00000000, 0x00000000, 0x000fb7db, 0x000fb7db, 0x00000000},
1601 {0x00009b68, 0x00000000, 0x00000000, 0x000fb7db, 0x000fb7db, 0x00000000},
1602 {0x00009b6c, 0x00000000, 0x00000000, 0x000fb7db, 0x000fb7db, 0x00000000},
1603 {0x00009b70, 0x00000000, 0x00000000, 0x000fb7db, 0x000fb7db, 0x00000000},
1604 {0x00009b74, 0x00000000, 0x00000000, 0x000fb7db, 0x000fb7db, 0x00000000},
1605 {0x00009b78, 0x00000000, 0x00000000, 0x000fb7db, 0x000fb7db, 0x00000000},
1606 {0x00009b7c, 0x00000000, 0x00000000, 0x000fb7db, 0x000fb7db, 0x00000000},
1607 {0x00009b80, 0x00000000, 0x00000000, 0x000fb7db, 0x000fb7db, 0x00000000},
1608 {0x00009b84, 0x00000000, 0x00000000, 0x000fb7db, 0x000fb7db, 0x00000000},
1609 {0x00009b88, 0x00000000, 0x00000000, 0x000fb7db, 0x000fb7db, 0x00000000},
1610 {0x00009b8c, 0x00000000, 0x00000000, 0x000fb7db, 0x000fb7db, 0x00000000},
1611 {0x00009b90, 0x00000000, 0x00000000, 0x000fb7db, 0x000fb7db, 0x00000000},
1612 {0x00009b94, 0x00000000, 0x00000000, 0x000fb7db, 0x000fb7db, 0x00000000},
1613 {0x00009b98, 0x00000000, 0x00000000, 0x000fb7db, 0x000fb7db, 0x00000000},
1614 {0x00009b9c, 0x00000000, 0x00000000, 0x000fb7db, 0x000fb7db, 0x00000000},
1615 {0x00009ba0, 0x00000000, 0x00000000, 0x000fb7db, 0x000fb7db, 0x00000000},
1616 {0x00009ba4, 0x00000000, 0x00000000, 0x000fb7db, 0x000fb7db, 0x00000000},
1617 {0x00009ba8, 0x00000000, 0x00000000, 0x000fb7db, 0x000fb7db, 0x00000000},
1618 {0x00009bac, 0x00000000, 0x00000000, 0x000fb7db, 0x000fb7db, 0x00000000},
1619 {0x00009bb0, 0x00000000, 0x00000000, 0x000fb7db, 0x000fb7db, 0x00000000},
1620 {0x00009bb4, 0x00000000, 0x00000000, 0x000fb7db, 0x000fb7db, 0x00000000},
1621 {0x00009bb8, 0x00000000, 0x00000000, 0x000fb7db, 0x000fb7db, 0x00000000},
1622 {0x00009bbc, 0x00000000, 0x00000000, 0x000fb7db, 0x000fb7db, 0x00000000},
1623 {0x00009bc0, 0x00000000, 0x00000000, 0x000fb7db, 0x000fb7db, 0x00000000},
1624 {0x00009bc4, 0x00000000, 0x00000000, 0x000fb7db, 0x000fb7db, 0x00000000},
1625 {0x00009bc8, 0x00000000, 0x00000000, 0x000fb7db, 0x000fb7db, 0x00000000},
1626 {0x00009bcc, 0x00000000, 0x00000000, 0x000fb7db, 0x000fb7db, 0x00000000},
1627 {0x00009bd0, 0x00000000, 0x00000000, 0x000fb7db, 0x000fb7db, 0x00000000},
1628 {0x00009bd4, 0x00000000, 0x00000000, 0x000fb7db, 0x000fb7db, 0x00000000},
1629 {0x00009bd8, 0x00000000, 0x00000000, 0x000fb7db, 0x000fb7db, 0x00000000},
1630 {0x00009bdc, 0x00000000, 0x00000000, 0x000fb7db, 0x000fb7db, 0x00000000},
1631 {0x00009be0, 0x00000000, 0x00000000, 0x000fb7db, 0x000fb7db, 0x00000000},
1632 {0x00009be4, 0x00000000, 0x00000000, 0x000fb7db, 0x000fb7db, 0x00000000},
1633 {0x00009be8, 0x00000000, 0x00000000, 0x000fb7db, 0x000fb7db, 0x00000000},
1634 {0x00009bec, 0x00000000, 0x00000000, 0x000fb7db, 0x000fb7db, 0x00000000},
1635 {0x00009bf0, 0x00000000, 0x00000000, 0x000fb7db, 0x000fb7db, 0x00000000},
1636 {0x00009bf4, 0x00000000, 0x00000000, 0x000fb7db, 0x000fb7db, 0x00000000},
1637 {0x00009bf8, 0x00000000, 0x00000000, 0x000fb7db, 0x000fb7db, 0x00000000},
1638 {0x00009bfc, 0x00000000, 0x00000000, 0x000fb7db, 0x000fb7db, 0x00000000},
1639 {0x0000aa00, 0x00000000, 0x00000000, 0x0006801c, 0x0006801c, 0x00000000},
1640 {0x0000aa04, 0x00000000, 0x00000000, 0x00068080, 0x00068080, 0x00000000},
1641 {0x0000aa08, 0x00000000, 0x00000000, 0x00068084, 0x00068084, 0x00000000},
1642 {0x0000aa0c, 0x00000000, 0x00000000, 0x00068088, 0x00068088, 0x00000000},
1643 {0x0000aa10, 0x00000000, 0x00000000, 0x0006808c, 0x0006808c, 0x00000000},
1644 {0x0000aa14, 0x00000000, 0x00000000, 0x00068100, 0x00068100, 0x00000000},
1645 {0x0000aa18, 0x00000000, 0x00000000, 0x00068104, 0x00068104, 0x00000000},
1646 {0x0000aa1c, 0x00000000, 0x00000000, 0x00068108, 0x00068108, 0x00000000},
1647 {0x0000aa20, 0x00000000, 0x00000000, 0x0006810c, 0x0006810c, 0x00000000},
1648 {0x0000aa24, 0x00000000, 0x00000000, 0x00068110, 0x00068110, 0x00000000},
1649 {0x0000aa28, 0x00000000, 0x00000000, 0x00068110, 0x00068110, 0x00000000},
1650 {0x0000aa2c, 0x00000000, 0x00000000, 0x00068180, 0x00068180, 0x00000000},
1651 {0x0000aa30, 0x00000000, 0x00000000, 0x00068184, 0x00068184, 0x00000000},
1652 {0x0000aa34, 0x00000000, 0x00000000, 0x00068188, 0x00068188, 0x00000000},
1653 {0x0000aa38, 0x00000000, 0x00000000, 0x0006818c, 0x0006818c, 0x00000000},
1654 {0x0000aa3c, 0x00000000, 0x00000000, 0x00068190, 0x00068190, 0x00000000},
1655 {0x0000aa40, 0x00000000, 0x00000000, 0x00068194, 0x00068194, 0x00000000},
1656 {0x0000aa44, 0x00000000, 0x00000000, 0x000681a0, 0x000681a0, 0x00000000},
1657 {0x0000aa48, 0x00000000, 0x00000000, 0x0006820c, 0x0006820c, 0x00000000},
1658 {0x0000aa4c, 0x00000000, 0x00000000, 0x000681a8, 0x000681a8, 0x00000000},
1659 {0x0000aa50, 0x00000000, 0x00000000, 0x000681ac, 0x000681ac, 0x00000000},
1660 {0x0000aa54, 0x00000000, 0x00000000, 0x0006821c, 0x0006821c, 0x00000000},
1661 {0x0000aa58, 0x00000000, 0x00000000, 0x00068224, 0x00068224, 0x00000000},
1662 {0x0000aa5c, 0x00000000, 0x00000000, 0x00068290, 0x00068290, 0x00000000},
1663 {0x0000aa60, 0x00000000, 0x00000000, 0x00068300, 0x00068300, 0x00000000},
1664 {0x0000aa64, 0x00000000, 0x00000000, 0x00068308, 0x00068308, 0x00000000},
1665 {0x0000aa68, 0x00000000, 0x00000000, 0x0006830c, 0x0006830c, 0x00000000},
1666 {0x0000aa6c, 0x00000000, 0x00000000, 0x00068310, 0x00068310, 0x00000000},
1667 {0x0000aa70, 0x00000000, 0x00000000, 0x00068788, 0x00068788, 0x00000000},
1668 {0x0000aa74, 0x00000000, 0x00000000, 0x0006878c, 0x0006878c, 0x00000000},
1669 {0x0000aa78, 0x00000000, 0x00000000, 0x00068790, 0x00068790, 0x00000000},
1670 {0x0000aa7c, 0x00000000, 0x00000000, 0x00068794, 0x00068794, 0x00000000},
1671 {0x0000aa80, 0x00000000, 0x00000000, 0x00068798, 0x00068798, 0x00000000},
1672 {0x0000aa84, 0x00000000, 0x00000000, 0x0006879c, 0x0006879c, 0x00000000},
1673 {0x0000aa88, 0x00000000, 0x00000000, 0x00068b89, 0x00068b89, 0x00000000},
1674 {0x0000aa8c, 0x00000000, 0x00000000, 0x00068b8d, 0x00068b8d, 0x00000000},
1675 {0x0000aa90, 0x00000000, 0x00000000, 0x00068b91, 0x00068b91, 0x00000000},
1676 {0x0000aa94, 0x00000000, 0x00000000, 0x00068b95, 0x00068b95, 0x00000000},
1677 {0x0000aa98, 0x00000000, 0x00000000, 0x00068b99, 0x00068b99, 0x00000000},
1678 {0x0000aa9c, 0x00000000, 0x00000000, 0x00068ba5, 0x00068ba5, 0x00000000},
1679 {0x0000aaa0, 0x00000000, 0x00000000, 0x00068ba9, 0x00068ba9, 0x00000000},
1680 {0x0000aaa4, 0x00000000, 0x00000000, 0x00068bad, 0x00068bad, 0x00000000},
1681 {0x0000aaa8, 0x00000000, 0x00000000, 0x000b8b0c, 0x000b8b0c, 0x00000000},
1682 {0x0000aaac, 0x00000000, 0x00000000, 0x000b8f10, 0x000b8f10, 0x00000000},
1683 {0x0000aab0, 0x00000000, 0x00000000, 0x000b8f14, 0x000b8f14, 0x00000000},
1684 {0x0000aab4, 0x00000000, 0x00000000, 0x000b8f84, 0x000b8f84, 0x00000000},
1685 {0x0000aab8, 0x00000000, 0x00000000, 0x000b8f84, 0x000b8f84, 0x00000000},
1686 {0x0000aabc, 0x00000000, 0x00000000, 0x000b8f88, 0x000b8f88, 0x00000000},
1687 {0x0000aac0, 0x00000000, 0x00000000, 0x000bb380, 0x000bb380, 0x00000000},
1688 {0x0000aac4, 0x00000000, 0x00000000, 0x000bb384, 0x000bb384, 0x00000000},
1689 {0x0000aac8, 0x00000000, 0x00000000, 0x000bb388, 0x000bb388, 0x00000000},
1690 {0x0000aacc, 0x00000000, 0x00000000, 0x000bb38c, 0x000bb38c, 0x00000000},
1691 {0x0000aad0, 0x00000000, 0x00000000, 0x000bb394, 0x000bb394, 0x00000000},
1692 {0x0000aad4, 0x00000000, 0x00000000, 0x000bb798, 0x000bb798, 0x00000000},
1693 {0x0000aad8, 0x00000000, 0x00000000, 0x000f970c, 0x000f970c, 0x00000000},
1694 {0x0000aadc, 0x00000000, 0x00000000, 0x000f9710, 0x000f9710, 0x00000000},
1695 {0x0000aae0, 0x00000000, 0x00000000, 0x000f9714, 0x000f9714, 0x00000000},
1696 {0x0000aae4, 0x00000000, 0x00000000, 0x000f9718, 0x000f9718, 0x00000000},
1697 {0x0000aae8, 0x00000000, 0x00000000, 0x000f9705, 0x000f9705, 0x00000000},
1698 {0x0000aaec, 0x00000000, 0x00000000, 0x000f9709, 0x000f9709, 0x00000000},
1699 {0x0000aaf0, 0x00000000, 0x00000000, 0x000f970d, 0x000f970d, 0x00000000},
1700 {0x0000aaf4, 0x00000000, 0x00000000, 0x000f9711, 0x000f9711, 0x00000000},
1701 {0x0000aaf8, 0x00000000, 0x00000000, 0x000f9715, 0x000f9715, 0x00000000},
1702 {0x0000aafc, 0x00000000, 0x00000000, 0x000f9719, 0x000f9719, 0x00000000},
1703 {0x0000ab00, 0x00000000, 0x00000000, 0x000fb7a4, 0x000fb7a4, 0x00000000},
1704 {0x0000ab04, 0x00000000, 0x00000000, 0x000fb7a8, 0x000fb7a8, 0x00000000},
1705 {0x0000ab08, 0x00000000, 0x00000000, 0x000fb7ac, 0x000fb7ac, 0x00000000},
1706 {0x0000ab0c, 0x00000000, 0x00000000, 0x000fb7ac, 0x000fb7ac, 0x00000000},
1707 {0x0000ab10, 0x00000000, 0x00000000, 0x000fb7b0, 0x000fb7b0, 0x00000000},
1708 {0x0000ab14, 0x00000000, 0x00000000, 0x000fb7b8, 0x000fb7b8, 0x00000000},
1709 {0x0000ab18, 0x00000000, 0x00000000, 0x000fb7bc, 0x000fb7bc, 0x00000000},
1710 {0x0000ab1c, 0x00000000, 0x00000000, 0x000fb7a1, 0x000fb7a1, 0x00000000},
1711 {0x0000ab20, 0x00000000, 0x00000000, 0x000fb7a5, 0x000fb7a5, 0x00000000},
1712 {0x0000ab24, 0x00000000, 0x00000000, 0x000fb7a9, 0x000fb7a9, 0x00000000},
1713 {0x0000ab28, 0x00000000, 0x00000000, 0x000fb7b1, 0x000fb7b1, 0x00000000},
1714 {0x0000ab2c, 0x00000000, 0x00000000, 0x000fb7b5, 0x000fb7b5, 0x00000000},
1715 {0x0000ab30, 0x00000000, 0x00000000, 0x000fb7bd, 0x000fb7bd, 0x00000000},
1716 {0x0000ab34, 0x00000000, 0x00000000, 0x000fb7c9, 0x000fb7c9, 0x00000000},
1717 {0x0000ab38, 0x00000000, 0x00000000, 0x000fb7cd, 0x000fb7cd, 0x00000000},
1718 {0x0000ab3c, 0x00000000, 0x00000000, 0x000fb7d1, 0x000fb7d1, 0x00000000},
1719 {0x0000ab40, 0x00000000, 0x00000000, 0x000fb7d9, 0x000fb7d9, 0x00000000},
1720 {0x0000ab44, 0x00000000, 0x00000000, 0x000fb7c2, 0x000fb7c2, 0x00000000},
1721 {0x0000ab48, 0x00000000, 0x00000000, 0x000fb7c6, 0x000fb7c6, 0x00000000},
1722 {0x0000ab4c, 0x00000000, 0x00000000, 0x000fb7ca, 0x000fb7ca, 0x00000000},
1723 {0x0000ab50, 0x00000000, 0x00000000, 0x000fb7ce, 0x000fb7ce, 0x00000000},
1724 {0x0000ab54, 0x00000000, 0x00000000, 0x000fb7d2, 0x000fb7d2, 0x00000000},
1725 {0x0000ab58, 0x00000000, 0x00000000, 0x000fb7d6, 0x000fb7d6, 0x00000000},
1726 {0x0000ab5c, 0x00000000, 0x00000000, 0x000fb7c3, 0x000fb7c3, 0x00000000},
1727 {0x0000ab60, 0x00000000, 0x00000000, 0x000fb7cb, 0x000fb7cb, 0x00000000},
1728 {0x0000ab64, 0x00000000, 0x00000000, 0x000fb7d3, 0x000fb7d3, 0x00000000},
1729 {0x0000ab68, 0x00000000, 0x00000000, 0x000fb7d3, 0x000fb7d3, 0x00000000},
1730 {0x0000ab6c, 0x00000000, 0x00000000, 0x000fb7d3, 0x000fb7d3, 0x00000000},
1731 {0x0000ab70, 0x00000000, 0x00000000, 0x000fb7d3, 0x000fb7d3, 0x00000000},
1732 {0x0000ab74, 0x00000000, 0x00000000, 0x000fb7d3, 0x000fb7d3, 0x00000000},
1733 {0x0000ab78, 0x00000000, 0x00000000, 0x000fb7d3, 0x000fb7d3, 0x00000000},
1734 {0x0000ab7c, 0x00000000, 0x00000000, 0x000fb7d3, 0x000fb7d3, 0x00000000},
1735 {0x0000ab80, 0x00000000, 0x00000000, 0x000fb7d3, 0x000fb7d3, 0x00000000},
1736 {0x0000ab84, 0x00000000, 0x00000000, 0x000fb7d3, 0x000fb7d3, 0x00000000},
1737 {0x0000ab88, 0x00000000, 0x00000000, 0x000fb7d3, 0x000fb7d3, 0x00000000},
1738 {0x0000ab8c, 0x00000000, 0x00000000, 0x000fb7d3, 0x000fb7d3, 0x00000000},
1739 {0x0000ab90, 0x00000000, 0x00000000, 0x000fb7d3, 0x000fb7d3, 0x00000000},
1740 {0x0000ab94, 0x00000000, 0x00000000, 0x000fb7d3, 0x000fb7d3, 0x00000000},
1741 {0x0000ab98, 0x00000000, 0x00000000, 0x000fb7d3, 0x000fb7d3, 0x00000000},
1742 {0x0000ab9c, 0x00000000, 0x00000000, 0x000fb7d3, 0x000fb7d3, 0x00000000},
1743 {0x0000aba0, 0x00000000, 0x00000000, 0x000fb7d3, 0x000fb7d3, 0x00000000},
1744 {0x0000aba4, 0x00000000, 0x00000000, 0x000fb7d3, 0x000fb7d3, 0x00000000},
1745 {0x0000aba8, 0x00000000, 0x00000000, 0x000fb7d3, 0x000fb7d3, 0x00000000},
1746 {0x0000abac, 0x00000000, 0x00000000, 0x000fb7d3, 0x000fb7d3, 0x00000000},
1747 {0x0000abb0, 0x00000000, 0x00000000, 0x000fb7d3, 0x000fb7d3, 0x00000000},
1748 {0x0000abb4, 0x00000000, 0x00000000, 0x000fb7d3, 0x000fb7d3, 0x00000000},
1749 {0x0000abb8, 0x00000000, 0x00000000, 0x000fb7d3, 0x000fb7d3, 0x00000000},
1750 {0x0000abbc, 0x00000000, 0x00000000, 0x000fb7d3, 0x000fb7d3, 0x00000000},
1751 {0x0000abc0, 0x00000000, 0x00000000, 0x000fb7d3, 0x000fb7d3, 0x00000000},
1752 {0x0000abc4, 0x00000000, 0x00000000, 0x000fb7d3, 0x000fb7d3, 0x00000000},
1753 {0x0000abc8, 0x00000000, 0x00000000, 0x000fb7d3, 0x000fb7d3, 0x00000000},
1754 {0x0000abcc, 0x00000000, 0x00000000, 0x000fb7d3, 0x000fb7d3, 0x00000000},
1755 {0x0000abd0, 0x00000000, 0x00000000, 0x000fb7d3, 0x000fb7d3, 0x00000000},
1756 {0x0000abd4, 0x00000000, 0x00000000, 0x000fb7d3, 0x000fb7d3, 0x00000000},
1757 {0x0000abd8, 0x00000000, 0x00000000, 0x000fb7d3, 0x000fb7d3, 0x00000000},
1758 {0x0000abdc, 0x00000000, 0x00000000, 0x000fb7d3, 0x000fb7d3, 0x00000000},
1759 {0x0000abe0, 0x00000000, 0x00000000, 0x000fb7d3, 0x000fb7d3, 0x00000000},
1760 {0x0000abe4, 0x00000000, 0x00000000, 0x000fb7d3, 0x000fb7d3, 0x00000000},
1761 {0x0000abe8, 0x00000000, 0x00000000, 0x000fb7d3, 0x000fb7d3, 0x00000000},
1762 {0x0000abec, 0x00000000, 0x00000000, 0x000fb7d3, 0x000fb7d3, 0x00000000},
1763 {0x0000abf0, 0x00000000, 0x00000000, 0x000fb7d3, 0x000fb7d3, 0x00000000},
1764 {0x0000abf4, 0x00000000, 0x00000000, 0x000fb7d3, 0x000fb7d3, 0x00000000},
1765 {0x0000abf8, 0x00000000, 0x00000000, 0x000fb7d3, 0x000fb7d3, 0x00000000},
1766 {0x0000abfc, 0x00000000, 0x00000000, 0x000fb7d3, 0x000fb7d3, 0x00000000},
1767 {0x0000a204, 0x00000004, 0x00000004, 0x00000004, 0x00000004, 0x00000004},
1768 {0x0000a20c, 0x00000014, 0x00000014, 0x00000000, 0x00000000, 0x0001f000},
1769 {0x0000a21c, 0x1883800a, 0x1883800a, 0x1883800a, 0x1883800a, 0x1883800a},
1770 {0x0000a230, 0x00000000, 0x00000000, 0x00000210, 0x00000108, 0x00000000},
1771 {0x0000a250, 0x001ff000, 0x001ff000, 0x001ca000, 0x001ca000, 0x001da000},
1772 {0x0000a274, 0x0a81c652, 0x0a81c652, 0x0a820652, 0x0a820652, 0x0a82a652},
1773 {0x0000a300, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
1774 {0x0000a304, 0x00000000, 0x00000000, 0x00007201, 0x00007201, 0x00000000},
1775 {0x0000a308, 0x00000000, 0x00000000, 0x00010408, 0x00010408, 0x00000000},
1776 {0x0000a30c, 0x00000000, 0x00000000, 0x0001860a, 0x0001860a, 0x00000000},
1777 {0x0000a310, 0x00000000, 0x00000000, 0x00020818, 0x00020818, 0x00000000},
1778 {0x0000a314, 0x00000000, 0x00000000, 0x00024858, 0x00024858, 0x00000000},
1779 {0x0000a318, 0x00000000, 0x00000000, 0x00026859, 0x00026859, 0x00000000},
1780 {0x0000a31c, 0x00000000, 0x00000000, 0x0002985b, 0x0002985b, 0x00000000},
1781 {0x0000a320, 0x00000000, 0x00000000, 0x0002c89a, 0x0002c89a, 0x00000000},
1782 {0x0000a324, 0x00000000, 0x00000000, 0x0002e89b, 0x0002e89b, 0x00000000},
1783 {0x0000a328, 0x00000000, 0x00000000, 0x0003089c, 0x0003089c, 0x00000000},
1784 {0x0000a32c, 0x00000000, 0x00000000, 0x0003289d, 0x0003289d, 0x00000000},
1785 {0x0000a330, 0x00000000, 0x00000000, 0x0003489e, 0x0003489e, 0x00000000},
1786 {0x0000a334, 0x00000000, 0x00000000, 0x000388de, 0x000388de, 0x00000000},
1787 {0x0000a338, 0x00000000, 0x00000000, 0x0003b91e, 0x0003b91e, 0x00000000},
1788 {0x0000a33c, 0x00000000, 0x00000000, 0x0003d95e, 0x0003d95e, 0x00000000},
1789 {0x0000a340, 0x00000000, 0x00000000, 0x000419df, 0x000419df, 0x00000000},
1790 {0x0000a344, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x00000000},
1791 {0x0000a358, 0x7999aa02, 0x7999aa02, 0x7999aa0e, 0x7999aa0e, 0x7999aa0e},
1792};
1793
1794static const u32 ar9285Common_9285[][2] = {
1795 /* Addr allmodes */
1796 {0x0000000c, 0x00000000},
1797 {0x00000030, 0x00020045},
1798 {0x00000034, 0x00000005},
1799 {0x00000040, 0x00000000},
1800 {0x00000044, 0x00000008},
1801 {0x00000048, 0x00000008},
1802 {0x0000004c, 0x00000010},
1803 {0x00000050, 0x00000000},
1804 {0x00000054, 0x0000001f},
1805 {0x00000800, 0x00000000},
1806 {0x00000804, 0x00000000},
1807 {0x00000808, 0x00000000},
1808 {0x0000080c, 0x00000000},
1809 {0x00000810, 0x00000000},
1810 {0x00000814, 0x00000000},
1811 {0x00000818, 0x00000000},
1812 {0x0000081c, 0x00000000},
1813 {0x00000820, 0x00000000},
1814 {0x00000824, 0x00000000},
1815 {0x00001040, 0x002ffc0f},
1816 {0x00001044, 0x002ffc0f},
1817 {0x00001048, 0x002ffc0f},
1818 {0x0000104c, 0x002ffc0f},
1819 {0x00001050, 0x002ffc0f},
1820 {0x00001054, 0x002ffc0f},
1821 {0x00001058, 0x002ffc0f},
1822 {0x0000105c, 0x002ffc0f},
1823 {0x00001060, 0x002ffc0f},
1824 {0x00001064, 0x002ffc0f},
1825 {0x00001230, 0x00000000},
1826 {0x00001270, 0x00000000},
1827 {0x00001038, 0x00000000},
1828 {0x00001078, 0x00000000},
1829 {0x000010b8, 0x00000000},
1830 {0x000010f8, 0x00000000},
1831 {0x00001138, 0x00000000},
1832 {0x00001178, 0x00000000},
1833 {0x000011b8, 0x00000000},
1834 {0x000011f8, 0x00000000},
1835 {0x00001238, 0x00000000},
1836 {0x00001278, 0x00000000},
1837 {0x000012b8, 0x00000000},
1838 {0x000012f8, 0x00000000},
1839 {0x00001338, 0x00000000},
1840 {0x00001378, 0x00000000},
1841 {0x000013b8, 0x00000000},
1842 {0x000013f8, 0x00000000},
1843 {0x00001438, 0x00000000},
1844 {0x00001478, 0x00000000},
1845 {0x000014b8, 0x00000000},
1846 {0x000014f8, 0x00000000},
1847 {0x00001538, 0x00000000},
1848 {0x00001578, 0x00000000},
1849 {0x000015b8, 0x00000000},
1850 {0x000015f8, 0x00000000},
1851 {0x00001638, 0x00000000},
1852 {0x00001678, 0x00000000},
1853 {0x000016b8, 0x00000000},
1854 {0x000016f8, 0x00000000},
1855 {0x00001738, 0x00000000},
1856 {0x00001778, 0x00000000},
1857 {0x000017b8, 0x00000000},
1858 {0x000017f8, 0x00000000},
1859 {0x0000103c, 0x00000000},
1860 {0x0000107c, 0x00000000},
1861 {0x000010bc, 0x00000000},
1862 {0x000010fc, 0x00000000},
1863 {0x0000113c, 0x00000000},
1864 {0x0000117c, 0x00000000},
1865 {0x000011bc, 0x00000000},
1866 {0x000011fc, 0x00000000},
1867 {0x0000123c, 0x00000000},
1868 {0x0000127c, 0x00000000},
1869 {0x000012bc, 0x00000000},
1870 {0x000012fc, 0x00000000},
1871 {0x0000133c, 0x00000000},
1872 {0x0000137c, 0x00000000},
1873 {0x000013bc, 0x00000000},
1874 {0x000013fc, 0x00000000},
1875 {0x0000143c, 0x00000000},
1876 {0x0000147c, 0x00000000},
1877 {0x00004030, 0x00000002},
1878 {0x0000403c, 0x00000002},
1879 {0x00004024, 0x0000001f},
1880 {0x00004060, 0x00000000},
1881 {0x00004064, 0x00000000},
1882 {0x00007010, 0x00000031},
1883 {0x00007034, 0x00000002},
1884 {0x00007038, 0x000004c2},
1885 {0x00008004, 0x00000000},
1886 {0x00008008, 0x00000000},
1887 {0x0000800c, 0x00000000},
1888 {0x00008018, 0x00000700},
1889 {0x00008020, 0x00000000},
1890 {0x00008038, 0x00000000},
1891 {0x0000803c, 0x00000000},
1892 {0x00008048, 0x00000000},
1893 {0x00008054, 0x00000000},
1894 {0x00008058, 0x00000000},
1895 {0x0000805c, 0x000fc78f},
1896 {0x00008060, 0x0000000f},
1897 {0x00008064, 0x00000000},
1898 {0x00008070, 0x00000000},
1899 {0x000080c0, 0x2a80001a},
1900 {0x000080c4, 0x05dc01e0},
1901 {0x000080c8, 0x1f402710},
1902 {0x000080cc, 0x01f40000},
1903 {0x000080d0, 0x00001e00},
1904 {0x000080d4, 0x00000000},
1905 {0x000080d8, 0x00400000},
1906 {0x000080e0, 0xffffffff},
1907 {0x000080e4, 0x0000ffff},
1908 {0x000080e8, 0x003f3f3f},
1909 {0x000080ec, 0x00000000},
1910 {0x000080f0, 0x00000000},
1911 {0x000080f4, 0x00000000},
1912 {0x000080f8, 0x00000000},
1913 {0x000080fc, 0x00020000},
1914 {0x00008100, 0x00020000},
1915 {0x00008104, 0x00000001},
1916 {0x00008108, 0x00000052},
1917 {0x0000810c, 0x00000000},
1918 {0x00008110, 0x00000168},
1919 {0x00008118, 0x000100aa},
1920 {0x0000811c, 0x00003210},
1921 {0x00008120, 0x08f04800},
1922 {0x00008124, 0x00000000},
1923 {0x00008128, 0x00000000},
1924 {0x0000812c, 0x00000000},
1925 {0x00008130, 0x00000000},
1926 {0x00008134, 0x00000000},
1927 {0x00008138, 0x00000000},
1928 {0x0000813c, 0x00000000},
1929 {0x00008144, 0x00000000},
1930 {0x00008168, 0x00000000},
1931 {0x0000816c, 0x00000000},
1932 {0x00008170, 0x32143320},
1933 {0x00008174, 0xfaa4fa50},
1934 {0x00008178, 0x00000100},
1935 {0x0000817c, 0x00000000},
1936 {0x000081c0, 0x00000000},
1937 {0x000081d0, 0x00003210},
1938 {0x000081ec, 0x00000000},
1939 {0x000081f0, 0x00000000},
1940 {0x000081f4, 0x00000000},
1941 {0x000081f8, 0x00000000},
1942 {0x000081fc, 0x00000000},
1943 {0x00008200, 0x00000000},
1944 {0x00008204, 0x00000000},
1945 {0x00008208, 0x00000000},
1946 {0x0000820c, 0x00000000},
1947 {0x00008210, 0x00000000},
1948 {0x00008214, 0x00000000},
1949 {0x00008218, 0x00000000},
1950 {0x0000821c, 0x00000000},
1951 {0x00008220, 0x00000000},
1952 {0x00008224, 0x00000000},
1953 {0x00008228, 0x00000000},
1954 {0x0000822c, 0x00000000},
1955 {0x00008230, 0x00000000},
1956 {0x00008234, 0x00000000},
1957 {0x00008238, 0x00000000},
1958 {0x0000823c, 0x00000000},
1959 {0x00008240, 0x00100000},
1960 {0x00008244, 0x0010f400},
1961 {0x00008248, 0x00000100},
1962 {0x0000824c, 0x0001e800},
1963 {0x00008250, 0x00000000},
1964 {0x00008254, 0x00000000},
1965 {0x00008258, 0x00000000},
1966 {0x0000825c, 0x400000ff},
1967 {0x00008260, 0x00080922},
1968 {0x00008264, 0x88a00010},
1969 {0x00008270, 0x00000000},
1970 {0x00008274, 0x40000000},
1971 {0x00008278, 0x003e4180},
1972 {0x0000827c, 0x00000000},
1973 {0x00008284, 0x0000002c},
1974 {0x00008288, 0x0000002c},
1975 {0x0000828c, 0x00000000},
1976 {0x00008294, 0x00000000},
1977 {0x00008298, 0x00000000},
1978 {0x0000829c, 0x00000000},
1979 {0x00008300, 0x00000040},
1980 {0x00008314, 0x00000000},
1981 {0x00008328, 0x00000000},
1982 {0x0000832c, 0x00000001},
1983 {0x00008330, 0x00000302},
1984 {0x00008334, 0x00000e00},
1985 {0x00008338, 0x00000000},
1986 {0x0000833c, 0x00000000},
1987 {0x00008340, 0x00010380},
1988 {0x00008344, 0x00481043},
1989 {0x00009808, 0x00000000},
1990 {0x0000980c, 0xafe68e30},
1991 {0x00009810, 0xfd14e000},
1992 {0x00009814, 0x9c0a9f6b},
1993 {0x0000981c, 0x00000000},
1994 {0x0000982c, 0x0000a000},
1995 {0x00009830, 0x00000000},
1996 {0x0000983c, 0x00200400},
1997 {0x0000984c, 0x0040233c},
1998 {0x00009854, 0x00000044},
1999 {0x00009900, 0x00000000},
2000 {0x00009904, 0x00000000},
2001 {0x00009908, 0x00000000},
2002 {0x0000990c, 0x00000000},
2003 {0x00009910, 0x01002310},
2004 {0x0000991c, 0x10000fff},
2005 {0x00009920, 0x04900000},
2006 {0x00009928, 0x00000001},
2007 {0x0000992c, 0x00000004},
2008 {0x00009934, 0x1e1f2022},
2009 {0x00009938, 0x0a0b0c0d},
2010 {0x0000993c, 0x00000000},
2011 {0x00009940, 0x14750604},
2012 {0x00009948, 0x9280c00a},
2013 {0x0000994c, 0x00020028},
2014 {0x00009954, 0x5f3ca3de},
2015 {0x00009958, 0x2108ecff},
2016 {0x00009968, 0x000003ce},
2017 {0x00009970, 0x1927b515},
2018 {0x00009974, 0x00000000},
2019 {0x00009978, 0x00000001},
2020 {0x0000997c, 0x00000000},
2021 {0x00009980, 0x00000000},
2022 {0x00009984, 0x00000000},
2023 {0x00009988, 0x00000000},
2024 {0x0000998c, 0x00000000},
2025 {0x00009990, 0x00000000},
2026 {0x00009994, 0x00000000},
2027 {0x00009998, 0x00000000},
2028 {0x0000999c, 0x00000000},
2029 {0x000099a0, 0x00000000},
2030 {0x000099a4, 0x00000001},
2031 {0x000099a8, 0x201fff00},
2032 {0x000099ac, 0x2def0a00},
2033 {0x000099b0, 0x03051000},
2034 {0x000099b4, 0x00000820},
2035 {0x000099dc, 0x00000000},
2036 {0x000099e0, 0x00000000},
2037 {0x000099e4, 0xaaaaaaaa},
2038 {0x000099e8, 0x3c466478},
2039 {0x000099ec, 0x0cc80caa},
2040 {0x000099f0, 0x00000000},
2041 {0x0000a208, 0x803e6788},
2042 {0x0000a210, 0x4080a333},
2043 {0x0000a214, 0x00206c10},
2044 {0x0000a218, 0x009c4060},
2045 {0x0000a220, 0x01834061},
2046 {0x0000a224, 0x00000400},
2047 {0x0000a228, 0x000003b5},
2048 {0x0000a22c, 0x00000000},
2049 {0x0000a234, 0x20202020},
2050 {0x0000a238, 0x20202020},
2051 {0x0000a244, 0x00000000},
2052 {0x0000a248, 0xfffffffc},
2053 {0x0000a24c, 0x00000000},
2054 {0x0000a254, 0x00000000},
2055 {0x0000a258, 0x0ccb5380},
2056 {0x0000a25c, 0x15151501},
2057 {0x0000a260, 0xdfa90f01},
2058 {0x0000a268, 0x00000000},
2059 {0x0000a26c, 0x0ebae9e6},
2060 {0x0000d270, 0x0d820820},
2061 {0x0000a278, 0x39ce739c},
2062 {0x0000a27c, 0x050e039c},
2063 {0x0000d35c, 0x07ffffef},
2064 {0x0000d360, 0x0fffffe7},
2065 {0x0000d364, 0x17ffffe5},
2066 {0x0000d368, 0x1fffffe4},
2067 {0x0000d36c, 0x37ffffe3},
2068 {0x0000d370, 0x3fffffe3},
2069 {0x0000d374, 0x57ffffe3},
2070 {0x0000d378, 0x5fffffe2},
2071 {0x0000d37c, 0x7fffffe2},
2072 {0x0000d380, 0x7f3c7bba},
2073 {0x0000d384, 0xf3307ff0},
2074 {0x0000a388, 0x0c000000},
2075 {0x0000a38c, 0x20202020},
2076 {0x0000a390, 0x20202020},
2077 {0x0000a394, 0x39ce739c},
2078 {0x0000a398, 0x0000039c},
2079 {0x0000a39c, 0x00000001},
2080 {0x0000a3a0, 0x00000000},
2081 {0x0000a3a4, 0x00000000},
2082 {0x0000a3a8, 0x00000000},
2083 {0x0000a3ac, 0x00000000},
2084 {0x0000a3b0, 0x00000000},
2085 {0x0000a3b4, 0x00000000},
2086 {0x0000a3b8, 0x00000000},
2087 {0x0000a3bc, 0x00000000},
2088 {0x0000a3c0, 0x00000000},
2089 {0x0000a3c4, 0x00000000},
2090 {0x0000a3cc, 0x20202020},
2091 {0x0000a3d0, 0x20202020},
2092 {0x0000a3d4, 0x20202020},
2093 {0x0000a3dc, 0x39ce739c},
2094 {0x0000a3e0, 0x0000039c},
2095 {0x0000a3e4, 0x00000000},
2096 {0x0000a3e8, 0x18c43433},
2097 {0x0000a3ec, 0x00f70081},
2098 {0x00007800, 0x00140000},
2099 {0x00007804, 0x0e4548d8},
2100 {0x00007808, 0x54214514},
2101 {0x0000780c, 0x02025820},
2102 {0x00007810, 0x71c0d388},
2103 {0x00007814, 0x924934a8},
2104 {0x0000781c, 0x00000000},
2105 {0x00007820, 0x00000c04},
2106 {0x00007824, 0x00d86fff},
2107 {0x00007828, 0x26d2491b},
2108 {0x0000782c, 0x6e36d97b},
2109 {0x00007830, 0xedb6d96c},
2110 {0x00007834, 0x71400086},
2111 {0x00007838, 0xfac68800},
2112 {0x0000783c, 0x0001fffe},
2113 {0x00007840, 0xffeb1a20},
2114 {0x00007844, 0x000c0db6},
2115 {0x00007848, 0x6db61b6f},
2116 {0x0000784c, 0x6d9b66db},
2117 {0x00007850, 0x6d8c6dba},
2118 {0x00007854, 0x00040000},
2119 {0x00007858, 0xdb003012},
2120 {0x0000785c, 0x04924914},
2121 {0x00007860, 0x21084210},
2122 {0x00007864, 0xf7d7ffde},
2123 {0x00007868, 0xc2034080},
2124 {0x0000786c, 0x48609eb4},
2125 {0x00007870, 0x10142c00},
2126};
2127
2128static const u32 ar9285PciePhy_clkreq_always_on_L1_9285[][2] = { 922static const u32 ar9285PciePhy_clkreq_always_on_L1_9285[][2] = {
2129 /* Addr allmodes */ 923 /* Addr allmodes */
2130 {0x00004040, 0x9248fd00}, 924 {0x00004040, 0x9248fd00},
@@ -2966,761 +1760,6 @@ static const u32 ar9285PciePhy_clkreq_off_L1_9285_1_2[][2] = {
2966 {0x00004044, 0x00000000}, 1760 {0x00004044, 0x00000000},
2967}; 1761};
2968 1762
2969static const u32 ar9287Modes_9287_1_0[][6] = {
2970 {0x00001030, 0x00000000, 0x00000000, 0x000002c0, 0x00000160, 0x000001e0},
2971 {0x00001070, 0x00000000, 0x00000000, 0x00000318, 0x0000018c, 0x000001e0},
2972 {0x000010b0, 0x00000000, 0x00000000, 0x00007c70, 0x00003e38, 0x00001180},
2973 {0x000010f0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000008},
2974 {0x00008014, 0x00000000, 0x00000000, 0x10801600, 0x08400b00, 0x06e006e0},
2975 {0x0000801c, 0x00000000, 0x00000000, 0x12e00057, 0x12e0002b, 0x0988004f},
2976 {0x00008120, 0x08f04800, 0x08f04800, 0x08f04810, 0x08f04810, 0x08f04810},
2977 {0x000081d0, 0x00003200, 0x00003200, 0x0000320a, 0x0000320a, 0x0000320a},
2978 {0x00008318, 0x00000000, 0x00000000, 0x00006880, 0x00003440, 0x00006880},
2979 {0x00009804, 0x00000000, 0x00000000, 0x000003c4, 0x00000300, 0x00000303},
2980 {0x00009820, 0x00000000, 0x00000000, 0x02020200, 0x02020200, 0x02020200},
2981 {0x00009824, 0x00000000, 0x00000000, 0x01000e0e, 0x01000e0e, 0x01000e0e},
2982 {0x00009828, 0x00000000, 0x00000000, 0x0a020001, 0x0a020001, 0x0a020001},
2983 {0x00009834, 0x00000000, 0x00000000, 0x00000e0e, 0x00000e0e, 0x00000e0e},
2984 {0x00009838, 0x00000003, 0x00000003, 0x00000007, 0x00000007, 0x00000007},
2985 {0x00009840, 0x206a002e, 0x206a002e, 0x206a012e, 0x206a012e, 0x206a012e},
2986 {0x00009844, 0x03720000, 0x03720000, 0x037216a0, 0x037216a0, 0x037216a0},
2987 {0x00009850, 0x60000000, 0x60000000, 0x6d4000e2, 0x6c4000e2, 0x6c4000e2},
2988 {0x00009858, 0x7c000d00, 0x7c000d00, 0x7ec84d2e, 0x7ec84d2e, 0x7ec84d2e},
2989 {0x0000985c, 0x3100005e, 0x3100005e, 0x3139605e, 0x31395d5e, 0x31395d5e},
2990 {0x00009860, 0x00058d00, 0x00058d00, 0x00058d20, 0x00058d20, 0x00058d18},
2991 {0x00009864, 0x00000e00, 0x00000e00, 0x0001ce00, 0x0001ce00, 0x0001ce00},
2992 {0x00009868, 0x000040c0, 0x000040c0, 0x5ac640d0, 0x5ac640d0, 0x5ac640d0},
2993 {0x0000986c, 0x00000080, 0x00000080, 0x06903881, 0x06903881, 0x06903881},
2994 {0x00009914, 0x00000000, 0x00000000, 0x00001130, 0x00000898, 0x000007d0},
2995 {0x00009918, 0x00000000, 0x00000000, 0x00000016, 0x0000000b, 0x00000016},
2996 {0x00009924, 0xd00a8a01, 0xd00a8a01, 0xd00a8a0d, 0xd00a8a0d, 0xd00a8a0d},
2997 {0x00009944, 0xefbc0000, 0xefbc0000, 0xefbc1010, 0xefbc1010, 0xefbc1010},
2998 {0x00009960, 0x00000000, 0x00000000, 0x00000010, 0x00000010, 0x00000010},
2999 {0x0000a960, 0x00000000, 0x00000000, 0x00000010, 0x00000010, 0x00000010},
3000 {0x00009964, 0x00000000, 0x00000000, 0x00000210, 0x00000210, 0x00000210},
3001 {0x0000c968, 0x00000200, 0x00000200, 0x000003ce, 0x000003ce, 0x000003ce},
3002 {0x000099b8, 0x00000000, 0x00000000, 0x0000001c, 0x0000001c, 0x0000001c},
3003 {0x000099bc, 0x00000000, 0x00000000, 0x00000c00, 0x00000c00, 0x00000c00},
3004 {0x000099c0, 0x00000000, 0x00000000, 0x05eea6d4, 0x05eea6d4, 0x05eea6d4},
3005 {0x0000a204, 0x00000440, 0x00000440, 0x00000444, 0x00000444, 0x00000444},
3006 {0x0000a20c, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
3007 {0x0000b20c, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
3008 {0x0000a21c, 0x1803800a, 0x1803800a, 0x1883800a, 0x1883800a, 0x1883800a},
3009 {0x0000a230, 0x00000000, 0x00000000, 0x00000210, 0x00000108, 0x00000000},
3010 {0x0000a250, 0x00000000, 0x00000000, 0x0004a000, 0x0004a000, 0x0004a000},
3011 {0x0000a358, 0x7999aa02, 0x7999aa02, 0x7999aa0e, 0x7999aa0e, 0x7999aa0e},
3012 {0x0000a3d8, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
3013};
3014
3015static const u32 ar9287Common_9287_1_0[][2] = {
3016 /* Addr allmodes */
3017 {0x0000000c, 0x00000000},
3018 {0x00000030, 0x00020015},
3019 {0x00000034, 0x00000005},
3020 {0x00000040, 0x00000000},
3021 {0x00000044, 0x00000008},
3022 {0x00000048, 0x00000008},
3023 {0x0000004c, 0x00000010},
3024 {0x00000050, 0x00000000},
3025 {0x00000054, 0x0000001f},
3026 {0x00000800, 0x00000000},
3027 {0x00000804, 0x00000000},
3028 {0x00000808, 0x00000000},
3029 {0x0000080c, 0x00000000},
3030 {0x00000810, 0x00000000},
3031 {0x00000814, 0x00000000},
3032 {0x00000818, 0x00000000},
3033 {0x0000081c, 0x00000000},
3034 {0x00000820, 0x00000000},
3035 {0x00000824, 0x00000000},
3036 {0x00001040, 0x002ffc0f},
3037 {0x00001044, 0x002ffc0f},
3038 {0x00001048, 0x002ffc0f},
3039 {0x0000104c, 0x002ffc0f},
3040 {0x00001050, 0x002ffc0f},
3041 {0x00001054, 0x002ffc0f},
3042 {0x00001058, 0x002ffc0f},
3043 {0x0000105c, 0x002ffc0f},
3044 {0x00001060, 0x002ffc0f},
3045 {0x00001064, 0x002ffc0f},
3046 {0x00001230, 0x00000000},
3047 {0x00001270, 0x00000000},
3048 {0x00001038, 0x00000000},
3049 {0x00001078, 0x00000000},
3050 {0x000010b8, 0x00000000},
3051 {0x000010f8, 0x00000000},
3052 {0x00001138, 0x00000000},
3053 {0x00001178, 0x00000000},
3054 {0x000011b8, 0x00000000},
3055 {0x000011f8, 0x00000000},
3056 {0x00001238, 0x00000000},
3057 {0x00001278, 0x00000000},
3058 {0x000012b8, 0x00000000},
3059 {0x000012f8, 0x00000000},
3060 {0x00001338, 0x00000000},
3061 {0x00001378, 0x00000000},
3062 {0x000013b8, 0x00000000},
3063 {0x000013f8, 0x00000000},
3064 {0x00001438, 0x00000000},
3065 {0x00001478, 0x00000000},
3066 {0x000014b8, 0x00000000},
3067 {0x000014f8, 0x00000000},
3068 {0x00001538, 0x00000000},
3069 {0x00001578, 0x00000000},
3070 {0x000015b8, 0x00000000},
3071 {0x000015f8, 0x00000000},
3072 {0x00001638, 0x00000000},
3073 {0x00001678, 0x00000000},
3074 {0x000016b8, 0x00000000},
3075 {0x000016f8, 0x00000000},
3076 {0x00001738, 0x00000000},
3077 {0x00001778, 0x00000000},
3078 {0x000017b8, 0x00000000},
3079 {0x000017f8, 0x00000000},
3080 {0x0000103c, 0x00000000},
3081 {0x0000107c, 0x00000000},
3082 {0x000010bc, 0x00000000},
3083 {0x000010fc, 0x00000000},
3084 {0x0000113c, 0x00000000},
3085 {0x0000117c, 0x00000000},
3086 {0x000011bc, 0x00000000},
3087 {0x000011fc, 0x00000000},
3088 {0x0000123c, 0x00000000},
3089 {0x0000127c, 0x00000000},
3090 {0x000012bc, 0x00000000},
3091 {0x000012fc, 0x00000000},
3092 {0x0000133c, 0x00000000},
3093 {0x0000137c, 0x00000000},
3094 {0x000013bc, 0x00000000},
3095 {0x000013fc, 0x00000000},
3096 {0x0000143c, 0x00000000},
3097 {0x0000147c, 0x00000000},
3098 {0x00004030, 0x00000002},
3099 {0x0000403c, 0x00000002},
3100 {0x00004024, 0x0000001f},
3101 {0x00004060, 0x00000000},
3102 {0x00004064, 0x00000000},
3103 {0x00007010, 0x00000033},
3104 {0x00007020, 0x00000000},
3105 {0x00007034, 0x00000002},
3106 {0x00007038, 0x000004c2},
3107 {0x00008004, 0x00000000},
3108 {0x00008008, 0x00000000},
3109 {0x0000800c, 0x00000000},
3110 {0x00008018, 0x00000700},
3111 {0x00008020, 0x00000000},
3112 {0x00008038, 0x00000000},
3113 {0x0000803c, 0x00000000},
3114 {0x00008048, 0x40000000},
3115 {0x00008054, 0x00000000},
3116 {0x00008058, 0x00000000},
3117 {0x0000805c, 0x000fc78f},
3118 {0x00008060, 0x0000000f},
3119 {0x00008064, 0x00000000},
3120 {0x00008070, 0x00000000},
3121 {0x000080c0, 0x2a80001a},
3122 {0x000080c4, 0x05dc01e0},
3123 {0x000080c8, 0x1f402710},
3124 {0x000080cc, 0x01f40000},
3125 {0x000080d0, 0x00001e00},
3126 {0x000080d4, 0x00000000},
3127 {0x000080d8, 0x00400000},
3128 {0x000080e0, 0xffffffff},
3129 {0x000080e4, 0x0000ffff},
3130 {0x000080e8, 0x003f3f3f},
3131 {0x000080ec, 0x00000000},
3132 {0x000080f0, 0x00000000},
3133 {0x000080f4, 0x00000000},
3134 {0x000080f8, 0x00000000},
3135 {0x000080fc, 0x00020000},
3136 {0x00008100, 0x00020000},
3137 {0x00008104, 0x00000001},
3138 {0x00008108, 0x00000052},
3139 {0x0000810c, 0x00000000},
3140 {0x00008110, 0x00000168},
3141 {0x00008118, 0x000100aa},
3142 {0x0000811c, 0x00003210},
3143 {0x00008124, 0x00000000},
3144 {0x00008128, 0x00000000},
3145 {0x0000812c, 0x00000000},
3146 {0x00008130, 0x00000000},
3147 {0x00008134, 0x00000000},
3148 {0x00008138, 0x00000000},
3149 {0x0000813c, 0x00000000},
3150 {0x00008144, 0xffffffff},
3151 {0x00008168, 0x00000000},
3152 {0x0000816c, 0x00000000},
3153 {0x00008170, 0x18487320},
3154 {0x00008174, 0xfaa4fa50},
3155 {0x00008178, 0x00000100},
3156 {0x0000817c, 0x00000000},
3157 {0x000081c0, 0x00000000},
3158 {0x000081c4, 0x00000000},
3159 {0x000081d4, 0x00000000},
3160 {0x000081ec, 0x00000000},
3161 {0x000081f0, 0x00000000},
3162 {0x000081f4, 0x00000000},
3163 {0x000081f8, 0x00000000},
3164 {0x000081fc, 0x00000000},
3165 {0x00008200, 0x00000000},
3166 {0x00008204, 0x00000000},
3167 {0x00008208, 0x00000000},
3168 {0x0000820c, 0x00000000},
3169 {0x00008210, 0x00000000},
3170 {0x00008214, 0x00000000},
3171 {0x00008218, 0x00000000},
3172 {0x0000821c, 0x00000000},
3173 {0x00008220, 0x00000000},
3174 {0x00008224, 0x00000000},
3175 {0x00008228, 0x00000000},
3176 {0x0000822c, 0x00000000},
3177 {0x00008230, 0x00000000},
3178 {0x00008234, 0x00000000},
3179 {0x00008238, 0x00000000},
3180 {0x0000823c, 0x00000000},
3181 {0x00008240, 0x00100000},
3182 {0x00008244, 0x0010f400},
3183 {0x00008248, 0x00000100},
3184 {0x0000824c, 0x0001e800},
3185 {0x00008250, 0x00000000},
3186 {0x00008254, 0x00000000},
3187 {0x00008258, 0x00000000},
3188 {0x0000825c, 0x400000ff},
3189 {0x00008260, 0x00080922},
3190 {0x00008264, 0x88a00010},
3191 {0x00008270, 0x00000000},
3192 {0x00008274, 0x40000000},
3193 {0x00008278, 0x003e4180},
3194 {0x0000827c, 0x00000000},
3195 {0x00008284, 0x0000002c},
3196 {0x00008288, 0x0000002c},
3197 {0x0000828c, 0x000000ff},
3198 {0x00008294, 0x00000000},
3199 {0x00008298, 0x00000000},
3200 {0x0000829c, 0x00000000},
3201 {0x00008300, 0x00000040},
3202 {0x00008314, 0x00000000},
3203 {0x00008328, 0x00000000},
3204 {0x0000832c, 0x00000007},
3205 {0x00008330, 0x00000302},
3206 {0x00008334, 0x00000e00},
3207 {0x00008338, 0x00ff0000},
3208 {0x0000833c, 0x00000000},
3209 {0x00008340, 0x000107ff},
3210 {0x00008344, 0x01c81043},
3211 {0x00008360, 0xffffffff},
3212 {0x00008364, 0xffffffff},
3213 {0x00008368, 0x00000000},
3214 {0x00008370, 0x00000000},
3215 {0x00008374, 0x000000ff},
3216 {0x00008378, 0x00000000},
3217 {0x0000837c, 0x00000000},
3218 {0x00008380, 0xffffffff},
3219 {0x00008384, 0xffffffff},
3220 {0x00008390, 0x0fffffff},
3221 {0x00008394, 0x0fffffff},
3222 {0x00008398, 0x00000000},
3223 {0x0000839c, 0x00000000},
3224 {0x000083a0, 0x00000000},
3225 {0x00009808, 0x00000000},
3226 {0x0000980c, 0xafe68e30},
3227 {0x00009810, 0xfd14e000},
3228 {0x00009814, 0x9c0a9f6b},
3229 {0x0000981c, 0x00000000},
3230 {0x0000982c, 0x0000a000},
3231 {0x00009830, 0x00000000},
3232 {0x0000983c, 0x00200400},
3233 {0x0000984c, 0x0040233c},
3234 {0x0000a84c, 0x0040233c},
3235 {0x00009854, 0x00000044},
3236 {0x00009900, 0x00000000},
3237 {0x00009904, 0x00000000},
3238 {0x00009908, 0x00000000},
3239 {0x0000990c, 0x00000000},
3240 {0x00009910, 0x10002310},
3241 {0x0000991c, 0x10000fff},
3242 {0x00009920, 0x04900000},
3243 {0x0000a920, 0x04900000},
3244 {0x00009928, 0x00000001},
3245 {0x0000992c, 0x00000004},
3246 {0x00009930, 0x00000000},
3247 {0x0000a930, 0x00000000},
3248 {0x00009934, 0x1e1f2022},
3249 {0x00009938, 0x0a0b0c0d},
3250 {0x0000993c, 0x00000000},
3251 {0x00009948, 0x9280c00a},
3252 {0x0000994c, 0x00020028},
3253 {0x00009954, 0x5f3ca3de},
3254 {0x00009958, 0x0108ecff},
3255 {0x00009940, 0x14750604},
3256 {0x0000c95c, 0x004b6a8e},
3257 {0x00009970, 0x990bb515},
3258 {0x00009974, 0x00000000},
3259 {0x00009978, 0x00000001},
3260 {0x0000997c, 0x00000000},
3261 {0x000099a0, 0x00000000},
3262 {0x000099a4, 0x00000001},
3263 {0x000099a8, 0x201fff00},
3264 {0x000099ac, 0x0c6f0000},
3265 {0x000099b0, 0x03051000},
3266 {0x000099b4, 0x00000820},
3267 {0x000099c4, 0x06336f77},
3268 {0x000099c8, 0x6af65329},
3269 {0x000099cc, 0x08f186c8},
3270 {0x000099d0, 0x00046384},
3271 {0x000099dc, 0x00000000},
3272 {0x000099e0, 0x00000000},
3273 {0x000099e4, 0xaaaaaaaa},
3274 {0x000099e8, 0x3c466478},
3275 {0x000099ec, 0x0cc80caa},
3276 {0x000099f0, 0x00000000},
3277 {0x000099fc, 0x00001042},
3278 {0x0000a1f4, 0x00fffeff},
3279 {0x0000a1f8, 0x00f5f9ff},
3280 {0x0000a1fc, 0xb79f6427},
3281 {0x0000a208, 0x803e4788},
3282 {0x0000a210, 0x4080a333},
3283 {0x0000a214, 0x40206c10},
3284 {0x0000a218, 0x009c4060},
3285 {0x0000a220, 0x01834061},
3286 {0x0000a224, 0x00000400},
3287 {0x0000a228, 0x000003b5},
3288 {0x0000a22c, 0x233f7180},
3289 {0x0000a234, 0x20202020},
3290 {0x0000a238, 0x20202020},
3291 {0x0000a23c, 0x13c889af},
3292 {0x0000a240, 0x38490a20},
3293 {0x0000a244, 0x00000000},
3294 {0x0000a248, 0xfffffffc},
3295 {0x0000a24c, 0x00000000},
3296 {0x0000a254, 0x00000000},
3297 {0x0000a258, 0x0cdbd380},
3298 {0x0000a25c, 0x0f0f0f01},
3299 {0x0000a260, 0xdfa91f01},
3300 {0x0000a264, 0x00418a11},
3301 {0x0000b264, 0x00418a11},
3302 {0x0000a268, 0x00000000},
3303 {0x0000a26c, 0x0e79e5c6},
3304 {0x0000b26c, 0x0e79e5c6},
3305 {0x0000d270, 0x00820820},
3306 {0x0000a278, 0x1ce739ce},
3307 {0x0000a27c, 0x050701ce},
3308 {0x0000d35c, 0x07ffffef},
3309 {0x0000d360, 0x0fffffe7},
3310 {0x0000d364, 0x17ffffe5},
3311 {0x0000d368, 0x1fffffe4},
3312 {0x0000d36c, 0x37ffffe3},
3313 {0x0000d370, 0x3fffffe3},
3314 {0x0000d374, 0x57ffffe3},
3315 {0x0000d378, 0x5fffffe2},
3316 {0x0000d37c, 0x7fffffe2},
3317 {0x0000d380, 0x7f3c7bba},
3318 {0x0000d384, 0xf3307ff0},
3319 {0x0000a388, 0x0c000000},
3320 {0x0000a38c, 0x20202020},
3321 {0x0000a390, 0x20202020},
3322 {0x0000a394, 0x1ce739ce},
3323 {0x0000a398, 0x000001ce},
3324 {0x0000b398, 0x000001ce},
3325 {0x0000a39c, 0x00000001},
3326 {0x0000a3c8, 0x00000246},
3327 {0x0000a3cc, 0x20202020},
3328 {0x0000a3d0, 0x20202020},
3329 {0x0000a3d4, 0x20202020},
3330 {0x0000a3dc, 0x1ce739ce},
3331 {0x0000a3e0, 0x000001ce},
3332 {0x0000a3e4, 0x00000000},
3333 {0x0000a3e8, 0x18c43433},
3334 {0x0000a3ec, 0x00f70081},
3335 {0x0000a3f0, 0x01036a1e},
3336 {0x0000a3f4, 0x00000000},
3337 {0x0000b3f4, 0x00000000},
3338 {0x0000a7d8, 0x00000001},
3339 {0x00007800, 0x00000800},
3340 {0x00007804, 0x6c35ffb0},
3341 {0x00007808, 0x6db6c000},
3342 {0x0000780c, 0x6db6cb30},
3343 {0x00007810, 0x6db6cb6c},
3344 {0x00007814, 0x0501e200},
3345 {0x00007818, 0x0094128d},
3346 {0x0000781c, 0x976ee392},
3347 {0x00007820, 0xf75ff6fc},
3348 {0x00007824, 0x00040000},
3349 {0x00007828, 0xdb003012},
3350 {0x0000782c, 0x04924914},
3351 {0x00007830, 0x21084210},
3352 {0x00007834, 0x00140000},
3353 {0x00007838, 0x0e4548d8},
3354 {0x0000783c, 0x54214514},
3355 {0x00007840, 0x02025820},
3356 {0x00007844, 0x71c0d388},
3357 {0x00007848, 0x934934a8},
3358 {0x00007850, 0x00000000},
3359 {0x00007854, 0x00000800},
3360 {0x00007858, 0x6c35ffb0},
3361 {0x0000785c, 0x6db6c000},
3362 {0x00007860, 0x6db6cb2c},
3363 {0x00007864, 0x6db6cb6c},
3364 {0x00007868, 0x0501e200},
3365 {0x0000786c, 0x0094128d},
3366 {0x00007870, 0x976ee392},
3367 {0x00007874, 0xf75ff6fc},
3368 {0x00007878, 0x00040000},
3369 {0x0000787c, 0xdb003012},
3370 {0x00007880, 0x04924914},
3371 {0x00007884, 0x21084210},
3372 {0x00007888, 0x001b6db0},
3373 {0x0000788c, 0x00376b63},
3374 {0x00007890, 0x06db6db6},
3375 {0x00007894, 0x006d8000},
3376 {0x00007898, 0x48100000},
3377 {0x0000789c, 0x00000000},
3378 {0x000078a0, 0x08000000},
3379 {0x000078a4, 0x0007ffd8},
3380 {0x000078a8, 0x0007ffd8},
3381 {0x000078ac, 0x001c0020},
3382 {0x000078b0, 0x000611eb},
3383 {0x000078b4, 0x40008080},
3384 {0x000078b8, 0x2a850160},
3385};
3386
3387static const u32 ar9287Modes_tx_gain_9287_1_0[][6] = {
3388 {0x0000a300, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
3389 {0x0000a304, 0x00000000, 0x00000000, 0x00004002, 0x00004002, 0x00004002},
3390 {0x0000a308, 0x00000000, 0x00000000, 0x00008004, 0x00008004, 0x00008004},
3391 {0x0000a30c, 0x00000000, 0x00000000, 0x0000c00a, 0x0000c00a, 0x0000c00a},
3392 {0x0000a310, 0x00000000, 0x00000000, 0x0001000c, 0x0001000c, 0x0001000c},
3393 {0x0000a314, 0x00000000, 0x00000000, 0x0001420b, 0x0001420b, 0x0001420b},
3394 {0x0000a318, 0x00000000, 0x00000000, 0x0001824a, 0x0001824a, 0x0001824a},
3395 {0x0000a31c, 0x00000000, 0x00000000, 0x0001c44a, 0x0001c44a, 0x0001c44a},
3396 {0x0000a320, 0x00000000, 0x00000000, 0x0002064a, 0x0002064a, 0x0002064a},
3397 {0x0000a324, 0x00000000, 0x00000000, 0x0002484a, 0x0002484a, 0x0002484a},
3398 {0x0000a328, 0x00000000, 0x00000000, 0x00028a4a, 0x00028a4a, 0x00028a4a},
3399 {0x0000a32c, 0x00000000, 0x00000000, 0x0002cc4a, 0x0002cc4a, 0x0002cc4a},
3400 {0x0000a330, 0x00000000, 0x00000000, 0x00030e4a, 0x00030e4a, 0x00030e4a},
3401 {0x0000a334, 0x00000000, 0x00000000, 0x00034e8a, 0x00034e8a, 0x00034e8a},
3402 {0x0000a338, 0x00000000, 0x00000000, 0x00038e8c, 0x00038e8c, 0x00038e8c},
3403 {0x0000a33c, 0x00000000, 0x00000000, 0x0003cecc, 0x0003cecc, 0x0003cecc},
3404 {0x0000a340, 0x00000000, 0x00000000, 0x00040ed4, 0x00040ed4, 0x00040ed4},
3405 {0x0000a344, 0x00000000, 0x00000000, 0x00044edc, 0x00044edc, 0x00044edc},
3406 {0x0000a348, 0x00000000, 0x00000000, 0x00048ede, 0x00048ede, 0x00048ede},
3407 {0x0000a34c, 0x00000000, 0x00000000, 0x0004cf1e, 0x0004cf1e, 0x0004cf1e},
3408 {0x0000a350, 0x00000000, 0x00000000, 0x00050f5e, 0x00050f5e, 0x00050f5e},
3409 {0x0000a354, 0x00000000, 0x00000000, 0x00054f9e, 0x00054f9e, 0x00054f9e},
3410 {0x0000a780, 0x00000000, 0x00000000, 0x00000060, 0x00000060, 0x00000060},
3411 {0x0000a784, 0x00000000, 0x00000000, 0x00004062, 0x00004062, 0x00004062},
3412 {0x0000a788, 0x00000000, 0x00000000, 0x00008064, 0x00008064, 0x00008064},
3413 {0x0000a78c, 0x00000000, 0x00000000, 0x0000c0a4, 0x0000c0a4, 0x0000c0a4},
3414 {0x0000a790, 0x00000000, 0x00000000, 0x000100b0, 0x000100b0, 0x000100b0},
3415 {0x0000a794, 0x00000000, 0x00000000, 0x000140b2, 0x000140b2, 0x000140b2},
3416 {0x0000a798, 0x00000000, 0x00000000, 0x000180b4, 0x000180b4, 0x000180b4},
3417 {0x0000a79c, 0x00000000, 0x00000000, 0x0001c0f4, 0x0001c0f4, 0x0001c0f4},
3418 {0x0000a7a0, 0x00000000, 0x00000000, 0x00020134, 0x00020134, 0x00020134},
3419 {0x0000a7a4, 0x00000000, 0x00000000, 0x000240fe, 0x000240fe, 0x000240fe},
3420 {0x0000a7a8, 0x00000000, 0x00000000, 0x0002813e, 0x0002813e, 0x0002813e},
3421 {0x0000a7ac, 0x00000000, 0x00000000, 0x0002c17e, 0x0002c17e, 0x0002c17e},
3422 {0x0000a7b0, 0x00000000, 0x00000000, 0x000301be, 0x000301be, 0x000301be},
3423 {0x0000a7b4, 0x00000000, 0x00000000, 0x000341fe, 0x000341fe, 0x000341fe},
3424 {0x0000a7b8, 0x00000000, 0x00000000, 0x000341fe, 0x000341fe, 0x000341fe},
3425 {0x0000a7bc, 0x00000000, 0x00000000, 0x000341fe, 0x000341fe, 0x000341fe},
3426 {0x0000a7c0, 0x00000000, 0x00000000, 0x000341fe, 0x000341fe, 0x000341fe},
3427 {0x0000a7c4, 0x00000000, 0x00000000, 0x000341fe, 0x000341fe, 0x000341fe},
3428 {0x0000a7c8, 0x00000000, 0x00000000, 0x000341fe, 0x000341fe, 0x000341fe},
3429 {0x0000a7cc, 0x00000000, 0x00000000, 0x000341fe, 0x000341fe, 0x000341fe},
3430 {0x0000a7d0, 0x00000000, 0x00000000, 0x000341fe, 0x000341fe, 0x000341fe},
3431 {0x0000a7d4, 0x00000000, 0x00000000, 0x000341fe, 0x000341fe, 0x000341fe},
3432 {0x0000a274, 0x0a180000, 0x0a180000, 0x0a1aa000, 0x0a1aa000, 0x0a1aa000},
3433};
3434
3435static const u32 ar9287Modes_rx_gain_9287_1_0[][6] = {
3436 {0x00009a00, 0x00000000, 0x00000000, 0x0000a120, 0x0000a120, 0x0000a120},
3437 {0x00009a04, 0x00000000, 0x00000000, 0x0000a124, 0x0000a124, 0x0000a124},
3438 {0x00009a08, 0x00000000, 0x00000000, 0x0000a128, 0x0000a128, 0x0000a128},
3439 {0x00009a0c, 0x00000000, 0x00000000, 0x0000a12c, 0x0000a12c, 0x0000a12c},
3440 {0x00009a10, 0x00000000, 0x00000000, 0x0000a130, 0x0000a130, 0x0000a130},
3441 {0x00009a14, 0x00000000, 0x00000000, 0x0000a194, 0x0000a194, 0x0000a194},
3442 {0x00009a18, 0x00000000, 0x00000000, 0x0000a198, 0x0000a198, 0x0000a198},
3443 {0x00009a1c, 0x00000000, 0x00000000, 0x0000a20c, 0x0000a20c, 0x0000a20c},
3444 {0x00009a20, 0x00000000, 0x00000000, 0x0000a210, 0x0000a210, 0x0000a210},
3445 {0x00009a24, 0x00000000, 0x00000000, 0x0000a284, 0x0000a284, 0x0000a284},
3446 {0x00009a28, 0x00000000, 0x00000000, 0x0000a288, 0x0000a288, 0x0000a288},
3447 {0x00009a2c, 0x00000000, 0x00000000, 0x0000a28c, 0x0000a28c, 0x0000a28c},
3448 {0x00009a30, 0x00000000, 0x00000000, 0x0000a290, 0x0000a290, 0x0000a290},
3449 {0x00009a34, 0x00000000, 0x00000000, 0x0000a294, 0x0000a294, 0x0000a294},
3450 {0x00009a38, 0x00000000, 0x00000000, 0x0000a2a0, 0x0000a2a0, 0x0000a2a0},
3451 {0x00009a3c, 0x00000000, 0x00000000, 0x0000a2a4, 0x0000a2a4, 0x0000a2a4},
3452 {0x00009a40, 0x00000000, 0x00000000, 0x0000a2a8, 0x0000a2a8, 0x0000a2a8},
3453 {0x00009a44, 0x00000000, 0x00000000, 0x0000a2ac, 0x0000a2ac, 0x0000a2ac},
3454 {0x00009a48, 0x00000000, 0x00000000, 0x0000a2b0, 0x0000a2b0, 0x0000a2b0},
3455 {0x00009a4c, 0x00000000, 0x00000000, 0x0000a2b4, 0x0000a2b4, 0x0000a2b4},
3456 {0x00009a50, 0x00000000, 0x00000000, 0x0000a2b8, 0x0000a2b8, 0x0000a2b8},
3457 {0x00009a54, 0x00000000, 0x00000000, 0x0000a2c4, 0x0000a2c4, 0x0000a2c4},
3458 {0x00009a58, 0x00000000, 0x00000000, 0x0000a708, 0x0000a708, 0x0000a708},
3459 {0x00009a5c, 0x00000000, 0x00000000, 0x0000a70c, 0x0000a70c, 0x0000a70c},
3460 {0x00009a60, 0x00000000, 0x00000000, 0x0000a710, 0x0000a710, 0x0000a710},
3461 {0x00009a64, 0x00000000, 0x00000000, 0x0000ab04, 0x0000ab04, 0x0000ab04},
3462 {0x00009a68, 0x00000000, 0x00000000, 0x0000ab08, 0x0000ab08, 0x0000ab08},
3463 {0x00009a6c, 0x00000000, 0x00000000, 0x0000ab0c, 0x0000ab0c, 0x0000ab0c},
3464 {0x00009a70, 0x00000000, 0x00000000, 0x0000ab10, 0x0000ab10, 0x0000ab10},
3465 {0x00009a74, 0x00000000, 0x00000000, 0x0000ab14, 0x0000ab14, 0x0000ab14},
3466 {0x00009a78, 0x00000000, 0x00000000, 0x0000ab18, 0x0000ab18, 0x0000ab18},
3467 {0x00009a7c, 0x00000000, 0x00000000, 0x0000ab8c, 0x0000ab8c, 0x0000ab8c},
3468 {0x00009a80, 0x00000000, 0x00000000, 0x0000ab90, 0x0000ab90, 0x0000ab90},
3469 {0x00009a84, 0x00000000, 0x00000000, 0x0000ab94, 0x0000ab94, 0x0000ab94},
3470 {0x00009a88, 0x00000000, 0x00000000, 0x0000ab98, 0x0000ab98, 0x0000ab98},
3471 {0x00009a8c, 0x00000000, 0x00000000, 0x0000aba4, 0x0000aba4, 0x0000aba4},
3472 {0x00009a90, 0x00000000, 0x00000000, 0x0000aba8, 0x0000aba8, 0x0000aba8},
3473 {0x00009a94, 0x00000000, 0x00000000, 0x0000cb04, 0x0000cb04, 0x0000cb04},
3474 {0x00009a98, 0x00000000, 0x00000000, 0x0000cb08, 0x0000cb08, 0x0000cb08},
3475 {0x00009a9c, 0x00000000, 0x00000000, 0x0000cb0c, 0x0000cb0c, 0x0000cb0c},
3476 {0x00009aa0, 0x00000000, 0x00000000, 0x0000cb10, 0x0000cb10, 0x0000cb10},
3477 {0x00009aa4, 0x00000000, 0x00000000, 0x0000cb14, 0x0000cb14, 0x0000cb14},
3478 {0x00009aa8, 0x00000000, 0x00000000, 0x0000cb18, 0x0000cb18, 0x0000cb18},
3479 {0x00009aac, 0x00000000, 0x00000000, 0x0000cb8c, 0x0000cb8c, 0x0000cb8c},
3480 {0x00009ab0, 0x00000000, 0x00000000, 0x0000cb90, 0x0000cb90, 0x0000cb90},
3481 {0x00009ab4, 0x00000000, 0x00000000, 0x0000cf18, 0x0000cf18, 0x0000cf18},
3482 {0x00009ab8, 0x00000000, 0x00000000, 0x0000cf24, 0x0000cf24, 0x0000cf24},
3483 {0x00009abc, 0x00000000, 0x00000000, 0x0000cf28, 0x0000cf28, 0x0000cf28},
3484 {0x00009ac0, 0x00000000, 0x00000000, 0x0000d314, 0x0000d314, 0x0000d314},
3485 {0x00009ac4, 0x00000000, 0x00000000, 0x0000d318, 0x0000d318, 0x0000d318},
3486 {0x00009ac8, 0x00000000, 0x00000000, 0x0000d38c, 0x0000d38c, 0x0000d38c},
3487 {0x00009acc, 0x00000000, 0x00000000, 0x0000d390, 0x0000d390, 0x0000d390},
3488 {0x00009ad0, 0x00000000, 0x00000000, 0x0000d394, 0x0000d394, 0x0000d394},
3489 {0x00009ad4, 0x00000000, 0x00000000, 0x0000d398, 0x0000d398, 0x0000d398},
3490 {0x00009ad8, 0x00000000, 0x00000000, 0x0000d3a4, 0x0000d3a4, 0x0000d3a4},
3491 {0x00009adc, 0x00000000, 0x00000000, 0x0000d3a8, 0x0000d3a8, 0x0000d3a8},
3492 {0x00009ae0, 0x00000000, 0x00000000, 0x0000d3ac, 0x0000d3ac, 0x0000d3ac},
3493 {0x00009ae4, 0x00000000, 0x00000000, 0x0000d3b0, 0x0000d3b0, 0x0000d3b0},
3494 {0x00009ae8, 0x00000000, 0x00000000, 0x0000f380, 0x0000f380, 0x0000f380},
3495 {0x00009aec, 0x00000000, 0x00000000, 0x0000f384, 0x0000f384, 0x0000f384},
3496 {0x00009af0, 0x00000000, 0x00000000, 0x0000f388, 0x0000f388, 0x0000f388},
3497 {0x00009af4, 0x00000000, 0x00000000, 0x0000f710, 0x0000f710, 0x0000f710},
3498 {0x00009af8, 0x00000000, 0x00000000, 0x0000f714, 0x0000f714, 0x0000f714},
3499 {0x00009afc, 0x00000000, 0x00000000, 0x0000f718, 0x0000f718, 0x0000f718},
3500 {0x00009b00, 0x00000000, 0x00000000, 0x0000fb10, 0x0000fb10, 0x0000fb10},
3501 {0x00009b04, 0x00000000, 0x00000000, 0x0000fb14, 0x0000fb14, 0x0000fb14},
3502 {0x00009b08, 0x00000000, 0x00000000, 0x0000fb18, 0x0000fb18, 0x0000fb18},
3503 {0x00009b0c, 0x00000000, 0x00000000, 0x0000fb8c, 0x0000fb8c, 0x0000fb8c},
3504 {0x00009b10, 0x00000000, 0x00000000, 0x0000fb90, 0x0000fb90, 0x0000fb90},
3505 {0x00009b14, 0x00000000, 0x00000000, 0x0000fb94, 0x0000fb94, 0x0000fb94},
3506 {0x00009b18, 0x00000000, 0x00000000, 0x0000ff8c, 0x0000ff8c, 0x0000ff8c},
3507 {0x00009b1c, 0x00000000, 0x00000000, 0x0000ff90, 0x0000ff90, 0x0000ff90},
3508 {0x00009b20, 0x00000000, 0x00000000, 0x0000ff94, 0x0000ff94, 0x0000ff94},
3509 {0x00009b24, 0x00000000, 0x00000000, 0x0000ffa0, 0x0000ffa0, 0x0000ffa0},
3510 {0x00009b28, 0x00000000, 0x00000000, 0x0000ffa4, 0x0000ffa4, 0x0000ffa4},
3511 {0x00009b2c, 0x00000000, 0x00000000, 0x0000ffa8, 0x0000ffa8, 0x0000ffa8},
3512 {0x00009b30, 0x00000000, 0x00000000, 0x0000ffac, 0x0000ffac, 0x0000ffac},
3513 {0x00009b34, 0x00000000, 0x00000000, 0x0000ffb0, 0x0000ffb0, 0x0000ffb0},
3514 {0x00009b38, 0x00000000, 0x00000000, 0x0000ffb4, 0x0000ffb4, 0x0000ffb4},
3515 {0x00009b3c, 0x00000000, 0x00000000, 0x0000ffa1, 0x0000ffa1, 0x0000ffa1},
3516 {0x00009b40, 0x00000000, 0x00000000, 0x0000ffa5, 0x0000ffa5, 0x0000ffa5},
3517 {0x00009b44, 0x00000000, 0x00000000, 0x0000ffa9, 0x0000ffa9, 0x0000ffa9},
3518 {0x00009b48, 0x00000000, 0x00000000, 0x0000ffad, 0x0000ffad, 0x0000ffad},
3519 {0x00009b4c, 0x00000000, 0x00000000, 0x0000ffb1, 0x0000ffb1, 0x0000ffb1},
3520 {0x00009b50, 0x00000000, 0x00000000, 0x0000ffb5, 0x0000ffb5, 0x0000ffb5},
3521 {0x00009b54, 0x00000000, 0x00000000, 0x0000ffb9, 0x0000ffb9, 0x0000ffb9},
3522 {0x00009b58, 0x00000000, 0x00000000, 0x0000ffc5, 0x0000ffc5, 0x0000ffc5},
3523 {0x00009b5c, 0x00000000, 0x00000000, 0x0000ffc9, 0x0000ffc9, 0x0000ffc9},
3524 {0x00009b60, 0x00000000, 0x00000000, 0x0000ffcd, 0x0000ffcd, 0x0000ffcd},
3525 {0x00009b64, 0x00000000, 0x00000000, 0x0000ffd1, 0x0000ffd1, 0x0000ffd1},
3526 {0x00009b68, 0x00000000, 0x00000000, 0x0000ffd5, 0x0000ffd5, 0x0000ffd5},
3527 {0x00009b6c, 0x00000000, 0x00000000, 0x0000ffc2, 0x0000ffc2, 0x0000ffc2},
3528 {0x00009b70, 0x00000000, 0x00000000, 0x0000ffc6, 0x0000ffc6, 0x0000ffc6},
3529 {0x00009b74, 0x00000000, 0x00000000, 0x0000ffca, 0x0000ffca, 0x0000ffca},
3530 {0x00009b78, 0x00000000, 0x00000000, 0x0000ffce, 0x0000ffce, 0x0000ffce},
3531 {0x00009b7c, 0x00000000, 0x00000000, 0x0000ffd2, 0x0000ffd2, 0x0000ffd2},
3532 {0x00009b80, 0x00000000, 0x00000000, 0x0000ffd6, 0x0000ffd6, 0x0000ffd6},
3533 {0x00009b84, 0x00000000, 0x00000000, 0x0000ffda, 0x0000ffda, 0x0000ffda},
3534 {0x00009b88, 0x00000000, 0x00000000, 0x0000ffc7, 0x0000ffc7, 0x0000ffc7},
3535 {0x00009b8c, 0x00000000, 0x00000000, 0x0000ffcb, 0x0000ffcb, 0x0000ffcb},
3536 {0x00009b90, 0x00000000, 0x00000000, 0x0000ffcf, 0x0000ffcf, 0x0000ffcf},
3537 {0x00009b94, 0x00000000, 0x00000000, 0x0000ffd3, 0x0000ffd3, 0x0000ffd3},
3538 {0x00009b98, 0x00000000, 0x00000000, 0x0000ffd7, 0x0000ffd7, 0x0000ffd7},
3539 {0x00009b9c, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
3540 {0x00009ba0, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
3541 {0x00009ba4, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
3542 {0x00009ba8, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
3543 {0x00009bac, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
3544 {0x00009bb0, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
3545 {0x00009bb4, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
3546 {0x00009bb8, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
3547 {0x00009bbc, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
3548 {0x00009bc0, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
3549 {0x00009bc4, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
3550 {0x00009bc8, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
3551 {0x00009bcc, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
3552 {0x00009bd0, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
3553 {0x00009bd4, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
3554 {0x00009bd8, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
3555 {0x00009bdc, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
3556 {0x00009be0, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
3557 {0x00009be4, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
3558 {0x00009be8, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
3559 {0x00009bec, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
3560 {0x00009bf0, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
3561 {0x00009bf4, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
3562 {0x00009bf8, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
3563 {0x00009bfc, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
3564 {0x0000aa00, 0x00000000, 0x00000000, 0x0000a120, 0x0000a120, 0x0000a120},
3565 {0x0000aa04, 0x00000000, 0x00000000, 0x0000a124, 0x0000a124, 0x0000a124},
3566 {0x0000aa08, 0x00000000, 0x00000000, 0x0000a128, 0x0000a128, 0x0000a128},
3567 {0x0000aa0c, 0x00000000, 0x00000000, 0x0000a12c, 0x0000a12c, 0x0000a12c},
3568 {0x0000aa10, 0x00000000, 0x00000000, 0x0000a130, 0x0000a130, 0x0000a130},
3569 {0x0000aa14, 0x00000000, 0x00000000, 0x0000a194, 0x0000a194, 0x0000a194},
3570 {0x0000aa18, 0x00000000, 0x00000000, 0x0000a198, 0x0000a198, 0x0000a198},
3571 {0x0000aa1c, 0x00000000, 0x00000000, 0x0000a20c, 0x0000a20c, 0x0000a20c},
3572 {0x0000aa20, 0x00000000, 0x00000000, 0x0000a210, 0x0000a210, 0x0000a210},
3573 {0x0000aa24, 0x00000000, 0x00000000, 0x0000a284, 0x0000a284, 0x0000a284},
3574 {0x0000aa28, 0x00000000, 0x00000000, 0x0000a288, 0x0000a288, 0x0000a288},
3575 {0x0000aa2c, 0x00000000, 0x00000000, 0x0000a28c, 0x0000a28c, 0x0000a28c},
3576 {0x0000aa30, 0x00000000, 0x00000000, 0x0000a290, 0x0000a290, 0x0000a290},
3577 {0x0000aa34, 0x00000000, 0x00000000, 0x0000a294, 0x0000a294, 0x0000a294},
3578 {0x0000aa38, 0x00000000, 0x00000000, 0x0000a2a0, 0x0000a2a0, 0x0000a2a0},
3579 {0x0000aa3c, 0x00000000, 0x00000000, 0x0000a2a4, 0x0000a2a4, 0x0000a2a4},
3580 {0x0000aa40, 0x00000000, 0x00000000, 0x0000a2a8, 0x0000a2a8, 0x0000a2a8},
3581 {0x0000aa44, 0x00000000, 0x00000000, 0x0000a2ac, 0x0000a2ac, 0x0000a2ac},
3582 {0x0000aa48, 0x00000000, 0x00000000, 0x0000a2b0, 0x0000a2b0, 0x0000a2b0},
3583 {0x0000aa4c, 0x00000000, 0x00000000, 0x0000a2b4, 0x0000a2b4, 0x0000a2b4},
3584 {0x0000aa50, 0x00000000, 0x00000000, 0x0000a2b8, 0x0000a2b8, 0x0000a2b8},
3585 {0x0000aa54, 0x00000000, 0x00000000, 0x0000a2c4, 0x0000a2c4, 0x0000a2c4},
3586 {0x0000aa58, 0x00000000, 0x00000000, 0x0000a708, 0x0000a708, 0x0000a708},
3587 {0x0000aa5c, 0x00000000, 0x00000000, 0x0000a70c, 0x0000a70c, 0x0000a70c},
3588 {0x0000aa60, 0x00000000, 0x00000000, 0x0000a710, 0x0000a710, 0x0000a710},
3589 {0x0000aa64, 0x00000000, 0x00000000, 0x0000ab04, 0x0000ab04, 0x0000ab04},
3590 {0x0000aa68, 0x00000000, 0x00000000, 0x0000ab08, 0x0000ab08, 0x0000ab08},
3591 {0x0000aa6c, 0x00000000, 0x00000000, 0x0000ab0c, 0x0000ab0c, 0x0000ab0c},
3592 {0x0000aa70, 0x00000000, 0x00000000, 0x0000ab10, 0x0000ab10, 0x0000ab10},
3593 {0x0000aa74, 0x00000000, 0x00000000, 0x0000ab14, 0x0000ab14, 0x0000ab14},
3594 {0x0000aa78, 0x00000000, 0x00000000, 0x0000ab18, 0x0000ab18, 0x0000ab18},
3595 {0x0000aa7c, 0x00000000, 0x00000000, 0x0000ab8c, 0x0000ab8c, 0x0000ab8c},
3596 {0x0000aa80, 0x00000000, 0x00000000, 0x0000ab90, 0x0000ab90, 0x0000ab90},
3597 {0x0000aa84, 0x00000000, 0x00000000, 0x0000ab94, 0x0000ab94, 0x0000ab94},
3598 {0x0000aa88, 0x00000000, 0x00000000, 0x0000ab98, 0x0000ab98, 0x0000ab98},
3599 {0x0000aa8c, 0x00000000, 0x00000000, 0x0000aba4, 0x0000aba4, 0x0000aba4},
3600 {0x0000aa90, 0x00000000, 0x00000000, 0x0000aba8, 0x0000aba8, 0x0000aba8},
3601 {0x0000aa94, 0x00000000, 0x00000000, 0x0000cb04, 0x0000cb04, 0x0000cb04},
3602 {0x0000aa98, 0x00000000, 0x00000000, 0x0000cb08, 0x0000cb08, 0x0000cb08},
3603 {0x0000aa9c, 0x00000000, 0x00000000, 0x0000cb0c, 0x0000cb0c, 0x0000cb0c},
3604 {0x0000aaa0, 0x00000000, 0x00000000, 0x0000cb10, 0x0000cb10, 0x0000cb10},
3605 {0x0000aaa4, 0x00000000, 0x00000000, 0x0000cb14, 0x0000cb14, 0x0000cb14},
3606 {0x0000aaa8, 0x00000000, 0x00000000, 0x0000cb18, 0x0000cb18, 0x0000cb18},
3607 {0x0000aaac, 0x00000000, 0x00000000, 0x0000cb8c, 0x0000cb8c, 0x0000cb8c},
3608 {0x0000aab0, 0x00000000, 0x00000000, 0x0000cb90, 0x0000cb90, 0x0000cb90},
3609 {0x0000aab4, 0x00000000, 0x00000000, 0x0000cf18, 0x0000cf18, 0x0000cf18},
3610 {0x0000aab8, 0x00000000, 0x00000000, 0x0000cf24, 0x0000cf24, 0x0000cf24},
3611 {0x0000aabc, 0x00000000, 0x00000000, 0x0000cf28, 0x0000cf28, 0x0000cf28},
3612 {0x0000aac0, 0x00000000, 0x00000000, 0x0000d314, 0x0000d314, 0x0000d314},
3613 {0x0000aac4, 0x00000000, 0x00000000, 0x0000d318, 0x0000d318, 0x0000d318},
3614 {0x0000aac8, 0x00000000, 0x00000000, 0x0000d38c, 0x0000d38c, 0x0000d38c},
3615 {0x0000aacc, 0x00000000, 0x00000000, 0x0000d390, 0x0000d390, 0x0000d390},
3616 {0x0000aad0, 0x00000000, 0x00000000, 0x0000d394, 0x0000d394, 0x0000d394},
3617 {0x0000aad4, 0x00000000, 0x00000000, 0x0000d398, 0x0000d398, 0x0000d398},
3618 {0x0000aad8, 0x00000000, 0x00000000, 0x0000d3a4, 0x0000d3a4, 0x0000d3a4},
3619 {0x0000aadc, 0x00000000, 0x00000000, 0x0000d3a8, 0x0000d3a8, 0x0000d3a8},
3620 {0x0000aae0, 0x00000000, 0x00000000, 0x0000d3ac, 0x0000d3ac, 0x0000d3ac},
3621 {0x0000aae4, 0x00000000, 0x00000000, 0x0000d3b0, 0x0000d3b0, 0x0000d3b0},
3622 {0x0000aae8, 0x00000000, 0x00000000, 0x0000f380, 0x0000f380, 0x0000f380},
3623 {0x0000aaec, 0x00000000, 0x00000000, 0x0000f384, 0x0000f384, 0x0000f384},
3624 {0x0000aaf0, 0x00000000, 0x00000000, 0x0000f388, 0x0000f388, 0x0000f388},
3625 {0x0000aaf4, 0x00000000, 0x00000000, 0x0000f710, 0x0000f710, 0x0000f710},
3626 {0x0000aaf8, 0x00000000, 0x00000000, 0x0000f714, 0x0000f714, 0x0000f714},
3627 {0x0000aafc, 0x00000000, 0x00000000, 0x0000f718, 0x0000f718, 0x0000f718},
3628 {0x0000ab00, 0x00000000, 0x00000000, 0x0000fb10, 0x0000fb10, 0x0000fb10},
3629 {0x0000ab04, 0x00000000, 0x00000000, 0x0000fb14, 0x0000fb14, 0x0000fb14},
3630 {0x0000ab08, 0x00000000, 0x00000000, 0x0000fb18, 0x0000fb18, 0x0000fb18},
3631 {0x0000ab0c, 0x00000000, 0x00000000, 0x0000fb8c, 0x0000fb8c, 0x0000fb8c},
3632 {0x0000ab10, 0x00000000, 0x00000000, 0x0000fb90, 0x0000fb90, 0x0000fb90},
3633 {0x0000ab14, 0x00000000, 0x00000000, 0x0000fb94, 0x0000fb94, 0x0000fb94},
3634 {0x0000ab18, 0x00000000, 0x00000000, 0x0000ff8c, 0x0000ff8c, 0x0000ff8c},
3635 {0x0000ab1c, 0x00000000, 0x00000000, 0x0000ff90, 0x0000ff90, 0x0000ff90},
3636 {0x0000ab20, 0x00000000, 0x00000000, 0x0000ff94, 0x0000ff94, 0x0000ff94},
3637 {0x0000ab24, 0x00000000, 0x00000000, 0x0000ffa0, 0x0000ffa0, 0x0000ffa0},
3638 {0x0000ab28, 0x00000000, 0x00000000, 0x0000ffa4, 0x0000ffa4, 0x0000ffa4},
3639 {0x0000ab2c, 0x00000000, 0x00000000, 0x0000ffa8, 0x0000ffa8, 0x0000ffa8},
3640 {0x0000ab30, 0x00000000, 0x00000000, 0x0000ffac, 0x0000ffac, 0x0000ffac},
3641 {0x0000ab34, 0x00000000, 0x00000000, 0x0000ffb0, 0x0000ffb0, 0x0000ffb0},
3642 {0x0000ab38, 0x00000000, 0x00000000, 0x0000ffb4, 0x0000ffb4, 0x0000ffb4},
3643 {0x0000ab3c, 0x00000000, 0x00000000, 0x0000ffa1, 0x0000ffa1, 0x0000ffa1},
3644 {0x0000ab40, 0x00000000, 0x00000000, 0x0000ffa5, 0x0000ffa5, 0x0000ffa5},
3645 {0x0000ab44, 0x00000000, 0x00000000, 0x0000ffa9, 0x0000ffa9, 0x0000ffa9},
3646 {0x0000ab48, 0x00000000, 0x00000000, 0x0000ffad, 0x0000ffad, 0x0000ffad},
3647 {0x0000ab4c, 0x00000000, 0x00000000, 0x0000ffb1, 0x0000ffb1, 0x0000ffb1},
3648 {0x0000ab50, 0x00000000, 0x00000000, 0x0000ffb5, 0x0000ffb5, 0x0000ffb5},
3649 {0x0000ab54, 0x00000000, 0x00000000, 0x0000ffb9, 0x0000ffb9, 0x0000ffb9},
3650 {0x0000ab58, 0x00000000, 0x00000000, 0x0000ffc5, 0x0000ffc5, 0x0000ffc5},
3651 {0x0000ab5c, 0x00000000, 0x00000000, 0x0000ffc9, 0x0000ffc9, 0x0000ffc9},
3652 {0x0000ab60, 0x00000000, 0x00000000, 0x0000ffcd, 0x0000ffcd, 0x0000ffcd},
3653 {0x0000ab64, 0x00000000, 0x00000000, 0x0000ffd1, 0x0000ffd1, 0x0000ffd1},
3654 {0x0000ab68, 0x00000000, 0x00000000, 0x0000ffd5, 0x0000ffd5, 0x0000ffd5},
3655 {0x0000ab6c, 0x00000000, 0x00000000, 0x0000ffc2, 0x0000ffc2, 0x0000ffc2},
3656 {0x0000ab70, 0x00000000, 0x00000000, 0x0000ffc6, 0x0000ffc6, 0x0000ffc6},
3657 {0x0000ab74, 0x00000000, 0x00000000, 0x0000ffca, 0x0000ffca, 0x0000ffca},
3658 {0x0000ab78, 0x00000000, 0x00000000, 0x0000ffce, 0x0000ffce, 0x0000ffce},
3659 {0x0000ab7c, 0x00000000, 0x00000000, 0x0000ffd2, 0x0000ffd2, 0x0000ffd2},
3660 {0x0000ab80, 0x00000000, 0x00000000, 0x0000ffd6, 0x0000ffd6, 0x0000ffd6},
3661 {0x0000ab84, 0x00000000, 0x00000000, 0x0000ffda, 0x0000ffda, 0x0000ffda},
3662 {0x0000ab88, 0x00000000, 0x00000000, 0x0000ffc7, 0x0000ffc7, 0x0000ffc7},
3663 {0x0000ab8c, 0x00000000, 0x00000000, 0x0000ffcb, 0x0000ffcb, 0x0000ffcb},
3664 {0x0000ab90, 0x00000000, 0x00000000, 0x0000ffcf, 0x0000ffcf, 0x0000ffcf},
3665 {0x0000ab94, 0x00000000, 0x00000000, 0x0000ffd3, 0x0000ffd3, 0x0000ffd3},
3666 {0x0000ab98, 0x00000000, 0x00000000, 0x0000ffd7, 0x0000ffd7, 0x0000ffd7},
3667 {0x0000ab9c, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
3668 {0x0000aba0, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
3669 {0x0000aba4, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
3670 {0x0000aba8, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
3671 {0x0000abac, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
3672 {0x0000abb0, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
3673 {0x0000abb4, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
3674 {0x0000abb8, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
3675 {0x0000abbc, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
3676 {0x0000abc0, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
3677 {0x0000abc4, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
3678 {0x0000abc8, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
3679 {0x0000abcc, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
3680 {0x0000abd0, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
3681 {0x0000abd4, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
3682 {0x0000abd8, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
3683 {0x0000abdc, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
3684 {0x0000abe0, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
3685 {0x0000abe4, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
3686 {0x0000abe8, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
3687 {0x0000abec, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
3688 {0x0000abf0, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
3689 {0x0000abf4, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
3690 {0x0000abf8, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
3691 {0x0000abfc, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
3692 {0x00009848, 0x00000000, 0x00000000, 0x00001067, 0x00001067, 0x00001067},
3693 {0x0000a848, 0x00000000, 0x00000000, 0x00001067, 0x00001067, 0x00001067},
3694};
3695
3696static const u32 ar9287PciePhy_clkreq_always_on_L1_9287_1_0[][2] = {
3697 /* Addr allmodes */
3698 {0x00004040, 0x9248fd00},
3699 {0x00004040, 0x24924924},
3700 {0x00004040, 0xa8000019},
3701 {0x00004040, 0x13160820},
3702 {0x00004040, 0xe5980560},
3703 {0x00004040, 0xc01dcffd},
3704 {0x00004040, 0x1aaabe41},
3705 {0x00004040, 0xbe105554},
3706 {0x00004040, 0x00043007},
3707 {0x00004044, 0x00000000},
3708};
3709
3710static const u32 ar9287PciePhy_clkreq_off_L1_9287_1_0[][2] = {
3711 /* Addr allmodes */
3712 {0x00004040, 0x9248fd00},
3713 {0x00004040, 0x24924924},
3714 {0x00004040, 0xa8000019},
3715 {0x00004040, 0x13160820},
3716 {0x00004040, 0xe5980560},
3717 {0x00004040, 0xc01dcffc},
3718 {0x00004040, 0x1aaabe41},
3719 {0x00004040, 0xbe105554},
3720 {0x00004040, 0x00043007},
3721 {0x00004044, 0x00000000},
3722};
3723
3724static const u32 ar9287Modes_9287_1_1[][6] = { 1763static const u32 ar9287Modes_9287_1_1[][6] = {
3725 {0x00001030, 0x00000000, 0x00000000, 0x000002c0, 0x00000160, 0x000001e0}, 1764 {0x00001030, 0x00000000, 0x00000000, 0x000002c0, 0x00000160, 0x000001e0},
3726 {0x00001070, 0x00000000, 0x00000000, 0x00000318, 0x0000018c, 0x000001e0}, 1765 {0x00001070, 0x00000000, 0x00000000, 0x00000318, 0x0000018c, 0x000001e0},
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_mac.c b/drivers/net/wireless/ath/ath9k/ar9003_mac.c
index 06ef71019c12..5b995bee70ae 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_mac.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_mac.c
@@ -579,12 +579,39 @@ int ath9k_hw_process_rxdesc_edma(struct ath_hw *ah, struct ath_rx_status *rxs,
579 rxs->rs_flags |= ATH9K_RX_DECRYPT_BUSY; 579 rxs->rs_flags |= ATH9K_RX_DECRYPT_BUSY;
580 580
581 if ((rxsp->status11 & AR_RxFrameOK) == 0) { 581 if ((rxsp->status11 & AR_RxFrameOK) == 0) {
582 /*
583 * AR_CRCErr will bet set to true if we're on the last
584 * subframe and the AR_PostDelimCRCErr is caught.
585 * In a way this also gives us a guarantee that when
586 * (!(AR_CRCErr) && (AR_PostDelimCRCErr)) we cannot
587 * possibly be reviewing the last subframe. AR_CRCErr
588 * is the CRC of the actual data.
589 */
582 if (rxsp->status11 & AR_CRCErr) { 590 if (rxsp->status11 & AR_CRCErr) {
583 rxs->rs_status |= ATH9K_RXERR_CRC; 591 rxs->rs_status |= ATH9K_RXERR_CRC;
584 } else if (rxsp->status11 & AR_PHYErr) { 592 } else if (rxsp->status11 & AR_PHYErr) {
585 rxs->rs_status |= ATH9K_RXERR_PHY;
586 phyerr = MS(rxsp->status11, AR_PHYErrCode); 593 phyerr = MS(rxsp->status11, AR_PHYErrCode);
587 rxs->rs_phyerr = phyerr; 594 /*
595 * If we reach a point here where AR_PostDelimCRCErr is
596 * true it implies we're *not* on the last subframe. In
597 * in that case that we know already that the CRC of
598 * the frame was OK, and MAC would send an ACK for that
599 * subframe, even if we did get a phy error of type
600 * ATH9K_PHYERR_OFDM_RESTART. This is only applicable
601 * to frame that are prior to the last subframe.
602 * The AR_PostDelimCRCErr is the CRC for the MPDU
603 * delimiter, which contains the 4 reserved bits,
604 * the MPDU length (12 bits), and follows the MPDU
605 * delimiter for an A-MPDU subframe (0x4E = 'N' ASCII).
606 */
607 if ((phyerr == ATH9K_PHYERR_OFDM_RESTART) &&
608 (rxsp->status11 & AR_PostDelimCRCErr)) {
609 rxs->rs_phyerr = 0;
610 } else {
611 rxs->rs_status |= ATH9K_RXERR_PHY;
612 rxs->rs_phyerr = phyerr;
613 }
614
588 } else if (rxsp->status11 & AR_DecryptCRCErr) { 615 } else if (rxsp->status11 & AR_DecryptCRCErr) {
589 rxs->rs_status |= ATH9K_RXERR_DECRYPT; 616 rxs->rs_status |= ATH9K_RXERR_DECRYPT;
590 } else if (rxsp->status11 & AR_MichaelErr) { 617 } else if (rxsp->status11 & AR_MichaelErr) {
diff --git a/drivers/net/wireless/ath/ath9k/eeprom_4k.c b/drivers/net/wireless/ath/ath9k/eeprom_4k.c
index afafc4d4b8fb..9cccd12e8f21 100644
--- a/drivers/net/wireless/ath/ath9k/eeprom_4k.c
+++ b/drivers/net/wireless/ath/ath9k/eeprom_4k.c
@@ -222,7 +222,7 @@ static void ath9k_hw_get_4k_gain_boundaries_pdadcs(struct ath_hw *ah,
222 struct ath9k_channel *chan, 222 struct ath9k_channel *chan,
223 struct cal_data_per_freq_4k *pRawDataSet, 223 struct cal_data_per_freq_4k *pRawDataSet,
224 u8 *bChans, u16 availPiers, 224 u8 *bChans, u16 availPiers,
225 u16 tPdGainOverlap, int16_t *pMinCalPower, 225 u16 tPdGainOverlap,
226 u16 *pPdGainBoundaries, u8 *pPDADCValues, 226 u16 *pPdGainBoundaries, u8 *pPDADCValues,
227 u16 numXpdGains) 227 u16 numXpdGains)
228{ 228{
@@ -308,8 +308,6 @@ static void ath9k_hw_get_4k_gain_boundaries_pdadcs(struct ath_hw *ah,
308 } 308 }
309 } 309 }
310 310
311 *pMinCalPower = (int16_t)(minPwrT4[0] / 2);
312
313 k = 0; 311 k = 0;
314 312
315 for (i = 0; i < numXpdGains; i++) { 313 for (i = 0; i < numXpdGains; i++) {
@@ -399,7 +397,6 @@ static void ath9k_hw_set_4k_power_cal_table(struct ath_hw *ah,
399 static u8 pdadcValues[AR5416_NUM_PDADC_VALUES]; 397 static u8 pdadcValues[AR5416_NUM_PDADC_VALUES];
400 u16 gainBoundaries[AR5416_EEP4K_PD_GAINS_IN_MASK]; 398 u16 gainBoundaries[AR5416_EEP4K_PD_GAINS_IN_MASK];
401 u16 numPiers, i, j; 399 u16 numPiers, i, j;
402 int16_t tMinCalPower;
403 u16 numXpdGain, xpdMask; 400 u16 numXpdGain, xpdMask;
404 u16 xpdGainValues[AR5416_EEP4K_NUM_PD_GAINS] = { 0, 0 }; 401 u16 xpdGainValues[AR5416_EEP4K_NUM_PD_GAINS] = { 0, 0 };
405 u32 reg32, regOffset, regChainOffset; 402 u32 reg32, regOffset, regChainOffset;
@@ -452,7 +449,7 @@ static void ath9k_hw_set_4k_power_cal_table(struct ath_hw *ah,
452 ath9k_hw_get_4k_gain_boundaries_pdadcs(ah, chan, 449 ath9k_hw_get_4k_gain_boundaries_pdadcs(ah, chan,
453 pRawDataset, pCalBChans, 450 pRawDataset, pCalBChans,
454 numPiers, pdGainOverlap_t2, 451 numPiers, pdGainOverlap_t2,
455 &tMinCalPower, gainBoundaries, 452 gainBoundaries,
456 pdadcValues, numXpdGain); 453 pdadcValues, numXpdGain);
457 454
458 ENABLE_REGWRITE_BUFFER(ah); 455 ENABLE_REGWRITE_BUFFER(ah);
diff --git a/drivers/net/wireless/ath/ath9k/eeprom_9287.c b/drivers/net/wireless/ath/ath9k/eeprom_9287.c
index 37207dfd1799..4a52cf03808b 100644
--- a/drivers/net/wireless/ath/ath9k/eeprom_9287.c
+++ b/drivers/net/wireless/ath/ath9k/eeprom_9287.c
@@ -223,7 +223,6 @@ static void ath9k_hw_get_ar9287_gain_boundaries_pdadcs(struct ath_hw *ah,
223 struct cal_data_per_freq_ar9287 *pRawDataSet, 223 struct cal_data_per_freq_ar9287 *pRawDataSet,
224 u8 *bChans, u16 availPiers, 224 u8 *bChans, u16 availPiers,
225 u16 tPdGainOverlap, 225 u16 tPdGainOverlap,
226 int16_t *pMinCalPower,
227 u16 *pPdGainBoundaries, 226 u16 *pPdGainBoundaries,
228 u8 *pPDADCValues, 227 u8 *pPDADCValues,
229 u16 numXpdGains) 228 u16 numXpdGains)
@@ -303,7 +302,6 @@ static void ath9k_hw_get_ar9287_gain_boundaries_pdadcs(struct ath_hw *ah,
303 } 302 }
304 } 303 }
305 304
306 *pMinCalPower = (int16_t)(minPwrT4[0] / 2);
307 k = 0; 305 k = 0;
308 306
309 for (i = 0; i < numXpdGains; i++) { 307 for (i = 0; i < numXpdGains; i++) {
@@ -458,7 +456,6 @@ static void ath9k_hw_set_ar9287_power_cal_table(struct ath_hw *ah,
458 u8 pdadcValues[AR9287_NUM_PDADC_VALUES]; 456 u8 pdadcValues[AR9287_NUM_PDADC_VALUES];
459 u16 gainBoundaries[AR9287_PD_GAINS_IN_MASK]; 457 u16 gainBoundaries[AR9287_PD_GAINS_IN_MASK];
460 u16 numPiers = 0, i, j; 458 u16 numPiers = 0, i, j;
461 int16_t tMinCalPower;
462 u16 numXpdGain, xpdMask; 459 u16 numXpdGain, xpdMask;
463 u16 xpdGainValues[AR9287_NUM_PD_GAINS] = {0, 0, 0, 0}; 460 u16 xpdGainValues[AR9287_NUM_PD_GAINS] = {0, 0, 0, 0};
464 u32 reg32, regOffset, regChainOffset, regval; 461 u32 reg32, regOffset, regChainOffset, regval;
@@ -530,7 +527,6 @@ static void ath9k_hw_set_ar9287_power_cal_table(struct ath_hw *ah,
530 pRawDataset, 527 pRawDataset,
531 pCalBChans, numPiers, 528 pCalBChans, numPiers,
532 pdGainOverlap_t2, 529 pdGainOverlap_t2,
533 &tMinCalPower,
534 gainBoundaries, 530 gainBoundaries,
535 pdadcValues, 531 pdadcValues,
536 numXpdGain); 532 numXpdGain);
diff --git a/drivers/net/wireless/ath/ath9k/eeprom_def.c b/drivers/net/wireless/ath/ath9k/eeprom_def.c
index 02e6c2a55fe4..afa2b73ddbdd 100644
--- a/drivers/net/wireless/ath/ath9k/eeprom_def.c
+++ b/drivers/net/wireless/ath/ath9k/eeprom_def.c
@@ -593,7 +593,7 @@ static void ath9k_hw_get_def_gain_boundaries_pdadcs(struct ath_hw *ah,
593 struct ath9k_channel *chan, 593 struct ath9k_channel *chan,
594 struct cal_data_per_freq *pRawDataSet, 594 struct cal_data_per_freq *pRawDataSet,
595 u8 *bChans, u16 availPiers, 595 u8 *bChans, u16 availPiers,
596 u16 tPdGainOverlap, int16_t *pMinCalPower, 596 u16 tPdGainOverlap,
597 u16 *pPdGainBoundaries, u8 *pPDADCValues, 597 u16 *pPdGainBoundaries, u8 *pPDADCValues,
598 u16 numXpdGains) 598 u16 numXpdGains)
599{ 599{
@@ -675,8 +675,6 @@ static void ath9k_hw_get_def_gain_boundaries_pdadcs(struct ath_hw *ah,
675 } 675 }
676 } 676 }
677 677
678 *pMinCalPower = (int16_t)(minPwrT4[0] / 2);
679
680 k = 0; 678 k = 0;
681 679
682 for (i = 0; i < numXpdGains; i++) { 680 for (i = 0; i < numXpdGains; i++) {
@@ -838,7 +836,7 @@ static void ath9k_hw_set_def_power_cal_table(struct ath_hw *ah,
838 static u8 pdadcValues[AR5416_NUM_PDADC_VALUES]; 836 static u8 pdadcValues[AR5416_NUM_PDADC_VALUES];
839 u16 gainBoundaries[AR5416_PD_GAINS_IN_MASK]; 837 u16 gainBoundaries[AR5416_PD_GAINS_IN_MASK];
840 u16 numPiers, i, j; 838 u16 numPiers, i, j;
841 int16_t tMinCalPower, diff = 0; 839 int16_t diff = 0;
842 u16 numXpdGain, xpdMask; 840 u16 numXpdGain, xpdMask;
843 u16 xpdGainValues[AR5416_NUM_PD_GAINS] = { 0, 0, 0, 0 }; 841 u16 xpdGainValues[AR5416_NUM_PD_GAINS] = { 0, 0, 0, 0 };
844 u32 reg32, regOffset, regChainOffset; 842 u32 reg32, regOffset, regChainOffset;
@@ -923,7 +921,6 @@ static void ath9k_hw_set_def_power_cal_table(struct ath_hw *ah,
923 chan, pRawDataset, 921 chan, pRawDataset,
924 pCalBChans, numPiers, 922 pCalBChans, numPiers,
925 pdGainOverlap_t2, 923 pdGainOverlap_t2,
926 &tMinCalPower,
927 gainBoundaries, 924 gainBoundaries,
928 pdadcValues, 925 pdadcValues,
929 numXpdGain); 926 numXpdGain);
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
index e38ca66db849..32438771ca2b 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
@@ -438,10 +438,11 @@ static void ath9k_htc_update_rate(struct ath9k_htc_priv *priv,
438 bss_conf->bssid, be32_to_cpu(trate.capflags)); 438 bss_conf->bssid, be32_to_cpu(trate.capflags));
439} 439}
440 440
441int ath9k_htc_tx_aggr_oper(struct ath9k_htc_priv *priv, 441static int ath9k_htc_tx_aggr_oper(struct ath9k_htc_priv *priv,
442 struct ieee80211_vif *vif, 442 struct ieee80211_vif *vif,
443 struct ieee80211_sta *sta, 443 struct ieee80211_sta *sta,
444 enum ieee80211_ampdu_mlme_action action, u16 tid) 444 enum ieee80211_ampdu_mlme_action action,
445 u16 tid)
445{ 446{
446 struct ath_common *common = ath9k_hw_common(priv->ah); 447 struct ath_common *common = ath9k_hw_common(priv->ah);
447 struct ath9k_htc_target_aggr aggr; 448 struct ath9k_htc_target_aggr aggr;
@@ -492,8 +493,7 @@ static int ath9k_debugfs_open(struct inode *inode, struct file *file)
492static ssize_t read_file_tgt_stats(struct file *file, char __user *user_buf, 493static ssize_t read_file_tgt_stats(struct file *file, char __user *user_buf,
493 size_t count, loff_t *ppos) 494 size_t count, loff_t *ppos)
494{ 495{
495 struct ath9k_htc_priv *priv = 496 struct ath9k_htc_priv *priv = file->private_data;
496 (struct ath9k_htc_priv *) file->private_data;
497 struct ath9k_htc_target_stats cmd_rsp; 497 struct ath9k_htc_target_stats cmd_rsp;
498 char buf[512]; 498 char buf[512];
499 unsigned int len = 0; 499 unsigned int len = 0;
@@ -536,8 +536,7 @@ static const struct file_operations fops_tgt_stats = {
536static ssize_t read_file_xmit(struct file *file, char __user *user_buf, 536static ssize_t read_file_xmit(struct file *file, char __user *user_buf,
537 size_t count, loff_t *ppos) 537 size_t count, loff_t *ppos)
538{ 538{
539 struct ath9k_htc_priv *priv = 539 struct ath9k_htc_priv *priv = file->private_data;
540 (struct ath9k_htc_priv *) file->private_data;
541 char buf[512]; 540 char buf[512];
542 unsigned int len = 0; 541 unsigned int len = 0;
543 542
@@ -582,8 +581,7 @@ static const struct file_operations fops_xmit = {
582static ssize_t read_file_recv(struct file *file, char __user *user_buf, 581static ssize_t read_file_recv(struct file *file, char __user *user_buf,
583 size_t count, loff_t *ppos) 582 size_t count, loff_t *ppos)
584{ 583{
585 struct ath9k_htc_priv *priv = 584 struct ath9k_htc_priv *priv = file->private_data;
586 (struct ath9k_htc_priv *) file->private_data;
587 char buf[512]; 585 char buf[512];
588 unsigned int len = 0; 586 unsigned int len = 0;
589 587
diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c
index fe730cb16ec2..243c1775f343 100644
--- a/drivers/net/wireless/ath/ath9k/init.c
+++ b/drivers/net/wireless/ath/ath9k/init.c
@@ -787,12 +787,12 @@ void ath9k_deinit_device(struct ath_softc *sc)
787 ieee80211_unregister_hw(aphy->hw); 787 ieee80211_unregister_hw(aphy->hw);
788 ieee80211_free_hw(aphy->hw); 788 ieee80211_free_hw(aphy->hw);
789 } 789 }
790 kfree(sc->sec_wiphy);
791 790
792 ieee80211_unregister_hw(hw); 791 ieee80211_unregister_hw(hw);
793 ath_rx_cleanup(sc); 792 ath_rx_cleanup(sc);
794 ath_tx_cleanup(sc); 793 ath_tx_cleanup(sc);
795 ath9k_deinit_softc(sc); 794 ath9k_deinit_softc(sc);
795 kfree(sc->sec_wiphy);
796} 796}
797 797
798void ath_descdma_cleanup(struct ath_softc *sc, 798void ath_descdma_cleanup(struct ath_softc *sc,
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index 4c0831ff6e92..6cf0410ae0ba 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -279,7 +279,7 @@ void ath_paprd_calibrate(struct work_struct *work)
279 hdr = (struct ieee80211_hdr *)skb->data; 279 hdr = (struct ieee80211_hdr *)skb->data;
280 ftype = IEEE80211_FTYPE_DATA | IEEE80211_STYPE_NULLFUNC; 280 ftype = IEEE80211_FTYPE_DATA | IEEE80211_STYPE_NULLFUNC;
281 hdr->frame_control = cpu_to_le16(ftype); 281 hdr->frame_control = cpu_to_le16(ftype);
282 hdr->duration_id = 10; 282 hdr->duration_id = cpu_to_le16(10);
283 memcpy(hdr->addr1, hw->wiphy->perm_addr, ETH_ALEN); 283 memcpy(hdr->addr1, hw->wiphy->perm_addr, ETH_ALEN);
284 memcpy(hdr->addr2, hw->wiphy->perm_addr, ETH_ALEN); 284 memcpy(hdr->addr2, hw->wiphy->perm_addr, ETH_ALEN);
285 memcpy(hdr->addr3, hw->wiphy->perm_addr, ETH_ALEN); 285 memcpy(hdr->addr3, hw->wiphy->perm_addr, ETH_ALEN);
@@ -857,9 +857,14 @@ void ath_radio_disable(struct ath_softc *sc, struct ieee80211_hw *hw)
857 ath9k_ps_wakeup(sc); 857 ath9k_ps_wakeup(sc);
858 ieee80211_stop_queues(hw); 858 ieee80211_stop_queues(hw);
859 859
860 /* Disable LED */ 860 /*
861 ath9k_hw_set_gpio(ah, ah->led_pin, 1); 861 * Keep the LED on when the radio is disabled
862 ath9k_hw_cfg_gpio_input(ah, ah->led_pin); 862 * during idle unassociated state.
863 */
864 if (!sc->ps_idle) {
865 ath9k_hw_set_gpio(ah, ah->led_pin, 1);
866 ath9k_hw_cfg_gpio_input(ah, ah->led_pin);
867 }
863 868
864 /* Disable interrupts */ 869 /* Disable interrupts */
865 ath9k_hw_set_interrupts(ah, 0); 870 ath9k_hw_set_interrupts(ah, 0);
@@ -1264,6 +1269,7 @@ static void ath9k_stop(struct ieee80211_hw *hw)
1264 struct ath_softc *sc = aphy->sc; 1269 struct ath_softc *sc = aphy->sc;
1265 struct ath_hw *ah = sc->sc_ah; 1270 struct ath_hw *ah = sc->sc_ah;
1266 struct ath_common *common = ath9k_hw_common(ah); 1271 struct ath_common *common = ath9k_hw_common(ah);
1272 int i;
1267 1273
1268 mutex_lock(&sc->mutex); 1274 mutex_lock(&sc->mutex);
1269 1275
@@ -1276,7 +1282,12 @@ static void ath9k_stop(struct ieee80211_hw *hw)
1276 cancel_work_sync(&sc->paprd_work); 1282 cancel_work_sync(&sc->paprd_work);
1277 cancel_work_sync(&sc->hw_check_work); 1283 cancel_work_sync(&sc->hw_check_work);
1278 1284
1279 if (!sc->num_sec_wiphy) { 1285 for (i = 0; i < sc->num_sec_wiphy; i++) {
1286 if (sc->sec_wiphy[i])
1287 break;
1288 }
1289
1290 if (i == sc->num_sec_wiphy) {
1280 cancel_delayed_work_sync(&sc->wiphy_work); 1291 cancel_delayed_work_sync(&sc->wiphy_work);
1281 cancel_work_sync(&sc->chan_work); 1292 cancel_work_sync(&sc->chan_work);
1282 } 1293 }
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c
index bd52ac111795..0644f1e91887 100644
--- a/drivers/net/wireless/ath/ath9k/xmit.c
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
@@ -329,7 +329,6 @@ static void ath_tx_complete_aggr(struct ath_softc *sc, struct ath_txq *txq,
329 int isaggr, txfail, txpending, sendbar = 0, needreset = 0, nbad = 0; 329 int isaggr, txfail, txpending, sendbar = 0, needreset = 0, nbad = 0;
330 bool rc_update = true; 330 bool rc_update = true;
331 struct ieee80211_tx_rate rates[4]; 331 struct ieee80211_tx_rate rates[4];
332 unsigned long flags;
333 332
334 skb = bf->bf_mpdu; 333 skb = bf->bf_mpdu;
335 hdr = (struct ieee80211_hdr *)skb->data; 334 hdr = (struct ieee80211_hdr *)skb->data;
@@ -346,9 +345,21 @@ static void ath_tx_complete_aggr(struct ath_softc *sc, struct ath_txq *txq,
346 if (!sta) { 345 if (!sta) {
347 rcu_read_unlock(); 346 rcu_read_unlock();
348 347
349 spin_lock_irqsave(&sc->tx.txbuflock, flags); 348 INIT_LIST_HEAD(&bf_head);
350 list_splice_tail_init(bf_q, &sc->tx.txbuf); 349 while (bf) {
351 spin_unlock_irqrestore(&sc->tx.txbuflock, flags); 350 bf_next = bf->bf_next;
351
352 bf->bf_state.bf_type |= BUF_XRETRY;
353 if ((sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_EDMA) ||
354 !bf->bf_stale || bf_next != NULL)
355 list_move_tail(&bf->list, &bf_head);
356
357 ath_tx_rc_status(bf, ts, 0, 0, false);
358 ath_tx_complete_buf(sc, bf, txq, &bf_head, ts,
359 0, 0);
360
361 bf = bf_next;
362 }
352 return; 363 return;
353 } 364 }
354 365
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index 8e243798ae93..20631ae2ddd7 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -108,7 +108,7 @@ int b43_modparam_verbose = B43_VERBOSITY_DEFAULT;
108module_param_named(verbose, b43_modparam_verbose, int, 0644); 108module_param_named(verbose, b43_modparam_verbose, int, 0644);
109MODULE_PARM_DESC(verbose, "Log message verbosity: 0=error, 1=warn, 2=info(default), 3=debug"); 109MODULE_PARM_DESC(verbose, "Log message verbosity: 0=error, 1=warn, 2=info(default), 3=debug");
110 110
111int b43_modparam_pio = B43_PIO_DEFAULT; 111static int b43_modparam_pio = B43_PIO_DEFAULT;
112module_param_named(pio, b43_modparam_pio, int, 0644); 112module_param_named(pio, b43_modparam_pio, int, 0644);
113MODULE_PARM_DESC(pio, "Use PIO accesses by default: 0=DMA, 1=PIO"); 113MODULE_PARM_DESC(pio, "Use PIO accesses by default: 0=DMA, 1=PIO");
114 114
diff --git a/drivers/net/wireless/b43/phy_g.c b/drivers/net/wireless/b43/phy_g.c
index 29bf34ced865..0dc33b65e86b 100644
--- a/drivers/net/wireless/b43/phy_g.c
+++ b/drivers/net/wireless/b43/phy_g.c
@@ -972,7 +972,7 @@ b43_radio_interference_mitigation_enable(struct b43_wldev *dev, int mode)
972 b43_phy_maskset(dev, 0x04A2, 0xFFF0, 0x000B); 972 b43_phy_maskset(dev, 0x04A2, 0xFFF0, 0x000B);
973 973
974 if (phy->rev >= 3) { 974 if (phy->rev >= 3) {
975 b43_phy_mask(dev, 0x048A, (u16)~0x8000); 975 b43_phy_mask(dev, 0x048A, 0x7FFF);
976 b43_phy_maskset(dev, 0x0415, 0x8000, 0x36D8); 976 b43_phy_maskset(dev, 0x0415, 0x8000, 0x36D8);
977 b43_phy_maskset(dev, 0x0416, 0x8000, 0x36D8); 977 b43_phy_maskset(dev, 0x0416, 0x8000, 0x36D8);
978 b43_phy_maskset(dev, 0x0417, 0xFE00, 0x016D); 978 b43_phy_maskset(dev, 0x0417, 0xFE00, 0x016D);
diff --git a/drivers/net/wireless/b43/phy_lp.c b/drivers/net/wireless/b43/phy_lp.c
index c6afe9d94590..fd50eb116243 100644
--- a/drivers/net/wireless/b43/phy_lp.c
+++ b/drivers/net/wireless/b43/phy_lp.c
@@ -1145,7 +1145,7 @@ static void lpphy_write_tx_pctl_mode_to_hardware(struct b43_wldev *dev)
1145 B43_WARN_ON(1); 1145 B43_WARN_ON(1);
1146 } 1146 }
1147 b43_phy_maskset(dev, B43_LPPHY_TX_PWR_CTL_CMD, 1147 b43_phy_maskset(dev, B43_LPPHY_TX_PWR_CTL_CMD,
1148 (u16)~B43_LPPHY_TX_PWR_CTL_CMD_MODE, ctl); 1148 ~B43_LPPHY_TX_PWR_CTL_CMD_MODE & 0xFFFF, ctl);
1149} 1149}
1150 1150
1151static void lpphy_set_tx_power_control(struct b43_wldev *dev, 1151static void lpphy_set_tx_power_control(struct b43_wldev *dev,
@@ -1522,11 +1522,11 @@ static void lpphy_tx_pctl_init_hw(struct b43_wldev *dev)
1522 b43_phy_mask(dev, B43_LPPHY_TX_PWR_CTL_DELTAPWR_LIMIT, 0xFF); 1522 b43_phy_mask(dev, B43_LPPHY_TX_PWR_CTL_DELTAPWR_LIMIT, 0xFF);
1523 b43_phy_write(dev, B43_LPPHY_TX_PWR_CTL_DELTAPWR_LIMIT, 0xA); 1523 b43_phy_write(dev, B43_LPPHY_TX_PWR_CTL_DELTAPWR_LIMIT, 0xA);
1524 b43_phy_maskset(dev, B43_LPPHY_TX_PWR_CTL_CMD, 1524 b43_phy_maskset(dev, B43_LPPHY_TX_PWR_CTL_CMD,
1525 (u16)~B43_LPPHY_TX_PWR_CTL_CMD_MODE, 1525 ~B43_LPPHY_TX_PWR_CTL_CMD_MODE & 0xFFFF,
1526 B43_LPPHY_TX_PWR_CTL_CMD_MODE_OFF); 1526 B43_LPPHY_TX_PWR_CTL_CMD_MODE_OFF);
1527 b43_phy_mask(dev, B43_LPPHY_TX_PWR_CTL_NNUM, 0xF8FF); 1527 b43_phy_mask(dev, B43_LPPHY_TX_PWR_CTL_NNUM, 0xF8FF);
1528 b43_phy_maskset(dev, B43_LPPHY_TX_PWR_CTL_CMD, 1528 b43_phy_maskset(dev, B43_LPPHY_TX_PWR_CTL_CMD,
1529 (u16)~B43_LPPHY_TX_PWR_CTL_CMD_MODE, 1529 ~B43_LPPHY_TX_PWR_CTL_CMD_MODE & 0xFFFF,
1530 B43_LPPHY_TX_PWR_CTL_CMD_MODE_SW); 1530 B43_LPPHY_TX_PWR_CTL_CMD_MODE_SW);
1531 1531
1532 if (dev->phy.rev < 2) { 1532 if (dev->phy.rev < 2) {
@@ -2698,7 +2698,7 @@ static enum b43_txpwr_result b43_lpphy_op_recalc_txpower(struct b43_wldev *dev,
2698 return B43_TXPWR_RES_DONE; 2698 return B43_TXPWR_RES_DONE;
2699} 2699}
2700 2700
2701void b43_lpphy_op_switch_analog(struct b43_wldev *dev, bool on) 2701static void b43_lpphy_op_switch_analog(struct b43_wldev *dev, bool on)
2702{ 2702{
2703 if (on) { 2703 if (on) {
2704 b43_phy_mask(dev, B43_LPPHY_AFE_CTL_OVR, 0xfff8); 2704 b43_phy_mask(dev, B43_LPPHY_AFE_CTL_OVR, 0xfff8);
diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c
index 3d6b33775964..5a725703770c 100644
--- a/drivers/net/wireless/b43/phy_n.c
+++ b/drivers/net/wireless/b43/phy_n.c
@@ -509,7 +509,8 @@ static void b43_nphy_rx_cal_phy_setup(struct b43_wldev *dev, u8 core)
509 b43_phy_mask(dev, B43_NPHY_PAPD_EN0, ~0x0001); 509 b43_phy_mask(dev, B43_NPHY_PAPD_EN0, ~0x0001);
510 b43_phy_mask(dev, B43_NPHY_PAPD_EN1, ~0x0001); 510 b43_phy_mask(dev, B43_NPHY_PAPD_EN1, ~0x0001);
511 511
512 b43_phy_maskset(dev, B43_NPHY_RFSEQCA, (u16)~B43_NPHY_RFSEQCA_RXDIS, 512 b43_phy_maskset(dev, B43_NPHY_RFSEQCA,
513 ~B43_NPHY_RFSEQCA_RXDIS & 0xFFFF,
513 ((1 - core) << B43_NPHY_RFSEQCA_RXDIS_SHIFT)); 514 ((1 - core) << B43_NPHY_RFSEQCA_RXDIS_SHIFT));
514 b43_phy_maskset(dev, B43_NPHY_RFSEQCA, ~B43_NPHY_RFSEQCA_TXEN, 515 b43_phy_maskset(dev, B43_NPHY_RFSEQCA, ~B43_NPHY_RFSEQCA_TXEN,
515 ((1 - core) << B43_NPHY_RFSEQCA_TXEN_SHIFT)); 516 ((1 - core) << B43_NPHY_RFSEQCA_TXEN_SHIFT));
@@ -762,7 +763,7 @@ static void b43_nphy_stop_playback(struct b43_wldev *dev)
762 if (tmp & 0x1) 763 if (tmp & 0x1)
763 b43_phy_set(dev, B43_NPHY_SAMP_CMD, B43_NPHY_SAMP_CMD_STOP); 764 b43_phy_set(dev, B43_NPHY_SAMP_CMD, B43_NPHY_SAMP_CMD_STOP);
764 else if (tmp & 0x2) 765 else if (tmp & 0x2)
765 b43_phy_mask(dev, B43_NPHY_IQLOCAL_CMDGCTL, (u16)~0x8000); 766 b43_phy_mask(dev, B43_NPHY_IQLOCAL_CMDGCTL, 0x7FFF);
766 767
767 b43_phy_mask(dev, B43_NPHY_SAMP_CMD, ~0x0004); 768 b43_phy_mask(dev, B43_NPHY_SAMP_CMD, ~0x0004);
768 769
@@ -1009,7 +1010,7 @@ static void b43_nphy_gain_crtl_workarounds(struct b43_wldev *dev)
1009 b43_nphy_set_rf_sequence(dev, 5, 1010 b43_nphy_set_rf_sequence(dev, 5,
1010 rfseq_events, rfseq_delays, 3); 1011 rfseq_events, rfseq_delays, 3);
1011 b43_phy_maskset(dev, B43_NPHY_OVER_DGAIN1, 1012 b43_phy_maskset(dev, B43_NPHY_OVER_DGAIN1,
1012 (u16)~B43_NPHY_OVER_DGAIN_CCKDGECV, 1013 ~B43_NPHY_OVER_DGAIN_CCKDGECV & 0xFFFF,
1013 0x5A << B43_NPHY_OVER_DGAIN_CCKDGECV_SHIFT); 1014 0x5A << B43_NPHY_OVER_DGAIN_CCKDGECV_SHIFT);
1014 1015
1015 if (b43_current_band(dev->wl) == IEEE80211_BAND_2GHZ) 1016 if (b43_current_band(dev->wl) == IEEE80211_BAND_2GHZ)
@@ -1116,7 +1117,7 @@ static void b43_nphy_workarounds(struct b43_wldev *dev)
1116 b43_phy_write(dev, B43_NPHY_PHASETR_B2, 0x20); 1117 b43_phy_write(dev, B43_NPHY_PHASETR_B2, 0x20);
1117 1118
1118 b43_phy_mask(dev, B43_NPHY_PIL_DW1, 1119 b43_phy_mask(dev, B43_NPHY_PIL_DW1,
1119 (u16)~B43_NPHY_PIL_DW_64QAM); 1120 ~B43_NPHY_PIL_DW_64QAM & 0xFFFF);
1120 b43_phy_write(dev, B43_NPHY_TXF_20CO_S2B1, 0xB5); 1121 b43_phy_write(dev, B43_NPHY_TXF_20CO_S2B1, 0xB5);
1121 b43_phy_write(dev, B43_NPHY_TXF_20CO_S2B2, 0xA4); 1122 b43_phy_write(dev, B43_NPHY_TXF_20CO_S2B2, 0xA4);
1122 b43_phy_write(dev, B43_NPHY_TXF_20CO_S2B3, 0x00); 1123 b43_phy_write(dev, B43_NPHY_TXF_20CO_S2B3, 0x00);
@@ -2455,7 +2456,8 @@ static void b43_nphy_tx_cal_phy_setup(struct b43_wldev *dev)
2455 b43_phy_write(dev, B43_NPHY_AFECTL_OVER, tmp | 0x0600); 2456 b43_phy_write(dev, B43_NPHY_AFECTL_OVER, tmp | 0x0600);
2456 2457
2457 regs[4] = b43_phy_read(dev, B43_NPHY_BBCFG); 2458 regs[4] = b43_phy_read(dev, B43_NPHY_BBCFG);
2458 b43_phy_mask(dev, B43_NPHY_BBCFG, (u16)~B43_NPHY_BBCFG_RSTRX); 2459 b43_phy_mask(dev, B43_NPHY_BBCFG,
2460 ~B43_NPHY_BBCFG_RSTRX & 0xFFFF);
2459 2461
2460 tmp = b43_ntab_read(dev, B43_NTAB16(8, 3)); 2462 tmp = b43_ntab_read(dev, B43_NTAB16(8, 3));
2461 regs[5] = tmp; 2463 regs[5] = tmp;
@@ -2930,7 +2932,7 @@ static int b43_nphy_rev2_cal_rx_iq(struct b43_wldev *dev,
2930 tmp[5] = b43_phy_read(dev, rfctl[1]); 2932 tmp[5] = b43_phy_read(dev, rfctl[1]);
2931 2933
2932 b43_phy_maskset(dev, B43_NPHY_RFSEQCA, 2934 b43_phy_maskset(dev, B43_NPHY_RFSEQCA,
2933 (u16)~B43_NPHY_RFSEQCA_RXDIS, 2935 ~B43_NPHY_RFSEQCA_RXDIS & 0xFFFF,
2934 ((1 - i) << B43_NPHY_RFSEQCA_RXDIS_SHIFT)); 2936 ((1 - i) << B43_NPHY_RFSEQCA_RXDIS_SHIFT));
2935 b43_phy_maskset(dev, B43_NPHY_RFSEQCA, ~B43_NPHY_RFSEQCA_TXEN, 2937 b43_phy_maskset(dev, B43_NPHY_RFSEQCA, ~B43_NPHY_RFSEQCA_TXEN,
2936 (1 - i)); 2938 (1 - i));
@@ -3291,7 +3293,7 @@ static void b43_nphy_chanspec_setup(struct b43_wldev *dev,
3291 b43_phy_mask(dev, B43_NPHY_BANDCTL, ~B43_NPHY_BANDCTL_5GHZ); 3293 b43_phy_mask(dev, B43_NPHY_BANDCTL, ~B43_NPHY_BANDCTL_5GHZ);
3292 tmp32 = b43_read32(dev, B43_MMIO_PSM_PHY_HDR); 3294 tmp32 = b43_read32(dev, B43_MMIO_PSM_PHY_HDR);
3293 b43_write32(dev, B43_MMIO_PSM_PHY_HDR, tmp32 | 4); 3295 b43_write32(dev, B43_MMIO_PSM_PHY_HDR, tmp32 | 4);
3294 b43_phy_mask(dev, B43_PHY_B_BBCFG, (u16)~0xC000); 3296 b43_phy_mask(dev, B43_PHY_B_BBCFG, 0x3FFF);
3295 b43_write32(dev, B43_MMIO_PSM_PHY_HDR, tmp32); 3297 b43_write32(dev, B43_MMIO_PSM_PHY_HDR, tmp32);
3296 } 3298 }
3297 3299
diff --git a/drivers/net/wireless/b43/wa.c b/drivers/net/wireless/b43/wa.c
index 97c79161c208..9a335da65b42 100644
--- a/drivers/net/wireless/b43/wa.c
+++ b/drivers/net/wireless/b43/wa.c
@@ -382,7 +382,7 @@ static void b43_wa_altagc(struct b43_wldev *dev)
382 b43_ofdmtab_write16(dev, B43_OFDMTAB_AGC1, 3, 25); 382 b43_ofdmtab_write16(dev, B43_OFDMTAB_AGC1, 3, 25);
383 } 383 }
384 384
385 b43_phy_maskset(dev, B43_PHY_CCKSHIFTBITS_WA, (u16)~0xFF00, 0x5700); 385 b43_phy_maskset(dev, B43_PHY_CCKSHIFTBITS_WA, 0x00FF, 0x5700);
386 b43_phy_maskset(dev, B43_PHY_OFDM(0x1A), ~0x007F, 0x000F); 386 b43_phy_maskset(dev, B43_PHY_OFDM(0x1A), ~0x007F, 0x000F);
387 b43_phy_maskset(dev, B43_PHY_OFDM(0x1A), ~0x3F80, 0x2B80); 387 b43_phy_maskset(dev, B43_PHY_OFDM(0x1A), ~0x3F80, 0x2B80);
388 b43_phy_maskset(dev, B43_PHY_ANTWRSETT, 0xF0FF, 0x0300); 388 b43_phy_maskset(dev, B43_PHY_ANTWRSETT, 0xF0FF, 0x0300);
@@ -400,9 +400,9 @@ static void b43_wa_altagc(struct b43_wldev *dev)
400 b43_phy_maskset(dev, B43_PHY_OFDM(0x89), ~0x00FF, 0x0020); 400 b43_phy_maskset(dev, B43_PHY_OFDM(0x89), ~0x00FF, 0x0020);
401 b43_phy_maskset(dev, B43_PHY_OFDM(0x89), ~0x3F00, 0x0200); 401 b43_phy_maskset(dev, B43_PHY_OFDM(0x89), ~0x3F00, 0x0200);
402 b43_phy_maskset(dev, B43_PHY_OFDM(0x82), ~0x00FF, 0x002E); 402 b43_phy_maskset(dev, B43_PHY_OFDM(0x82), ~0x00FF, 0x002E);
403 b43_phy_maskset(dev, B43_PHY_OFDM(0x96), (u16)~0xFF00, 0x1A00); 403 b43_phy_maskset(dev, B43_PHY_OFDM(0x96), 0x00FF, 0x1A00);
404 b43_phy_maskset(dev, B43_PHY_OFDM(0x81), ~0x00FF, 0x0028); 404 b43_phy_maskset(dev, B43_PHY_OFDM(0x81), ~0x00FF, 0x0028);
405 b43_phy_maskset(dev, B43_PHY_OFDM(0x81), (u16)~0xFF00, 0x2C00); 405 b43_phy_maskset(dev, B43_PHY_OFDM(0x81), 0x00FF, 0x2C00);
406 if (phy->rev == 1) { 406 if (phy->rev == 1) {
407 b43_phy_write(dev, B43_PHY_PEAK_COUNT, 0x092B); 407 b43_phy_write(dev, B43_PHY_PEAK_COUNT, 0x092B);
408 b43_phy_maskset(dev, B43_PHY_OFDM(0x1B), ~0x001E, 0x0002); 408 b43_phy_maskset(dev, B43_PHY_OFDM(0x1B), ~0x001E, 0x0002);
@@ -412,7 +412,7 @@ static void b43_wa_altagc(struct b43_wldev *dev)
412 b43_phy_maskset(dev, B43_PHY_LPFGAINCTL, ~0x000F, 0x0004); 412 b43_phy_maskset(dev, B43_PHY_LPFGAINCTL, ~0x000F, 0x0004);
413 if (phy->rev >= 6) { 413 if (phy->rev >= 6) {
414 b43_phy_write(dev, B43_PHY_OFDM(0x22), 0x287A); 414 b43_phy_write(dev, B43_PHY_OFDM(0x22), 0x287A);
415 b43_phy_maskset(dev, B43_PHY_LPFGAINCTL, (u16)~0xF000, 0x3000); 415 b43_phy_maskset(dev, B43_PHY_LPFGAINCTL, 0x0FFF, 0x3000);
416 } 416 }
417 } 417 }
418 b43_phy_maskset(dev, B43_PHY_DIVSRCHIDX, 0x8080, 0x7874); 418 b43_phy_maskset(dev, B43_PHY_DIVSRCHIDX, 0x8080, 0x7874);
diff --git a/drivers/net/wireless/ipw2x00/ipw2100.c b/drivers/net/wireless/ipw2x00/ipw2100.c
index 56350d571960..5bbff4c5a489 100644
--- a/drivers/net/wireless/ipw2x00/ipw2100.c
+++ b/drivers/net/wireless/ipw2x00/ipw2100.c
@@ -174,7 +174,7 @@ that only one external action is invoked at a time.
174#define DRV_DESCRIPTION "Intel(R) PRO/Wireless 2100 Network Driver" 174#define DRV_DESCRIPTION "Intel(R) PRO/Wireless 2100 Network Driver"
175#define DRV_COPYRIGHT "Copyright(c) 2003-2006 Intel Corporation" 175#define DRV_COPYRIGHT "Copyright(c) 2003-2006 Intel Corporation"
176 176
177struct pm_qos_request_list *ipw2100_pm_qos_req; 177static struct pm_qos_request_list *ipw2100_pm_qos_req;
178 178
179/* Debugging stuff */ 179/* Debugging stuff */
180#ifdef CONFIG_IPW2100_DEBUG 180#ifdef CONFIG_IPW2100_DEBUG
diff --git a/drivers/net/wireless/ipw2x00/libipw_module.c b/drivers/net/wireless/ipw2x00/libipw_module.c
index 55965408ff3f..32dee2ce5d31 100644
--- a/drivers/net/wireless/ipw2x00/libipw_module.c
+++ b/drivers/net/wireless/ipw2x00/libipw_module.c
@@ -62,8 +62,8 @@ MODULE_DESCRIPTION(DRV_DESCRIPTION);
62MODULE_AUTHOR(DRV_COPYRIGHT); 62MODULE_AUTHOR(DRV_COPYRIGHT);
63MODULE_LICENSE("GPL"); 63MODULE_LICENSE("GPL");
64 64
65struct cfg80211_ops libipw_config_ops = { }; 65static struct cfg80211_ops libipw_config_ops = { };
66void *libipw_wiphy_privid = &libipw_wiphy_privid; 66static void *libipw_wiphy_privid = &libipw_wiphy_privid;
67 67
68static int libipw_networks_allocate(struct libipw_device *ieee) 68static int libipw_networks_allocate(struct libipw_device *ieee)
69{ 69{
diff --git a/drivers/net/wireless/ipw2x00/libipw_wx.c b/drivers/net/wireless/ipw2x00/libipw_wx.c
index 3633c6682e49..8a4bae44b109 100644
--- a/drivers/net/wireless/ipw2x00/libipw_wx.c
+++ b/drivers/net/wireless/ipw2x00/libipw_wx.c
@@ -411,10 +411,6 @@ int libipw_wx_set_encode(struct libipw_device *ieee,
411 411
412 /* If a new key was provided, set it up */ 412 /* If a new key was provided, set it up */
413 if (erq->length > 0) { 413 if (erq->length > 0) {
414#ifdef CONFIG_LIBIPW_DEBUG
415 DECLARE_SSID_BUF(ssid);
416#endif
417
418 len = erq->length <= 5 ? 5 : 13; 414 len = erq->length <= 5 ? 5 : 13;
419 memcpy(sec.keys[key], keybuf, erq->length); 415 memcpy(sec.keys[key], keybuf, erq->length);
420 if (len > erq->length) 416 if (len > erq->length)
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c
index 1dd3bc4c107e..3a0d0adab1ae 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965.c
@@ -2286,6 +2286,7 @@ static struct iwl_lib_ops iwl4965_lib = {
2286 .tx_stats_read = iwl_ucode_tx_stats_read, 2286 .tx_stats_read = iwl_ucode_tx_stats_read,
2287 .general_stats_read = iwl_ucode_general_stats_read, 2287 .general_stats_read = iwl_ucode_general_stats_read,
2288 }, 2288 },
2289 .recover_from_tx_stall = iwl_bg_monitor_recover,
2289 .check_plcp_health = iwl_good_plcp_health, 2290 .check_plcp_health = iwl_good_plcp_health,
2290}; 2291};
2291 2292
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-agn-debugfs.c
index 75d6bfcbc607..5e5c5122fb15 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-debugfs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-debugfs.c
@@ -813,6 +813,13 @@ ssize_t iwl_ucode_general_stats_read(struct file *file, char __user *user_buf,
813 delta_dbg->burst_count, max_dbg->burst_count); 813 delta_dbg->burst_count, max_dbg->burst_count);
814 pos += scnprintf(buf + pos, bufsz - pos, 814 pos += scnprintf(buf + pos, bufsz - pos,
815 " %-30s %10u %10u %10u %10u\n", 815 " %-30s %10u %10u %10u %10u\n",
816 "wait_for_silence_timeout_count:",
817 le32_to_cpu(dbg->wait_for_silence_timeout_cnt),
818 accum_dbg->wait_for_silence_timeout_cnt,
819 delta_dbg->wait_for_silence_timeout_cnt,
820 max_dbg->wait_for_silence_timeout_cnt);
821 pos += scnprintf(buf + pos, bufsz - pos,
822 " %-30s %10u %10u %10u %10u\n",
816 "sleep_time:", 823 "sleep_time:",
817 le32_to_cpu(general->sleep_time), 824 le32_to_cpu(general->sleep_time),
818 accum_general->sleep_time, 825 accum_general->sleep_time,
diff --git a/drivers/net/wireless/iwlwifi/iwl-commands.h b/drivers/net/wireless/iwlwifi/iwl-commands.h
index 8d2db9d22045..bd1ec933cd98 100644
--- a/drivers/net/wireless/iwlwifi/iwl-commands.h
+++ b/drivers/net/wireless/iwlwifi/iwl-commands.h
@@ -1245,7 +1245,7 @@ struct iwl_txfifo_flush_cmd {
1245 __le32 fifo_control; 1245 __le32 fifo_control;
1246 __le16 flush_control; 1246 __le16 flush_control;
1247 __le16 reserved; 1247 __le16 reserved;
1248} __attribute__ ((packed)); 1248} __packed;
1249 1249
1250/* 1250/*
1251 * REPLY_WEP_KEY = 0x20 1251 * REPLY_WEP_KEY = 0x20
@@ -3035,7 +3035,8 @@ struct iwl39_statistics_tx {
3035struct statistics_dbg { 3035struct statistics_dbg {
3036 __le32 burst_check; 3036 __le32 burst_check;
3037 __le32 burst_count; 3037 __le32 burst_count;
3038 __le32 reserved[4]; 3038 __le32 wait_for_silence_timeout_cnt;
3039 __le32 reserved[3];
3039} __packed; 3040} __packed;
3040 3041
3041struct iwl39_statistics_div { 3042struct iwl39_statistics_div {
@@ -3547,7 +3548,7 @@ struct iwl_sensitivity_cmd {
3547struct iwl_enhance_sensitivity_cmd { 3548struct iwl_enhance_sensitivity_cmd {
3548 __le16 control; /* always use "1" */ 3549 __le16 control; /* always use "1" */
3549 __le16 enhance_table[ENHANCE_HD_TABLE_SIZE]; /* use HD_* as index */ 3550 __le16 enhance_table[ENHANCE_HD_TABLE_SIZE]; /* use HD_* as index */
3550} __attribute__ ((packed)); 3551} __packed;
3551 3552
3552 3553
3553/** 3554/**
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
index f73eb08a9494..676d49df77ed 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.c
+++ b/drivers/net/wireless/iwlwifi/iwl-core.c
@@ -1763,6 +1763,15 @@ void iwl_bss_info_changed(struct ieee80211_hw *hw,
1763 1763
1764 mutex_lock(&priv->mutex); 1764 mutex_lock(&priv->mutex);
1765 1765
1766 if (changes & BSS_CHANGED_QOS) {
1767 unsigned long flags;
1768
1769 spin_lock_irqsave(&priv->lock, flags);
1770 priv->qos_data.qos_active = bss_conf->qos;
1771 iwl_update_qos(priv);
1772 spin_unlock_irqrestore(&priv->lock, flags);
1773 }
1774
1766 if (changes & BSS_CHANGED_BEACON && vif->type == NL80211_IFTYPE_AP) { 1775 if (changes & BSS_CHANGED_BEACON && vif->type == NL80211_IFTYPE_AP) {
1767 dev_kfree_skb(priv->ibss_beacon); 1776 dev_kfree_skb(priv->ibss_beacon);
1768 priv->ibss_beacon = ieee80211_beacon_get(hw, vif); 1777 priv->ibss_beacon = ieee80211_beacon_get(hw, vif);
@@ -2134,15 +2143,6 @@ int iwl_mac_config(struct ieee80211_hw *hw, u32 changed)
2134 iwl_set_tx_power(priv, conf->power_level, false); 2143 iwl_set_tx_power(priv, conf->power_level, false);
2135 } 2144 }
2136 2145
2137 if (changed & IEEE80211_CONF_CHANGE_QOS) {
2138 bool qos_active = !!(conf->flags & IEEE80211_CONF_QOS);
2139
2140 spin_lock_irqsave(&priv->lock, flags);
2141 priv->qos_data.qos_active = qos_active;
2142 iwl_update_qos(priv);
2143 spin_unlock_irqrestore(&priv->lock, flags);
2144 }
2145
2146 if (!iwl_is_ready(priv)) { 2146 if (!iwl_is_ready(priv)) {
2147 IWL_DEBUG_MAC80211(priv, "leave - not ready\n"); 2147 IWL_DEBUG_MAC80211(priv, "leave - not ready\n");
2148 goto out; 2148 goto out;
diff --git a/drivers/net/wireless/iwlwifi/iwl-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
index 088a2c13f59b..7b25d1468358 100644
--- a/drivers/net/wireless/iwlwifi/iwl-debugfs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
@@ -1267,7 +1267,7 @@ static ssize_t iwl_dbgfs_ucode_tracing_read(struct file *file,
1267 char __user *user_buf, 1267 char __user *user_buf,
1268 size_t count, loff_t *ppos) { 1268 size_t count, loff_t *ppos) {
1269 1269
1270 struct iwl_priv *priv = (struct iwl_priv *)file->private_data; 1270 struct iwl_priv *priv = file->private_data;
1271 int pos = 0; 1271 int pos = 0;
1272 char buf[128]; 1272 char buf[128];
1273 const size_t bufsz = sizeof(buf); 1273 const size_t bufsz = sizeof(buf);
@@ -1317,7 +1317,7 @@ static ssize_t iwl_dbgfs_rxon_flags_read(struct file *file,
1317 char __user *user_buf, 1317 char __user *user_buf,
1318 size_t count, loff_t *ppos) { 1318 size_t count, loff_t *ppos) {
1319 1319
1320 struct iwl_priv *priv = (struct iwl_priv *)file->private_data; 1320 struct iwl_priv *priv = file->private_data;
1321 int len = 0; 1321 int len = 0;
1322 char buf[20]; 1322 char buf[20];
1323 1323
@@ -1329,7 +1329,7 @@ static ssize_t iwl_dbgfs_rxon_filter_flags_read(struct file *file,
1329 char __user *user_buf, 1329 char __user *user_buf,
1330 size_t count, loff_t *ppos) { 1330 size_t count, loff_t *ppos) {
1331 1331
1332 struct iwl_priv *priv = (struct iwl_priv *)file->private_data; 1332 struct iwl_priv *priv = file->private_data;
1333 int len = 0; 1333 int len = 0;
1334 char buf[20]; 1334 char buf[20];
1335 1335
@@ -1342,7 +1342,7 @@ static ssize_t iwl_dbgfs_fh_reg_read(struct file *file,
1342 char __user *user_buf, 1342 char __user *user_buf,
1343 size_t count, loff_t *ppos) 1343 size_t count, loff_t *ppos)
1344{ 1344{
1345 struct iwl_priv *priv = (struct iwl_priv *)file->private_data; 1345 struct iwl_priv *priv = file->private_data;
1346 char *buf; 1346 char *buf;
1347 int pos = 0; 1347 int pos = 0;
1348 ssize_t ret = -EFAULT; 1348 ssize_t ret = -EFAULT;
@@ -1404,7 +1404,7 @@ static ssize_t iwl_dbgfs_plcp_delta_read(struct file *file,
1404 char __user *user_buf, 1404 char __user *user_buf,
1405 size_t count, loff_t *ppos) { 1405 size_t count, loff_t *ppos) {
1406 1406
1407 struct iwl_priv *priv = (struct iwl_priv *)file->private_data; 1407 struct iwl_priv *priv = file->private_data;
1408 int pos = 0; 1408 int pos = 0;
1409 char buf[12]; 1409 char buf[12];
1410 const size_t bufsz = sizeof(buf); 1410 const size_t bufsz = sizeof(buf);
diff --git a/drivers/net/wireless/libertas/cfg.c b/drivers/net/wireless/libertas/cfg.c
index f36cc970ad1b..7e0741608856 100644
--- a/drivers/net/wireless/libertas/cfg.c
+++ b/drivers/net/wireless/libertas/cfg.c
@@ -891,7 +891,7 @@ struct cmd_key_material {
891 891
892 __le16 action; 892 __le16 action;
893 struct MrvlIEtype_keyParamSet param; 893 struct MrvlIEtype_keyParamSet param;
894} __attribute__ ((packed)); 894} __packed;
895 895
896static int lbs_set_key_material(struct lbs_private *priv, 896static int lbs_set_key_material(struct lbs_private *priv,
897 int key_type, 897 int key_type,
@@ -1395,7 +1395,7 @@ struct cmd_monitor_mode {
1395 1395
1396 __le16 action; 1396 __le16 action;
1397 __le16 mode; 1397 __le16 mode;
1398} __attribute__ ((packed)); 1398} __packed;
1399 1399
1400static int lbs_enable_monitor_mode(struct lbs_private *priv, int mode) 1400static int lbs_enable_monitor_mode(struct lbs_private *priv, int mode)
1401{ 1401{
@@ -1450,7 +1450,7 @@ struct cmd_rssi {
1450 __le16 nf; 1450 __le16 nf;
1451 __le16 avg_snr; 1451 __le16 avg_snr;
1452 __le16 avg_nf; 1452 __le16 avg_nf;
1453} __attribute__ ((packed)); 1453} __packed;
1454 1454
1455static int lbs_get_signal(struct lbs_private *priv, s8 *signal, s8 *noise) 1455static int lbs_get_signal(struct lbs_private *priv, s8 *signal, s8 *noise)
1456{ 1456{
diff --git a/drivers/net/wireless/libertas/debugfs.c b/drivers/net/wireless/libertas/debugfs.c
index acaf81164624..3db621b18a2f 100644
--- a/drivers/net/wireless/libertas/debugfs.c
+++ b/drivers/net/wireless/libertas/debugfs.c
@@ -905,7 +905,7 @@ static ssize_t lbs_debugfs_read(struct file *file, char __user *userbuf,
905 905
906 p = buf; 906 p = buf;
907 907
908 d = (struct debug_data *)file->private_data; 908 d = file->private_data;
909 909
910 for (i = 0; i < num_of_items; i++) { 910 for (i = 0; i < num_of_items; i++) {
911 if (d[i].size == 1) 911 if (d[i].size == 1)
@@ -944,7 +944,7 @@ static ssize_t lbs_debugfs_write(struct file *f, const char __user *buf,
944 char *p0; 944 char *p0;
945 char *p1; 945 char *p1;
946 char *p2; 946 char *p2;
947 struct debug_data *d = (struct debug_data *)f->private_data; 947 struct debug_data *d = f->private_data;
948 948
949 pdata = kmalloc(cnt, GFP_KERNEL); 949 pdata = kmalloc(cnt, GFP_KERNEL);
950 if (pdata == NULL) 950 if (pdata == NULL)
diff --git a/drivers/net/wireless/libertas/host.h b/drivers/net/wireless/libertas/host.h
index db8e209878c1..43d020cd7403 100644
--- a/drivers/net/wireless/libertas/host.h
+++ b/drivers/net/wireless/libertas/host.h
@@ -398,12 +398,12 @@ struct mrvl_ie_domain_param_set {
398 398
399 u8 countrycode[COUNTRY_CODE_LEN]; 399 u8 countrycode[COUNTRY_CODE_LEN];
400 struct ieee80211_country_ie_triplet triplet[1]; 400 struct ieee80211_country_ie_triplet triplet[1];
401} __attribute__ ((packed)); 401} __packed;
402 402
403struct cmd_ds_802_11d_domain_info { 403struct cmd_ds_802_11d_domain_info {
404 __le16 action; 404 __le16 action;
405 struct mrvl_ie_domain_param_set domain; 405 struct mrvl_ie_domain_param_set domain;
406} __attribute__ ((packed)); 406} __packed;
407 407
408struct lbs_802_11d_domain_reg { 408struct lbs_802_11d_domain_reg {
409 /** Country code*/ 409 /** Country code*/
@@ -411,7 +411,7 @@ struct lbs_802_11d_domain_reg {
411 /** No. of triplet*/ 411 /** No. of triplet*/
412 u8 no_triplet; 412 u8 no_triplet;
413 struct ieee80211_country_ie_triplet triplet[MRVDRV_MAX_TRIPLET_802_11D]; 413 struct ieee80211_country_ie_triplet triplet[MRVDRV_MAX_TRIPLET_802_11D];
414} __attribute__ ((packed)); 414} __packed;
415 415
416/* 416/*
417 * Define data structure for CMD_GET_HW_SPEC 417 * Define data structure for CMD_GET_HW_SPEC
diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c
index c019fdc131c0..0e34260b22b1 100644
--- a/drivers/net/wireless/mwl8k.c
+++ b/drivers/net/wireless/mwl8k.c
@@ -314,13 +314,15 @@ static const struct ieee80211_rate mwl8k_rates_50[] = {
314#define MWL8K_CMD_SET_NEW_STN 0x1111 /* per-vif */ 314#define MWL8K_CMD_SET_NEW_STN 0x1111 /* per-vif */
315#define MWL8K_CMD_UPDATE_STADB 0x1123 315#define MWL8K_CMD_UPDATE_STADB 0x1123
316 316
317static const char *mwl8k_cmd_name(u16 cmd, char *buf, int bufsize) 317static const char *mwl8k_cmd_name(__le16 cmd, char *buf, int bufsize)
318{ 318{
319 u16 command = le16_to_cpu(cmd);
320
319#define MWL8K_CMDNAME(x) case MWL8K_CMD_##x: do {\ 321#define MWL8K_CMDNAME(x) case MWL8K_CMD_##x: do {\
320 snprintf(buf, bufsize, "%s", #x);\ 322 snprintf(buf, bufsize, "%s", #x);\
321 return buf;\ 323 return buf;\
322 } while (0) 324 } while (0)
323 switch (cmd & ~0x8000) { 325 switch (command & ~0x8000) {
324 MWL8K_CMDNAME(CODE_DNLD); 326 MWL8K_CMDNAME(CODE_DNLD);
325 MWL8K_CMDNAME(GET_HW_SPEC); 327 MWL8K_CMDNAME(GET_HW_SPEC);
326 MWL8K_CMDNAME(SET_HW_SPEC); 328 MWL8K_CMDNAME(SET_HW_SPEC);
@@ -1538,7 +1540,7 @@ static int mwl8k_post_cmd(struct ieee80211_hw *hw, struct mwl8k_cmd_pkt *cmd)
1538 unsigned long timeout = 0; 1540 unsigned long timeout = 0;
1539 u8 buf[32]; 1541 u8 buf[32];
1540 1542
1541 cmd->result = 0xffff; 1543 cmd->result = (__force __le16) 0xffff;
1542 dma_size = le16_to_cpu(cmd->length); 1544 dma_size = le16_to_cpu(cmd->length);
1543 dma_addr = pci_map_single(priv->pdev, cmd, dma_size, 1545 dma_addr = pci_map_single(priv->pdev, cmd, dma_size,
1544 PCI_DMA_BIDIRECTIONAL); 1546 PCI_DMA_BIDIRECTIONAL);
@@ -1842,22 +1844,22 @@ static int mwl8k_cmd_get_hw_spec_ap(struct ieee80211_hw *hw)
1842 priv->sta_macids_supported = 0x00000000; 1844 priv->sta_macids_supported = 0x00000000;
1843 1845
1844 off = le32_to_cpu(cmd->wcbbase0) & 0xffff; 1846 off = le32_to_cpu(cmd->wcbbase0) & 0xffff;
1845 iowrite32(cpu_to_le32(priv->txq[0].txd_dma), priv->sram + off); 1847 iowrite32(priv->txq[0].txd_dma, priv->sram + off);
1846 1848
1847 off = le32_to_cpu(cmd->rxwrptr) & 0xffff; 1849 off = le32_to_cpu(cmd->rxwrptr) & 0xffff;
1848 iowrite32(cpu_to_le32(priv->rxq[0].rxd_dma), priv->sram + off); 1850 iowrite32(priv->rxq[0].rxd_dma, priv->sram + off);
1849 1851
1850 off = le32_to_cpu(cmd->rxrdptr) & 0xffff; 1852 off = le32_to_cpu(cmd->rxrdptr) & 0xffff;
1851 iowrite32(cpu_to_le32(priv->rxq[0].rxd_dma), priv->sram + off); 1853 iowrite32(priv->rxq[0].rxd_dma, priv->sram + off);
1852 1854
1853 off = le32_to_cpu(cmd->wcbbase1) & 0xffff; 1855 off = le32_to_cpu(cmd->wcbbase1) & 0xffff;
1854 iowrite32(cpu_to_le32(priv->txq[1].txd_dma), priv->sram + off); 1856 iowrite32(priv->txq[1].txd_dma, priv->sram + off);
1855 1857
1856 off = le32_to_cpu(cmd->wcbbase2) & 0xffff; 1858 off = le32_to_cpu(cmd->wcbbase2) & 0xffff;
1857 iowrite32(cpu_to_le32(priv->txq[2].txd_dma), priv->sram + off); 1859 iowrite32(priv->txq[2].txd_dma, priv->sram + off);
1858 1860
1859 off = le32_to_cpu(cmd->wcbbase3) & 0xffff; 1861 off = le32_to_cpu(cmd->wcbbase3) & 0xffff;
1860 iowrite32(cpu_to_le32(priv->txq[3].txd_dma), priv->sram + off); 1862 iowrite32(priv->txq[3].txd_dma, priv->sram + off);
1861 } 1863 }
1862 1864
1863 kfree(cmd); 1865 kfree(cmd);
@@ -3052,7 +3054,7 @@ static int mwl8k_cmd_update_stadb_add(struct ieee80211_hw *hw,
3052 p->peer_type = MWL8K_PEER_TYPE_ACCESSPOINT; 3054 p->peer_type = MWL8K_PEER_TYPE_ACCESSPOINT;
3053 p->basic_caps = cpu_to_le16(vif->bss_conf.assoc_capability); 3055 p->basic_caps = cpu_to_le16(vif->bss_conf.assoc_capability);
3054 p->ht_support = sta->ht_cap.ht_supported; 3056 p->ht_support = sta->ht_cap.ht_supported;
3055 p->ht_caps = sta->ht_cap.cap; 3057 p->ht_caps = cpu_to_le16(sta->ht_cap.cap);
3056 p->extended_ht_caps = (sta->ht_cap.ampdu_factor & 3) | 3058 p->extended_ht_caps = (sta->ht_cap.ampdu_factor & 3) |
3057 ((sta->ht_cap.ampdu_density & 7) << 2); 3059 ((sta->ht_cap.ampdu_density & 7) << 2);
3058 if (hw->conf.channel->band == IEEE80211_BAND_2GHZ) 3060 if (hw->conf.channel->band == IEEE80211_BAND_2GHZ)
diff --git a/drivers/net/wireless/orinoco/orinoco_usb.c b/drivers/net/wireless/orinoco/orinoco_usb.c
index 1558381998ee..a38a7bd25f19 100644
--- a/drivers/net/wireless/orinoco/orinoco_usb.c
+++ b/drivers/net/wireless/orinoco/orinoco_usb.c
@@ -1502,16 +1502,16 @@ static inline void ezusb_delete(struct ezusb_priv *upriv)
1502 ezusb_ctx_complete(list_entry(item, 1502 ezusb_ctx_complete(list_entry(item,
1503 struct request_context, list)); 1503 struct request_context, list));
1504 1504
1505 if (upriv->read_urb->status == -EINPROGRESS) 1505 if (upriv->read_urb && upriv->read_urb->status == -EINPROGRESS)
1506 printk(KERN_ERR PFX "Some URB in progress\n"); 1506 printk(KERN_ERR PFX "Some URB in progress\n");
1507 1507
1508 mutex_unlock(&upriv->mtx); 1508 mutex_unlock(&upriv->mtx);
1509 1509
1510 kfree(upriv->read_urb->transfer_buffer); 1510 if (upriv->read_urb) {
1511 if (upriv->bap_buf != NULL) 1511 kfree(upriv->read_urb->transfer_buffer);
1512 kfree(upriv->bap_buf);
1513 if (upriv->read_urb != NULL)
1514 usb_free_urb(upriv->read_urb); 1512 usb_free_urb(upriv->read_urb);
1513 }
1514 kfree(upriv->bap_buf);
1515 if (upriv->dev) { 1515 if (upriv->dev) {
1516 struct orinoco_private *priv = ndev_priv(upriv->dev); 1516 struct orinoco_private *priv = ndev_priv(upriv->dev);
1517 orinoco_if_del(priv); 1517 orinoco_if_del(priv);
diff --git a/drivers/net/wireless/rt2x00/rt2x00dump.h b/drivers/net/wireless/rt2x00/rt2x00dump.h
index 6df2e0b746b8..5d6e0b83151f 100644
--- a/drivers/net/wireless/rt2x00/rt2x00dump.h
+++ b/drivers/net/wireless/rt2x00/rt2x00dump.h
@@ -116,7 +116,7 @@ struct rt2x00dump_hdr {
116 116
117 __le16 chip_rt; 117 __le16 chip_rt;
118 __le16 chip_rf; 118 __le16 chip_rf;
119 __le32 chip_rev; 119 __le16 chip_rev;
120 120
121 __le16 type; 121 __le16 type;
122 __u8 queue_index; 122 __u8 queue_index;
diff --git a/drivers/net/wireless/rtl818x/rtl8180_dev.c b/drivers/net/wireless/rtl818x/rtl8180_dev.c
index 42705028751d..31808f96a3d6 100644
--- a/drivers/net/wireless/rtl818x/rtl8180_dev.c
+++ b/drivers/net/wireless/rtl818x/rtl8180_dev.c
@@ -103,6 +103,7 @@ static void rtl8180_handle_rx(struct ieee80211_hw *dev)
103{ 103{
104 struct rtl8180_priv *priv = dev->priv; 104 struct rtl8180_priv *priv = dev->priv;
105 unsigned int count = 32; 105 unsigned int count = 32;
106 u8 signal;
106 107
107 while (count--) { 108 while (count--) {
108 struct rtl8180_rx_desc *entry = &priv->rx_ring[priv->rx_idx]; 109 struct rtl8180_rx_desc *entry = &priv->rx_ring[priv->rx_idx];
@@ -130,10 +131,14 @@ static void rtl8180_handle_rx(struct ieee80211_hw *dev)
130 skb_put(skb, flags & 0xFFF); 131 skb_put(skb, flags & 0xFFF);
131 132
132 rx_status.antenna = (flags2 >> 15) & 1; 133 rx_status.antenna = (flags2 >> 15) & 1;
133 /* TODO: improve signal/rssi reporting */
134 rx_status.signal = (flags2 >> 8) & 0x7F;
135 /* XXX: is this correct? */
136 rx_status.rate_idx = (flags >> 20) & 0xF; 134 rx_status.rate_idx = (flags >> 20) & 0xF;
135 /* TODO: improve signal/rssi reporting for !rtl8185 */
136 signal = (flags2 >> 17) & 0x7F;
137 if (rx_status.rate_idx > 3)
138 signal = 90 - clamp_t(u8, signal, 25, 90);
139 else
140 signal = 95 - clamp_t(u8, signal, 30, 95);
141 rx_status.signal = signal;
137 rx_status.freq = dev->conf.channel->center_freq; 142 rx_status.freq = dev->conf.channel->center_freq;
138 rx_status.band = dev->conf.channel->band; 143 rx_status.band = dev->conf.channel->band;
139 rx_status.mactime = le64_to_cpu(entry->tsft); 144 rx_status.mactime = le64_to_cpu(entry->tsft);
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 168fe530b214..4d1f19d70798 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -1952,6 +1952,10 @@ int cfg80211_wext_giwap(struct net_device *dev,
1952 struct iw_request_info *info, 1952 struct iw_request_info *info,
1953 struct sockaddr *ap_addr, char *extra); 1953 struct sockaddr *ap_addr, char *extra);
1954 1954
1955int cfg80211_wext_siwpmksa(struct net_device *dev,
1956 struct iw_request_info *info,
1957 struct iw_point *data, char *extra);
1958
1955/* 1959/*
1956 * callbacks for asynchronous cfg80211 methods, notification 1960 * callbacks for asynchronous cfg80211 methods, notification
1957 * functions and BSS handling helpers 1961 * functions and BSS handling helpers
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 23e46cee06f9..837353bfcb20 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -147,6 +147,8 @@ struct ieee80211_low_level_stats {
147 * @BSS_CHANGED_CQM: Connection quality monitor config changed 147 * @BSS_CHANGED_CQM: Connection quality monitor config changed
148 * @BSS_CHANGED_IBSS: IBSS join status changed 148 * @BSS_CHANGED_IBSS: IBSS join status changed
149 * @BSS_CHANGED_ARP_FILTER: Hardware ARP filter address list or state changed. 149 * @BSS_CHANGED_ARP_FILTER: Hardware ARP filter address list or state changed.
150 * @BSS_CHANGED_QOS: QoS for this association was enabled/disabled. Note
151 * that it is only ever disabled for station mode.
150 */ 152 */
151enum ieee80211_bss_change { 153enum ieee80211_bss_change {
152 BSS_CHANGED_ASSOC = 1<<0, 154 BSS_CHANGED_ASSOC = 1<<0,
@@ -162,6 +164,7 @@ enum ieee80211_bss_change {
162 BSS_CHANGED_CQM = 1<<10, 164 BSS_CHANGED_CQM = 1<<10,
163 BSS_CHANGED_IBSS = 1<<11, 165 BSS_CHANGED_IBSS = 1<<11,
164 BSS_CHANGED_ARP_FILTER = 1<<12, 166 BSS_CHANGED_ARP_FILTER = 1<<12,
167 BSS_CHANGED_QOS = 1<<13,
165 168
166 /* when adding here, make sure to change ieee80211_reconfig */ 169 /* when adding here, make sure to change ieee80211_reconfig */
167}; 170};
@@ -217,6 +220,7 @@ enum ieee80211_bss_change {
217 * filter ARP queries based on the @arp_addr_list, if disabled, the 220 * filter ARP queries based on the @arp_addr_list, if disabled, the
218 * hardware must not perform any ARP filtering. Note, that the filter will 221 * hardware must not perform any ARP filtering. Note, that the filter will
219 * be enabled also in promiscuous mode. 222 * be enabled also in promiscuous mode.
223 * @qos: This is a QoS-enabled BSS.
220 */ 224 */
221struct ieee80211_bss_conf { 225struct ieee80211_bss_conf {
222 const u8 *bssid; 226 const u8 *bssid;
@@ -240,6 +244,7 @@ struct ieee80211_bss_conf {
240 __be32 arp_addr_list[IEEE80211_BSS_ARP_ADDR_LIST_LEN]; 244 __be32 arp_addr_list[IEEE80211_BSS_ARP_ADDR_LIST_LEN];
241 u8 arp_addr_cnt; 245 u8 arp_addr_cnt;
242 bool arp_filter_enabled; 246 bool arp_filter_enabled;
247 bool qos;
243}; 248};
244 249
245/** 250/**
@@ -620,15 +625,11 @@ struct ieee80211_rx_status {
620 * may turn the device off as much as possible. Typically, this flag will 625 * may turn the device off as much as possible. Typically, this flag will
621 * be set when an interface is set UP but not associated or scanning, but 626 * be set when an interface is set UP but not associated or scanning, but
622 * it can also be unset in that case when monitor interfaces are active. 627 * it can also be unset in that case when monitor interfaces are active.
623 * @IEEE80211_CONF_QOS: Enable 802.11e QoS also know as WMM (Wireless
624 * Multimedia). On some drivers (iwlwifi is one of know) we have
625 * to enable/disable QoS explicitly.
626 */ 628 */
627enum ieee80211_conf_flags { 629enum ieee80211_conf_flags {
628 IEEE80211_CONF_MONITOR = (1<<0), 630 IEEE80211_CONF_MONITOR = (1<<0),
629 IEEE80211_CONF_PS = (1<<1), 631 IEEE80211_CONF_PS = (1<<1),
630 IEEE80211_CONF_IDLE = (1<<2), 632 IEEE80211_CONF_IDLE = (1<<2),
631 IEEE80211_CONF_QOS = (1<<3),
632}; 633};
633 634
634 635
@@ -643,7 +644,6 @@ enum ieee80211_conf_flags {
643 * @IEEE80211_CONF_CHANGE_RETRY_LIMITS: retry limits changed 644 * @IEEE80211_CONF_CHANGE_RETRY_LIMITS: retry limits changed
644 * @IEEE80211_CONF_CHANGE_IDLE: Idle flag changed 645 * @IEEE80211_CONF_CHANGE_IDLE: Idle flag changed
645 * @IEEE80211_CONF_CHANGE_SMPS: Spatial multiplexing powersave mode changed 646 * @IEEE80211_CONF_CHANGE_SMPS: Spatial multiplexing powersave mode changed
646 * @IEEE80211_CONF_CHANGE_QOS: Quality of service was enabled or disabled
647 */ 647 */
648enum ieee80211_conf_changed { 648enum ieee80211_conf_changed {
649 IEEE80211_CONF_CHANGE_SMPS = BIT(1), 649 IEEE80211_CONF_CHANGE_SMPS = BIT(1),
@@ -654,7 +654,6 @@ enum ieee80211_conf_changed {
654 IEEE80211_CONF_CHANGE_CHANNEL = BIT(6), 654 IEEE80211_CONF_CHANGE_CHANNEL = BIT(6),
655 IEEE80211_CONF_CHANGE_RETRY_LIMITS = BIT(7), 655 IEEE80211_CONF_CHANGE_RETRY_LIMITS = BIT(7),
656 IEEE80211_CONF_CHANGE_IDLE = BIT(8), 656 IEEE80211_CONF_CHANGE_IDLE = BIT(8),
657 IEEE80211_CONF_CHANGE_QOS = BIT(9),
658}; 657};
659 658
660/** 659/**
diff --git a/include/net/regulatory.h b/include/net/regulatory.h
index f873ee37f7e4..9e103a4e91ee 100644
--- a/include/net/regulatory.h
+++ b/include/net/regulatory.h
@@ -54,7 +54,6 @@ struct regulatory_request {
54 enum nl80211_reg_initiator initiator; 54 enum nl80211_reg_initiator initiator;
55 char alpha2[2]; 55 char alpha2[2];
56 bool intersect; 56 bool intersect;
57 u32 country_ie_checksum;
58 enum environment_cap country_ie_env; 57 enum environment_cap country_ie_env;
59 struct list_head list; 58 struct list_head list;
60}; 59};
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 5e56e91c92c4..a3f3325df9f2 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -1154,10 +1154,6 @@ static int ieee80211_set_txq_params(struct wiphy *wiphy,
1154 return -EINVAL; 1154 return -EINVAL;
1155 } 1155 }
1156 1156
1157 /* enable WMM or activate new settings */
1158 local->hw.conf.flags |= IEEE80211_CONF_QOS;
1159 drv_config(local, IEEE80211_CONF_CHANGE_QOS);
1160
1161 return 0; 1157 return 0;
1162} 1158}
1163 1159
diff --git a/net/mac80211/ht.c b/net/mac80211/ht.c
index be928ef7ef51..9d101fb33861 100644
--- a/net/mac80211/ht.c
+++ b/net/mac80211/ht.c
@@ -29,7 +29,7 @@ void ieee80211_ht_cap_ie_to_sta_ht_cap(struct ieee80211_supported_band *sband,
29 29
30 memset(ht_cap, 0, sizeof(*ht_cap)); 30 memset(ht_cap, 0, sizeof(*ht_cap));
31 31
32 if (!ht_cap_ie) 32 if (!ht_cap_ie || !sband->ht_cap.ht_supported)
33 return; 33 return;
34 34
35 ht_cap->ht_supported = true; 35 ht_cap->ht_supported = true;
diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
index d4e84b22a66d..c691780725a7 100644
--- a/net/mac80211/ibss.c
+++ b/net/mac80211/ibss.c
@@ -43,6 +43,8 @@ static void ieee80211_rx_mgmt_auth_ibss(struct ieee80211_sub_if_data *sdata,
43{ 43{
44 u16 auth_alg, auth_transaction, status_code; 44 u16 auth_alg, auth_transaction, status_code;
45 45
46 lockdep_assert_held(&sdata->u.ibss.mtx);
47
46 if (len < 24 + 6) 48 if (len < 24 + 6)
47 return; 49 return;
48 50
@@ -78,6 +80,8 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
78 u32 bss_change; 80 u32 bss_change;
79 u8 supp_rates[IEEE80211_MAX_SUPP_RATES]; 81 u8 supp_rates[IEEE80211_MAX_SUPP_RATES];
80 82
83 lockdep_assert_held(&ifibss->mtx);
84
81 /* Reset own TSF to allow time synchronization work. */ 85 /* Reset own TSF to allow time synchronization work. */
82 drv_reset_tsf(local); 86 drv_reset_tsf(local);
83 87
@@ -205,6 +209,8 @@ static void ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
205 int i, j; 209 int i, j;
206 u16 beacon_int = cbss->beacon_interval; 210 u16 beacon_int = cbss->beacon_interval;
207 211
212 lockdep_assert_held(&sdata->u.ibss.mtx);
213
208 if (beacon_int < 10) 214 if (beacon_int < 10)
209 beacon_int = 10; 215 beacon_int = 10;
210 216
@@ -449,6 +455,8 @@ static int ieee80211_sta_active_ibss(struct ieee80211_sub_if_data *sdata)
449 int active = 0; 455 int active = 0;
450 struct sta_info *sta; 456 struct sta_info *sta;
451 457
458 lockdep_assert_held(&sdata->u.ibss.mtx);
459
452 rcu_read_lock(); 460 rcu_read_lock();
453 461
454 list_for_each_entry_rcu(sta, &local->sta_list, list) { 462 list_for_each_entry_rcu(sta, &local->sta_list, list) {
@@ -473,6 +481,8 @@ static void ieee80211_sta_merge_ibss(struct ieee80211_sub_if_data *sdata)
473{ 481{
474 struct ieee80211_if_ibss *ifibss = &sdata->u.ibss; 482 struct ieee80211_if_ibss *ifibss = &sdata->u.ibss;
475 483
484 lockdep_assert_held(&ifibss->mtx);
485
476 mod_timer(&ifibss->timer, 486 mod_timer(&ifibss->timer,
477 round_jiffies(jiffies + IEEE80211_IBSS_MERGE_INTERVAL)); 487 round_jiffies(jiffies + IEEE80211_IBSS_MERGE_INTERVAL));
478 488
@@ -505,6 +515,8 @@ static void ieee80211_sta_create_ibss(struct ieee80211_sub_if_data *sdata)
505 u16 capability; 515 u16 capability;
506 int i; 516 int i;
507 517
518 lockdep_assert_held(&ifibss->mtx);
519
508 if (ifibss->fixed_bssid) { 520 if (ifibss->fixed_bssid) {
509 memcpy(bssid, ifibss->bssid, ETH_ALEN); 521 memcpy(bssid, ifibss->bssid, ETH_ALEN);
510 } else { 522 } else {
@@ -549,6 +561,8 @@ static void ieee80211_sta_find_ibss(struct ieee80211_sub_if_data *sdata)
549 int active_ibss; 561 int active_ibss;
550 u16 capability; 562 u16 capability;
551 563
564 lockdep_assert_held(&ifibss->mtx);
565
552 active_ibss = ieee80211_sta_active_ibss(sdata); 566 active_ibss = ieee80211_sta_active_ibss(sdata);
553#ifdef CONFIG_MAC80211_IBSS_DEBUG 567#ifdef CONFIG_MAC80211_IBSS_DEBUG
554 printk(KERN_DEBUG "%s: sta_find_ibss (active_ibss=%d)\n", 568 printk(KERN_DEBUG "%s: sta_find_ibss (active_ibss=%d)\n",
@@ -637,6 +651,8 @@ static void ieee80211_rx_mgmt_probe_req(struct ieee80211_sub_if_data *sdata,
637 struct ieee80211_mgmt *resp; 651 struct ieee80211_mgmt *resp;
638 u8 *pos, *end; 652 u8 *pos, *end;
639 653
654 lockdep_assert_held(&ifibss->mtx);
655
640 if (ifibss->state != IEEE80211_IBSS_MLME_JOINED || 656 if (ifibss->state != IEEE80211_IBSS_MLME_JOINED ||
641 len < 24 + 2 || !ifibss->presp) 657 len < 24 + 2 || !ifibss->presp)
642 return; 658 return;
@@ -740,6 +756,8 @@ void ieee80211_ibss_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata,
740 mgmt = (struct ieee80211_mgmt *) skb->data; 756 mgmt = (struct ieee80211_mgmt *) skb->data;
741 fc = le16_to_cpu(mgmt->frame_control); 757 fc = le16_to_cpu(mgmt->frame_control);
742 758
759 mutex_lock(&sdata->u.ibss.mtx);
760
743 switch (fc & IEEE80211_FCTL_STYPE) { 761 switch (fc & IEEE80211_FCTL_STYPE) {
744 case IEEE80211_STYPE_PROBE_REQ: 762 case IEEE80211_STYPE_PROBE_REQ:
745 ieee80211_rx_mgmt_probe_req(sdata, mgmt, skb->len); 763 ieee80211_rx_mgmt_probe_req(sdata, mgmt, skb->len);
@@ -756,14 +774,23 @@ void ieee80211_ibss_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata,
756 ieee80211_rx_mgmt_auth_ibss(sdata, mgmt, skb->len); 774 ieee80211_rx_mgmt_auth_ibss(sdata, mgmt, skb->len);
757 break; 775 break;
758 } 776 }
777
778 mutex_unlock(&sdata->u.ibss.mtx);
759} 779}
760 780
761void ieee80211_ibss_work(struct ieee80211_sub_if_data *sdata) 781void ieee80211_ibss_work(struct ieee80211_sub_if_data *sdata)
762{ 782{
763 struct ieee80211_if_ibss *ifibss = &sdata->u.ibss; 783 struct ieee80211_if_ibss *ifibss = &sdata->u.ibss;
764 784
765 if (!test_and_clear_bit(IEEE80211_IBSS_REQ_RUN, &ifibss->request)) 785 mutex_lock(&ifibss->mtx);
766 return; 786
787 /*
788 * Work could be scheduled after scan or similar
789 * when we aren't even joined (or trying) with a
790 * network.
791 */
792 if (!ifibss->ssid_len)
793 goto out;
767 794
768 switch (ifibss->state) { 795 switch (ifibss->state) {
769 case IEEE80211_IBSS_MLME_SEARCH: 796 case IEEE80211_IBSS_MLME_SEARCH:
@@ -776,15 +803,9 @@ void ieee80211_ibss_work(struct ieee80211_sub_if_data *sdata)
776 WARN_ON(1); 803 WARN_ON(1);
777 break; 804 break;
778 } 805 }
779}
780 806
781static void ieee80211_queue_ibss_work(struct ieee80211_sub_if_data *sdata) 807 out:
782{ 808 mutex_unlock(&ifibss->mtx);
783 struct ieee80211_if_ibss *ifibss = &sdata->u.ibss;
784 struct ieee80211_local *local = sdata->local;
785
786 set_bit(IEEE80211_IBSS_REQ_RUN, &ifibss->request);
787 ieee80211_queue_work(&local->hw, &sdata->work);
788} 809}
789 810
790static void ieee80211_ibss_timer(unsigned long data) 811static void ieee80211_ibss_timer(unsigned long data)
@@ -799,7 +820,7 @@ static void ieee80211_ibss_timer(unsigned long data)
799 return; 820 return;
800 } 821 }
801 822
802 ieee80211_queue_ibss_work(sdata); 823 ieee80211_queue_work(&local->hw, &sdata->work);
803} 824}
804 825
805#ifdef CONFIG_PM 826#ifdef CONFIG_PM
@@ -828,6 +849,7 @@ void ieee80211_ibss_setup_sdata(struct ieee80211_sub_if_data *sdata)
828 849
829 setup_timer(&ifibss->timer, ieee80211_ibss_timer, 850 setup_timer(&ifibss->timer, ieee80211_ibss_timer,
830 (unsigned long) sdata); 851 (unsigned long) sdata);
852 mutex_init(&ifibss->mtx);
831} 853}
832 854
833/* scan finished notification */ 855/* scan finished notification */
@@ -841,10 +863,8 @@ void ieee80211_ibss_notify_scan_completed(struct ieee80211_local *local)
841 continue; 863 continue;
842 if (sdata->vif.type != NL80211_IFTYPE_ADHOC) 864 if (sdata->vif.type != NL80211_IFTYPE_ADHOC)
843 continue; 865 continue;
844 if (!sdata->u.ibss.ssid_len)
845 continue;
846 sdata->u.ibss.last_scan_completed = jiffies; 866 sdata->u.ibss.last_scan_completed = jiffies;
847 ieee80211_queue_ibss_work(sdata); 867 ieee80211_queue_work(&local->hw, &sdata->work);
848 } 868 }
849 mutex_unlock(&local->iflist_mtx); 869 mutex_unlock(&local->iflist_mtx);
850} 870}
@@ -854,6 +874,17 @@ int ieee80211_ibss_join(struct ieee80211_sub_if_data *sdata,
854{ 874{
855 struct sk_buff *skb; 875 struct sk_buff *skb;
856 876
877 skb = dev_alloc_skb(sdata->local->hw.extra_tx_headroom +
878 36 /* bitrates */ +
879 34 /* SSID */ +
880 3 /* DS params */ +
881 4 /* IBSS params */ +
882 params->ie_len);
883 if (!skb)
884 return -ENOMEM;
885
886 mutex_lock(&sdata->u.ibss.mtx);
887
857 if (params->bssid) { 888 if (params->bssid) {
858 memcpy(sdata->u.ibss.bssid, params->bssid, ETH_ALEN); 889 memcpy(sdata->u.ibss.bssid, params->bssid, ETH_ALEN);
859 sdata->u.ibss.fixed_bssid = true; 890 sdata->u.ibss.fixed_bssid = true;
@@ -882,35 +913,19 @@ int ieee80211_ibss_join(struct ieee80211_sub_if_data *sdata,
882 sdata->u.ibss.ie_len = params->ie_len; 913 sdata->u.ibss.ie_len = params->ie_len;
883 } 914 }
884 915
885 skb = dev_alloc_skb(sdata->local->hw.extra_tx_headroom +
886 36 /* bitrates */ +
887 34 /* SSID */ +
888 3 /* DS params */ +
889 4 /* IBSS params */ +
890 params->ie_len);
891 if (!skb)
892 return -ENOMEM;
893
894 sdata->u.ibss.skb = skb; 916 sdata->u.ibss.skb = skb;
895 sdata->u.ibss.state = IEEE80211_IBSS_MLME_SEARCH; 917 sdata->u.ibss.state = IEEE80211_IBSS_MLME_SEARCH;
896 sdata->u.ibss.ibss_join_req = jiffies; 918 sdata->u.ibss.ibss_join_req = jiffies;
897 919
898 memcpy(sdata->u.ibss.ssid, params->ssid, IEEE80211_MAX_SSID_LEN); 920 memcpy(sdata->u.ibss.ssid, params->ssid, IEEE80211_MAX_SSID_LEN);
899
900 /*
901 * The ssid_len setting below is used to see whether
902 * we are active, and we need all other settings
903 * before that may get visible.
904 */
905 mb();
906
907 sdata->u.ibss.ssid_len = params->ssid_len; 921 sdata->u.ibss.ssid_len = params->ssid_len;
908 922
909 ieee80211_recalc_idle(sdata->local); 923 ieee80211_recalc_idle(sdata->local);
910 924
911 set_bit(IEEE80211_IBSS_REQ_RUN, &sdata->u.ibss.request);
912 ieee80211_queue_work(&sdata->local->hw, &sdata->work); 925 ieee80211_queue_work(&sdata->local->hw, &sdata->work);
913 926
927 mutex_unlock(&sdata->u.ibss.mtx);
928
914 return 0; 929 return 0;
915} 930}
916 931
@@ -921,7 +936,9 @@ int ieee80211_ibss_leave(struct ieee80211_sub_if_data *sdata)
921 struct ieee80211_local *local = sdata->local; 936 struct ieee80211_local *local = sdata->local;
922 struct cfg80211_bss *cbss; 937 struct cfg80211_bss *cbss;
923 u16 capability; 938 u16 capability;
924 int active_ibss = 0; 939 int active_ibss;
940
941 mutex_lock(&sdata->u.ibss.mtx);
925 942
926 active_ibss = ieee80211_sta_active_ibss(sdata); 943 active_ibss = ieee80211_sta_active_ibss(sdata);
927 944
@@ -943,11 +960,6 @@ int ieee80211_ibss_leave(struct ieee80211_sub_if_data *sdata)
943 } 960 }
944 } 961 }
945 962
946 del_timer_sync(&sdata->u.ibss.timer);
947 clear_bit(IEEE80211_IBSS_REQ_RUN, &sdata->u.ibss.request);
948 cancel_work_sync(&sdata->work);
949 clear_bit(IEEE80211_IBSS_REQ_RUN, &sdata->u.ibss.request);
950
951 sta_info_flush(sdata->local, sdata); 963 sta_info_flush(sdata->local, sdata);
952 964
953 /* remove beacon */ 965 /* remove beacon */
@@ -964,6 +976,10 @@ int ieee80211_ibss_leave(struct ieee80211_sub_if_data *sdata)
964 memset(sdata->u.ibss.bssid, 0, ETH_ALEN); 976 memset(sdata->u.ibss.bssid, 0, ETH_ALEN);
965 sdata->u.ibss.ssid_len = 0; 977 sdata->u.ibss.ssid_len = 0;
966 978
979 del_timer_sync(&sdata->u.ibss.timer);
980
981 mutex_unlock(&sdata->u.ibss.mtx);
982
967 ieee80211_recalc_idle(sdata->local); 983 ieee80211_recalc_idle(sdata->local);
968 984
969 return 0; 985 return 0;
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index a3649a86a784..ef470064b154 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -377,14 +377,11 @@ struct ieee80211_if_managed {
377 int last_cqm_event_signal; 377 int last_cqm_event_signal;
378}; 378};
379 379
380enum ieee80211_ibss_request {
381 IEEE80211_IBSS_REQ_RUN = 0,
382};
383
384struct ieee80211_if_ibss { 380struct ieee80211_if_ibss {
385 struct timer_list timer; 381 struct timer_list timer;
386 382
387 unsigned long request; 383 struct mutex mtx;
384
388 unsigned long last_scan_completed; 385 unsigned long last_scan_completed;
389 386
390 u32 basic_rates; 387 u32 basic_rates;
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index 910729fc18cd..ebbe264e2b0b 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -249,6 +249,8 @@ static int ieee80211_open(struct net_device *dev)
249 local->fif_other_bss++; 249 local->fif_other_bss++;
250 250
251 ieee80211_configure_filter(local); 251 ieee80211_configure_filter(local);
252
253 netif_carrier_on(dev);
252 break; 254 break;
253 default: 255 default:
254 res = drv_add_interface(local, &sdata->vif); 256 res = drv_add_interface(local, &sdata->vif);
@@ -741,7 +743,7 @@ static void ieee80211_iface_work(struct work_struct *work)
741 int len = skb->len; 743 int len = skb->len;
742 744
743 mutex_lock(&local->sta_mtx); 745 mutex_lock(&local->sta_mtx);
744 sta = sta_info_get(sdata, mgmt->sa); 746 sta = sta_info_get_bss(sdata, mgmt->sa);
745 if (sta) { 747 if (sta) {
746 switch (mgmt->u.action.u.addba_req.action_code) { 748 switch (mgmt->u.action.u.addba_req.action_code) {
747 case WLAN_ACTION_ADDBA_REQ: 749 case WLAN_ACTION_ADDBA_REQ:
@@ -782,7 +784,7 @@ static void ieee80211_iface_work(struct work_struct *work)
782 * right, so terminate the session. 784 * right, so terminate the session.
783 */ 785 */
784 mutex_lock(&local->sta_mtx); 786 mutex_lock(&local->sta_mtx);
785 sta = sta_info_get(sdata, mgmt->sa); 787 sta = sta_info_get_bss(sdata, mgmt->sa);
786 if (sta) { 788 if (sta) {
787 u16 tid = *ieee80211_get_qos_ctl(hdr) & 789 u16 tid = *ieee80211_get_qos_ctl(hdr) &
788 IEEE80211_QOS_CTL_TID_MASK; 790 IEEE80211_QOS_CTL_TID_MASK;
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index d1962650b254..cf8d72196c65 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -698,10 +698,11 @@ void ieee80211_dynamic_ps_timer(unsigned long data)
698 698
699/* MLME */ 699/* MLME */
700static void ieee80211_sta_wmm_params(struct ieee80211_local *local, 700static void ieee80211_sta_wmm_params(struct ieee80211_local *local,
701 struct ieee80211_if_managed *ifmgd, 701 struct ieee80211_sub_if_data *sdata,
702 u8 *wmm_param, size_t wmm_param_len) 702 u8 *wmm_param, size_t wmm_param_len)
703{ 703{
704 struct ieee80211_tx_queue_params params; 704 struct ieee80211_tx_queue_params params;
705 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
705 size_t left; 706 size_t left;
706 int count; 707 int count;
707 u8 *pos, uapsd_queues = 0; 708 u8 *pos, uapsd_queues = 0;
@@ -790,8 +791,8 @@ static void ieee80211_sta_wmm_params(struct ieee80211_local *local,
790 } 791 }
791 792
792 /* enable WMM or activate new settings */ 793 /* enable WMM or activate new settings */
793 local->hw.conf.flags |= IEEE80211_CONF_QOS; 794 sdata->vif.bss_conf.qos = true;
794 drv_config(local, IEEE80211_CONF_CHANGE_QOS); 795 ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_QOS);
795} 796}
796 797
797static u32 ieee80211_handle_bss_capability(struct ieee80211_sub_if_data *sdata, 798static u32 ieee80211_handle_bss_capability(struct ieee80211_sub_if_data *sdata,
@@ -1325,7 +1326,7 @@ static bool ieee80211_assoc_success(struct ieee80211_work *wk,
1325 } 1326 }
1326 1327
1327 if (elems.wmm_param) 1328 if (elems.wmm_param)
1328 ieee80211_sta_wmm_params(local, ifmgd, elems.wmm_param, 1329 ieee80211_sta_wmm_params(local, sdata, elems.wmm_param,
1329 elems.wmm_param_len); 1330 elems.wmm_param_len);
1330 else 1331 else
1331 ieee80211_set_wmm_default(sdata); 1332 ieee80211_set_wmm_default(sdata);
@@ -1597,7 +1598,7 @@ static void ieee80211_rx_mgmt_beacon(struct ieee80211_sub_if_data *sdata,
1597 ieee80211_rx_bss_info(sdata, mgmt, len, rx_status, &elems, 1598 ieee80211_rx_bss_info(sdata, mgmt, len, rx_status, &elems,
1598 true); 1599 true);
1599 1600
1600 ieee80211_sta_wmm_params(local, ifmgd, elems.wmm_param, 1601 ieee80211_sta_wmm_params(local, sdata, elems.wmm_param,
1601 elems.wmm_param_len); 1602 elems.wmm_param_len);
1602 } 1603 }
1603 1604
@@ -2030,6 +2031,8 @@ int ieee80211_mgd_auth(struct ieee80211_sub_if_data *sdata,
2030 auth_alg = WLAN_AUTH_OPEN; 2031 auth_alg = WLAN_AUTH_OPEN;
2031 break; 2032 break;
2032 case NL80211_AUTHTYPE_SHARED_KEY: 2033 case NL80211_AUTHTYPE_SHARED_KEY:
2034 if (IS_ERR(sdata->local->wep_tx_tfm))
2035 return -EOPNOTSUPP;
2033 auth_alg = WLAN_AUTH_SHARED_KEY; 2036 auth_alg = WLAN_AUTH_SHARED_KEY;
2034 break; 2037 break;
2035 case NL80211_AUTHTYPE_FT: 2038 case NL80211_AUTHTYPE_FT:
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index a54cf146ed50..794792177376 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -803,8 +803,8 @@ void ieee80211_set_wmm_default(struct ieee80211_sub_if_data *sdata)
803 803
804 /* after reinitialize QoS TX queues setting to default, 804 /* after reinitialize QoS TX queues setting to default,
805 * disable QoS at all */ 805 * disable QoS at all */
806 local->hw.conf.flags &= ~IEEE80211_CONF_QOS; 806 sdata->vif.bss_conf.qos = sdata->vif.type != NL80211_IFTYPE_STATION;
807 drv_config(local, IEEE80211_CONF_CHANGE_QOS); 807 ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_QOS);
808} 808}
809 809
810void ieee80211_sta_def_wmm_params(struct ieee80211_sub_if_data *sdata, 810void ieee80211_sta_def_wmm_params(struct ieee80211_sub_if_data *sdata,
@@ -1161,7 +1161,8 @@ int ieee80211_reconfig(struct ieee80211_local *local)
1161 BSS_CHANGED_BASIC_RATES | 1161 BSS_CHANGED_BASIC_RATES |
1162 BSS_CHANGED_BEACON_INT | 1162 BSS_CHANGED_BEACON_INT |
1163 BSS_CHANGED_BSSID | 1163 BSS_CHANGED_BSSID |
1164 BSS_CHANGED_CQM; 1164 BSS_CHANGED_CQM |
1165 BSS_CHANGED_QOS;
1165 1166
1166 switch (sdata->vif.type) { 1167 switch (sdata->vif.type) {
1167 case NL80211_IFTYPE_STATION: 1168 case NL80211_IFTYPE_STATION:
diff --git a/net/mac80211/wep.c b/net/mac80211/wep.c
index 6d133b6efce5..9ebc8d8a1f5b 100644
--- a/net/mac80211/wep.c
+++ b/net/mac80211/wep.c
@@ -32,13 +32,16 @@ int ieee80211_wep_init(struct ieee80211_local *local)
32 32
33 local->wep_tx_tfm = crypto_alloc_blkcipher("ecb(arc4)", 0, 33 local->wep_tx_tfm = crypto_alloc_blkcipher("ecb(arc4)", 0,
34 CRYPTO_ALG_ASYNC); 34 CRYPTO_ALG_ASYNC);
35 if (IS_ERR(local->wep_tx_tfm)) 35 if (IS_ERR(local->wep_tx_tfm)) {
36 local->wep_rx_tfm = ERR_PTR(-EINVAL);
36 return PTR_ERR(local->wep_tx_tfm); 37 return PTR_ERR(local->wep_tx_tfm);
38 }
37 39
38 local->wep_rx_tfm = crypto_alloc_blkcipher("ecb(arc4)", 0, 40 local->wep_rx_tfm = crypto_alloc_blkcipher("ecb(arc4)", 0,
39 CRYPTO_ALG_ASYNC); 41 CRYPTO_ALG_ASYNC);
40 if (IS_ERR(local->wep_rx_tfm)) { 42 if (IS_ERR(local->wep_rx_tfm)) {
41 crypto_free_blkcipher(local->wep_tx_tfm); 43 crypto_free_blkcipher(local->wep_tx_tfm);
44 local->wep_tx_tfm = ERR_PTR(-EINVAL);
42 return PTR_ERR(local->wep_rx_tfm); 45 return PTR_ERR(local->wep_rx_tfm);
43 } 46 }
44 47
diff --git a/net/wireless/core.c b/net/wireless/core.c
index 47fcfd0eebc2..f65c6494ede9 100644
--- a/net/wireless/core.c
+++ b/net/wireless/core.c
@@ -472,24 +472,22 @@ int wiphy_register(struct wiphy *wiphy)
472 /* check and set up bitrates */ 472 /* check and set up bitrates */
473 ieee80211_set_bitrate_flags(wiphy); 473 ieee80211_set_bitrate_flags(wiphy);
474 474
475 mutex_lock(&cfg80211_mutex);
476
475 res = device_add(&rdev->wiphy.dev); 477 res = device_add(&rdev->wiphy.dev);
476 if (res) 478 if (res)
477 return res; 479 goto out_unlock;
478 480
479 res = rfkill_register(rdev->rfkill); 481 res = rfkill_register(rdev->rfkill);
480 if (res) 482 if (res)
481 goto out_rm_dev; 483 goto out_rm_dev;
482 484
483 mutex_lock(&cfg80211_mutex);
484
485 /* set up regulatory info */ 485 /* set up regulatory info */
486 wiphy_update_regulatory(wiphy, NL80211_REGDOM_SET_BY_CORE); 486 wiphy_update_regulatory(wiphy, NL80211_REGDOM_SET_BY_CORE);
487 487
488 list_add_rcu(&rdev->list, &cfg80211_rdev_list); 488 list_add_rcu(&rdev->list, &cfg80211_rdev_list);
489 cfg80211_rdev_list_generation++; 489 cfg80211_rdev_list_generation++;
490 490
491 mutex_unlock(&cfg80211_mutex);
492
493 /* add to debugfs */ 491 /* add to debugfs */
494 rdev->wiphy.debugfsdir = 492 rdev->wiphy.debugfsdir =
495 debugfs_create_dir(wiphy_name(&rdev->wiphy), 493 debugfs_create_dir(wiphy_name(&rdev->wiphy),
@@ -509,11 +507,15 @@ int wiphy_register(struct wiphy *wiphy)
509 } 507 }
510 508
511 cfg80211_debugfs_rdev_add(rdev); 509 cfg80211_debugfs_rdev_add(rdev);
510 mutex_unlock(&cfg80211_mutex);
512 511
513 return 0; 512 return 0;
514 513
515 out_rm_dev: 514out_rm_dev:
516 device_del(&rdev->wiphy.dev); 515 device_del(&rdev->wiphy.dev);
516
517out_unlock:
518 mutex_unlock(&cfg80211_mutex);
517 return res; 519 return res;
518} 520}
519EXPORT_SYMBOL(wiphy_register); 521EXPORT_SYMBOL(wiphy_register);
diff --git a/net/wireless/genregdb.awk b/net/wireless/genregdb.awk
index 3cc9e69880a8..53c143f5e770 100644
--- a/net/wireless/genregdb.awk
+++ b/net/wireless/genregdb.awk
@@ -21,6 +21,7 @@ BEGIN {
21 print "" 21 print ""
22 print "#include <linux/nl80211.h>" 22 print "#include <linux/nl80211.h>"
23 print "#include <net/cfg80211.h>" 23 print "#include <net/cfg80211.h>"
24 print "#include \"regdb.h\""
24 print "" 25 print ""
25 regdb = "const struct ieee80211_regdomain *reg_regdb[] = {\n" 26 regdb = "const struct ieee80211_regdomain *reg_regdb[] = {\n"
26} 27}
diff --git a/net/wireless/lib80211_crypt_tkip.c b/net/wireless/lib80211_crypt_tkip.c
index 8cbdb32ff316..a7f995613f1f 100644
--- a/net/wireless/lib80211_crypt_tkip.c
+++ b/net/wireless/lib80211_crypt_tkip.c
@@ -578,7 +578,7 @@ static void michael_mic_hdr(struct sk_buff *skb, u8 * hdr)
578 } 578 }
579 579
580 if (ieee80211_is_data_qos(hdr11->frame_control)) { 580 if (ieee80211_is_data_qos(hdr11->frame_control)) {
581 hdr[12] = le16_to_cpu(*ieee80211_get_qos_ctl(hdr11)) 581 hdr[12] = le16_to_cpu(*((__le16 *)ieee80211_get_qos_ctl(hdr11)))
582 & IEEE80211_QOS_CTL_TID_MASK; 582 & IEEE80211_QOS_CTL_TID_MASK;
583 } else 583 } else
584 hdr[12] = 0; /* priority */ 584 hdr[12] = 0; /* priority */
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index 1ac2bdd46ecf..48baf28cc4b6 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -67,17 +67,9 @@ static struct platform_device *reg_pdev;
67const struct ieee80211_regdomain *cfg80211_regdomain; 67const struct ieee80211_regdomain *cfg80211_regdomain;
68 68
69/* 69/*
70 * We use this as a place for the rd structure built from the
71 * last parsed country IE to rest until CRDA gets back to us with
72 * what it thinks should apply for the same country
73 */
74static const struct ieee80211_regdomain *country_ie_regdomain;
75
76/*
77 * Protects static reg.c components: 70 * Protects static reg.c components:
78 * - cfg80211_world_regdom 71 * - cfg80211_world_regdom
79 * - cfg80211_regdom 72 * - cfg80211_regdom
80 * - country_ie_regdomain
81 * - last_request 73 * - last_request
82 */ 74 */
83static DEFINE_MUTEX(reg_mutex); 75static DEFINE_MUTEX(reg_mutex);
@@ -275,25 +267,6 @@ static bool is_user_regdom_saved(void)
275 return true; 267 return true;
276} 268}
277 269
278/**
279 * country_ie_integrity_changes - tells us if the country IE has changed
280 * @checksum: checksum of country IE of fields we are interested in
281 *
282 * If the country IE has not changed you can ignore it safely. This is
283 * useful to determine if two devices are seeing two different country IEs
284 * even on the same alpha2. Note that this will return false if no IE has
285 * been set on the wireless core yet.
286 */
287static bool country_ie_integrity_changes(u32 checksum)
288{
289 /* If no IE has been set then the checksum doesn't change */
290 if (unlikely(!last_request->country_ie_checksum))
291 return false;
292 if (unlikely(last_request->country_ie_checksum != checksum))
293 return true;
294 return false;
295}
296
297static int reg_copy_regd(const struct ieee80211_regdomain **dst_regd, 270static int reg_copy_regd(const struct ieee80211_regdomain **dst_regd,
298 const struct ieee80211_regdomain *src_regd) 271 const struct ieee80211_regdomain *src_regd)
299{ 272{
@@ -506,471 +479,6 @@ static bool freq_in_rule_band(const struct ieee80211_freq_range *freq_range,
506} 479}
507 480
508/* 481/*
509 * This is a work around for sanity checking ieee80211_channel_to_frequency()'s
510 * work. ieee80211_channel_to_frequency() can for example currently provide a
511 * 2 GHz channel when in fact a 5 GHz channel was desired. An example would be
512 * an AP providing channel 8 on a country IE triplet when it sent this on the
513 * 5 GHz band, that channel is designed to be channel 8 on 5 GHz, not a 2 GHz
514 * channel.
515 *
516 * This can be removed once ieee80211_channel_to_frequency() takes in a band.
517 */
518static bool chan_in_band(int chan, enum ieee80211_band band)
519{
520 int center_freq = ieee80211_channel_to_frequency(chan);
521
522 switch (band) {
523 case IEEE80211_BAND_2GHZ:
524 if (center_freq <= 2484)
525 return true;
526 return false;
527 case IEEE80211_BAND_5GHZ:
528 if (center_freq >= 5005)
529 return true;
530 return false;
531 default:
532 return false;
533 }
534}
535
536/*
537 * Some APs may send a country IE triplet for each channel they
538 * support and while this is completely overkill and silly we still
539 * need to support it. We avoid making a single rule for each channel
540 * though and to help us with this we use this helper to find the
541 * actual subband end channel. These type of country IE triplet
542 * scenerios are handled then, all yielding two regulaotry rules from
543 * parsing a country IE:
544 *
545 * [1]
546 * [2]
547 * [36]
548 * [40]
549 *
550 * [1]
551 * [2-4]
552 * [5-12]
553 * [36]
554 * [40-44]
555 *
556 * [1-4]
557 * [5-7]
558 * [36-44]
559 * [48-64]
560 *
561 * [36-36]
562 * [40-40]
563 * [44-44]
564 * [48-48]
565 * [52-52]
566 * [56-56]
567 * [60-60]
568 * [64-64]
569 * [100-100]
570 * [104-104]
571 * [108-108]
572 * [112-112]
573 * [116-116]
574 * [120-120]
575 * [124-124]
576 * [128-128]
577 * [132-132]
578 * [136-136]
579 * [140-140]
580 *
581 * Returns 0 if the IE has been found to be invalid in the middle
582 * somewhere.
583 */
584static int max_subband_chan(enum ieee80211_band band,
585 int orig_cur_chan,
586 int orig_end_channel,
587 s8 orig_max_power,
588 u8 **country_ie,
589 u8 *country_ie_len)
590{
591 u8 *triplets_start = *country_ie;
592 u8 len_at_triplet = *country_ie_len;
593 int end_subband_chan = orig_end_channel;
594
595 /*
596 * We'll deal with padding for the caller unless
597 * its not immediate and we don't process any channels
598 */
599 if (*country_ie_len == 1) {
600 *country_ie += 1;
601 *country_ie_len -= 1;
602 return orig_end_channel;
603 }
604
605 /* Move to the next triplet and then start search */
606 *country_ie += 3;
607 *country_ie_len -= 3;
608
609 if (!chan_in_band(orig_cur_chan, band))
610 return 0;
611
612 while (*country_ie_len >= 3) {
613 int end_channel = 0;
614 struct ieee80211_country_ie_triplet *triplet =
615 (struct ieee80211_country_ie_triplet *) *country_ie;
616 int cur_channel = 0, next_expected_chan;
617
618 /* means last triplet is completely unrelated to this one */
619 if (triplet->ext.reg_extension_id >=
620 IEEE80211_COUNTRY_EXTENSION_ID) {
621 *country_ie -= 3;
622 *country_ie_len += 3;
623 break;
624 }
625
626 if (triplet->chans.first_channel == 0) {
627 *country_ie += 1;
628 *country_ie_len -= 1;
629 if (*country_ie_len != 0)
630 return 0;
631 break;
632 }
633
634 if (triplet->chans.num_channels == 0)
635 return 0;
636
637 /* Monitonically increasing channel order */
638 if (triplet->chans.first_channel <= end_subband_chan)
639 return 0;
640
641 if (!chan_in_band(triplet->chans.first_channel, band))
642 return 0;
643
644 /* 2 GHz */
645 if (triplet->chans.first_channel <= 14) {
646 end_channel = triplet->chans.first_channel +
647 triplet->chans.num_channels - 1;
648 }
649 else {
650 end_channel = triplet->chans.first_channel +
651 (4 * (triplet->chans.num_channels - 1));
652 }
653
654 if (!chan_in_band(end_channel, band))
655 return 0;
656
657 if (orig_max_power != triplet->chans.max_power) {
658 *country_ie -= 3;
659 *country_ie_len += 3;
660 break;
661 }
662
663 cur_channel = triplet->chans.first_channel;
664
665 /* The key is finding the right next expected channel */
666 if (band == IEEE80211_BAND_2GHZ)
667 next_expected_chan = end_subband_chan + 1;
668 else
669 next_expected_chan = end_subband_chan + 4;
670
671 if (cur_channel != next_expected_chan) {
672 *country_ie -= 3;
673 *country_ie_len += 3;
674 break;
675 }
676
677 end_subband_chan = end_channel;
678
679 /* Move to the next one */
680 *country_ie += 3;
681 *country_ie_len -= 3;
682
683 /*
684 * Padding needs to be dealt with if we processed
685 * some channels.
686 */
687 if (*country_ie_len == 1) {
688 *country_ie += 1;
689 *country_ie_len -= 1;
690 break;
691 }
692
693 /* If seen, the IE is invalid */
694 if (*country_ie_len == 2)
695 return 0;
696 }
697
698 if (end_subband_chan == orig_end_channel) {
699 *country_ie = triplets_start;
700 *country_ie_len = len_at_triplet;
701 return orig_end_channel;
702 }
703
704 return end_subband_chan;
705}
706
707/*
708 * Converts a country IE to a regulatory domain. A regulatory domain
709 * structure has a lot of information which the IE doesn't yet have,
710 * so for the other values we use upper max values as we will intersect
711 * with our userspace regulatory agent to get lower bounds.
712 */
713static struct ieee80211_regdomain *country_ie_2_rd(
714 enum ieee80211_band band,
715 u8 *country_ie,
716 u8 country_ie_len,
717 u32 *checksum)
718{
719 struct ieee80211_regdomain *rd = NULL;
720 unsigned int i = 0;
721 char alpha2[2];
722 u32 flags = 0;
723 u32 num_rules = 0, size_of_regd = 0;
724 u8 *triplets_start = NULL;
725 u8 len_at_triplet = 0;
726 /* the last channel we have registered in a subband (triplet) */
727 int last_sub_max_channel = 0;
728
729 *checksum = 0xDEADBEEF;
730
731 /* Country IE requirements */
732 BUG_ON(country_ie_len < IEEE80211_COUNTRY_IE_MIN_LEN ||
733 country_ie_len & 0x01);
734
735 alpha2[0] = country_ie[0];
736 alpha2[1] = country_ie[1];
737
738 /*
739 * Third octet can be:
740 * 'I' - Indoor
741 * 'O' - Outdoor
742 *
743 * anything else we assume is no restrictions
744 */
745 if (country_ie[2] == 'I')
746 flags = NL80211_RRF_NO_OUTDOOR;
747 else if (country_ie[2] == 'O')
748 flags = NL80211_RRF_NO_INDOOR;
749
750 country_ie += 3;
751 country_ie_len -= 3;
752
753 triplets_start = country_ie;
754 len_at_triplet = country_ie_len;
755
756 *checksum ^= ((flags ^ alpha2[0] ^ alpha2[1]) << 8);
757
758 /*
759 * We need to build a reg rule for each triplet, but first we must
760 * calculate the number of reg rules we will need. We will need one
761 * for each channel subband
762 */
763 while (country_ie_len >= 3) {
764 int end_channel = 0;
765 struct ieee80211_country_ie_triplet *triplet =
766 (struct ieee80211_country_ie_triplet *) country_ie;
767 int cur_sub_max_channel = 0, cur_channel = 0;
768
769 if (triplet->ext.reg_extension_id >=
770 IEEE80211_COUNTRY_EXTENSION_ID) {
771 country_ie += 3;
772 country_ie_len -= 3;
773 continue;
774 }
775
776 /*
777 * APs can add padding to make length divisible
778 * by two, required by the spec.
779 */
780 if (triplet->chans.first_channel == 0) {
781 country_ie++;
782 country_ie_len--;
783 /* This is expected to be at the very end only */
784 if (country_ie_len != 0)
785 return NULL;
786 break;
787 }
788
789 if (triplet->chans.num_channels == 0)
790 return NULL;
791
792 if (!chan_in_band(triplet->chans.first_channel, band))
793 return NULL;
794
795 /* 2 GHz */
796 if (band == IEEE80211_BAND_2GHZ)
797 end_channel = triplet->chans.first_channel +
798 triplet->chans.num_channels - 1;
799 else
800 /*
801 * 5 GHz -- For example in country IEs if the first
802 * channel given is 36 and the number of channels is 4
803 * then the individual channel numbers defined for the
804 * 5 GHz PHY by these parameters are: 36, 40, 44, and 48
805 * and not 36, 37, 38, 39.
806 *
807 * See: http://tinyurl.com/11d-clarification
808 */
809 end_channel = triplet->chans.first_channel +
810 (4 * (triplet->chans.num_channels - 1));
811
812 cur_channel = triplet->chans.first_channel;
813
814 /*
815 * Enhancement for APs that send a triplet for every channel
816 * or for whatever reason sends triplets with multiple channels
817 * separated when in fact they should be together.
818 */
819 end_channel = max_subband_chan(band,
820 cur_channel,
821 end_channel,
822 triplet->chans.max_power,
823 &country_ie,
824 &country_ie_len);
825 if (!end_channel)
826 return NULL;
827
828 if (!chan_in_band(end_channel, band))
829 return NULL;
830
831 cur_sub_max_channel = end_channel;
832
833 /* Basic sanity check */
834 if (cur_sub_max_channel < cur_channel)
835 return NULL;
836
837 /*
838 * Do not allow overlapping channels. Also channels
839 * passed in each subband must be monotonically
840 * increasing
841 */
842 if (last_sub_max_channel) {
843 if (cur_channel <= last_sub_max_channel)
844 return NULL;
845 if (cur_sub_max_channel <= last_sub_max_channel)
846 return NULL;
847 }
848
849 /*
850 * When dot11RegulatoryClassesRequired is supported
851 * we can throw ext triplets as part of this soup,
852 * for now we don't care when those change as we
853 * don't support them
854 */
855 *checksum ^= ((cur_channel ^ cur_sub_max_channel) << 8) |
856 ((cur_sub_max_channel ^ cur_sub_max_channel) << 16) |
857 ((triplet->chans.max_power ^ cur_sub_max_channel) << 24);
858
859 last_sub_max_channel = cur_sub_max_channel;
860
861 num_rules++;
862
863 if (country_ie_len >= 3) {
864 country_ie += 3;
865 country_ie_len -= 3;
866 }
867
868 /*
869 * Note: this is not a IEEE requirement but
870 * simply a memory requirement
871 */
872 if (num_rules > NL80211_MAX_SUPP_REG_RULES)
873 return NULL;
874 }
875
876 country_ie = triplets_start;
877 country_ie_len = len_at_triplet;
878
879 size_of_regd = sizeof(struct ieee80211_regdomain) +
880 (num_rules * sizeof(struct ieee80211_reg_rule));
881
882 rd = kzalloc(size_of_regd, GFP_KERNEL);
883 if (!rd)
884 return NULL;
885
886 rd->n_reg_rules = num_rules;
887 rd->alpha2[0] = alpha2[0];
888 rd->alpha2[1] = alpha2[1];
889
890 /* This time around we fill in the rd */
891 while (country_ie_len >= 3) {
892 int end_channel = 0;
893 struct ieee80211_country_ie_triplet *triplet =
894 (struct ieee80211_country_ie_triplet *) country_ie;
895 struct ieee80211_reg_rule *reg_rule = NULL;
896 struct ieee80211_freq_range *freq_range = NULL;
897 struct ieee80211_power_rule *power_rule = NULL;
898
899 /*
900 * Must parse if dot11RegulatoryClassesRequired is true,
901 * we don't support this yet
902 */
903 if (triplet->ext.reg_extension_id >=
904 IEEE80211_COUNTRY_EXTENSION_ID) {
905 country_ie += 3;
906 country_ie_len -= 3;
907 continue;
908 }
909
910 if (triplet->chans.first_channel == 0) {
911 country_ie++;
912 country_ie_len--;
913 break;
914 }
915
916 reg_rule = &rd->reg_rules[i];
917 freq_range = &reg_rule->freq_range;
918 power_rule = &reg_rule->power_rule;
919
920 reg_rule->flags = flags;
921
922 /* 2 GHz */
923 if (band == IEEE80211_BAND_2GHZ)
924 end_channel = triplet->chans.first_channel +
925 triplet->chans.num_channels -1;
926 else
927 end_channel = triplet->chans.first_channel +
928 (4 * (triplet->chans.num_channels - 1));
929
930 end_channel = max_subband_chan(band,
931 triplet->chans.first_channel,
932 end_channel,
933 triplet->chans.max_power,
934 &country_ie,
935 &country_ie_len);
936
937 /*
938 * The +10 is since the regulatory domain expects
939 * the actual band edge, not the center of freq for
940 * its start and end freqs, assuming 20 MHz bandwidth on
941 * the channels passed
942 */
943 freq_range->start_freq_khz =
944 MHZ_TO_KHZ(ieee80211_channel_to_frequency(
945 triplet->chans.first_channel) - 10);
946 freq_range->end_freq_khz =
947 MHZ_TO_KHZ(ieee80211_channel_to_frequency(
948 end_channel) + 10);
949
950 /*
951 * These are large arbitrary values we use to intersect later.
952 * Increment this if we ever support >= 40 MHz channels
953 * in IEEE 802.11
954 */
955 freq_range->max_bandwidth_khz = MHZ_TO_KHZ(40);
956 power_rule->max_antenna_gain = DBI_TO_MBI(100);
957 power_rule->max_eirp = DBM_TO_MBM(triplet->chans.max_power);
958
959 i++;
960
961 if (country_ie_len >= 3) {
962 country_ie += 3;
963 country_ie_len -= 3;
964 }
965
966 BUG_ON(i > NL80211_MAX_SUPP_REG_RULES);
967 }
968
969 return rd;
970}
971
972
973/*
974 * Helper for regdom_intersect(), this does the real 482 * Helper for regdom_intersect(), this does the real
975 * mathematical intersection fun 483 * mathematical intersection fun
976 */ 484 */
@@ -1191,7 +699,6 @@ static int freq_reg_info_regd(struct wiphy *wiphy,
1191 699
1192 return -EINVAL; 700 return -EINVAL;
1193} 701}
1194EXPORT_SYMBOL(freq_reg_info);
1195 702
1196int freq_reg_info(struct wiphy *wiphy, 703int freq_reg_info(struct wiphy *wiphy,
1197 u32 center_freq, 704 u32 center_freq,
@@ -1205,6 +712,7 @@ int freq_reg_info(struct wiphy *wiphy,
1205 reg_rule, 712 reg_rule,
1206 NULL); 713 NULL);
1207} 714}
715EXPORT_SYMBOL(freq_reg_info);
1208 716
1209/* 717/*
1210 * Note that right now we assume the desired channel bandwidth 718 * Note that right now we assume the desired channel bandwidth
@@ -1243,41 +751,8 @@ static void handle_channel(struct wiphy *wiphy, enum ieee80211_band band,
1243 desired_bw_khz, 751 desired_bw_khz,
1244 &reg_rule); 752 &reg_rule);
1245 753
1246 if (r) { 754 if (r)
1247 /*
1248 * This means no regulatory rule was found in the country IE
1249 * with a frequency range on the center_freq's band, since
1250 * IEEE-802.11 allows for a country IE to have a subset of the
1251 * regulatory information provided in a country we ignore
1252 * disabling the channel unless at least one reg rule was
1253 * found on the center_freq's band. For details see this
1254 * clarification:
1255 *
1256 * http://tinyurl.com/11d-clarification
1257 */
1258 if (r == -ERANGE &&
1259 last_request->initiator ==
1260 NL80211_REGDOM_SET_BY_COUNTRY_IE) {
1261 REG_DBG_PRINT("cfg80211: Leaving channel %d MHz "
1262 "intact on %s - no rule found in band on "
1263 "Country IE\n",
1264 chan->center_freq, wiphy_name(wiphy));
1265 } else {
1266 /*
1267 * In this case we know the country IE has at least one reg rule
1268 * for the band so we respect its band definitions
1269 */
1270 if (last_request->initiator ==
1271 NL80211_REGDOM_SET_BY_COUNTRY_IE)
1272 REG_DBG_PRINT("cfg80211: Disabling "
1273 "channel %d MHz on %s due to "
1274 "Country IE\n",
1275 chan->center_freq, wiphy_name(wiphy));
1276 flags |= IEEE80211_CHAN_DISABLED;
1277 chan->flags = flags;
1278 }
1279 return; 755 return;
1280 }
1281 756
1282 power_rule = &reg_rule->power_rule; 757 power_rule = &reg_rule->power_rule;
1283 freq_range = &reg_rule->freq_range; 758 freq_range = &reg_rule->freq_range;
@@ -2008,35 +1483,6 @@ int regulatory_hint(struct wiphy *wiphy, const char *alpha2)
2008} 1483}
2009EXPORT_SYMBOL(regulatory_hint); 1484EXPORT_SYMBOL(regulatory_hint);
2010 1485
2011/* Caller must hold reg_mutex */
2012static bool reg_same_country_ie_hint(struct wiphy *wiphy,
2013 u32 country_ie_checksum)
2014{
2015 struct wiphy *request_wiphy;
2016
2017 assert_reg_lock();
2018
2019 if (unlikely(last_request->initiator !=
2020 NL80211_REGDOM_SET_BY_COUNTRY_IE))
2021 return false;
2022
2023 request_wiphy = wiphy_idx_to_wiphy(last_request->wiphy_idx);
2024
2025 if (!request_wiphy)
2026 return false;
2027
2028 if (likely(request_wiphy != wiphy))
2029 return !country_ie_integrity_changes(country_ie_checksum);
2030 /*
2031 * We should not have let these through at this point, they
2032 * should have been picked up earlier by the first alpha2 check
2033 * on the device
2034 */
2035 if (WARN_ON(!country_ie_integrity_changes(country_ie_checksum)))
2036 return true;
2037 return false;
2038}
2039
2040/* 1486/*
2041 * We hold wdev_lock() here so we cannot hold cfg80211_mutex() and 1487 * We hold wdev_lock() here so we cannot hold cfg80211_mutex() and
2042 * therefore cannot iterate over the rdev list here. 1488 * therefore cannot iterate over the rdev list here.
@@ -2048,7 +1494,6 @@ void regulatory_hint_11d(struct wiphy *wiphy,
2048{ 1494{
2049 struct ieee80211_regdomain *rd = NULL; 1495 struct ieee80211_regdomain *rd = NULL;
2050 char alpha2[2]; 1496 char alpha2[2];
2051 u32 checksum = 0;
2052 enum environment_cap env = ENVIRON_ANY; 1497 enum environment_cap env = ENVIRON_ANY;
2053 struct regulatory_request *request; 1498 struct regulatory_request *request;
2054 1499
@@ -2064,14 +1509,6 @@ void regulatory_hint_11d(struct wiphy *wiphy,
2064 if (country_ie_len < IEEE80211_COUNTRY_IE_MIN_LEN) 1509 if (country_ie_len < IEEE80211_COUNTRY_IE_MIN_LEN)
2065 goto out; 1510 goto out;
2066 1511
2067 /*
2068 * Pending country IE processing, this can happen after we
2069 * call CRDA and wait for a response if a beacon was received before
2070 * we were able to process the last regulatory_hint_11d() call
2071 */
2072 if (country_ie_regdomain)
2073 goto out;
2074
2075 alpha2[0] = country_ie[0]; 1512 alpha2[0] = country_ie[0];
2076 alpha2[1] = country_ie[1]; 1513 alpha2[1] = country_ie[1];
2077 1514
@@ -2090,39 +1527,14 @@ void regulatory_hint_11d(struct wiphy *wiphy,
2090 wiphy_idx_valid(last_request->wiphy_idx))) 1527 wiphy_idx_valid(last_request->wiphy_idx)))
2091 goto out; 1528 goto out;
2092 1529
2093 rd = country_ie_2_rd(band, country_ie, country_ie_len, &checksum);
2094 if (!rd) {
2095 REG_DBG_PRINT("cfg80211: Ignoring bogus country IE\n");
2096 goto out;
2097 }
2098
2099 /*
2100 * This will not happen right now but we leave it here for the
2101 * the future when we want to add suspend/resume support and having
2102 * the user move to another country after doing so, or having the user
2103 * move to another AP. Right now we just trust the first AP.
2104 *
2105 * If we hit this before we add this support we want to be informed of
2106 * it as it would indicate a mistake in the current design
2107 */
2108 if (WARN_ON(reg_same_country_ie_hint(wiphy, checksum)))
2109 goto free_rd_out;
2110
2111 request = kzalloc(sizeof(struct regulatory_request), GFP_KERNEL); 1530 request = kzalloc(sizeof(struct regulatory_request), GFP_KERNEL);
2112 if (!request) 1531 if (!request)
2113 goto free_rd_out; 1532 goto free_rd_out;
2114 1533
2115 /*
2116 * We keep this around for when CRDA comes back with a response so
2117 * we can intersect with that
2118 */
2119 country_ie_regdomain = rd;
2120
2121 request->wiphy_idx = get_wiphy_idx(wiphy); 1534 request->wiphy_idx = get_wiphy_idx(wiphy);
2122 request->alpha2[0] = rd->alpha2[0]; 1535 request->alpha2[0] = alpha2[0];
2123 request->alpha2[1] = rd->alpha2[1]; 1536 request->alpha2[1] = alpha2[1];
2124 request->initiator = NL80211_REGDOM_SET_BY_COUNTRY_IE; 1537 request->initiator = NL80211_REGDOM_SET_BY_COUNTRY_IE;
2125 request->country_ie_checksum = checksum;
2126 request->country_ie_env = env; 1538 request->country_ie_env = env;
2127 1539
2128 mutex_unlock(&reg_mutex); 1540 mutex_unlock(&reg_mutex);
@@ -2383,33 +1795,6 @@ static void print_regdomain_info(const struct ieee80211_regdomain *rd)
2383 print_rd_rules(rd); 1795 print_rd_rules(rd);
2384} 1796}
2385 1797
2386#ifdef CONFIG_CFG80211_REG_DEBUG
2387static void reg_country_ie_process_debug(
2388 const struct ieee80211_regdomain *rd,
2389 const struct ieee80211_regdomain *country_ie_regdomain,
2390 const struct ieee80211_regdomain *intersected_rd)
2391{
2392 printk(KERN_DEBUG "cfg80211: Received country IE:\n");
2393 print_regdomain_info(country_ie_regdomain);
2394 printk(KERN_DEBUG "cfg80211: CRDA thinks this should applied:\n");
2395 print_regdomain_info(rd);
2396 if (intersected_rd) {
2397 printk(KERN_DEBUG "cfg80211: We intersect both of these "
2398 "and get:\n");
2399 print_regdomain_info(intersected_rd);
2400 return;
2401 }
2402 printk(KERN_DEBUG "cfg80211: Intersection between both failed\n");
2403}
2404#else
2405static inline void reg_country_ie_process_debug(
2406 const struct ieee80211_regdomain *rd,
2407 const struct ieee80211_regdomain *country_ie_regdomain,
2408 const struct ieee80211_regdomain *intersected_rd)
2409{
2410}
2411#endif
2412
2413/* Takes ownership of rd only if it doesn't fail */ 1798/* Takes ownership of rd only if it doesn't fail */
2414static int __set_regdom(const struct ieee80211_regdomain *rd) 1799static int __set_regdom(const struct ieee80211_regdomain *rd)
2415{ 1800{
@@ -2521,34 +1906,6 @@ static int __set_regdom(const struct ieee80211_regdomain *rd)
2521 return 0; 1906 return 0;
2522 } 1907 }
2523 1908
2524 /*
2525 * Country IE requests are handled a bit differently, we intersect
2526 * the country IE rd with what CRDA believes that country should have
2527 */
2528
2529 /*
2530 * Userspace could have sent two replies with only
2531 * one kernel request. By the second reply we would have
2532 * already processed and consumed the country_ie_regdomain.
2533 */
2534 if (!country_ie_regdomain)
2535 return -EALREADY;
2536 BUG_ON(rd == country_ie_regdomain);
2537
2538 /*
2539 * Intersect what CRDA returned and our what we
2540 * had built from the Country IE received
2541 */
2542
2543 intersected_rd = regdom_intersect(rd, country_ie_regdomain);
2544
2545 reg_country_ie_process_debug(rd,
2546 country_ie_regdomain,
2547 intersected_rd);
2548
2549 kfree(country_ie_regdomain);
2550 country_ie_regdomain = NULL;
2551
2552 if (!intersected_rd) 1909 if (!intersected_rd)
2553 return -EINVAL; 1910 return -EINVAL;
2554 1911
@@ -2688,9 +2045,6 @@ void /* __init_or_exit */ regulatory_exit(void)
2688 2045
2689 reset_regdomains(); 2046 reset_regdomains();
2690 2047
2691 kfree(country_ie_regdomain);
2692 country_ie_regdomain = NULL;
2693
2694 kfree(last_request); 2048 kfree(last_request);
2695 2049
2696 platform_device_unregister(reg_pdev); 2050 platform_device_unregister(reg_pdev);
diff --git a/net/wireless/scan.c b/net/wireless/scan.c
index 58401d246bda..5ca8c7180141 100644
--- a/net/wireless/scan.c
+++ b/net/wireless/scan.c
@@ -275,6 +275,7 @@ struct cfg80211_bss *cfg80211_get_bss(struct wiphy *wiphy,
275{ 275{
276 struct cfg80211_registered_device *dev = wiphy_to_dev(wiphy); 276 struct cfg80211_registered_device *dev = wiphy_to_dev(wiphy);
277 struct cfg80211_internal_bss *bss, *res = NULL; 277 struct cfg80211_internal_bss *bss, *res = NULL;
278 unsigned long now = jiffies;
278 279
279 spin_lock_bh(&dev->bss_lock); 280 spin_lock_bh(&dev->bss_lock);
280 281
@@ -283,6 +284,10 @@ struct cfg80211_bss *cfg80211_get_bss(struct wiphy *wiphy,
283 continue; 284 continue;
284 if (channel && bss->pub.channel != channel) 285 if (channel && bss->pub.channel != channel)
285 continue; 286 continue;
287 /* Don't get expired BSS structs */
288 if (time_after(now, bss->ts + IEEE80211_SCAN_RESULT_EXPIRE) &&
289 !atomic_read(&bss->hold))
290 continue;
286 if (is_bss(&bss->pub, bssid, ssid, ssid_len)) { 291 if (is_bss(&bss->pub, bssid, ssid, ssid_len)) {
287 res = bss; 292 res = bss;
288 kref_get(&res->ref); 293 kref_get(&res->ref);
diff --git a/net/wireless/sme.c b/net/wireless/sme.c
index 72222f0074db..a8c2d6b877ae 100644
--- a/net/wireless/sme.c
+++ b/net/wireless/sme.c
@@ -35,7 +35,7 @@ struct cfg80211_conn {
35 bool auto_auth, prev_bssid_valid; 35 bool auto_auth, prev_bssid_valid;
36}; 36};
37 37
38bool cfg80211_is_all_idle(void) 38static bool cfg80211_is_all_idle(void)
39{ 39{
40 struct cfg80211_registered_device *rdev; 40 struct cfg80211_registered_device *rdev;
41 struct wireless_dev *wdev; 41 struct wireless_dev *wdev;
diff --git a/net/wireless/wext-compat.c b/net/wireless/wext-compat.c
index 1ff1e9f49136..bb5e0a5ecfa1 100644
--- a/net/wireless/wext-compat.c
+++ b/net/wireless/wext-compat.c
@@ -1471,6 +1471,7 @@ int cfg80211_wext_siwpmksa(struct net_device *dev,
1471 return -EOPNOTSUPP; 1471 return -EOPNOTSUPP;
1472 } 1472 }
1473} 1473}
1474EXPORT_SYMBOL_GPL(cfg80211_wext_siwpmksa);
1474 1475
1475static const iw_handler cfg80211_handlers[] = { 1476static const iw_handler cfg80211_handlers[] = {
1476 [IW_IOCTL_IDX(SIOCGIWNAME)] = (iw_handler) cfg80211_wext_giwname, 1477 [IW_IOCTL_IDX(SIOCGIWNAME)] = (iw_handler) cfg80211_wext_giwname,