diff options
author | imp <imp@FreeBSD.org> | 1999-12-07 06:44:38 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 1999-12-07 06:44:38 +0000 |
commit | 03f3b6304174aefc44a82f53d0d1d13f3f1d2c2a (patch) | |
tree | 8b99c325ef54ec681b6472d6d6c59562288d5706 /sys/dev/pccard | |
parent | 4efb27971818504cb318693917f7ec92b51a9c80 (diff) | |
download | FreeBSD-src-03f3b6304174aefc44a82f53d0d1d13f3f1d2c2a.zip FreeBSD-src-03f3b6304174aefc44a82f53d0d1d13f3f1d2c2a.tar.gz |
Tonight's cleanups.
o Implement memory and I/O activation/deactivation. irq not handled.
o switch pcic_chip functions around to use more convenient types.
o kill __P and most of the old K&R prototypes just to be mean.
o minor other nits
Diffstat (limited to 'sys/dev/pccard')
-rw-r--r-- | sys/dev/pccard/pccard.c | 16 | ||||
-rw-r--r-- | sys/dev/pccard/pccard_cis.c | 4 | ||||
-rw-r--r-- | sys/dev/pccard/pccardchip.h | 40 | ||||
-rw-r--r-- | sys/dev/pccard/pccardvar.h | 37 |
4 files changed, 50 insertions, 47 deletions
diff --git a/sys/dev/pccard/pccard.c b/sys/dev/pccard/pccard.c index 39c939c..67a4ae1 100644 --- a/sys/dev/pccard/pccard.c +++ b/sys/dev/pccard/pccard.c @@ -65,16 +65,16 @@ int pccard_verbose = 1; int pccard_verbose = 0; #endif -int pccard_print __P((void *, const char *)); +int pccard_print(void *, const char *); -static __inline void pccard_socket_enable __P((pccard_chipset_tag_t, - pccard_chipset_handle_t *)); -static __inline void pccard_socket_disable __P((pccard_chipset_tag_t, - pccard_chipset_handle_t *)); +static __inline void pccard_socket_enable(pccard_chipset_tag_t, + pccard_chipset_handle_t *); +static __inline void pccard_socket_disable(pccard_chipset_tag_t, + pccard_chipset_handle_t *); -int pccard_card_intr __P((void *)); +int pccard_card_intr(void *); #ifdef PCCARDDEBUG -int pccard_card_intrdebug __P((void *)); +int pccard_card_intrdebug(void *); #endif int @@ -557,7 +557,7 @@ void * pccard_intr_establish(pf, ipl, ih_fct, ih_arg) struct pccard_function *pf; int ipl; - int (*ih_fct) __P((void *)); + int (*ih_fct)(void *); void *ih_arg; { void *ret; diff --git a/sys/dev/pccard/pccard_cis.c b/sys/dev/pccard/pccard_cis.c index e09c52a..aeb10ba 100644 --- a/sys/dev/pccard/pccard_cis.c +++ b/sys/dev/pccard/pccard_cis.c @@ -65,7 +65,7 @@ struct cis_state { struct pccard_function *pf; }; -int pccard_parse_cis_tuple __P((struct pccard_tuple *, void *)); +int pccard_parse_cis_tuple(struct pccard_tuple *, void *); void pccard_read_cis(sc) @@ -99,7 +99,7 @@ pccard_read_cis(sc) int pccard_scan_cis(dev, fct, arg) struct device *dev; - int (*fct) __P((struct pccard_tuple *, void *)); + int (*fct)(struct pccard_tuple *, void *); void *arg; { struct pccard_softc *sc = (struct pccard_softc *) dev; diff --git a/sys/dev/pccard/pccardchip.h b/sys/dev/pccard/pccardchip.h index b2a6635..638526a 100644 --- a/sys/dev/pccard/pccardchip.h +++ b/sys/dev/pccard/pccardchip.h @@ -54,39 +54,39 @@ typedef int pccard_mem_handle_t; struct pccard_chip_functions { /* memory space allocation */ - int (*mem_alloc) __P((pccard_chipset_handle_t, bus_size_t, - struct pccard_mem_handle *)); - void (*mem_free) __P((pccard_chipset_handle_t, - struct pccard_mem_handle *)); + int (*mem_alloc)(pccard_chipset_handle_t, bus_size_t, + struct pccard_mem_handle *); + void (*mem_free)(pccard_chipset_handle_t, + struct pccard_mem_handle *); /* memory space window mapping */ - int (*mem_map) __P((pccard_chipset_handle_t, int, bus_addr_t, + int (*mem_map)(pccard_chipset_handle_t, int, bus_addr_t, bus_size_t, struct pccard_mem_handle *, - bus_addr_t *, int *)); - void (*mem_unmap) __P((pccard_chipset_handle_t, int)); + bus_addr_t *, int *); + void (*mem_unmap)(pccard_chipset_handle_t, int); /* I/O space allocation */ - int (*io_alloc) __P((pccard_chipset_handle_t, bus_addr_t, - bus_size_t, bus_size_t, struct pccard_io_handle *)); - void (*io_free) __P((pccard_chipset_handle_t, - struct pccard_io_handle *)); + int (*io_alloc) (pccard_chipset_handle_t, bus_addr_t, + bus_size_t, bus_size_t, struct pccard_io_handle *); + void (*io_free) (pccard_chipset_handle_t, + struct pccard_io_handle *); /* I/O space window mapping */ - int (*io_map) __P((pccard_chipset_handle_t, int, bus_addr_t, - bus_size_t, struct pccard_io_handle *, int *)); - void (*io_unmap) __P((pccard_chipset_handle_t, int)); + int (*io_map) (pccard_chipset_handle_t, int, bus_addr_t, + bus_size_t, struct pccard_io_handle *, int *); + void (*io_unmap) (pccard_chipset_handle_t, int); /* interrupt glue */ - void *(*intr_establish) __P((pccard_chipset_handle_t, - struct pccard_function *, int, int (*)(void *), void *)); - void (*intr_disestablish) __P((pccard_chipset_handle_t, void *)); + void *(*intr_establish) (pccard_chipset_handle_t, + struct pccard_function *, int, int (*)(void *), void *); + void (*intr_disestablish) (pccard_chipset_handle_t, void *); /* card enable/disable */ - void (*socket_enable) __P((pccard_chipset_handle_t)); - void (*socket_disable) __P((pccard_chipset_handle_t)); + void (*socket_enable) (pccard_chipset_handle_t); + void (*socket_disable) (pccard_chipset_handle_t); /* card detection */ - int (*card_detect) __P((pccard_chipset_handle_t)); + int (*card_detect)(pccard_chipset_handle_t); }; /* Memory space functions. */ diff --git a/sys/dev/pccard/pccardvar.h b/sys/dev/pccard/pccardvar.h index 8544247..e6ad7d3 100644 --- a/sys/dev/pccard/pccardvar.h +++ b/sys/dev/pccard/pccardvar.h @@ -48,6 +48,7 @@ struct pccard_io_handle { bus_addr_t addr; /* resulting address in bus space */ bus_size_t size; /* size of i/o space */ int flags; /* misc. information */ + int width; }; #define PCCARD_IO_ALLOCATED 0x01 /* i/o space was allocated */ @@ -62,6 +63,8 @@ struct pccard_mem_handle { bus_size_t size; /* size of mem space */ pccard_mem_handle_t mhandle; /* opaque memory handle */ bus_size_t realsize; /* how much we really allocated */ + long offset; + int kind; }; /* pccard itself */ @@ -128,7 +131,7 @@ struct pccard_function { int pf_ccr_window; long pf_mfc_iobase; long pf_mfc_iomax; - int (*ih_fct) __P((void *)); + int (*ih_fct)(void *); void *ih_arg; int ih_ipl; int pf_flags; @@ -185,7 +188,7 @@ struct pccard_softc { }; void -pccardbus_if_setup __P((struct pccard_softc*)); +pccardbus_if_setup(struct pccard_softc*); struct pccard_cis_quirk { int32_t manufacturer; @@ -211,11 +214,11 @@ struct pccard_tuple { bus_space_handle_t memh; }; -void pccard_read_cis __P((struct pccard_softc *)); +void pccard_read_cis(struct pccard_softc *); void pccard_check_cis_quirks(device_t); void pccard_print_cis(device_t); -int pccard_scan_cis __P((struct device * dev, - int (*) (struct pccard_tuple *, void *), void *)); +int pccard_scan_cis(struct device * dev, + int (*) (struct pccard_tuple *, void *), void *); #define pccard_cis_read_1(tuple, idx0) \ (bus_space_read_1((tuple)->memt, (tuple)->memh, (tuple)->mult*(idx0))) @@ -247,16 +250,16 @@ int pccard_scan_cis __P((struct device * dev, #define PCCARD_SPACE_MEMORY 1 #define PCCARD_SPACE_IO 2 -int pccard_ccr_read __P((struct pccard_function *, int)); -void pccard_ccr_write __P((struct pccard_function *, int, int)); +int pccard_ccr_read(struct pccard_function *, int); +void pccard_ccr_write(struct pccard_function *, int, int); #define pccard_mfc(sc) (STAILQ_FIRST(&(sc)->card.pf_head) && \ STAILQ_NEXT(STAILQ_FIRST(&(sc)->card.pf_head),pf_list)) -void pccard_function_init __P((struct pccard_function *, - struct pccard_config_entry *)); -int pccard_function_enable __P((struct pccard_function *)); -void pccard_function_disable __P((struct pccard_function *)); +void pccard_function_init(struct pccard_function *, + struct pccard_config_entry *); +int pccard_function_enable(struct pccard_function *); +void pccard_function_disable(struct pccard_function *); #define pccard_io_alloc(pf, start, size, align, pciop) \ (pccard_chip_io_alloc((pf)->sc->pct, pf->sc->pch, (start), \ @@ -265,9 +268,9 @@ void pccard_function_disable __P((struct pccard_function *)); #define pccard_io_free(pf, pciohp) \ (pccard_chip_io_free((pf)->sc->pct, (pf)->sc->pch, (pciohp))) -int pccard_io_map __P((struct pccard_function *, int, bus_addr_t, - bus_size_t, struct pccard_io_handle *, int *)); -void pccard_io_unmap __P((struct pccard_function *, int)); +int pccard_io_map(struct pccard_function *, int, bus_addr_t, + bus_size_t, struct pccard_io_handle *, int *); +void pccard_io_unmap(struct pccard_function *, int); #define pccard_mem_alloc(pf, size, pcmhp) \ (pccard_chip_mem_alloc((pf)->sc->pct, (pf)->sc->pch, (size), (pcmhp))) @@ -282,6 +285,6 @@ void pccard_io_unmap __P((struct pccard_function *, int)); #define pccard_mem_unmap(pf, window) \ (pccard_chip_mem_unmap((pf)->sc->pct, (pf)->sc->pch, (window))) -void *pccard_intr_establish __P((struct pccard_function *, int, - int (*) (void *), void *)); -void pccard_intr_disestablish __P((struct pccard_function *, void *)); +void *pccard_intr_establish(struct pccard_function *, int, + int (*) (void *), void *); +void pccard_intr_disestablish(struct pccard_function *, void *); |