-- all back-ends: fail on non-zero domain
-
- review class names
Setpci:
}
static int
-aix_bus_open(struct pci_access *a, int bus_number)
+aix_bus_open(struct pci_dev *d)
{
- aix_pci_bus *bp = aix_find_bus(a, bus_number);
+ struct pci_access *a = d->access;
+ aix_pci_bus *bp = aix_find_bus(a, d->bus);
if (bp->bus_fd < 0)
{
snprintf(devbuf, sizeof (devbuf), "/dev/%s", bp->bus_name);
bp->bus_fd = open(devbuf, mode, 0);
if (bp->bus_fd < 0)
- {
- a->error("aix_open_bus: %s open failed", devbuf);
- }
+ a->error("aix_open_bus: %s open failed", devbuf);
}
return bp->bus_fd;
struct mdio mdio;
int fd;
- if (pos + len > 256)
+ if (d->domain || pos + len > 256)
return 0;
- fd = aix_bus_open(d->access, d->bus);
+ fd = aix_bus_open(d);
mdio.md_addr = (ulong) pos;
mdio.md_size = len;
mdio.md_incr = MV_BYTE;
struct mdio mdio;
int fd;
- if (pos + len > 256)
+ if (d->domain || pos + len > 256)
return 0;
- fd = aix_bus_open(d->access, d->bus);
+ fd = aix_bus_open(d);
mdio.md_addr = (ulong) pos;
mdio.md_size = len;
mdio.md_incr = MV_BYTE;
#if __FreeBSD_version >= 700053 || defined(__DragonFly__)
pi.pi_sel.pc_domain = d->domain;
+#else
+ if (d->domain)
+ return 0;
#endif
pi.pi_sel.pc_bus = d->bus;
pi.pi_sel.pc_dev = d->dev;
#if __FreeBSD_version >= 700053 || defined(__DragonFly__)
pi.pi_sel.pc_domain = d->domain;
+#else
+ if (d->domain)
+ return 0;
#endif
pi.pi_sel.pc_bus = d->bus;
pi.pi_sel.pc_dev = d->dev;
int addr = 0xcfc + (pos&3);
int res = 1;
- if (pos >= 256)
+ if (d->domain || pos >= 256)
return 0;
intel_io_lock();
int addr = 0xcfc + (pos&3);
int res = 1;
- if (pos >= 256)
+ if (d->domain || pos >= 256)
return 0;
intel_io_lock();
int res = 1;
int addr = 0xc000 | (d->dev << 8) | pos;
- if (pos >= 256)
+ if (d->domain || pos >= 256)
return 0;
if (d->dev >= 16)
int res = 1;
int addr = 0xc000 | (d->dev << 8) | pos;
- if (pos >= 256)
+ if (d->domain || pos >= 256)
return 0;
if (d->dev >= 16)
- d->access->error("conf2_write: only first 16 devices exist.");
+ /* conf2 supports only 16 devices per bus */
+ return 0;
intel_io_lock();
outb((d->func << 1) | 0xf0, 0xcf8);
if (!(len == 1 || len == 2 || len == 4))
return pci_generic_block_read(d, pos, buf, len);
- if (pos >= 4096)
+ if (d->domain || pos >= 4096)
return 0;
shift = 8*(pos % 4);
if (!(len == 1 || len == 2 || len == 4))
return pci_generic_block_write(d, pos, buf, len);
- if (pos >= 256)
+ if (d->domain || pos >= 256)
return 0;
/*
if (!(len == 1 || len == 2 || len == 4))
return pci_generic_block_read(d, pos, buf, len);
- if (pos >= 256)
+ if (d->domain || pos >= 256)
return 0;
pi.pi_sel.pc_bus = d->bus;
if (!(len == 1 || len == 2 || len == 4))
return pci_generic_block_write(d, pos, buf, len);
- if (pos >= 256)
+ if (d->domain || pos >= 256)
return 0;
pi.pi_sel.pc_bus = d->bus;