diff options
author | Aaron Campbell <aaron@cvs.openbsd.org> | 2000-04-08 05:50:54 +0000 |
---|---|---|
committer | Aaron Campbell <aaron@cvs.openbsd.org> | 2000-04-08 05:50:54 +0000 |
commit | baf7d3528de2c205985708a2d97ec168af15aec2 (patch) | |
tree | 371d418fadef234b603efb1b2315a5924cc4ca81 /sys/dev/ic/i82365var.h | |
parent | 7c2b118d597d4335b6e7cffd5950cc45da0b0506 (diff) |
Initial check-in for support of 32-bit CardBus PC Cards; from NetBSD. On many
machines, this code needs the new PCIBIOS* options enabled in the kernel config
file to work, but your mileage may vary. Included is a working 3c575 driver for
3Com 10/100 CardBus PC Card NICs (tested only with the 'C' revision). The 3c575
is the pccard version of the PCI EtherLink XL cards, and thus the xl driver has
been split into /sys/dev/ic.
Diffstat (limited to 'sys/dev/ic/i82365var.h')
-rw-r--r-- | sys/dev/ic/i82365var.h | 43 |
1 files changed, 12 insertions, 31 deletions
diff --git a/sys/dev/ic/i82365var.h b/sys/dev/ic/i82365var.h index 81af7b771f2..72792836c86 100644 --- a/sys/dev/ic/i82365var.h +++ b/sys/dev/ic/i82365var.h @@ -1,4 +1,4 @@ -/* $OpenBSD: i82365var.h,v 1.5 1999/08/08 01:07:02 niklas Exp $ */ +/* $OpenBSD: i82365var.h,v 1.6 2000/04/08 05:50:50 aaron Exp $ */ /* $NetBSD: i82365var.h,v 1.4 1998/05/23 18:32:29 matt Exp $ */ /* @@ -49,7 +49,12 @@ struct pcic_event { #define PCIC_EVENT_REMOVAL 1 struct pcic_handle { - struct pcic_softc *sc; + struct device *ph_parent; + bus_space_tag_t ph_bus_t; + bus_space_handle_t ph_bus_h; + u_int8_t (*ph_read) __P((struct pcic_handle *, int)); + void (*ph_write) __P((struct pcic_handle *, int, u_int8_t)); + int vendor; int sock; int flags; @@ -146,9 +151,6 @@ void pcic_attach __P((struct pcic_softc *)); void pcic_attach_sockets __P((struct pcic_softc *)); int pcic_intr __P((void *arg)); -static inline int pcic_read __P((struct pcic_handle *, int)); -static inline void pcic_write __P((struct pcic_handle *, int, int)); - int pcic_chip_mem_alloc __P((pcmcia_chipset_handle_t, bus_size_t, struct pcmcia_mem_handle *)); void pcic_chip_mem_free __P((pcmcia_chipset_handle_t, @@ -168,29 +170,8 @@ void pcic_chip_io_unmap __P((pcmcia_chipset_handle_t, int)); void pcic_chip_socket_enable __P((pcmcia_chipset_handle_t)); void pcic_chip_socket_disable __P((pcmcia_chipset_handle_t)); -static __inline int pcic_read __P((struct pcic_handle *, int)); -static __inline int -pcic_read(h, idx) - struct pcic_handle *h; - int idx; -{ - if (idx != -1) - bus_space_write_1(h->sc->iot, h->sc->ioh, PCIC_REG_INDEX, - h->sock + idx); - return (bus_space_read_1(h->sc->iot, h->sc->ioh, PCIC_REG_DATA)); -} - -static __inline void pcic_write __P((struct pcic_handle *, int, int)); -static __inline void -pcic_write(h, idx, data) - struct pcic_handle *h; - int idx; - int data; -{ - if (idx != -1) - bus_space_write_1(h->sc->iot, h->sc->ioh, PCIC_REG_INDEX, - h->sock + idx); - if (data != -1) - bus_space_write_1(h->sc->iot, h->sc->ioh, PCIC_REG_DATA, - (data)); -} +#define pcic_read(h, idx) \ + (*(h)->ph_read)((h), (idx)) + +#define pcic_write(h, idx, data) \ + (*(h)->ph_write)((h), (idx), (data)) |