/* Method entries */
-static void
-aix_config(struct pci_access *a)
-{
- a->method_params[PCI_ACCESS_AIX_DEVICE] = NULL;
-}
-
static int
aix_detect(struct pci_access *a)
{
int bus_number;
byte busmap[256];
- bzero(busmap, sizeof(busmap));
+ memset(busmap, 0, sizeof(busmap));
for (i = 0; i < pci_bus_count; i++)
{
bus_number = pci_buses[i].bus_number;
aix_read(struct pci_dev *d, int pos, byte *buf, int len)
{
struct mdio mdio;
- int fd = aix_bus_open(d->access, d->bus);
+ int fd;
+ if (pos + len > 256)
+ return 0;
+
+ fd = aix_bus_open(d->access, d->bus);
mdio.md_addr = (ulong) pos;
mdio.md_size = len;
mdio.md_incr = MV_BYTE;
if (ioctl(fd, MIOPCFGET, &mdio) < 0)
d->access->error("aix_read: ioctl(MIOPCFGET) failed");
-
+
return 1;
}
aix_write(struct pci_dev *d, int pos, byte *buf, int len)
{
struct mdio mdio;
- int fd = aix_bus_open(d->access, d->bus);
+ int fd;
+
+ if (pos + len > 256)
+ return 0;
+ fd = aix_bus_open(d->access, d->bus);
mdio.md_addr = (ulong) pos;
mdio.md_size = len;
mdio.md_incr = MV_BYTE;
}
struct pci_methods pm_aix_device = {
- "AIX-device",
- aix_config,
+ "aix-device",
+ "AIX /dev/pci[0-n]",
+ NULL,
aix_detect,
aix_init,
aix_cleanup,