From linux-activists@niksula.hut.fiFri Feb 10 14:02:15 1995 Date: Thu, 9 Feb 1995 01:13:21 +0200 From: Linux Activists To: Linux-Activists Subject: Linux-Activists - NET Channel digest. 95-1-8-20:41 Topics: Bugfix for DE4x5 and support for ZX312 ---------------------------------------------------------------------- From: chris@cosy.sbg.ac.at (Christian Linhart) Subject: Bugfix for DE4x5 and support for ZX312 Date: Wed, 8 Feb 1995 16:24:43 +0100 (MET) Hi, I fixed two bugs with the DE4x5-driver and I added support for older ZNYX ZX312 Ethercards which are almost DE435. (The newer versions should not differ from the DE435 according to information from ZNYX) ZX312 support can be enabled via autoconf.h. I also added the appropriate stuff to config.in. Thanks to Alan Deikman from ZNYX for providing me with information with which cards the ZX312 is (almost) compatible to and what the differences are. Th first bug was a typo in drivers/net/Space.c, where a capital X was used instead of a small x. This caused the DE4x5-driver never to be initialized. The second bug was a parameter list error in the interrupt handler function. Enough said, below is the suggested patch in form of a diff against 1.1.89. -Chris P.S.: Please Cc: replys to me because I can't receive linux-activists at the moment. Our mail2news-gateway is down because the CS-dept is currently moving to another building. --------------------- cut here --------------------- diff -rc linux/arch/i386/config.in 1.1.89-my-patches/arch/i386/config.in *** linux/arch/i386/config.in Sun Feb 5 14:17:17 1995 --- 1.1.89-my-patches/arch/i386/config.in Wed Feb 8 13:43:42 1995 *************** *** 162,168 **** bool 'Ansel Communications EISA 3200 support' CONFIG_AC3200 n fi bool 'Apricot Xen-II on board ethernet' CONFIG_APRICOT n ! bool 'DE425, DE434, DE435 support' CONFIG_DE4x5 n # bool 'DEC 21040 PCI support' CONFIG_DEC_ELCP n # bool 'LPL T100V 100Mbs support' CONFIG_LPL_T100 n # bool 'PCnet32 (32 bit VLB and PCI LANCE) support' CONFIG_PCNET32 n --- 162,171 ---- bool 'Ansel Communications EISA 3200 support' CONFIG_AC3200 n fi bool 'Apricot Xen-II on board ethernet' CONFIG_APRICOT n ! bool 'DE425, DE434, DE435, ZX312 support' CONFIG_DE4x5 n ! if [ "$CONFIG_DE4x5" = "y" ]; then ! bool 'old ZX312 support' CONFIG_OLDZX312 n ! fi # bool 'DEC 21040 PCI support' CONFIG_DEC_ELCP n # bool 'LPL T100V 100Mbs support' CONFIG_LPL_T100 n # bool 'PCnet32 (32 bit VLB and PCI LANCE) support' CONFIG_PCNET32 n diff -rc linux/drivers/net/Space.c 1.1.89-my-patches/drivers/net/Space.c *** linux/drivers/net/Space.c Tue Jan 31 13:36:24 1995 --- 1.1.89-my-patches/drivers/net/Space.c Tue Feb 7 14:49:17 1995 *************** *** 115,121 **** #ifdef CONFIG_EWRK3 /* DEC EtherWORKS 3 */ && ewrk3_probe(dev) #endif ! #ifdef CONFIG_DE4X5 /* DEC DE425, DE434, DE435 adapters */ && de4x5_probe(dev) #endif #ifdef CONFIG_APRICOT /* Apricot I82596 */ --- 115,121 ---- #ifdef CONFIG_EWRK3 /* DEC EtherWORKS 3 */ && ewrk3_probe(dev) #endif ! #ifdef CONFIG_DE4x5 /* DEC DE425, DE434, DE435 adapters */ && de4x5_probe(dev) #endif #ifdef CONFIG_APRICOT /* Apricot I82596 */ diff -rc linux/drivers/net/de4x5.c 1.1.89-my-patches/drivers/net/de4x5.c *** linux/drivers/net/de4x5.c Thu Jan 26 05:53:58 1995 --- 1.1.89-my-patches/drivers/net/de4x5.c Wed Feb 8 13:59:04 1995 *************** *** 90,95 **** --- 90,101 ---- 0.1 17-Nov-94 Initial writing. ALPHA code release. 0.2 13-Jan-95 Added PCI support for DE435's 0.21 19-Jan-95 Added auto media detection + 0.22 8-Feb-95 by Christian Linhart : + * Fixed parameter list of de4x5_interrupt. + * added (kludgy) support for old ZNYX ZX312 cards. + According to info from ZNYX, cards + prior to revision 4 have EPROM + contents which differ from the DE435. ========================================================================= */ *************** *** 273,279 **** */ static int de4x5_open(struct device *dev); static int de4x5_queue_pkt(struct sk_buff *skb, struct device *dev); ! static void de4x5_interrupt(int reg_ptr); static int de4x5_close(struct device *dev); static struct enet_statistics *de4x5_get_stats(struct device *dev); static void set_multicast_list(struct device *dev, int num_addrs, void *addrs); --- 279,285 ---- */ static int de4x5_open(struct device *dev); static int de4x5_queue_pkt(struct sk_buff *skb, struct device *dev); ! static void de4x5_interrupt(int irq, struct pt_regs *reg_ptr); static int de4x5_close(struct device *dev); static struct enet_statistics *de4x5_get_stats(struct device *dev); static void set_multicast_list(struct device *dev, int num_addrs, void *addrs); *************** *** 404,410 **** --- 410,420 ---- } printk(", h/w address "); + #ifdef CONFIG_OLDZX312 + status=0; + #else status = aprom_crc(dev); + #endif for (i = 0; i < ETH_ALEN - 1; i++) { /* get the ethernet addr. */ printk("%2.2x:", dev->dev_addr[i]); } *************** *** 829,837 **** ** The DE4X5 interrupt handler. */ static void ! de4x5_interrupt(int reg_ptr) { - int irq = -(((struct pt_regs *)reg_ptr)->orig_eax+2); struct device *dev = (struct device *)(irq2dev_map[irq]); struct de4x5_private *lp; int iobase; --- 839,846 ---- ** The DE4X5 interrupt handler. */ static void ! de4x5_interrupt(int irq, struct pt_regs *reg_ptr) { struct device *dev = (struct device *)(irq2dev_map[irq]); struct de4x5_private *lp; int iobase; *************** *** 1262,1268 **** --- 1271,1279 ---- pcibios_write_config_word(pb, PCI_DEVICE, PCI_COMMAND, status); /* If a device is present, initialise it */ + #ifndef CONFIG_OLDZX312 if (DevicePresent(DE4X5_APROM) == 0) { + #endif pci_slots_full[pb] |= (0x01 << dev_num); if ((dev = alloc_device(dev, iobase)) != NULL) { dev->irq = irq; *************** *** 1271,1277 **** --- 1282,1290 ---- } num_eth++; } + #ifndef CONFIG_OLDZX312 } + #endif } } else { printk("%s: PCI device already allocated at slot %d.\n", dev->name, dev_num); ------------------------------ End of NET Digest ***************** -------