]> Git Repo - linux.git/commitdiff
Merge tag 'mt76-for-kvalo-2021-04-12' of https://github.com/nbd168/wireless
authorKalle Valo <[email protected]>
Sat, 17 Apr 2021 08:34:43 +0000 (11:34 +0300)
committerKalle Valo <[email protected]>
Sat, 17 Apr 2021 08:34:43 +0000 (11:34 +0300)
mt76 patches for 5.13

* code cleanup
* mt7915/mt7615 decap offload support
* driver fixes
* mt7613 eeprom support
* MCU code unification
* threaded NAPI support
* new device IDs
* mt7921 device reset support
* rx timestamp support

# gpg: Signature made Tue 13 Apr 2021 12:11:25 AM EEST using DSA key ID 02A76EF5
# gpg: Good signature from "Felix Fietkau <[email protected]>"
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: 75D1 1A7D 91A7 710F 4900  42EF D77D 141D 02A7 6EF5

1  2 
drivers/net/wireless/mediatek/mt76/mt7915/debugfs.c
drivers/net/wireless/mediatek/mt76/mt7921/debugfs.c
drivers/net/wireless/mediatek/mt76/mt7921/regs.h

index 7bef36feb9c7b91152316307fe59d10c1fc986ab,2f706620686e8fb1471d9c66354cac91f3528eb1..587d55d240a17a57d5fe487f2d2a00b647c1807b
@@@ -124,7 -124,7 +124,7 @@@ mt7915_ampdu_stat_read_phy(struct mt791
                range[i] = mt76_rr(dev, MT_MIB_ARNG(ext_phy, i));
  
        for (i = 0; i < ARRAY_SIZE(bound); i++)
-               bound[i] = MT_MIB_ARNCR_RANGE(range[i / 4], i) + 1;
+               bound[i] = MT_MIB_ARNCR_RANGE(range[i / 4], i % 4) + 1;
  
        seq_printf(file, "\nPhy %d\n", ext_phy);
  
@@@ -192,7 -192,7 +192,7 @@@ mt7915_txbf_stat_read_phy(struct mt7915
  }
  
  static int
 -mt7915_tx_stats_read(struct seq_file *file, void *data)
 +mt7915_tx_stats_show(struct seq_file *file, void *data)
  {
        struct mt7915_dev *dev = file->private;
        int stat[8], i, n;
        return 0;
  }
  
 -static int
 -mt7915_tx_stats_open(struct inode *inode, struct file *f)
 -{
 -      return single_open(f, mt7915_tx_stats_read, inode->i_private);
 -}
 -
 -static const struct file_operations fops_tx_stats = {
 -      .open = mt7915_tx_stats_open,
 -      .read = seq_read,
 -      .llseek = seq_lseek,
 -      .release = single_release,
 -      .owner = THIS_MODULE,
 -};
 +DEFINE_SHOW_ATTRIBUTE(mt7915_tx_stats);
  
  static int mt7915_read_temperature(struct seq_file *s, void *data)
  {
@@@ -367,7 -379,7 +367,7 @@@ int mt7915_init_debugfs(struct mt7915_d
                                    mt7915_queues_read);
        debugfs_create_devm_seqfile(dev->mt76.dev, "acq", dir,
                                    mt7915_queues_acq);
 -      debugfs_create_file("tx_stats", 0400, dir, dev, &fops_tx_stats);
 +      debugfs_create_file("tx_stats", 0400, dir, dev, &mt7915_tx_stats_fops);
        debugfs_create_file("fw_debug", 0600, dir, dev, &fops_fw_debug);
        debugfs_create_file("implicit_txbf", 0600, dir, dev,
                            &fops_implicit_txbf);
@@@ -400,7 -412,7 +400,7 @@@ DEFINE_DEBUGFS_ATTRIBUTE(fops_fixed_rat
                         mt7915_sta_fixed_rate_set, "%llx\n");
  
  static int
 -mt7915_sta_stats_read(struct seq_file *s, void *data)
 +mt7915_sta_stats_show(struct seq_file *s, void *data)
  {
        struct ieee80211_sta *sta = s->private;
        struct mt7915_sta *msta = (struct mt7915_sta *)sta->drv_priv;
        return 0;
  }
  
 -static int
 -mt7915_sta_stats_open(struct inode *inode, struct file *f)
 -{
 -      return single_open(f, mt7915_sta_stats_read, inode->i_private);
 -}
 -
 -static const struct file_operations fops_sta_stats = {
 -      .open = mt7915_sta_stats_open,
 -      .read = seq_read,
 -      .llseek = seq_lseek,
 -      .release = single_release,
 -      .owner = THIS_MODULE,
 -};
 +DEFINE_SHOW_ATTRIBUTE(mt7915_sta_stats);
  
  void mt7915_sta_add_debugfs(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
                            struct ieee80211_sta *sta, struct dentry *dir)
  {
        debugfs_create_file("fixed_rate", 0600, dir, sta, &fops_fixed_rate);
 -      debugfs_create_file("stats", 0400, dir, sta, &fops_sta_stats);
 +      debugfs_create_file("stats", 0400, dir, sta, &mt7915_sta_stats_fops);
  }
  #endif
index c1a64ff6a19790d630af4443f3e57aa2dd3f7973,b2e8d698e0191f4b9d29cad17cb5b933066dad4a..94f0320ab2d4012bde552c8a65f314639515a112
@@@ -44,14 -44,13 +44,13 @@@ mt7921_ampdu_stat_read_phy(struct mt792
                range[i] = mt76_rr(dev, MT_MIB_ARNG(0, i));
  
        for (i = 0; i < ARRAY_SIZE(bound); i++)
-               bound[i] = MT_MIB_ARNCR_RANGE(range[i / 4], i) + 1;
+               bound[i] = MT_MIB_ARNCR_RANGE(range[i / 4], i % 4) + 1;
  
        seq_printf(file, "\nPhy0\n");
  
        seq_printf(file, "Length: %8d | ", bound[0]);
        for (i = 0; i < ARRAY_SIZE(bound) - 1; i++)
-               seq_printf(file, "%3d -%3d | ",
-                          bound[i] + 1, bound[i + 1]);
+               seq_printf(file, "%3d  %3d | ", bound[i] + 1, bound[i + 1]);
  
        seq_puts(file, "\nCount:  ");
        for (i = 0; i < ARRAY_SIZE(bound); i++)
@@@ -62,7 -61,7 +61,7 @@@
  }
  
  static int
 -mt7921_tx_stats_read(struct seq_file *file, void *data)
 +mt7921_tx_stats_show(struct seq_file *file, void *data)
  {
        struct mt7921_dev *dev = file->private;
        int stat[8], i, n;
        return 0;
  }
  
 -static int
 -mt7921_tx_stats_open(struct inode *inode, struct file *f)
 -{
 -      return single_open(f, mt7921_tx_stats_read, inode->i_private);
 -}
 -
 -static const struct file_operations fops_tx_stats = {
 -      .open = mt7921_tx_stats_open,
 -      .read = seq_read,
 -      .llseek = seq_lseek,
 -      .release = single_release,
 -      .owner = THIS_MODULE,
 -};
 +DEFINE_SHOW_ATTRIBUTE(mt7921_tx_stats);
  
  static int
  mt7921_queues_acq(struct seq_file *s, void *data)
@@@ -152,7 -163,6 +151,6 @@@ mt7921_pm_set(void *data, u64 val
  {
        struct mt7921_dev *dev = data;
        struct mt76_phy *mphy = dev->phy.mt76;
-       int ret = 0;
  
        mt7921_mutex_acquire(dev);
  
                                            mt7921_pm_interface_iter, mphy->priv);
        mt7921_mutex_release(dev);
  
-       return ret;
+       return 0;
  }
  
  static int
@@@ -227,7 -237,7 +225,7 @@@ int mt7921_init_debugfs(struct mt7921_d
                                    mt7921_queues_read);
        debugfs_create_devm_seqfile(dev->mt76.dev, "acq", dir,
                                    mt7921_queues_acq);
 -      debugfs_create_file("tx_stats", 0400, dir, dev, &fops_tx_stats);
 +      debugfs_create_file("tx_stats", 0400, dir, dev, &mt7921_tx_stats_fops);
        debugfs_create_file("fw_debug", 0600, dir, dev, &fops_fw_debug);
        debugfs_create_file("runtime-pm", 0600, dir, dev, &fops_pm);
        debugfs_create_file("idle-timeout", 0600, dir, dev,
index 6dad7f6ab09dfe1e6d3eda89d612423f4003a031,5b1bb5f85e5dbc390fba2ecf720524e4ef645262..76ecfea21dce684d73464c1c635facb8a25750b6
@@@ -96,8 -96,8 +96,8 @@@
  #define MT_WF_MIB_BASE(_band)         ((_band) ? 0xa4800 : 0x24800)
  #define MT_WF_MIB(_band, ofs)         (MT_WF_MIB_BASE(_band) + (ofs))
  
- #define MT_MIB_SDR3(_band)            MT_WF_MIB(_band, 0x014)
- #define MT_MIB_SDR3_FCS_ERR_MASK      GENMASK(15, 0)
+ #define MT_MIB_SDR3(_band)            MT_WF_MIB(_band, 0x698)
+ #define MT_MIB_SDR3_FCS_ERR_MASK      GENMASK(31, 16)
  
  #define MT_MIB_SDR9(_band)            MT_WF_MIB(_band, 0x02c)
  #define MT_MIB_SDR9_BUSY_MASK         GENMASK(23, 0)
  #define MT_MIB_RTS_RETRIES_COUNT_MASK GENMASK(31, 16)
  #define MT_MIB_RTS_COUNT_MASK         GENMASK(15, 0)
  
- #define MT_MIB_MB_SDR1(_band, n)      MT_WF_MIB(_band, 0x104 + ((n) << 4))
- #define MT_MIB_BA_MISS_COUNT_MASK     GENMASK(15, 0)
- #define MT_MIB_ACK_FAIL_COUNT_MASK    GENMASK(31, 16)
+ #define MT_MIB_MB_BSDR0(_band)                MT_WF_MIB(_band, 0x688)
+ #define MT_MIB_RTS_COUNT_MASK         GENMASK(15, 0)
+ #define MT_MIB_MB_BSDR1(_band)                MT_WF_MIB(_band, 0x690)
+ #define MT_MIB_RTS_FAIL_COUNT_MASK    GENMASK(15, 0)
+ #define MT_MIB_MB_BSDR2(_band)                MT_WF_MIB(_band, 0x518)
+ #define MT_MIB_BA_FAIL_COUNT_MASK     GENMASK(15, 0)
+ #define MT_MIB_MB_BSDR3(_band)                MT_WF_MIB(_band, 0x520)
+ #define MT_MIB_ACK_FAIL_COUNT_MASK    GENMASK(15, 0)
  
  #define MT_MIB_MB_SDR2(_band, n)      MT_WF_MIB(_band, 0x108 + ((n) << 4))
  #define MT_MIB_FRAME_RETRIES_COUNT_MASK       GENMASK(15, 0)
  
- #define MT_TX_AGG_CNT(_band, n)               MT_WF_MIB(_band, 0x0a8 + ((n) << 2))
- #define MT_TX_AGG_CNT2(_band, n)      MT_WF_MIB(_band, 0x164 + ((n) << 2))
- #define MT_MIB_ARNG(_band, n)         MT_WF_MIB(_band, 0x4b8 + ((n) << 2))
+ #define MT_TX_AGG_CNT(_band, n)               MT_WF_MIB(_band, 0x7dc + ((n) << 2))
+ #define MT_TX_AGG_CNT2(_band, n)      MT_WF_MIB(_band, 0x7ec + ((n) << 2))
+ #define MT_MIB_ARNG(_band, n)         MT_WF_MIB(_band, 0x0b0 + ((n) << 2))
  #define MT_MIB_ARNCR_RANGE(val, n)    (((val) >> ((n) << 3)) & GENMASK(7, 0))
  
  #define MT_WTBLON_TOP_BASE            0x34000
  #define MT_WTBLON_TOP(ofs)            (MT_WTBLON_TOP_BASE + (ofs))
 -#define MT_WTBLON_TOP_WDUCR           MT_WTBLON_TOP(0x0)
 +#define MT_WTBLON_TOP_WDUCR           MT_WTBLON_TOP(0x200)
  #define MT_WTBLON_TOP_WDUCR_GROUP     GENMASK(2, 0)
  
 -#define MT_WTBL_UPDATE                        MT_WTBLON_TOP(0x030)
 +#define MT_WTBL_UPDATE                        MT_WTBLON_TOP(0x230)
  #define MT_WTBL_UPDATE_WLAN_IDX               GENMASK(9, 0)
  #define MT_WTBL_UPDATE_ADM_COUNT_CLEAR        BIT(12)
  #define MT_WTBL_UPDATE_BUSY           BIT(31)
  #define MT_INFRA_CFG_BASE             0xfe000
  #define MT_INFRA(ofs)                 (MT_INFRA_CFG_BASE + (ofs))
  
- #define MT_HIF_REMAP_L1                       MT_INFRA(0x260)
+ #define MT_HIF_REMAP_L1                       MT_INFRA(0x24c)
  #define MT_HIF_REMAP_L1_MASK          GENMASK(15, 0)
  #define MT_HIF_REMAP_L1_OFFSET                GENMASK(15, 0)
  #define MT_HIF_REMAP_L1_BASE          GENMASK(31, 16)
- #define MT_HIF_REMAP_BASE_L1          0xe0000
+ #define MT_HIF_REMAP_BASE_L1          0x40000
  
  #define MT_SWDEF_BASE                 0x41f200
  #define MT_SWDEF(ofs)                 (MT_SWDEF_BASE + (ofs))
  #define MT_TOP_MISC                   MT_TOP(0xf0)
  #define MT_TOP_MISC_FW_STATE          GENMASK(2, 0)
  
+ #define MT_MCU_WPDMA0_BASE            0x54000000
+ #define MT_MCU_WPDMA0(ofs)            (MT_MCU_WPDMA0_BASE + (ofs))
+ #define MT_WFDMA_DUMMY_CR             MT_MCU_WPDMA0(0x120)
+ #define MT_WFDMA_NEED_REINIT          BIT(1)
  #define MT_HW_BOUND                   0x70010020
  #define MT_HW_CHIPID                  0x70010200
  #define MT_HW_REV                     0x70010204
  
- #define MT_PCIE_MAC_BASE              0x74030000
+ #define MT_PCIE_MAC_BASE              0x10000
  #define MT_PCIE_MAC(ofs)              (MT_PCIE_MAC_BASE + (ofs))
  #define MT_PCIE_MAC_INT_ENABLE                MT_PCIE_MAC(0x188)
  
  #define PCIE_LPCR_HOST_CLR_OWN                BIT(1)
  #define PCIE_LPCR_HOST_SET_OWN                BIT(0)
  
+ #define MT_WFSYS_SW_RST_B             0x18000140
+ #define WFSYS_SW_RST_B                        BIT(0)
+ #define WFSYS_SW_INIT_DONE            BIT(4)
  #define MT_CONN_ON_MISC                       0x7c0600f0
  #define MT_TOP_MISC2_FW_N9_RDY                GENMASK(1, 0)
  
This page took 0.08563 seconds and 4 git commands to generate.