This message generated a parse failure. Raw output follows here. Please use 'back' to navigate. From devnull@lkml.org Tue May 21 19:30:26 2024 Received: from spaans.ds9a.nl (adsl-xs4all.ds9a.nl [213.84.159.51]) by kylie.puddingonline.com (8.11.6/8.11.6) with SMTP id g8HM7pi08540 for ; Wed, 18 Sep 2002 00:07:51 +0200 Received: (qmail 13406 invoked by uid 1000); 17 Sep 2002 19:54:29 -0000 Received: (maildatabase); juh Received: (qmail 3094 invoked by alias); 17 Dec 2000 01:09:51 -0000 Received: (qmail 3091 invoked from network); 17 Dec 2000 01:09:50 -0000 Received: from vger.kernel.org (199.183.24.194) by spaans.ds9a.nl with SMTP; 17 Dec 2000 01:09:50 -0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Sat, 16 Dec 2000 20:39:47 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Sat, 16 Dec 2000 20:39:28 -0500 Received: from jalon.able.es ([212.97.163.2]:714 "EHLO jalon.able.es") by vger.kernel.org with ESMTP id ; Sat, 16 Dec 2000 20:39:09 -0500 Received: from correo.able.es ([212.97.169.209]) by jalon.able.es (Netscape Messaging Server 4.15) with SMTP id G5OU1800.92E; Sun, 17 Dec 2000 02:12:44 +0100 Date: Sun, 17 Dec 2000 02:08:36 +0100 From: "J . A . Magallon" To: Linux Kernel List Cc: alan@lxorguk.ukuu.org.uk, becker@scyld.com Subject: [PATCH] ne2k-pci update Message-Id: <20001217020836.A734@werewolf.able.es> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT X-Mailer: Balsa 1.0.0 Lines: 217 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org Hi, everyone. Here is a patch to update the 2.2.18 driver for ne2k-pci cards to 1.02 version. Reviewed by Donald Becker, tried on 18, 19-pre1 and 19-pre2. Changes: - full duplex support on Realtek and Holtek cards, ignored on others. - module params debug=1 (0..7) full_duplex=1,0,1 ... (up to 6 supported cards) NOTE: full duplex is not active by default. Please apply for 19-preX... -------------- patch-ne2k-pci --- linux/drivers/net/ne2k-pci.c.org Sun Dec 17 01:51:04 2000 +++ linux/drivers/net/ne2k-pci.c Sun Dec 17 01:55:22 2000 @@ -12,19 +12,31 @@ This software may be used and distributed according to the terms of the GNU Public License, incorporated herein by reference. - The author may be reached as becker@CESDIS.gsfc.nasa.gov, or C/O - Center of Excellence in Space Data and Information Sciences - Code 930.5, Goddard Space Flight Center, Greenbelt MD 20771 + Drivers based on or derived from this code fall under the GPL and must + retain the authorship, copyright and license notice. This file is not + a complete program and may only be used when the entire operating + system is licensed under the GPL. + + The author may be reached as becker@scyld.com, or C/O + Scyld Computing Corporation + 410 Severn Ave., Suite 210 + Annapolis MD 21403 + Issues remaining: People are making PCI ne2000 clones! Oh the horror, the horror... + Limited full-duplex support. - Issues remaining: - No full-duplex support. + ChangeLog: + + 12/15/2000 Merged Scyld v1.02 into 2.2.18 + J.A. Magallon */ -/* Our copyright info must remain in the binary. */ -static const char *version = -"ne2k-pci.c:vpre-1.00e 5/27/99 D. Becker/P. Gortmaker http://cesdis.gsfc.nasa.gov/linux/drivers/ne2k-pci.html\n"; +/* These identify the driver base version and may not be removed. */ +static const char version1[] = +"ne2k-pci.c:v1.02 10/19/2000 D. Becker/P. Gortmaker\n"; +static const char version2[] = +" http://www.scyld.com/network/ne2k-pci.html\n"; #include #include @@ -49,7 +61,18 @@ #endif /* Set statically or when loading the driver module. */ -static int debug = 1; +static int debug = 1; /* 1 normal messages, 0 quiet .. 7 verbose. */ +/* More are supported, limit only on options */ +#define MAX_UNITS 6 +/* Used to pass the full-duplex flag, etc. */ +static int full_duplex[MAX_UNITS] = {0, }; +static int options[MAX_UNITS] = {0, }; + +MODULE_AUTHOR("Donald Becker / Paul Gortmaker"); +MODULE_DESCRIPTION("PCI NE2000 clone driver"); +MODULE_PARM(debug, "i"); +MODULE_PARM(options, "1-" __MODULE_STRING(MAX_UNITS) "i"); +MODULE_PARM(full_duplex, "1-" __MODULE_STRING(MAX_UNITS) "i"); /* Some defines that people can play with if so inclined. */ @@ -62,12 +85,13 @@ /* Do we have a non std. amount of memory? (in units of 256 byte pages) */ /* #define PACKETBUF_MEMSIZE 0x40 */ -#define ne2k_flags reg0 /* Rename an existing field to store flags! */ - -/* Only the low 8 bits are usable for non-init-time flags! */ +/* Flags. We rename an existing ei_status field to store flags! */ +/* Thus only the low 8 bits are usable for non-init-time flags. */ +#define ne2k_flags reg0 enum { - HOLTEK_FDX=1, /* Full duplex -> set 0x80 at offset 0x20. */ - ONLY_16BIT_IO=2, ONLY_32BIT_IO=4, /* Chip can do only 16/32-bit xfers. */ + ONLY_16BIT_IO=8, ONLY_32BIT_IO=4, /* Chip can do only 16/32-bit xfers. */ + FORCE_FDX=0x20, /* User override. */ + REALTEK_FDX=0x40, HOLTEK_FDX=0x80, STOP_PG_0x60=0x100, }; @@ -79,18 +103,17 @@ int flags; } pci_clone_list[] __initdata = { - {0x10ec, 0x8029, "RealTek RTL-8029", 0}, - {0x1050, 0x0940, "Winbond 89C940", 0}, - {0x11f6, 0x1401, "Compex RL2000", 0}, - {0x8e2e, 0x3000, "KTI ET32P2", 0}, - {0x4a14, 0x5000, "NetVin NV5000SC", 0}, - {0x1106, 0x0926, "Via 86C926", ONLY_16BIT_IO}, - {0x10bd, 0x0e34, "SureCom NE34", 0}, - {0x1050, 0x5a5a, "Winbond", 0}, - {0x12c3, 0x0058, "Holtek HT80232", ONLY_16BIT_IO | HOLTEK_FDX}, - {0x12c3, 0x5598, "Holtek HT80229", - ONLY_32BIT_IO | HOLTEK_FDX | STOP_PG_0x60 }, - {0,} +{0x10ec, 0x8029, "RealTek RTL-8029", REALTEK_FDX}, +{0x1050, 0x0940, "Winbond 89C940", 0}, +{0x1050, 0x5a5a, "Winbond w89c940", 0}, +{0x8e2e, 0x3000, "KTI ET32P2", 0}, +{0x4a14, 0x5000, "NetVin NV5000SC", 0}, +{0x1106, 0x0926, "Via 86C926", ONLY_16BIT_IO}, +{0x10bd, 0x0e34, "SureCom NE34", 0}, +{0x12c3, 0x0058, "Holtek HT80232", ONLY_16BIT_IO|HOLTEK_FDX}, +{0x12c3, 0x5598, "Holtek HT80229", ONLY_32BIT_IO|HOLTEK_FDX|STOP_PG_0x60 }, +{0x11f6, 0x1401, "Compex RL2000", 0}, +{0,} }; /* ---- No user-serviceable parts below ---- */ @@ -119,7 +142,7 @@ static void ne2k_pci_block_output(struct device *dev, const int count, const unsigned char *buf, const int start_page); - + /* No room in the standard 8390 structure for extra info we need. */ struct ne2k_pci_card { @@ -137,7 +160,7 @@ { /* We must emit version information. */ if (debug) - printk(KERN_INFO "%s", version); + printk(KERN_INFO "%s" KERN_INFO "%s", version1, version2); if (ne2k_pci_probe(0)) { printk(KERN_NOTICE "ne2k-pci.c: No useable cards found, driver NOT installed.\n"); @@ -263,8 +286,8 @@ return cards_found ? 0 : -ENODEV; } -__initfunc (static struct device *ne2k_pci_probe1(struct device *dev, long ioaddr, int irq, - int chip_idx)) +__initfunc (static struct device *ne2k_pci_probe1(struct device *dev, + long ioaddr, int irq, int chip_idx)) { int i; unsigned char SA_prom[32]; @@ -291,6 +314,8 @@ dev = init_etherdev(dev, 0); + if (!dev) return 0; + /* Reset card. Who knows what dain-bramaged state it was left in. */ { unsigned long reset_start_time = jiffies; @@ -342,7 +367,7 @@ /* Note: all PCI cards have at least 16 bit access, so we don't have to check for 8 bit cards. Most cards permit 32 bit access. */ if (pci_clone_list[chip_idx].flags & ONLY_32BIT_IO) { - for (i = 0; i < 4 ; i++) + for (i = 0; i < 8 ; i++) ((u32 *)SA_prom)[i] = le32_to_cpu(inl(ioaddr + NE_DATAPORT)); } else for(i = 0; i < 32 /*sizeof(SA_prom)*/; i++) @@ -379,6 +404,10 @@ ei_status.stop_page = stop_page; ei_status.word16 = 1; ei_status.ne2k_flags = pci_clone_list[chip_idx].flags; + if (chip_idx < MAX_UNITS) { + if (full_duplex[chip_idx] || (options[chip_idx] & FORCE_FDX)) + ei_status.ne2k_flags |= FORCE_FDX; + } ei_status.rx_start_page = start_page + TX_PAGES; #ifdef PACKETBUF_MEMSIZE @@ -401,8 +430,17 @@ { if (request_irq(dev->irq, ei_interrupt, SA_SHIRQ, dev->name, dev)) return -EAGAIN; - ei_open(dev); MOD_INC_USE_COUNT; + /* Set full duplex for the chips that we know about. */ + if (ei_status.ne2k_flags & FORCE_FDX) { + long ioaddr = dev->base_addr; + if (ei_status.ne2k_flags & REALTEK_FDX) { + outb(0xC0 + E8390_NODMA, ioaddr + NE_CMD); /* Page 3 */ + outb(inb(ioaddr + 0x20) | 0x80, ioaddr + 0x20); + } else if (ei_status.ne2k_flags & HOLTEK_FDX) + outb(inb(ioaddr + 0x20) | 0x80, ioaddr + 0x20); + } + ei_open(dev); return 0; } -------------- patch-ne2k-pci -- Juan Antonio Magallon Lacarta #> cd /pub mailto:jamagallon@able.es #> more beer Linux werewolf 2.2.19-pre2 #2 SMP Sun Dec 17 00:51:15 CET 2000 i686 - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org Please read the FAQ at http://www.tux.org/lkml/