aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/pcmcia
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/pcmcia')
-rw-r--r--drivers/net/pcmcia/pcnet_cs.c42
1 files changed, 22 insertions, 20 deletions
diff --git a/drivers/net/pcmcia/pcnet_cs.c b/drivers/net/pcmcia/pcnet_cs.c
index d090df413049..661bfe54ff5d 100644
--- a/drivers/net/pcmcia/pcnet_cs.c
+++ b/drivers/net/pcmcia/pcnet_cs.c
@@ -12,7 +12,7 @@
12 Copyright (C) 1999 David A. Hinds -- dahinds@users.sourceforge.net 12 Copyright (C) 1999 David A. Hinds -- dahinds@users.sourceforge.net
13 13
14 pcnet_cs.c 1.153 2003/11/09 18:53:09 14 pcnet_cs.c 1.153 2003/11/09 18:53:09
15 15
16 The network driver code is based on Donald Becker's NE2000 code: 16 The network driver code is based on Donald Becker's NE2000 code:
17 17
18 Written 1992,1993 by Donald Becker. 18 Written 1992,1993 by Donald Becker.
@@ -146,7 +146,7 @@ typedef struct hw_info_t {
146#define MII_PHYID_REG2 0x03 146#define MII_PHYID_REG2 0x03
147 147
148static hw_info_t hw_info[] = { 148static hw_info_t hw_info[] = {
149 { /* Accton EN2212 */ 0x0ff0, 0x00, 0x00, 0xe8, DELAY_OUTPUT }, 149 { /* Accton EN2212 */ 0x0ff0, 0x00, 0x00, 0xe8, DELAY_OUTPUT },
150 { /* Allied Telesis LA-PCM */ 0x0ff0, 0x00, 0x00, 0xf4, 0 }, 150 { /* Allied Telesis LA-PCM */ 0x0ff0, 0x00, 0x00, 0xf4, 0 },
151 { /* APEX MultiCard */ 0x03f4, 0x00, 0x20, 0xe5, 0 }, 151 { /* APEX MultiCard */ 0x03f4, 0x00, 0x20, 0xe5, 0 },
152 { /* ASANTE FriendlyNet */ 0x4910, 0x00, 0x00, 0x94, 152 { /* ASANTE FriendlyNet */ 0x4910, 0x00, 0x00, 0x94,
@@ -193,7 +193,7 @@ static hw_info_t hw_info[] = {
193 { /* NE2000 Compatible */ 0x0ff0, 0x00, 0xa0, 0x0c, 0 }, 193 { /* NE2000 Compatible */ 0x0ff0, 0x00, 0xa0, 0x0c, 0 },
194 { /* Network General Sniffer */ 0x0ff0, 0x00, 0x00, 0x65, 194 { /* Network General Sniffer */ 0x0ff0, 0x00, 0x00, 0x65,
195 HAS_MISC_REG | HAS_IBM_MISC }, 195 HAS_MISC_REG | HAS_IBM_MISC },
196 { /* Panasonic VEL211 */ 0x0ff0, 0x00, 0x80, 0x45, 196 { /* Panasonic VEL211 */ 0x0ff0, 0x00, 0x80, 0x45,
197 HAS_MISC_REG | HAS_IBM_MISC }, 197 HAS_MISC_REG | HAS_IBM_MISC },
198 { /* PreMax PE-200 */ 0x07f0, 0x00, 0x20, 0xe0, 0 }, 198 { /* PreMax PE-200 */ 0x07f0, 0x00, 0x20, 0xe0, 0 },
199 { /* RPTI EP400 */ 0x0110, 0x00, 0x40, 0x95, 0 }, 199 { /* RPTI EP400 */ 0x0110, 0x00, 0x40, 0x95, 0 },
@@ -330,7 +330,7 @@ static hw_info_t *get_hwinfo(struct pcmcia_device *link)
330 for (j = 0; j < 6; j++) 330 for (j = 0; j < 6; j++)
331 dev->dev_addr[j] = readb(base + (j<<1)); 331 dev->dev_addr[j] = readb(base + (j<<1));
332 } 332 }
333 333
334 iounmap(virt); 334 iounmap(virt);
335 j = pcmcia_release_window(link->win); 335 j = pcmcia_release_window(link->win);
336 if (j != CS_SUCCESS) 336 if (j != CS_SUCCESS)
@@ -490,7 +490,7 @@ static int try_io_port(struct pcmcia_device *link)
490 if (link->io.NumPorts2 > 0) { 490 if (link->io.NumPorts2 > 0) {
491 /* for master/slave multifunction cards */ 491 /* for master/slave multifunction cards */
492 link->io.Attributes2 = IO_DATA_PATH_WIDTH_8; 492 link->io.Attributes2 = IO_DATA_PATH_WIDTH_8;
493 link->irq.Attributes = 493 link->irq.Attributes =
494 IRQ_TYPE_DYNAMIC_SHARING|IRQ_FIRST_SHARED; 494 IRQ_TYPE_DYNAMIC_SHARING|IRQ_FIRST_SHARED;
495 } 495 }
496 } else { 496 } else {
@@ -543,19 +543,19 @@ static int pcnet_config(struct pcmcia_device *link)
543 manfid = le16_to_cpu(buf[0]); 543 manfid = le16_to_cpu(buf[0]);
544 prodid = le16_to_cpu(buf[1]); 544 prodid = le16_to_cpu(buf[1]);
545 } 545 }
546 546
547 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; 547 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;
548 tuple.Attributes = 0; 548 tuple.Attributes = 0;
549 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); 549 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple));
550 while (last_ret == CS_SUCCESS) { 550 while (last_ret == CS_SUCCESS) {
551 cistpl_cftable_entry_t *cfg = &(parse.cftable_entry); 551 cistpl_cftable_entry_t *cfg = &(parse.cftable_entry);
552 cistpl_io_t *io = &(parse.cftable_entry.io); 552 cistpl_io_t *io = &(parse.cftable_entry.io);
553 553
554 if (pcmcia_get_tuple_data(link, &tuple) != 0 || 554 if (pcmcia_get_tuple_data(link, &tuple) != 0 ||
555 pcmcia_parse_tuple(link, &tuple, &parse) != 0 || 555 pcmcia_parse_tuple(link, &tuple, &parse) != 0 ||
556 cfg->index == 0 || cfg->io.nwin == 0) 556 cfg->index == 0 || cfg->io.nwin == 0)
557 goto next_entry; 557 goto next_entry;
558 558
559 link->conf.ConfigIndex = cfg->index; 559 link->conf.ConfigIndex = cfg->index;
560 /* For multifunction cards, by convention, we configure the 560 /* For multifunction cards, by convention, we configure the
561 network function with window 0, and serial with window 1 */ 561 network function with window 0, and serial with window 1 */
@@ -584,7 +584,7 @@ static int pcnet_config(struct pcmcia_device *link)
584 } 584 }
585 585
586 CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); 586 CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq));
587 587
588 if (link->io.NumPorts2 == 8) { 588 if (link->io.NumPorts2 == 8) {
589 link->conf.Attributes |= CONF_ENABLE_SPKR; 589 link->conf.Attributes |= CONF_ENABLE_SPKR;
590 link->conf.Status = CCSR_AUDIO_ENA; 590 link->conf.Status = CCSR_AUDIO_ENA;
@@ -592,7 +592,7 @@ static int pcnet_config(struct pcmcia_device *link)
592 if ((manfid == MANFID_IBM) && 592 if ((manfid == MANFID_IBM) &&
593 (prodid == PRODID_IBM_HOME_AND_AWAY)) 593 (prodid == PRODID_IBM_HOME_AND_AWAY))
594 link->conf.ConfigIndex |= 0x10; 594 link->conf.ConfigIndex |= 0x10;
595 595
596 CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); 596 CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf));
597 dev->irq = link->irq.AssignedIRQ; 597 dev->irq = link->irq.AssignedIRQ;
598 dev->base_addr = link->io.BasePort1; 598 dev->base_addr = link->io.BasePort1;
@@ -614,7 +614,7 @@ static int pcnet_config(struct pcmcia_device *link)
614 hw_info = get_ax88190(link); 614 hw_info = get_ax88190(link);
615 if (hw_info == NULL) 615 if (hw_info == NULL)
616 hw_info = get_hwired(link); 616 hw_info = get_hwired(link);
617 617
618 if (hw_info == NULL) { 618 if (hw_info == NULL) {
619 printk(KERN_NOTICE "pcnet_cs: unable to read hardware net" 619 printk(KERN_NOTICE "pcnet_cs: unable to read hardware net"
620 " address for io base %#3lx\n", dev->base_addr); 620 " address for io base %#3lx\n", dev->base_addr);
@@ -631,7 +631,7 @@ static int pcnet_config(struct pcmcia_device *link)
631 info->flags &= ~USE_BIG_BUF; 631 info->flags &= ~USE_BIG_BUF;
632 if (!use_big_buf) 632 if (!use_big_buf)
633 info->flags &= ~USE_BIG_BUF; 633 info->flags &= ~USE_BIG_BUF;
634 634
635 if (info->flags & USE_BIG_BUF) { 635 if (info->flags & USE_BIG_BUF) {
636 start_pg = SOCKET_START_PG; 636 start_pg = SOCKET_START_PG;
637 stop_pg = SOCKET_STOP_PG; 637 stop_pg = SOCKET_STOP_PG;
@@ -929,7 +929,7 @@ static void set_misc_reg(struct net_device *dev)
929 kio_addr_t nic_base = dev->base_addr; 929 kio_addr_t nic_base = dev->base_addr;
930 pcnet_dev_t *info = PRIV(dev); 930 pcnet_dev_t *info = PRIV(dev);
931 u_char tmp; 931 u_char tmp;
932 932
933 if (info->flags & HAS_MISC_REG) { 933 if (info->flags & HAS_MISC_REG) {
934 tmp = inb_p(nic_base + PCNET_MISC) & ~3; 934 tmp = inb_p(nic_base + PCNET_MISC) & ~3;
935 if (dev->if_port == 2) 935 if (dev->if_port == 2)
@@ -1022,7 +1022,7 @@ static int pcnet_close(struct net_device *dev)
1022 1022
1023 ei_close(dev); 1023 ei_close(dev);
1024 free_irq(dev->irq, dev); 1024 free_irq(dev->irq, dev);
1025 1025
1026 link->open--; 1026 link->open--;
1027 netif_stop_queue(dev); 1027 netif_stop_queue(dev);
1028 del_timer_sync(&info->watchdog); 1028 del_timer_sync(&info->watchdog);
@@ -1054,12 +1054,12 @@ static void pcnet_reset_8390(struct net_device *dev)
1054 udelay(100); 1054 udelay(100);
1055 } 1055 }
1056 outb_p(ENISR_RESET, nic_base + EN0_ISR); /* Ack intr. */ 1056 outb_p(ENISR_RESET, nic_base + EN0_ISR); /* Ack intr. */
1057 1057
1058 if (i == 100) 1058 if (i == 100)
1059 printk(KERN_ERR "%s: pcnet_reset_8390() did not complete.\n", 1059 printk(KERN_ERR "%s: pcnet_reset_8390() did not complete.\n",
1060 dev->name); 1060 dev->name);
1061 set_misc_reg(dev); 1061 set_misc_reg(dev);
1062 1062
1063} /* pcnet_reset_8390 */ 1063} /* pcnet_reset_8390 */
1064 1064
1065/*====================================================================*/ 1065/*====================================================================*/
@@ -1233,7 +1233,7 @@ static void dma_get_8390_hdr(struct net_device *dev,
1233 dev->name, ei_status.dmaing, ei_status.irqlock); 1233 dev->name, ei_status.dmaing, ei_status.irqlock);
1234 return; 1234 return;
1235 } 1235 }
1236 1236
1237 ei_status.dmaing |= 0x01; 1237 ei_status.dmaing |= 0x01;
1238 outb_p(E8390_NODMA+E8390_PAGE0+E8390_START, nic_base + PCNET_CMD); 1238 outb_p(E8390_NODMA+E8390_PAGE0+E8390_START, nic_base + PCNET_CMD);
1239 outb_p(sizeof(struct e8390_pkt_hdr), nic_base + EN0_RCNTLO); 1239 outb_p(sizeof(struct e8390_pkt_hdr), nic_base + EN0_RCNTLO);
@@ -1458,7 +1458,7 @@ static void shmem_get_8390_hdr(struct net_device *dev,
1458 void __iomem *xfer_start = ei_status.mem + (TX_PAGES<<8) 1458 void __iomem *xfer_start = ei_status.mem + (TX_PAGES<<8)
1459 + (ring_page << 8) 1459 + (ring_page << 8)
1460 - (ei_status.rx_start_page << 8); 1460 - (ei_status.rx_start_page << 8);
1461 1461
1462 copyin(hdr, xfer_start, sizeof(struct e8390_pkt_hdr)); 1462 copyin(hdr, xfer_start, sizeof(struct e8390_pkt_hdr));
1463 /* Fix for big endian systems */ 1463 /* Fix for big endian systems */
1464 hdr->count = le16_to_cpu(hdr->count); 1464 hdr->count = le16_to_cpu(hdr->count);
@@ -1473,7 +1473,7 @@ static void shmem_block_input(struct net_device *dev, int count,
1473 unsigned long offset = (TX_PAGES<<8) + ring_offset 1473 unsigned long offset = (TX_PAGES<<8) + ring_offset
1474 - (ei_status.rx_start_page << 8); 1474 - (ei_status.rx_start_page << 8);
1475 char *buf = skb->data; 1475 char *buf = skb->data;
1476 1476
1477 if (offset + count > ei_status.priv) { 1477 if (offset + count > ei_status.priv) {
1478 /* We must wrap the input move. */ 1478 /* We must wrap the input move. */
1479 int semi_count = ei_status.priv - offset; 1479 int semi_count = ei_status.priv - offset;
@@ -1541,7 +1541,7 @@ static int setup_shmem_window(struct pcmcia_device *link, int start_pg,
1541 info->base = NULL; link->win = NULL; 1541 info->base = NULL; link->win = NULL;
1542 goto failed; 1542 goto failed;
1543 } 1543 }
1544 1544
1545 ei_status.mem = info->base + offset; 1545 ei_status.mem = info->base + offset;
1546 ei_status.priv = req.Size; 1546 ei_status.priv = req.Size;
1547 dev->mem_start = (u_long)ei_status.mem; 1547 dev->mem_start = (u_long)ei_status.mem;
@@ -1768,6 +1768,8 @@ static struct pcmcia_device_id pcnet_ids[] = {
1768 PCMCIA_DEVICE_CIS_PROD_ID12("NDC", "Ethernet", 0x01c43ae1, 0x00b2e941, "NE2K.cis"), 1768 PCMCIA_DEVICE_CIS_PROD_ID12("NDC", "Ethernet", 0x01c43ae1, 0x00b2e941, "NE2K.cis"),
1769 PCMCIA_DEVICE_CIS_PROD_ID12("PMX ", "PE-200", 0x34f3f1c8, 0x10b59f8c, "PE-200.cis"), 1769 PCMCIA_DEVICE_CIS_PROD_ID12("PMX ", "PE-200", 0x34f3f1c8, 0x10b59f8c, "PE-200.cis"),
1770 PCMCIA_DEVICE_CIS_PROD_ID12("TAMARACK", "Ethernet", 0xcf434fba, 0x00b2e941, "tamarack.cis"), 1770 PCMCIA_DEVICE_CIS_PROD_ID12("TAMARACK", "Ethernet", 0xcf434fba, 0x00b2e941, "tamarack.cis"),
1771 PCMCIA_DEVICE_PROD_ID123("Fast Ethernet", "CF Size PC Card", "1.0",
1772 0xb4be14e3, 0x43ac239b, 0x0877b627),
1771 PCMCIA_DEVICE_NULL 1773 PCMCIA_DEVICE_NULL
1772}; 1774};
1773MODULE_DEVICE_TABLE(pcmcia, pcnet_ids); 1775MODULE_DEVICE_TABLE(pcmcia, pcnet_ids);