Skip to content

Commit d07ecb4

Browse files
Peter Chiunbd168
authored andcommitted
wifi: mt76: mt7996: fix register mapping
Bypass the entry when ofs is equal to dev->reg.map[i].size. Without this patch, it would get incorrect register mapping when the CR address is located at the boundary of an entry. Fixes: 98686cd ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices") Signed-off-by: Peter Chiu <[email protected]> Signed-off-by: Shengyu Qu <[email protected]> Link: https://patch.msgid.link/OSZPR01MB84344FEFF53004B5CF40BCC198132@OSZPR01MB8434.jpnprd01.prod.outlook.com Signed-off-by: Felix Fietkau <[email protected]>
1 parent dd1649e commit d07ecb4

File tree

1 file changed

+1
-1
lines changed
  • drivers/net/wireless/mediatek/mt76/mt7996

1 file changed

+1
-1
lines changed

drivers/net/wireless/mediatek/mt76/mt7996/mmio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ static u32 __mt7996_reg_addr(struct mt7996_dev *dev, u32 addr)
177177
continue;
178178

179179
ofs = addr - dev->reg.map[i].phys;
180-
if (ofs > dev->reg.map[i].size)
180+
if (ofs >= dev->reg.map[i].size)
181181
continue;
182182

183183
return dev->reg.map[i].mapped + ofs;

0 commit comments

Comments
 (0)