Skip to content

Commit

Permalink
Merge ath-next from git://git.kernel.org/pub/scm/linux/kernel/git/kva…
Browse files Browse the repository at this point in the history
…lo/ath.git

ath.git patches for v5.6. Major changes:

ar5523

* add support for SMCWUSBT-G2 USB device
  • Loading branch information
Kalle Valo committed Jan 26, 2020
2 parents c2f9a4e + d7809bd commit 2a13513
Show file tree
Hide file tree
Showing 25 changed files with 346 additions and 105 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Optional properties:
entry in clock-names.
- clock-names: Should contain the clock names "wifi_wcss_cmd", "wifi_wcss_ref",
"wifi_wcss_rtc" for "qcom,ipq4019-wifi" compatible target and
"cxo_ref_clk_pin" for "qcom,wcn3990-wifi"
"cxo_ref_clk_pin" and optionally "qdss" for "qcom,wcn3990-wifi"
compatible target.
- qcom,msi_addr: MSI interrupt address.
- qcom,msi_base: Base value to add before writing MSI data into
Expand Down Expand Up @@ -88,6 +88,9 @@ Optional properties:
of the host capability QMI request
- qcom,xo-cal-data: xo cal offset to be configured in xo trim register.

- qcom,msa-fixed-perm: Boolean context flag to disable SCM call for statically
mapped msa region.

Example (to supply PCI based wifi block details):

