]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
ath10k: htt: support MSDU ids with SDIO
authorAlagu Sankar <alagusankar@silex-india.com>
Fri, 19 Apr 2019 07:28:54 +0000 (10:28 +0300)
committerKalle Valo <kvalo@codeaurora.org>
Tue, 23 Apr 2019 13:24:06 +0000 (16:24 +0300)
Transmit completion for SDIO is similar to PCIe, modify the high
latency path to allow SDIO modules to use the msdu id.

kvalo: the original patch from Alagu enabled this only for SDIO but I'm not
sure should we also enable this with USB. I'll use bus params to enable this
for so that it's easy to enable also for USB later.

Tested with QCA6174 SDIO with firmware WLAN.RMH.4.4.1-00007-QCARMSWP-1.

Co-developed-by: Wen Gong <wgong@codeaurora.org>
Signed-off-by: Alagu Sankar <alagusankar@silex-india.com>
Signed-off-by: Wen Gong <wgong@codeaurora.org>.
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/ath/ath10k/core.h
drivers/net/wireless/ath/ath10k/htt_tx.c
drivers/net/wireless/ath/ath10k/sdio.c

index e08a17b01e035dba87cc63a05d29cd59f0d732f4..f22cb3f4903489141c0398d7e06a9b90c3284f95 100644 (file)
@@ -919,6 +919,7 @@ struct ath10k_bus_params {
        u32 chip_id;
        enum ath10k_dev_type dev_type;
        bool link_can_suspend;
+       bool hl_msdu_ids;
 };
 
 struct ath10k {
index d8e9cc0bb772972fbc2b972d7baf3cd840ed3c84..88f880b601d84cbad020ca9aa1a9963e54123b91 100644 (file)
@@ -1244,6 +1244,7 @@ static int ath10k_htt_tx_hl(struct ath10k_htt *htt, enum ath10k_hw_txrx_mode txm
        u8 tid = ath10k_htt_tx_get_tid(msdu, is_eth);
        u8 flags0 = 0;
        u16 flags1 = 0;
+       u16 msdu_id = 0;
 
        data_len = msdu->len;
 
@@ -1291,6 +1292,16 @@ static int ath10k_htt_tx_hl(struct ath10k_htt *htt, enum ath10k_hw_txrx_mode txm
                }
        }
 
+       if (ar->bus_param.hl_msdu_ids) {
+               flags1 |= HTT_DATA_TX_DESC_FLAGS1_POSTPONED;
+               res = ath10k_htt_tx_alloc_msdu_id(htt, msdu);
+               if (res < 0) {
+                       ath10k_err(ar, "msdu_id allocation failed %d\n", res);
+                       goto out;
+               }
+               msdu_id = res;
+       }
+
        skb_push(msdu, sizeof(*cmd_hdr));
        skb_push(msdu, sizeof(*tx_desc));
        cmd_hdr = (struct htt_cmd_hdr *)msdu->data;
@@ -1300,7 +1311,7 @@ static int ath10k_htt_tx_hl(struct ath10k_htt *htt, enum ath10k_hw_txrx_mode txm
        tx_desc->flags0 = flags0;
        tx_desc->flags1 = __cpu_to_le16(flags1);
        tx_desc->len = __cpu_to_le16(data_len);
-       tx_desc->id = 0;
+       tx_desc->id = __cpu_to_le16(msdu_id);
        tx_desc->frags_paddr = 0; /* always zero */
        /* Initialize peer_id to INVALID_PEER because this is NOT
         * Reinjection path
index bbfdc4d7cf5fa32f2da9de826184a7fa64c06a08..d5073fac9509a829a8acbdda6d117251b84bff37 100644 (file)
@@ -2045,6 +2045,8 @@ static int ath10k_sdio_probe(struct sdio_func *func,
        bus_params.dev_type = ATH10K_DEV_TYPE_HL;
        /* TODO: don't know yet how to get chip_id with SDIO */
        bus_params.chip_id = 0;
+       bus_params.hl_msdu_ids = true;
+
        ret = ath10k_core_register(ar, &bus_params);
        if (ret) {
                ath10k_err(ar, "failed to register driver core: %d\n", ret);