From 0ca724d37af370dbf2d55dc4d6359ead558e5756 Mon Sep 17 00:00:00 2001 From: Dominik Brodowski Date: Sat, 24 Jul 2010 19:03:02 +0200 Subject: pcmcia: use struct resource for PCMCIA devices, part 2 Use struct resource * also for iomem resources. CC: linux-mtd@lists.infradead.org CC: netdev@vger.kernel.org CC: linux-wireless@vger.kernel.org CC: Jiri Kosina Signed-off-by: Dominik Brodowski --- include/pcmcia/cs.h | 35 ++++++++++++++--------------------- include/pcmcia/ds.h | 15 +++++++++++++-- 2 files changed, 27 insertions(+), 23 deletions(-) (limited to 'include/pcmcia') diff --git a/include/pcmcia/cs.h b/include/pcmcia/cs.h index e4faf4420f2a..68d8bde7e8d6 100644 --- a/include/pcmcia/cs.h +++ b/include/pcmcia/cs.h @@ -77,26 +77,19 @@ typedef struct win_req_t { } win_req_t; /* Attributes for RequestWindow */ -#define WIN_ADDR_SPACE 0x0001 -#define WIN_ADDR_SPACE_MEM 0x0000 -#define WIN_ADDR_SPACE_IO 0x0001 -#define WIN_MEMORY_TYPE 0x0002 -#define WIN_MEMORY_TYPE_CM 0x0000 -#define WIN_MEMORY_TYPE_AM 0x0002 -#define WIN_ENABLE 0x0004 -#define WIN_DATA_WIDTH 0x0018 -#define WIN_DATA_WIDTH_8 0x0000 -#define WIN_DATA_WIDTH_16 0x0008 -#define WIN_DATA_WIDTH_32 0x0010 -#define WIN_PAGED 0x0020 -#define WIN_SHARED 0x0040 -#define WIN_FIRST_SHARED 0x0080 -#define WIN_USE_WAIT 0x0100 -#define WIN_STRICT_ALIGN 0x0200 -#define WIN_MAP_BELOW_1MB 0x0400 -#define WIN_PREFETCH 0x0800 -#define WIN_CACHEABLE 0x1000 -#define WIN_BAR_MASK 0xe000 -#define WIN_BAR_SHIFT 13 +#define WIN_MEMORY_TYPE_CM 0x00 /* default */ +#define WIN_MEMORY_TYPE_AM 0x20 /* MAP_ATTRIB */ +#define WIN_DATA_WIDTH_8 0x00 /* default */ +#define WIN_DATA_WIDTH_16 0x02 /* MAP_16BIT */ +#define WIN_ENABLE 0x01 /* MAP_ACTIVE */ +#define WIN_USE_WAIT 0x40 /* MAP_USE_WAIT */ + +#define WIN_FLAGS_MAP 0x63 /* MAP_ATTRIB | MAP_16BIT | MAP_ACTIVE | + MAP_USE_WAIT */ +#define WIN_FLAGS_REQ 0x1c /* mapping to socket->win[i]: + 0x04 -> 0 + 0x08 -> 1 + 0x0c -> 2 + 0x10 -> 3 */ #endif /* _LINUX_CS_H */ diff --git a/include/pcmcia/ds.h b/include/pcmcia/ds.h index a2bf3a702c08..70c58ed2278c 100644 --- a/include/pcmcia/ds.h +++ b/include/pcmcia/ds.h @@ -36,7 +36,7 @@ struct pcmcia_device; struct config_t; struct net_device; -typedef unsigned long window_handle_t; +typedef struct resource *window_handle_t; /* dynamic device IDs for PCMCIA device drivers. See * Documentation/pcmcia/driver.txt for details. @@ -63,6 +63,17 @@ struct pcmcia_driver { int pcmcia_register_driver(struct pcmcia_driver *driver); void pcmcia_unregister_driver(struct pcmcia_driver *driver); +/* for struct resource * array embedded in struct pcmcia_device */ +enum { + PCMCIA_IOPORT_0, + PCMCIA_IOPORT_1, + PCMCIA_IOMEM_0, + PCMCIA_IOMEM_1, + PCMCIA_IOMEM_2, + PCMCIA_IOMEM_3, + PCMCIA_NUM_RESOURCES, +}; + struct pcmcia_device { /* the socket and the device_no [for multifunction devices] uniquely define a pcmcia_device */ @@ -85,7 +96,7 @@ struct pcmcia_device { /* device setup */ unsigned int irq; - struct resource *resource[MAX_IO_WIN]; + struct resource *resource[PCMCIA_NUM_RESOURCES]; unsigned int io_lines; /* number of I/O lines */ -- cgit v1.2.3