Commit 22f0d2d1 authored by John W. Linville's avatar John W. Linville

Merge branch 'master' of...

Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless into for-davem
parents 0f7dd1aa 48c3e371
...@@ -523,9 +523,9 @@ static int prism2_ioctl_giwaplist(struct net_device *dev, ...@@ -523,9 +523,9 @@ static int prism2_ioctl_giwaplist(struct net_device *dev,
data->length = prism2_ap_get_sta_qual(local, addr, qual, IW_MAX_AP, 1); data->length = prism2_ap_get_sta_qual(local, addr, qual, IW_MAX_AP, 1);
memcpy(extra, &addr, sizeof(struct sockaddr) * data->length); memcpy(extra, addr, sizeof(struct sockaddr) * data->length);
data->flags = 1; /* has quality information */ data->flags = 1; /* has quality information */
memcpy(extra + sizeof(struct sockaddr) * data->length, &qual, memcpy(extra + sizeof(struct sockaddr) * data->length, qual,
sizeof(struct iw_quality) * data->length); sizeof(struct iw_quality) * data->length);
kfree(addr); kfree(addr);
......
...@@ -1068,7 +1068,10 @@ void iwl_chswitch_done(struct iwl_priv *priv, bool is_success) ...@@ -1068,7 +1068,10 @@ void iwl_chswitch_done(struct iwl_priv *priv, bool is_success)
if (test_bit(STATUS_EXIT_PENDING, &priv->status)) if (test_bit(STATUS_EXIT_PENDING, &priv->status))
return; return;
if (test_and_clear_bit(STATUS_CHANNEL_SWITCH_PENDING, &priv->status)) if (!test_and_clear_bit(STATUS_CHANNEL_SWITCH_PENDING, &priv->status))
return;
if (ctx->vif)
ieee80211_chswitch_done(ctx->vif, is_success); ieee80211_chswitch_done(ctx->vif, is_success);
} }
......
...@@ -97,8 +97,6 @@ ...@@ -97,8 +97,6 @@
#define APMG_PCIDEV_STT_VAL_L1_ACT_DIS (0x00000800) #define APMG_PCIDEV_STT_VAL_L1_ACT_DIS (0x00000800)
#define APMG_RTC_INT_STT_RFKILL (0x10000000)
/* Device system time */ /* Device system time */
#define DEVICE_SYSTEM_TIME_REG 0xA0206C #define DEVICE_SYSTEM_TIME_REG 0xA0206C
......
...@@ -138,6 +138,20 @@ static void iwl_mvm_roc_finished(struct iwl_mvm *mvm) ...@@ -138,6 +138,20 @@ static void iwl_mvm_roc_finished(struct iwl_mvm *mvm)
schedule_work(&mvm->roc_done_wk); schedule_work(&mvm->roc_done_wk);
} }
static bool iwl_mvm_te_check_disconnect(struct iwl_mvm *mvm,
struct ieee80211_vif *vif,
const char *errmsg)
{
if (vif->type != NL80211_IFTYPE_STATION)
return false;
if (vif->bss_conf.assoc && vif->bss_conf.dtim_period)
return false;
if (errmsg)
IWL_ERR(mvm, "%s\n", errmsg);
ieee80211_connection_loss(vif);
return true;
}
/* /*
* Handles a FW notification for an event that is known to the driver. * Handles a FW notification for an event that is known to the driver.
* *
...@@ -163,8 +177,13 @@ static void iwl_mvm_te_handle_notif(struct iwl_mvm *mvm, ...@@ -163,8 +177,13 @@ static void iwl_mvm_te_handle_notif(struct iwl_mvm *mvm,
* P2P Device discoveribility, while there are other higher priority * P2P Device discoveribility, while there are other higher priority
* events in the system). * events in the system).
*/ */
WARN_ONCE(!le32_to_cpu(notif->status), if (WARN_ONCE(!le32_to_cpu(notif->status),
"Failed to schedule time event\n"); "Failed to schedule time event\n")) {
if (iwl_mvm_te_check_disconnect(mvm, te_data->vif, NULL)) {
iwl_mvm_te_clear_data(mvm, te_data);
return;
}
}
if (le32_to_cpu(notif->action) & TE_NOTIF_HOST_EVENT_END) { if (le32_to_cpu(notif->action) & TE_NOTIF_HOST_EVENT_END) {
IWL_DEBUG_TE(mvm, IWL_DEBUG_TE(mvm,
...@@ -180,14 +199,8 @@ static void iwl_mvm_te_handle_notif(struct iwl_mvm *mvm, ...@@ -180,14 +199,8 @@ static void iwl_mvm_te_handle_notif(struct iwl_mvm *mvm,
* By now, we should have finished association * By now, we should have finished association
* and know the dtim period. * and know the dtim period.
*/ */
if (te_data->vif->type == NL80211_IFTYPE_STATION && iwl_mvm_te_check_disconnect(mvm, te_data->vif,
(!te_data->vif->bss_conf.assoc || "No assocation and the time event is over already...");
!te_data->vif->bss_conf.dtim_period)) {
IWL_ERR(mvm,
"No assocation and the time event is over already...\n");
ieee80211_connection_loss(te_data->vif);
}
iwl_mvm_te_clear_data(mvm, te_data); iwl_mvm_te_clear_data(mvm, te_data);
} else if (le32_to_cpu(notif->action) & TE_NOTIF_HOST_EVENT_START) { } else if (le32_to_cpu(notif->action) & TE_NOTIF_HOST_EVENT_START) {
te_data->running = true; te_data->running = true;
......
...@@ -888,14 +888,6 @@ irqreturn_t iwl_pcie_irq_handler(int irq, void *dev_id) ...@@ -888,14 +888,6 @@ irqreturn_t iwl_pcie_irq_handler(int irq, void *dev_id)
iwl_op_mode_hw_rf_kill(trans->op_mode, hw_rfkill); iwl_op_mode_hw_rf_kill(trans->op_mode, hw_rfkill);
if (hw_rfkill) { if (hw_rfkill) {
/*
* Clear the interrupt in APMG if the NIC is going down.
* Note that when the NIC exits RFkill (else branch), we
* can't access prph and the NIC will be reset in
* start_hw anyway.
*/
iwl_write_prph(trans, APMG_RTC_INT_STT_REG,
APMG_RTC_INT_STT_RFKILL);
set_bit(STATUS_RFKILL, &trans_pcie->status); set_bit(STATUS_RFKILL, &trans_pcie->status);
if (test_and_clear_bit(STATUS_HCMD_ACTIVE, if (test_and_clear_bit(STATUS_HCMD_ACTIVE,
&trans_pcie->status)) &trans_pcie->status))
......
...@@ -1502,16 +1502,16 @@ struct iwl_trans *iwl_trans_pcie_alloc(struct pci_dev *pdev, ...@@ -1502,16 +1502,16 @@ struct iwl_trans *iwl_trans_pcie_alloc(struct pci_dev *pdev,
spin_lock_init(&trans_pcie->reg_lock); spin_lock_init(&trans_pcie->reg_lock);
init_waitqueue_head(&trans_pcie->ucode_write_waitq); init_waitqueue_head(&trans_pcie->ucode_write_waitq);
/* W/A - seems to solve weird behavior. We need to remove this if we
* don't want to stay in L1 all the time. This wastes a lot of power */
pci_disable_link_state(pdev, PCIE_LINK_STATE_L0S | PCIE_LINK_STATE_L1 |
PCIE_LINK_STATE_CLKPM);
if (pci_enable_device(pdev)) { if (pci_enable_device(pdev)) {
err = -ENODEV; err = -ENODEV;
goto out_no_pci; goto out_no_pci;
} }
/* W/A - seems to solve weird behavior. We need to remove this if we
* don't want to stay in L1 all the time. This wastes a lot of power */
pci_disable_link_state(pdev, PCIE_LINK_STATE_L0S | PCIE_LINK_STATE_L1 |
PCIE_LINK_STATE_CLKPM);
pci_set_master(pdev); pci_set_master(pdev);
err = pci_set_dma_mask(pdev, DMA_BIT_MASK(36)); err = pci_set_dma_mask(pdev, DMA_BIT_MASK(36));
......
...@@ -98,10 +98,12 @@ static int zd1201_fw_upload(struct usb_device *dev, int apfw) ...@@ -98,10 +98,12 @@ static int zd1201_fw_upload(struct usb_device *dev, int apfw)
goto exit; goto exit;
err = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0), 0x4, err = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0), 0x4,
USB_DIR_IN | 0x40, 0,0, &ret, sizeof(ret), ZD1201_FW_TIMEOUT); USB_DIR_IN | 0x40, 0, 0, buf, sizeof(ret), ZD1201_FW_TIMEOUT);
if (err < 0) if (err < 0)
goto exit; goto exit;
memcpy(&ret, buf, sizeof(ret));
if (ret & 0x80) { if (ret & 0x80) {
err = -EIO; err = -EIO;
goto exit; goto exit;
......
...@@ -2622,8 +2622,8 @@ static int nl80211_get_key(struct sk_buff *skb, struct genl_info *info) ...@@ -2622,8 +2622,8 @@ static int nl80211_get_key(struct sk_buff *skb, struct genl_info *info)
hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0, hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0,
NL80211_CMD_NEW_KEY); NL80211_CMD_NEW_KEY);
if (IS_ERR(hdr)) if (!hdr)
return PTR_ERR(hdr); return -ENOBUFS;
cookie.msg = msg; cookie.msg = msg;
cookie.idx = key_idx; cookie.idx = key_idx;
...@@ -6507,6 +6507,9 @@ static int nl80211_testmode_dump(struct sk_buff *skb, ...@@ -6507,6 +6507,9 @@ static int nl80211_testmode_dump(struct sk_buff *skb,
NL80211_CMD_TESTMODE); NL80211_CMD_TESTMODE);
struct nlattr *tmdata; struct nlattr *tmdata;
if (!hdr)
break;
if (nla_put_u32(skb, NL80211_ATTR_WIPHY, phy_idx)) { if (nla_put_u32(skb, NL80211_ATTR_WIPHY, phy_idx)) {
genlmsg_cancel(skb, hdr); genlmsg_cancel(skb, hdr);
break; break;
...@@ -6951,9 +6954,8 @@ static int nl80211_remain_on_channel(struct sk_buff *skb, ...@@ -6951,9 +6954,8 @@ static int nl80211_remain_on_channel(struct sk_buff *skb,
hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0, hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0,
NL80211_CMD_REMAIN_ON_CHANNEL); NL80211_CMD_REMAIN_ON_CHANNEL);
if (!hdr) {
if (IS_ERR(hdr)) { err = -ENOBUFS;
err = PTR_ERR(hdr);
goto free_msg; goto free_msg;
} }
...@@ -7251,9 +7253,8 @@ static int nl80211_tx_mgmt(struct sk_buff *skb, struct genl_info *info) ...@@ -7251,9 +7253,8 @@ static int nl80211_tx_mgmt(struct sk_buff *skb, struct genl_info *info)
hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0, hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0,
NL80211_CMD_FRAME); NL80211_CMD_FRAME);
if (!hdr) {
if (IS_ERR(hdr)) { err = -ENOBUFS;
err = PTR_ERR(hdr);
goto free_msg; goto free_msg;
} }
} }
...@@ -8132,9 +8133,8 @@ static int nl80211_probe_client(struct sk_buff *skb, ...@@ -8132,9 +8133,8 @@ static int nl80211_probe_client(struct sk_buff *skb,
hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0, hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0,
NL80211_CMD_PROBE_CLIENT); NL80211_CMD_PROBE_CLIENT);
if (!hdr) {
if (IS_ERR(hdr)) { err = -ENOBUFS;
err = PTR_ERR(hdr);
goto free_msg; goto free_msg;
} }
......
...@@ -976,21 +976,19 @@ int cfg80211_disconnect(struct cfg80211_registered_device *rdev, ...@@ -976,21 +976,19 @@ int cfg80211_disconnect(struct cfg80211_registered_device *rdev,
struct net_device *dev, u16 reason, bool wextev) struct net_device *dev, u16 reason, bool wextev)
{ {
struct wireless_dev *wdev = dev->ieee80211_ptr; struct wireless_dev *wdev = dev->ieee80211_ptr;
int err; int err = 0;
ASSERT_WDEV_LOCK(wdev); ASSERT_WDEV_LOCK(wdev);
kfree(wdev->connect_keys); kfree(wdev->connect_keys);
wdev->connect_keys = NULL; wdev->connect_keys = NULL;
if (wdev->conn) { if (wdev->conn)
err = cfg80211_sme_disconnect(wdev, reason); err = cfg80211_sme_disconnect(wdev, reason);
} else if (!rdev->ops->disconnect) { else if (!rdev->ops->disconnect)
cfg80211_mlme_down(rdev, dev); cfg80211_mlme_down(rdev, dev);
err = 0; else if (wdev->current_bss)
} else {
err = rdev_disconnect(rdev, dev, reason); err = rdev_disconnect(rdev, dev, reason);
}
return err; return err;
} }
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