Changeset View
Standalone View
sys/compat/linuxkpi/common/include/linux/pci.h
Show First 20 Lines • Show All 205 Lines • ▼ Show 20 Lines | struct pci_driver { | ||||
int (*suspend) (struct pci_dev *dev, pm_message_t state); /* Device suspended */ | int (*suspend) (struct pci_dev *dev, pm_message_t state); /* Device suspended */ | ||||
int (*resume) (struct pci_dev *dev); /* Device woken up */ | int (*resume) (struct pci_dev *dev); /* Device woken up */ | ||||
void (*shutdown) (struct pci_dev *dev); /* Device shutdown */ | void (*shutdown) (struct pci_dev *dev); /* Device shutdown */ | ||||
driver_t bsddriver; | driver_t bsddriver; | ||||
devclass_t bsdclass; | devclass_t bsdclass; | ||||
struct device_driver driver; | struct device_driver driver; | ||||
const struct pci_error_handlers *err_handler; | const struct pci_error_handlers *err_handler; | ||||
bool isdrm; | bool isdrm; | ||||
int bsd_probe_return; | |||||
int (*bsd_iov_init)(device_t dev, uint16_t num_vfs, | int (*bsd_iov_init)(device_t dev, uint16_t num_vfs, | ||||
hselasky: Why not init bsd_bus_probe_return BUS_PROBE_DEFAULT and skip the boolean? | |||||
Done Inline ActionsWhere do you want to init that? I don't want to touch all the drivers which statically initialise the struct and then pass it to pci_register_driver(). If it gets there and is 0 I still don't know if that is a valid 0 or a bss 0. Am I missing a way without linker scripts to pre-initialise this field in all cases? bz: Where do you want to init that? I don't want to touch all the drivers which statically… | |||||
Done Inline ActionsThe struct passed to pci_register_driver() is not const, so pci_register_driver could set bsd_bus_probe_return to the default value. Then you can make a new function, pci_register_driver_prio(), which takes a second argument, which gets stored into the pci_driver structure? hselasky: The struct passed to pci_register_driver() is not const, so pci_register_driver could set… | |||||
Done Inline ActionsWhich will only work if you actually change the function call and not do (without the bool) the below which is how things get initialised at the moment. As otherwise you'll overwrite the already set value with a default value again. I keep wondering if it would be simpler to simply check for != 0, ignore the SPECIFIC case and move on as this below is likely the only case we'll hit in the next while (or at least so I'd hope)... --- sys/contrib/dev/iwlwifi/pcie/drv.c +++ sys/contrib/dev/iwlwifi/pcie/drv.c @@ -1660,6 +1660,11 @@ static struct pci_driver iwl_pci_driver = { .probe = iwl_pci_probe, .remove = iwl_pci_remove, .driver.pm = IWL_PM_OPS, +#if defined(__FreeBSD__) + /* Allow iwm(4) to attach for conflicting IDs for now. */ + .bsd_has_bus_probe_return = true, + .bsd_bus_probe_return = (BUS_PROBE_DEFAULT - 1), +#endif }; int __must_check iwl_pci_register_driver(void) bz: Which will only work if you actually change the function call and not do (without the bool) the… | |||||
const nvlist_t *pf_config); | const nvlist_t *pf_config); | ||||
void (*bsd_iov_uninit)(device_t dev); | void (*bsd_iov_uninit)(device_t dev); | ||||
int (*bsd_iov_add_vf)(device_t dev, uint16_t vfnum, | int (*bsd_iov_add_vf)(device_t dev, uint16_t vfnum, | ||||
const nvlist_t *vf_config); | const nvlist_t *vf_config); | ||||
}; | }; | ||||
struct pci_bus { | struct pci_bus { | ||||
struct pci_dev *self; | struct pci_dev *self; | ||||
▲ Show 20 Lines • Show All 1,371 Lines • Show Last 20 Lines |
Why not init bsd_bus_probe_return BUS_PROBE_DEFAULT and skip the boolean?