Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge ath-next from git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git

ath.git patches for v6.2. Major changes:

ath11k

* support configuring channel dwell time during scan

+268 -147
+6
drivers/net/wireless/ath/ar5523/ar5523.c
··· 241 241 } 242 242 } 243 243 244 + static void ar5523_cancel_tx_cmd(struct ar5523 *ar) 245 + { 246 + usb_kill_urb(ar->tx_cmd.urb_tx); 247 + } 248 + 244 249 static int ar5523_cmd(struct ar5523 *ar, u32 code, const void *idata, 245 250 int ilen, void *odata, int olen, int flags) 246 251 { ··· 285 280 } 286 281 287 282 if (!wait_for_completion_timeout(&cmd->done, 2 * HZ)) { 283 + ar5523_cancel_tx_cmd(ar); 288 284 cmd->odata = NULL; 289 285 ar5523_err(ar, "timeout waiting for command %02x reply\n", 290 286 code);
+16
drivers/net/wireless/ath/ath10k/core.c
··· 99 99 .dynamic_sar_support = false, 100 100 .hw_restart_disconnect = false, 101 101 .use_fw_tx_credits = true, 102 + .delay_unmap_buffer = false, 102 103 }, 103 104 { 104 105 .id = QCA988X_HW_2_0_VERSION, ··· 139 138 .dynamic_sar_support = false, 140 139 .hw_restart_disconnect = false, 141 140 .use_fw_tx_credits = true, 141 + .delay_unmap_buffer = false, 142 142 }, 143 143 { 144 144 .id = QCA9887_HW_1_0_VERSION, ··· 180 178 .dynamic_sar_support = false, 181 179 .hw_restart_disconnect = false, 182 180 .use_fw_tx_credits = true, 181 + .delay_unmap_buffer = false, 183 182 }, 184 183 { 185 184 .id = QCA6174_HW_3_2_VERSION, ··· 216 213 .dynamic_sar_support = true, 217 214 .hw_restart_disconnect = false, 218 215 .use_fw_tx_credits = true, 216 + .delay_unmap_buffer = false, 219 217 }, 220 218 { 221 219 .id = QCA6174_HW_2_1_VERSION, ··· 256 252 .dynamic_sar_support = false, 257 253 .hw_restart_disconnect = false, 258 254 .use_fw_tx_credits = true, 255 + .delay_unmap_buffer = false, 259 256 }, 260 257 { 261 258 .id = QCA6174_HW_2_1_VERSION, ··· 296 291 .dynamic_sar_support = false, 297 292 .hw_restart_disconnect = false, 298 293 .use_fw_tx_credits = true, 294 + .delay_unmap_buffer = false, 299 295 }, 300 296 { 301 297 .id = QCA6174_HW_3_0_VERSION, ··· 336 330 .dynamic_sar_support = false, 337 331 .hw_restart_disconnect = false, 338 332 .use_fw_tx_credits = true, 333 + .delay_unmap_buffer = false, 339 334 }, 340 335 { 341 336 .id = QCA6174_HW_3_2_VERSION, ··· 380 373 .dynamic_sar_support = true, 381 374 .hw_restart_disconnect = false, 382 375 .use_fw_tx_credits = true, 376 + .delay_unmap_buffer = false, 383 377 }, 384 378 { 385 379 .id = QCA99X0_HW_2_0_DEV_VERSION, ··· 426 418 .dynamic_sar_support = false, 427 419 .hw_restart_disconnect = false, 428 420 .use_fw_tx_credits = true, 421 + .delay_unmap_buffer = false, 429 422 }, 430 423 { 431 424 .id = QCA9984_HW_1_0_DEV_VERSION, ··· 479 470 .dynamic_sar_support = false, 480 471 .hw_restart_disconnect = false, 481 472 .use_fw_tx_credits = true, 473 + .delay_unmap_buffer = false, 482 474 }, 483 475 { 484 476 .id = QCA9888_HW_2_0_DEV_VERSION, ··· 529 519 .dynamic_sar_support = false, 530 520 .hw_restart_disconnect = false, 531 521 .use_fw_tx_credits = true, 522 + .delay_unmap_buffer = false, 532 523 }, 533 524 { 534 525 .id = QCA9377_HW_1_0_DEV_VERSION, ··· 569 558 .dynamic_sar_support = false, 570 559 .hw_restart_disconnect = false, 571 560 .use_fw_tx_credits = true, 561 + .delay_unmap_buffer = false, 572 562 }, 573 563 { 574 564 .id = QCA9377_HW_1_1_DEV_VERSION, ··· 611 599 .dynamic_sar_support = false, 612 600 .hw_restart_disconnect = false, 613 601 .use_fw_tx_credits = true, 602 + .delay_unmap_buffer = false, 614 603 }, 615 604 { 616 605 .id = QCA9377_HW_1_1_DEV_VERSION, ··· 644 631 .dynamic_sar_support = false, 645 632 .hw_restart_disconnect = false, 646 633 .use_fw_tx_credits = true, 634 + .delay_unmap_buffer = false, 647 635 }, 648 636 { 649 637 .id = QCA4019_HW_1_0_DEV_VERSION, ··· 691 677 .dynamic_sar_support = false, 692 678 .hw_restart_disconnect = false, 693 679 .use_fw_tx_credits = true, 680 + .delay_unmap_buffer = false, 694 681 }, 695 682 { 696 683 .id = WCN3990_HW_1_0_DEV_VERSION, ··· 724 709 .dynamic_sar_support = true, 725 710 .hw_restart_disconnect = true, 726 711 .use_fw_tx_credits = false, 712 + .delay_unmap_buffer = true, 727 713 }, 728 714 }; 729 715
+9
drivers/net/wireless/ath/ath10k/htc.c
··· 56 56 ath10k_dbg(ar, ATH10K_DBG_HTC, "%s: ep %d skb %pK\n", __func__, 57 57 ep->eid, skb); 58 58 59 + /* A corner case where the copy completion is reaching to host but still 60 + * copy engine is processing it due to which host unmaps corresponding 61 + * memory and causes SMMU fault, hence as workaround adding delay 62 + * the unmapping memory to avoid SMMU faults. 63 + */ 64 + if (ar->hw_params.delay_unmap_buffer && 65 + ep->ul_pipe_id == 3) 66 + mdelay(2); 67 + 59 68 hdr = (struct ath10k_htc_hdr *)skb->data; 60 69 ath10k_htc_restore_tx_skb(ep->htc, skb); 61 70
+4 -2
drivers/net/wireless/ath/ath10k/htt.h
··· 1108 1108 u8 reserved; 1109 1109 __le16 msdu_count; 1110 1110 union { 1111 - struct htt_rx_in_ord_msdu_desc msdu_descs32[0]; 1112 - struct htt_rx_in_ord_msdu_desc_ext msdu_descs64[0]; 1111 + DECLARE_FLEX_ARRAY(struct htt_rx_in_ord_msdu_desc, 1112 + msdu_descs32); 1113 + DECLARE_FLEX_ARRAY(struct htt_rx_in_ord_msdu_desc_ext, 1114 + msdu_descs64); 1113 1115 } __packed; 1114 1116 } __packed; 1115 1117
+2
drivers/net/wireless/ath/ath10k/hw.h
··· 637 637 bool hw_restart_disconnect; 638 638 639 639 bool use_fw_tx_credits; 640 + 641 + bool delay_unmap_buffer; 640 642 }; 641 643 642 644 struct htt_resp;
+7
drivers/net/wireless/ath/ath10k/wmi-tlv.c
··· 584 584 ath10k_warn(ar, "did not find station from tdls peer event"); 585 585 goto exit; 586 586 } 587 + 587 588 arvif = ath10k_get_arvif(ar, __le32_to_cpu(ev->vdev_id)); 589 + if (!arvif) { 590 + ath10k_warn(ar, "no vif for vdev_id %d found", 591 + __le32_to_cpu(ev->vdev_id)); 592 + goto exit; 593 + } 594 + 588 595 ieee80211_tdls_oper_request( 589 596 arvif->vif, station->addr, 590 597 NL80211_TDLS_TEARDOWN,
+5 -4
drivers/net/wireless/ath/ath11k/core.c
··· 1641 1641 } 1642 1642 } 1643 1643 1644 - static void ath11k_core_pre_reconfigure_recovery(struct ath11k_base *ab) 1644 + void ath11k_core_pre_reconfigure_recovery(struct ath11k_base *ab) 1645 1645 { 1646 1646 struct ath11k *ar; 1647 1647 struct ath11k_pdev *pdev; ··· 1677 1677 ath11k_mac_tx_mgmt_pending_free, ar); 1678 1678 idr_destroy(&ar->txmgmt_idr); 1679 1679 wake_up(&ar->txmgmt_empty_waitq); 1680 + 1681 + ar->monitor_vdev_id = -1; 1682 + clear_bit(ATH11K_FLAG_MONITOR_STARTED, &ar->monitor_flags); 1683 + clear_bit(ATH11K_FLAG_MONITOR_VDEV_CREATED, &ar->monitor_flags); 1680 1684 } 1681 1685 1682 1686 wake_up(&ab->wmi_ab.tx_credits_wq); ··· 1733 1729 { 1734 1730 struct ath11k_base *ab = container_of(work, struct ath11k_base, restart_work); 1735 1731 int ret; 1736 - 1737 - if (!ab->is_reset) 1738 - ath11k_core_pre_reconfigure_recovery(ab); 1739 1732 1740 1733 ret = ath11k_core_reconfigure_on_crash(ab); 1741 1734 if (ret) {
+3
drivers/net/wireless/ath/ath11k/core.h
··· 505 505 u64 ps_start_jiffies; 506 506 u64 ps_total_duration; 507 507 bool peer_current_ps_valid; 508 + 509 + u32 bw_prev; 508 510 }; 509 511 510 512 #define ATH11K_MIN_5G_FREQ 4150 ··· 1159 1157 void ath11k_core_halt(struct ath11k *ar); 1160 1158 int ath11k_core_resume(struct ath11k_base *ab); 1161 1159 int ath11k_core_suspend(struct ath11k_base *ab); 1160 + void ath11k_core_pre_reconfigure_recovery(struct ath11k_base *ab); 1162 1161 1163 1162 const struct firmware *ath11k_core_firmware_request(struct ath11k_base *ab, 1164 1163 const char *filename);
+153 -69
drivers/net/wireless/ath/ath11k/mac.c
··· 241 241 #define ath11k_a_rates (ath11k_legacy_rates + 4) 242 242 #define ath11k_a_rates_size (ARRAY_SIZE(ath11k_legacy_rates) - 4) 243 243 244 - #define ATH11K_MAC_SCAN_TIMEOUT_MSECS 200 /* in msecs */ 244 + #define ATH11K_MAC_SCAN_CMD_EVT_OVERHEAD 200 /* in msecs */ 245 + 246 + /* Overhead due to the processing of channel switch events from FW */ 247 + #define ATH11K_SCAN_CHANNEL_SWITCH_WMI_EVT_OVERHEAD 10 /* in msecs */ 245 248 246 249 static const u32 ath11k_smps_map[] = { 247 250 [WLAN_HT_CAP_SM_PS_STATIC] = WMI_PEER_SMPS_STATIC, ··· 3615 3612 struct scan_req_params arg; 3616 3613 int ret = 0; 3617 3614 int i; 3615 + u32 scan_timeout; 3618 3616 3619 3617 mutex_lock(&ar->conf_mutex); 3620 3618 ··· 3685 3681 ether_addr_copy(arg.mac_mask.addr, req->mac_addr_mask); 3686 3682 } 3687 3683 3684 + /* if duration is set, default dwell times will be overwritten */ 3685 + if (req->duration) { 3686 + arg.dwell_time_active = req->duration; 3687 + arg.dwell_time_active_2g = req->duration; 3688 + arg.dwell_time_active_6g = req->duration; 3689 + arg.dwell_time_passive = req->duration; 3690 + arg.dwell_time_passive_6g = req->duration; 3691 + arg.burst_duration = req->duration; 3692 + 3693 + scan_timeout = min_t(u32, arg.max_rest_time * 3694 + (arg.num_chan - 1) + (req->duration + 3695 + ATH11K_SCAN_CHANNEL_SWITCH_WMI_EVT_OVERHEAD) * 3696 + arg.num_chan, arg.max_scan_time); 3697 + } else { 3698 + scan_timeout = arg.max_scan_time; 3699 + } 3700 + 3701 + /* Add a margin to account for event/command processing */ 3702 + scan_timeout += ATH11K_MAC_SCAN_CMD_EVT_OVERHEAD; 3703 + 3688 3704 ret = ath11k_start_scan(ar, &arg); 3689 3705 if (ret) { 3690 3706 ath11k_warn(ar->ab, "failed to start hw scan: %d\n", ret); ··· 3713 3689 spin_unlock_bh(&ar->data_lock); 3714 3690 } 3715 3691 3716 - /* Add a 200ms margin to account for event/command processing */ 3717 3692 ieee80211_queue_delayed_work(ar->hw, &ar->scan.timeout, 3718 - msecs_to_jiffies(arg.max_scan_time + 3719 - ATH11K_MAC_SCAN_TIMEOUT_MSECS)); 3693 + msecs_to_jiffies(scan_timeout)); 3720 3694 3721 3695 exit: 3722 3696 kfree(arg.chan_list); ··· 4237 4215 const u8 *ht_mcs_mask; 4238 4216 const u16 *vht_mcs_mask; 4239 4217 const u16 *he_mcs_mask; 4240 - u32 changed, bw, nss, smps; 4218 + u32 changed, bw, nss, smps, bw_prev; 4241 4219 int err, num_vht_rates, num_he_rates; 4242 4220 const struct cfg80211_bitrate_mask *mask; 4243 4221 struct peer_assoc_params peer_arg; 4222 + enum wmi_phy_mode peer_phymode; 4244 4223 4245 4224 arsta = container_of(wk, struct ath11k_sta, update_wk); 4246 4225 sta = container_of((void *)arsta, struct ieee80211_sta, drv_priv); ··· 4262 4239 arsta->changed = 0; 4263 4240 4264 4241 bw = arsta->bw; 4242 + bw_prev = arsta->bw_prev; 4265 4243 nss = arsta->nss; 4266 4244 smps = arsta->smps; 4267 4245 ··· 4276 4252 ath11k_mac_max_he_nss(he_mcs_mask))); 4277 4253 4278 4254 if (changed & IEEE80211_RC_BW_CHANGED) { 4279 - /* Send peer assoc command before set peer bandwidth param to 4280 - * avoid the mismatch between the peer phymode and the peer 4281 - * bandwidth. 4282 - */ 4283 - ath11k_peer_assoc_prepare(ar, arvif->vif, sta, &peer_arg, true); 4255 + /* Get the peer phymode */ 4256 + ath11k_peer_assoc_h_phymode(ar, arvif->vif, sta, &peer_arg); 4257 + peer_phymode = peer_arg.peer_phymode; 4284 4258 4285 - peer_arg.is_assoc = false; 4286 - err = ath11k_wmi_send_peer_assoc_cmd(ar, &peer_arg); 4287 - if (err) { 4288 - ath11k_warn(ar->ab, "failed to send peer assoc for STA %pM vdev %i: %d\n", 4289 - sta->addr, arvif->vdev_id, err); 4290 - } else if (wait_for_completion_timeout(&ar->peer_assoc_done, 1 * HZ)) { 4259 + ath11k_dbg(ar->ab, ATH11K_DBG_MAC, "mac update sta %pM peer bw %d phymode %d\n", 4260 + sta->addr, bw, peer_phymode); 4261 + 4262 + if (bw > bw_prev) { 4263 + /* BW is upgraded. In this case we send WMI_PEER_PHYMODE 4264 + * followed by WMI_PEER_CHWIDTH 4265 + */ 4266 + ath11k_dbg(ar->ab, ATH11K_DBG_MAC, "mac BW upgrade for sta %pM new BW %d, old BW %d\n", 4267 + sta->addr, bw, bw_prev); 4268 + 4269 + err = ath11k_wmi_set_peer_param(ar, sta->addr, arvif->vdev_id, 4270 + WMI_PEER_PHYMODE, peer_phymode); 4271 + 4272 + if (err) { 4273 + ath11k_warn(ar->ab, "failed to update STA %pM peer phymode %d: %d\n", 4274 + sta->addr, peer_phymode, err); 4275 + goto err_rc_bw_changed; 4276 + } 4277 + 4291 4278 err = ath11k_wmi_set_peer_param(ar, sta->addr, arvif->vdev_id, 4292 4279 WMI_PEER_CHWIDTH, bw); 4280 + 4293 4281 if (err) 4294 4282 ath11k_warn(ar->ab, "failed to update STA %pM peer bw %d: %d\n", 4295 4283 sta->addr, bw, err); 4296 4284 } else { 4297 - ath11k_warn(ar->ab, "failed to get peer assoc conf event for %pM vdev %i\n", 4298 - sta->addr, arvif->vdev_id); 4285 + /* BW is downgraded. In this case we send WMI_PEER_CHWIDTH 4286 + * followed by WMI_PEER_PHYMODE 4287 + */ 4288 + ath11k_dbg(ar->ab, ATH11K_DBG_MAC, "mac BW downgrade for sta %pM new BW %d,old BW %d\n", 4289 + sta->addr, bw, bw_prev); 4290 + 4291 + err = ath11k_wmi_set_peer_param(ar, sta->addr, arvif->vdev_id, 4292 + WMI_PEER_CHWIDTH, bw); 4293 + 4294 + if (err) { 4295 + ath11k_warn(ar->ab, "failed to update STA %pM peer bw %d: %d\n", 4296 + sta->addr, bw, err); 4297 + goto err_rc_bw_changed; 4298 + } 4299 + 4300 + err = ath11k_wmi_set_peer_param(ar, sta->addr, arvif->vdev_id, 4301 + WMI_PEER_PHYMODE, peer_phymode); 4302 + 4303 + if (err) 4304 + ath11k_warn(ar->ab, "failed to update STA %pM peer phymode %d: %d\n", 4305 + sta->addr, peer_phymode, err); 4299 4306 } 4300 4307 } 4301 4308 ··· 4407 4352 } 4408 4353 } 4409 4354 4355 + err_rc_bw_changed: 4410 4356 mutex_unlock(&ar->conf_mutex); 4411 4357 } 4412 4358 ··· 4561 4505 return ret; 4562 4506 } 4563 4507 4508 + static u32 ath11k_mac_ieee80211_sta_bw_to_wmi(struct ath11k *ar, 4509 + struct ieee80211_sta *sta) 4510 + { 4511 + u32 bw = WMI_PEER_CHWIDTH_20MHZ; 4512 + 4513 + switch (sta->deflink.bandwidth) { 4514 + case IEEE80211_STA_RX_BW_20: 4515 + bw = WMI_PEER_CHWIDTH_20MHZ; 4516 + break; 4517 + case IEEE80211_STA_RX_BW_40: 4518 + bw = WMI_PEER_CHWIDTH_40MHZ; 4519 + break; 4520 + case IEEE80211_STA_RX_BW_80: 4521 + bw = WMI_PEER_CHWIDTH_80MHZ; 4522 + break; 4523 + case IEEE80211_STA_RX_BW_160: 4524 + bw = WMI_PEER_CHWIDTH_160MHZ; 4525 + break; 4526 + default: 4527 + ath11k_warn(ar->ab, "Invalid bandwidth %d for %pM\n", 4528 + sta->deflink.bandwidth, sta->addr); 4529 + bw = WMI_PEER_CHWIDTH_20MHZ; 4530 + break; 4531 + } 4532 + 4533 + return bw; 4534 + } 4535 + 4564 4536 static int ath11k_mac_op_sta_state(struct ieee80211_hw *hw, 4565 4537 struct ieee80211_vif *vif, 4566 4538 struct ieee80211_sta *sta, ··· 4674 4590 if (ret) 4675 4591 ath11k_warn(ar->ab, "Failed to associate station: %pM\n", 4676 4592 sta->addr); 4593 + 4594 + spin_lock_bh(&ar->data_lock); 4595 + /* Set arsta bw and prev bw */ 4596 + arsta->bw = ath11k_mac_ieee80211_sta_bw_to_wmi(ar, sta); 4597 + arsta->bw_prev = arsta->bw; 4598 + spin_unlock_bh(&ar->data_lock); 4677 4599 } else if (old_state == IEEE80211_STA_ASSOC && 4678 4600 new_state == IEEE80211_STA_AUTHORIZED) { 4679 4601 spin_lock_bh(&ar->ab->base_lock); ··· 4803 4713 spin_lock_bh(&ar->data_lock); 4804 4714 4805 4715 if (changed & IEEE80211_RC_BW_CHANGED) { 4806 - bw = WMI_PEER_CHWIDTH_20MHZ; 4807 - 4808 - switch (sta->deflink.bandwidth) { 4809 - case IEEE80211_STA_RX_BW_20: 4810 - bw = WMI_PEER_CHWIDTH_20MHZ; 4811 - break; 4812 - case IEEE80211_STA_RX_BW_40: 4813 - bw = WMI_PEER_CHWIDTH_40MHZ; 4814 - break; 4815 - case IEEE80211_STA_RX_BW_80: 4816 - bw = WMI_PEER_CHWIDTH_80MHZ; 4817 - break; 4818 - case IEEE80211_STA_RX_BW_160: 4819 - bw = WMI_PEER_CHWIDTH_160MHZ; 4820 - break; 4821 - default: 4822 - ath11k_warn(ar->ab, "Invalid bandwidth %d in rc update for %pM\n", 4823 - sta->deflink.bandwidth, sta->addr); 4824 - bw = WMI_PEER_CHWIDTH_20MHZ; 4825 - break; 4826 - } 4827 - 4716 + bw = ath11k_mac_ieee80211_sta_bw_to_wmi(ar, sta); 4717 + arsta->bw_prev = arsta->bw; 4828 4718 arsta->bw = bw; 4829 4719 } 4830 4720 ··· 6233 6163 } 6234 6164 } 6235 6165 6166 + static int ath11k_mac_vdev_delete(struct ath11k *ar, struct ath11k_vif *arvif) 6167 + { 6168 + unsigned long time_left; 6169 + struct ieee80211_vif *vif = arvif->vif; 6170 + int ret = 0; 6171 + 6172 + lockdep_assert_held(&ar->conf_mutex); 6173 + 6174 + reinit_completion(&ar->vdev_delete_done); 6175 + 6176 + ret = ath11k_wmi_vdev_delete(ar, arvif->vdev_id); 6177 + if (ret) { 6178 + ath11k_warn(ar->ab, "failed to delete WMI vdev %d: %d\n", 6179 + arvif->vdev_id, ret); 6180 + return ret; 6181 + } 6182 + 6183 + time_left = wait_for_completion_timeout(&ar->vdev_delete_done, 6184 + ATH11K_VDEV_DELETE_TIMEOUT_HZ); 6185 + if (time_left == 0) { 6186 + ath11k_warn(ar->ab, "Timeout in receiving vdev delete response\n"); 6187 + return -ETIMEDOUT; 6188 + } 6189 + 6190 + ar->ab->free_vdev_map |= 1LL << (arvif->vdev_id); 6191 + ar->allocated_vdev_map &= ~(1LL << arvif->vdev_id); 6192 + ar->num_created_vdevs--; 6193 + 6194 + ath11k_dbg(ar->ab, ATH11K_DBG_MAC, "vdev %pM deleted, vdev_id %d\n", 6195 + vif->addr, arvif->vdev_id); 6196 + 6197 + return ret; 6198 + } 6199 + 6236 6200 static int ath11k_mac_op_add_interface(struct ieee80211_hw *hw, 6237 6201 struct ieee80211_vif *vif) 6238 6202 { ··· 6477 6373 6478 6374 ath11k_dp_vdev_tx_attach(ar, arvif); 6479 6375 6376 + ath11k_debugfs_add_interface(arvif); 6377 + 6480 6378 if (vif->type != NL80211_IFTYPE_MONITOR && 6481 6379 test_bit(ATH11K_FLAG_MONITOR_CONF_ENABLED, &ar->monitor_flags)) { 6482 6380 ret = ath11k_mac_monitor_vdev_create(ar); 6483 - if (ret) { 6381 + if (ret) 6484 6382 ath11k_warn(ar->ab, "failed to create monitor vdev during add interface: %d", 6485 6383 ret); 6486 - goto err_peer_del; 6487 - } 6488 6384 } 6489 - 6490 - ath11k_debugfs_add_interface(arvif); 6491 6385 6492 6386 mutex_unlock(&ar->conf_mutex); 6493 6387 ··· 6502 6400 } 6503 6401 6504 6402 err_vdev_del: 6505 - ath11k_wmi_vdev_delete(ar, arvif->vdev_id); 6506 - ar->num_created_vdevs--; 6507 - ar->allocated_vdev_map &= ~(1LL << arvif->vdev_id); 6508 - ab->free_vdev_map |= 1LL << arvif->vdev_id; 6403 + ath11k_mac_vdev_delete(ar, arvif); 6509 6404 spin_lock_bh(&ar->data_lock); 6510 6405 list_del(&arvif->list); 6511 6406 spin_unlock_bh(&ar->data_lock); 6512 6407 6513 6408 err: 6514 - ath11k_debugfs_remove_interface(arvif); 6515 6409 mutex_unlock(&ar->conf_mutex); 6516 6410 6517 6411 return ret; ··· 6530 6432 struct ath11k *ar = hw->priv; 6531 6433 struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif); 6532 6434 struct ath11k_base *ab = ar->ab; 6533 - unsigned long time_left; 6534 6435 int ret; 6535 6436 int i; 6536 6437 ··· 6550 6453 arvif->vdev_id, ret); 6551 6454 } 6552 6455 6553 - reinit_completion(&ar->vdev_delete_done); 6554 - 6555 - ret = ath11k_wmi_vdev_delete(ar, arvif->vdev_id); 6456 + ret = ath11k_mac_vdev_delete(ar, arvif); 6556 6457 if (ret) { 6557 - ath11k_warn(ab, "failed to delete WMI vdev %d: %d\n", 6458 + ath11k_warn(ab, "failed to delete vdev %d: %d\n", 6558 6459 arvif->vdev_id, ret); 6559 6460 goto err_vdev_del; 6560 6461 } 6561 - 6562 - time_left = wait_for_completion_timeout(&ar->vdev_delete_done, 6563 - ATH11K_VDEV_DELETE_TIMEOUT_HZ); 6564 - if (time_left == 0) { 6565 - ath11k_warn(ab, "Timeout in receiving vdev delete response\n"); 6566 - goto err_vdev_del; 6567 - } 6568 - 6569 - ab->free_vdev_map |= 1LL << (arvif->vdev_id); 6570 - ar->allocated_vdev_map &= ~(1LL << arvif->vdev_id); 6571 - ar->num_created_vdevs--; 6572 - 6573 - ath11k_dbg(ab, ATH11K_DBG_MAC, "vdev %pM deleted, vdev_id %d\n", 6574 - vif->addr, arvif->vdev_id); 6575 6462 6576 6463 if (arvif->vdev_type == WMI_VDEV_TYPE_MONITOR) { 6577 6464 clear_bit(ATH11K_FLAG_MONITOR_VDEV_CREATED, &ar->monitor_flags); ··· 9095 9014 wiphy_ext_feature_set(ar->hw->wiphy, 9096 9015 NL80211_EXT_FEATURE_UNSOL_BCAST_PROBE_RESP); 9097 9016 } 9017 + 9018 + wiphy_ext_feature_set(ar->hw->wiphy, 9019 + NL80211_EXT_FEATURE_SET_SCAN_DWELL); 9098 9020 9099 9021 ath11k_reg_init(ar); 9100 9022
+10 -3
drivers/net/wireless/ath/ath11k/pcic.c
··· 218 218 if (wakeup_required && ab->pci.ops->wakeup) { 219 219 ret = ab->pci.ops->wakeup(ab); 220 220 if (ret) { 221 - ath11k_warn(ab, "failed to wakeup for read from 0x%x: %d\n", 222 - start, ret); 223 - return ret; 221 + ath11k_warn(ab, 222 + "wakeup failed, data may be invalid: %d", 223 + ret); 224 + /* Even though wakeup() failed, continue processing rather 225 + * than returning because some parts of the data may still 226 + * be valid and useful in some cases, e.g. could give us 227 + * some clues on firmware crash. 228 + * Mislead due to invalid data could be avoided because we 229 + * are aware of the wakeup failure. 230 + */ 224 231 } 225 232 } 226 233
+9 -3
drivers/net/wireless/ath/ath11k/qmi.c
··· 19 19 #define SLEEP_CLOCK_SELECT_INTERNAL_BIT 0x02 20 20 #define HOST_CSTATE_BIT 0x04 21 21 #define PLATFORM_CAP_PCIE_GLOBAL_RESET 0x08 22 + #define PLATFORM_CAP_PCIE_PME_D3COLD 0x10 22 23 23 24 #define FW_BUILD_ID_MASK "QC_IMAGE_VERSION_STRING=" 24 25 ··· 1753 1752 if (ab->hw_params.global_reset) 1754 1753 req.nm_modem |= PLATFORM_CAP_PCIE_GLOBAL_RESET; 1755 1754 1755 + req.nm_modem |= PLATFORM_CAP_PCIE_PME_D3COLD; 1756 + 1756 1757 ath11k_dbg(ab, ATH11K_DBG_QMI, "qmi host cap request\n"); 1757 1758 1758 1759 ret = qmi_txn_init(&ab->qmi.handle, &txn, ··· 1964 1961 continue; 1965 1962 1966 1963 dma_free_coherent(ab->dev, 1967 - ab->qmi.target_mem[i].size, 1964 + ab->qmi.target_mem[i].prev_size, 1968 1965 ab->qmi.target_mem[i].vaddr, 1969 1966 ab->qmi.target_mem[i].paddr); 1970 1967 ab->qmi.target_mem[i].vaddr = NULL; ··· 1985 1982 * in such case, no need to allocate memory for FW again. 1986 1983 */ 1987 1984 if (chunk->vaddr) { 1988 - if (chunk->prev_type == chunk->type || 1985 + if (chunk->prev_type == chunk->type && 1989 1986 chunk->prev_size == chunk->size) 1990 1987 continue; 1991 1988 1992 1989 /* cannot reuse the existing chunk */ 1993 - dma_free_coherent(ab->dev, chunk->size, 1990 + dma_free_coherent(ab->dev, chunk->prev_size, 1994 1991 chunk->vaddr, chunk->paddr); 1995 1992 chunk->vaddr = NULL; 1996 1993 } ··· 3161 3158 case ATH11K_QMI_EVENT_SERVER_EXIT: 3162 3159 set_bit(ATH11K_FLAG_CRASH_FLUSH, &ab->dev_flags); 3163 3160 set_bit(ATH11K_FLAG_RECOVERY, &ab->dev_flags); 3161 + 3162 + if (!ab->is_reset) 3163 + ath11k_core_pre_reconfigure_recovery(ab); 3164 3164 break; 3165 3165 case ATH11K_QMI_EVENT_REQUEST_MEM: 3166 3166 ret = ath11k_qmi_event_mem_request(qmi);
+1 -5
drivers/net/wireless/ath/ath11k/reg.c
··· 287 287 goto err; 288 288 } 289 289 290 - rtnl_lock(); 291 - wiphy_lock(ar->hw->wiphy); 292 - ret = regulatory_set_wiphy_regd_sync(ar->hw->wiphy, regd_copy); 293 - wiphy_unlock(ar->hw->wiphy); 294 - rtnl_unlock(); 290 + ret = regulatory_set_wiphy_regd(ar->hw->wiphy, regd_copy); 295 291 296 292 kfree(regd_copy); 297 293
+1 -1
drivers/net/wireless/ath/ath11k/wmi.c
··· 6829 6829 } 6830 6830 6831 6831 ath11k_dbg(ab, ATH11K_DBG_WMI, 6832 - "peer sta ps chnange ev addr %pM state %u sup_bitmap %x ps_valid %u ts %u\n", 6832 + "peer sta ps change ev addr %pM state %u sup_bitmap %x ps_valid %u ts %u\n", 6833 6833 ev->peer_macaddr.addr, ev->peer_ps_state, 6834 6834 ev->ps_supported_bitmap, ev->peer_ps_valid, 6835 6835 ev->peer_ps_timestamp);
-5
drivers/net/wireless/ath/ath9k/Makefile
··· 45 45 ar9003_eeprom.o \ 46 46 ar9003_paprd.o 47 47 48 - # FIXME: temporarily silence -Warray-bounds on non W=1+ builds 49 - ifndef KBUILD_EXTRA_WARN 50 - CFLAGS_mac.o += -Wno-array-bounds 51 - endif 52 - 53 48 ath9k_hw-$(CONFIG_ATH9K_WOW) += ar9003_wow.o 54 49 55 50 ath9k_hw-$(CONFIG_ATH9K_BTCOEX_SUPPORT) += btcoex.o \
+29 -17
drivers/net/wireless/ath/ath9k/hif_usb.c
··· 708 708 struct rx_buf *rx_buf = (struct rx_buf *)urb->context; 709 709 struct hif_device_usb *hif_dev = rx_buf->hif_dev; 710 710 struct sk_buff *skb = rx_buf->skb; 711 - struct sk_buff *nskb; 712 711 int ret; 713 712 714 713 if (!skb) 715 714 return; 716 715 717 716 if (!hif_dev) 718 - goto free; 717 + goto free_skb; 719 718 720 719 switch (urb->status) { 721 720 case 0: ··· 723 724 case -ECONNRESET: 724 725 case -ENODEV: 725 726 case -ESHUTDOWN: 726 - goto free; 727 + goto free_skb; 727 728 default: 728 729 skb_reset_tail_pointer(skb); 729 730 skb_trim(skb, 0); ··· 734 735 if (likely(urb->actual_length != 0)) { 735 736 skb_put(skb, urb->actual_length); 736 737 737 - /* Process the command first */ 738 + /* 739 + * Process the command first. 740 + * skb is either freed here or passed to be 741 + * managed to another callback function. 742 + */ 738 743 ath9k_htc_rx_msg(hif_dev->htc_handle, skb, 739 744 skb->len, USB_REG_IN_PIPE); 740 745 741 - 742 - nskb = alloc_skb(MAX_REG_IN_BUF_SIZE, GFP_ATOMIC); 743 - if (!nskb) { 746 + skb = alloc_skb(MAX_REG_IN_BUF_SIZE, GFP_ATOMIC); 747 + if (!skb) { 744 748 dev_err(&hif_dev->udev->dev, 745 749 "ath9k_htc: REG_IN memory allocation failure\n"); 746 - urb->context = NULL; 747 - return; 750 + goto free_rx_buf; 748 751 } 749 752 750 - rx_buf->skb = nskb; 753 + rx_buf->skb = skb; 751 754 752 755 usb_fill_int_urb(urb, hif_dev->udev, 753 756 usb_rcvintpipe(hif_dev->udev, 754 757 USB_REG_IN_PIPE), 755 - nskb->data, MAX_REG_IN_BUF_SIZE, 758 + skb->data, MAX_REG_IN_BUF_SIZE, 756 759 ath9k_hif_usb_reg_in_cb, rx_buf, 1); 757 760 } 758 761 ··· 763 762 ret = usb_submit_urb(urb, GFP_ATOMIC); 764 763 if (ret) { 765 764 usb_unanchor_urb(urb); 766 - goto free; 765 + goto free_skb; 767 766 } 768 767 769 768 return; 770 - free: 769 + free_skb: 771 770 kfree_skb(skb); 771 + free_rx_buf: 772 772 kfree(rx_buf); 773 773 urb->context = NULL; 774 774 } ··· 782 780 spin_lock_irqsave(&hif_dev->tx.tx_lock, flags); 783 781 list_for_each_entry_safe(tx_buf, tx_buf_tmp, 784 782 &hif_dev->tx.tx_buf, list) { 785 - usb_get_urb(tx_buf->urb); 786 - spin_unlock_irqrestore(&hif_dev->tx.tx_lock, flags); 787 - usb_kill_urb(tx_buf->urb); 788 783 list_del(&tx_buf->list); 789 784 usb_free_urb(tx_buf->urb); 790 785 kfree(tx_buf->buf); 791 786 kfree(tx_buf); 792 - spin_lock_irqsave(&hif_dev->tx.tx_lock, flags); 793 787 } 794 788 spin_unlock_irqrestore(&hif_dev->tx.tx_lock, flags); 795 789 ··· 1327 1329 static int ath9k_hif_usb_probe(struct usb_interface *interface, 1328 1330 const struct usb_device_id *id) 1329 1331 { 1332 + struct usb_endpoint_descriptor *bulk_in, *bulk_out, *int_in, *int_out; 1330 1333 struct usb_device *udev = interface_to_usbdev(interface); 1334 + struct usb_host_interface *alt; 1331 1335 struct hif_device_usb *hif_dev; 1332 1336 int ret = 0; 1337 + 1338 + /* Verify the expected endpoints are present */ 1339 + alt = interface->cur_altsetting; 1340 + if (usb_find_common_endpoints(alt, &bulk_in, &bulk_out, &int_in, &int_out) < 0 || 1341 + usb_endpoint_num(bulk_in) != USB_WLAN_RX_PIPE || 1342 + usb_endpoint_num(bulk_out) != USB_WLAN_TX_PIPE || 1343 + usb_endpoint_num(int_in) != USB_REG_IN_PIPE || 1344 + usb_endpoint_num(int_out) != USB_REG_OUT_PIPE) { 1345 + dev_err(&udev->dev, 1346 + "ath9k_htc: Device endpoint numbers are not the expected ones\n"); 1347 + return -ENODEV; 1348 + } 1333 1349 1334 1350 if (id->driver_info == STORAGE_DEVICE) 1335 1351 return send_eject_command(interface);
+6 -2
drivers/net/wireless/ath/ath9k/mci.c
··· 266 266 stomp_txprio[ATH_BTCOEX_STOMP_NONE] = 267 267 ATH_MCI_INQUIRY_PRIO; 268 268 } else { 269 - u8 prof_prio[] = { 50, 90, 94, 52 };/* RFCOMM, A2DP, HID, PAN */ 269 + static const u8 prof_prio[] = { 270 + 50, 90, 94, 52 271 + }; /* RFCOMM, A2DP, HID, PAN */ 270 272 271 273 stomp_txprio[ATH_BTCOEX_STOMP_LOW] = 272 274 stomp_txprio[ATH_BTCOEX_STOMP_NONE] = 0xff; ··· 646 644 struct ath_hw *ah = sc->sc_ah; 647 645 struct ath9k_hw_mci *mci = &ah->btcoex_hw.mci; 648 646 struct ath9k_channel *chan = ah->curchan; 649 - u32 channelmap[] = {0x00000000, 0xffff0000, 0xffffffff, 0x7fffffff}; 647 + static const u32 channelmap[] = { 648 + 0x00000000, 0xffff0000, 0xffffffff, 0x7fffffff 649 + }; 650 650 int i; 651 651 s16 chan_start, chan_end; 652 652 u16 wlan_chan;
-5
drivers/net/wireless/ath/carl9170/Makefile
··· 3 3 carl9170-$(CONFIG_CARL9170_DEBUGFS) += debug.o 4 4 5 5 obj-$(CONFIG_CARL9170) += carl9170.o 6 - 7 - # FIXME: temporarily silence -Warray-bounds on non W=1+ builds 8 - ifndef KBUILD_EXTRA_WARN 9 - CFLAGS_cmd.o += -Wno-array-bounds 10 - endif
+1 -1
drivers/net/wireless/ath/carl9170/wlan.h
··· 271 271 272 272 union { 273 273 struct ieee80211_hdr i3e; 274 - u8 payload[0]; 274 + DECLARE_FLEX_ARRAY(u8, payload); 275 275 } data; 276 276 } __packed; 277 277
+6 -30
drivers/net/wireless/ath/wil6210/debugfs.c
··· 2154 2154 }; 2155 2155 2156 2156 /*---------FW capabilities------------*/ 2157 - static int wil_fw_capabilities_debugfs_show(struct seq_file *s, void *data) 2157 + static int fw_capabilities_show(struct seq_file *s, void *data) 2158 2158 { 2159 2159 struct wil6210_priv *wil = s->private; 2160 2160 ··· 2163 2163 2164 2164 return 0; 2165 2165 } 2166 - 2167 - static int wil_fw_capabilities_seq_open(struct inode *inode, struct file *file) 2168 - { 2169 - return single_open(file, wil_fw_capabilities_debugfs_show, 2170 - inode->i_private); 2171 - } 2172 - 2173 - static const struct file_operations fops_fw_capabilities = { 2174 - .open = wil_fw_capabilities_seq_open, 2175 - .release = single_release, 2176 - .read = seq_read, 2177 - .llseek = seq_lseek, 2178 - }; 2166 + DEFINE_SHOW_ATTRIBUTE(fw_capabilities); 2179 2167 2180 2168 /*---------FW version------------*/ 2181 - static int wil_fw_version_debugfs_show(struct seq_file *s, void *data) 2169 + static int fw_version_show(struct seq_file *s, void *data) 2182 2170 { 2183 2171 struct wil6210_priv *wil = s->private; 2184 2172 ··· 2177 2189 2178 2190 return 0; 2179 2191 } 2180 - 2181 - static int wil_fw_version_seq_open(struct inode *inode, struct file *file) 2182 - { 2183 - return single_open(file, wil_fw_version_debugfs_show, 2184 - inode->i_private); 2185 - } 2186 - 2187 - static const struct file_operations fops_fw_version = { 2188 - .open = wil_fw_version_seq_open, 2189 - .release = single_release, 2190 - .read = seq_read, 2191 - .llseek = seq_lseek, 2192 - }; 2192 + DEFINE_SHOW_ATTRIBUTE(fw_version); 2193 2193 2194 2194 /*---------suspend_stats---------*/ 2195 2195 static ssize_t wil_write_suspend_stats(struct file *file, ··· 2342 2366 {"recovery", 0644, &fops_recovery}, 2343 2367 {"led_cfg", 0644, &fops_led_cfg}, 2344 2368 {"led_blink_time", 0644, &fops_led_blink_time}, 2345 - {"fw_capabilities", 0444, &fops_fw_capabilities}, 2346 - {"fw_version", 0444, &fops_fw_version}, 2369 + {"fw_capabilities", 0444, &fw_capabilities_fops}, 2370 + {"fw_version", 0444, &fw_version_fops}, 2347 2371 {"suspend_stats", 0644, &fops_suspend_stats}, 2348 2372 {"compressed_rx_status", 0644, &fops_compressed_rx_status}, 2349 2373 {"srings", 0444, &srings_fops},