Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/pci/pci_user.c
Context not available. | |||||
static int | static int | ||||
pci_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td) | pci_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td) | ||||
{ | { | ||||
device_t pcidev, brdev; | device_t pcidev; | ||||
void *confdata; | void *confdata; | ||||
const char *name; | const char *name; | ||||
struct devlist *devlist_head; | struct devlist *devlist_head; | ||||
Context not available. | |||||
io->pi_sel.pc_bus, io->pi_sel.pc_dev, | io->pi_sel.pc_bus, io->pi_sel.pc_dev, | ||||
io->pi_sel.pc_func); | io->pi_sel.pc_func); | ||||
if (pcidev) { | if (pcidev) { | ||||
brdev = device_get_parent( | |||||
device_get_parent(pcidev)); | |||||
#ifdef PRE7_COMPAT | #ifdef PRE7_COMPAT | ||||
if (cmd == PCIOCWRITE || cmd == PCIOCWRITE_OLD) | if (cmd == PCIOCWRITE || cmd == PCIOCWRITE_OLD) | ||||
#else | #else | ||||
if (cmd == PCIOCWRITE) | if (cmd == PCIOCWRITE) | ||||
#endif | #endif | ||||
PCIB_WRITE_CONFIG(brdev, | pci_write_config(pcidev, | ||||
io->pi_sel.pc_bus, | |||||
io->pi_sel.pc_dev, | |||||
io->pi_sel.pc_func, | |||||
io->pi_reg, | io->pi_reg, | ||||
io->pi_data, | io->pi_data, | ||||
io->pi_width); | io->pi_width); | ||||
#ifdef PRE7_COMPAT | #ifdef PRE7_COMPAT | ||||
else if (cmd == PCIOCREAD_OLD) | else if (cmd == PCIOCREAD_OLD) | ||||
io_old->pi_data = | io_old->pi_data = | ||||
PCIB_READ_CONFIG(brdev, | pci_read_config(pcidev, | ||||
io->pi_sel.pc_bus, | |||||
io->pi_sel.pc_dev, | |||||
io->pi_sel.pc_func, | |||||
io->pi_reg, | io->pi_reg, | ||||
io->pi_width); | io->pi_width); | ||||
#endif | #endif | ||||
else | else | ||||
io->pi_data = | io->pi_data = | ||||
PCIB_READ_CONFIG(brdev, | pci_read_config(pcidev, | ||||
io->pi_sel.pc_bus, | |||||
io->pi_sel.pc_dev, | |||||
io->pi_sel.pc_func, | |||||
io->pi_reg, | io->pi_reg, | ||||
io->pi_width); | io->pi_width); | ||||
error = 0; | error = 0; | ||||
Context not available. |