Commit a9501019 authored by Kalle Valo's avatar Kalle Valo

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
parents 637639cb f3ca72b0
...@@ -241,6 +241,11 @@ static void ar5523_cmd_tx_cb(struct urb *urb) ...@@ -241,6 +241,11 @@ static void ar5523_cmd_tx_cb(struct urb *urb)
} }
} }
static void ar5523_cancel_tx_cmd(struct ar5523 *ar)
{
usb_kill_urb(ar->tx_cmd.urb_tx);
}
static int ar5523_cmd(struct ar5523 *ar, u32 code, const void *idata, static int ar5523_cmd(struct ar5523 *ar, u32 code, const void *idata,
int ilen, void *odata, int olen, int flags) int ilen, void *odata, int olen, int flags)
{ {
...@@ -280,6 +285,7 @@ static int ar5523_cmd(struct ar5523 *ar, u32 code, const void *idata, ...@@ -280,6 +285,7 @@ static int ar5523_cmd(struct ar5523 *ar, u32 code, const void *idata,
} }
if (!wait_for_completion_timeout(&cmd->done, 2 * HZ)) { if (!wait_for_completion_timeout(&cmd->done, 2 * HZ)) {
ar5523_cancel_tx_cmd(ar);
cmd->odata = NULL; cmd->odata = NULL;
ar5523_err(ar, "timeout waiting for command %02x reply\n", ar5523_err(ar, "timeout waiting for command %02x reply\n",
code); code);
......
...@@ -99,6 +99,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { ...@@ -99,6 +99,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
.dynamic_sar_support = false, .dynamic_sar_support = false,
.hw_restart_disconnect = false, .hw_restart_disconnect = false,
.use_fw_tx_credits = true, .use_fw_tx_credits = true,
.delay_unmap_buffer = false,
}, },
{ {
.id = QCA988X_HW_2_0_VERSION, .id = QCA988X_HW_2_0_VERSION,
...@@ -138,6 +139,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { ...@@ -138,6 +139,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
.dynamic_sar_support = false, .dynamic_sar_support = false,
.hw_restart_disconnect = false, .hw_restart_disconnect = false,
.use_fw_tx_credits = true, .use_fw_tx_credits = true,
.delay_unmap_buffer = false,
}, },
{ {
.id = QCA9887_HW_1_0_VERSION, .id = QCA9887_HW_1_0_VERSION,
...@@ -178,6 +180,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { ...@@ -178,6 +180,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
.dynamic_sar_support = false, .dynamic_sar_support = false,
.hw_restart_disconnect = false, .hw_restart_disconnect = false,
.use_fw_tx_credits = true, .use_fw_tx_credits = true,
.delay_unmap_buffer = false,
}, },
{ {
.id = QCA6174_HW_3_2_VERSION, .id = QCA6174_HW_3_2_VERSION,
...@@ -213,6 +216,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { ...@@ -213,6 +216,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
.dynamic_sar_support = true, .dynamic_sar_support = true,
.hw_restart_disconnect = false, .hw_restart_disconnect = false,
.use_fw_tx_credits = true, .use_fw_tx_credits = true,
.delay_unmap_buffer = false,
}, },
{ {
.id = QCA6174_HW_2_1_VERSION, .id = QCA6174_HW_2_1_VERSION,
...@@ -252,6 +256,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { ...@@ -252,6 +256,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
.dynamic_sar_support = false, .dynamic_sar_support = false,
.hw_restart_disconnect = false, .hw_restart_disconnect = false,
.use_fw_tx_credits = true, .use_fw_tx_credits = true,
.delay_unmap_buffer = false,
}, },
{ {
.id = QCA6174_HW_2_1_VERSION, .id = QCA6174_HW_2_1_VERSION,
...@@ -291,6 +296,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { ...@@ -291,6 +296,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
.dynamic_sar_support = false, .dynamic_sar_support = false,
.hw_restart_disconnect = false, .hw_restart_disconnect = false,
.use_fw_tx_credits = true, .use_fw_tx_credits = true,
.delay_unmap_buffer = false,
}, },
{ {
.id = QCA6174_HW_3_0_VERSION, .id = QCA6174_HW_3_0_VERSION,
...@@ -330,6 +336,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { ...@@ -330,6 +336,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
.dynamic_sar_support = false, .dynamic_sar_support = false,
.hw_restart_disconnect = false, .hw_restart_disconnect = false,
.use_fw_tx_credits = true, .use_fw_tx_credits = true,
.delay_unmap_buffer = false,
}, },
{ {
.id = QCA6174_HW_3_2_VERSION, .id = QCA6174_HW_3_2_VERSION,
...@@ -373,6 +380,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { ...@@ -373,6 +380,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
.dynamic_sar_support = true, .dynamic_sar_support = true,
.hw_restart_disconnect = false, .hw_restart_disconnect = false,
.use_fw_tx_credits = true, .use_fw_tx_credits = true,
.delay_unmap_buffer = false,
}, },
{ {
.id = QCA99X0_HW_2_0_DEV_VERSION, .id = QCA99X0_HW_2_0_DEV_VERSION,
...@@ -418,6 +426,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { ...@@ -418,6 +426,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
.dynamic_sar_support = false, .dynamic_sar_support = false,
.hw_restart_disconnect = false, .hw_restart_disconnect = false,
.use_fw_tx_credits = true, .use_fw_tx_credits = true,
.delay_unmap_buffer = false,
}, },
{ {
.id = QCA9984_HW_1_0_DEV_VERSION, .id = QCA9984_HW_1_0_DEV_VERSION,
...@@ -470,6 +479,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { ...@@ -470,6 +479,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
.dynamic_sar_support = false, .dynamic_sar_support = false,
.hw_restart_disconnect = false, .hw_restart_disconnect = false,
.use_fw_tx_credits = true, .use_fw_tx_credits = true,
.delay_unmap_buffer = false,
}, },
{ {
.id = QCA9888_HW_2_0_DEV_VERSION, .id = QCA9888_HW_2_0_DEV_VERSION,
...@@ -519,6 +529,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { ...@@ -519,6 +529,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
.dynamic_sar_support = false, .dynamic_sar_support = false,
.hw_restart_disconnect = false, .hw_restart_disconnect = false,
.use_fw_tx_credits = true, .use_fw_tx_credits = true,
.delay_unmap_buffer = false,
}, },
{ {
.id = QCA9377_HW_1_0_DEV_VERSION, .id = QCA9377_HW_1_0_DEV_VERSION,
...@@ -558,6 +569,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { ...@@ -558,6 +569,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
.dynamic_sar_support = false, .dynamic_sar_support = false,
.hw_restart_disconnect = false, .hw_restart_disconnect = false,
.use_fw_tx_credits = true, .use_fw_tx_credits = true,
.delay_unmap_buffer = false,
}, },
{ {
.id = QCA9377_HW_1_1_DEV_VERSION, .id = QCA9377_HW_1_1_DEV_VERSION,
...@@ -599,6 +611,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { ...@@ -599,6 +611,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
.dynamic_sar_support = false, .dynamic_sar_support = false,
.hw_restart_disconnect = false, .hw_restart_disconnect = false,
.use_fw_tx_credits = true, .use_fw_tx_credits = true,
.delay_unmap_buffer = false,
}, },
{ {
.id = QCA9377_HW_1_1_DEV_VERSION, .id = QCA9377_HW_1_1_DEV_VERSION,
...@@ -631,6 +644,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { ...@@ -631,6 +644,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
.dynamic_sar_support = false, .dynamic_sar_support = false,
.hw_restart_disconnect = false, .hw_restart_disconnect = false,
.use_fw_tx_credits = true, .use_fw_tx_credits = true,
.delay_unmap_buffer = false,
}, },
{ {
.id = QCA4019_HW_1_0_DEV_VERSION, .id = QCA4019_HW_1_0_DEV_VERSION,
...@@ -677,6 +691,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { ...@@ -677,6 +691,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
.dynamic_sar_support = false, .dynamic_sar_support = false,
.hw_restart_disconnect = false, .hw_restart_disconnect = false,
.use_fw_tx_credits = true, .use_fw_tx_credits = true,
.delay_unmap_buffer = false,
}, },
{ {
.id = WCN3990_HW_1_0_DEV_VERSION, .id = WCN3990_HW_1_0_DEV_VERSION,
...@@ -709,6 +724,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { ...@@ -709,6 +724,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
.dynamic_sar_support = true, .dynamic_sar_support = true,
.hw_restart_disconnect = true, .hw_restart_disconnect = true,
.use_fw_tx_credits = false, .use_fw_tx_credits = false,
.delay_unmap_buffer = true,
}, },
}; };
......
...@@ -56,6 +56,15 @@ void ath10k_htc_notify_tx_completion(struct ath10k_htc_ep *ep, ...@@ -56,6 +56,15 @@ void ath10k_htc_notify_tx_completion(struct ath10k_htc_ep *ep,
ath10k_dbg(ar, ATH10K_DBG_HTC, "%s: ep %d skb %pK\n", __func__, ath10k_dbg(ar, ATH10K_DBG_HTC, "%s: ep %d skb %pK\n", __func__,
ep->eid, skb); ep->eid, skb);
/* A corner case where the copy completion is reaching to host but still
* copy engine is processing it due to which host unmaps corresponding
* memory and causes SMMU fault, hence as workaround adding delay
* the unmapping memory to avoid SMMU faults.
*/
if (ar->hw_params.delay_unmap_buffer &&
ep->ul_pipe_id == 3)
mdelay(2);
hdr = (struct ath10k_htc_hdr *)skb->data; hdr = (struct ath10k_htc_hdr *)skb->data;
ath10k_htc_restore_tx_skb(ep->htc, skb); ath10k_htc_restore_tx_skb(ep->htc, skb);
......
...@@ -1108,8 +1108,10 @@ struct htt_rx_in_ord_ind { ...@@ -1108,8 +1108,10 @@ struct htt_rx_in_ord_ind {
u8 reserved; u8 reserved;
__le16 msdu_count; __le16 msdu_count;
union { union {
struct htt_rx_in_ord_msdu_desc msdu_descs32[0]; DECLARE_FLEX_ARRAY(struct htt_rx_in_ord_msdu_desc,
struct htt_rx_in_ord_msdu_desc_ext msdu_descs64[0]; msdu_descs32);
DECLARE_FLEX_ARRAY(struct htt_rx_in_ord_msdu_desc_ext,
msdu_descs64);
} __packed; } __packed;
} __packed; } __packed;
......
...@@ -637,6 +637,8 @@ struct ath10k_hw_params { ...@@ -637,6 +637,8 @@ struct ath10k_hw_params {
bool hw_restart_disconnect; bool hw_restart_disconnect;
bool use_fw_tx_credits; bool use_fw_tx_credits;
bool delay_unmap_buffer;
}; };
struct htt_resp; struct htt_resp;
......
...@@ -584,7 +584,14 @@ static void ath10k_wmi_event_tdls_peer(struct ath10k *ar, struct sk_buff *skb) ...@@ -584,7 +584,14 @@ static void ath10k_wmi_event_tdls_peer(struct ath10k *ar, struct sk_buff *skb)
ath10k_warn(ar, "did not find station from tdls peer event"); ath10k_warn(ar, "did not find station from tdls peer event");
goto exit; goto exit;
} }
arvif = ath10k_get_arvif(ar, __le32_to_cpu(ev->vdev_id)); arvif = ath10k_get_arvif(ar, __le32_to_cpu(ev->vdev_id));
if (!arvif) {
ath10k_warn(ar, "no vif for vdev_id %d found",
__le32_to_cpu(ev->vdev_id));
goto exit;
}
ieee80211_tdls_oper_request( ieee80211_tdls_oper_request(
arvif->vif, station->addr, arvif->vif, station->addr,
NL80211_TDLS_TEARDOWN, NL80211_TDLS_TEARDOWN,
......
...@@ -1641,7 +1641,7 @@ static void ath11k_update_11d(struct work_struct *work) ...@@ -1641,7 +1641,7 @@ static void ath11k_update_11d(struct work_struct *work)
} }
} }
static void ath11k_core_pre_reconfigure_recovery(struct ath11k_base *ab) void ath11k_core_pre_reconfigure_recovery(struct ath11k_base *ab)
{ {
struct ath11k *ar; struct ath11k *ar;
struct ath11k_pdev *pdev; struct ath11k_pdev *pdev;
...@@ -1677,6 +1677,10 @@ static void ath11k_core_pre_reconfigure_recovery(struct ath11k_base *ab) ...@@ -1677,6 +1677,10 @@ static void ath11k_core_pre_reconfigure_recovery(struct ath11k_base *ab)
ath11k_mac_tx_mgmt_pending_free, ar); ath11k_mac_tx_mgmt_pending_free, ar);
idr_destroy(&ar->txmgmt_idr); idr_destroy(&ar->txmgmt_idr);
wake_up(&ar->txmgmt_empty_waitq); wake_up(&ar->txmgmt_empty_waitq);
ar->monitor_vdev_id = -1;
clear_bit(ATH11K_FLAG_MONITOR_STARTED, &ar->monitor_flags);
clear_bit(ATH11K_FLAG_MONITOR_VDEV_CREATED, &ar->monitor_flags);
} }
wake_up(&ab->wmi_ab.tx_credits_wq); wake_up(&ab->wmi_ab.tx_credits_wq);
...@@ -1730,9 +1734,6 @@ static void ath11k_core_restart(struct work_struct *work) ...@@ -1730,9 +1734,6 @@ static void ath11k_core_restart(struct work_struct *work)
struct ath11k_base *ab = container_of(work, struct ath11k_base, restart_work); struct ath11k_base *ab = container_of(work, struct ath11k_base, restart_work);
int ret; int ret;
if (!ab->is_reset)
ath11k_core_pre_reconfigure_recovery(ab);
ret = ath11k_core_reconfigure_on_crash(ab); ret = ath11k_core_reconfigure_on_crash(ab);
if (ret) { if (ret) {
ath11k_err(ab, "failed to reconfigure driver on crash recovery\n"); ath11k_err(ab, "failed to reconfigure driver on crash recovery\n");
......
...@@ -505,6 +505,8 @@ struct ath11k_sta { ...@@ -505,6 +505,8 @@ struct ath11k_sta {
u64 ps_start_jiffies; u64 ps_start_jiffies;
u64 ps_total_duration; u64 ps_total_duration;
bool peer_current_ps_valid; bool peer_current_ps_valid;
u32 bw_prev;
}; };
#define ATH11K_MIN_5G_FREQ 4150 #define ATH11K_MIN_5G_FREQ 4150
...@@ -1157,6 +1159,7 @@ int ath11k_core_check_smbios(struct ath11k_base *ab); ...@@ -1157,6 +1159,7 @@ int ath11k_core_check_smbios(struct ath11k_base *ab);
void ath11k_core_halt(struct ath11k *ar); void ath11k_core_halt(struct ath11k *ar);
int ath11k_core_resume(struct ath11k_base *ab); int ath11k_core_resume(struct ath11k_base *ab);
int ath11k_core_suspend(struct ath11k_base *ab); int ath11k_core_suspend(struct ath11k_base *ab);
void ath11k_core_pre_reconfigure_recovery(struct ath11k_base *ab);
const struct firmware *ath11k_core_firmware_request(struct ath11k_base *ab, const struct firmware *ath11k_core_firmware_request(struct ath11k_base *ab,
const char *filename); const char *filename);
......
This diff is collapsed.
...@@ -218,9 +218,16 @@ int ath11k_pcic_read(struct ath11k_base *ab, void *buf, u32 start, u32 end) ...@@ -218,9 +218,16 @@ int ath11k_pcic_read(struct ath11k_base *ab, void *buf, u32 start, u32 end)
if (wakeup_required && ab->pci.ops->wakeup) { if (wakeup_required && ab->pci.ops->wakeup) {
ret = ab->pci.ops->wakeup(ab); ret = ab->pci.ops->wakeup(ab);
if (ret) { if (ret) {
ath11k_warn(ab, "failed to wakeup for read from 0x%x: %d\n", ath11k_warn(ab,
start, ret); "wakeup failed, data may be invalid: %d",
return ret; ret);
/* Even though wakeup() failed, continue processing rather
* than returning because some parts of the data may still
* be valid and useful in some cases, e.g. could give us
* some clues on firmware crash.
* Mislead due to invalid data could be avoided because we
* are aware of the wakeup failure.
*/
} }
} }
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#define SLEEP_CLOCK_SELECT_INTERNAL_BIT 0x02 #define SLEEP_CLOCK_SELECT_INTERNAL_BIT 0x02
#define HOST_CSTATE_BIT 0x04 #define HOST_CSTATE_BIT 0x04
#define PLATFORM_CAP_PCIE_GLOBAL_RESET 0x08 #define PLATFORM_CAP_PCIE_GLOBAL_RESET 0x08
#define PLATFORM_CAP_PCIE_PME_D3COLD 0x10
#define FW_BUILD_ID_MASK "QC_IMAGE_VERSION_STRING=" #define FW_BUILD_ID_MASK "QC_IMAGE_VERSION_STRING="
...@@ -1752,6 +1753,8 @@ static int ath11k_qmi_host_cap_send(struct ath11k_base *ab) ...@@ -1752,6 +1753,8 @@ static int ath11k_qmi_host_cap_send(struct ath11k_base *ab)
if (ab->hw_params.global_reset) if (ab->hw_params.global_reset)
req.nm_modem |= PLATFORM_CAP_PCIE_GLOBAL_RESET; req.nm_modem |= PLATFORM_CAP_PCIE_GLOBAL_RESET;
req.nm_modem |= PLATFORM_CAP_PCIE_PME_D3COLD;
ath11k_dbg(ab, ATH11K_DBG_QMI, "qmi host cap request\n"); ath11k_dbg(ab, ATH11K_DBG_QMI, "qmi host cap request\n");
ret = qmi_txn_init(&ab->qmi.handle, &txn, ret = qmi_txn_init(&ab->qmi.handle, &txn,
...@@ -1961,7 +1964,7 @@ static void ath11k_qmi_free_target_mem_chunk(struct ath11k_base *ab) ...@@ -1961,7 +1964,7 @@ static void ath11k_qmi_free_target_mem_chunk(struct ath11k_base *ab)
continue; continue;
dma_free_coherent(ab->dev, dma_free_coherent(ab->dev,
ab->qmi.target_mem[i].size, ab->qmi.target_mem[i].prev_size,
ab->qmi.target_mem[i].vaddr, ab->qmi.target_mem[i].vaddr,
ab->qmi.target_mem[i].paddr); ab->qmi.target_mem[i].paddr);
ab->qmi.target_mem[i].vaddr = NULL; ab->qmi.target_mem[i].vaddr = NULL;
...@@ -1982,12 +1985,12 @@ static int ath11k_qmi_alloc_target_mem_chunk(struct ath11k_base *ab) ...@@ -1982,12 +1985,12 @@ static int ath11k_qmi_alloc_target_mem_chunk(struct ath11k_base *ab)
* in such case, no need to allocate memory for FW again. * in such case, no need to allocate memory for FW again.
*/ */
if (chunk->vaddr) { if (chunk->vaddr) {
if (chunk->prev_type == chunk->type || if (chunk->prev_type == chunk->type &&
chunk->prev_size == chunk->size) chunk->prev_size == chunk->size)
continue; continue;
/* cannot reuse the existing chunk */ /* cannot reuse the existing chunk */
dma_free_coherent(ab->dev, chunk->size, dma_free_coherent(ab->dev, chunk->prev_size,
chunk->vaddr, chunk->paddr); chunk->vaddr, chunk->paddr);
chunk->vaddr = NULL; chunk->vaddr = NULL;
} }
...@@ -3158,6 +3161,9 @@ static void ath11k_qmi_driver_event_work(struct work_struct *work) ...@@ -3158,6 +3161,9 @@ static void ath11k_qmi_driver_event_work(struct work_struct *work)
case ATH11K_QMI_EVENT_SERVER_EXIT: case ATH11K_QMI_EVENT_SERVER_EXIT:
set_bit(ATH11K_FLAG_CRASH_FLUSH, &ab->dev_flags); set_bit(ATH11K_FLAG_CRASH_FLUSH, &ab->dev_flags);
set_bit(ATH11K_FLAG_RECOVERY, &ab->dev_flags); set_bit(ATH11K_FLAG_RECOVERY, &ab->dev_flags);
if (!ab->is_reset)
ath11k_core_pre_reconfigure_recovery(ab);
break; break;
case ATH11K_QMI_EVENT_REQUEST_MEM: case ATH11K_QMI_EVENT_REQUEST_MEM:
ret = ath11k_qmi_event_mem_request(qmi); ret = ath11k_qmi_event_mem_request(qmi);
......
...@@ -287,11 +287,7 @@ int ath11k_regd_update(struct ath11k *ar) ...@@ -287,11 +287,7 @@ int ath11k_regd_update(struct ath11k *ar)
goto err; goto err;
} }
rtnl_lock(); ret = regulatory_set_wiphy_regd(ar->hw->wiphy, regd_copy);
wiphy_lock(ar->hw->wiphy);
ret = regulatory_set_wiphy_regd_sync(ar->hw->wiphy, regd_copy);
wiphy_unlock(ar->hw->wiphy);
rtnl_unlock();
kfree(regd_copy); kfree(regd_copy);
......
...@@ -6829,7 +6829,7 @@ static void ath11k_wmi_event_peer_sta_ps_state_chg(struct ath11k_base *ab, ...@@ -6829,7 +6829,7 @@ static void ath11k_wmi_event_peer_sta_ps_state_chg(struct ath11k_base *ab,
} }
ath11k_dbg(ab, ATH11K_DBG_WMI, ath11k_dbg(ab, ATH11K_DBG_WMI,
"peer sta ps chnange ev addr %pM state %u sup_bitmap %x ps_valid %u ts %u\n", "peer sta ps change ev addr %pM state %u sup_bitmap %x ps_valid %u ts %u\n",
ev->peer_macaddr.addr, ev->peer_ps_state, ev->peer_macaddr.addr, ev->peer_ps_state,
ev->ps_supported_bitmap, ev->peer_ps_valid, ev->ps_supported_bitmap, ev->peer_ps_valid,
ev->peer_ps_timestamp); ev->peer_ps_timestamp);
......
...@@ -45,11 +45,6 @@ ath9k_hw-y:= \ ...@@ -45,11 +45,6 @@ ath9k_hw-y:= \
ar9003_eeprom.o \ ar9003_eeprom.o \
ar9003_paprd.o ar9003_paprd.o
# FIXME: temporarily silence -Warray-bounds on non W=1+ builds
ifndef KBUILD_EXTRA_WARN
CFLAGS_mac.o += -Wno-array-bounds
endif
ath9k_hw-$(CONFIG_ATH9K_WOW) += ar9003_wow.o ath9k_hw-$(CONFIG_ATH9K_WOW) += ar9003_wow.o
ath9k_hw-$(CONFIG_ATH9K_BTCOEX_SUPPORT) += btcoex.o \ ath9k_hw-$(CONFIG_ATH9K_BTCOEX_SUPPORT) += btcoex.o \
......
...@@ -708,14 +708,13 @@ static void ath9k_hif_usb_reg_in_cb(struct urb *urb) ...@@ -708,14 +708,13 @@ static void ath9k_hif_usb_reg_in_cb(struct urb *urb)
struct rx_buf *rx_buf = (struct rx_buf *)urb->context; struct rx_buf *rx_buf = (struct rx_buf *)urb->context;
struct hif_device_usb *hif_dev = rx_buf->hif_dev; struct hif_device_usb *hif_dev = rx_buf->hif_dev;
struct sk_buff *skb = rx_buf->skb; struct sk_buff *skb = rx_buf->skb;
struct sk_buff *nskb;
int ret; int ret;
if (!skb) if (!skb)
return; return;
if (!hif_dev) if (!hif_dev)
goto free; goto free_skb;
switch (urb->status) { switch (urb->status) {
case 0: case 0:
...@@ -724,7 +723,7 @@ static void ath9k_hif_usb_reg_in_cb(struct urb *urb) ...@@ -724,7 +723,7 @@ static void ath9k_hif_usb_reg_in_cb(struct urb *urb)
case -ECONNRESET: case -ECONNRESET:
case -ENODEV: case -ENODEV:
case -ESHUTDOWN: case -ESHUTDOWN:
goto free; goto free_skb;
default: default:
skb_reset_tail_pointer(skb); skb_reset_tail_pointer(skb);
skb_trim(skb, 0); skb_trim(skb, 0);
...@@ -735,25 +734,27 @@ static void ath9k_hif_usb_reg_in_cb(struct urb *urb) ...@@ -735,25 +734,27 @@ static void ath9k_hif_usb_reg_in_cb(struct urb *urb)
if (likely(urb->actual_length != 0)) { if (likely(urb->actual_length != 0)) {
skb_put(skb, urb->actual_length); skb_put(skb, urb->actual_length);
/* Process the command first */ /*
* Process the command first.
* skb is either freed here or passed to be
* managed to another callback function.
*/
ath9k_htc_rx_msg(hif_dev->htc_handle, skb, ath9k_htc_rx_msg(hif_dev->htc_handle, skb,
skb->len, USB_REG_IN_PIPE); skb->len, USB_REG_IN_PIPE);
skb = alloc_skb(MAX_REG_IN_BUF_SIZE, GFP_ATOMIC);
nskb = alloc_skb(MAX_REG_IN_BUF_SIZE, GFP_ATOMIC); if (!skb) {
if (!nskb) {
dev_err(&hif_dev->udev->dev, dev_err(&hif_dev->udev->dev,
"ath9k_htc: REG_IN memory allocation failure\n"); "ath9k_htc: REG_IN memory allocation failure\n");
urb->context = NULL; goto free_rx_buf;
return;
} }
rx_buf->skb = nskb; rx_buf->skb = skb;
usb_fill_int_urb(urb, hif_dev->udev, usb_fill_int_urb(urb, hif_dev->udev,
usb_rcvintpipe(hif_dev->udev, usb_rcvintpipe(hif_dev->udev,
USB_REG_IN_PIPE), USB_REG_IN_PIPE),
nskb->data, MAX_REG_IN_BUF_SIZE, skb->data, MAX_REG_IN_BUF_SIZE,
ath9k_hif_usb_reg_in_cb, rx_buf, 1); ath9k_hif_usb_reg_in_cb, rx_buf, 1);
} }
...@@ -762,12 +763,13 @@ static void ath9k_hif_usb_reg_in_cb(struct urb *urb) ...@@ -762,12 +763,13 @@ static void ath9k_hif_usb_reg_in_cb(struct urb *urb)
ret = usb_submit_urb(urb, GFP_ATOMIC); ret = usb_submit_urb(urb, GFP_ATOMIC);
if (ret) { if (ret) {
usb_unanchor_urb(urb); usb_unanchor_urb(urb);
goto free; goto free_skb;
} }
return; return;
free: free_skb:
kfree_skb(skb); kfree_skb(skb);
free_rx_buf:
kfree(rx_buf); kfree(rx_buf);
urb->context = NULL; urb->context = NULL;
} }
...@@ -780,14 +782,10 @@ static void ath9k_hif_usb_dealloc_tx_urbs(struct hif_device_usb *hif_dev) ...@@ -780,14 +782,10 @@ static void ath9k_hif_usb_dealloc_tx_urbs(struct hif_device_usb *hif_dev)
spin_lock_irqsave(&hif_dev->tx.tx_lock, flags); spin_lock_irqsave(&hif_dev->tx.tx_lock, flags);
list_for_each_entry_safe(tx_buf, tx_buf_tmp, list_for_each_entry_safe(tx_buf, tx_buf_tmp,
&hif_dev->tx.tx_buf, list) { &hif_dev->tx.tx_buf, list) {
usb_get_urb(tx_buf->urb);
spin_unlock_irqrestore(&hif_dev->tx.tx_lock, flags);
usb_kill_urb(tx_buf->urb);
list_del(&tx_buf->list); list_del(&tx_buf->list);
usb_free_urb(tx_buf->urb); usb_free_urb(tx_buf->urb);
kfree(tx_buf->buf); kfree(tx_buf->buf);
kfree(tx_buf); kfree(tx_buf);
spin_lock_irqsave(&hif_dev->tx.tx_lock, flags);
} }
spin_unlock_irqrestore(&hif_dev->tx.tx_lock, flags); spin_unlock_irqrestore(&hif_dev->tx.tx_lock, flags);
...@@ -1329,10 +1327,24 @@ static int send_eject_command(struct usb_interface *interface) ...@@ -1329,10 +1327,24 @@ static int send_eject_command(struct usb_interface *interface)
static int ath9k_hif_usb_probe(struct usb_interface *interface, static int ath9k_hif_usb_probe(struct usb_interface *interface,
const struct usb_device_id *id) const struct usb_device_id *id)
{ {
struct usb_endpoint_descriptor *bulk_in, *bulk_out, *int_in, *int_out;
struct usb_device *udev = interface_to_usbdev(interface); struct usb_device *udev = interface_to_usbdev(interface);
struct usb_host_interface *alt;
struct hif_device_usb *hif_dev; struct hif_device_usb *hif_dev;
int ret = 0; int ret = 0;
/* Verify the expected endpoints are present */
alt = interface->cur_altsetting;
if (usb_find_common_endpoints(alt, &bulk_in, &bulk_out, &int_in, &int_out) < 0 ||
usb_endpoint_num(bulk_in) != USB_WLAN_RX_PIPE ||
usb_endpoint_num(bulk_out) != USB_WLAN_TX_PIPE ||
usb_endpoint_num(int_in) != USB_REG_IN_PIPE ||
usb_endpoint_num(int_out) != USB_REG_OUT_PIPE) {
dev_err(&udev->dev,
"ath9k_htc: Device endpoint numbers are not the expected ones\n");
return -ENODEV;
}
if (id->driver_info == STORAGE_DEVICE) if (id->driver_info == STORAGE_DEVICE)
return send_eject_command(interface); return send_eject_command(interface);
......
...@@ -266,7 +266,9 @@ static void ath_mci_set_concur_txprio(struct ath_softc *sc) ...@@ -266,7 +266,9 @@ static void ath_mci_set_concur_txprio(struct ath_softc *sc)
stomp_txprio[ATH_BTCOEX_STOMP_NONE] = stomp_txprio[ATH_BTCOEX_STOMP_NONE] =
ATH_MCI_INQUIRY_PRIO; ATH_MCI_INQUIRY_PRIO;
} else { } else {
u8 prof_prio[] = { 50, 90, 94, 52 };/* RFCOMM, A2DP, HID, PAN */ static const u8 prof_prio[] = {
50, 90, 94, 52
}; /* RFCOMM, A2DP, HID, PAN */
stomp_txprio[ATH_BTCOEX_STOMP_LOW] = stomp_txprio[ATH_BTCOEX_STOMP_LOW] =
stomp_txprio[ATH_BTCOEX_STOMP_NONE] = 0xff; stomp_txprio[ATH_BTCOEX_STOMP_NONE] = 0xff;
...@@ -644,7 +646,9 @@ void ath9k_mci_update_wlan_channels(struct ath_softc *sc, bool allow_all) ...@@ -644,7 +646,9 @@ void ath9k_mci_update_wlan_channels(struct ath_softc *sc, bool allow_all)
struct ath_hw *ah = sc->sc_ah; struct ath_hw *ah = sc->sc_ah;
struct ath9k_hw_mci *mci = &ah->btcoex_hw.mci; struct ath9k_hw_mci *mci = &ah->btcoex_hw.mci;
struct ath9k_channel *chan = ah->curchan; struct ath9k_channel *chan = ah->curchan;
u32 channelmap[] = {0x00000000, 0xffff0000, 0xffffffff, 0x7fffffff}; static const u32 channelmap[] = {
0x00000000, 0xffff0000, 0xffffffff, 0x7fffffff
};
int i; int i;
s16 chan_start, chan_end; s16 chan_start, chan_end;
u16 wlan_chan; u16 wlan_chan;
......
...@@ -3,8 +3,3 @@ carl9170-objs := main.o usb.o cmd.o mac.o phy.o led.o fw.o tx.o rx.o ...@@ -3,8 +3,3 @@ carl9170-objs := main.o usb.o cmd.o mac.o phy.o led.o fw.o tx.o rx.o
carl9170-$(CONFIG_CARL9170_DEBUGFS) += debug.o carl9170-$(CONFIG_CARL9170_DEBUGFS) += debug.o
obj-$(CONFIG_CARL9170) += carl9170.o obj-$(CONFIG_CARL9170) += carl9170.o
# FIXME: temporarily silence -Warray-bounds on non W=1+ builds
ifndef KBUILD_EXTRA_WARN
CFLAGS_cmd.o += -Wno-array-bounds
endif
...@@ -271,7 +271,7 @@ struct ar9170_tx_frame { ...@@ -271,7 +271,7 @@ struct ar9170_tx_frame {
union { union {
struct ieee80211_hdr i3e; struct ieee80211_hdr i3e;
u8 payload[0]; DECLARE_FLEX_ARRAY(u8, payload);
} data; } data;
} __packed; } __packed;
......
...@@ -2154,7 +2154,7 @@ static const struct file_operations fops_led_blink_time = { ...@@ -2154,7 +2154,7 @@ static const struct file_operations fops_led_blink_time = {
}; };
/*---------FW capabilities------------*/ /*---------FW capabilities------------*/
static int wil_fw_capabilities_debugfs_show(struct seq_file *s, void *data) static int fw_capabilities_show(struct seq_file *s, void *data)
{ {
struct wil6210_priv *wil = s->private; struct wil6210_priv *wil = s->private;
...@@ -2163,22 +2163,10 @@ static int wil_fw_capabilities_debugfs_show(struct seq_file *s, void *data) ...@@ -2163,22 +2163,10 @@ static int wil_fw_capabilities_debugfs_show(struct seq_file *s, void *data)
return 0; return 0;
} }
DEFINE_SHOW_ATTRIBUTE(fw_capabilities);
static int wil_fw_capabilities_seq_open(struct inode *inode, struct file *file)
{
return single_open(file, wil_fw_capabilities_debugfs_show,
inode->i_private);
}
static const struct file_operations fops_fw_capabilities = {
.open = wil_fw_capabilities_seq_open,
.release = single_release,
.read = seq_read,
.llseek = seq_lseek,
};
/*---------FW version------------*/ /*---------FW version------------*/
static int wil_fw_version_debugfs_show(struct seq_file *s, void *data) static int fw_version_show(struct seq_file *s, void *data)
{ {
struct wil6210_priv *wil = s->private; struct wil6210_priv *wil = s->private;
...@@ -2189,19 +2177,7 @@ static int wil_fw_version_debugfs_show(struct seq_file *s, void *data) ...@@ -2189,19 +2177,7 @@ static int wil_fw_version_debugfs_show(struct seq_file *s, void *data)
return 0; return 0;
} }
DEFINE_SHOW_ATTRIBUTE(fw_version);
static int wil_fw_version_seq_open(struct inode *inode, struct file *file)
{
return single_open(file, wil_fw_version_debugfs_show,
inode->i_private);
}
static const struct file_operations fops_fw_version = {
.open = wil_fw_version_seq_open,
.release = single_release,
.read = seq_read,
.llseek = seq_lseek,
};
/*---------suspend_stats---------*/ /*---------suspend_stats---------*/
static ssize_t wil_write_suspend_stats(struct file *file, static ssize_t wil_write_suspend_stats(struct file *file,
...@@ -2366,8 +2342,8 @@ static const struct { ...@@ -2366,8 +2342,8 @@ static const struct {
{"recovery", 0644, &fops_recovery}, {"recovery", 0644, &fops_recovery},
{"led_cfg", 0644, &fops_led_cfg}, {"led_cfg", 0644, &fops_led_cfg},
{"led_blink_time", 0644, &fops_led_blink_time}, {"led_blink_time", 0644, &fops_led_blink_time},
{"fw_capabilities", 0444, &fops_fw_capabilities}, {"fw_capabilities", 0444, &fw_capabilities_fops},
{"fw_version", 0444, &fops_fw_version}, {"fw_version", 0444, &fw_version_fops},
{"suspend_stats", 0644, &fops_suspend_stats}, {"suspend_stats", 0644, &fops_suspend_stats},
{"compressed_rx_status", 0644, &fops_compressed_rx_status}, {"compressed_rx_status", 0644, &fops_compressed_rx_status},
{"srings", 0444, &srings_fops}, {"srings", 0444, &srings_fops},
......
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