]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
ath10k: add support for Ubiquiti rebranded QCA988X v2
authorTobias Schramm <tobleminer@gmail.com>
Tue, 30 Jan 2018 12:06:05 +0000 (14:06 +0200)
committerKalle Valo <kvalo@codeaurora.org>
Wed, 7 Feb 2018 14:09:44 +0000 (16:09 +0200)
Some modern Ubiquiti devices contain a rebranded QCA988X rev2 with
a custom Ubiquiti vendor and device id. This patch adds support for
those devices, treating them as a QCA988X v2.

Signed-off-by: Tobias Schramm <tobleminer@gmail.com>
[kvalo@codeaurora.org: rebase, add missing fields in hw_params, fix a long line in pci.c:61]
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/ath/ath10k/core.c
drivers/net/wireless/ath/ath10k/hw.h
drivers/net/wireless/ath/ath10k/pci.c

index b0fdc1023619349bb726a3b238c9556dc1e1668e..6fb282f76804cdbe1d6ae8c3a022a2db4d22bab6 100644 (file)
@@ -90,6 +90,35 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
                .target_64bit = false,
                .rx_ring_fill_level = HTT_RX_RING_FILL_LEVEL,
        },
+       {
+               .id = QCA988X_HW_2_0_VERSION,
+               .dev_id = QCA988X_2_0_DEVICE_ID_UBNT,
+               .name = "qca988x hw2.0 ubiquiti",
+               .patch_load_addr = QCA988X_HW_2_0_PATCH_LOAD_ADDR,
+               .uart_pin = 7,
+               .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_ALL,
+               .otp_exe_param = 0,
+               .channel_counters_freq_hz = 88000,
+               .max_probe_resp_desc_thres = 0,
+               .cal_data_len = 2116,
+               .fw = {
+                       .dir = QCA988X_HW_2_0_FW_DIR,
+                       .board = QCA988X_HW_2_0_BOARD_DATA_FILE,
+                       .board_size = QCA988X_BOARD_DATA_SZ,
+                       .board_ext_size = QCA988X_BOARD_EXT_DATA_SZ,
+               },
+               .hw_ops = &qca988x_ops,
+               .decap_align_bytes = 4,
+               .spectral_bin_discard = 0,
+               .vht160_mcs_rx_highest = 0,
+               .vht160_mcs_tx_highest = 0,
+               .n_cipher_suites = 8,
+               .num_peers = TARGET_TLV_NUM_PEERS,
+               .ast_skid_limit = 0x10,
+               .num_wds_entries = 0x20,
+               .target_64bit = false,
+               .rx_ring_fill_level = HTT_RX_RING_FILL_LEVEL,
+       },
        {
                .id = QCA9887_HW_1_0_VERSION,
                .dev_id = QCA9887_1_0_DEVICE_ID,
index 6203bc65799bee7b38a14d7be82bae9d506c7b8c..413b1b4321f77f7dfbd947844e1fad40d36f0e08 100644 (file)
@@ -22,6 +22,7 @@
 
 #define ATH10K_FW_DIR                  "ath10k"
 
+#define QCA988X_2_0_DEVICE_ID_UBNT   (0x11ac)
 #define QCA988X_2_0_DEVICE_ID   (0x003c)
 #define QCA6164_2_1_DEVICE_ID   (0x0041)
 #define QCA6174_2_1_DEVICE_ID   (0x003e)
index 355db6a0fcf3ee9ddc3213bece83da1004c36e4c..1b266cd0c2ec086bd76eae5ffe2bce66a9c6a4a4 100644 (file)
@@ -58,6 +58,9 @@ MODULE_PARM_DESC(reset_mode, "0: auto, 1: warm only (default: 0)");
 #define ATH10K_DIAG_TRANSFER_LIMIT     0x5000
 
 static const struct pci_device_id ath10k_pci_id_table[] = {
+       /* PCI-E QCA988X V2 (Ubiquiti branded) */
+       { PCI_VDEVICE(UBIQUITI, QCA988X_2_0_DEVICE_ID_UBNT) },
+
        { PCI_VDEVICE(ATHEROS, QCA988X_2_0_DEVICE_ID) }, /* PCI-E QCA988X V2 */
        { PCI_VDEVICE(ATHEROS, QCA6164_2_1_DEVICE_ID) }, /* PCI-E QCA6164 V2.1 */
        { PCI_VDEVICE(ATHEROS, QCA6174_2_1_DEVICE_ID) }, /* PCI-E QCA6174 V2.1 */
@@ -74,6 +77,7 @@ static const struct ath10k_pci_supp_chip ath10k_pci_supp_chips[] = {
         * hacks. ath10k doesn't have them and these devices crash horribly
         * because of that.
         */
+       { QCA988X_2_0_DEVICE_ID_UBNT, QCA988X_HW_2_0_CHIP_ID_REV },
        { QCA988X_2_0_DEVICE_ID, QCA988X_HW_2_0_CHIP_ID_REV },
 
        { QCA6164_2_1_DEVICE_ID, QCA6174_HW_2_1_CHIP_ID_REV },
@@ -2193,6 +2197,7 @@ static int ath10k_pci_get_num_banks(struct ath10k *ar)
        struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
 
        switch (ar_pci->pdev->device) {
+       case QCA988X_2_0_DEVICE_ID_UBNT:
        case QCA988X_2_0_DEVICE_ID:
        case QCA99X0_2_0_DEVICE_ID:
        case QCA9888_2_0_DEVICE_ID:
@@ -3424,6 +3429,7 @@ static int ath10k_pci_probe(struct pci_dev *pdev,
        u32 (*targ_cpu_to_ce_addr)(struct ath10k *ar, u32 addr);
 
        switch (pci_dev->device) {
+       case QCA988X_2_0_DEVICE_ID_UBNT:
        case QCA988X_2_0_DEVICE_ID:
                hw_rev = ATH10K_HW_QCA988X;
                pci_ps = false;