e6000sw: Fix direct register write logic
When accessing a register directly from etherswitchcfg one must specify a register group(e.g. registers of portN) and the register offset within the group. The latter is passed as the 5 least significant bits. Extract the former by dividing the register address by 32, not by 5. Approved by: mw(mentor) Obtained from: Semihalf Sponsored by: Stormshield MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D35672
This commit is contained in:
parent
9dbacce2d4
commit
6654825907
@ -1061,7 +1061,7 @@ e6000sw_writereg_wrapper(device_t dev, int addr_reg, int val)
|
||||
device_printf(dev, "Wrong register address.\n");
|
||||
return (EINVAL);
|
||||
}
|
||||
e6000sw_writereg(device_get_softc(dev), addr_reg / 5,
|
||||
e6000sw_writereg(device_get_softc(dev), addr_reg / 32,
|
||||
addr_reg % 32, val);
|
||||
|
||||
return (0);
|
||||
|
Loading…
Reference in New Issue
Block a user