diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2000-02-16 01:07:24 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2000-02-16 01:07:24 +0000 |
commit | 95db6b748fc86297827fbd9c9ef174d491c9ad89 (patch) | |
tree | 27a92a942821cde1edda9a1b088718d436b3efe4 /drivers/char/pcmcia | |
parent | 45b27b0a0652331d104c953a5b192d843fff88f8 (diff) |
Merge with Linux 2.3.40.
Diffstat (limited to 'drivers/char/pcmcia')
-rw-r--r-- | drivers/char/pcmcia/Config.in | 28 | ||||
-rw-r--r-- | drivers/char/pcmcia/serial_cb.c | 9 | ||||
-rw-r--r-- | drivers/char/pcmcia/serial_cs.c | 33 |
3 files changed, 36 insertions, 34 deletions
diff --git a/drivers/char/pcmcia/Config.in b/drivers/char/pcmcia/Config.in index 7a32e5d55..766fdd1d0 100644 --- a/drivers/char/pcmcia/Config.in +++ b/drivers/char/pcmcia/Config.in @@ -2,10 +2,7 @@ # PCMCIA character device configuration # -mainmenu_option next_comment -comment 'PCMCIA character device support' - -if [ "$CONFIG_SERIAL" = "n" -o "$CONFIG_PCMCIA" = "n" ]; then +if [ "$CONFIG_SERIAL" = "n" ]; then define_bool CONFIG_PCMCIA_SERIAL n else if [ "$CONFIG_SERIAL" = "m" -o "$CONFIG_PCMCIA" = "m" ]; then @@ -15,14 +12,19 @@ else fi fi -dep_tristate ' PCMCIA serial device support' CONFIG_PCMCIA_SERIAL_CS $CONFIG_PCMCIA_SERIAL -if [ "$CONFIG_CARDBUS" = "y" ]; then - dep_tristate ' CardBus serial device support' CONFIG_PCMCIA_SERIAL_CB $CONFIG_PCMCIA_SERIAL -fi +if [ "$CONFIG_PCMCIA_SERIAL" != "n" ]; then + mainmenu_option next_comment + comment 'PCMCIA character device support' -if [ "$CONFIG_PCMCIA_SERIAL_CS" = "y" -o \ - "$CONFIG_PCMCIA_SERIAL_CB" = "y" ]; then - define_bool CONFIG_PCMCIA_CHRDEV y -fi + dep_tristate 'PCMCIA serial device support' CONFIG_PCMCIA_SERIAL_CS $CONFIG_PCMCIA_SERIAL + if [ "$CONFIG_CARDBUS" = "y" ]; then + dep_tristate 'CardBus serial device support' CONFIG_PCMCIA_SERIAL_CB $CONFIG_PCMCIA_SERIAL + fi -endmenu + if [ "$CONFIG_PCMCIA_SERIAL_CS" = "y" -o \ + "$CONFIG_PCMCIA_SERIAL_CB" = "y" ]; then + define_bool CONFIG_PCMCIA_CHRDEV y + fi + + endmenu +fi diff --git a/drivers/char/pcmcia/serial_cb.c b/drivers/char/pcmcia/serial_cb.c index 8a2dede85..b0d8b02a8 100644 --- a/drivers/char/pcmcia/serial_cb.c +++ b/drivers/char/pcmcia/serial_cb.c @@ -2,7 +2,7 @@ A driver for CardBus serial devices - serial_cb.c 1.14 1999/11/11 02:18:08 + serial_cb.c 1.15 1999/11/24 02:52:06 Copyright 1998, 1999 by Donald Becker and David Hinds @@ -39,7 +39,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 = -"serial_cb.c 1.14 1999/11/11 02:18:08 (David Hinds)"; +"serial_cb.c 1.15 1999/11/24 02:52:06 (David Hinds)"; #else #define DEBUG(n, args...) #endif @@ -56,8 +56,9 @@ static void device_setup(u_char bus, u_char devfn, u_int ioaddr) pcibios_read_config_word(bus, devfn, PCI_SUBSYSTEM_VENDOR_ID, &a); pcibios_read_config_word(bus, devfn, PCI_SUBSYSTEM_ID, &b); - if ((a == 0x13a2) && (b == 0x8007)) { - /* Ositech Jack of Spades */ + if (((a == 0x13a2) && (b == 0x8007)) || + ((a == 0x1420) && (b == 0x8003))) { + /* Ositech, Psion 83c175-based cards */ DEBUG(0, " 83c175 NVCTL_m = 0x%4.4x.\n", inl(ioaddr+0x80)); outl(0x4C00, ioaddr + 0x80); outl(0x4C80, ioaddr + 0x80); diff --git a/drivers/char/pcmcia/serial_cs.c b/drivers/char/pcmcia/serial_cs.c index 38345b1b5..a59a877bb 100644 --- a/drivers/char/pcmcia/serial_cs.c +++ b/drivers/char/pcmcia/serial_cs.c @@ -2,7 +2,7 @@ A driver for PCMCIA serial devices - serial_cs.c 1.114 1999/11/11 00:54:46 + serial_cs.c 1.117 1999/12/11 03:59:18 The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); you may not use this file @@ -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 = -"serial_cs.c 1.114 1999/11/11 00:54:46 (David Hinds)"; +"serial_cs.c 1.117 1999/12/11 03:59:18 (David Hinds)"; #else #define DEBUG(n, args...) #endif @@ -100,6 +100,7 @@ static multi_id_t multi_id[] = { #define MULTI_COUNT (sizeof(multi_id)/sizeof(multi_id_t)) typedef struct serial_info_t { + dev_link_t link; int ndev; int multi; int slave; @@ -138,6 +139,7 @@ static void cs_error(client_handle_t handle, int func, int ret) static dev_link_t *serial_attach(void) { + serial_info_t *info; client_reg_t client_reg; dev_link_t *link; int i, ret; @@ -145,8 +147,11 @@ static dev_link_t *serial_attach(void) DEBUG(0, "serial_attach()\n"); /* Create new serial device */ - link = kmalloc(sizeof(struct dev_link_t), GFP_KERNEL); - memset(link, 0, sizeof(struct dev_link_t)); + info = kmalloc(sizeof(*info), GFP_KERNEL); + if (!info) return NULL; + memset(info, 0, sizeof(*info)); + link = &info->link; link->priv = info; + link->release.function = &serial_release; link->release.data = (u_long)link; link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; @@ -165,8 +170,6 @@ static dev_link_t *serial_attach(void) link->conf.Status = CCSR_AUDIO_ENA; } link->conf.IntType = INT_MEMORY_AND_IO; - link->priv = kmalloc(sizeof(struct serial_info_t), GFP_KERNEL); - memset(link->priv, 0, sizeof(struct serial_info_t)); /* Register with Card Services */ link->next = dev_list; @@ -201,6 +204,7 @@ static dev_link_t *serial_attach(void) static void serial_detach(dev_link_t *link) { + serial_info_t *info = link->priv; dev_link_t **linkp; long flags; int ret; @@ -232,8 +236,7 @@ static void serial_detach(dev_link_t *link) /* Unlink device structure, free bits */ *linkp = link->next; - kfree_s(link->priv, sizeof(serial_info_t)); - kfree_s(link, sizeof(struct dev_link_t)); + kfree(info); } /* serial_detach */ @@ -326,7 +329,8 @@ static int simple_config(dev_link_t *link) if (cf->vpp1.present & (1<<CISTPL_POWER_VNOM)) link->conf.Vpp1 = link->conf.Vpp2 = cf->vpp1.param[CISTPL_POWER_VNOM]/10000; - if ((cf->io.nwin > 0) && ((cf->io.win[0].base & 0xf) == 8)) { + if ((cf->io.nwin > 0) && (cf->io.win[0].len == 8) && + (cf->io.win[0].base != 0)) { link->conf.ConfigIndex = cf->index; link->io.BasePort1 = cf->io.win[0].base; link->io.IOAddrLines = cf->io.flags & CISTPL_IO_LINES_MASK; @@ -347,6 +351,7 @@ static int simple_config(dev_link_t *link) link->conf.ConfigIndex = cf->index; for (j = 0; j < 5; j++) { link->io.BasePort1 = base[j]; + link->io.IOAddrLines = base[j] ? 16 : 3; i = CardServices(RequestIO, link->handle, &link->io); if (i == CS_SUCCESS) goto found_port; @@ -470,18 +475,14 @@ while ((last_ret=CardServices(last_fn=(fn), args))!=0) goto cs_failed void serial_config(dev_link_t *link) { - client_handle_t handle; - serial_info_t *info; + client_handle_t handle = link->handle; + serial_info_t *info = link->priv; tuple_t tuple; u_short buf[128]; cisparse_t parse; cistpl_cftable_entry_t *cf = &parse.cftable_entry; int i, last_ret, last_fn; - sti(); - handle = link->handle; - info = link->priv; - DEBUG(0, "serial_config(0x%p)\n", link); tuple.TupleData = (cisdata_t *)buf; @@ -572,8 +573,6 @@ void serial_release(u_long arg) serial_info_t *info = link->priv; int i; - sti(); - DEBUG(0, "serial_release(0x%p)\n", link); for (i = 0; i < info->ndev; i++) { |