mt7603: fix wtbl3/4 offsets

Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
Felix Fietkau
2016-02-20 20:16:23 +01:00
parent a2d894e2de
commit 85d873df16
2 changed files with 15 additions and 6 deletions
+12 -6
View File
@@ -106,12 +106,18 @@ void mt7603_wtbl_init(struct mt7603_dev *dev, int idx, const u8 *mac_addr)
void mt7603_wtbl_clear(struct mt7603_dev *dev, int idx)
{
int wtbl2_frame = (idx * MT_WTBL2_SIZE) / MT_PSE_PAGE_SIZE;
int wtbl2_entry = (idx * MT_WTBL2_SIZE) % MT_PSE_PAGE_SIZE;
int wtbl3_frame = (idx * MT_WTBL3_SIZE) / MT_PSE_PAGE_SIZE;
int wtbl3_entry = ((idx * MT_WTBL3_SIZE) % MT_PSE_PAGE_SIZE) * 2;
int wtbl4_frame = (idx * MT_WTBL4_SIZE) / MT_PSE_PAGE_SIZE;
int wtbl4_entry = (idx * MT_WTBL4_SIZE) % MT_PSE_PAGE_SIZE;
int wtbl2_offset = idx * MT_WTBL2_SIZE;
int wtbl2_frame = wtbl2_offset / MT_PSE_PAGE_SIZE;
int wtbl2_entry = wtbl2_offset % MT_PSE_PAGE_SIZE;
int wtbl3_offset = idx * MT_WTBL3_SIZE + MT_WTBL3_OFFSET;
int wtbl3_frame = wtbl3_offset / MT_PSE_PAGE_SIZE;
int wtbl3_entry = (wtbl3_offset % MT_PSE_PAGE_SIZE) * 2;
int wtbl4_offset = idx * MT_WTBL4_SIZE + MT_WTBL4_OFFSET;
int wtbl4_frame = wtbl4_offset / MT_PSE_PAGE_SIZE;
int wtbl4_entry = wtbl4_offset % MT_PSE_PAGE_SIZE;
u32 addr = MT_WTBL1_BASE + idx * MT_WTBL1_SIZE;
int i;
+3
View File
@@ -349,7 +349,10 @@
#define MT_WTBL1_SIZE (8 * 4)
#define MT_WTBL2_SIZE (16 * 4)
#define MT_WTBL3_OFFSET (MT7603_WTBL_SIZE * MT_WTBL2_SIZE)
#define MT_WTBL3_SIZE (16 * 4)
#define MT_WTBL4_OFFSET (MT7603_WTBL_SIZE * MT_WTBL3_SIZE + \
MT_WTBL3_OFFSET)
#define MT_WTBL4_SIZE (8 * 4)
#define MT_WTBL1_W0_ADDR_HI GENMASK(15, 0)