Skip to content

Commit 9d1cd50

Browse files
committed
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless
2 parents c8bf40a + b7e0473 commit 9d1cd50

10 files changed

Lines changed: 105 additions & 40 deletions

File tree

‎drivers/bluetooth/ath3k.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ static const struct usb_device_id ath3k_table[] = {
8888
{ USB_DEVICE(0x0CF3, 0xE004) },
8989
{ USB_DEVICE(0x0CF3, 0xE005) },
9090
{ USB_DEVICE(0x0930, 0x0219) },
91+
{ USB_DEVICE(0x0930, 0x0220) },
9192
{ USB_DEVICE(0x0489, 0xe057) },
9293
{ USB_DEVICE(0x13d3, 0x3393) },
9394
{ USB_DEVICE(0x0489, 0xe04e) },
@@ -132,6 +133,7 @@ static const struct usb_device_id ath3k_blist_tbl[] = {
132133
{ USB_DEVICE(0x0cf3, 0xe004), .driver_info = BTUSB_ATH3012 },
133134
{ USB_DEVICE(0x0cf3, 0xe005), .driver_info = BTUSB_ATH3012 },
134135
{ USB_DEVICE(0x0930, 0x0219), .driver_info = BTUSB_ATH3012 },
136+
{ USB_DEVICE(0x0930, 0x0220), .driver_info = BTUSB_ATH3012 },
135137
{ USB_DEVICE(0x0489, 0xe057), .driver_info = BTUSB_ATH3012 },
136138
{ USB_DEVICE(0x13d3, 0x3393), .driver_info = BTUSB_ATH3012 },
137139
{ USB_DEVICE(0x0489, 0xe04e), .driver_info = BTUSB_ATH3012 },

‎drivers/bluetooth/btusb.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ static const struct usb_device_id blacklist_table[] = {
155155
{ USB_DEVICE(0x0cf3, 0xe004), .driver_info = BTUSB_ATH3012 },
156156
{ USB_DEVICE(0x0cf3, 0xe005), .driver_info = BTUSB_ATH3012 },
157157
{ USB_DEVICE(0x0930, 0x0219), .driver_info = BTUSB_ATH3012 },
158+
{ USB_DEVICE(0x0930, 0x0220), .driver_info = BTUSB_ATH3012 },
158159
{ USB_DEVICE(0x0489, 0xe057), .driver_info = BTUSB_ATH3012 },
159160
{ USB_DEVICE(0x13d3, 0x3393), .driver_info = BTUSB_ATH3012 },
160161
{ USB_DEVICE(0x0489, 0xe04e), .driver_info = BTUSB_ATH3012 },

‎drivers/net/wireless/ath/ath9k/ar9002_mac.c‎

Lines changed: 43 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,16 @@ static bool ar9002_hw_get_isr(struct ath_hw *ah, enum ath9k_int *masked,
7777
mask2 |= ATH9K_INT_CST;
7878
if (isr2 & AR_ISR_S2_TSFOOR)
7979
mask2 |= ATH9K_INT_TSFOOR;
80+
81+
if (!(pCap->hw_caps & ATH9K_HW_CAP_RAC_SUPPORTED)) {
82+
REG_WRITE(ah, AR_ISR_S2, isr2);
83+
isr &= ~AR_ISR_BCNMISC;
84+
}
8085
}
8186

82-
isr = REG_READ(ah, AR_ISR_RAC);
87+
if (pCap->hw_caps & ATH9K_HW_CAP_RAC_SUPPORTED)
88+
isr = REG_READ(ah, AR_ISR_RAC);
89+
8390
if (isr == 0xffffffff) {
8491
*masked = 0;
8592
return false;
@@ -98,11 +105,23 @@ static bool ar9002_hw_get_isr(struct ath_hw *ah, enum ath9k_int *masked,
98105

99106
*masked |= ATH9K_INT_TX;
100107

101-
s0_s = REG_READ(ah, AR_ISR_S0_S);
108+
if (pCap->hw_caps & ATH9K_HW_CAP_RAC_SUPPORTED) {
109+
s0_s = REG_READ(ah, AR_ISR_S0_S);
110+
s1_s = REG_READ(ah, AR_ISR_S1_S);
111+
} else {
112+
s0_s = REG_READ(ah, AR_ISR_S0);
113+
REG_WRITE(ah, AR_ISR_S0, s0_s);
114+
s1_s = REG_READ(ah, AR_ISR_S1);
115+
REG_WRITE(ah, AR_ISR_S1, s1_s);
116+
117+
isr &= ~(AR_ISR_TXOK |
118+
AR_ISR_TXDESC |
119+
AR_ISR_TXERR |
120+
AR_ISR_TXEOL);
121+
}
122+
102123
ah->intr_txqs |= MS(s0_s, AR_ISR_S0_QCU_TXOK);
103124
ah->intr_txqs |= MS(s0_s, AR_ISR_S0_QCU_TXDESC);
104-
105-
s1_s = REG_READ(ah, AR_ISR_S1_S);
106125
ah->intr_txqs |= MS(s1_s, AR_ISR_S1_QCU_TXERR);
107126
ah->intr_txqs |= MS(s1_s, AR_ISR_S1_QCU_TXEOL);
108127
}
@@ -115,13 +134,15 @@ static bool ar9002_hw_get_isr(struct ath_hw *ah, enum ath9k_int *masked,
115134
*masked |= mask2;
116135
}
117136

118-
if (AR_SREV_9100(ah))
119-
return true;
120-
121-
if (isr & AR_ISR_GENTMR) {
137+
if (!AR_SREV_9100(ah) && (isr & AR_ISR_GENTMR)) {
122138
u32 s5_s;
123139

124-
s5_s = REG_READ(ah, AR_ISR_S5_S);
140+
if (pCap->hw_caps & ATH9K_HW_CAP_RAC_SUPPORTED) {
141+
s5_s = REG_READ(ah, AR_ISR_S5_S);
142+
} else {
143+
s5_s = REG_READ(ah, AR_ISR_S5);
144+
}
145+
125146
ah->intr_gen_timer_trigger =
126147
MS(s5_s, AR_ISR_S5_GENTIMER_TRIG);
127148

@@ -134,8 +155,21 @@ static bool ar9002_hw_get_isr(struct ath_hw *ah, enum ath9k_int *masked,
134155
if ((s5_s & AR_ISR_S5_TIM_TIMER) &&
135156
!(pCap->hw_caps & ATH9K_HW_CAP_AUTOSLEEP))
136157
*masked |= ATH9K_INT_TIM_TIMER;
158+
159+
if (!(pCap->hw_caps & ATH9K_HW_CAP_RAC_SUPPORTED)) {
160+
REG_WRITE(ah, AR_ISR_S5, s5_s);
161+
isr &= ~AR_ISR_GENTMR;
162+
}
137163
}
138164

165+
if (!(pCap->hw_caps & ATH9K_HW_CAP_RAC_SUPPORTED)) {
166+
REG_WRITE(ah, AR_ISR, isr);
167+
REG_READ(ah, AR_ISR);
168+
}
169+
170+
if (AR_SREV_9100(ah))
171+
return true;
172+
139173
if (sync_cause) {
140174
if (sync_cause_p)
141175
*sync_cause_p = sync_cause;

‎drivers/net/wireless/ath/ath9k/htc_drv_main.c‎

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -127,21 +127,26 @@ static void ath9k_htc_bssid_iter(void *data, u8 *mac, struct ieee80211_vif *vif)
127127
struct ath9k_vif_iter_data *iter_data = data;
128128
int i;
129129

130-
for (i = 0; i < ETH_ALEN; i++)
131-
iter_data->mask[i] &= ~(iter_data->hw_macaddr[i] ^ mac[i]);
130+
if (iter_data->hw_macaddr != NULL) {
131+
for (i = 0; i < ETH_ALEN; i++)
132+
iter_data->mask[i] &= ~(iter_data->hw_macaddr[i] ^ mac[i]);
133+
} else {
134+
iter_data->hw_macaddr = mac;
135+
}
132136
}
133137

134-
static void ath9k_htc_set_bssid_mask(struct ath9k_htc_priv *priv,
138+
static void ath9k_htc_set_mac_bssid_mask(struct ath9k_htc_priv *priv,
135139
struct ieee80211_vif *vif)
136140
{
137141
struct ath_common *common = ath9k_hw_common(priv->ah);
138142
struct ath9k_vif_iter_data iter_data;
139143

140144
/*
141-
* Use the hardware MAC address as reference, the hardware uses it
142-
* together with the BSSID mask when matching addresses.
145+
* Pick the MAC address of the first interface as the new hardware
146+
* MAC address. The hardware will use it together with the BSSID mask
147+
* when matching addresses.
143148
*/
144-
iter_data.hw_macaddr = common->macaddr;
149+
iter_data.hw_macaddr = NULL;
145150
memset(&iter_data.mask, 0xff, ETH_ALEN);
146151

147152
if (vif)
@@ -153,6 +158,10 @@ static void ath9k_htc_set_bssid_mask(struct ath9k_htc_priv *priv,
153158
ath9k_htc_bssid_iter, &iter_data);
154159

155160
memcpy(common->bssidmask, iter_data.mask, ETH_ALEN);
161+
162+
if (iter_data.hw_macaddr)
163+
memcpy(common->macaddr, iter_data.hw_macaddr, ETH_ALEN);
164+
156165
ath_hw_setbssidmask(common);
157166
}
158167

@@ -1063,7 +1072,7 @@ static int ath9k_htc_add_interface(struct ieee80211_hw *hw,
10631072
goto out;
10641073
}
10651074

1066-
ath9k_htc_set_bssid_mask(priv, vif);
1075+
ath9k_htc_set_mac_bssid_mask(priv, vif);
10671076

10681077
priv->vif_slot |= (1 << avp->index);
10691078
priv->nvifs++;
@@ -1128,7 +1137,7 @@ static void ath9k_htc_remove_interface(struct ieee80211_hw *hw,
11281137

11291138
ath9k_htc_set_opmode(priv);
11301139

1131-
ath9k_htc_set_bssid_mask(priv, vif);
1140+
ath9k_htc_set_mac_bssid_mask(priv, vif);
11321141

11331142
/*
11341143
* Stop ANI only if there are no associated station interfaces.

‎drivers/net/wireless/ath/ath9k/main.c‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -991,8 +991,9 @@ void ath9k_calculate_iter_data(struct ieee80211_hw *hw,
991991
struct ath_common *common = ath9k_hw_common(ah);
992992

993993
/*
994-
* Use the hardware MAC address as reference, the hardware uses it
995-
* together with the BSSID mask when matching addresses.
994+
* Pick the MAC address of the first interface as the new hardware
995+
* MAC address. The hardware will use it together with the BSSID mask
996+
* when matching addresses.
996997
*/
997998
memset(iter_data, 0, sizeof(*iter_data));
998999
memset(&iter_data->mask, 0xff, ETH_ALEN);

‎drivers/net/wireless/ath/ath9k/xmit.c‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1264,6 +1264,10 @@ static void ath_tx_fill_desc(struct ath_softc *sc, struct ath_buf *bf,
12641264
if (!rts_thresh || (len > rts_thresh))
12651265
rts = true;
12661266
}
1267+
1268+
if (!aggr)
1269+
len = fi->framelen;
1270+
12671271
ath_buf_set_rate(sc, bf, &info, len, rts);
12681272
}
12691273

‎drivers/net/wireless/rtlwifi/pci.c‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -738,6 +738,8 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw)
738738
};
739739
int index = rtlpci->rx_ring[rx_queue_idx].idx;
740740

741+
if (rtlpci->driver_is_goingto_unload)
742+
return;
741743
/*RX NORMAL PKT */
742744
while (count--) {
743745
/*rx descriptor */
@@ -1634,6 +1636,7 @@ static void rtl_pci_stop(struct ieee80211_hw *hw)
16341636
*/
16351637
set_hal_stop(rtlhal);
16361638

1639+
rtlpci->driver_is_goingto_unload = true;
16371640
rtlpriv->cfg->ops->disable_interrupt(hw);
16381641
cancel_work_sync(&rtlpriv->works.lps_change_work);
16391642

@@ -1651,7 +1654,6 @@ static void rtl_pci_stop(struct ieee80211_hw *hw)
16511654
ppsc->rfchange_inprogress = true;
16521655
spin_unlock_irqrestore(&rtlpriv->locks.rf_ps_lock, flags);
16531656

1654-
rtlpci->driver_is_goingto_unload = true;
16551657
rtlpriv->cfg->ops->hw_disable(hw);
16561658
/* some things are not needed if firmware not available */
16571659
if (!rtlpriv->max_fw_size)

‎net/bluetooth/hci_sock.c‎

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -940,8 +940,22 @@ static int hci_sock_sendmsg(struct kiocb *iocb, struct socket *sock,
940940
bt_cb(skb)->pkt_type = *((unsigned char *) skb->data);
941941
skb_pull(skb, 1);
942942

943-
if (hci_pi(sk)->channel == HCI_CHANNEL_RAW &&
944-
bt_cb(skb)->pkt_type == HCI_COMMAND_PKT) {
943+
if (hci_pi(sk)->channel == HCI_CHANNEL_USER) {
944+
/* No permission check is needed for user channel
945+
* since that gets enforced when binding the socket.
946+
*
947+
* However check that the packet type is valid.
948+
*/
949+
if (bt_cb(skb)->pkt_type != HCI_COMMAND_PKT &&
950+
bt_cb(skb)->pkt_type != HCI_ACLDATA_PKT &&
951+
bt_cb(skb)->pkt_type != HCI_SCODATA_PKT) {
952+
err = -EINVAL;
953+
goto drop;
954+
}
955+
956+
skb_queue_tail(&hdev->raw_q, skb);
957+
queue_work(hdev->workqueue, &hdev->tx_work);
958+
} else if (bt_cb(skb)->pkt_type == HCI_COMMAND_PKT) {
945959
u16 opcode = get_unaligned_le16(skb->data);
946960
u16 ogf = hci_opcode_ogf(opcode);
947961
u16 ocf = hci_opcode_ocf(opcode);
@@ -972,14 +986,6 @@ static int hci_sock_sendmsg(struct kiocb *iocb, struct socket *sock,
972986
goto drop;
973987
}
974988

975-
if (hci_pi(sk)->channel == HCI_CHANNEL_USER &&
976-
bt_cb(skb)->pkt_type != HCI_COMMAND_PKT &&
977-
bt_cb(skb)->pkt_type != HCI_ACLDATA_PKT &&
978-
bt_cb(skb)->pkt_type != HCI_SCODATA_PKT) {
979-
err = -EINVAL;
980-
goto drop;
981-
}
982-
983989
skb_queue_tail(&hdev->raw_q, skb);
984990
queue_work(hdev->workqueue, &hdev->tx_work);
985991
}

‎net/wireless/radiotap.c‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,10 @@ int ieee80211_radiotap_iterator_init(
124124
/* find payload start allowing for extended bitmap(s) */
125125

126126
if (iterator->_bitmap_shifter & (1<<IEEE80211_RADIOTAP_EXT)) {
127+
if ((unsigned long)iterator->_arg -
128+
(unsigned long)iterator->_rtheader + sizeof(uint32_t) >
129+
(unsigned long)iterator->_max_length)
130+
return -EINVAL;
127131
while (get_unaligned_le32(iterator->_arg) &
128132
(1 << IEEE80211_RADIOTAP_EXT)) {
129133
iterator->_arg += sizeof(uint32_t);

‎net/wireless/sme.c‎

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -632,6 +632,16 @@ void __cfg80211_connect_result(struct net_device *dev, const u8 *bssid,
632632
}
633633
#endif
634634

635+
if (!bss && (status == WLAN_STATUS_SUCCESS)) {
636+
WARN_ON_ONCE(!wiphy_to_dev(wdev->wiphy)->ops->connect);
637+
bss = cfg80211_get_bss(wdev->wiphy, NULL, bssid,
638+
wdev->ssid, wdev->ssid_len,
639+
WLAN_CAPABILITY_ESS,
640+
WLAN_CAPABILITY_ESS);
641+
if (bss)
642+
cfg80211_hold_bss(bss_from_pub(bss));
643+
}
644+
635645
if (wdev->current_bss) {
636646
cfg80211_unhold_bss(wdev->current_bss);
637647
cfg80211_put_bss(wdev->wiphy, &wdev->current_bss->pub);
@@ -649,16 +659,8 @@ void __cfg80211_connect_result(struct net_device *dev, const u8 *bssid,
649659
return;
650660
}
651661

652-
if (!bss) {
653-
WARN_ON_ONCE(!wiphy_to_dev(wdev->wiphy)->ops->connect);
654-
bss = cfg80211_get_bss(wdev->wiphy, NULL, bssid,
655-
wdev->ssid, wdev->ssid_len,
656-
WLAN_CAPABILITY_ESS,
657-
WLAN_CAPABILITY_ESS);
658-
if (WARN_ON(!bss))
659-
return;
660-
cfg80211_hold_bss(bss_from_pub(bss));
661-
}
662+
if (WARN_ON(!bss))
663+
return;
662664

663665
wdev->current_bss = bss_from_pub(bss);
664666

0 commit comments

Comments
 (0)