Ensure that ixl_flush() uses a defined register on VFs
In some code that is shared between the ixl(4) and ixlv(4) drivers, a macro hard-coded a register offset that was not valid on ixlv devices. Fix this by having each driver define a variable that contains the correct offset. Reviewed by: Eric Joyner <ricera10 AT gmail.com> MFC after: 3 days Sponsored by: Sandvine Inc
This commit is contained in:
parent
9daa89f3bb
commit
cf3c0c32d2
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=272285
@ -152,6 +152,7 @@ struct i40e_osdep
|
||||
bus_space_tag_t mem_bus_space_tag;
|
||||
bus_space_handle_t mem_bus_space_handle;
|
||||
bus_size_t mem_bus_space_size;
|
||||
uint32_t flush_reg;
|
||||
struct device *dev;
|
||||
};
|
||||
|
||||
@ -208,6 +209,13 @@ wr32_osdep(struct i40e_osdep *osdep, uint32_t reg, uint32_t value)
|
||||
osdep->mem_bus_space_handle, reg, value);
|
||||
}
|
||||
|
||||
static __inline void
|
||||
ixl_flush_osdep(struct i40e_osdep *osdep)
|
||||
{
|
||||
|
||||
rd32_osdep(osdep, osdep->flush_reg);
|
||||
}
|
||||
|
||||
#define rd32(a, reg) rd32_osdep((a)->back, (reg))
|
||||
#define wr32(a, reg, value) wr32_osdep((a)->back, (reg), (value))
|
||||
|
||||
@ -221,9 +229,6 @@ wr32_osdep(struct i40e_osdep *osdep, uint32_t reg, uint32_t value)
|
||||
((struct i40e_osdep *)(a)->back)->mem_bus_space_handle, \
|
||||
reg, value))
|
||||
|
||||
#define ixl_flush(a) (\
|
||||
bus_space_read_4( ((struct i40e_osdep *)(a)->back)->mem_bus_space_tag, \
|
||||
((struct i40e_osdep *)(a)->back)->mem_bus_space_handle, \
|
||||
I40E_GLGEN_STAT))
|
||||
#define ixl_flush(a) ixl_flush_osdep((a)->back)
|
||||
|
||||
#endif /* _I40E_OSDEP_H_ */
|
||||
|
@ -2177,6 +2177,7 @@ ixl_allocate_pci_resources(struct ixl_pf *pf)
|
||||
pf->osdep.mem_bus_space_handle =
|
||||
rman_get_bushandle(pf->pci_mem);
|
||||
pf->osdep.mem_bus_space_size = rman_get_size(pf->pci_mem);
|
||||
pf->osdep.flush_reg = I40E_GLGEN_STAT;
|
||||
pf->hw.hw_addr = (u8 *) &pf->osdep.mem_bus_space_handle;
|
||||
|
||||
pf->hw.back = &pf->osdep;
|
||||
|
@ -1137,6 +1137,7 @@ ixlv_allocate_pci_resources(struct ixlv_sc *sc)
|
||||
sc->osdep.mem_bus_space_handle =
|
||||
rman_get_bushandle(sc->pci_mem);
|
||||
sc->osdep.mem_bus_space_size = rman_get_size(sc->pci_mem);
|
||||
sc->osdep.flush_reg = I40E_VFGEN_RSTAT;
|
||||
sc->hw.hw_addr = (u8 *) &sc->osdep.mem_bus_space_handle;
|
||||
|
||||
sc->hw.back = &sc->osdep;
|
||||
|
Loading…
Reference in New Issue
Block a user