提交 42fb0b02 编写于 作者: J John W. Linville
...@@ -63,6 +63,7 @@ static struct usb_device_id ath3k_table[] = { ...@@ -63,6 +63,7 @@ static struct usb_device_id ath3k_table[] = {
/* Atheros AR3011 with sflash firmware*/ /* Atheros AR3011 with sflash firmware*/
{ USB_DEVICE(0x0CF3, 0x3002) }, { USB_DEVICE(0x0CF3, 0x3002) },
{ USB_DEVICE(0x0CF3, 0xE019) },
{ USB_DEVICE(0x13d3, 0x3304) }, { USB_DEVICE(0x13d3, 0x3304) },
{ USB_DEVICE(0x0930, 0x0215) }, { USB_DEVICE(0x0930, 0x0215) },
{ USB_DEVICE(0x0489, 0xE03D) }, { USB_DEVICE(0x0489, 0xE03D) },
...@@ -77,6 +78,7 @@ static struct usb_device_id ath3k_table[] = { ...@@ -77,6 +78,7 @@ static struct usb_device_id ath3k_table[] = {
{ USB_DEVICE(0x04CA, 0x3005) }, { USB_DEVICE(0x04CA, 0x3005) },
{ USB_DEVICE(0x13d3, 0x3362) }, { USB_DEVICE(0x13d3, 0x3362) },
{ USB_DEVICE(0x0CF3, 0xE004) }, { USB_DEVICE(0x0CF3, 0xE004) },
{ USB_DEVICE(0x0930, 0x0219) },
/* Atheros AR5BBU12 with sflash firmware */ /* Atheros AR5BBU12 with sflash firmware */
{ USB_DEVICE(0x0489, 0xE02C) }, { USB_DEVICE(0x0489, 0xE02C) },
...@@ -101,6 +103,7 @@ static struct usb_device_id ath3k_blist_tbl[] = { ...@@ -101,6 +103,7 @@ static struct usb_device_id ath3k_blist_tbl[] = {
{ USB_DEVICE(0x04ca, 0x3005), .driver_info = BTUSB_ATH3012 }, { USB_DEVICE(0x04ca, 0x3005), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x13d3, 0x3362), .driver_info = BTUSB_ATH3012 }, { USB_DEVICE(0x13d3, 0x3362), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x0cf3, 0xe004), .driver_info = BTUSB_ATH3012 }, { USB_DEVICE(0x0cf3, 0xe004), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x0930, 0x0219), .driver_info = BTUSB_ATH3012 },
/* Atheros AR5BBU22 with sflash firmware */ /* Atheros AR5BBU22 with sflash firmware */
{ USB_DEVICE(0x0489, 0xE03C), .driver_info = BTUSB_ATH3012 }, { USB_DEVICE(0x0489, 0xE03C), .driver_info = BTUSB_ATH3012 },
......
...@@ -136,7 +136,7 @@ int btmrvl_remove_card(struct btmrvl_private *priv); ...@@ -136,7 +136,7 @@ int btmrvl_remove_card(struct btmrvl_private *priv);
void btmrvl_interrupt(struct btmrvl_private *priv); void btmrvl_interrupt(struct btmrvl_private *priv);
void btmrvl_check_evtpkt(struct btmrvl_private *priv, struct sk_buff *skb); bool btmrvl_check_evtpkt(struct btmrvl_private *priv, struct sk_buff *skb);
int btmrvl_process_event(struct btmrvl_private *priv, struct sk_buff *skb); int btmrvl_process_event(struct btmrvl_private *priv, struct sk_buff *skb);
int btmrvl_send_module_cfg_cmd(struct btmrvl_private *priv, int subcmd); int btmrvl_send_module_cfg_cmd(struct btmrvl_private *priv, int subcmd);
......
...@@ -44,23 +44,33 @@ void btmrvl_interrupt(struct btmrvl_private *priv) ...@@ -44,23 +44,33 @@ void btmrvl_interrupt(struct btmrvl_private *priv)
} }
EXPORT_SYMBOL_GPL(btmrvl_interrupt); EXPORT_SYMBOL_GPL(btmrvl_interrupt);
void btmrvl_check_evtpkt(struct btmrvl_private *priv, struct sk_buff *skb) bool btmrvl_check_evtpkt(struct btmrvl_private *priv, struct sk_buff *skb)
{ {
struct hci_event_hdr *hdr = (void *) skb->data; struct hci_event_hdr *hdr = (void *) skb->data;
struct hci_ev_cmd_complete *ec; struct hci_ev_cmd_complete *ec;
u16 opcode, ocf; u16 opcode, ocf, ogf;
if (hdr->evt == HCI_EV_CMD_COMPLETE) { if (hdr->evt == HCI_EV_CMD_COMPLETE) {
ec = (void *) (skb->data + HCI_EVENT_HDR_SIZE); ec = (void *) (skb->data + HCI_EVENT_HDR_SIZE);
opcode = __le16_to_cpu(ec->opcode); opcode = __le16_to_cpu(ec->opcode);
ocf = hci_opcode_ocf(opcode); ocf = hci_opcode_ocf(opcode);
ogf = hci_opcode_ogf(opcode);
if (ocf == BT_CMD_MODULE_CFG_REQ && if (ocf == BT_CMD_MODULE_CFG_REQ &&
priv->btmrvl_dev.sendcmdflag) { priv->btmrvl_dev.sendcmdflag) {
priv->btmrvl_dev.sendcmdflag = false; priv->btmrvl_dev.sendcmdflag = false;
priv->adapter->cmd_complete = true; priv->adapter->cmd_complete = true;
wake_up_interruptible(&priv->adapter->cmd_wait_q); wake_up_interruptible(&priv->adapter->cmd_wait_q);
} }
if (ogf == OGF) {
BT_DBG("vendor event skipped: ogf 0x%4.4x", ogf);
kfree_skb(skb);
return false;
}
} }
return true;
} }
EXPORT_SYMBOL_GPL(btmrvl_check_evtpkt); EXPORT_SYMBOL_GPL(btmrvl_check_evtpkt);
......
...@@ -565,10 +565,12 @@ static int btmrvl_sdio_card_to_host(struct btmrvl_private *priv) ...@@ -565,10 +565,12 @@ static int btmrvl_sdio_card_to_host(struct btmrvl_private *priv)
skb_put(skb, buf_len); skb_put(skb, buf_len);
skb_pull(skb, SDIO_HEADER_LEN); skb_pull(skb, SDIO_HEADER_LEN);
if (type == HCI_EVENT_PKT) if (type == HCI_EVENT_PKT) {
btmrvl_check_evtpkt(priv, skb); if (btmrvl_check_evtpkt(priv, skb))
hci_recv_frame(skb);
} else
hci_recv_frame(skb);
hci_recv_frame(skb);
hdev->stat.byte_rx += buf_len; hdev->stat.byte_rx += buf_len;
break; break;
......
...@@ -117,6 +117,7 @@ static struct usb_device_id blacklist_table[] = { ...@@ -117,6 +117,7 @@ static struct usb_device_id blacklist_table[] = {
/* Atheros 3011 with sflash firmware */ /* Atheros 3011 with sflash firmware */
{ USB_DEVICE(0x0cf3, 0x3002), .driver_info = BTUSB_IGNORE }, { USB_DEVICE(0x0cf3, 0x3002), .driver_info = BTUSB_IGNORE },
{ USB_DEVICE(0x0cf3, 0xe019), .driver_info = BTUSB_IGNORE },
{ USB_DEVICE(0x13d3, 0x3304), .driver_info = BTUSB_IGNORE }, { USB_DEVICE(0x13d3, 0x3304), .driver_info = BTUSB_IGNORE },
{ USB_DEVICE(0x0930, 0x0215), .driver_info = BTUSB_IGNORE }, { USB_DEVICE(0x0930, 0x0215), .driver_info = BTUSB_IGNORE },
{ USB_DEVICE(0x0489, 0xe03d), .driver_info = BTUSB_IGNORE }, { USB_DEVICE(0x0489, 0xe03d), .driver_info = BTUSB_IGNORE },
...@@ -131,6 +132,7 @@ static struct usb_device_id blacklist_table[] = { ...@@ -131,6 +132,7 @@ static struct usb_device_id blacklist_table[] = {
{ USB_DEVICE(0x04ca, 0x3005), .driver_info = BTUSB_ATH3012 }, { USB_DEVICE(0x04ca, 0x3005), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x13d3, 0x3362), .driver_info = BTUSB_ATH3012 }, { USB_DEVICE(0x13d3, 0x3362), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x0cf3, 0xe004), .driver_info = BTUSB_ATH3012 }, { USB_DEVICE(0x0cf3, 0xe004), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x0930, 0x0219), .driver_info = BTUSB_ATH3012 },
/* Atheros AR5BBU12 with sflash firmware */ /* Atheros AR5BBU12 with sflash firmware */
{ USB_DEVICE(0x0489, 0xe02c), .driver_info = BTUSB_IGNORE }, { USB_DEVICE(0x0489, 0xe02c), .driver_info = BTUSB_IGNORE },
......
...@@ -7233,8 +7233,8 @@ static int airo_get_aplist(struct net_device *dev, ...@@ -7233,8 +7233,8 @@ static int airo_get_aplist(struct net_device *dev,
} }
} else { } else {
dwrq->flags = 1; /* Should be define'd */ dwrq->flags = 1; /* Should be define'd */
memcpy(extra + sizeof(struct sockaddr)*i, memcpy(extra + sizeof(struct sockaddr) * i, qual,
&qual, sizeof(struct iw_quality)*i); sizeof(struct iw_quality) * i);
} }
dwrq->length = i; dwrq->length = i;
......
...@@ -143,6 +143,7 @@ struct ath_common { ...@@ -143,6 +143,7 @@ struct ath_common {
u32 keymax; u32 keymax;
DECLARE_BITMAP(keymap, ATH_KEYMAX); DECLARE_BITMAP(keymap, ATH_KEYMAX);
DECLARE_BITMAP(tkip_keymap, ATH_KEYMAX); DECLARE_BITMAP(tkip_keymap, ATH_KEYMAX);
DECLARE_BITMAP(ccmp_keymap, ATH_KEYMAX);
enum ath_crypt_caps crypt_caps; enum ath_crypt_caps crypt_caps;
unsigned int clockrate; unsigned int clockrate;
......
...@@ -1045,11 +1045,11 @@ ath5k_drain_tx_buffs(struct ath5k_hw *ah) ...@@ -1045,11 +1045,11 @@ ath5k_drain_tx_buffs(struct ath5k_hw *ah)
ath5k_txbuf_free_skb(ah, bf); ath5k_txbuf_free_skb(ah, bf);
spin_lock_bh(&ah->txbuflock); spin_lock(&ah->txbuflock);
list_move_tail(&bf->list, &ah->txbuf); list_move_tail(&bf->list, &ah->txbuf);
ah->txbuf_len++; ah->txbuf_len++;
txq->txq_len--; txq->txq_len--;
spin_unlock_bh(&ah->txbuflock); spin_unlock(&ah->txbuflock);
} }
txq->link = NULL; txq->link = NULL;
txq->txq_poll_mark = false; txq->txq_poll_mark = false;
......
...@@ -214,6 +214,7 @@ struct ath_frame_info { ...@@ -214,6 +214,7 @@ struct ath_frame_info {
enum ath9k_key_type keytype; enum ath9k_key_type keytype;
u8 keyix; u8 keyix;
u8 retries; u8 retries;
u8 rtscts_rate;
}; };
struct ath_buf_state { struct ath_buf_state {
......
...@@ -1486,6 +1486,7 @@ static void ath9k_htc_bss_info_changed(struct ieee80211_hw *hw, ...@@ -1486,6 +1486,7 @@ static void ath9k_htc_bss_info_changed(struct ieee80211_hw *hw,
priv->num_sta_assoc_vif++ : priv->num_sta_assoc_vif--; priv->num_sta_assoc_vif++ : priv->num_sta_assoc_vif--;
if (priv->ah->opmode == NL80211_IFTYPE_STATION) { if (priv->ah->opmode == NL80211_IFTYPE_STATION) {
ath9k_htc_choose_set_bssid(priv);
if (bss_conf->assoc && (priv->num_sta_assoc_vif == 1)) if (bss_conf->assoc && (priv->num_sta_assoc_vif == 1))
ath9k_htc_start_ani(priv); ath9k_htc_start_ani(priv);
else if (priv->num_sta_assoc_vif == 0) else if (priv->num_sta_assoc_vif == 0)
...@@ -1493,13 +1494,11 @@ static void ath9k_htc_bss_info_changed(struct ieee80211_hw *hw, ...@@ -1493,13 +1494,11 @@ static void ath9k_htc_bss_info_changed(struct ieee80211_hw *hw,
} }
} }
if (changed & BSS_CHANGED_BSSID) { if (changed & BSS_CHANGED_IBSS) {
if (priv->ah->opmode == NL80211_IFTYPE_ADHOC) { if (priv->ah->opmode == NL80211_IFTYPE_ADHOC) {
common->curaid = bss_conf->aid; common->curaid = bss_conf->aid;
memcpy(common->curbssid, bss_conf->bssid, ETH_ALEN); memcpy(common->curbssid, bss_conf->bssid, ETH_ALEN);
ath9k_htc_set_bssid(priv); ath9k_htc_set_bssid(priv);
} else if (priv->ah->opmode == NL80211_IFTYPE_STATION) {
ath9k_htc_choose_set_bssid(priv);
} }
} }
......
...@@ -614,7 +614,7 @@ static int __ath9k_hw_init(struct ath_hw *ah) ...@@ -614,7 +614,7 @@ static int __ath9k_hw_init(struct ath_hw *ah)
if (NR_CPUS > 1 && ah->config.serialize_regmode == SER_REG_MODE_AUTO) { if (NR_CPUS > 1 && ah->config.serialize_regmode == SER_REG_MODE_AUTO) {
if (ah->hw_version.macVersion == AR_SREV_VERSION_5416_PCI || if (ah->hw_version.macVersion == AR_SREV_VERSION_5416_PCI ||
((AR_SREV_9160(ah) || AR_SREV_9280(ah)) && ((AR_SREV_9160(ah) || AR_SREV_9280(ah) || AR_SREV_9287(ah)) &&
!ah->is_pciexpress)) { !ah->is_pciexpress)) {
ah->config.serialize_regmode = ah->config.serialize_regmode =
SER_REG_MODE_ON; SER_REG_MODE_ON;
...@@ -773,13 +773,25 @@ static void ath9k_hw_init_qos(struct ath_hw *ah) ...@@ -773,13 +773,25 @@ static void ath9k_hw_init_qos(struct ath_hw *ah)
u32 ar9003_get_pll_sqsum_dvc(struct ath_hw *ah) u32 ar9003_get_pll_sqsum_dvc(struct ath_hw *ah)
{ {
struct ath_common *common = ath9k_hw_common(ah);
int i = 0;
REG_CLR_BIT(ah, PLL3, PLL3_DO_MEAS_MASK); REG_CLR_BIT(ah, PLL3, PLL3_DO_MEAS_MASK);
udelay(100); udelay(100);
REG_SET_BIT(ah, PLL3, PLL3_DO_MEAS_MASK); REG_SET_BIT(ah, PLL3, PLL3_DO_MEAS_MASK);
while ((REG_READ(ah, PLL4) & PLL4_MEAS_DONE) == 0) while ((REG_READ(ah, PLL4) & PLL4_MEAS_DONE) == 0) {
udelay(100); udelay(100);
if (WARN_ON_ONCE(i >= 100)) {
ath_err(common, "PLL4 meaurement not done\n");
break;
}
i++;
}
return (REG_READ(ah, PLL3) & SQSUM_DVC_MASK) >> 3; return (REG_READ(ah, PLL3) & SQSUM_DVC_MASK) >> 3;
} }
EXPORT_SYMBOL(ar9003_get_pll_sqsum_dvc); EXPORT_SYMBOL(ar9003_get_pll_sqsum_dvc);
......
...@@ -658,9 +658,9 @@ static bool ath_edma_get_buffers(struct ath_softc *sc, ...@@ -658,9 +658,9 @@ static bool ath_edma_get_buffers(struct ath_softc *sc,
__skb_unlink(skb, &rx_edma->rx_fifo); __skb_unlink(skb, &rx_edma->rx_fifo);
list_add_tail(&bf->list, &sc->rx.rxbuf); list_add_tail(&bf->list, &sc->rx.rxbuf);
ath_rx_edma_buf_link(sc, qtype); ath_rx_edma_buf_link(sc, qtype);
} else {
bf = NULL;
} }
bf = NULL;
} }
*dest = bf; *dest = bf;
...@@ -785,7 +785,8 @@ static bool ath9k_rx_accept(struct ath_common *common, ...@@ -785,7 +785,8 @@ static bool ath9k_rx_accept(struct ath_common *common,
* descriptor does contain a valid key index. This has been observed * descriptor does contain a valid key index. This has been observed
* mostly with CCMP encryption. * mostly with CCMP encryption.
*/ */
if (rx_stats->rs_keyix == ATH9K_RXKEYIX_INVALID) if (rx_stats->rs_keyix == ATH9K_RXKEYIX_INVALID ||
!test_bit(rx_stats->rs_keyix, common->ccmp_keymap))
rx_stats->rs_status &= ~ATH9K_RXERR_KEYMISS; rx_stats->rs_status &= ~ATH9K_RXERR_KEYMISS;
if (!rx_stats->rs_datalen) { if (!rx_stats->rs_datalen) {
......
...@@ -938,6 +938,7 @@ static void ath_buf_set_rate(struct ath_softc *sc, struct ath_buf *bf, ...@@ -938,6 +938,7 @@ static void ath_buf_set_rate(struct ath_softc *sc, struct ath_buf *bf,
struct ieee80211_tx_rate *rates; struct ieee80211_tx_rate *rates;
const struct ieee80211_rate *rate; const struct ieee80211_rate *rate;
struct ieee80211_hdr *hdr; struct ieee80211_hdr *hdr;
struct ath_frame_info *fi = get_frame_info(bf->bf_mpdu);
int i; int i;
u8 rix = 0; u8 rix = 0;
...@@ -948,18 +949,7 @@ static void ath_buf_set_rate(struct ath_softc *sc, struct ath_buf *bf, ...@@ -948,18 +949,7 @@ static void ath_buf_set_rate(struct ath_softc *sc, struct ath_buf *bf,
/* set dur_update_en for l-sig computation except for PS-Poll frames */ /* set dur_update_en for l-sig computation except for PS-Poll frames */
info->dur_update = !ieee80211_is_pspoll(hdr->frame_control); info->dur_update = !ieee80211_is_pspoll(hdr->frame_control);
info->rtscts_rate = fi->rtscts_rate;
/*
* We check if Short Preamble is needed for the CTS rate by
* checking the BSS's global flag.
* But for the rate series, IEEE80211_TX_RC_USE_SHORT_PREAMBLE is used.
*/
rate = ieee80211_get_rts_cts_rate(sc->hw, tx_info);
info->rtscts_rate = rate->hw_value;
if (tx_info->control.vif &&
tx_info->control.vif->bss_conf.use_short_preamble)
info->rtscts_rate |= rate->hw_value_short;
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
bool is_40, is_sgi, is_sp; bool is_40, is_sgi, is_sp;
...@@ -1001,13 +991,13 @@ static void ath_buf_set_rate(struct ath_softc *sc, struct ath_buf *bf, ...@@ -1001,13 +991,13 @@ static void ath_buf_set_rate(struct ath_softc *sc, struct ath_buf *bf,
} }
/* legacy rates */ /* legacy rates */
rate = &sc->sbands[tx_info->band].bitrates[rates[i].idx];
if ((tx_info->band == IEEE80211_BAND_2GHZ) && if ((tx_info->band == IEEE80211_BAND_2GHZ) &&
!(rate->flags & IEEE80211_RATE_ERP_G)) !(rate->flags & IEEE80211_RATE_ERP_G))
phy = WLAN_RC_PHY_CCK; phy = WLAN_RC_PHY_CCK;
else else
phy = WLAN_RC_PHY_OFDM; phy = WLAN_RC_PHY_OFDM;
rate = &sc->sbands[tx_info->band].bitrates[rates[i].idx];
info->rates[i].Rate = rate->hw_value; info->rates[i].Rate = rate->hw_value;
if (rate->hw_value_short) { if (rate->hw_value_short) {
if (rates[i].flags & IEEE80211_TX_RC_USE_SHORT_PREAMBLE) if (rates[i].flags & IEEE80211_TX_RC_USE_SHORT_PREAMBLE)
...@@ -1788,10 +1778,22 @@ static void setup_frame_info(struct ieee80211_hw *hw, struct sk_buff *skb, ...@@ -1788,10 +1778,22 @@ static void setup_frame_info(struct ieee80211_hw *hw, struct sk_buff *skb,
struct ieee80211_sta *sta = tx_info->control.sta; struct ieee80211_sta *sta = tx_info->control.sta;
struct ieee80211_key_conf *hw_key = tx_info->control.hw_key; struct ieee80211_key_conf *hw_key = tx_info->control.hw_key;
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
const struct ieee80211_rate *rate;
struct ath_frame_info *fi = get_frame_info(skb); struct ath_frame_info *fi = get_frame_info(skb);
struct ath_node *an = NULL; struct ath_node *an = NULL;
enum ath9k_key_type keytype; enum ath9k_key_type keytype;
bool short_preamble = false;
/*
* We check if Short Preamble is needed for the CTS rate by
* checking the BSS's global flag.
* But for the rate series, IEEE80211_TX_RC_USE_SHORT_PREAMBLE is used.
*/
if (tx_info->control.vif &&
tx_info->control.vif->bss_conf.use_short_preamble)
short_preamble = true;
rate = ieee80211_get_rts_cts_rate(hw, tx_info);
keytype = ath9k_cmn_get_hw_crypto_keytype(skb); keytype = ath9k_cmn_get_hw_crypto_keytype(skb);
if (sta) if (sta)
...@@ -1806,6 +1808,9 @@ static void setup_frame_info(struct ieee80211_hw *hw, struct sk_buff *skb, ...@@ -1806,6 +1808,9 @@ static void setup_frame_info(struct ieee80211_hw *hw, struct sk_buff *skb,
fi->keyix = ATH9K_TXKEYIX_INVALID; fi->keyix = ATH9K_TXKEYIX_INVALID;
fi->keytype = keytype; fi->keytype = keytype;
fi->framelen = framelen; fi->framelen = framelen;
fi->rtscts_rate = rate->hw_value;
if (short_preamble)
fi->rtscts_rate |= rate->hw_value_short;
} }
u8 ath_txchainmask_reduction(struct ath_softc *sc, u8 chainmask, u32 rate) u8 ath_txchainmask_reduction(struct ath_softc *sc, u8 chainmask, u32 rate)
......
...@@ -556,6 +556,9 @@ int ath_key_config(struct ath_common *common, ...@@ -556,6 +556,9 @@ int ath_key_config(struct ath_common *common,
return -EIO; return -EIO;
set_bit(idx, common->keymap); set_bit(idx, common->keymap);
if (key->cipher == WLAN_CIPHER_SUITE_CCMP)
set_bit(idx, common->ccmp_keymap);
if (key->cipher == WLAN_CIPHER_SUITE_TKIP) { if (key->cipher == WLAN_CIPHER_SUITE_TKIP) {
set_bit(idx + 64, common->keymap); set_bit(idx + 64, common->keymap);
set_bit(idx, common->tkip_keymap); set_bit(idx, common->tkip_keymap);
...@@ -582,6 +585,7 @@ void ath_key_delete(struct ath_common *common, struct ieee80211_key_conf *key) ...@@ -582,6 +585,7 @@ void ath_key_delete(struct ath_common *common, struct ieee80211_key_conf *key)
return; return;
clear_bit(key->hw_key_idx, common->keymap); clear_bit(key->hw_key_idx, common->keymap);
clear_bit(key->hw_key_idx, common->ccmp_keymap);
if (key->cipher != WLAN_CIPHER_SUITE_TKIP) if (key->cipher != WLAN_CIPHER_SUITE_TKIP)
return; return;
......
...@@ -2228,6 +2228,7 @@ static ssize_t iwl_dbgfs_echo_test_write(struct file *file, ...@@ -2228,6 +2228,7 @@ static ssize_t iwl_dbgfs_echo_test_write(struct file *file,
return count; return count;
} }
#ifdef CONFIG_IWLWIFI_DEBUG
static ssize_t iwl_dbgfs_log_event_read(struct file *file, static ssize_t iwl_dbgfs_log_event_read(struct file *file,
char __user *user_buf, char __user *user_buf,
size_t count, loff_t *ppos) size_t count, loff_t *ppos)
...@@ -2265,6 +2266,7 @@ static ssize_t iwl_dbgfs_log_event_write(struct file *file, ...@@ -2265,6 +2266,7 @@ static ssize_t iwl_dbgfs_log_event_write(struct file *file,
return count; return count;
} }
#endif
static ssize_t iwl_dbgfs_calib_disabled_read(struct file *file, static ssize_t iwl_dbgfs_calib_disabled_read(struct file *file,
char __user *user_buf, char __user *user_buf,
...@@ -2334,7 +2336,9 @@ DEBUGFS_READ_FILE_OPS(bt_traffic); ...@@ -2334,7 +2336,9 @@ DEBUGFS_READ_FILE_OPS(bt_traffic);
DEBUGFS_READ_WRITE_FILE_OPS(protection_mode); DEBUGFS_READ_WRITE_FILE_OPS(protection_mode);
DEBUGFS_READ_FILE_OPS(reply_tx_error); DEBUGFS_READ_FILE_OPS(reply_tx_error);
DEBUGFS_WRITE_FILE_OPS(echo_test); DEBUGFS_WRITE_FILE_OPS(echo_test);
#ifdef CONFIG_IWLWIFI_DEBUG
DEBUGFS_READ_WRITE_FILE_OPS(log_event); DEBUGFS_READ_WRITE_FILE_OPS(log_event);
#endif
DEBUGFS_READ_WRITE_FILE_OPS(calib_disabled); DEBUGFS_READ_WRITE_FILE_OPS(calib_disabled);
/* /*
...@@ -2394,7 +2398,9 @@ int iwl_dbgfs_register(struct iwl_priv *priv, const char *name) ...@@ -2394,7 +2398,9 @@ int iwl_dbgfs_register(struct iwl_priv *priv, const char *name)
DEBUGFS_ADD_FILE(rxon_flags, dir_debug, S_IWUSR); DEBUGFS_ADD_FILE(rxon_flags, dir_debug, S_IWUSR);
DEBUGFS_ADD_FILE(rxon_filter_flags, dir_debug, S_IWUSR); DEBUGFS_ADD_FILE(rxon_filter_flags, dir_debug, S_IWUSR);
DEBUGFS_ADD_FILE(echo_test, dir_debug, S_IWUSR); DEBUGFS_ADD_FILE(echo_test, dir_debug, S_IWUSR);
#ifdef CONFIG_IWLWIFI_DEBUG
DEBUGFS_ADD_FILE(log_event, dir_debug, S_IWUSR | S_IRUSR); DEBUGFS_ADD_FILE(log_event, dir_debug, S_IWUSR | S_IRUSR);
#endif
if (iwl_advanced_bt_coexist(priv)) if (iwl_advanced_bt_coexist(priv))
DEBUGFS_ADD_FILE(bt_traffic, dir_debug, S_IRUSR); DEBUGFS_ADD_FILE(bt_traffic, dir_debug, S_IRUSR);
......
...@@ -801,6 +801,18 @@ static int iwlagn_mac_sta_state(struct ieee80211_hw *hw, ...@@ -801,6 +801,18 @@ static int iwlagn_mac_sta_state(struct ieee80211_hw *hw,
switch (op) { switch (op) {
case ADD: case ADD:
ret = iwlagn_mac_sta_add(hw, vif, sta); ret = iwlagn_mac_sta_add(hw, vif, sta);
if (ret)
break;
/*
* Clear the in-progress flag, the AP station entry was added
* but we'll initialize LQ only when we've associated (which
* would also clear the in-progress flag). This is necessary
* in case we never initialize LQ because association fails.
*/
spin_lock_bh(&priv->sta_lock);
priv->stations[iwl_sta_id(sta)].used &=
~IWL_STA_UCODE_INPROGRESS;
spin_unlock_bh(&priv->sta_lock);
break; break;
case REMOVE: case REMOVE:
ret = iwlagn_mac_sta_remove(hw, vif, sta); ret = iwlagn_mac_sta_remove(hw, vif, sta);
......
...@@ -256,7 +256,8 @@ mwifiex_11n_create_rx_reorder_tbl(struct mwifiex_private *priv, u8 *ta, ...@@ -256,7 +256,8 @@ mwifiex_11n_create_rx_reorder_tbl(struct mwifiex_private *priv, u8 *ta,
else else
last_seq = priv->rx_seq[tid]; last_seq = priv->rx_seq[tid];
if (last_seq >= new_node->start_win) if (last_seq != MWIFIEX_DEF_11N_RX_SEQ_NUM &&
last_seq >= new_node->start_win)
new_node->start_win = last_seq + 1; new_node->start_win = last_seq + 1;
new_node->win_size = win_size; new_node->win_size = win_size;
...@@ -596,5 +597,5 @@ void mwifiex_11n_cleanup_reorder_tbl(struct mwifiex_private *priv) ...@@ -596,5 +597,5 @@ void mwifiex_11n_cleanup_reorder_tbl(struct mwifiex_private *priv)
spin_unlock_irqrestore(&priv->rx_reorder_tbl_lock, flags); spin_unlock_irqrestore(&priv->rx_reorder_tbl_lock, flags);
INIT_LIST_HEAD(&priv->rx_reorder_tbl_ptr); INIT_LIST_HEAD(&priv->rx_reorder_tbl_ptr);
memset(priv->rx_seq, 0, sizeof(priv->rx_seq)); mwifiex_reset_11n_rx_seq_num(priv);
} }
...@@ -37,6 +37,13 @@ ...@@ -37,6 +37,13 @@
#define ADDBA_RSP_STATUS_ACCEPT 0 #define ADDBA_RSP_STATUS_ACCEPT 0
#define MWIFIEX_DEF_11N_RX_SEQ_NUM 0xffff
static inline void mwifiex_reset_11n_rx_seq_num(struct mwifiex_private *priv)
{
memset(priv->rx_seq, 0xff, sizeof(priv->rx_seq));
}
int mwifiex_11n_rx_reorder_pkt(struct mwifiex_private *, int mwifiex_11n_rx_reorder_pkt(struct mwifiex_private *,
u16 seqNum, u16 seqNum,
u16 tid, u8 *ta, u16 tid, u8 *ta,
......
...@@ -1525,7 +1525,7 @@ struct net_device *mwifiex_add_virtual_intf(struct wiphy *wiphy, ...@@ -1525,7 +1525,7 @@ struct net_device *mwifiex_add_virtual_intf(struct wiphy *wiphy,
struct wireless_dev *wdev; struct wireless_dev *wdev;
if (!adapter) if (!adapter)
return NULL; return ERR_PTR(-EFAULT);
switch (type) { switch (type) {
case NL80211_IFTYPE_UNSPECIFIED: case NL80211_IFTYPE_UNSPECIFIED:
...@@ -1535,12 +1535,12 @@ struct net_device *mwifiex_add_virtual_intf(struct wiphy *wiphy, ...@@ -1535,12 +1535,12 @@ struct net_device *mwifiex_add_virtual_intf(struct wiphy *wiphy,
if (priv->bss_mode) { if (priv->bss_mode) {
wiphy_err(wiphy, wiphy_err(wiphy,
"cannot create multiple sta/adhoc ifaces\n"); "cannot create multiple sta/adhoc ifaces\n");
return NULL; return ERR_PTR(-EINVAL);
} }
wdev = kzalloc(sizeof(struct wireless_dev), GFP_KERNEL); wdev = kzalloc(sizeof(struct wireless_dev), GFP_KERNEL);
if (!wdev) if (!wdev)
return NULL; return ERR_PTR(-ENOMEM);
wdev->wiphy = wiphy; wdev->wiphy = wiphy;
priv->wdev = wdev; priv->wdev = wdev;
...@@ -1563,12 +1563,12 @@ struct net_device *mwifiex_add_virtual_intf(struct wiphy *wiphy, ...@@ -1563,12 +1563,12 @@ struct net_device *mwifiex_add_virtual_intf(struct wiphy *wiphy,
if (priv->bss_mode) { if (priv->bss_mode) {
wiphy_err(wiphy, "Can't create multiple AP interfaces"); wiphy_err(wiphy, "Can't create multiple AP interfaces");
return NULL; return ERR_PTR(-EINVAL);
} }
wdev = kzalloc(sizeof(struct wireless_dev), GFP_KERNEL); wdev = kzalloc(sizeof(struct wireless_dev), GFP_KERNEL);
if (!wdev) if (!wdev)
return NULL; return ERR_PTR(-ENOMEM);
priv->wdev = wdev; priv->wdev = wdev;
wdev->wiphy = wiphy; wdev->wiphy = wiphy;
...@@ -1585,14 +1585,15 @@ struct net_device *mwifiex_add_virtual_intf(struct wiphy *wiphy, ...@@ -1585,14 +1585,15 @@ struct net_device *mwifiex_add_virtual_intf(struct wiphy *wiphy,
break; break;
default: default:
wiphy_err(wiphy, "type not supported\n"); wiphy_err(wiphy, "type not supported\n");
return NULL; return ERR_PTR(-EINVAL);
} }
dev = alloc_netdev_mq(sizeof(struct mwifiex_private *), name, dev = alloc_netdev_mq(sizeof(struct mwifiex_private *), name,
ether_setup, 1); ether_setup, 1);
if (!dev) { if (!dev) {
wiphy_err(wiphy, "no memory available for netdevice\n"); wiphy_err(wiphy, "no memory available for netdevice\n");
goto error; priv->bss_mode = NL80211_IFTYPE_UNSPECIFIED;
return ERR_PTR(-ENOMEM);
} }
mwifiex_init_priv_params(priv, dev); mwifiex_init_priv_params(priv, dev);
...@@ -1623,7 +1624,9 @@ struct net_device *mwifiex_add_virtual_intf(struct wiphy *wiphy, ...@@ -1623,7 +1624,9 @@ struct net_device *mwifiex_add_virtual_intf(struct wiphy *wiphy,
/* Register network device */ /* Register network device */
if (register_netdevice(dev)) { if (register_netdevice(dev)) {
wiphy_err(wiphy, "cannot register virtual network device\n"); wiphy_err(wiphy, "cannot register virtual network device\n");
goto error; free_netdev(dev);
priv->bss_mode = NL80211_IFTYPE_UNSPECIFIED;
return ERR_PTR(-EFAULT);
} }
sema_init(&priv->async_sem, 1); sema_init(&priv->async_sem, 1);
...@@ -1635,12 +1638,6 @@ struct net_device *mwifiex_add_virtual_intf(struct wiphy *wiphy, ...@@ -1635,12 +1638,6 @@ struct net_device *mwifiex_add_virtual_intf(struct wiphy *wiphy,
mwifiex_dev_debugfs_init(priv); mwifiex_dev_debugfs_init(priv);
#endif #endif
return dev; return dev;
error:
if (dev && (dev->reg_state == NETREG_UNREGISTERED))
free_netdev(dev);
priv->bss_mode = NL80211_IFTYPE_UNSPECIFIED;
return NULL;
} }
EXPORT_SYMBOL_GPL(mwifiex_add_virtual_intf); EXPORT_SYMBOL_GPL(mwifiex_add_virtual_intf);
......
...@@ -213,6 +213,7 @@ mwifiex_update_uap_custom_ie(struct mwifiex_private *priv, ...@@ -213,6 +213,7 @@ mwifiex_update_uap_custom_ie(struct mwifiex_private *priv,
/* save assoc resp ie index after auto-indexing */ /* save assoc resp ie index after auto-indexing */
*assoc_idx = *((u16 *)pos); *assoc_idx = *((u16 *)pos);
kfree(ap_custom_ie);
return ret; return ret;
} }
......
...@@ -978,10 +978,10 @@ static int mwifiex_decode_rx_packet(struct mwifiex_adapter *adapter, ...@@ -978,10 +978,10 @@ static int mwifiex_decode_rx_packet(struct mwifiex_adapter *adapter,
dev_dbg(adapter->dev, "info: --- Rx: Event ---\n"); dev_dbg(adapter->dev, "info: --- Rx: Event ---\n");
adapter->event_cause = *(u32 *) skb->data; adapter->event_cause = *(u32 *) skb->data;
skb_pull(skb, MWIFIEX_EVENT_HEADER_LEN);
if ((skb->len > 0) && (skb->len < MAX_EVENT_SIZE)) if ((skb->len > 0) && (skb->len < MAX_EVENT_SIZE))
memcpy(adapter->event_body, skb->data, skb->len); memcpy(adapter->event_body,
skb->data + MWIFIEX_EVENT_HEADER_LEN,
skb->len);
/* event cause has been saved to adapter->event_cause */ /* event cause has been saved to adapter->event_cause */
adapter->event_received = true; adapter->event_received = true;
......
...@@ -406,9 +406,9 @@ int mwifiex_process_sta_event(struct mwifiex_private *priv) ...@@ -406,9 +406,9 @@ int mwifiex_process_sta_event(struct mwifiex_private *priv)
break; break;
case EVENT_UAP_STA_ASSOC: case EVENT_UAP_STA_ASSOC:
skb_pull(adapter->event_skb, MWIFIEX_UAP_EVENT_EXTRA_HEADER);
memset(&sinfo, 0, sizeof(sinfo)); memset(&sinfo, 0, sizeof(sinfo));
event = (struct mwifiex_assoc_event *)adapter->event_skb->data; event = (struct mwifiex_assoc_event *)
(adapter->event_body + MWIFIEX_UAP_EVENT_EXTRA_HEADER);
if (le16_to_cpu(event->type) == TLV_TYPE_UAP_MGMT_FRAME) { if (le16_to_cpu(event->type) == TLV_TYPE_UAP_MGMT_FRAME) {
len = -1; len = -1;
...@@ -433,9 +433,8 @@ int mwifiex_process_sta_event(struct mwifiex_private *priv) ...@@ -433,9 +433,8 @@ int mwifiex_process_sta_event(struct mwifiex_private *priv)
GFP_KERNEL); GFP_KERNEL);
break; break;
case EVENT_UAP_STA_DEAUTH: case EVENT_UAP_STA_DEAUTH:
skb_pull(adapter->event_skb, MWIFIEX_UAP_EVENT_EXTRA_HEADER); cfg80211_del_sta(priv->netdev, adapter->event_body +
cfg80211_del_sta(priv->netdev, adapter->event_skb->data, MWIFIEX_UAP_EVENT_EXTRA_HEADER, GFP_KERNEL);
GFP_KERNEL);
break; break;
case EVENT_UAP_BSS_IDLE: case EVENT_UAP_BSS_IDLE:
priv->media_connected = false; priv->media_connected = false;
......
...@@ -161,15 +161,11 @@ int mwifiex_write_data_complete(struct mwifiex_adapter *adapter, ...@@ -161,15 +161,11 @@ int mwifiex_write_data_complete(struct mwifiex_adapter *adapter,
goto done; goto done;
for (i = 0; i < adapter->priv_num; i++) { for (i = 0; i < adapter->priv_num; i++) {
tpriv = adapter->priv[i]; tpriv = adapter->priv[i];
if ((GET_BSS_ROLE(tpriv) == MWIFIEX_BSS_ROLE_STA) && if (tpriv->media_connected &&
(tpriv->media_connected)) { netif_queue_stopped(tpriv->netdev))
if (netif_queue_stopped(tpriv->netdev)) mwifiex_wake_up_net_dev_queue(tpriv->netdev, adapter);
mwifiex_wake_up_net_dev_queue(tpriv->netdev,
adapter);
}
} }
done: done:
dev_kfree_skb_any(skb); dev_kfree_skb_any(skb);
......
...@@ -49,6 +49,7 @@ static int mwifiex_usb_recv(struct mwifiex_adapter *adapter, ...@@ -49,6 +49,7 @@ static int mwifiex_usb_recv(struct mwifiex_adapter *adapter,
struct device *dev = adapter->dev; struct device *dev = adapter->dev;
u32 recv_type; u32 recv_type;
__le32 tmp; __le32 tmp;
int ret;
if (adapter->hs_activated) if (adapter->hs_activated)
mwifiex_process_hs_config(adapter); mwifiex_process_hs_config(adapter);
...@@ -69,16 +70,19 @@ static int mwifiex_usb_recv(struct mwifiex_adapter *adapter, ...@@ -69,16 +70,19 @@ static int mwifiex_usb_recv(struct mwifiex_adapter *adapter,
case MWIFIEX_USB_TYPE_CMD: case MWIFIEX_USB_TYPE_CMD:
if (skb->len > MWIFIEX_SIZE_OF_CMD_BUFFER) { if (skb->len > MWIFIEX_SIZE_OF_CMD_BUFFER) {
dev_err(dev, "CMD: skb->len too large\n"); dev_err(dev, "CMD: skb->len too large\n");
return -1; ret = -1;
goto exit_restore_skb;
} else if (!adapter->curr_cmd) { } else if (!adapter->curr_cmd) {
dev_dbg(dev, "CMD: no curr_cmd\n"); dev_dbg(dev, "CMD: no curr_cmd\n");
if (adapter->ps_state == PS_STATE_SLEEP_CFM) { if (adapter->ps_state == PS_STATE_SLEEP_CFM) {
mwifiex_process_sleep_confirm_resp( mwifiex_process_sleep_confirm_resp(
adapter, skb->data, adapter, skb->data,
skb->len); skb->len);
return 0; ret = 0;
goto exit_restore_skb;
} }
return -1; ret = -1;
goto exit_restore_skb;
} }
adapter->curr_cmd->resp_skb = skb; adapter->curr_cmd->resp_skb = skb;
...@@ -87,20 +91,22 @@ static int mwifiex_usb_recv(struct mwifiex_adapter *adapter, ...@@ -87,20 +91,22 @@ static int mwifiex_usb_recv(struct mwifiex_adapter *adapter,
case MWIFIEX_USB_TYPE_EVENT: case MWIFIEX_USB_TYPE_EVENT:
if (skb->len < sizeof(u32)) { if (skb->len < sizeof(u32)) {
dev_err(dev, "EVENT: skb->len too small\n"); dev_err(dev, "EVENT: skb->len too small\n");
return -1; ret = -1;
goto exit_restore_skb;
} }
skb_copy_from_linear_data(skb, &tmp, sizeof(u32)); skb_copy_from_linear_data(skb, &tmp, sizeof(u32));
adapter->event_cause = le32_to_cpu(tmp); adapter->event_cause = le32_to_cpu(tmp);
skb_pull(skb, sizeof(u32));
dev_dbg(dev, "event_cause %#x\n", adapter->event_cause); dev_dbg(dev, "event_cause %#x\n", adapter->event_cause);
if (skb->len > MAX_EVENT_SIZE) { if (skb->len > MAX_EVENT_SIZE) {
dev_err(dev, "EVENT: event body too large\n"); dev_err(dev, "EVENT: event body too large\n");
return -1; ret = -1;
goto exit_restore_skb;
} }
skb_copy_from_linear_data(skb, adapter->event_body, memcpy(adapter->event_body, skb->data +
skb->len); MWIFIEX_EVENT_HEADER_LEN, skb->len);
adapter->event_received = true; adapter->event_received = true;
adapter->event_skb = skb; adapter->event_skb = skb;
break; break;
...@@ -124,6 +130,12 @@ static int mwifiex_usb_recv(struct mwifiex_adapter *adapter, ...@@ -124,6 +130,12 @@ static int mwifiex_usb_recv(struct mwifiex_adapter *adapter,
} }
return -EINPROGRESS; return -EINPROGRESS;
exit_restore_skb:
/* The buffer will be reused for further cmds/events */
skb_push(skb, INTF_HEADER_LEN);
return ret;
} }
static void mwifiex_usb_rx_complete(struct urb *urb) static void mwifiex_usb_rx_complete(struct urb *urb)
......
...@@ -404,6 +404,8 @@ mwifiex_wmm_init(struct mwifiex_adapter *adapter) ...@@ -404,6 +404,8 @@ mwifiex_wmm_init(struct mwifiex_adapter *adapter)
priv->add_ba_param.tx_win_size = MWIFIEX_AMPDU_DEF_TXWINSIZE; priv->add_ba_param.tx_win_size = MWIFIEX_AMPDU_DEF_TXWINSIZE;
priv->add_ba_param.rx_win_size = MWIFIEX_AMPDU_DEF_RXWINSIZE; priv->add_ba_param.rx_win_size = MWIFIEX_AMPDU_DEF_RXWINSIZE;
mwifiex_reset_11n_rx_seq_num(priv);
atomic_set(&priv->wmm.tx_pkts_queued, 0); atomic_set(&priv->wmm.tx_pkts_queued, 0);
atomic_set(&priv->wmm.highest_queued_prio, HIGH_PRIO_TID); atomic_set(&priv->wmm.highest_queued_prio, HIGH_PRIO_TID);
} }
...@@ -1221,6 +1223,7 @@ mwifiex_dequeue_tx_packet(struct mwifiex_adapter *adapter) ...@@ -1221,6 +1223,7 @@ mwifiex_dequeue_tx_packet(struct mwifiex_adapter *adapter)
if (!ptr->is_11n_enabled || if (!ptr->is_11n_enabled ||
mwifiex_is_ba_stream_setup(priv, ptr, tid) || mwifiex_is_ba_stream_setup(priv, ptr, tid) ||
priv->wps.session_enable ||
((priv->sec_info.wpa_enabled || ((priv->sec_info.wpa_enabled ||
priv->sec_info.wpa2_enabled) && priv->sec_info.wpa2_enabled) &&
!priv->wpa_is_gtk_set)) { !priv->wpa_is_gtk_set)) {
......
...@@ -301,9 +301,11 @@ static struct usb_device_id rtl8192c_usb_ids[] = { ...@@ -301,9 +301,11 @@ static struct usb_device_id rtl8192c_usb_ids[] = {
{RTL_USB_DEVICE(0x07b8, 0x8188, rtl92cu_hal_cfg)}, /*Abocom - Abocom*/ {RTL_USB_DEVICE(0x07b8, 0x8188, rtl92cu_hal_cfg)}, /*Abocom - Abocom*/
{RTL_USB_DEVICE(0x07b8, 0x8189, rtl92cu_hal_cfg)}, /*Funai - Abocom*/ {RTL_USB_DEVICE(0x07b8, 0x8189, rtl92cu_hal_cfg)}, /*Funai - Abocom*/
{RTL_USB_DEVICE(0x0846, 0x9041, rtl92cu_hal_cfg)}, /*NetGear WNA1000M*/ {RTL_USB_DEVICE(0x0846, 0x9041, rtl92cu_hal_cfg)}, /*NetGear WNA1000M*/
{RTL_USB_DEVICE(0x0bda, 0x5088, rtl92cu_hal_cfg)}, /*Thinkware-CC&C*/
{RTL_USB_DEVICE(0x0df6, 0x0052, rtl92cu_hal_cfg)}, /*Sitecom - Edimax*/ {RTL_USB_DEVICE(0x0df6, 0x0052, rtl92cu_hal_cfg)}, /*Sitecom - Edimax*/
{RTL_USB_DEVICE(0x0df6, 0x005c, rtl92cu_hal_cfg)}, /*Sitecom - Edimax*/ {RTL_USB_DEVICE(0x0df6, 0x005c, rtl92cu_hal_cfg)}, /*Sitecom - Edimax*/
{RTL_USB_DEVICE(0x0eb0, 0x9071, rtl92cu_hal_cfg)}, /*NO Brand - Etop*/ {RTL_USB_DEVICE(0x0eb0, 0x9071, rtl92cu_hal_cfg)}, /*NO Brand - Etop*/
{RTL_USB_DEVICE(0x4856, 0x0091, rtl92cu_hal_cfg)}, /*NetweeN - Feixun*/
/* HP - Lite-On ,8188CUS Slim Combo */ /* HP - Lite-On ,8188CUS Slim Combo */
{RTL_USB_DEVICE(0x103c, 0x1629, rtl92cu_hal_cfg)}, {RTL_USB_DEVICE(0x103c, 0x1629, rtl92cu_hal_cfg)},
{RTL_USB_DEVICE(0x13d3, 0x3357, rtl92cu_hal_cfg)}, /* AzureWave */ {RTL_USB_DEVICE(0x13d3, 0x3357, rtl92cu_hal_cfg)}, /* AzureWave */
...@@ -346,6 +348,7 @@ static struct usb_device_id rtl8192c_usb_ids[] = { ...@@ -346,6 +348,7 @@ static struct usb_device_id rtl8192c_usb_ids[] = {
{RTL_USB_DEVICE(0x07b8, 0x8178, rtl92cu_hal_cfg)}, /*Funai -Abocom*/ {RTL_USB_DEVICE(0x07b8, 0x8178, rtl92cu_hal_cfg)}, /*Funai -Abocom*/
{RTL_USB_DEVICE(0x0846, 0x9021, rtl92cu_hal_cfg)}, /*Netgear-Sercomm*/ {RTL_USB_DEVICE(0x0846, 0x9021, rtl92cu_hal_cfg)}, /*Netgear-Sercomm*/
{RTL_USB_DEVICE(0x0b05, 0x17ab, rtl92cu_hal_cfg)}, /*ASUS-Edimax*/ {RTL_USB_DEVICE(0x0b05, 0x17ab, rtl92cu_hal_cfg)}, /*ASUS-Edimax*/
{RTL_USB_DEVICE(0x0bda, 0x8186, rtl92cu_hal_cfg)}, /*Realtek 92CE-VAU*/
{RTL_USB_DEVICE(0x0df6, 0x0061, rtl92cu_hal_cfg)}, /*Sitecom-Edimax*/ {RTL_USB_DEVICE(0x0df6, 0x0061, rtl92cu_hal_cfg)}, /*Sitecom-Edimax*/
{RTL_USB_DEVICE(0x0e66, 0x0019, rtl92cu_hal_cfg)}, /*Hawking-Edimax*/ {RTL_USB_DEVICE(0x0e66, 0x0019, rtl92cu_hal_cfg)}, /*Hawking-Edimax*/
{RTL_USB_DEVICE(0x2001, 0x3307, rtl92cu_hal_cfg)}, /*D-Link-Cameo*/ {RTL_USB_DEVICE(0x2001, 0x3307, rtl92cu_hal_cfg)}, /*D-Link-Cameo*/
......
...@@ -869,7 +869,7 @@ int wl1251_acx_tsf_info(struct wl1251 *wl, u64 *mactime) ...@@ -869,7 +869,7 @@ int wl1251_acx_tsf_info(struct wl1251 *wl, u64 *mactime)
} }
*mactime = tsf_info->current_tsf_lsb | *mactime = tsf_info->current_tsf_lsb |
(tsf_info->current_tsf_msb << 31); ((u64)tsf_info->current_tsf_msb << 32);
out: out:
kfree(tsf_info); kfree(tsf_info);
......
...@@ -76,8 +76,7 @@ static int wl1251_event_process(struct wl1251 *wl, struct event_mailbox *mbox) ...@@ -76,8 +76,7 @@ static int wl1251_event_process(struct wl1251 *wl, struct event_mailbox *mbox)
} }
} }
if (vector & SYNCHRONIZATION_TIMEOUT_EVENT_ID && if (vector & SYNCHRONIZATION_TIMEOUT_EVENT_ID) {
wl->station_mode != STATION_ACTIVE_MODE) {
wl1251_debug(DEBUG_EVENT, "SYNCHRONIZATION_TIMEOUT_EVENT"); wl1251_debug(DEBUG_EVENT, "SYNCHRONIZATION_TIMEOUT_EVENT");
/* indicate to the stack, that beacons have been lost */ /* indicate to the stack, that beacons have been lost */
......
...@@ -73,6 +73,8 @@ static void wl1251_spi_reset(struct wl1251 *wl) ...@@ -73,6 +73,8 @@ static void wl1251_spi_reset(struct wl1251 *wl)
spi_sync(wl_to_spi(wl), &m); spi_sync(wl_to_spi(wl), &m);
wl1251_dump(DEBUG_SPI, "spi reset -> ", cmd, WSPI_INIT_CMD_LEN); wl1251_dump(DEBUG_SPI, "spi reset -> ", cmd, WSPI_INIT_CMD_LEN);
kfree(cmd);
} }
static void wl1251_spi_wake(struct wl1251 *wl) static void wl1251_spi_wake(struct wl1251 *wl)
...@@ -127,6 +129,8 @@ static void wl1251_spi_wake(struct wl1251 *wl) ...@@ -127,6 +129,8 @@ static void wl1251_spi_wake(struct wl1251 *wl)
spi_sync(wl_to_spi(wl), &m); spi_sync(wl_to_spi(wl), &m);
wl1251_dump(DEBUG_SPI, "spi init -> ", cmd, WSPI_INIT_CMD_LEN); wl1251_dump(DEBUG_SPI, "spi init -> ", cmd, WSPI_INIT_CMD_LEN);
kfree(cmd);
} }
static void wl1251_spi_reset_wake(struct wl1251 *wl) static void wl1251_spi_reset_wake(struct wl1251 *wl)
......
config WLCORE config WLCORE
tristate "TI wlcore support" tristate "TI wlcore support"
depends on WL_TI && GENERIC_HARDIRQS && MAC80211 depends on WL_TI && GENERIC_HARDIRQS && MAC80211
depends on INET
select FW_LOADER select FW_LOADER
---help--- ---help---
This module contains the main code for TI WLAN chips. It abstracts This module contains the main code for TI WLAN chips. It abstracts
......
...@@ -3278,12 +3278,14 @@ static void l2cap_conf_rfc_get(struct l2cap_chan *chan, void *rsp, int len) ...@@ -3278,12 +3278,14 @@ static void l2cap_conf_rfc_get(struct l2cap_chan *chan, void *rsp, int len)
while (len >= L2CAP_CONF_OPT_SIZE) { while (len >= L2CAP_CONF_OPT_SIZE) {
len -= l2cap_get_conf_opt(&rsp, &type, &olen, &val); len -= l2cap_get_conf_opt(&rsp, &type, &olen, &val);
switch (type) { if (type != L2CAP_CONF_RFC)
case L2CAP_CONF_RFC: continue;
if (olen == sizeof(rfc))
memcpy(&rfc, (void *)val, olen); if (olen != sizeof(rfc))
goto done; break;
}
memcpy(&rfc, (void *)val, olen);
goto done;
} }
/* Use sane default values in case a misbehaving remote device /* Use sane default values in case a misbehaving remote device
......
...@@ -1598,7 +1598,7 @@ static int disconnect(struct sock *sk, struct hci_dev *hdev, void *data, ...@@ -1598,7 +1598,7 @@ static int disconnect(struct sock *sk, struct hci_dev *hdev, void *data,
else else
conn = hci_conn_hash_lookup_ba(hdev, LE_LINK, &cp->addr.bdaddr); conn = hci_conn_hash_lookup_ba(hdev, LE_LINK, &cp->addr.bdaddr);
if (!conn) { if (!conn || conn->state == BT_OPEN || conn->state == BT_CLOSED) {
err = cmd_status(sk, hdev->id, MGMT_OP_DISCONNECT, err = cmd_status(sk, hdev->id, MGMT_OP_DISCONNECT,
MGMT_STATUS_NOT_CONNECTED); MGMT_STATUS_NOT_CONNECTED);
goto failed; goto failed;
......
...@@ -1324,7 +1324,6 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata, ...@@ -1324,7 +1324,6 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata,
struct ieee80211_local *local = sdata->local; struct ieee80211_local *local = sdata->local;
struct sta_info *sta; struct sta_info *sta;
u32 changed = 0; u32 changed = 0;
u8 bssid[ETH_ALEN];
ASSERT_MGD_MTX(ifmgd); ASSERT_MGD_MTX(ifmgd);
...@@ -1336,10 +1335,7 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata, ...@@ -1336,10 +1335,7 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata,
ieee80211_stop_poll(sdata); ieee80211_stop_poll(sdata);
memcpy(bssid, ifmgd->associated->bssid, ETH_ALEN);
ifmgd->associated = NULL; ifmgd->associated = NULL;
memset(ifmgd->bssid, 0, ETH_ALEN);
/* /*
* we need to commit the associated = NULL change because the * we need to commit the associated = NULL change because the
...@@ -1359,7 +1355,7 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata, ...@@ -1359,7 +1355,7 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata,
netif_carrier_off(sdata->dev); netif_carrier_off(sdata->dev);
mutex_lock(&local->sta_mtx); mutex_lock(&local->sta_mtx);
sta = sta_info_get(sdata, bssid); sta = sta_info_get(sdata, ifmgd->bssid);
if (sta) { if (sta) {
set_sta_flag(sta, WLAN_STA_BLOCK_BA); set_sta_flag(sta, WLAN_STA_BLOCK_BA);
ieee80211_sta_tear_down_BA_sessions(sta, tx); ieee80211_sta_tear_down_BA_sessions(sta, tx);
...@@ -1368,13 +1364,16 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata, ...@@ -1368,13 +1364,16 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata,
/* deauthenticate/disassociate now */ /* deauthenticate/disassociate now */
if (tx || frame_buf) if (tx || frame_buf)
ieee80211_send_deauth_disassoc(sdata, bssid, stype, reason, ieee80211_send_deauth_disassoc(sdata, ifmgd->bssid, stype,
tx, frame_buf); reason, tx, frame_buf);
/* flush out frame */ /* flush out frame */
if (tx) if (tx)
drv_flush(local, false); drv_flush(local, false);
/* clear bssid only after building the needed mgmt frames */
memset(ifmgd->bssid, 0, ETH_ALEN);
/* remove AP and TDLS peers */ /* remove AP and TDLS peers */
sta_info_flush(local, sdata); sta_info_flush(local, sdata);
......
...@@ -2434,7 +2434,7 @@ ieee80211_rx_h_action_return(struct ieee80211_rx_data *rx) ...@@ -2434,7 +2434,7 @@ ieee80211_rx_h_action_return(struct ieee80211_rx_data *rx)
* frames that we didn't handle, including returning unknown * frames that we didn't handle, including returning unknown
* ones. For all other modes we will return them to the sender, * ones. For all other modes we will return them to the sender,
* setting the 0x80 bit in the action category, as required by * setting the 0x80 bit in the action category, as required by
* 802.11-2007 7.3.1.11. * 802.11-2012 9.24.4.
* Newer versions of hostapd shall also use the management frame * Newer versions of hostapd shall also use the management frame
* registration mechanisms, but older ones still use cooked * registration mechanisms, but older ones still use cooked
* monitor interfaces so push all frames there. * monitor interfaces so push all frames there.
...@@ -2444,6 +2444,9 @@ ieee80211_rx_h_action_return(struct ieee80211_rx_data *rx) ...@@ -2444,6 +2444,9 @@ ieee80211_rx_h_action_return(struct ieee80211_rx_data *rx)
sdata->vif.type == NL80211_IFTYPE_AP_VLAN)) sdata->vif.type == NL80211_IFTYPE_AP_VLAN))
return RX_DROP_MONITOR; return RX_DROP_MONITOR;
if (is_multicast_ether_addr(mgmt->da))
return RX_DROP_MONITOR;
/* do not return rejected action frames */ /* do not return rejected action frames */
if (mgmt->u.action.category & 0x80) if (mgmt->u.action.category & 0x80)
return RX_DROP_UNUSABLE; return RX_DROP_UNUSABLE;
......
...@@ -106,7 +106,7 @@ static __u8 *nci_extract_rf_params_nfca_passive_poll(struct nci_dev *ndev, ...@@ -106,7 +106,7 @@ static __u8 *nci_extract_rf_params_nfca_passive_poll(struct nci_dev *ndev,
nfca_poll->sens_res = __le16_to_cpu(*((__u16 *)data)); nfca_poll->sens_res = __le16_to_cpu(*((__u16 *)data));
data += 2; data += 2;
nfca_poll->nfcid1_len = *data++; nfca_poll->nfcid1_len = min_t(__u8, *data++, NFC_NFCID1_MAXSIZE);
pr_debug("sens_res 0x%x, nfcid1_len %d\n", pr_debug("sens_res 0x%x, nfcid1_len %d\n",
nfca_poll->sens_res, nfca_poll->nfcid1_len); nfca_poll->sens_res, nfca_poll->nfcid1_len);
...@@ -130,7 +130,7 @@ static __u8 *nci_extract_rf_params_nfcb_passive_poll(struct nci_dev *ndev, ...@@ -130,7 +130,7 @@ static __u8 *nci_extract_rf_params_nfcb_passive_poll(struct nci_dev *ndev,
struct rf_tech_specific_params_nfcb_poll *nfcb_poll, struct rf_tech_specific_params_nfcb_poll *nfcb_poll,
__u8 *data) __u8 *data)
{ {
nfcb_poll->sensb_res_len = *data++; nfcb_poll->sensb_res_len = min_t(__u8, *data++, NFC_SENSB_RES_MAXSIZE);
pr_debug("sensb_res_len %d\n", nfcb_poll->sensb_res_len); pr_debug("sensb_res_len %d\n", nfcb_poll->sensb_res_len);
...@@ -145,7 +145,7 @@ static __u8 *nci_extract_rf_params_nfcf_passive_poll(struct nci_dev *ndev, ...@@ -145,7 +145,7 @@ static __u8 *nci_extract_rf_params_nfcf_passive_poll(struct nci_dev *ndev,
__u8 *data) __u8 *data)
{ {
nfcf_poll->bit_rate = *data++; nfcf_poll->bit_rate = *data++;
nfcf_poll->sensf_res_len = *data++; nfcf_poll->sensf_res_len = min_t(__u8, *data++, NFC_SENSF_RES_MAXSIZE);
pr_debug("bit_rate %d, sensf_res_len %d\n", pr_debug("bit_rate %d, sensf_res_len %d\n",
nfcf_poll->bit_rate, nfcf_poll->sensf_res_len); nfcf_poll->bit_rate, nfcf_poll->sensf_res_len);
...@@ -331,7 +331,7 @@ static int nci_extract_activation_params_iso_dep(struct nci_dev *ndev, ...@@ -331,7 +331,7 @@ static int nci_extract_activation_params_iso_dep(struct nci_dev *ndev,
switch (ntf->activation_rf_tech_and_mode) { switch (ntf->activation_rf_tech_and_mode) {
case NCI_NFC_A_PASSIVE_POLL_MODE: case NCI_NFC_A_PASSIVE_POLL_MODE:
nfca_poll = &ntf->activation_params.nfca_poll_iso_dep; nfca_poll = &ntf->activation_params.nfca_poll_iso_dep;
nfca_poll->rats_res_len = *data++; nfca_poll->rats_res_len = min_t(__u8, *data++, 20);
pr_debug("rats_res_len %d\n", nfca_poll->rats_res_len); pr_debug("rats_res_len %d\n", nfca_poll->rats_res_len);
if (nfca_poll->rats_res_len > 0) { if (nfca_poll->rats_res_len > 0) {
memcpy(nfca_poll->rats_res, memcpy(nfca_poll->rats_res,
...@@ -341,7 +341,7 @@ static int nci_extract_activation_params_iso_dep(struct nci_dev *ndev, ...@@ -341,7 +341,7 @@ static int nci_extract_activation_params_iso_dep(struct nci_dev *ndev,
case NCI_NFC_B_PASSIVE_POLL_MODE: case NCI_NFC_B_PASSIVE_POLL_MODE:
nfcb_poll = &ntf->activation_params.nfcb_poll_iso_dep; nfcb_poll = &ntf->activation_params.nfcb_poll_iso_dep;
nfcb_poll->attrib_res_len = *data++; nfcb_poll->attrib_res_len = min_t(__u8, *data++, 50);
pr_debug("attrib_res_len %d\n", nfcb_poll->attrib_res_len); pr_debug("attrib_res_len %d\n", nfcb_poll->attrib_res_len);
if (nfcb_poll->attrib_res_len > 0) { if (nfcb_poll->attrib_res_len > 0) {
memcpy(nfcb_poll->attrib_res, memcpy(nfcb_poll->attrib_res,
......
...@@ -54,7 +54,10 @@ static int rawsock_release(struct socket *sock) ...@@ -54,7 +54,10 @@ static int rawsock_release(struct socket *sock)
{ {
struct sock *sk = sock->sk; struct sock *sk = sock->sk;
pr_debug("sock=%p\n", sock); pr_debug("sock=%p sk=%p\n", sock, sk);
if (!sk)
return 0;
sock_orphan(sk); sock_orphan(sk);
sock_put(sk); sock_put(sk);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册