Merge ath-current from git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git
authorKalle Valo <kvalo@codeaurora.org>
Thu, 8 Feb 2018 17:28:49 +0000 (19:28 +0200)
committerKalle Valo <kvalo@codeaurora.org>
Thu, 8 Feb 2018 17:28:49 +0000 (19:28 +0200)
ath.git fixes for 4.16. Major changes:

ath10k

* correct firmware RAM dump length for QCA6174/QCA9377

* add new QCA988X device id

* fix a kernel panic during pci probe

* revert a recent commit which broke ath10k firmware metadata parsing

ath9k

* fix a noise floor regression introduced during the merge window

* add new device id

drivers/net/wireless/ath/ath10k/core.c
drivers/net/wireless/ath/ath10k/coredump.c
drivers/net/wireless/ath/ath10k/debug.c
drivers/net/wireless/ath/ath10k/hw.h
drivers/net/wireless/ath/ath10k/pci.c
drivers/net/wireless/ath/ath9k/calib.c
drivers/net/wireless/ath/ath9k/hif_usb.c
include/linux/pci_ids.h

index b0fdc1023619349bb726a3b238c9556dc1e1668e..f3ec13b80b20c1b27d4aa98dfb31a7751d81db27 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,
@@ -1276,10 +1305,7 @@ static int ath10k_core_fetch_board_data_api_n(struct ath10k *ar,
                len -= sizeof(*hdr);
                data = hdr->data;
 
-               /* jump over the padding */
-               ie_len = ALIGN(ie_len, 4);
-
-               if (len < ie_len) {
+               if (len < ALIGN(ie_len, 4)) {
                        ath10k_err(ar, "invalid length for board ie_id %d ie_len %zu len %zu\n",
                                   ie_id, ie_len, len);
                        ret = -EINVAL;
@@ -1318,6 +1344,9 @@ static int ath10k_core_fetch_board_data_api_n(struct ath10k *ar,
                        goto out;
                }
 
+               /* jump over the padding */
+               ie_len = ALIGN(ie_len, 4);
+
                len -= ie_len;
                data += ie_len;
        }
@@ -1448,9 +1477,6 @@ int ath10k_core_fetch_firmware_api_n(struct ath10k *ar, const char *name,
                len -= sizeof(*hdr);
                data += sizeof(*hdr);
 
-               /* jump over the padding */
-               ie_len = ALIGN(ie_len, 4);
-
                if (len < ie_len) {
                        ath10k_err(ar, "invalid length for FW IE %d (%zu < %zu)\n",
                                   ie_id, len, ie_len);
@@ -1556,6 +1582,9 @@ int ath10k_core_fetch_firmware_api_n(struct ath10k *ar, const char *name,
                        break;
                }
 
+               /* jump over the padding */
+               ie_len = ALIGN(ie_len, 4);
+
                len -= ie_len;
                data += ie_len;
        }
index 4dde126dab171a0b6eeed842fd8a0c962e089808..7173b3743b43b8256a28ce7df97d239e28d728bf 100644 (file)
@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2011-2017 Qualcomm Atheros, Inc.
+ * Copyright (c) 2018, The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above
@@ -616,7 +617,7 @@ static const struct ath10k_mem_region qca6174_hw30_mem_regions[] = {
        {
                .type = ATH10K_MEM_REGION_TYPE_DRAM,
                .start = 0x400000,
-               .len = 0x90000,
+               .len = 0xa8000,
                .name = "DRAM",
                .section_table = {
                        .sections = NULL,
index 6d836a26272fe7a7e4ab84c744111552c8d003b7..554cd7856cb6e2949cc5eff17aeb76a414204d63 100644 (file)
@@ -1,6 +1,7 @@
 /*
  * Copyright (c) 2005-2011 Atheros Communications Inc.
  * Copyright (c) 2011-2017 Qualcomm Atheros, Inc.
+ * Copyright (c) 2018, The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above
@@ -81,6 +82,8 @@ void ath10k_debug_print_hwfw_info(struct ath10k *ar)
 void ath10k_debug_print_board_info(struct ath10k *ar)
 {
        char boardinfo[100];
+       const struct firmware *board;
+       u32 crc;
 
        if (ar->id.bmi_ids_valid)
                scnprintf(boardinfo, sizeof(boardinfo), "%d:%d",
@@ -88,11 +91,16 @@ void ath10k_debug_print_board_info(struct ath10k *ar)
        else
                scnprintf(boardinfo, sizeof(boardinfo), "N/A");
 
+       board = ar->normal_mode_fw.board;
+       if (!IS_ERR_OR_NULL(board))
+               crc = crc32_le(0, board->data, board->size);
+       else
+               crc = 0;
+
        ath10k_info(ar, "board_file api %d bmi_id %s crc32 %08x",
                    ar->bd_api,
                    boardinfo,
-                   crc32_le(0, ar->normal_mode_fw.board->data,
-                            ar->normal_mode_fw.board->size));
+                   crc);
 }
 
 void ath10k_debug_print_boot_info(struct ath10k *ar)
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;
index 3d9447e21025f41bc59ea362b3a3e8d26161dd9f..695c779ae8cf7440084b3613daeb090ba86242f0 100644 (file)
@@ -72,7 +72,7 @@ static s16 ath9k_hw_get_default_nf(struct ath_hw *ah,
 s16 ath9k_hw_getchan_noise(struct ath_hw *ah, struct ath9k_channel *chan,
                           s16 nf)
 {
-       s8 noise = ath9k_hw_get_default_nf(ah, chan, 0);
+       s8 noise = ATH_DEFAULT_NOISE_FLOOR;
 
        if (nf) {
                s8 delta = nf - ATH9K_NF_CAL_NOISE_THRESH -
index 56676eaff24c186f323fc79330b061e3d74e6ae5..cb0eef13af1c8d3791832d78d70e5546b2ade346 100644 (file)
@@ -24,6 +24,7 @@ static const struct usb_device_id ath9k_hif_usb_ids[] = {
        { USB_DEVICE(0x0cf3, 0x9271) }, /* Atheros */
        { USB_DEVICE(0x0cf3, 0x1006) }, /* Atheros */
        { USB_DEVICE(0x0846, 0x9030) }, /* Netgear N150 */
+       { USB_DEVICE(0x07b8, 0x9271) }, /* Altai WA1011N-GU */
        { USB_DEVICE(0x07D1, 0x3A10) }, /* Dlink Wireless 150 */
        { USB_DEVICE(0x13D3, 0x3327) }, /* Azurewave */
        { USB_DEVICE(0x13D3, 0x3328) }, /* Azurewave */
index ab20dc5db423cd80f5e2b5a18a0e631af3a5e4b8..35871adfdc868e50bc66896af6e06cbdd59d9451 100644 (file)
 #define PCI_VENDOR_ID_DYNALINK         0x0675
 #define PCI_DEVICE_ID_DYNALINK_IS64PH  0x1702
 
+#define PCI_VENDOR_ID_UBIQUITI         0x0777
+
 #define PCI_VENDOR_ID_BERKOM                   0x0871
 #define PCI_DEVICE_ID_BERKOM_A1T               0xffa1
 #define PCI_DEVICE_ID_BERKOM_T_CONCEPT         0xffa2