diff --git a/sys/dev/ixl/i40e_osdep.h b/sys/dev/ixl/i40e_osdep.h index 97908bacaf94..895bf83cd686 100755 --- a/sys/dev/ixl/i40e_osdep.h +++ b/sys/dev/ixl/i40e_osdep.h @@ -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_ */ diff --git a/sys/dev/ixl/if_ixl.c b/sys/dev/ixl/if_ixl.c index 49459e4a50e5..8d1100c55f45 100755 --- a/sys/dev/ixl/if_ixl.c +++ b/sys/dev/ixl/if_ixl.c @@ -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; diff --git a/sys/dev/ixl/if_ixlv.c b/sys/dev/ixl/if_ixlv.c index dc588a3e19fa..bd3c202dd814 100644 --- a/sys/dev/ixl/if_ixlv.c +++ b/sys/dev/ixl/if_ixlv.c @@ -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;