Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless into for-davem

+126 -94
+2 -2
drivers/bluetooth/ath3k.c
··· 105 105 106 106 pipe = usb_sndctrlpipe(udev, 0); 107 107 108 - send_buf = kmalloc(BULK_SIZE, GFP_ATOMIC); 108 + send_buf = kmalloc(BULK_SIZE, GFP_KERNEL); 109 109 if (!send_buf) { 110 110 BT_ERR("Can't allocate memory chunk for firmware"); 111 111 return -ENOMEM; ··· 176 176 177 177 count = firmware->size; 178 178 179 - send_buf = kmalloc(BULK_SIZE, GFP_ATOMIC); 179 + send_buf = kmalloc(BULK_SIZE, GFP_KERNEL); 180 180 if (!send_buf) { 181 181 BT_ERR("Can't allocate memory chunk for firmware"); 182 182 return -ENOMEM;
+11 -1
drivers/bluetooth/bcm203x.c
··· 24 24 25 25 #include <linux/module.h> 26 26 27 + #include <linux/atomic.h> 27 28 #include <linux/kernel.h> 28 29 #include <linux/init.h> 29 30 #include <linux/slab.h> ··· 66 65 unsigned long state; 67 66 68 67 struct work_struct work; 68 + atomic_t shutdown; 69 69 70 70 struct urb *urb; 71 71 unsigned char *buffer; ··· 99 97 100 98 data->state = BCM203X_SELECT_MEMORY; 101 99 100 + /* use workqueue to have a small delay */ 102 101 schedule_work(&data->work); 103 102 break; 104 103 ··· 158 155 struct bcm203x_data *data = 159 156 container_of(work, struct bcm203x_data, work); 160 157 161 - if (usb_submit_urb(data->urb, GFP_ATOMIC) < 0) 158 + if (atomic_read(&data->shutdown)) 159 + return; 160 + 161 + if (usb_submit_urb(data->urb, GFP_KERNEL) < 0) 162 162 BT_ERR("Can't submit URB"); 163 163 } 164 164 ··· 249 243 250 244 usb_set_intfdata(intf, data); 251 245 246 + /* use workqueue to have a small delay */ 252 247 schedule_work(&data->work); 253 248 254 249 return 0; ··· 260 253 struct bcm203x_data *data = usb_get_intfdata(intf); 261 254 262 255 BT_DBG("intf %p", intf); 256 + 257 + atomic_inc(&data->shutdown); 258 + cancel_work_sync(&data->work); 263 259 264 260 usb_kill_urb(data->urb); 265 261
+7 -6
drivers/bluetooth/bfusb.c
··· 568 568 569 569 BT_INFO("BlueFRITZ! USB loading firmware"); 570 570 571 + buf = kmalloc(BFUSB_MAX_BLOCK_SIZE + 3, GFP_KERNEL); 572 + if (!buf) { 573 + BT_ERR("Can't allocate memory chunk for firmware"); 574 + return -ENOMEM; 575 + } 576 + 571 577 pipe = usb_sndctrlpipe(data->udev, 0); 572 578 573 579 if (usb_control_msg(data->udev, pipe, USB_REQ_SET_CONFIGURATION, 574 580 0, 1, 0, NULL, 0, USB_CTRL_SET_TIMEOUT) < 0) { 575 581 BT_ERR("Can't change to loading configuration"); 582 + kfree(buf); 576 583 return -EBUSY; 577 584 } 578 585 579 586 data->udev->toggle[0] = data->udev->toggle[1] = 0; 580 - 581 - buf = kmalloc(BFUSB_MAX_BLOCK_SIZE + 3, GFP_ATOMIC); 582 - if (!buf) { 583 - BT_ERR("Can't allocate memory chunk for firmware"); 584 - return -ENOMEM; 585 - } 586 587 587 588 pipe = usb_sndbulkpipe(data->udev, data->bulk_out_ep); 588 589
-4
drivers/net/wireless/ath/ath9k/ar9002_calib.c
··· 868 868 /* Do PA Calibration */ 869 869 ar9002_hw_pa_cal(ah, true); 870 870 871 - /* Do NF Calibration after DC offset and other calibrations */ 872 - ath9k_hw_loadnf(ah, chan); 873 - ath9k_hw_start_nfcal(ah, true); 874 - 875 871 if (ah->caldata) 876 872 ah->caldata->nfcal_pending = true; 877 873
+6 -5
drivers/net/wireless/ath/ath9k/ar9003_calib.c
··· 908 908 int i; 909 909 bool restore; 910 910 911 - if (!(ah->caps.hw_caps & ATH9K_HW_CAP_RTT) || !ah->caldata) 911 + if (!ah->caldata) 912 912 return false; 913 913 914 914 hist = &ah->caldata->rtt_hist; 915 + if (!hist->num_readings) 916 + return false; 917 + 915 918 ar9003_hw_rtt_enable(ah); 916 - ar9003_hw_rtt_set_mask(ah, 0x10); 919 + ar9003_hw_rtt_set_mask(ah, 0x00); 917 920 for (i = 0; i < AR9300_MAX_CHAINS; i++) { 918 921 if (!(ah->rxchainmask & (1 << i))) 919 922 continue; ··· 1073 1070 if (is_reusable && (hist->num_readings < RTT_HIST_MAX)) { 1074 1071 u32 *table; 1075 1072 1073 + hist->num_readings++; 1076 1074 for (i = 0; i < AR9300_MAX_CHAINS; i++) { 1077 1075 if (!(ah->rxchainmask & (1 << i))) 1078 1076 continue; ··· 1084 1080 1085 1081 ar9003_hw_rtt_disable(ah); 1086 1082 } 1087 - 1088 - ath9k_hw_loadnf(ah, chan); 1089 - ath9k_hw_start_nfcal(ah, true); 1090 1083 1091 1084 /* Initialize list pointers */ 1092 1085 ah->cal_list = ah->cal_list_last = ah->cal_list_curr = NULL;
+17 -17
drivers/net/wireless/ath/ath9k/ar9003_phy.h
··· 572 572 573 573 #define AR_PHY_TXGAIN_TABLE (AR_SM_BASE + 0x300) 574 574 575 - #define AR_PHY_TX_IQCAL_CONTROL_0 (AR_SM_BASE + AR_SREV_9485(ah) ? \ 576 - 0x3c4 : 0x444) 577 - #define AR_PHY_TX_IQCAL_CONTROL_1 (AR_SM_BASE + AR_SREV_9485(ah) ? \ 578 - 0x3c8 : 0x448) 579 - #define AR_PHY_TX_IQCAL_START (AR_SM_BASE + AR_SREV_9485(ah) ? \ 580 - 0x3c4 : 0x440) 581 - #define AR_PHY_TX_IQCAL_STATUS_B0 (AR_SM_BASE + AR_SREV_9485(ah) ? \ 582 - 0x3f0 : 0x48c) 575 + #define AR_PHY_TX_IQCAL_CONTROL_0 (AR_SM_BASE + (AR_SREV_9485(ah) ? \ 576 + 0x3c4 : 0x444)) 577 + #define AR_PHY_TX_IQCAL_CONTROL_1 (AR_SM_BASE + (AR_SREV_9485(ah) ? \ 578 + 0x3c8 : 0x448)) 579 + #define AR_PHY_TX_IQCAL_START (AR_SM_BASE + (AR_SREV_9485(ah) ? \ 580 + 0x3c4 : 0x440)) 581 + #define AR_PHY_TX_IQCAL_STATUS_B0 (AR_SM_BASE + (AR_SREV_9485(ah) ? \ 582 + 0x3f0 : 0x48c)) 583 583 #define AR_PHY_TX_IQCAL_CORR_COEFF_B0(_i) (AR_SM_BASE + \ 584 584 (AR_SREV_9485(ah) ? \ 585 585 0x3d0 : 0x450) + ((_i) << 2)) ··· 651 651 #define AR_SWITCH_TABLE_ALL_S (0) 652 652 653 653 #define AR_PHY_65NM_CH0_THERM (AR_SREV_9300(ah) ? 0x16290 :\ 654 - (AR_SREV_9485(ah) ? 0x1628c : 0x16294)) 654 + (AR_SREV_9462(ah) ? 0x16294 : 0x1628c)) 655 655 656 656 #define AR_PHY_65NM_CH0_THERM_LOCAL 0x80000000 657 657 #define AR_PHY_65NM_CH0_THERM_LOCAL_S 31 ··· 668 668 #define AR_PHY_65NM_CH2_RXTX2 0x16904 669 669 670 670 #define AR_CH0_TOP2 (AR_SREV_9300(ah) ? 0x1628c : \ 671 - (AR_SREV_9485(ah) ? 0x16284 : 0x16290)) 671 + (AR_SREV_9462(ah) ? 0x16290 : 0x16284)) 672 672 #define AR_CH0_TOP2_XPABIASLVL 0xf000 673 673 #define AR_CH0_TOP2_XPABIASLVL_S 12 674 674 675 675 #define AR_CH0_XTAL (AR_SREV_9300(ah) ? 0x16294 : \ 676 - (AR_SREV_9485(ah) ? 0x16290 : 0x16298)) 676 + (AR_SREV_9462(ah) ? 0x16298 : 0x16290)) 677 677 #define AR_CH0_XTAL_CAPINDAC 0x7f000000 678 678 #define AR_CH0_XTAL_CAPINDAC_S 24 679 679 #define AR_CH0_XTAL_CAPOUTDAC 0x00fe0000 ··· 908 908 #define AR_PHY_TPC_5_B1 (AR_SM1_BASE + 0x208) 909 909 #define AR_PHY_TPC_6_B1 (AR_SM1_BASE + 0x20c) 910 910 #define AR_PHY_TPC_11_B1 (AR_SM1_BASE + 0x220) 911 - #define AR_PHY_PDADC_TAB_1 (AR_SM1_BASE + (AR_SREV_AR9300(ah) ? \ 912 - 0x240 : 0x280)) 911 + #define AR_PHY_PDADC_TAB_1 (AR_SM1_BASE + (AR_SREV_AR9462(ah) ? \ 912 + 0x280 : 0x240)) 913 913 #define AR_PHY_TPC_19_B1 (AR_SM1_BASE + 0x240) 914 914 #define AR_PHY_TPC_19_B1_ALPHA_THERM 0xff 915 915 #define AR_PHY_TPC_19_B1_ALPHA_THERM_S 0 ··· 931 931 #define AR_PHY_AIC_SRAM_ADDR_B1 (AR_SM1_BASE + 0x5f0) 932 932 #define AR_PHY_AIC_SRAM_DATA_B1 (AR_SM1_BASE + 0x5f4) 933 933 934 - #define AR_PHY_RTT_TABLE_SW_INTF_B(i) (0x384 + (i) ? \ 935 - AR_SM1_BASE : AR_SM_BASE) 936 - #define AR_PHY_RTT_TABLE_SW_INTF_1_B(i) (0x388 + (i) ? \ 937 - AR_SM1_BASE : AR_SM_BASE) 934 + #define AR_PHY_RTT_TABLE_SW_INTF_B(i) (0x384 + ((i) ? \ 935 + AR_SM1_BASE : AR_SM_BASE)) 936 + #define AR_PHY_RTT_TABLE_SW_INTF_1_B(i) (0x388 + ((i) ? \ 937 + AR_SM1_BASE : AR_SM_BASE)) 938 938 /* 939 939 * Channel 2 Register Map 940 940 */
+5 -5
drivers/net/wireless/ath/ath9k/ar9485_initvals.h
··· 521 521 {0x000160ac, 0x24611800}, 522 522 {0x000160b0, 0x03284f3e}, 523 523 {0x0001610c, 0x00170000}, 524 - {0x00016140, 0x10804008}, 524 + {0x00016140, 0x50804008}, 525 525 }; 526 526 527 527 static const u32 ar9485_1_1_mac_postamble[][5] = { ··· 603 603 604 604 static const u32 ar9485_1_1_pcie_phy_pll_on_clkreq_enable_L1[][2] = { 605 605 /* Addr allmodes */ 606 - {0x00018c00, 0x10052e5e}, 606 + {0x00018c00, 0x18052e5e}, 607 607 {0x00018c04, 0x000801d8}, 608 608 {0x00018c08, 0x0000080c}, 609 609 }; ··· 776 776 777 777 static const u32 ar9485_1_1_pcie_phy_clkreq_disable_L1[][2] = { 778 778 /* Addr allmodes */ 779 - {0x00018c00, 0x10013e5e}, 779 + {0x00018c00, 0x18013e5e}, 780 780 {0x00018c04, 0x000801d8}, 781 781 {0x00018c08, 0x0000080c}, 782 782 }; ··· 882 882 883 883 static const u32 ar9485_1_1_pcie_phy_pll_on_clkreq_disable_L1[][2] = { 884 884 /* Addr allmodes */ 885 - {0x00018c00, 0x10012e5e}, 885 + {0x00018c00, 0x18012e5e}, 886 886 {0x00018c04, 0x000801d8}, 887 887 {0x00018c08, 0x0000080c}, 888 888 }; ··· 1021 1021 1022 1022 static const u32 ar9485_1_1_pcie_phy_clkreq_enable_L1[][2] = { 1023 1023 /* Addr allmodes */ 1024 - {0x00018c00, 0x10053e5e}, 1024 + {0x00018c00, 0x18053e5e}, 1025 1025 {0x00018c04, 0x000801d8}, 1026 1026 {0x00018c08, 0x0000080c}, 1027 1027 };
+3
drivers/net/wireless/ath/ath9k/hw.c
··· 1724 1724 if (!ath9k_hw_init_cal(ah, chan)) 1725 1725 return -EIO; 1726 1726 1727 + ath9k_hw_loadnf(ah, chan); 1728 + ath9k_hw_start_nfcal(ah, true); 1729 + 1727 1730 ENABLE_REGWRITE_BUFFER(ah); 1728 1731 1729 1732 ath9k_hw_restore_chainmask(ah);
+7 -4
drivers/net/wireless/ath/carl9170/tx.c
··· 296 296 super = (void *)skb->data; 297 297 txinfo->status.ampdu_len = super->s.rix; 298 298 txinfo->status.ampdu_ack_len = super->s.cnt; 299 - } else if (txinfo->flags & IEEE80211_TX_STAT_ACK) { 299 + } else if ((txinfo->flags & IEEE80211_TX_STAT_ACK) && 300 + !(txinfo->flags & IEEE80211_TX_CTL_REQ_TX_STATUS)) { 300 301 /* 301 302 * drop redundant tx_status reports: 302 303 * ··· 309 308 * 310 309 * 3. minstrel_ht is picky, it only accepts 311 310 * reports of frames with the TX_STATUS_AMPDU flag. 311 + * 312 + * 4. mac80211 is not particularly interested in 313 + * feedback either [CTL_REQ_TX_STATUS not set] 312 314 */ 313 315 314 316 dev_kfree_skb_any(skb); 315 317 return; 316 318 } else { 317 319 /* 318 - * Frame has failed, but we want to keep it in 319 - * case it was lost due to a power-state 320 - * transition. 320 + * Either the frame transmission has failed or 321 + * mac80211 requested tx status. 321 322 */ 322 323 } 323 324 }
-1
drivers/net/wireless/b43/xmit.c
··· 827 827 #endif 828 828 return; 829 829 drop: 830 - b43dbg(dev->wl, "RX: Packet dropped\n"); 831 830 dev_kfree_skb_any(skb); 832 831 } 833 832
-10
drivers/net/wireless/iwlwifi/iwl-core.c
··· 1755 1755 { 1756 1756 if (iwl_trans_check_stuck_queue(trans(priv), txq)) { 1757 1757 int ret; 1758 - if (txq == priv->shrd->cmd_queue) { 1759 - /* 1760 - * validate command queue still working 1761 - * by sending "ECHO" command 1762 - */ 1763 - if (!iwl_cmd_echo_test(priv)) 1764 - return 0; 1765 - else 1766 - IWL_DEBUG_HC(priv, "echo testing fail\n"); 1767 - } 1768 1758 ret = iwl_force_reset(priv, IWL_FW_RESET, false); 1769 1759 return (ret == -EAGAIN) ? 0 : 1; 1770 1760 }
+3 -5
drivers/net/wireless/iwlwifi/iwl-pci.c
··· 445 445 pci_write_config_byte(pdev, PCI_CFG_RETRY_TIMEOUT, 0x00); 446 446 447 447 err = pci_enable_msi(pdev); 448 - if (err) { 449 - dev_printk(KERN_ERR, &pdev->dev, "pci_enable_msi failed"); 450 - goto out_iounmap; 451 - } 448 + if (err) 449 + dev_printk(KERN_ERR, &pdev->dev, 450 + "pci_enable_msi failed(0X%x)", err); 452 451 453 452 /* TODO: Move this away, not needed if not MSI */ 454 453 /* enable rfkill interrupt: hw bug w/a */ ··· 468 469 469 470 out_disable_msi: 470 471 pci_disable_msi(pdev); 471 - out_iounmap: 472 472 pci_iounmap(pdev, pci_bus->hw_base); 473 473 out_pci_release_regions: 474 474 pci_set_drvdata(pdev, NULL);
+8 -4
drivers/net/wireless/iwlwifi/iwl-trans-pcie.c
··· 407 407 struct iwl_queue *q = &txq->q; 408 408 enum dma_data_direction dma_dir; 409 409 unsigned long flags; 410 + spinlock_t *lock; 410 411 411 412 if (!q->n_bd) 412 413 return; ··· 415 414 /* In the command queue, all the TBs are mapped as BIDI 416 415 * so unmap them as such. 417 416 */ 418 - if (txq_id == trans->shrd->cmd_queue) 417 + if (txq_id == trans->shrd->cmd_queue) { 419 418 dma_dir = DMA_BIDIRECTIONAL; 420 - else 419 + lock = &trans->hcmd_lock; 420 + } else { 421 421 dma_dir = DMA_TO_DEVICE; 422 + lock = &trans->shrd->sta_lock; 423 + } 422 424 423 - spin_lock_irqsave(&trans->shrd->sta_lock, flags); 425 + spin_lock_irqsave(lock, flags); 424 426 while (q->write_ptr != q->read_ptr) { 425 427 /* The read_ptr needs to bound by q->n_window */ 426 428 iwlagn_txq_free_tfd(trans, txq, get_cmd_index(q, q->read_ptr), 427 429 dma_dir); 428 430 q->read_ptr = iwl_queue_inc_wrap(q->read_ptr, q->n_bd); 429 431 } 430 - spin_unlock_irqrestore(&trans->shrd->sta_lock, flags); 432 + spin_unlock_irqrestore(lock, flags); 431 433 } 432 434 433 435 /**
+17 -8
drivers/net/wireless/libertas/cfg.c
··· 728 728 le16_to_cpu(scan_cmd->hdr.size), 729 729 lbs_ret_scan, 0); 730 730 731 - if (priv->scan_channel >= priv->scan_req->n_channels) { 731 + if (priv->scan_channel >= priv->scan_req->n_channels) 732 732 /* Mark scan done */ 733 - if (priv->internal_scan) 734 - kfree(priv->scan_req); 735 - else 736 - cfg80211_scan_done(priv->scan_req, false); 737 - 738 - priv->scan_req = NULL; 739 - } 733 + lbs_scan_done(priv); 740 734 741 735 /* Restart network */ 742 736 if (carrier) ··· 766 772 priv->internal_scan = internal; 767 773 768 774 lbs_deb_leave(LBS_DEB_CFG80211); 775 + } 776 + 777 + /* 778 + * Clean up priv->scan_req. Should be used to handle the allocation details. 779 + */ 780 + void lbs_scan_done(struct lbs_private *priv) 781 + { 782 + WARN_ON(!priv->scan_req); 783 + 784 + if (priv->internal_scan) 785 + kfree(priv->scan_req); 786 + else 787 + cfg80211_scan_done(priv->scan_req, false); 788 + 789 + priv->scan_req = NULL; 769 790 } 770 791 771 792 static int lbs_cfg_scan(struct wiphy *wiphy,
+1
drivers/net/wireless/libertas/cfg.h
··· 16 16 void lbs_send_disconnect_notification(struct lbs_private *priv); 17 17 void lbs_send_mic_failureevent(struct lbs_private *priv, u32 event); 18 18 19 + void lbs_scan_done(struct lbs_private *priv); 19 20 void lbs_scan_deinit(struct lbs_private *priv); 20 21 int lbs_disconnect(struct lbs_private *priv, u16 reason); 21 22
+2 -4
drivers/net/wireless/libertas/main.c
··· 255 255 256 256 lbs_update_mcast(priv); 257 257 cancel_delayed_work_sync(&priv->scan_work); 258 - if (priv->scan_req) { 259 - cfg80211_scan_done(priv->scan_req, false); 260 - priv->scan_req = NULL; 261 - } 258 + if (priv->scan_req) 259 + lbs_scan_done(priv); 262 260 263 261 netif_carrier_off(priv->dev); 264 262
+1
include/net/bluetooth/rfcomm.h
··· 211 211 #define RFCOMM_AUTH_ACCEPT 6 212 212 #define RFCOMM_AUTH_REJECT 7 213 213 #define RFCOMM_DEFER_SETUP 8 214 + #define RFCOMM_ENC_DROP 9 214 215 215 216 /* Scheduling flags and events */ 216 217 #define RFCOMM_SCHED_WAKEUP 31
+2 -1
include/net/mac80211.h
··· 3567 3567 return i; 3568 3568 3569 3569 /* warn when we cannot find a rate. */ 3570 - WARN_ON(1); 3570 + WARN_ON_ONCE(1); 3571 3571 3572 + /* and return 0 (the lowest index) */ 3572 3573 return 0; 3573 3574 } 3574 3575
+1 -1
net/bluetooth/hci_core.c
··· 613 613 if (!test_bit(HCI_RAW, &hdev->flags)) { 614 614 set_bit(HCI_INIT, &hdev->flags); 615 615 __hci_request(hdev, hci_reset_req, 0, 616 - msecs_to_jiffies(250)); 616 + msecs_to_jiffies(HCI_INIT_TIMEOUT)); 617 617 clear_bit(HCI_INIT, &hdev->flags); 618 618 } 619 619
-2
net/bluetooth/mgmt.c
··· 147 147 148 148 hci_del_off_timer(d); 149 149 150 - set_bit(HCI_MGMT, &d->flags); 151 - 152 150 if (test_bit(HCI_SETUP, &d->flags)) 153 151 continue; 154 152
+7 -2
net/bluetooth/rfcomm/core.c
··· 1802 1802 continue; 1803 1803 } 1804 1804 1805 + if (test_bit(RFCOMM_ENC_DROP, &d->flags)) { 1806 + __rfcomm_dlc_close(d, ECONNREFUSED); 1807 + continue; 1808 + } 1809 + 1805 1810 if (test_and_clear_bit(RFCOMM_AUTH_ACCEPT, &d->flags)) { 1806 1811 rfcomm_dlc_clear_timer(d); 1807 1812 if (d->out) { ··· 2082 2077 if (test_and_clear_bit(RFCOMM_SEC_PENDING, &d->flags)) { 2083 2078 rfcomm_dlc_clear_timer(d); 2084 2079 if (status || encrypt == 0x00) { 2085 - __rfcomm_dlc_close(d, ECONNREFUSED); 2080 + set_bit(RFCOMM_ENC_DROP, &d->flags); 2086 2081 continue; 2087 2082 } 2088 2083 } ··· 2093 2088 rfcomm_dlc_set_timer(d, RFCOMM_AUTH_TIMEOUT); 2094 2089 continue; 2095 2090 } else if (d->sec_level == BT_SECURITY_HIGH) { 2096 - __rfcomm_dlc_close(d, ECONNREFUSED); 2091 + set_bit(RFCOMM_ENC_DROP, &d->flags); 2097 2092 continue; 2098 2093 } 2099 2094 }
+6 -6
net/mac80211/cfg.c
··· 832 832 if (is_multicast_ether_addr(mac)) 833 833 return -EINVAL; 834 834 835 + /* Only TDLS-supporting stations can add TDLS peers */ 836 + if ((params->sta_flags_set & BIT(NL80211_STA_FLAG_TDLS_PEER)) && 837 + !((wiphy->flags & WIPHY_FLAG_SUPPORTS_TDLS) && 838 + sdata->vif.type == NL80211_IFTYPE_STATION)) 839 + return -ENOTSUPP; 840 + 835 841 sta = sta_info_alloc(sdata, mac, GFP_KERNEL); 836 842 if (!sta) 837 843 return -ENOMEM; ··· 846 840 set_sta_flag(sta, WLAN_STA_ASSOC); 847 841 848 842 sta_apply_parameters(local, sta, params); 849 - 850 - /* Only TDLS-supporting stations can add TDLS peers */ 851 - if (test_sta_flag(sta, WLAN_STA_TDLS_PEER) && 852 - !((wiphy->flags & WIPHY_FLAG_SUPPORTS_TDLS) && 853 - sdata->vif.type == NL80211_IFTYPE_STATION)) 854 - return -ENOTSUPP; 855 843 856 844 rate_control_rate_init(sta); 857 845
+1
net/mac80211/ieee80211_i.h
··· 389 389 390 390 unsigned long timers_running; /* used for quiesce/restart */ 391 391 bool powersave; /* powersave requested for this iface */ 392 + bool broken_ap; /* AP is broken -- turn off powersave */ 392 393 enum ieee80211_smps_mode req_smps, /* requested smps mode */ 393 394 ap_smps, /* smps mode AP thinks we're in */ 394 395 driver_smps_mode; /* smps mode request */
+16 -2
net/mac80211/mlme.c
··· 637 637 if (!mgd->powersave) 638 638 return false; 639 639 640 + if (mgd->broken_ap) 641 + return false; 642 + 640 643 if (!mgd->associated) 641 644 return false; 642 645 ··· 1492 1489 capab_info = le16_to_cpu(mgmt->u.assoc_resp.capab_info); 1493 1490 1494 1491 if ((aid & (BIT(15) | BIT(14))) != (BIT(15) | BIT(14))) 1495 - printk(KERN_DEBUG "%s: invalid aid value %d; bits 15:14 not " 1496 - "set\n", sdata->name, aid); 1492 + printk(KERN_DEBUG 1493 + "%s: invalid AID value 0x%x; bits 15:14 not set\n", 1494 + sdata->name, aid); 1497 1495 aid &= ~(BIT(15) | BIT(14)); 1496 + 1497 + ifmgd->broken_ap = false; 1498 + 1499 + if (aid == 0 || aid > IEEE80211_MAX_AID) { 1500 + printk(KERN_DEBUG 1501 + "%s: invalid AID value %d (out of range), turn off PS\n", 1502 + sdata->name, aid); 1503 + aid = 0; 1504 + ifmgd->broken_ap = true; 1505 + } 1498 1506 1499 1507 pos = mgmt->u.assoc_resp.variable; 1500 1508 ieee802_11_parse_elems(pos, len - (pos - (u8 *) mgmt), &elems);
+3 -4
net/mac80211/work.c
··· 1084 1084 continue; 1085 1085 if (wk->chan != local->tmp_channel) 1086 1086 continue; 1087 - if (ieee80211_work_ct_coexists(wk->chan_type, 1088 - local->tmp_channel_type)) 1087 + if (!ieee80211_work_ct_coexists(wk->chan_type, 1088 + local->tmp_channel_type)) 1089 1089 continue; 1090 1090 remain_off_channel = true; 1091 1091 } 1092 1092 1093 1093 if (!remain_off_channel && local->tmp_channel) { 1094 - bool on_oper_chan = ieee80211_cfg_on_oper_channel(local); 1095 1094 local->tmp_channel = NULL; 1096 1095 /* If tmp_channel wasn't operating channel, then 1097 1096 * we need to go back on-channel. ··· 1100 1101 * we still need to do a hardware config. Currently, 1101 1102 * we cannot be here while scanning, however. 1102 1103 */ 1103 - if (ieee80211_cfg_on_oper_channel(local) && !on_oper_chan) 1104 + if (!ieee80211_cfg_on_oper_channel(local)) 1104 1105 ieee80211_hw_config(local, 0); 1105 1106 1106 1107 /* At the least, we need to disable offchannel_ps,