add support for PC-9800 architecture (14/26) network device
RFC PATCH 1/1 add support for PC-9800 architecture (14/26) network device
This is part 14/26 of patchset for add support NEC PC-9800 architecture, against 2.5.43.
Summary:
network card modules
- add support for PC-9800 legacy bus network cards.
diffstat:
drivers/net/3c509.c | 47 ++++ drivers/net/8390.h | 3 drivers/net/Config.in | 24 ++ drivers/net/Makefile | 4 drivers/net/Makefile.lib | 1 drivers/net/Space.c | 2 drivers/net/at1700.c | 142 ++++++++++++ drivers/net/ne.c | 517 +++++++++++++++++++++++++++++++++++++++++++++-- drivers/net/ne2k_cbus.h | 473 +++++++++++++++++++++++++++++++++++++++++++ 9 files changed, 1189 insertions(+), 24 deletions(-)
patch:
drivers/net/3c509.c +47 -0
@@ -52,6 +52,10 @@v1.19 16Oct2002 Zwane Mwaikambo <[email protected]> - Additional ethtool features */ +/* +FIXES for PC-9800: +Shu Iwanaga: 3c569B(PC-9801 C-bus) support +*/ #define DRV_NAME "3c509"#define DRV_VERSION "1.19"
@@ -168,11 +172,17 @@struct pm_dev *pmdev;#endif }; +#ifdef CONFIG_PC9800 +static int id_port__initdata =0x71d0 ; +#else static int id_port__initdata =0x110 ;/* Start with 0x110 to avoid new sound cards.*/ +#endif static struct net_device *el3_root_dev;static ushort id_read_eeprom (int index); +#ifndef CONFIG_PC9800 static ushort read_eeprom (int ioaddr,int index); +#endif static int el3_open (struct net_device *dev);static int el3_start_xmit (struct sk_buff *skb,struct net_device *dev);static void el3_interrupt (int irq,void *dev_id,struct pt_regs *regs);
@@ -251,6 +261,7 @@if (dev)SET_MODULE_OWNER (dev); +#ifndef CONFIG_PC9800 /* PC-9800 never have EISA bus */ /* First check all slots of the EISA bus. The next slot address to probe is kept in 'eisa_addr' to support multiple probe() calls. */ if (EISA_bus) {
@@ -286,6 +297,7 @@ goto found; } } +#endif /* CONFIG_PC9800 : PC-9800 never have EISA bus */ #ifdef CONFIG_MCA /* Based on Erik Nygren's ([email protected]) 3c529 patch, heavily
@@ -350,6 +362,7 @@ return -ENODEV; }#endif /* CONFIG_MCA */ +#ifndef CONFIG_PC9800 /* ISA PnP is not supported yet ... */ #ifdef __ISAPNP__if (nopnp ==1 )
@@ -407,6 +420,7 @@ID_PORT. We find cards past the first by setting the 'current_tag' on cards as they are found. Cards with their tag set will not respond to subsequent ID sequences. */ +#endif /* CONFIG_PC9800 : ISA PnP is not supported yet ... */ outb (0x00 , id_port);outb (0x00 , id_port);
@@ -458,7 +472,11 @@ {unsigned int iobase =id_read_eeprom (8 ); if_port = iobase >>14 ; +#ifndef CONFIG_PC9800 ioaddr =0x200 + ((iobase &0x1f ) <<4 ); +#else + ioaddr =0x40d0 + ((iobase &0x1f ) <<8 ); +#endif } irq =id_read_eeprom (9 ) >>12 ;
@@ -475,6 +493,14 @@ } } +#ifdef CONFIG_PC9800 +if (irq==7 ){ + irq =6 ; + }else if (irq==15 ){ + irq =13 ; + } +#endif +if (!request_region (ioaddr,EL3_IO_EXTENT ,"3c509" ))return -EBUSY ;
@@ -482,7 +508,11 @@outb (0xd0 + ++current_tag, id_port);/* Activate the adaptor at the EEPROM location. */ +#ifndef CONFIG_PC9800 outb ((ioaddr >>4 ) |0xe0 , id_port); +#else +outb ((ioaddr >>8 ) |0xe0 , id_port); +#endif EL3WINDOW (0 );if (inw (ioaddr) !=0x6d50 ) {
@@ -492,7 +522,9 @@/* Free the interrupt so that some other card can use it. */ outw (0x0f00 , ioaddr +WN0_IRQ ); +#if !defined(CONFIG_PC9800 ) || defined(CONFIG_MCA ) found: +#endif if (dev ==NULL ) { dev =init_etherdev (dev,sizeof (struct el3_private ));if (dev ==NULL ) {
@@ -564,6 +596,7 @@return 0 ; } +#ifndef CONFIG_PC9800 /* not used */ /* Read a word from the EEPROM using the regular EEPROM access register. Assume that we are in register window zero. */
@@ -574,6 +607,7 @@udelay (500 ); return inw(ioaddr + 12); } +#endif /* CONFIG_PC9800 : not used */ /* Read a word from the EEPROM when in the ISA ID probe state. */ static ushort __init id_read_eeprom (int index)
@@ -1253,7 +1287,20 @@outw (0x0001 , ioaddr +4 );/* Set the IRQ line. */ +#ifdef CONFIG_PC9800 +switch (dev->irq){ +case 6 : +outw (0x7000 |0x0f00 ,ioaddr+WN0_IRQ ); +break ; +case 13 : +outw (0xf000 |0x0f00 ,ioaddr+WN0_IRQ ); +break ; +default : +#endif outw ((dev->irq <<12 ) |0x0f00 , ioaddr +WN0_IRQ ); +#ifdef CONFIG_PC9800 + } +#endif /* Set the station address in window 2 each time opened. */ EL3WINDOW (2 );
drivers/net/8390.h +2 -1
@@ -123,7 +123,8 @@#define inb_p (port) in_8(port)#define outb_p (val,port) out_8(port,val) -#elif defined(CONFIG_ARM_ETHERH ) || defined(CONFIG_ARM_ETHERH_MODULE ) +#elif defined(CONFIG_ARM_ETHERH ) || defined(CONFIG_ARM_ETHERH_MODULE ) || \ + defined(CONFIG_NET_CBUS )#define EI_SHIFT (x) (ei_local->reg_offset[x])#else #define EI_SHIFT (x) (x)
drivers/net/Config.in +24 -0
@@ -112,7 +112,11 @@ source drivers/net/tulip/Config.in fi if [ "$CONFIG_ISA" = "y" -o "$CONFIG_MCA" = "y" ]; then + if [ "$CONFIG_PC9800" != "y" ]; then dep_tristate ' AT1700/1720 support (EXPERIMENTAL)' CONFIG_AT1700 $CONFIG_EXPERIMENTAL + else + dep_tristate ' Allied Telesis RE1000Plus support (EXPERIMENTAL)' CONFIG_AT1700 $CONFIG_EXPERIMENTAL + fi fi if [ "$CONFIG_ISA" = "y" -o "$CONFIG_EISA" = "y" -o "$CONFIG_MCA" = "y" ]; then tristate ' DEPCA, DE10x, DE200, DE201, DE202, DE422 support' CONFIG_DEPCA
@@ -120,6 +124,7 @@ if [ "$CONFIG_ISA" = "y" -o "$CONFIG_EISA" = "y" -o "$CONFIG_PCI" = "y" ]; then tristate ' HP 10/100VG PCLAN (ISA, EISA, PCI) support' CONFIG_HP100 fi + if [ "$CONFIG_PC9800" != "y" ]; then dep_bool ' Other ISA cards' CONFIG_NET_ISA $CONFIG_ISA if [ "$CONFIG_NET_ISA" = "y" ]; then tristate ' Cabletron E21xx support' CONFIG_E2100
@@ -146,6 +151,25 @@ tristate ' NE/2 (ne2000 MCA version) support' CONFIG_NE2_MCA tristate ' IBM LAN Adapter/A support' CONFIG_IBMLANA fi + else # CONFIG_PC9800 = y + bool ' NEC PC-9800 C-bus cards' CONFIG_NET_CBUS + if [ "$CONFIG_NET_CBUS" = "y" ]; then + tristate ' Most NE2000-based Ethernet support' CONFIG_NE2K_CBUS + if [ "$CONFIG_NE2K_CBUS" != "n" ]; then + bool ' Melco EGY-98 support' CONFIG_NE2K_CBUS_EGY98 + bool ' Melco LGY-98 support' CONFIG_NE2K_CBUS_LGY98 + bool ' ICM IF-27xxET support' CONFIG_NE2K_CBUS_ICM + bool ' I-O DATA LA-98 support (NOT TESTED!)' CONFIG_NE2K_CBUS_IOLA98 + bool ' Contec C-NET(98)E/L support (NOT TESTED!)' CONFIG_NE2K_CBUS_CNET98EL + if [ "$CONFIG_NE2K_CBUS_CNET98EL" != "n" ]; then + hex ' C-NET(98)E/L I/O base address (aaed or 55ed)' CONFIG_NE2K_CBUS_CNET98EL_IO_BASE aaed + fi + bool ' Allied Telesis LA-98 Support (NOT TESTED!)' CONFIG_NE2K_CBUS_ATLA98 + bool ' ELECOM Laneed LD-BDN[123]A Support (NOT TESTED!)' CONFIG_NE2K_CBUS_BDN + bool ' NEC PC-9801-108 Support (NOT TESTED!)' CONFIG_NE2K_CBUS_NEC108 + fi + fi + fi # CONFIG_PC9800 if [ "$CONFIG_ISA" = "y" -o "$CONFIG_EISA" = "y" -o "$CONFIG_PCI" = "y" ]; then bool ' EISA, VLB, PCI and on board controllers' CONFIG_NET_PCI else
drivers/net/Makefile +4 -0
@@ -87,7 +87,11 @@ obj-$(CONFIG_ARM_ETHERH) += 8390.o obj-$(CONFIG_WD80x3) += wd.o 8390.o obj-$(CONFIG_EL2) += 3c503.o 8390.o +ifneq ($(CONFIG_PC9800),y) obj-$(CONFIG_NE2000) += ne.o 8390.o +else +obj-$(CONFIG_NE2K_CBUS) += ne.o 8390.o +endif obj-$(CONFIG_NE2_MCA) += ne2.o 8390.o obj-$(CONFIG_HPLAN) += hp.o 8390.o obj-$(CONFIG_HPLAN_PLUS) += hp-plus.o 8390.o
drivers/net/Makefile.lib +1 -0
@@ -19,6 +19,7 @@ obj-$(CONFIG_MACMACE) += crc32.o obj-$(CONFIG_MIPS_AU1000_ENET) += crc32.o obj-$(CONFIG_NATSEMI) += crc32.o +obj-$(CONFIG_NE2K_CBUS) += crc32.o obj-$(CONFIG_PCMCIA_FMVJ18X) += crc32.o obj-$(CONFIG_PCMCIA_SMC91C92) += crc32.o obj-$(CONFIG_PCMCIA_XIRTULIP) += crc32.o
drivers/net/Space.c +1 -1
@@ -243,7 +243,7 @@ #ifdef CONFIG_E2100 /* Cabletron E21xx series. */ {e2100_probe, 0}, #endif -#ifdef CONFIG_NE2000 /* ISA (use ne2k-pci for PCI cards) */ +#if defined(CONFIG_NE2000) || defined(CONFIG_NE2K_CBUS) /* ISA & PC-9800 CBUS (use ne2k-pci for PCI cards) */ {ne_probe, 0}, #endif #ifdef CONFIG_LANCE /* ISA/VLB (use pcnet32 for PCI cards) */
drivers/net/at1700.c +134 -8
342 lines not on this page · raw message
drivers/net/ne.c +503 -14
779 lines not on this page · raw message
drivers/net/ne2k_cbus.h +473 -0
473 lines not on this page · raw message