diff --git a/ath10k/debug.c b/ath10k/debug.c index 8638697..af2da82 100644 --- a/ath10k/debug.c +++ b/ath10k/debug.c @@ -1053,6 +1053,10 @@ static ssize_t ath10k_read_debug_level(struct file *file, "BMI: 0x400\n" "REGULATORY: 0x800\n" "TESTMODE: 0x1000\n" + "WMI-PRINT: 0x2000\n" + "PCI-PS: 0x4000\n" + "AHB: 0x8000\n" + "MAC2: 0x20000000\n" "INFO-AS-DBG: 0x40000000\n" "FW: 0x80000000\n" "ALL: 0xFFFFFFFF\n"; diff --git a/ath10k/debug.h b/ath10k/debug.h index d045374..a788057 100644 --- a/ath10k/debug.h +++ b/ath10k/debug.h @@ -42,6 +42,7 @@ enum ath10k_debug_mask { ATH10K_DBG_WMI_PRINT = 0x00002000, ATH10K_DBG_PCI_PS = 0x00004000, ATH10K_DBG_AHB = 0x00008000, + ATH10K_DBG_MAC2 = 0x20000000, /* more verbose MAC debugging */ ATH10K_DBG_INFO_AS_DBG = 0x40000000, ATH10K_DBG_FW = 0x80000000, ATH10K_DBG_ANY = 0xffffffff, diff --git a/ath10k/mac.c b/ath10k/mac.c index 4befdf4..ac69d03 100644 --- a/ath10k/mac.c +++ b/ath10k/mac.c @@ -2278,12 +2278,35 @@ static void ath10k_peer_assoc_h_rate_overrides(struct ath10k *ar, int i; int j; int hw_rix; - int hw_nss = ar->num_rf_chains; + /* So, what we really want here is the max number of chains the firmware + * is compiled for. But, since we can have 3x3 firmware run on 2x2 chips, + * then we need to hack on this in gruesome ways. Better have the hack here + * than try to extend FW's ability to send that value I think. + */ + int hw_nss = ar->num_rf_chains; if (! test_bit(ATH10K_FW_FEATURE_CT_RATEMASK, ar->running_fw->fw_file.fw_features)) return; + /* Ignore devices not known to be supported, this is a minor feature and + * not worth breaking systems for users that don't need it. + */ + if (!((ar->dev_id == QCA988X_2_0_DEVICE_ID) || + (ar->dev_id == QCA99X0_2_0_DEVICE_ID) || + (ar->dev_id == QCA9984_1_0_DEVICE_ID))) { + ath10k_warn(ar, "rate-override: Skipping un-supported device-id, hw-nss: %d dev-id: 0x%x\n", + hw_nss, ar->dev_id); + return; + } + + if (hw_nss < 3) { + /* Maybe 2x2 NIC booting 3x3 988x firmware? */ + if (ar->dev_id == QCA988X_2_0_DEVICE_ID) { + hw_nss = 3; + } + } + lockdep_assert_held(&ar->conf_mutex); if (WARN_ON(ath10k_mac_vif_chan(vif, &def))) @@ -2294,8 +2317,8 @@ static void ath10k_peer_assoc_h_rate_overrides(struct ath10k *ar, ratemask = arvif->bitrate_mask.control[band].legacy; rates = sband->bitrates; - ath10k_warn(ar, "band: %d ratemask: 0x%x hw-nss: %d\n", - band, ratemask, hw_nss); + ath10k_warn(ar, "band: %d ratemask: 0x%x hw-nss: %d dev-id: 0x%x\n", + band, ratemask, hw_nss, ar->dev_id); arg->has_rate_overrides = true; @@ -2314,9 +2337,9 @@ static void ath10k_peer_assoc_h_rate_overrides(struct ath10k *ar, /* ofdm rates start at rix 4 */ hw_rix = rates->hw_value + 4; } - //ath10k_dbg(ar, ATH10K_DBG_MAC, - // "set-enabled, bitrate: %d i: %d hw-value: %d hw-rix: %d\n", - // rates->bitrate, i, rates->hw_value, hw_rix); + ath10k_dbg(ar, ATH10K_DBG_MAC2, + "set-enabled, bitrate: %d i: %d hw-value: %d hw-rix: %d\n", + rates->bitrate, i, rates->hw_value, hw_rix); ath10k_set_rate_enabled(hw_rix, arg->rate_overrides, 1); } @@ -2327,13 +2350,13 @@ static void ath10k_peer_assoc_h_rate_overrides(struct ath10k *ar, */ for (i = 0; i < hw_nss; i++) { unsigned int mcs = arvif->bitrate_mask.control[band].ht_mcs[i]; - //ath10k_warn(ar, "ht-mcs [%i]: 0x%x\n", i, mcs); + ath10k_dbg(ar, ATH10K_DBG_MAC2, "ht-mcs [%i]: 0x%x\n", i, mcs); for (j = 0; j<8; j++) { if (mcs & (1<rate_overrides, 1); /* Set HT40 rateset too */ ath10k_set_rate_enabled(hw_rix + hw_nss * 8, arg->rate_overrides, 1); @@ -2350,13 +2373,13 @@ static void ath10k_peer_assoc_h_rate_overrides(struct ath10k *ar, */ for (i = 0; i < hw_nss; i++) { unsigned int mcs = arvif->bitrate_mask.control[band].vht_mcs[i]; - //ath10k_warn(ar, "vht-mcs [%i]: 0x%x\n", i, mcs); + ath10k_dbg(ar, ATH10K_DBG_MAC2, "vht-mcs [%i]: 0x%x\n", i, mcs); for (j = 0; j<10; j++) { if (mcs & (1<rate_overrides, 1); /* Set HT40 rateset too */ ath10k_set_rate_enabled(hw_rix + hw_nss * 10, arg->rate_overrides, 1); @@ -2366,14 +2389,12 @@ static void ath10k_peer_assoc_h_rate_overrides(struct ath10k *ar, } } -#if 0 for (i = 0; i < sizeof(arg->rate_overrides); i++) { if (arg->rate_overrides[i] != 0xFF) { - ath10k_warn(ar, "vif: %d rate-overrides[%d]: 0x%x\n", - arvif->vdev_id, i, arg->rate_overrides[i]); + ath10k_dbg(ar, ATH10K_DBG_MAC2, "vif: %d rate-overrides[%d]: 0x%x\n", + arvif->vdev_id, i, arg->rate_overrides[i]); } } -#endif } static u8 get_nss_from_chainmask(u16 chain_mask) diff --git a/ath10k/pci.c b/ath10k/pci.c index e1d8ccf..e8aead1 100644 --- a/ath10k/pci.c +++ b/ath10k/pci.c @@ -3448,7 +3448,8 @@ static int ath10k_pci_probe(struct pci_dev *pdev, int (*pci_soft_reset)(struct ath10k *ar); int (*pci_hard_reset)(struct ath10k *ar); - printk(KERN_INFO "ath10k driver, optimized for CT firmware, probing pci.\n"); + printk(KERN_INFO "ath10k driver, optimized for CT firmware, probing pci device: 0x%x.\n", + pci_dev->device); switch (pci_dev->device) { case QCA988X_2_0_DEVICE_ID: