From 933d52b17333ad51d15643cf286018e3de2f426b Mon Sep 17 00:00:00 2001 From: imp Date: Thu, 16 Feb 2017 21:56:51 +0000 Subject: [PATCH] Remove EISA support for ep driver. Left in place EISA strings that are still relevant (ISA cards can still be in EISA mode, and we're still ignoring those in the identify routine). Notes about cards in EISA mode have been left in the manual since they aren't relevant to EISA support, but instruct how to properly configure an ISA card in a mode when it is in a ISA bus slot. --- share/man/man4/man4.i386/ep.4 | 11 +- sys/conf/files | 1 - sys/dev/ep/if_ep.c | 54 ++------ sys/dev/ep/if_ep_eisa.c | 252 ---------------------------------- sys/dev/ep/if_ep_isa.c | 5 +- sys/dev/ep/if_epvar.h | 1 - sys/modules/ep/Makefile | 1 - 7 files changed, 19 insertions(+), 306 deletions(-) delete mode 100644 sys/dev/ep/if_ep_eisa.c diff --git a/share/man/man4/man4.i386/ep.4 b/share/man/man4/man4.i386/ep.4 index 8ff20b3116c..9d5cd7da209 100644 --- a/share/man/man4/man4.i386/ep.4 +++ b/share/man/man4/man4.i386/ep.4 @@ -99,8 +99,6 @@ driver supports Ethernet adapters based on the .It 3Com 3C574, 3C574TX, 3C574-TX, 3CCFE574BT, 3CXFE574BT, 3C3FE574BT PCMCIA .It -3Com 3C579-TP, 3C579-BNC EISA -.It 3Com 3C589, 3C589B, 3C589C, 3C589D, 3CXE589DT PCMCIA .It 3Com 3CCFEM556B, 3CCFEM556BI PCMCIA @@ -121,10 +119,7 @@ scan operation at IO address 0x110. Beware! Avoid placing other cards at that address! .Pp -Furthermore, the 3c509 should only be configured in EISA mode -when installed in a computer that has actual EISA slots -(and an EISA-aware BIOS). -The normal driver auto-detection support is sufficient for non-EISA systems. +Furthermore, the 3c509 should not be configured in EISA mode. .Pp Cards in PnP mode may conflict with other resources in the system. Ensure your BIOS is configured correctly to exclude resources used by @@ -180,9 +175,9 @@ has about connectors, so it is assuming the worst. .It "ep0: unknown ID 0xXXXXXXXX" The driver has found an ID that it believes it supports, but does not have a specific identification string to present to the user. -.It "ep0: <%s> at port 0x%03x in EISA mode" +.It "ep0: <%s> at port 0x%03x in EISA mode, ignored." The 3C509 ISA card is in EISA mode. -This message appears to be purely informational. +The card will be ignored until it is taken out of EISA mode. .It "ep0: <%s> at x0%03x in PnP mode" This card appears to be in Plug and Play mode. It should be probed as part of the plug and play phase of the ISA diff --git a/sys/conf/files b/sys/conf/files index a28dc7b6cf0..2942a71c31e 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -1604,7 +1604,6 @@ dev/et/if_et.c optional et dev/en/if_en_pci.c optional en pci dev/en/midway.c optional en dev/ep/if_ep.c optional ep -dev/ep/if_ep_eisa.c optional ep eisa dev/ep/if_ep_isa.c optional ep isa dev/ep/if_ep_pccard.c optional ep pccard dev/esp/esp_pci.c optional esp pci diff --git a/sys/dev/ep/if_ep.c b/sys/dev/ep/if_ep.c index 9f6848a1de5..fcd8796f6d0 100644 --- a/sys/dev/ep/if_ep.c +++ b/sys/dev/ep/if_ep.c @@ -530,31 +530,17 @@ epstart_locked(struct ifnet *ifp) CSR_WRITE_2(sc, EP_COMMAND, SET_TX_AVAIL_THRESH | EP_THRESH_DISABLE); - /* XXX 4.x and earlier would splhigh here */ - CSR_WRITE_2(sc, EP_W1_TX_PIO_WR_1, len); /* Second dword meaningless */ CSR_WRITE_2(sc, EP_W1_TX_PIO_WR_1, 0x0); - if (EP_FTST(sc, F_ACCESS_32_BITS)) { - for (m = m0; m != NULL; m = m->m_next) { - if (m->m_len > 3) - CSR_WRITE_MULTI_4(sc, EP_W1_TX_PIO_WR_1, - mtod(m, uint32_t *), m->m_len / 4); - if (m->m_len & 3) - CSR_WRITE_MULTI_1(sc, EP_W1_TX_PIO_WR_1, - mtod(m, uint8_t *)+(m->m_len & (~3)), - m->m_len & 3); - } - } else { - for (m = m0; m != NULL; m = m->m_next) { - if (m->m_len > 1) - CSR_WRITE_MULTI_2(sc, EP_W1_TX_PIO_WR_1, - mtod(m, uint16_t *), m->m_len / 2); - if (m->m_len & 1) - CSR_WRITE_1(sc, EP_W1_TX_PIO_WR_1, - *(mtod(m, uint8_t *)+m->m_len - 1)); - } + for (m = m0; m != NULL; m = m->m_next) { + if (m->m_len > 1) + CSR_WRITE_MULTI_2(sc, EP_W1_TX_PIO_WR_1, + mtod(m, uint16_t *), m->m_len / 2); + if (m->m_len & 1) + CSR_WRITE_1(sc, EP_W1_TX_PIO_WR_1, + *(mtod(m, uint8_t *)+m->m_len - 1)); } while (pad--) @@ -788,25 +774,13 @@ epread(struct ep_softc *sc) mcur->m_next = m; lenthisone = min(rx_fifo, M_TRAILINGSPACE(m)); } - if (EP_FTST(sc, F_ACCESS_32_BITS)) { - /* default for EISA configured cards */ - CSR_READ_MULTI_4(sc, EP_W1_RX_PIO_RD_1, - (uint32_t *)(mtod(m, caddr_t)+m->m_len), - lenthisone / 4); - m->m_len += (lenthisone & ~3); - if (lenthisone & 3) - CSR_READ_MULTI_1(sc, EP_W1_RX_PIO_RD_1, - mtod(m, caddr_t)+m->m_len, lenthisone & 3); - m->m_len += (lenthisone & 3); - } else { - CSR_READ_MULTI_2(sc, EP_W1_RX_PIO_RD_1, - (uint16_t *)(mtod(m, caddr_t)+m->m_len), - lenthisone / 2); - m->m_len += lenthisone; - if (lenthisone & 1) - *(mtod(m, caddr_t)+m->m_len - 1) = - CSR_READ_1(sc, EP_W1_RX_PIO_RD_1); - } + CSR_READ_MULTI_2(sc, EP_W1_RX_PIO_RD_1, + (uint16_t *)(mtod(m, caddr_t)+m->m_len), + lenthisone / 2); + m->m_len += lenthisone; + if (lenthisone & 1) + *(mtod(m, caddr_t)+m->m_len - 1) = + CSR_READ_1(sc, EP_W1_RX_PIO_RD_1); rx_fifo -= lenthisone; } diff --git a/sys/dev/ep/if_ep_eisa.c b/sys/dev/ep/if_ep_eisa.c deleted file mode 100644 index bc77ec8870f..00000000000 --- a/sys/dev/ep/if_ep_eisa.c +++ /dev/null @@ -1,252 +0,0 @@ -/*- - * Product specific probe and attach routines for: - * 3COM 3C579 and 3C509(in eisa config mode) ethernet controllers - * - * Copyright (c) 1996 Justin T. Gibbs - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice immediately at the beginning of the file, without modification, - * this list of conditions, and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Absolutely no warranty of function or purpose is made by the author - * Justin T. Gibbs. - * 4. Modifications may be freely made to this file if the above conditions - * are met. - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include -#include -#include - -#include - -#include -#include - -#define EISA_DEVICE_ID_3COM_3C509_TP 0x506d5090 -#define EISA_DEVICE_ID_3COM_3C509_BNC 0x506d5091 -#define EISA_DEVICE_ID_3COM_3C579_TP 0x506d5092 -#define EISA_DEVICE_ID_3COM_3C579_BNC 0x506d5093 -#define EISA_DEVICE_ID_3COM_3C509_COMBO 0x506d5094 -#define EISA_DEVICE_ID_3COM_3C509_TPO 0x506d5095 - -#define EP_EISA_SLOT_OFFSET 0x0c80 -#define EP_EISA_IOSIZE 0x000a - -#define EISA_IOCONF 0x0008 -#define IRQ_CHANNEL 0xf000 -#define INT_3 0x3000 -#define INT_5 0x5000 -#define INT_7 0x7000 -#define INT_9 0x9000 -#define INT_10 0xa000 -#define INT_11 0xb000 -#define INT_12 0xc000 -#define INT_15 0xf000 -#define EISA_BPROM_MEDIA_CONF 0x0006 -#define TRANS_TYPE 0xc000 -#define TRANS_TP 0x0000 -#define TRANS_AUI 0x4000 -#define TRANS_BNC 0xc000 - -static const char *ep_match(eisa_id_t type); - -static const char * -ep_match(eisa_id_t type) -{ - switch (type) { - case EISA_DEVICE_ID_3COM_3C509_TP: - return ("3Com 3C509-TP"); - case EISA_DEVICE_ID_3COM_3C509_BNC: - return ("3Com 3C509-BNC"); - case EISA_DEVICE_ID_3COM_3C579_TP: - return ("3Com 3C579-TP"); - case EISA_DEVICE_ID_3COM_3C579_BNC: - return ("3Com 3C579-BNC"); - case EISA_DEVICE_ID_3COM_3C509_COMBO: - return ("3Com 3C509-Combo"); - case EISA_DEVICE_ID_3COM_3C509_TPO: - return ("3Com 3C509-TPO"); - default: - return (NULL); - } -} - -static int -ep_eisa_probe(device_t dev) -{ - const char *desc; - u_long iobase; - u_short conf; - u_long port; - int irq; - int int_trig; - - desc = ep_match(eisa_get_id(dev)); - if (!desc) - return (ENXIO); - device_set_desc(dev, desc); - - port = (eisa_get_slot(dev) * EISA_SLOT_SIZE); - iobase = port + EP_EISA_SLOT_OFFSET; - - /* We must be in EISA configuration mode */ - if ((inw(iobase + EP_W0_ADDRESS_CFG) & 0x1f) != 0x1f) - return (ENXIO); - - eisa_add_iospace(dev, iobase, EP_EISA_IOSIZE, RESVADDR_NONE); - eisa_add_iospace(dev, port, EP_IOSIZE, RESVADDR_NONE); - - conf = inw(iobase + EISA_IOCONF); - /* Determine our IRQ */ - switch (conf & IRQ_CHANNEL) { - case INT_3: - irq = 3; - break; - case INT_5: - irq = 5; - break; - case INT_7: - irq = 7; - break; - case INT_9: - irq = 9; - break; - case INT_10: - irq = 10; - break; - case INT_11: - irq = 11; - break; - case INT_12: - irq = 12; - break; - case INT_15: - irq = 15; - break; - default: - /* Disabled */ - printf("ep: 3COM Network Adapter at " - "slot %d has its IRQ disabled. " - "Probe failed.\n", - eisa_get_slot(dev)); - return (ENXIO); - } - - switch (eisa_get_id(dev)) { - case EISA_DEVICE_ID_3COM_3C579_BNC: - case EISA_DEVICE_ID_3COM_3C579_TP: - int_trig = EISA_TRIGGER_LEVEL; - break; - default: - int_trig = EISA_TRIGGER_EDGE; - break; - } - - eisa_add_intr(dev, irq, int_trig); - - return (0); -} - -static int -ep_eisa_attach(device_t dev) -{ - struct ep_softc *sc = device_get_softc(dev); - struct resource *eisa_io = NULL; - uint32_t eisa_iobase; - int irq; - int error = 0; - int rid; - - rid = 1; - eisa_io = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, RF_ACTIVE); - if (!eisa_io) { - device_printf(dev, "No I/O space?!\n"); - error = ENXIO; - goto bad; - } - eisa_iobase = rman_get_start(eisa_io); - - /* Reset and Enable the card */ - outb(eisa_iobase + EP_W0_CONFIG_CTRL, W0_P4_CMD_RESET_ADAPTER); - DELAY(1000); /* we must wait at least 1 ms */ - outb(eisa_iobase + EP_W0_CONFIG_CTRL, W0_P4_CMD_ENABLE_ADAPTER); - /* Now the registers are availible through the lower ioport */ - - if ((error = ep_alloc(dev))) { - device_printf(dev, "ep_alloc() failed! (%d)\n", error); - goto bad; - } - switch (eisa_get_id(dev)) { - case EISA_DEVICE_ID_3COM_3C579_BNC: - case EISA_DEVICE_ID_3COM_3C579_TP: - sc->stat = F_ACCESS_32_BITS; - break; - } - - ep_get_media(sc); - - irq = rman_get_start(sc->irq); - if (irq == 9) - irq = 2; - - GO_WINDOW(sc, 0); - SET_IRQ(sc, irq); - - if ((error = ep_attach(sc))) { - device_printf(dev, "ep_attach() failed! (%d)\n", error); - goto bad; - } - if ((error = bus_setup_intr(dev, sc->irq, INTR_TYPE_NET | INTR_MPSAFE, - NULL, ep_intr, sc, &sc->ep_intrhand))) { - device_printf(dev, "bus_setup_intr() failed! (%d)\n", error); - goto bad; - } - return (0); - -bad: - if (eisa_io) - bus_release_resource(dev, SYS_RES_IOPORT, 0, eisa_io); - - ep_free(dev); - return (error); -} - -static device_method_t ep_eisa_methods[] = { - /* Device interface */ - DEVMETHOD(device_probe, ep_eisa_probe), - DEVMETHOD(device_attach, ep_eisa_attach), - DEVMETHOD(device_detach, ep_detach), - - DEVMETHOD_END -}; - -static driver_t ep_eisa_driver = { - "ep", - ep_eisa_methods, - sizeof(struct ep_softc), -}; - -extern devclass_t ep_devclass; - -DRIVER_MODULE(ep, eisa, ep_eisa_driver, ep_devclass, 0, 0); diff --git a/sys/dev/ep/if_ep_isa.c b/sys/dev/ep/if_ep_isa.c index 7bcb3d41005..11523f18402 100644 --- a/sys/dev/ep/if_ep_isa.c +++ b/sys/dev/ep/if_ep_isa.c @@ -194,8 +194,7 @@ ep_isa_identify(driver_t * driver, device_t parent) (void)get_eeprom_data(ELINK_ID_PORT, j); /* - * Construct an 'isa_id' in 'EISA' - * format. + * Construct an 'isa_id' in 'EISA' format. */ data = get_eeprom_data(ELINK_ID_PORT, EEPROM_MFG_ID); isa_id = (htons(data) << 16); @@ -220,7 +219,7 @@ ep_isa_identify(driver_t * driver, device_t parent) if ((data & ADDR_CFG_MASK) == ADDR_CFG_EISA) { device_printf(parent, - "<%s> at port 0x%03x in EISA mode!\n", + "<%s> at port 0x%03x in EISA mode, ignoring!\n", desc, ioport); /* * Set the adaptor tag so that the next card can be diff --git a/sys/dev/ep/if_epvar.h b/sys/dev/ep/if_epvar.h index c7b9cb39d5b..a7ad8ea4536 100644 --- a/sys/dev/ep/if_epvar.h +++ b/sys/dev/ep/if_epvar.h @@ -59,7 +59,6 @@ struct ep_softc { #define F_RX_FIRST 0x001 #define F_ENADDR_SKIP 0x002 #define F_PROMISC 0x008 -#define F_ACCESS_32_BITS 0x100 #define F_HAS_TX_PLL 0x200 int gone; /* adapter is not present (for PCCARD) */ diff --git a/sys/modules/ep/Makefile b/sys/modules/ep/Makefile index df117abe8b9..6759781e41c 100644 --- a/sys/modules/ep/Makefile +++ b/sys/modules/ep/Makefile @@ -9,7 +9,6 @@ KMOD= if_ep SRCS= if_ep.c SRCS+= if_ep_pccard.c pccarddevs.h card_if.h SRCS+= if_ep_isa.c isa_if.h -SRCS.DEV_EISA= if_ep_eisa.c eisa_if.h SRCS+= bus_if.h device_if.h .include -- 2.45.0