Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless
Conflicts: net/nfc/llcp/llcp.c
This commit is contained in:
@@ -27,7 +27,7 @@
|
||||
#define WME_MAX_BA WME_BA_BMP_SIZE
|
||||
#define ATH_TID_MAX_BUFS (2 * WME_MAX_BA)
|
||||
|
||||
#define ATH_RSSI_DUMMY_MARKER 0x127
|
||||
#define ATH_RSSI_DUMMY_MARKER 127
|
||||
#define ATH_RSSI_LPF_LEN 10
|
||||
#define RSSI_LPF_THRESHOLD -20
|
||||
#define ATH_RSSI_EP_MULTIPLIER (1<<7)
|
||||
|
@@ -22,6 +22,7 @@
|
||||
#include <linux/firmware.h>
|
||||
#include <linux/skbuff.h>
|
||||
#include <linux/netdevice.h>
|
||||
#include <linux/etherdevice.h>
|
||||
#include <linux/leds.h>
|
||||
#include <linux/slab.h>
|
||||
#include <net/mac80211.h>
|
||||
|
@@ -1067,15 +1067,19 @@ static bool ath9k_rx_prepare(struct ath9k_htc_priv *priv,
|
||||
|
||||
last_rssi = priv->rx.last_rssi;
|
||||
|
||||
if (likely(last_rssi != ATH_RSSI_DUMMY_MARKER))
|
||||
rxbuf->rxstatus.rs_rssi = ATH_EP_RND(last_rssi,
|
||||
ATH_RSSI_EP_MULTIPLIER);
|
||||
if (ieee80211_is_beacon(hdr->frame_control) &&
|
||||
!is_zero_ether_addr(common->curbssid) &&
|
||||
ether_addr_equal(hdr->addr3, common->curbssid)) {
|
||||
s8 rssi = rxbuf->rxstatus.rs_rssi;
|
||||
|
||||
if (rxbuf->rxstatus.rs_rssi < 0)
|
||||
rxbuf->rxstatus.rs_rssi = 0;
|
||||
if (likely(last_rssi != ATH_RSSI_DUMMY_MARKER))
|
||||
rssi = ATH_EP_RND(last_rssi, ATH_RSSI_EP_MULTIPLIER);
|
||||
|
||||
if (ieee80211_is_beacon(fc))
|
||||
priv->ah->stats.avgbrssi = rxbuf->rxstatus.rs_rssi;
|
||||
if (rssi < 0)
|
||||
rssi = 0;
|
||||
|
||||
priv->ah->stats.avgbrssi = rssi;
|
||||
}
|
||||
|
||||
rx_status->mactime = be64_to_cpu(rxbuf->rxstatus.rs_tstamp);
|
||||
rx_status->band = hw->conf.channel->band;
|
||||
|
@@ -1463,7 +1463,9 @@ static bool ath9k_hw_chip_reset(struct ath_hw *ah,
|
||||
reset_type = ATH9K_RESET_POWER_ON;
|
||||
else
|
||||
reset_type = ATH9K_RESET_COLD;
|
||||
}
|
||||
} else if (ah->chip_fullsleep || REG_READ(ah, AR_Q_TXE) ||
|
||||
(REG_READ(ah, AR_CR) & AR_CR_RXE))
|
||||
reset_type = ATH9K_RESET_COLD;
|
||||
|
||||
if (!ath9k_hw_set_reset_reg(ah, reset_type))
|
||||
return false;
|
||||
|
@@ -825,6 +825,11 @@ static void if_sdio_finish_power_on(struct if_sdio_card *card)
|
||||
|
||||
sdio_release_host(func);
|
||||
|
||||
/* Set fw_ready before queuing any commands so that
|
||||
* lbs_thread won't block from sending them to firmware.
|
||||
*/
|
||||
priv->fw_ready = 1;
|
||||
|
||||
/*
|
||||
* FUNC_INIT is required for SD8688 WLAN/BT multiple functions
|
||||
*/
|
||||
@@ -839,7 +844,6 @@ static void if_sdio_finish_power_on(struct if_sdio_card *card)
|
||||
netdev_alert(priv->dev, "CMD_FUNC_INIT cmd failed\n");
|
||||
}
|
||||
|
||||
priv->fw_ready = 1;
|
||||
wake_up(&card->pwron_waitq);
|
||||
|
||||
if (!card->started) {
|
||||
|
@@ -1117,10 +1117,9 @@ mwifiex_cmd_802_11_ad_hoc_join(struct mwifiex_private *priv,
|
||||
adhoc_join->bss_descriptor.bssid,
|
||||
adhoc_join->bss_descriptor.ssid);
|
||||
|
||||
for (i = 0; bss_desc->supported_rates[i] &&
|
||||
i < MWIFIEX_SUPPORTED_RATES;
|
||||
i++)
|
||||
;
|
||||
for (i = 0; i < MWIFIEX_SUPPORTED_RATES &&
|
||||
bss_desc->supported_rates[i]; i++)
|
||||
;
|
||||
rates_size = i;
|
||||
|
||||
/* Copy Data Rates from the Rates recorded in scan response */
|
||||
|
@@ -302,7 +302,7 @@ static int mwifiex_pm_wakeup_card(struct mwifiex_adapter *adapter)
|
||||
i++;
|
||||
usleep_range(10, 20);
|
||||
/* 50ms max wait */
|
||||
if (i == 50000)
|
||||
if (i == 5000)
|
||||
break;
|
||||
}
|
||||
|
||||
|
@@ -55,10 +55,10 @@ config RT61PCI
|
||||
|
||||
config RT2800PCI
|
||||
tristate "Ralink rt27xx/rt28xx/rt30xx (PCI/PCIe/PCMCIA) support"
|
||||
depends on PCI || RALINK_RT288X || RALINK_RT305X
|
||||
depends on PCI || SOC_RT288X || SOC_RT305X
|
||||
select RT2800_LIB
|
||||
select RT2X00_LIB_PCI if PCI
|
||||
select RT2X00_LIB_SOC if RALINK_RT288X || RALINK_RT305X
|
||||
select RT2X00_LIB_SOC if SOC_RT288X || SOC_RT305X
|
||||
select RT2X00_LIB_FIRMWARE
|
||||
select RT2X00_LIB_CRYPTO
|
||||
select CRC_CCITT
|
||||
|
@@ -89,7 +89,7 @@ static void rt2800pci_mcu_status(struct rt2x00_dev *rt2x00dev, const u8 token)
|
||||
rt2x00pci_register_write(rt2x00dev, H2M_MAILBOX_CID, ~0);
|
||||
}
|
||||
|
||||
#if defined(CONFIG_RALINK_RT288X) || defined(CONFIG_RALINK_RT305X)
|
||||
#if defined(CONFIG_SOC_RT288X) || defined(CONFIG_SOC_RT305X)
|
||||
static int rt2800pci_read_eeprom_soc(struct rt2x00_dev *rt2x00dev)
|
||||
{
|
||||
void __iomem *base_addr = ioremap(0x1F040000, EEPROM_SIZE);
|
||||
@@ -107,7 +107,7 @@ static inline int rt2800pci_read_eeprom_soc(struct rt2x00_dev *rt2x00dev)
|
||||
{
|
||||
return -ENOMEM;
|
||||
}
|
||||
#endif /* CONFIG_RALINK_RT288X || CONFIG_RALINK_RT305X */
|
||||
#endif /* CONFIG_SOC_RT288X || CONFIG_SOC_RT305X */
|
||||
|
||||
#ifdef CONFIG_PCI
|
||||
static void rt2800pci_eepromregister_read(struct eeprom_93cx6 *eeprom)
|
||||
@@ -1177,7 +1177,7 @@ MODULE_DEVICE_TABLE(pci, rt2800pci_device_table);
|
||||
#endif /* CONFIG_PCI */
|
||||
MODULE_LICENSE("GPL");
|
||||
|
||||
#if defined(CONFIG_RALINK_RT288X) || defined(CONFIG_RALINK_RT305X)
|
||||
#if defined(CONFIG_SOC_RT288X) || defined(CONFIG_SOC_RT305X)
|
||||
static int rt2800soc_probe(struct platform_device *pdev)
|
||||
{
|
||||
return rt2x00soc_probe(pdev, &rt2800pci_ops);
|
||||
@@ -1194,7 +1194,7 @@ static struct platform_driver rt2800soc_driver = {
|
||||
.suspend = rt2x00soc_suspend,
|
||||
.resume = rt2x00soc_resume,
|
||||
};
|
||||
#endif /* CONFIG_RALINK_RT288X || CONFIG_RALINK_RT305X */
|
||||
#endif /* CONFIG_SOC_RT288X || CONFIG_SOC_RT305X */
|
||||
|
||||
#ifdef CONFIG_PCI
|
||||
static int rt2800pci_probe(struct pci_dev *pci_dev,
|
||||
@@ -1217,7 +1217,7 @@ static int __init rt2800pci_init(void)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
#if defined(CONFIG_RALINK_RT288X) || defined(CONFIG_RALINK_RT305X)
|
||||
#if defined(CONFIG_SOC_RT288X) || defined(CONFIG_SOC_RT305X)
|
||||
ret = platform_driver_register(&rt2800soc_driver);
|
||||
if (ret)
|
||||
return ret;
|
||||
@@ -1225,7 +1225,7 @@ static int __init rt2800pci_init(void)
|
||||
#ifdef CONFIG_PCI
|
||||
ret = pci_register_driver(&rt2800pci_driver);
|
||||
if (ret) {
|
||||
#if defined(CONFIG_RALINK_RT288X) || defined(CONFIG_RALINK_RT305X)
|
||||
#if defined(CONFIG_SOC_RT288X) || defined(CONFIG_SOC_RT305X)
|
||||
platform_driver_unregister(&rt2800soc_driver);
|
||||
#endif
|
||||
return ret;
|
||||
@@ -1240,7 +1240,7 @@ static void __exit rt2800pci_exit(void)
|
||||
#ifdef CONFIG_PCI
|
||||
pci_unregister_driver(&rt2800pci_driver);
|
||||
#endif
|
||||
#if defined(CONFIG_RALINK_RT288X) || defined(CONFIG_RALINK_RT305X)
|
||||
#if defined(CONFIG_SOC_RT288X) || defined(CONFIG_SOC_RT305X)
|
||||
platform_driver_unregister(&rt2800soc_driver);
|
||||
#endif
|
||||
}
|
||||
|
@@ -1236,8 +1236,10 @@ static inline void rt2x00lib_set_if_combinations(struct rt2x00_dev *rt2x00dev)
|
||||
*/
|
||||
if_limit = &rt2x00dev->if_limits_ap;
|
||||
if_limit->max = rt2x00dev->ops->max_ap_intf;
|
||||
if_limit->types = BIT(NL80211_IFTYPE_AP) |
|
||||
BIT(NL80211_IFTYPE_MESH_POINT);
|
||||
if_limit->types = BIT(NL80211_IFTYPE_AP);
|
||||
#ifdef CONFIG_MAC80211_MESH
|
||||
if_limit->types |= BIT(NL80211_IFTYPE_MESH_POINT);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Build up AP interface combinations structure.
|
||||
@@ -1309,7 +1311,9 @@ int rt2x00lib_probe_dev(struct rt2x00_dev *rt2x00dev)
|
||||
rt2x00dev->hw->wiphy->interface_modes |=
|
||||
BIT(NL80211_IFTYPE_ADHOC) |
|
||||
BIT(NL80211_IFTYPE_AP) |
|
||||
#ifdef CONFIG_MAC80211_MESH
|
||||
BIT(NL80211_IFTYPE_MESH_POINT) |
|
||||
#endif
|
||||
BIT(NL80211_IFTYPE_WDS);
|
||||
|
||||
rt2x00dev->hw->wiphy->flags |= WIPHY_FLAG_IBSS_RSN;
|
||||
|
@@ -1377,74 +1377,57 @@ void rtl92cu_card_disable(struct ieee80211_hw *hw)
|
||||
|
||||
void rtl92cu_set_check_bssid(struct ieee80211_hw *hw, bool check_bssid)
|
||||
{
|
||||
/* dummy routine needed for callback from rtl_op_configure_filter() */
|
||||
struct rtl_priv *rtlpriv = rtl_priv(hw);
|
||||
struct rtl_hal *rtlhal = rtl_hal(rtlpriv);
|
||||
u32 reg_rcr = rtl_read_dword(rtlpriv, REG_RCR);
|
||||
|
||||
if (rtlpriv->psc.rfpwr_state != ERFON)
|
||||
return;
|
||||
|
||||
if (check_bssid) {
|
||||
u8 tmp;
|
||||
if (IS_NORMAL_CHIP(rtlhal->version)) {
|
||||
reg_rcr |= (RCR_CBSSID_DATA | RCR_CBSSID_BCN);
|
||||
tmp = BIT(4);
|
||||
} else {
|
||||
reg_rcr |= RCR_CBSSID;
|
||||
tmp = BIT(4) | BIT(5);
|
||||
}
|
||||
rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_RCR,
|
||||
(u8 *) (®_rcr));
|
||||
_rtl92cu_set_bcn_ctrl_reg(hw, 0, tmp);
|
||||
} else {
|
||||
u8 tmp;
|
||||
if (IS_NORMAL_CHIP(rtlhal->version)) {
|
||||
reg_rcr &= ~(RCR_CBSSID_DATA | RCR_CBSSID_BCN);
|
||||
tmp = BIT(4);
|
||||
} else {
|
||||
reg_rcr &= ~RCR_CBSSID;
|
||||
tmp = BIT(4) | BIT(5);
|
||||
}
|
||||
reg_rcr &= (~(RCR_CBSSID_DATA | RCR_CBSSID_BCN));
|
||||
rtlpriv->cfg->ops->set_hw_reg(hw,
|
||||
HW_VAR_RCR, (u8 *) (®_rcr));
|
||||
_rtl92cu_set_bcn_ctrl_reg(hw, tmp, 0);
|
||||
}
|
||||
}
|
||||
|
||||
/*========================================================================== */
|
||||
|
||||
static void _rtl92cu_set_check_bssid(struct ieee80211_hw *hw,
|
||||
enum nl80211_iftype type)
|
||||
{
|
||||
struct rtl_priv *rtlpriv = rtl_priv(hw);
|
||||
u32 reg_rcr = rtl_read_dword(rtlpriv, REG_RCR);
|
||||
struct rtl_hal *rtlhal = rtl_hal(rtlpriv);
|
||||
struct rtl_phy *rtlphy = &(rtlpriv->phy);
|
||||
u8 filterout_non_associated_bssid = false;
|
||||
|
||||
switch (type) {
|
||||
case NL80211_IFTYPE_ADHOC:
|
||||
case NL80211_IFTYPE_STATION:
|
||||
filterout_non_associated_bssid = true;
|
||||
break;
|
||||
case NL80211_IFTYPE_UNSPECIFIED:
|
||||
case NL80211_IFTYPE_AP:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (filterout_non_associated_bssid) {
|
||||
if (IS_NORMAL_CHIP(rtlhal->version)) {
|
||||
switch (rtlphy->current_io_type) {
|
||||
case IO_CMD_RESUME_DM_BY_SCAN:
|
||||
reg_rcr |= (RCR_CBSSID_DATA | RCR_CBSSID_BCN);
|
||||
rtlpriv->cfg->ops->set_hw_reg(hw,
|
||||
HW_VAR_RCR, (u8 *)(®_rcr));
|
||||
/* enable update TSF */
|
||||
_rtl92cu_set_bcn_ctrl_reg(hw, 0, BIT(4));
|
||||
break;
|
||||
case IO_CMD_PAUSE_DM_BY_SCAN:
|
||||
reg_rcr &= ~(RCR_CBSSID_DATA | RCR_CBSSID_BCN);
|
||||
rtlpriv->cfg->ops->set_hw_reg(hw,
|
||||
HW_VAR_RCR, (u8 *)(®_rcr));
|
||||
/* disable update TSF */
|
||||
_rtl92cu_set_bcn_ctrl_reg(hw, BIT(4), 0);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
reg_rcr |= (RCR_CBSSID);
|
||||
rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_RCR,
|
||||
(u8 *)(®_rcr));
|
||||
_rtl92cu_set_bcn_ctrl_reg(hw, 0, (BIT(4)|BIT(5)));
|
||||
}
|
||||
} else if (filterout_non_associated_bssid == false) {
|
||||
if (IS_NORMAL_CHIP(rtlhal->version)) {
|
||||
reg_rcr &= (~(RCR_CBSSID_DATA | RCR_CBSSID_BCN));
|
||||
rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_RCR,
|
||||
(u8 *)(®_rcr));
|
||||
_rtl92cu_set_bcn_ctrl_reg(hw, BIT(4), 0);
|
||||
} else {
|
||||
reg_rcr &= (~RCR_CBSSID);
|
||||
rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_RCR,
|
||||
(u8 *)(®_rcr));
|
||||
_rtl92cu_set_bcn_ctrl_reg(hw, (BIT(4)|BIT(5)), 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int rtl92cu_set_network_type(struct ieee80211_hw *hw, enum nl80211_iftype type)
|
||||
{
|
||||
struct rtl_priv *rtlpriv = rtl_priv(hw);
|
||||
|
||||
if (_rtl92cu_set_media_status(hw, type))
|
||||
return -EOPNOTSUPP;
|
||||
_rtl92cu_set_check_bssid(hw, type);
|
||||
|
||||
if (rtlpriv->mac80211.link_state == MAC80211_LINKED) {
|
||||
if (type != NL80211_IFTYPE_AP)
|
||||
rtl92cu_set_check_bssid(hw, true);
|
||||
} else {
|
||||
rtl92cu_set_check_bssid(hw, false);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -2058,8 +2041,6 @@ void rtl92cu_update_hal_rate_table(struct ieee80211_hw *hw,
|
||||
(shortgi_rate << 4) | (shortgi_rate);
|
||||
}
|
||||
rtl_write_dword(rtlpriv, REG_ARFR0 + ratr_index * 4, ratr_value);
|
||||
RT_TRACE(rtlpriv, COMP_RATR, DBG_DMESG, "%x\n",
|
||||
rtl_read_dword(rtlpriv, REG_ARFR0));
|
||||
}
|
||||
|
||||
void rtl92cu_update_hal_rate_mask(struct ieee80211_hw *hw, u8 rssi_level)
|
||||
|
Reference in New Issue
Block a user