In this example, the node is defined as child node of the PCI controller.
Expand Down Expand Up @@ -185,4 +188,5 @@ wifi@18000000 {
vdd-3.3-ch0-supply = <&vreg_l25a_3p3>;
memory-region = <&wifi_msa_mem>;
iommus = <&apps_smmu 0x0040 0x1>;
qcom,msa-fixed-perm;
};
4 changes: 3 additions & 1 deletion drivers/net/wireless/ath/ar5523/ar5523.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ static void ar5523_read_reply(struct ar5523 *ar, struct ar5523_cmd_hdr *hdr,

if (cmd->odata) {
if (cmd->olen < olen) {
ar5523_err(ar, "olen to small %d < %d\n",
ar5523_err(ar, "olen too small %d < %d\n",
cmd->olen, olen);
cmd->olen = 0;
cmd->res = -EOVERFLOW;
Expand Down Expand Up @@ -1770,6 +1770,8 @@ static const struct usb_device_id ar5523_id_table[] = {
AR5523_DEVICE_UX(0x0846, 0x4300), /* Netgear / WG111U */
AR5523_DEVICE_UG(0x0846, 0x4250), /* Netgear / WG111T */
AR5523_DEVICE_UG(0x0846, 0x5f00), /* Netgear / WPN111 */
AR5523_DEVICE_UG(0x083a, 0x4506), /* SMC / EZ Connect
SMCWUSBT-G2 */
AR5523_DEVICE_UG(0x157e, 0x3006), /* Umedia / AR5523_1 */
AR5523_DEVICE_UX(0x157e, 0x3205), /* Umedia / AR5523_2 */
AR5523_DEVICE_UG(0x157e, 0x3006), /* Umedia / TEW444UBEU */
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/ath/ath10k/htt_rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -2140,7 +2140,7 @@ static bool ath10k_htt_rx_pn_check_replay_hl(struct ath10k *ar,
if (last_pn_valid)
pn_invalid = ath10k_htt_rx_pn_cmp48(&new_pn, last_pn);
else
peer->tids_last_pn_valid[tid] = 1;
peer->tids_last_pn_valid[tid] = true;

if (!pn_invalid)
last_pn->pn48 = new_pn.pn48;
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/ath/ath10k/hw.h
Original file line number Diff line number Diff line change
Expand Up @@ -816,7 +816,7 @@ ath10k_is_rssi_enable(struct ath10k_hw_params *hw,

#define TARGET_10_4_TX_DBG_LOG_SIZE 1024
#define TARGET_10_4_NUM_WDS_ENTRIES 32
#define TARGET_10_4_DMA_BURST_SIZE 0
#define TARGET_10_4_DMA_BURST_SIZE 1
#define TARGET_10_4_MAC_AGGR_DELIM 0
#define TARGET_10_4_RX_SKIP_DEFRAG_TIMEOUT_DUP_DETECTION_CHECK 1
#define TARGET_10_4_VOW_CONFIG 0
Expand Down
21 changes: 18 additions & 3 deletions drivers/net/wireless/ath/ath10k/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -1578,7 +1578,7 @@ static int ath10k_pci_set_ram_config(struct ath10k *ar, u32 config)
return 0;
}

/* if an error happened returns < 0, otherwise the length */
/* Always returns the length */
static int ath10k_pci_dump_memory_sram(struct ath10k *ar,
const struct ath10k_mem_region *region,
u8 *buf)
Expand All @@ -1604,11 +1604,22 @@ static int ath10k_pci_dump_memory_reg(struct ath10k *ar,
{
struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
u32 i;
int ret;

mutex_lock(&ar->conf_mutex);
if (ar->state != ATH10K_STATE_ON) {
ath10k_warn(ar, "Skipping pci_dump_memory_reg invalid state\n");
ret = -EIO;
goto done;
}

for (i = 0; i < region->len; i += 4)
*(u32 *)(buf + i) = ioread32(ar_pci->mem + region->start + i);

return region->len;
ret = region->len;
done:
mutex_unlock(&ar->conf_mutex);
return ret;
}

/* if an error happened returns < 0, otherwise the length */
Expand Down Expand Up @@ -1704,7 +1715,11 @@ static void ath10k_pci_dump_memory(struct ath10k *ar,
count = ath10k_pci_dump_memory_sram(ar, current_region, buf);
break;
case ATH10K_MEM_REGION_TYPE_IOREG:
count = ath10k_pci_dump_memory_reg(ar, current_region, buf);
ret = ath10k_pci_dump_memory_reg(ar, current_region, buf);
if (ret < 0)
break;

count = ret;
break;
default:
ret = ath10k_pci_dump_memory_generic(ar, current_region, buf);
Expand Down
9 changes: 9 additions & 0 deletions drivers/net/wireless/ath/ath10k/qmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ static int ath10k_qmi_setup_msa_permissions(struct ath10k_qmi *qmi)
int ret;
int i;

if (qmi->msa_fixed_perm)
return 0;

for (i = 0; i < qmi->nr_mem_region; i++) {
ret = ath10k_qmi_map_msa_permission(qmi, &qmi->mem_region[i]);
if (ret)
Expand All @@ -102,6 +105,9 @@ static void ath10k_qmi_remove_msa_permission(struct ath10k_qmi *qmi)
{
int i;

if (qmi->msa_fixed_perm)
return;

for (i = 0; i < qmi->nr_mem_region; i++)
ath10k_qmi_unmap_msa_permission(qmi, &qmi->mem_region[i]);
}
Expand Down Expand Up @@ -1035,6 +1041,9 @@ static int ath10k_qmi_setup_msa_resources(struct ath10k_qmi *qmi, u32 msa_size)
qmi->msa_mem_size = msa_size;
}

if (of_property_read_bool(dev->of_node, "qcom,msa-fixed-perm"))
qmi->msa_fixed_perm = true;

ath10k_dbg(ar, ATH10K_DBG_QMI, "msa pa: %pad , msa va: 0x%p\n",
&qmi->msa_pa,
qmi->msa_va);
Expand Down
1 change: 1 addition & 0 deletions drivers/net/wireless/ath/ath10k/qmi.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ struct ath10k_qmi {
bool fw_ready;
char fw_build_timestamp[MAX_TIMESTAMP_LEN + 1];
struct ath10k_qmi_cal_data cal_data[MAX_NUM_CAL_V01];
bool msa_fixed_perm;
};

int ath10k_qmi_wlan_enable(struct ath10k *ar,
Expand Down
24 changes: 18 additions & 6 deletions drivers/net/wireless/ath/ath10k/sdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -642,16 +642,23 @@ static int ath10k_sdio_mbox_rx_fetch(struct ath10k *ar)

ret = ath10k_sdio_readsb(ar, ar_sdio->mbox_info.htc_addr,
skb->data, pkt->alloc_len);

if (ret) {
ar_sdio->n_rx_pkts = 0;
ath10k_sdio_mbox_free_rx_pkt(pkt);
return ret;
}
if (ret)
goto err;

htc_hdr = (struct ath10k_htc_hdr *)skb->data;
pkt->act_len = le16_to_cpu(htc_hdr->len) + sizeof(*htc_hdr);

if (pkt->act_len > pkt->alloc_len) {
ret = -EINVAL;
goto err;
}

skb_put(skb, pkt->act_len);
return 0;

err:
ar_sdio->n_rx_pkts = 0;
ath10k_sdio_mbox_free_rx_pkt(pkt);

return ret;
}
Expand Down Expand Up @@ -687,6 +694,11 @@ static int ath10k_sdio_mbox_rx_fetch_bundle(struct ath10k *ar)
htc_hdr = (struct ath10k_htc_hdr *)(ar_sdio->vsg_buffer + pkt_offset);
pkt->act_len = le16_to_cpu(htc_hdr->len) + sizeof(*htc_hdr);

if (pkt->act_len > pkt->alloc_len ) {
ret = -EINVAL;
goto err;
}

skb_put_data(pkt->skb, htc_hdr, pkt->act_len);
pkt_offset += pkt->alloc_len;
}
Expand Down
19 changes: 8 additions & 11 deletions drivers/net/wireless/ath/ath10k/snoc.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ static const char * const ath10k_regulators[] = {
};

static const char * const ath10k_clocks[] = {
"cxo_ref_clk_pin",
"cxo_ref_clk_pin", "qdss",
};

static void ath10k_snoc_htc_tx_cb(struct ath10k_ce_pipe *ce_state);
Expand Down Expand Up @@ -582,7 +582,7 @@ static void ath10k_snoc_process_rx_cb(struct ath10k_ce_pipe *ce_state,
max_nbytes, DMA_FROM_DEVICE);

if (unlikely(max_nbytes < nbytes)) {
ath10k_warn(ar, "rxed more than expected (nbytes %d, max %d)",
ath10k_warn(ar, "rxed more than expected (nbytes %d, max %d)\n",
nbytes, max_nbytes);
dev_kfree_skb_any(skb);
continue;
Expand Down Expand Up @@ -1201,7 +1201,7 @@ static int ath10k_snoc_request_irq(struct ath10k *ar)
irqflags, ce_name[id], ar);
if (ret) {
ath10k_err(ar,
"failed to register IRQ handler for CE %d: %d",
"failed to register IRQ handler for CE %d: %d\n",
id, ret);
goto err_irq;
}
Expand Down Expand Up @@ -1466,26 +1466,23 @@ MODULE_DEVICE_TABLE(of, ath10k_snoc_dt_match);
static int ath10k_snoc_probe(struct platform_device *pdev)
{
const struct ath10k_snoc_drv_priv *drv_data;
const struct of_device_id *of_id;
struct ath10k_snoc *ar_snoc;
struct device *dev;
struct ath10k *ar;
u32 msa_size;
int ret;
u32 i;

of_id = of_match_device(ath10k_snoc_dt_match, &pdev->dev);
if (!of_id) {
dev_err(&pdev->dev, "failed to find matching device tree id\n");
dev = &pdev->dev;
drv_data = device_get_match_data(dev);
if (!drv_data) {
dev_err(dev, "failed to find matching device tree id\n");
return -EINVAL;
}

drv_data = of_id->data;
dev = &pdev->dev;

ret = dma_set_mask_and_coherent(dev, drv_data->dma_mask);
if (ret) {
dev_err(dev, "failed to set dma mask: %d", ret);
dev_err(dev, "failed to set dma mask: %d\n", ret);
return ret;
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/ath/ath10k/wmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -9490,7 +9490,7 @@ static int ath10k_wmi_mgmt_tx_clean_up_pending(int msdu_id, void *ptr,

msdu = pkt_addr->vaddr;
dma_unmap_single(ar->dev, pkt_addr->paddr,
msdu->len, DMA_FROM_DEVICE);
msdu->len, DMA_TO_DEVICE);
ieee80211_free_txskb(ar->hw, msdu);

return 0;
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/ath/ath11k/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ config ATH11K_DEBUG

config ATH11K_DEBUGFS
bool "QCA ath11k debugfs support"
depends on ATH11K && DEBUG_FS
depends on ATH11K && DEBUG_FS && MAC80211_DEBUGFS
---help---
Enable ath11k debugfs support

Expand Down
3 changes: 1 addition & 2 deletions drivers/net/wireless/ath/ath11k/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ ath11k-y += core.o \
ce.o \
peer.o

ath11k-$(CONFIG_ATH11K_DEBUGFS) += debug_htt_stats.o
ath11k-$(CONFIG_MAC80211_DEBUGFS) += debugfs_sta.o
ath11k-$(CONFIG_ATH11K_DEBUGFS) += debug_htt_stats.o debugfs_sta.o
ath11k-$(CONFIG_NL80211_TESTMODE) += testmode.o
ath11k-$(CONFIG_ATH11K_TRACING) += trace.o

Expand Down
15 changes: 15 additions & 0 deletions drivers/net/wireless/ath/ath11k/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -931,7 +931,22 @@ static ssize_t ath11k_write_pktlog_filter(struct file *file,
HTT_RX_FILTER_TLV_FLAGS_PACKET_HEADER |
HTT_RX_FILTER_TLV_FLAGS_ATTENTION;
} else if (mode == ATH11K_PKTLOG_MODE_LITE) {
ret = ath11k_dp_tx_htt_h2t_ppdu_stats_req(ar,
HTT_PPDU_STATS_TAG_PKTLOG);
if (ret) {
ath11k_err(ar->ab, "failed to enable pktlog lite: %d\n", ret);
goto out;
}

rx_filter = HTT_RX_FILTER_TLV_LITE_MODE;
} else {
ret = ath11k_dp_tx_htt_h2t_ppdu_stats_req(ar,
HTT_PPDU_STATS_TAG_DEFAULT);
if (ret) {
ath11k_err(ar->ab, "failed to send htt ppdu stats req: %d\n",
ret);
goto out;
}
}

tlv_filter.rx_filter = rx_filter;
Expand Down
22 changes: 10 additions & 12 deletions drivers/net/wireless/ath/ath11k/debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,16 @@ static inline int ath11k_debug_is_extd_rx_stats_enabled(struct ath11k *ar)
{
return ar->debug.extd_rx_stats;
}

void ath11k_sta_add_debugfs(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
struct ieee80211_sta *sta, struct dentry *dir);
void
ath11k_accumulate_per_peer_tx_stats(struct ath11k_sta *arsta,
struct ath11k_per_peer_tx_stats *peer_stats,
u8 legacy_rate_idx);
void ath11k_update_per_peer_stats_from_txcompl(struct ath11k *ar,
struct sk_buff *msdu,
struct hal_tx_status *ts);
#else
static inline int ath11k_debug_soc_create(struct ath11k_base *ab)
{
Expand Down Expand Up @@ -243,19 +253,7 @@ static inline bool ath11k_debug_is_pktlog_peer_valid(struct ath11k *ar, u8 *addr
{
return false;
}
#endif /* CONFIG_ATH11K_DEBUGFS */

#ifdef CONFIG_MAC80211_DEBUGFS
void ath11k_sta_add_debugfs(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
struct ieee80211_sta *sta, struct dentry *dir);
void
ath11k_accumulate_per_peer_tx_stats(struct ath11k_sta *arsta,
struct ath11k_per_peer_tx_stats *peer_stats,
u8 legacy_rate_idx);
void ath11k_update_per_peer_stats_from_txcompl(struct ath11k *ar,
struct sk_buff *msdu,
struct hal_tx_status *ts);
#else /* !CONFIG_MAC80211_DEBUGFS */
static inline void
ath11k_accumulate_per_peer_tx_stats(struct ath11k_sta *arsta,
struct ath11k_per_peer_tx_stats *peer_stats,
Expand Down
Loading

0 comments on commit 2a13513

Please sign in to comment.