Commit 6a489c48 authored by David S. Miller's avatar David S. Miller

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

John W. Linville says:

====================
Please pull this batch of fixes intended for the 3.15 stream!

Chun-Yeow Yeoh gives us an ath9k_htc fix so that mac80211 can report
last_tx_rate correctly for those devices..

Fariya Fatima has a number of small fixes for things identified by
the static analysis folks in the new rsi driver.

Felix Fietkau brings an ath9k fix to better support some older chips,
and a fix for a scheduling while atomic bug introduced by an earlier
patch.

Janusz Dziedzic produced an ath9k fix to only enable DFS when a
related build option is selected.

Paul Bolle removes some dead code in rtlwifi.

Rafał Miłecki fixes some b43 code that was accessing some registers
with operations for the wrong register width.

Please let me know if there are problems!
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 45cdf9f3 029d3ac9
...@@ -1004,11 +1004,9 @@ static bool ar5008_hw_ani_control_new(struct ath_hw *ah, ...@@ -1004,11 +1004,9 @@ static bool ar5008_hw_ani_control_new(struct ath_hw *ah,
case ATH9K_ANI_FIRSTEP_LEVEL:{ case ATH9K_ANI_FIRSTEP_LEVEL:{
u32 level = param; u32 level = param;
value = level * 2; value = level;
REG_RMW_FIELD(ah, AR_PHY_FIND_SIG, REG_RMW_FIELD(ah, AR_PHY_FIND_SIG,
AR_PHY_FIND_SIG_FIRSTEP, value); AR_PHY_FIND_SIG_FIRSTEP, value);
REG_RMW_FIELD(ah, AR_PHY_FIND_SIG_LOW,
AR_PHY_FIND_SIG_FIRSTEP_LOW, value);
if (level != aniState->firstepLevel) { if (level != aniState->firstepLevel) {
ath_dbg(common, ANI, ath_dbg(common, ANI,
......
...@@ -312,10 +312,9 @@ static void ath9k_csa_update_vif(void *data, u8 *mac, struct ieee80211_vif *vif) ...@@ -312,10 +312,9 @@ static void ath9k_csa_update_vif(void *data, u8 *mac, struct ieee80211_vif *vif)
void ath9k_csa_update(struct ath_softc *sc) void ath9k_csa_update(struct ath_softc *sc)
{ {
ieee80211_iterate_active_interfaces(sc->hw, ieee80211_iterate_active_interfaces_atomic(sc->hw,
IEEE80211_IFACE_ITER_NORMAL, IEEE80211_IFACE_ITER_NORMAL,
ath9k_csa_update_vif, ath9k_csa_update_vif, sc);
sc);
} }
void ath9k_beacon_tasklet(unsigned long data) void ath9k_beacon_tasklet(unsigned long data)
......
...@@ -471,8 +471,11 @@ static void ath9k_htc_tx_process(struct ath9k_htc_priv *priv, ...@@ -471,8 +471,11 @@ static void ath9k_htc_tx_process(struct ath9k_htc_priv *priv,
if (!txok || !vif || !txs) if (!txok || !vif || !txs)
goto send_mac80211; goto send_mac80211;
if (txs->ts_flags & ATH9K_HTC_TXSTAT_ACK) if (txs->ts_flags & ATH9K_HTC_TXSTAT_ACK) {
tx_info->flags |= IEEE80211_TX_STAT_ACK; tx_info->flags |= IEEE80211_TX_STAT_ACK;
if (tx_info->flags & IEEE80211_TX_CTL_AMPDU)
tx_info->flags |= IEEE80211_TX_STAT_AMPDU;
}
if (txs->ts_flags & ATH9K_HTC_TXSTAT_FILT) if (txs->ts_flags & ATH9K_HTC_TXSTAT_FILT)
tx_info->flags |= IEEE80211_TX_STAT_TX_FILTERED; tx_info->flags |= IEEE80211_TX_STAT_TX_FILTERED;
......
...@@ -670,6 +670,7 @@ static const struct ieee80211_iface_combination if_comb[] = { ...@@ -670,6 +670,7 @@ static const struct ieee80211_iface_combination if_comb[] = {
.num_different_channels = 1, .num_different_channels = 1,
.beacon_int_infra_match = true, .beacon_int_infra_match = true,
}, },
#ifdef CONFIG_ATH9K_DFS_CERTIFIED
{ {
.limits = if_dfs_limits, .limits = if_dfs_limits,
.n_limits = ARRAY_SIZE(if_dfs_limits), .n_limits = ARRAY_SIZE(if_dfs_limits),
...@@ -679,6 +680,7 @@ static const struct ieee80211_iface_combination if_comb[] = { ...@@ -679,6 +680,7 @@ static const struct ieee80211_iface_combination if_comb[] = {
.radar_detect_widths = BIT(NL80211_CHAN_WIDTH_20_NOHT) | .radar_detect_widths = BIT(NL80211_CHAN_WIDTH_20_NOHT) |
BIT(NL80211_CHAN_WIDTH_20), BIT(NL80211_CHAN_WIDTH_20),
} }
#endif
}; };
static void ath9k_set_hw_capab(struct ath_softc *sc, struct ieee80211_hw *hw) static void ath9k_set_hw_capab(struct ath_softc *sc, struct ieee80211_hw *hw)
......
...@@ -5176,22 +5176,22 @@ static void b43_nphy_channel_setup(struct b43_wldev *dev, ...@@ -5176,22 +5176,22 @@ static void b43_nphy_channel_setup(struct b43_wldev *dev,
int ch = new_channel->hw_value; int ch = new_channel->hw_value;
u16 old_band_5ghz; u16 old_band_5ghz;
u32 tmp32; u16 tmp16;
old_band_5ghz = old_band_5ghz =
b43_phy_read(dev, B43_NPHY_BANDCTL) & B43_NPHY_BANDCTL_5GHZ; b43_phy_read(dev, B43_NPHY_BANDCTL) & B43_NPHY_BANDCTL_5GHZ;
if (new_channel->band == IEEE80211_BAND_5GHZ && !old_band_5ghz) { if (new_channel->band == IEEE80211_BAND_5GHZ && !old_band_5ghz) {
tmp32 = b43_read32(dev, B43_MMIO_PSM_PHY_HDR); tmp16 = b43_read16(dev, B43_MMIO_PSM_PHY_HDR);
b43_write32(dev, B43_MMIO_PSM_PHY_HDR, tmp32 | 4); b43_write16(dev, B43_MMIO_PSM_PHY_HDR, tmp16 | 4);
b43_phy_set(dev, B43_PHY_B_BBCFG, 0xC000); b43_phy_set(dev, B43_PHY_B_BBCFG, 0xC000);
b43_write32(dev, B43_MMIO_PSM_PHY_HDR, tmp32); b43_write16(dev, B43_MMIO_PSM_PHY_HDR, tmp16);
b43_phy_set(dev, B43_NPHY_BANDCTL, B43_NPHY_BANDCTL_5GHZ); b43_phy_set(dev, B43_NPHY_BANDCTL, B43_NPHY_BANDCTL_5GHZ);
} else if (new_channel->band == IEEE80211_BAND_2GHZ && old_band_5ghz) { } else if (new_channel->band == IEEE80211_BAND_2GHZ && old_band_5ghz) {
b43_phy_mask(dev, B43_NPHY_BANDCTL, ~B43_NPHY_BANDCTL_5GHZ); b43_phy_mask(dev, B43_NPHY_BANDCTL, ~B43_NPHY_BANDCTL_5GHZ);
tmp32 = b43_read32(dev, B43_MMIO_PSM_PHY_HDR); tmp16 = b43_read16(dev, B43_MMIO_PSM_PHY_HDR);
b43_write32(dev, B43_MMIO_PSM_PHY_HDR, tmp32 | 4); b43_write16(dev, B43_MMIO_PSM_PHY_HDR, tmp16 | 4);
b43_phy_mask(dev, B43_PHY_B_BBCFG, 0x3FFF); b43_phy_mask(dev, B43_PHY_B_BBCFG, 0x3FFF);
b43_write32(dev, B43_MMIO_PSM_PHY_HDR, tmp32); b43_write16(dev, B43_MMIO_PSM_PHY_HDR, tmp16);
} }
b43_chantab_phy_upload(dev, e); b43_chantab_phy_upload(dev, e);
......
...@@ -102,10 +102,10 @@ static u8 rsi_core_determine_hal_queue(struct rsi_common *common) ...@@ -102,10 +102,10 @@ static u8 rsi_core_determine_hal_queue(struct rsi_common *common)
} }
get_queue_num: get_queue_num:
q_num = 0;
recontend_queue = false; recontend_queue = false;
q_num = rsi_determine_min_weight_queue(common); q_num = rsi_determine_min_weight_queue(common);
q_len = skb_queue_len(&common->tx_queue[ii]); q_len = skb_queue_len(&common->tx_queue[ii]);
ii = q_num; ii = q_num;
...@@ -118,7 +118,9 @@ static u8 rsi_core_determine_hal_queue(struct rsi_common *common) ...@@ -118,7 +118,9 @@ static u8 rsi_core_determine_hal_queue(struct rsi_common *common)
} }
} }
common->tx_qinfo[q_num].pkt_contended = 0; if (q_num < NUM_EDCA_QUEUES)
common->tx_qinfo[q_num].pkt_contended = 0;
/* Adjust the back off values for all queues again */ /* Adjust the back off values for all queues again */
recontend_queue = rsi_recalculate_weights(common); recontend_queue = rsi_recalculate_weights(common);
......
...@@ -289,32 +289,29 @@ int rsi_init_dbgfs(struct rsi_hw *adapter) ...@@ -289,32 +289,29 @@ int rsi_init_dbgfs(struct rsi_hw *adapter)
const struct rsi_dbg_files *files; const struct rsi_dbg_files *files;
dev_dbgfs = kzalloc(sizeof(*dev_dbgfs), GFP_KERNEL); dev_dbgfs = kzalloc(sizeof(*dev_dbgfs), GFP_KERNEL);
if (!dev_dbgfs)
return -ENOMEM;
adapter->dfsentry = dev_dbgfs; adapter->dfsentry = dev_dbgfs;
snprintf(devdir, sizeof(devdir), "%s", snprintf(devdir, sizeof(devdir), "%s",
wiphy_name(adapter->hw->wiphy)); wiphy_name(adapter->hw->wiphy));
dev_dbgfs->subdir = debugfs_create_dir(devdir, NULL);
if (IS_ERR(dev_dbgfs->subdir)) { dev_dbgfs->subdir = debugfs_create_dir(devdir, NULL);
if (dev_dbgfs->subdir == ERR_PTR(-ENODEV))
rsi_dbg(ERR_ZONE,
"%s:Debugfs has not been mounted\n", __func__);
else
rsi_dbg(ERR_ZONE, "debugfs:%s not created\n", devdir);
adapter->dfsentry = NULL; if (!dev_dbgfs->subdir) {
kfree(dev_dbgfs); kfree(dev_dbgfs);
return (int)PTR_ERR(dev_dbgfs->subdir); return -ENOMEM;
} else { }
for (ii = 0; ii < adapter->num_debugfs_entries; ii++) {
files = &dev_debugfs_files[ii]; for (ii = 0; ii < adapter->num_debugfs_entries; ii++) {
dev_dbgfs->rsi_files[ii] = files = &dev_debugfs_files[ii];
debugfs_create_file(files->name, dev_dbgfs->rsi_files[ii] =
files->perms, debugfs_create_file(files->name,
dev_dbgfs->subdir, files->perms,
common, dev_dbgfs->subdir,
&files->fops); common,
} &files->fops);
} }
return 0; return 0;
} }
......
...@@ -738,7 +738,7 @@ int rsi_hal_load_key(struct rsi_common *common, ...@@ -738,7 +738,7 @@ int rsi_hal_load_key(struct rsi_common *common,
* *
* Return: 0 on success, corresponding error code on failure. * Return: 0 on success, corresponding error code on failure.
*/ */
static u8 rsi_load_bootup_params(struct rsi_common *common) static int rsi_load_bootup_params(struct rsi_common *common)
{ {
struct sk_buff *skb; struct sk_buff *skb;
struct rsi_boot_params *boot_params; struct rsi_boot_params *boot_params;
...@@ -1272,6 +1272,7 @@ int rsi_mgmt_pkt_recv(struct rsi_common *common, u8 *msg) ...@@ -1272,6 +1272,7 @@ int rsi_mgmt_pkt_recv(struct rsi_common *common, u8 *msg)
{ {
s32 msg_len = (le16_to_cpu(*(__le16 *)&msg[0]) & 0x0fff); s32 msg_len = (le16_to_cpu(*(__le16 *)&msg[0]) & 0x0fff);
u16 msg_type = (msg[2]); u16 msg_type = (msg[2]);
int ret;
rsi_dbg(FSM_ZONE, "%s: Msg Len: %d, Msg Type: %4x\n", rsi_dbg(FSM_ZONE, "%s: Msg Len: %d, Msg Type: %4x\n",
__func__, msg_len, msg_type); __func__, msg_len, msg_type);
...@@ -1284,8 +1285,9 @@ int rsi_mgmt_pkt_recv(struct rsi_common *common, u8 *msg) ...@@ -1284,8 +1285,9 @@ int rsi_mgmt_pkt_recv(struct rsi_common *common, u8 *msg)
if (common->fsm_state == FSM_CARD_NOT_READY) { if (common->fsm_state == FSM_CARD_NOT_READY) {
rsi_set_default_parameters(common); rsi_set_default_parameters(common);
if (rsi_load_bootup_params(common)) ret = rsi_load_bootup_params(common);
return -ENOMEM; if (ret)
return ret;
else else
common->fsm_state = FSM_BOOT_PARAMS_SENT; common->fsm_state = FSM_BOOT_PARAMS_SENT;
} else { } else {
......
...@@ -756,12 +756,13 @@ static int rsi_probe(struct sdio_func *pfunction, ...@@ -756,12 +756,13 @@ static int rsi_probe(struct sdio_func *pfunction,
static void rsi_disconnect(struct sdio_func *pfunction) static void rsi_disconnect(struct sdio_func *pfunction)
{ {
struct rsi_hw *adapter = sdio_get_drvdata(pfunction); struct rsi_hw *adapter = sdio_get_drvdata(pfunction);
struct rsi_91x_sdiodev *dev = struct rsi_91x_sdiodev *dev;
(struct rsi_91x_sdiodev *)adapter->rsi_dev;
if (!adapter) if (!adapter)
return; return;
dev = (struct rsi_91x_sdiodev *)adapter->rsi_dev;
dev->write_fail = 2; dev->write_fail = 2;
rsi_mac80211_detach(adapter); rsi_mac80211_detach(adapter);
......
...@@ -247,7 +247,7 @@ static int rsi_process_pkt(struct rsi_common *common) ...@@ -247,7 +247,7 @@ static int rsi_process_pkt(struct rsi_common *common)
if (!common->rx_data_pkt) { if (!common->rx_data_pkt) {
rsi_dbg(ERR_ZONE, "%s: Failed in memory allocation\n", rsi_dbg(ERR_ZONE, "%s: Failed in memory allocation\n",
__func__); __func__);
return -1; return -ENOMEM;
} }
status = rsi_sdio_host_intf_read_pkt(adapter, status = rsi_sdio_host_intf_read_pkt(adapter,
...@@ -260,12 +260,10 @@ static int rsi_process_pkt(struct rsi_common *common) ...@@ -260,12 +260,10 @@ static int rsi_process_pkt(struct rsi_common *common)
} }
status = rsi_read_pkt(common, rcv_pkt_len); status = rsi_read_pkt(common, rcv_pkt_len);
kfree(common->rx_data_pkt);
return status;
fail: fail:
kfree(common->rx_data_pkt); kfree(common->rx_data_pkt);
return -1; return status;
} }
/** /**
......
...@@ -154,24 +154,30 @@ static int rsi_usb_reg_read(struct usb_device *usbdev, ...@@ -154,24 +154,30 @@ static int rsi_usb_reg_read(struct usb_device *usbdev,
u16 *value, u16 *value,
u16 len) u16 len)
{ {
u8 temp_buf[4]; u8 *buf;
int status = 0; int status = -ENOMEM;
buf = kmalloc(0x04, GFP_KERNEL);
if (!buf)
return status;
status = usb_control_msg(usbdev, status = usb_control_msg(usbdev,
usb_rcvctrlpipe(usbdev, 0), usb_rcvctrlpipe(usbdev, 0),
USB_VENDOR_REGISTER_READ, USB_VENDOR_REGISTER_READ,
USB_TYPE_VENDOR, USB_TYPE_VENDOR,
((reg & 0xffff0000) >> 16), (reg & 0xffff), ((reg & 0xffff0000) >> 16), (reg & 0xffff),
(void *)temp_buf, (void *)buf,
len, len,
HZ * 5); HZ * 5);
*value = (temp_buf[0] | (temp_buf[1] << 8)); *value = (buf[0] | (buf[1] << 8));
if (status < 0) { if (status < 0) {
rsi_dbg(ERR_ZONE, rsi_dbg(ERR_ZONE,
"%s: Reg read failed with error code :%d\n", "%s: Reg read failed with error code :%d\n",
__func__, status); __func__, status);
} }
kfree(buf);
return status; return status;
} }
...@@ -190,8 +196,12 @@ static int rsi_usb_reg_write(struct usb_device *usbdev, ...@@ -190,8 +196,12 @@ static int rsi_usb_reg_write(struct usb_device *usbdev,
u16 value, u16 value,
u16 len) u16 len)
{ {
u8 usb_reg_buf[4]; u8 *usb_reg_buf;
int status = 0; int status = -ENOMEM;
usb_reg_buf = kmalloc(0x04, GFP_KERNEL);
if (!usb_reg_buf)
return status;
usb_reg_buf[0] = (value & 0x00ff); usb_reg_buf[0] = (value & 0x00ff);
usb_reg_buf[1] = (value & 0xff00) >> 8; usb_reg_buf[1] = (value & 0xff00) >> 8;
...@@ -212,6 +222,8 @@ static int rsi_usb_reg_write(struct usb_device *usbdev, ...@@ -212,6 +222,8 @@ static int rsi_usb_reg_write(struct usb_device *usbdev,
"%s: Reg write failed with error code :%d\n", "%s: Reg write failed with error code :%d\n",
__func__, status); __func__, status);
} }
kfree(usb_reg_buf);
return status; return status;
} }
...@@ -286,7 +298,7 @@ int rsi_usb_write_register_multiple(struct rsi_hw *adapter, ...@@ -286,7 +298,7 @@ int rsi_usb_write_register_multiple(struct rsi_hw *adapter,
return -ENOMEM; return -ENOMEM;
while (count) { while (count) {
transfer = min_t(int, count, 4096); transfer = (u8)(min_t(u32, count, 4096));
memcpy(buf, data, transfer); memcpy(buf, data, transfer);
status = usb_control_msg(dev->usbdev, status = usb_control_msg(dev->usbdev,
usb_sndctrlpipe(dev->usbdev, 0), usb_sndctrlpipe(dev->usbdev, 0),
......
...@@ -625,17 +625,7 @@ bool exhalbtc_initlize_variables(struct rtl_priv *adapter) ...@@ -625,17 +625,7 @@ bool exhalbtc_initlize_variables(struct rtl_priv *adapter)
else else
btcoexist->binded = true; btcoexist->binded = true;
#if (defined(CONFIG_PCI_HCI))
btcoexist->chip_interface = BTC_INTF_PCI;
#elif (defined(CONFIG_USB_HCI))
btcoexist->chip_interface = BTC_INTF_USB;
#elif (defined(CONFIG_SDIO_HCI))
btcoexist->chip_interface = BTC_INTF_SDIO;
#elif (defined(CONFIG_GSPI_HCI))
btcoexist->chip_interface = BTC_INTF_GSPI;
#else
btcoexist->chip_interface = BTC_INTF_UNKNOWN; btcoexist->chip_interface = BTC_INTF_UNKNOWN;
#endif
if (NULL == btcoexist->adapter) if (NULL == btcoexist->adapter)
btcoexist->adapter = adapter; btcoexist->adapter = adapter;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment