diff options
Diffstat (limited to 'drivers/pcmcia')
-rw-r--r-- | drivers/pcmcia/bulkmem.c | 4 | ||||
-rw-r--r-- | drivers/pcmcia/cardbus.c | 17 | ||||
-rw-r--r-- | drivers/pcmcia/cb_enabler.c | 6 | ||||
-rw-r--r-- | drivers/pcmcia/cirrus.h | 4 | ||||
-rw-r--r-- | drivers/pcmcia/cistpl.c | 6 | ||||
-rw-r--r-- | drivers/pcmcia/cs.c | 52 | ||||
-rw-r--r-- | drivers/pcmcia/cs_internal.h | 20 | ||||
-rw-r--r-- | drivers/pcmcia/ds.c | 44 | ||||
-rw-r--r-- | drivers/pcmcia/i82365.c | 40 | ||||
-rw-r--r-- | drivers/pcmcia/i82365.h | 4 | ||||
-rw-r--r-- | drivers/pcmcia/o2micro.h | 4 | ||||
-rw-r--r-- | drivers/pcmcia/ricoh.h | 4 | ||||
-rw-r--r-- | drivers/pcmcia/rsrc_mgr.c | 86 | ||||
-rw-r--r-- | drivers/pcmcia/rsrc_mgr.h | 4 | ||||
-rw-r--r-- | drivers/pcmcia/smc34c90.h | 4 | ||||
-rw-r--r-- | drivers/pcmcia/tcic.c | 6 | ||||
-rw-r--r-- | drivers/pcmcia/tcic.h | 4 | ||||
-rw-r--r-- | drivers/pcmcia/ti113x.h | 4 | ||||
-rw-r--r-- | drivers/pcmcia/vg468.h | 4 | ||||
-rw-r--r-- | drivers/pcmcia/yenta.h | 4 |
20 files changed, 191 insertions, 130 deletions
diff --git a/drivers/pcmcia/bulkmem.c b/drivers/pcmcia/bulkmem.c index 7eaad9626..60d227494 100644 --- a/drivers/pcmcia/bulkmem.c +++ b/drivers/pcmcia/bulkmem.c @@ -2,7 +2,7 @@ PCMCIA Bulk Memory Services - bulkmem.c 1.32 1999/09/15 15:32:19 + bulkmem.c 1.33 1999/10/25 20:03:33 The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); you may not use this file @@ -15,7 +15,7 @@ rights and limitations under the License. The initial developer of the original code is David A. Hinds - <dhinds@hyper.stanford.edu>. Portions created by David A. Hinds + <dhinds@pcmcia.sourceforge.org>. Portions created by David A. Hinds are Copyright (C) 1999 David A. Hinds. All Rights Reserved. Alternatively, the contents of this file may be used under the diff --git a/drivers/pcmcia/cardbus.c b/drivers/pcmcia/cardbus.c index 490182e00..440fd39c5 100644 --- a/drivers/pcmcia/cardbus.c +++ b/drivers/pcmcia/cardbus.c @@ -2,7 +2,7 @@ Cardbus device configuration - cardbus.c 1.61 1999/10/20 22:36:57 + cardbus.c 1.63 1999/11/08 20:47:02 The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); you may not use this file @@ -15,7 +15,7 @@ rights and limitations under the License. The initial developer of the original code is David A. Hinds - <dhinds@hyper.stanford.edu>. Portions created by David A. Hinds + <dhinds@pcmcia.sourceforge.org>. Portions created by David A. Hinds are Copyright (C) 1999 David A. Hinds. All Rights Reserved. Alternatively, the contents of this file may be used under the @@ -190,7 +190,7 @@ int cb_setup_cis_mem(socket_info_t *s, int space) sz &= PCI_BASE_ADDRESS_MEM_MASK; sz = FIND_FIRST_BIT(sz); if (sz < PAGE_SIZE) sz = PAGE_SIZE; - if (find_mem_region(&base, sz, "cb_enabler", sz, 0) != 0) { + if (find_mem_region(&base, sz, sz, 0, "cb_enabler") != 0) { printk(KERN_NOTICE "cs: could not allocate %dK memory for" " CardBus socket %d\n", sz/1024, s->sock); return CS_OUT_OF_RESOURCE; @@ -413,7 +413,8 @@ int cb_config(socket_info_t *s) s->io[0].NumPorts = num[B_IO]; s->io[0].BasePort = 0; if (num[B_IO]) { - if (find_io_region(&s->io[0].BasePort, num[B_IO], name) != 0) { + if (find_io_region(&s->io[0].BasePort, num[B_IO], + num[B_IO], name) != 0) { printk(KERN_NOTICE "cs: could not allocate %d IO ports for" " CardBus socket %d\n", num[B_IO], s->sock); goto failed; @@ -423,8 +424,8 @@ int cb_config(socket_info_t *s) s->win[0].size = num[B_M1]; s->win[0].base = 0; if (num[B_M1]) { - if (find_mem_region(&s->win[0].base, num[B_M1], - name, num[B_M1], 0) != 0) { + if (find_mem_region(&s->win[0].base, num[B_M1], num[B_M1], + 0, name) != 0) { printk(KERN_NOTICE "cs: could not allocate %dK memory for" " CardBus socket %d\n", num[B_M1]/1024, s->sock); goto failed; @@ -434,8 +435,8 @@ int cb_config(socket_info_t *s) s->win[1].size = num[B_M2]; s->win[1].base = 0; if (num[B_M2]) { - if (find_mem_region(&s->win[1].base, num[B_M2], - name, num[B_M2], 0) != 0) { + if (find_mem_region(&s->win[1].base, num[B_M2], num[B_M2], + 0, name) != 0) { printk(KERN_NOTICE "cs: could not allocate %dK memory for" " CardBus socket %d\n", num[B_M2]/1024, s->sock); goto failed; diff --git a/drivers/pcmcia/cb_enabler.c b/drivers/pcmcia/cb_enabler.c index 00cf824b3..f8fef22ed 100644 --- a/drivers/pcmcia/cb_enabler.c +++ b/drivers/pcmcia/cb_enabler.c @@ -2,7 +2,7 @@ Cardbus device enabler - cb_enabler.c 1.24 1999/10/20 00:19:09 + cb_enabler.c 1.25 1999/10/25 20:03:33 The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); you may not use this file @@ -15,7 +15,7 @@ rights and limitations under the License. The initial developer of the original code is David A. Hinds - <dhinds@hyper.stanford.edu>. Portions created by David A. Hinds + <dhinds@pcmcia.sourceforge.org>. Portions created by David A. Hinds are Copyright (C) 1999 David A. Hinds. All Rights Reserved. Alternatively, the contents of this file may be used under the @@ -58,7 +58,7 @@ static int pc_debug = PCMCIA_DEBUG; MODULE_PARM(pc_debug, "i"); #define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args) static char *version = -"cb_enabler.c 1.24 1999/10/20 00:19:09 (David Hinds)"; +"cb_enabler.c 1.25 1999/10/25 20:03:33 (David Hinds)"; #else #define DEBUG(n, args...) do { } while (0) #endif diff --git a/drivers/pcmcia/cirrus.h b/drivers/pcmcia/cirrus.h index 43527010a..34a3086cb 100644 --- a/drivers/pcmcia/cirrus.h +++ b/drivers/pcmcia/cirrus.h @@ -1,5 +1,5 @@ /* - * cirrus.h 1.3 1999/08/28 04:01:46 + * cirrus.h 1.4 1999/10/25 20:03:34 * * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in @@ -12,7 +12,7 @@ * limitations under the License. * * The initial developer of the original code is David A. Hinds - * <dhinds@hyper.stanford.edu>. Portions created by David A. Hinds + * <dhinds@pcmcia.sourceforge.org>. Portions created by David A. Hinds * are Copyright (C) 1999 David A. Hinds. All Rights Reserved. * * Alternatively, the contents of this file may be used under the diff --git a/drivers/pcmcia/cistpl.c b/drivers/pcmcia/cistpl.c index 690ea894f..45c08258c 100644 --- a/drivers/pcmcia/cistpl.c +++ b/drivers/pcmcia/cistpl.c @@ -2,7 +2,7 @@ PCMCIA Card Information Structure parser - cistpl.c 1.72 1999/09/15 15:32:19 + cistpl.c 1.74 1999/11/08 20:47:02 The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); you may not use this file @@ -15,7 +15,7 @@ rights and limitations under the License. The initial developer of the original code is David A. Hinds - <dhinds@hyper.stanford.edu>. Portions created by David A. Hinds + <dhinds@pcmcia.sourceforge.org>. Portions created by David A. Hinds are Copyright (C) 1999 David A. Hinds. All Rights Reserved. Alternatively, the contents of this file may be used under the @@ -206,7 +206,7 @@ int setup_cis_mem(socket_info_t *s) s->cis_mem.sys_start = 0; vs = NULL; if (find_mem_region(&s->cis_mem.sys_start, s->cap.map_size, - "card services", s->cap.map_size, low)) { + s->cap.map_size, low, "card services")) { printk(KERN_NOTICE "cs: unable to map card memory!\n"); return CS_OUT_OF_RESOURCE; } diff --git a/drivers/pcmcia/cs.c b/drivers/pcmcia/cs.c index f7fda7d8d..0b3bbd77d 100644 --- a/drivers/pcmcia/cs.c +++ b/drivers/pcmcia/cs.c @@ -2,7 +2,7 @@ PCMCIA Card Services -- core services - cs.c 1.232 1999/10/20 22:17:24 + cs.c 1.235 1999/11/11 17:52:05 The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); you may not use this file @@ -15,7 +15,7 @@ rights and limitations under the License. The initial developer of the original code is David A. Hinds - <dhinds@hyper.stanford.edu>. Portions created by David A. Hinds + <dhinds@pcmcia.sourceforge.org>. Portions created by David A. Hinds are Copyright (C) 1999 David A. Hinds. All Rights Reserved. Alternatively, the contents of this file may be used under the @@ -70,7 +70,7 @@ static int handle_apm_event(apm_event_t event); int pc_debug = PCMCIA_DEBUG; MODULE_PARM(pc_debug, "i"); static const char *version = -"cs.c 1.232 1999/10/20 22:17:24 (David Hinds)"; +"cs.c 1.235 1999/11/11 17:52:05 (David Hinds)"; #endif static const char *release = "Linux PCMCIA Card Services " CS_RELEASE; @@ -100,7 +100,7 @@ static const char *options = "options: " static int setup_delay = HZ/20; /* ticks */ static int resume_delay = HZ/5; /* ticks */ static int shutdown_delay = HZ/40; /* ticks */ -static int vcc_settle = HZ*3/10; /* ticks */ +static int vcc_settle = HZ*4/10; /* ticks */ static int reset_time = 10; /* usecs */ static int unreset_delay = HZ/10; /* ticks */ static int unreset_check = HZ/10; /* ticks */ @@ -268,8 +268,8 @@ static void init_socket(socket_info_t *s) /*====================================================================*/ #if defined(CONFIG_PROC_FS) && defined(PCMCIA_DEBUG) -int proc_read_clients(char *buf, char **start, off_t pos, - int count, int *eof, void *data) +static int proc_read_clients(char *buf, char **start, off_t pos, + int count, int *eof, void *data) { socket_info_t *s = data; client_handle_t c; @@ -708,14 +708,28 @@ static int handle_apm_event(apm_event_t event) ======================================================================*/ static int alloc_io_space(socket_info_t *s, u_int attr, ioaddr_t *base, - ioaddr_t num, char *name) + ioaddr_t num, u_int lines, char *name) { int i; - ioaddr_t try; - + ioaddr_t try, align; + + align = (*base) ? (1<<lines) : 1; + if (align && (align < num)) { + printk(KERN_INFO "odd IO request: num %04x align %04x\n", + num, align); + if (*base) + align = 0; + else + while (align && (align < num)) align <<= 1; + } + if (*base & ~(align-1)) { + printk(KERN_INFO "odd IO request: base %04x align %04x\n", + *base, align); + align = 0; + } for (i = 0; i < MAX_IO_WIN; i++) { if (s->io[i].NumPorts == 0) { - if (find_io_region(base, num, name) == 0) { + if (find_io_region(base, num, align, name) == 0) { s->io[i].Attributes = attr; s->io[i].BasePort = *base; s->io[i].NumPorts = s->io[i].InUse = num; @@ -727,7 +741,7 @@ static int alloc_io_space(socket_info_t *s, u_int attr, ioaddr_t *base, /* Try to extend top of window */ try = s->io[i].BasePort + s->io[i].NumPorts; if ((*base == 0) || (*base == try)) - if (find_io_region(&try, num, name) == 0) { + if (find_io_region(&try, num, 0, name) == 0) { *base = try; s->io[i].NumPorts += num; s->io[i].InUse += num; @@ -736,7 +750,7 @@ static int alloc_io_space(socket_info_t *s, u_int attr, ioaddr_t *base, /* Try to extend bottom of window */ try = s->io[i].BasePort - num; if ((*base == 0) || (*base == try)) - if (find_io_region(&try, num, name) == 0) { + if (find_io_region(&try, num, 0, name) == 0) { s->io[i].BasePort = *base = try; s->io[i].NumPorts += num; s->io[i].InUse += num; @@ -1699,12 +1713,14 @@ static int request_io(client_handle_t handle, io_req_t *req) return CS_BAD_ATTRIBUTE; if (alloc_io_space(s, req->Attributes1, &req->BasePort1, - req->NumPorts1, handle->dev_info)) + req->NumPorts1, req->IOAddrLines, + handle->dev_info)) return CS_IN_USE; if (req->NumPorts2) { if (alloc_io_space(s, req->Attributes2, &req->BasePort2, - req->NumPorts2, handle->dev_info)) { + req->NumPorts2, req->IOAddrLines, + handle->dev_info)) { release_io_space(s, req->BasePort1, req->NumPorts1); return CS_IN_USE; } @@ -1836,10 +1852,11 @@ static int request_window(client_handle_t *handle, win_req_t *req) win->size = req->Size; align = ((s->cap.features & SS_CAP_MEM_ALIGN) || (req->Attributes & WIN_STRICT_ALIGN)); - if (find_mem_region(&win->base, win->size, (*handle)->dev_info, + if (find_mem_region(&win->base, win->size, (align ? req->Size : s->cap.map_size), (req->Attributes & WIN_MAP_BELOW_1MB) || - !(s->cap.features & SS_CAP_PAGE_REGS))) + !(s->cap.features & SS_CAP_PAGE_REGS), + (*handle)->dev_info)) return CS_IN_USE; req->Base = win->base; (*handle)->state |= CLIENT_WIN_REQ(w); @@ -2202,6 +2219,9 @@ EXPORT_SYMBOL(register_ss_entry); EXPORT_SYMBOL(unregister_ss_entry); EXPORT_SYMBOL(CardServices); EXPORT_SYMBOL(MTDHelperEntry); +#ifdef CONFIG_PROC_FS +EXPORT_SYMBOL(proc_pccard); +#endif static int __init init_pcmcia_cs(void) { diff --git a/drivers/pcmcia/cs_internal.h b/drivers/pcmcia/cs_internal.h index aca0a0d0c..a49d4e0b5 100644 --- a/drivers/pcmcia/cs_internal.h +++ b/drivers/pcmcia/cs_internal.h @@ -1,5 +1,5 @@ /* - * cs_internal.h 1.43 1999/09/07 15:19:04 + * cs_internal.h 1.46 1999/11/08 20:46:49 * * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in @@ -12,7 +12,7 @@ * limitations under the License. * * The initial developer of the original code is David A. Hinds - * <dhinds@hyper.stanford.edu>. Portions created by David A. Hinds + * <dhinds@pcmcia.sourceforge.org>. Portions created by David A. Hinds * are Copyright (C) 1999 David A. Hinds. All Rights Reserved. */ @@ -241,9 +241,10 @@ int copy_memory(memory_handle_t handle, copy_op_t *req); /* In rsrc_mgr */ void validate_mem(int (*is_valid)(u_long), int (*do_cksum)(u_long), int force_low); -int find_io_region(ioaddr_t *base, ioaddr_t num, char *name); -int find_mem_region(u_long *base, u_long num, char *name, - u_long align, int force_low); +int find_io_region(ioaddr_t *base, ioaddr_t num, ioaddr_t align, + char *name); +int find_mem_region(u_long *base, u_long num, u_long align, + int force_low, char *name); int try_irq(u_int Attributes, int irq, int specific); void undo_irq(u_int Attributes, int irq); int adjust_resource_info(client_handle_t handle, adjust_t *adj); @@ -253,15 +254,6 @@ int proc_read_io(char *buf, char **start, off_t pos, int proc_read_mem(char *buf, char **start, off_t pos, int count, int *eof, void *data); -/* in pnp components */ -int proc_read_irq(char *buf, char **start, off_t pos, - int count, int *eof, void *data); -void pnp_bios_init(void); -void pnp_proc_init(void); -void pnp_proc_done(void); -void pnp_rsrc_init(void); -void pnp_rsrc_done(void); - #define MAX_SOCK 8 extern socket_t sockets; extern socket_info_t *socket_table[MAX_SOCK]; diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c index 71550228b..7713002a5 100644 --- a/drivers/pcmcia/ds.c +++ b/drivers/pcmcia/ds.c @@ -2,7 +2,7 @@ PC Card Driver Services - ds.c 1.98 1999/09/15 15:32:19 + ds.c 1.100 1999/11/08 20:47:02 The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); you may not use this file @@ -15,7 +15,7 @@ rights and limitations under the License. The initial developer of the original code is David A. Hinds - <dhinds@hyper.stanford.edu>. Portions created by David A. Hinds + <dhinds@pcmcia.sourceforge.org>. Portions created by David A. Hinds are Copyright (C) 1999 David A. Hinds. All Rights Reserved. Alternatively, the contents of this file may be used under the @@ -43,6 +43,7 @@ #include <linux/sched.h> #include <linux/timer.h> #include <linux/ioctl.h> +#include <linux/proc_fs.h> #include <linux/poll.h> #include <pcmcia/version.h> @@ -57,7 +58,7 @@ int pc_debug = PCMCIA_DEBUG; MODULE_PARM(pc_debug, "i"); #define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args) static const char *version = -"ds.c 1.98 1999/09/15 15:32:19 (David Hinds)"; +"ds.c 1.100 1999/11/08 20:47:02 (David Hinds)"; #else #define DEBUG(n, args...) #endif @@ -66,7 +67,7 @@ static const char *version = typedef struct driver_info_t { dev_info_t dev_info; - int use_count; + int use_count, status; dev_link_t *(*attach)(void); void (*detach)(dev_link_t *); struct driver_info_t *next; @@ -116,6 +117,11 @@ static driver_info_t *root_driver = NULL; static int sockets = 0, major_dev = -1; static socket_info_t *socket_table = NULL; +extern struct proc_dir_entry *proc_pccard; + +/* We use this to distinguish in-kernel from modular drivers */ +static int init_status = 1; + /*====================================================================*/ static void cs_error(client_handle_t handle, int func, int ret) @@ -149,6 +155,7 @@ int register_pccard_driver(dev_info_t *dev_info, driver = kmalloc(sizeof(driver_info_t), GFP_KERNEL); strncpy(driver->dev_info, (char *)dev_info, DEV_NAME_LEN); driver->use_count = 0; + driver->status = init_status; driver->next = root_driver; root_driver = driver; } @@ -200,6 +207,21 @@ int unregister_pccard_driver(dev_info_t *dev_info) return 0; } /* unregister_pccard_driver */ +/*====================================================================*/ + +#ifdef CONFIG_PROC_FS +static int proc_read_drivers(char *buf, char **start, off_t pos, + int count, int *eof, void *data) +{ + driver_info_t *d; + char *p = buf; + for (d = root_driver; d; d = d->next) + p += sprintf(p, "%-24.24s %d %d\n", d->dev_info, + d->status, d->use_count); + return (p - buf); +} +#endif + /*====================================================================== These manage a ring buffer of events pending for one user process @@ -874,7 +896,15 @@ int __init init_pcmcia_ds(void) "Driver Services\n"); else major_dev = i; - + +#ifdef CONFIG_PROC_FS + if (proc_pccard) { + struct proc_dir_entry *ent; + ent = create_proc_entry("drivers", 0, proc_pccard); + ent->read_proc = proc_read_drivers; + } + init_status = 0; +#endif return 0; } @@ -888,6 +918,10 @@ int __init init_module(void) void __exit cleanup_module(void) { int i; +#ifdef CONFIG_PROC_FS + if (proc_pccard) + remove_proc_entry("drivers", proc_pccard); +#endif if (major_dev != -1) unregister_chrdev(major_dev, "pcmcia"); for (i = 0; i < sockets; i++) diff --git a/drivers/pcmcia/i82365.c b/drivers/pcmcia/i82365.c index ed7bd3c30..685e65fe9 100644 --- a/drivers/pcmcia/i82365.c +++ b/drivers/pcmcia/i82365.c @@ -3,7 +3,7 @@ Device driver for Intel 82365 and compatible PC Card controllers, and Yenta-compatible PCI-to-CardBus controllers. - i82365.c 1.260 1999/10/21 00:56:07 + i82365.c 1.265 1999/11/10 18:36:21 The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); you may not use this file @@ -16,7 +16,7 @@ rights and limitations under the License. The initial developer of the original code is David A. Hinds - <dhinds@hyper.stanford.edu>. Portions created by David A. Hinds + <dhinds@pcmcia.sourceforge.org>. Portions created by David A. Hinds are Copyright (C) 1999 David A. Hinds. All Rights Reserved. Alternatively, the contents of this file may be used under the @@ -76,7 +76,7 @@ static int pc_debug = PCMCIA_DEBUG; MODULE_PARM(pc_debug, "i"); #define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args) static const char *version = -"i82365.c 1.260 1999/10/21 00:56:07 (David Hinds)"; +"i82365.c 1.265 1999/11/10 18:36:21 (David Hinds)"; #else #define DEBUG(n, args...) do { } while (0) #endif @@ -189,7 +189,7 @@ MODULE_PARM(cb_write_post, "i"); #ifdef CONFIG_ISA #ifdef CONFIG_PCI /* PCI card status change interrupts? */ -static int pci_csc = 1; +static int pci_csc = 0; /* PCI IO card functional interrupts? */ static int pci_int = 0; MODULE_PARM(pci_csc, "i"); @@ -903,7 +903,8 @@ static void o2micro_get_state(u_short s) { socket_info_t *t = &socket[s]; o2micro_state_t *p = &socket[s].state.o2micro; - if ((t->revision == 0x34) || (t->revision == 0x62)) { + if ((t->revision == 0x34) || (t->revision == 0x62) || + (t->type == IS_OZ6812)) { p->mode_a = i365_get(s, O2_MODE_A_2); p->mode_b = i365_get(s, O2_MODE_B_2); } else { @@ -923,7 +924,8 @@ static void o2micro_set_state(u_short s) { socket_info_t *t = &socket[s]; o2micro_state_t *p = &socket[s].state.o2micro; - if ((t->revision == 0x34) || (t->revision == 0x62)) { + if ((t->revision == 0x34) || (t->revision == 0x62) || + (t->type == IS_OZ6812)) { i365_set(s, O2_MODE_A_2, p->mode_a); i365_set(s, O2_MODE_B_2, p->mode_b); } else { @@ -1007,6 +1009,7 @@ static int topic_set_irq_mode(u_short s, int pcsc, int pint) flip(p->ccr, TOPIC97_ICR_IRQSEL, pcsc); return 0; } else { + /* no ISA card status change irq */ return !pcsc; } } @@ -1541,7 +1544,8 @@ static void __init add_pcic(int ns, int type) #ifdef CONFIG_ISA /* Poll if only two interrupts available */ if (!use_pci && !poll_interval) { - u_int tmp = (mask & (mask-1)); + u_int tmp = (mask & 0xff20); + tmp = tmp & (tmp-1); if ((tmp & (tmp-1)) == 0) poll_interval = HZ; } @@ -1627,7 +1631,7 @@ static void __init add_cb_bridge(int type, u_char bus, u_char devfn, u_short v, u_short d0) { socket_info_t *s = &socket[sockets]; - u_short d, ns; + u_short d, ns, i; u_char a, b, r, max; /* PCI bus enumeration is broken on some systems */ @@ -1666,7 +1670,6 @@ static void __init add_cb_bridge(int type, u_char bus, u_char devfn, pci_writel(bus, devfn, CB_LEGACY_MODE_BASE, 0); pci_readl(bus, devfn, PCI_BASE_ADDRESS_0, &s->cb_phys); if (s->cb_phys == 0) { - int i; pci_writew(bus, devfn, PCI_COMMAND, CMD_DFLT); for (i = 0; i < sizeof(cb_mem_base)/sizeof(u_int); i++) { s->cb_phys = cb_mem_base[i]; @@ -1710,10 +1713,21 @@ static void __init add_cb_bridge(int type, u_char bus, u_char devfn, } add_pcic(ns, type); - /* Re-do card type & voltage detection */ - cb_writel(sockets-ns, CB_SOCKET_FORCE, CB_SF_CVSTEST); - __set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(HZ/5); + /* Re-do card voltage detection, if needed: this checks for + card presence with no voltage detect bits set */ + for (a = sockets-ns; a < sockets; a++) + if (!(cb_readl(a, CB_SOCKET_STATE) & 0x3c86)) + cb_writel(a, CB_SOCKET_FORCE, CB_SF_CVSTEST); + for (i = 0; i < 200; i++) { + for (a = sockets-ns; a < sockets; a++) + if (!(cb_readl(a, CB_SOCKET_STATE) & 0x3c86)) break; + if (a == sockets) break; + __set_current_state(TASK_UNINTERRUPTIBLE); + schedule_timeout(HZ/20); + } + if (i == 200) + printk(KERN_NOTICE "i82365: card voltage interrogation" + " timed out!\n"); /* Set up PCI bus bridge structures if needed */ for (a = 0; a < ns; a++) { diff --git a/drivers/pcmcia/i82365.h b/drivers/pcmcia/i82365.h index ac3ba4e87..085f6bd4f 100644 --- a/drivers/pcmcia/i82365.h +++ b/drivers/pcmcia/i82365.h @@ -1,5 +1,5 @@ /* - * i82365.h 1.14 1999/08/28 04:01:47 + * i82365.h 1.15 1999/10/25 20:03:34 * * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in @@ -12,7 +12,7 @@ * limitations under the License. * * The initial developer of the original code is David A. Hinds - * <dhinds@hyper.stanford.edu>. Portions created by David A. Hinds + * <dhinds@pcmcia.sourceforge.org>. Portions created by David A. Hinds * are Copyright (C) 1999 David A. Hinds. All Rights Reserved. * * Alternatively, the contents of this file may be used under the diff --git a/drivers/pcmcia/o2micro.h b/drivers/pcmcia/o2micro.h index a3f922239..f303aba4a 100644 --- a/drivers/pcmcia/o2micro.h +++ b/drivers/pcmcia/o2micro.h @@ -1,5 +1,5 @@ /* - * o2micro.h 1.12 1999/10/16 01:43:24 + * o2micro.h 1.13 1999/10/25 20:03:34 * * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in @@ -12,7 +12,7 @@ * limitations under the License. * * The initial developer of the original code is David A. Hinds - * <dhinds@hyper.stanford.edu>. Portions created by David A. Hinds + * <dhinds@pcmcia.sourceforge.org>. Portions created by David A. Hinds * are Copyright (C) 1999 David A. Hinds. All Rights Reserved. * * Alternatively, the contents of this file may be used under the diff --git a/drivers/pcmcia/ricoh.h b/drivers/pcmcia/ricoh.h index c6fceac2e..8cfd30dac 100644 --- a/drivers/pcmcia/ricoh.h +++ b/drivers/pcmcia/ricoh.h @@ -1,5 +1,5 @@ /* - * ricoh.h 1.8 1999/08/28 04:01:47 + * ricoh.h 1.9 1999/10/25 20:03:34 * * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in @@ -12,7 +12,7 @@ * limitations under the License. * * The initial developer of the original code is David A. Hinds - * <dhinds@hyper.stanford.edu>. Portions created by David A. Hinds + * <dhinds@pcmcia.sourceforge.org>. Portions created by David A. Hinds * are Copyright (C) 1999 David A. Hinds. All Rights Reserved. * * Alternatively, the contents of this file may be used under the diff --git a/drivers/pcmcia/rsrc_mgr.c b/drivers/pcmcia/rsrc_mgr.c index 736ac0c05..e8a14d16f 100644 --- a/drivers/pcmcia/rsrc_mgr.c +++ b/drivers/pcmcia/rsrc_mgr.c @@ -2,7 +2,7 @@ Resource management routines - rsrc_mgr.c 1.73 1999/10/19 00:54:04 + rsrc_mgr.c 1.76 1999/11/08 20:47:02 The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); you may not use this file @@ -15,7 +15,7 @@ rights and limitations under the License. The initial developer of the original code is David A. Hinds - <dhinds@hyper.stanford.edu>. Portions created by David A. Hinds + <dhinds@pcmcia.sourceforge.org>. Portions created by David A. Hinds are Copyright (C) 1999 David A. Hinds. All Rights Reserved. Alternatively, the contents of this file may be used under the @@ -100,6 +100,14 @@ static irq_info_t irq_table[NR_IRQS] = { { 0, 0, 0 }, /* etc */ }; /*====================================================================== + Linux resource management extensions + +======================================================================*/ + +#define check_io_region(b,n) (0) + +/*====================================================================== + These manage the internal databases of available resources. ======================================================================*/ @@ -180,7 +188,7 @@ static void do_io_probe(ioaddr_t base, ioaddr_t num) b = kmalloc(256, GFP_KERNEL); memset(b, 0, 256); for (i = base, most = 0; i < base+num; i += 8) { - if (check_region(i, 8)) + if (check_region(i, 8) || check_io_region(i, 8)) continue; hole = inb(i); for (j = 1; j < 8; j++) @@ -193,7 +201,7 @@ static void do_io_probe(ioaddr_t base, ioaddr_t num) bad = any = 0; for (i = base; i < base+num; i += 8) { - if (check_region(i, 8)) + if (check_region(i, 8) || check_io_region(i, 8)) continue; for (j = 0; j < 8; j++) if (inb(i+j) != most) break; @@ -344,67 +352,59 @@ void validate_mem(int (*is_valid)(u_long), int (*do_cksum)(u_long), These find ranges of I/O ports or memory addresses that are not currently allocated by other devices. + + The 'align' field should reflect the number of bits of address + that need to be preserved from the initial value of *base. It + should be a power of two, greater than or equal to 'num'. A value + of 0 means that all bits of *base are significant. *base should + also be strictly less than 'align'. ======================================================================*/ -int find_io_region(ioaddr_t *base, ioaddr_t num, char *name) +int find_io_region(ioaddr_t *base, ioaddr_t num, ioaddr_t align, + char *name) { - ioaddr_t align; + ioaddr_t try; resource_map_t *m; - if (*base != 0) { - for (m = io_db.next; m != &io_db; m = m->next) { - if ((*base >= m->base) && (*base+num <= m->base+m->num)) { - if (check_region(*base, num)) { - return -1; - } else { - request_region(*base, num, name); - return 0; - } - } - } - return -1; - } - - for (align = 1; align < num; align *= 2) ; for (m = io_db.next; m != &io_db; m = m->next) { - for (*base = (m->base + align - 1) & (~(align-1)); - *base+align <= m->base + m->num; - *base += align) - if (check_region(*base, num) == 0) { - request_region(*base, num, name); + try = (m->base & ~(align-1)) + *base; + for (try = (try >= m->base) ? try : try+align; + (try >= m->base) && (try+num <= m->base+m->num); + try += align) { + if ((check_region(try, num) == 0) && + (check_io_region(try, num) == 0)) { + *base = try; + request_region(try, num, name); return 0; } + if (!align) break; + } } return -1; } /* find_io_region */ -int find_mem_region(u_long *base, u_long num, char *name, - u_long align, int force_low) +int find_mem_region(u_long *base, u_long num, u_long align, + int force_low, char *name) { + u_long try; resource_map_t *m; - if (*base != 0) { - for (m = mem_db.next; m != &mem_db; m = m->next) { - if ((*base >= m->base) && (*base+num <= m->base+m->num)) - if (check_mem_region(*base, num) == 0) { - request_mem_region(*base, num, name); - return 0; - } - } - return -1; - } - while (1) { for (m = mem_db.next; m != &mem_db; m = m->next) { /* first pass >1MB, second pass <1MB */ if ((force_low != 0) ^ (m->base < 0x100000)) continue; - for (*base = (m->base + align - 1) & (~(align-1)); - *base+num <= m->base+m->num; *base += align) - if (check_mem_region(*base, num) == 0) { - request_mem_region(*base, num, name); + try = (m->base & ~(align-1)) + *base; + for (try = (try >= m->base) ? try : try+align; + (try >= m->base) && (try+num <= m->base+m->num); + try += align) { + if (check_mem_region(try, num) == 0) { + request_mem_region(try, num, name); + *base = try; return 0; } + if (!align) break; + } } if (force_low) break; force_low++; diff --git a/drivers/pcmcia/rsrc_mgr.h b/drivers/pcmcia/rsrc_mgr.h index 37faa3b26..739e03b2f 100644 --- a/drivers/pcmcia/rsrc_mgr.h +++ b/drivers/pcmcia/rsrc_mgr.h @@ -1,5 +1,5 @@ /* - * rsrc_mgr.h 1.18 1999/08/28 04:01:47 + * rsrc_mgr.h 1.19 1999/10/25 20:03:34 * * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in @@ -12,7 +12,7 @@ * limitations under the License. * * The initial developer of the original code is David A. Hinds - * <dhinds@hyper.stanford.edu>. Portions created by David A. Hinds + * <dhinds@pcmcia.sourceforge.org>. Portions created by David A. Hinds * are Copyright (C) 1999 David A. Hinds. All Rights Reserved. * * Alternatively, the contents of this file may be used under the diff --git a/drivers/pcmcia/smc34c90.h b/drivers/pcmcia/smc34c90.h index 8ac3854a4..79893e9c7 100644 --- a/drivers/pcmcia/smc34c90.h +++ b/drivers/pcmcia/smc34c90.h @@ -1,5 +1,5 @@ /* - * smc34c90.h 1.6 1999/08/28 04:01:47 + * smc34c90.h 1.7 1999/10/25 20:03:34 * * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in @@ -12,7 +12,7 @@ * limitations under the License. * * The initial developer of the original code is David A. Hinds - * <dhinds@hyper.stanford.edu>. Portions created by David A. Hinds + * <dhinds@pcmcia.sourceforge.org>. Portions created by David A. Hinds * are Copyright (C) 1999 David A. Hinds. All Rights Reserved. * * Alternatively, the contents of this file may be used under the diff --git a/drivers/pcmcia/tcic.c b/drivers/pcmcia/tcic.c index ca2818d7c..2fba49434 100644 --- a/drivers/pcmcia/tcic.c +++ b/drivers/pcmcia/tcic.c @@ -2,7 +2,7 @@ Device driver for Databook TCIC-2 PCMCIA controller - tcic.c 1.106 1999/09/15 15:32:19 + tcic.c 1.107 1999/10/25 20:03:34 The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); you may not use this file @@ -15,7 +15,7 @@ rights and limitations under the License. The initial developer of the original code is David A. Hinds - <dhinds@hyper.stanford.edu>. Portions created by David A. Hinds + <dhinds@pcmcia.sourceforge.org>. Portions created by David A. Hinds are Copyright (C) 1999 David A. Hinds. All Rights Reserved. Alternatively, the contents of this file may be used under the @@ -60,7 +60,7 @@ static int pc_debug = PCMCIA_DEBUG; MODULE_PARM(pc_debug, "i"); static const char *version = -"tcic.c 1.106 1999/09/15 15:32:19 (David Hinds)"; +"tcic.c 1.107 1999/10/25 20:03:34 (David Hinds)"; #define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args) #else #define DEBUG(n, args...) diff --git a/drivers/pcmcia/tcic.h b/drivers/pcmcia/tcic.h index e33f79531..222341d3c 100644 --- a/drivers/pcmcia/tcic.h +++ b/drivers/pcmcia/tcic.h @@ -1,5 +1,5 @@ /* - * tcic.h 1.12 1999/08/28 04:01:47 + * tcic.h 1.13 1999/10/25 20:03:34 * * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in @@ -12,7 +12,7 @@ * limitations under the License. * * The initial developer of the original code is David A. Hinds - * <dhinds@hyper.stanford.edu>. Portions created by David A. Hinds + * <dhinds@pcmcia.sourceforge.org>. Portions created by David A. Hinds * are Copyright (C) 1999 David A. Hinds. All Rights Reserved. * * Alternatively, the contents of this file may be used under the diff --git a/drivers/pcmcia/ti113x.h b/drivers/pcmcia/ti113x.h index 758757d99..f37faeba5 100644 --- a/drivers/pcmcia/ti113x.h +++ b/drivers/pcmcia/ti113x.h @@ -1,5 +1,5 @@ /* - * ti113x.h 1.15 1999/09/03 16:43:35 + * ti113x.h 1.16 1999/10/25 20:03:34 * * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in @@ -12,7 +12,7 @@ * limitations under the License. * * The initial developer of the original code is David A. Hinds - * <dhinds@hyper.stanford.edu>. Portions created by David A. Hinds + * <dhinds@pcmcia.sourceforge.org>. Portions created by David A. Hinds * are Copyright (C) 1999 David A. Hinds. All Rights Reserved. * * Alternatively, the contents of this file may be used under the diff --git a/drivers/pcmcia/vg468.h b/drivers/pcmcia/vg468.h index c19d53d15..af0a941ed 100644 --- a/drivers/pcmcia/vg468.h +++ b/drivers/pcmcia/vg468.h @@ -1,5 +1,5 @@ /* - * vg468.h 1.10 1999/08/28 04:01:47 + * vg468.h 1.11 1999/10/25 20:03:34 * * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in @@ -12,7 +12,7 @@ * limitations under the License. * * The initial developer of the original code is David A. Hinds - * <dhinds@hyper.stanford.edu>. Portions created by David A. Hinds + * <dhinds@pcmcia.sourceforge.org>. Portions created by David A. Hinds * are Copyright (C) 1999 David A. Hinds. All Rights Reserved. * * Alternatively, the contents of this file may be used under the diff --git a/drivers/pcmcia/yenta.h b/drivers/pcmcia/yenta.h index 5c09f2978..fbba0b1a3 100644 --- a/drivers/pcmcia/yenta.h +++ b/drivers/pcmcia/yenta.h @@ -1,5 +1,5 @@ /* - * yenta.h 1.15 1999/08/28 04:01:47 + * yenta.h 1.16 1999/10/25 20:03:34 * * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in @@ -12,7 +12,7 @@ * limitations under the License. * * The initial developer of the original code is David A. Hinds - * <dhinds@hyper.stanford.edu>. Portions created by David A. Hinds + * <dhinds@pcmcia.sourceforge.org>. Portions created by David A. Hinds * are Copyright (C) 1999 David A. Hinds. All Rights Reserved. * * Alternatively, the contents of this file may be used under the |