From e19e3c77407840afdd02e70d76f400caadaac591 Mon Sep 17 00:00:00 2001 From: Sascha Wildner Date: Fri, 6 Dec 2013 01:59:18 +0100 Subject: [PATCH] kernel: Drop ISA support from most remaining drivers that had some. After this commit we're only left with things like atkbd, sio, etc. which have to stay. --- UPDATING | 11 + share/man/man4/adv.4 | 86 +-- share/man/man4/an.4 | 20 +- share/man/man4/ed.4 | 49 +- share/man/man4/isa.4 | 34 - share/man/man4/man4.i386/ar.4 | 5 +- share/man/man4/man4.i386/cs.4 | 21 +- share/man/man4/man4.i386/digi.4 | 82 +-- share/man/man4/man4.i386/ep.4 | 15 +- share/man/man4/man4.i386/ex.4 | 7 +- share/man/man4/man4.i386/sbni.4 | 49 +- share/man/man4/si.4 | 23 +- share/man/man4/sn.4 | 2 +- share/man/man4/stg.4 | 14 +- sys/conf/files | 10 +- sys/config/LINT | 18 +- sys/config/LINT64 | 12 +- sys/dev/disk/advansys/adv_isa.c | 417 ----------- sys/dev/disk/advansys/advansys.c | 3 +- sys/dev/disk/stg/Makefile | 4 +- sys/dev/disk/stg/tmc18c30_isa.c | 285 ------- sys/dev/netif/an/Makefile | 4 +- sys/dev/netif/an/if_an_isa.c | 155 ---- sys/dev/netif/ar/Makefile | 4 +- sys/dev/netif/ar/if_ar_isa.c | 223 ------ sys/dev/netif/cs/if_cs_isa.c | 93 --- sys/dev/netif/ed/Makefile | 4 +- sys/dev/netif/ed/if_ed_isa.c | 191 ----- sys/dev/netif/ep/Makefile | 4 +- sys/dev/netif/ep/if_ep_isa.c | 359 --------- sys/dev/netif/ex/if_ex_isa.c | 296 -------- sys/dev/netif/ex/if_ex_pccard.c | 2 +- sys/dev/netif/fe/if_fe_isa.c | 1059 --------------------------- sys/dev/netif/lnc/Makefile | 8 +- sys/dev/netif/lnc/if_lnc_isa.c | 514 ------------- sys/dev/netif/sn/if_sn_isa.c | 85 --- sys/dev/serial/digi/Makefile | 2 +- sys/dev/serial/digi/digi_isa.c | 470 ------------ sys/dev/serial/si/si_isa.c | 325 -------- sys/netgraph/sync_ar/Makefile | 4 +- sys/platform/pc32/conf/files | 4 - sys/platform/pc32/i386/userconfig.c | 14 - 42 files changed, 100 insertions(+), 4887 deletions(-) delete mode 100644 sys/dev/disk/advansys/adv_isa.c delete mode 100644 sys/dev/disk/stg/tmc18c30_isa.c delete mode 100644 sys/dev/netif/an/if_an_isa.c delete mode 100644 sys/dev/netif/ar/if_ar_isa.c delete mode 100644 sys/dev/netif/cs/if_cs_isa.c delete mode 100644 sys/dev/netif/ed/if_ed_isa.c delete mode 100644 sys/dev/netif/ep/if_ep_isa.c delete mode 100644 sys/dev/netif/ex/if_ex_isa.c delete mode 100644 sys/dev/netif/fe/if_fe_isa.c delete mode 100644 sys/dev/netif/lnc/if_lnc_isa.c delete mode 100644 sys/dev/netif/sn/if_sn_isa.c delete mode 100644 sys/dev/serial/digi/digi_isa.c delete mode 100644 sys/dev/serial/si/si_isa.c diff --git a/UPDATING b/UPDATING index adc8b0816d..18e0231a7a 100644 --- a/UPDATING +++ b/UPDATING @@ -8,6 +8,17 @@ # If you discover any problem, please contact the bugs@lists.dragonflybsd.org # mailing list with the details. ++-----------------------------------------------------------------------+ ++ UPGRADING DRAGONFLY FROM 3.6 to later versions + ++-----------------------------------------------------------------------+ + +MORE ISA SUPPORT DROPPED +------------------------ + +ISA support has been dropped from the following drivers: adv(4), an(4), +ar(4), cs(4), digi(4), ed(4), ep(4), ex(4), fe(4), lnc(4), sbni(4), +si(4), sn(4), and stg(4). + +-----------------------------------------------------------------------+ + UPGRADING DRAGONFLY FROM 3.4 to later versions + +-----------------------------------------------------------------------+ diff --git a/share/man/man4/adv.4 b/share/man/man4/adv.4 index 0814102ee3..8c50c2c0cb 100644 --- a/share/man/man4/adv.4 +++ b/share/man/man4/adv.4 @@ -28,13 +28,8 @@ .Os .Sh NAME .Nm adv -.Nd Advansys ISA/VL/PCI 8bit SCSI Host adapter driver +.Nd Advansys PCI 8bit SCSI Host adapter driver .Sh SYNOPSIS -For one or more ISA or VL cards: -.Cd device isa -.Cd device "adv0 at isa? port ? irq ? drq ?" -.Pp -For one or more PCI cards: .Cd device pci .Cd device adv .Pp @@ -58,75 +53,50 @@ their bus attachment type, maximum sync rate, and the maximum number of commands that can be handled by the adapter concurrently. .Bd -ragged -offset indent Connectivity Products: -.Bl -column "ABP510/5150 " "ISA PnP " "Floppy " "MaxSync " "Commands " "Footnotes " -.It Em Adapter Ta Em Bus Ta Em Floppy Ta Em MaxSync Ta Em Commands Ta Em Footnotes -.It ABP510/5150 Ta ISA Ta \&No Ta 10MHz Ta 240 Ta 1 -.It ABP5140 Ta ISA PnP Ta \&No Ta 10MHz Ta 16 Ta "1,3" -.It ABP5142 Ta ISA PnP Ta Yes Ta 10MHz Ta 16 Ta 4 -.It ABP[3]902 Ta PCI Ta \&No Ta 10MHz Ta 16 Ta "" -.It ABP3905 Ta PCI Ta \&No Ta 10MHz Ta 16 Ta "" -.It ABP915 Ta PCI Ta \&No Ta 10MHz Ta 16 Ta "" -.It ABP920 Ta PCI Ta \&No Ta 10MHz Ta 16 Ta "" -.It ABP3922 Ta PCI Ta \&No Ta 10MHz Ta 16 Ta "" -.It ABP3925 Ta PCI Ta \&No Ta 10MHz Ta 16 Ta "" -.It ABP930 Ta PCI Ta \&No Ta 10MHz Ta 16 Ta 5 -.It ABP930U Ta PCI Ta \&No Ta 20MHz Ta 16 Ta "" -.It ABP930UA Ta PCI Ta \&No Ta 20MHz Ta 16 Ta "" -.It ABP960 Ta PCI Ta \&No Ta 10MHz Ta 16 Ta "" -.It ABP960U Ta PCI Ta \&No Ta 20MHz Ta 16 Ta "" +.Bl -column "ABP510/5150 " "MaxSync " "Commands " "Footnotes " +.It Em Adapter Ta Em MaxSync Ta Em Commands Ta Em Footnotes +.It ABP[3]902 Ta 10MHz Ta 16 Ta "" +.It ABP3905 Ta 10MHz Ta 16 Ta "" +.It ABP915 Ta 10MHz Ta 16 Ta "" +.It ABP920 Ta 10MHz Ta 16 Ta "" +.It ABP3922 Ta 10MHz Ta 16 Ta "" +.It ABP3925 Ta 10MHz Ta 16 Ta "" +.It ABP930 Ta 10MHz Ta 16 Ta 1 +.It ABP930U Ta 20MHz Ta 16 Ta "" +.It ABP930UA Ta 20MHz Ta 16 Ta "" +.It ABP960 Ta 10MHz Ta 16 Ta "" +.It ABP960U Ta 20MHz Ta 16 Ta "" .El .Pp Footnotes: .Bl -enum -compact .It -This board has been shipped by HP with the 4020i CD-R drive. -The board has no BIOS so it cannot control a boot device, but -it can control any secondary SCSI device. -.It -This board has been sold by Iomega as a Jaz Jet PCI adapter. -.It -This board has been sold by SIIG as the i540 SpeedMaster. -.It -This board has been sold by SIIG as the i542 SpeedMaster. -.It This board has been sold by SIIG as the Fast SCSI Pro PCI. .El .Ed .Bd -ragged -offset indent Single Channel Products: -.Bl -column "ABP510/5150 " "ISA PnP " "Floppy " "MaxSync " "Commands " -.It Em Adapter Ta Em Bus Ta Em Floppy Ta Em MaxSync Ta Em Commands -.It ABP542 Ta ISA Ta Yes Ta 10MHz Ta 240 -.It ABP842 Ta VL Ta Yes Ta 10MHz Ta 240 -.It ABP940 Ta PCI Ta \&No Ta 10MHz Ta 240 -.It ABP[3]940UA Ta PCI Ta \&No Ta 20MHz Ta 240 -.It ABP940U Ta PCI Ta \&No Ta 20MHz Ta 240 -.It ABP3960UA Ta PCI Ta \&No Ta 20MHz Ta 240 -.It ABP970 Ta PCI Ta \&No Ta 10MHz Ta 240 -.It ABP970U Ta PCI Ta \&No Ta 20MHz Ta 240 +.Bl -column "ABP510/5150 " "MaxSync " "Commands " +.It Em Adapter Ta Em MaxSync Ta Em Commands +.It ABP940 Ta 10MHz Ta 240 +.It ABP[3]940UA Ta 20MHz Ta 240 +.It ABP940U Ta 20MHz Ta 240 +.It ABP3960UA Ta 20MHz Ta 240 +.It ABP970 Ta 10MHz Ta 240 +.It ABP970U Ta 20MHz Ta 240 .El .Ed .Bd -ragged -offset indent Multi Channel Products (Commands are per-channel): -.Bl -column "ABP510/5150 " "ISA PnP " "Floppy " "MaxSync " "Commands " "Channels " -.It Em Adapter Ta Em Bus Ta Em Floppy Ta Em MaxSync Ta Em Commands Ta Em Channels -.It ABP852 Ta VL Ta Yes Ta 10MHz Ta 240 Ta 2 -.It ABP950 Ta PCI Ta \&No Ta 10MHz Ta 240 Ta 2 -.It ABP980 Ta PCI Ta \&No Ta 10MHz Ta 240 Ta 4 -.It ABP980U Ta PCI Ta \&No Ta 20MHz Ta 240 Ta 4 -.It ABP[3]980UA Ta PCI Ta \&No Ta 20MHz Ta 16 Ta 4 +.Bl -column "ABP510/5150 " "MaxSync " "Commands " "Channels " +.It Em Adapter Ta Em MaxSync Ta Em Commands Ta Em Channels +.It ABP950 Ta 10MHz Ta 240 Ta 2 +.It ABP980 Ta 10MHz Ta 240 Ta 4 +.It ABP980U Ta 20MHz Ta 240 Ta 4 +.It ABP[3]980UA Ta 20MHz Ta 16 Ta 4 .El .Ed .Pp -For ISA or Vesa Local Bus adapters, one kernel config entry is required -for every card to be attached by the system. Specific values for the port -address, irq, and drq may be specified. If wildcard values are used, the -driver will query the device for its current settings and use those. If -the port address is a wildcard, the driver consults an internal table of -possible port address locations and attaches to the first unattached card -it finds. The possible port addresses for these card are 0x110, 0x130, -0x150, 0x190, 0x210, 0x230, 0x250, and 0x330. -.Pp Per target configuration performed in the .Tn AdvanceWare menu, which is accessible at boot, diff --git a/share/man/man4/an.4 b/share/man/man4/an.4 index cdfc929747..dc8b6fa5c9 100644 --- a/share/man/man4/an.4 +++ b/share/man/man4/an.4 @@ -38,34 +38,22 @@ .Nd "Aironet Communications 4500/4800 wireless network adapter driver" .Sh SYNOPSIS .Cd "device an" -.Cd "device an0 at isa? port 0x140 irq 5" .Sh DESCRIPTION The .Nm driver provides support for Aironet Communications 4500 and 4800 wireless network adapters. -This includes the ISA, PCI and PCMCIA +This includes the PCI and PCMCIA varieties. The 4500 series adapters operate at 1 and 2Mbps while the 4800 series can operate at 1, 2, 5.5 and 11Mbps. -The ISA, PCI +The PCI and PCMCIA devices are all based on the same core PCMCIA modules and all have the same programming interface, however unlike the -Lucent WaveLAN/IEEE cards, the ISA and PCI cards appear to the -host as normal ISA and PCI devices and do not require any PCCARD +Lucent WaveLAN/IEEE cards, the PCI cards appear to the +host as normal PCI devices and do not require any PCCARD support. -.Pp The PCMCIA Aironet cards require kernel pccard driver support. -ISA cards can either be configured to use ISA Plug and Play -or to use a particular I/O address and IRQ -by properly setting the DIP switches on the board. -(The default -switch setting is for plug and play.) -The -.Nm -driver has Plug and Play support and will work in either configuration, -however when using a hard-wired I/O address and IRQ, the driver -configuration and the NIC's switch settings must agree. PCI cards require no switch settings of any kind and will be automatically probed and attached. diff --git a/share/man/man4/ed.4 b/share/man/man4/ed.4 index adc7541626..6fba79d2e8 100644 --- a/share/man/man4/ed.4 +++ b/share/man/man4/ed.4 @@ -29,7 +29,6 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD: src/share/man/man4/ed.4,v 1.19.2.10 2003/02/17 21:20:39 trhodes Exp $ -.\" $DragonFly: src/share/man/man4/ed.4,v 1.7 2007/05/13 22:25:41 swildner Exp $ .\" .Dd October 28, 1995 .Dt ED 4 @@ -39,7 +38,7 @@ .Nd NE-2000 and WD-80x3 ethernet device driver .Sh SYNOPSIS .Cd "device miibus" -.Cd "device ed0 at isa? port 0x280 irq 5 iomem 0xd8000" +.Cd "device ed" .Sh DESCRIPTION The .Nm @@ -49,13 +48,11 @@ the National Semiconductor DS8390 and similar NICs manufactured by other compani It supports all 80x3 series ethernet cards manufactured by Western Digital and SMC, the SMC Ultra, the 3Com 3c503, the Novell NE1000/NE2000 and compatible cards, the HP PC Lan+ and the Digital Equipment EtherWorks DE305 card. -ISA, PCI and PC Card devices are supported. +PCI and PC Card devices are supported. .Pp The .Nm driver uses a unique multi-buffering mechanism to achieve high transmit performance. -When using 16bit ISA cards, as high as 97% of the theoretical maximum performance of -the IEEE 802.3 CSMA ethernet is possible. .Pp In addition to the standard port and IRQ specifications, the .Nm @@ -64,41 +61,6 @@ driver also supports a number of which can force 8/16bit mode, enable/disable multi-buffering, and select the default interface type (AUI/BNC, and for cards with twisted pair, AUI/10BaseT). .Pp -The -.Cd flags -are a bit field, and are summarized as follows: -.Bl -tag -width indent -.It Li 0x01 -Disable transceiver. -On those cards which support it, this flag causes the transceiver to -be disabled and the AUI connection to be used by default. -.It Li 0x02 -Force 8bit mode. -This flag forces the card to 8bit mode regardless of how the -card identifies itself. -This may be needed for some clones which incorrectly -identify themselves as 16bit, even though they only have an 8bit interface. -.It Li 0x04 -Force 16bit mode. -This flag forces the card to 16bit mode regardless of how the -card identifies itself. -This may be needed for some clones which incorrectly -identify themselves as 8bit, even though they have a 16bit ISA interface. -.It Li 0x08 -Disable transmitter multi-buffering. -This flag disables the use of multiple -transmit buffers and may be necessary in rare cases where packets are sent out -faster than a machine on the other end can handle (as evidenced by severe packet -lossage). -Some -.No ( non- Ns Dx -:-)) machines have terrible ethernet performance -and simply can't cope with 1100K+ data rates. -Use of this flag also provides -one more packet worth of receiver buffering, and on 8bit cards, this may help -reduce receiver lossage. -.El -.Pp When using a 3c503 card, the AUI connection may be selected by specifying the .Cm link2 option to @@ -135,8 +97,6 @@ Indicates a logic problem in the driver. Should never happen. .It "ed%d: device timeout" Indicates that an expected transmitter interrupt didn't occur. -Usually caused by an -interrupt conflict with another card on the ISA bus. This condition could also be caused if the kernel is configured for a different IRQ channel than the one the card is actually using. If that is the case, you will have to either reconfigure the card @@ -144,14 +104,9 @@ using a DOS utility or set the jumpers on the card appropriately. .It "ed%d: NIC memory corrupt - invalid packet length %d." Indicates that a packet was received with a packet length that was either larger than the maximum size or smaller than the minimum size allowed by the IEEE 802.3 standard. -Usually -caused by a conflict with another card on the ISA bus, but in some cases may also -indicate faulty cabling. .It "ed%d: remote transmit DMA failed to complete." This indicates that a programmed I/O transfer to an NE1000 or NE2000 style card has failed to properly complete. -Usually caused by the ISA bus speed being set -too fast. .El .Sh SEE ALSO .Xr arp 4 , diff --git a/share/man/man4/isa.4 b/share/man/man4/isa.4 index dcc594309e..73d72b32a7 100644 --- a/share/man/man4/isa.4 +++ b/share/man/man4/isa.4 @@ -56,13 +56,6 @@ devices instead. .Dx provides support for the following devices. Note that not all architectures support all devices. -.Ss SCSI controllers -.Bl -tag -width 12n -offset indent -compact -.It Xr adv 4 -Advansys SCSI host adapter driver -.It Xr stg 4 -Future Domain based SCSI controller driver -.El .Ss Disk and tape controllers .Bl -tag -width 12n -offset indent -compact .It Xr fdc 4 @@ -72,38 +65,11 @@ Generic ATA/ATAPI disk controller driver .El .Ss Serial and parallel interfaces .Bl -tag -width 12n -offset indent -compact -.It Xr digi 4 -DigiBoard intelligent serial cards driver .It Xr lpt 4 Generic printer device driver -.It Xr si 4 -Specialix International SI/XIO or SX serial card driver .It Xr sio 4 Generic serial controller driver .El -.Ss Network interfaces -.Bl -tag -width 12n -offset indent -compact -.It Xr an 4 -Aironet Communications 4500/4800 wireless network adapter driver -.It Xr ar 4 -Digi/Arnet SYNC/570i device driver -.It Xr cs 4 -Crystal Semiconductor CS8900 and CS8920 ethernet adapter driver -.It Xr ed 4 -Novell NE1000/NE2000 and WD-80x3 ethenet adapter driver -.It Xr ep 4 -3Com Etherlink III (3C5x9) ethernet adapter driver -.It Xr ex 4 -Intel EtherExpress Pro/10 and Pro/10+ ethernet adapter driver -.It Xr fe 4 -Fujitsu MB86960A and MB86965A ethernet adapter driver -.It Xr lnc 4 -AMD Am7900 LANCE and Am79C9xx PCnet ethernet adapter driver -.It Xr sn 4 -SMC91Cxx ethernet adapter driver -.It Xr sr 4 -RISCom/N2 device driver -.El .Ss Hardware Sensors & Watchdog Timers .Bl -tag -width 12n -offset indent -compact .It Xr amdsbwd 4 diff --git a/share/man/man4/man4.i386/ar.4 b/share/man/man4/man4.i386/ar.4 index 2d75292158..efea056879 100644 --- a/share/man/man4/man4.i386/ar.4 +++ b/share/man/man4/man4.i386/ar.4 @@ -34,14 +34,13 @@ .Nm ar .Nd synchronous Digi/Arnet device driver .Sh SYNOPSIS -.Cd "device ar0 at isa? port 0x300 irq 10 iomem 0xd0000" -.Cd "device ar1 at isa? port 0x310 irq 11 iomem 0xd0000" +.Cd "device ar" .Pp .Cd "pseudo-device sppp" .Sh DESCRIPTION The .Nm -driver supports the Digi/Arnet SYNC/570i ISA and PCI cards that is based on the +driver supports the Digi/Arnet SYNC/570i PCI cards that is based on the HD64570 chip. Both the 2 and 4 port cards are supported and auto detected. .Pp diff --git a/share/man/man4/man4.i386/cs.4 b/share/man/man4/man4.i386/cs.4 index fbfbe76448..8d616d9776 100644 --- a/share/man/man4/man4.i386/cs.4 +++ b/share/man/man4/man4.i386/cs.4 @@ -24,7 +24,6 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD: src/share/man/man4/man4.i386/cs.4,v 1.6.2.5 2001/08/17 13:08:45 ru Exp $ -.\" $DragonFly: src/share/man/man4/man4.i386/cs.4,v 1.4 2007/02/25 12:03:07 swildner Exp $ .\" .Dd July 20, 1998 .Dt CS 4 i386 @@ -33,35 +32,29 @@ .Nm cs .Nd Crystal Semiconductor CS8900 and CS8920 ethernet device driver .Sh SYNOPSIS -.Cd "device cs0 at isa? port 0x300 irq ?" -.Cd "device cs1 at isa? port 0x300 irq 10 iomem 0xd0000" +.Cd "device cs" .Sh DESCRIPTION The .Nm -driver provides support for ISA ethernet adapters based on the +driver provides support for ethernet adapters based on the .Tn Crystal Semiconductor CS8900 and .Tn CS8920 NICs. These devices are used on the -.Tn IBM EtherJet ISA +.Tn IBM EtherJet PCMCIA adapters and in many embedded applications where the high integration, small size and low cost of the CS89x0 family compensate for their drawbacks. .Pp The .Nm -driver will obtain configuration parameters either from the configuration entry -or from the card. Parameters specified in the configuration entry will be +driver will obtain configuration parameters from the card. +Parameters specified in the configuration entry will be used if present; the card may be soft-configured so these may be any valid -value. Adapters based on the CS8920 normally offer PnP configuration and the driver -will detect the +value. +The driver will detect the .Tn IBM EtherJet -and the -.Tn CSC6040 adapters automatically. .Pp -Note that the CS8900 is limited to 4 IRQ values; these are normally implemented -as 5, 10, 11 and 12. The CS8920 has no such limitation. -.Pp Memory-mapped and DMA operation are not supported at this time. .Sh DIAGNOSTICS .Bl -diag diff --git a/share/man/man4/man4.i386/digi.4 b/share/man/man4/man4.i386/digi.4 index 08c78146cb..636384d40f 100644 --- a/share/man/man4/man4.i386/digi.4 +++ b/share/man/man4/man4.i386/digi.4 @@ -43,35 +43,14 @@ To compile this driver into the kernel, place the following line in your kernel configuration file: .Bd -ragged -offset indent -.Cd "device digi0 at isa? port 0x220 iomem 0xfc0000 iosiz ? flags 0x0" +.Cd "device digi" .Ed -All values are just examples. .Pp To load this driver as a module at boot time, place the following line in .Xr loader.conf 5 : .Bd -literal -offset indent digi_load="YES" .Ed -.Pp -Meaning of -.Cm flags : -.Bl -tag -width indent -compact -.It 0x0001 -use alternate pinout (exchange DCD and DSR lines) -.It 0x0002 -don't use 8K window mode of PC/Xe -.El -.Pp -Device numbering: -.Bd -literal -compact -0b\fICC\fPmmmmmmmm\fIOLIPPPPP\fP - \fBCC\fPard number - \fRmmmmmmmm\fPajor number - call\fBO\fPut - \fBL\fPock - \fBI\fPnitial - \fBPPPPP\fPort number -.Ed .Sh DESCRIPTION The .Nm @@ -104,65 +83,6 @@ as in the .Xr sio 4 driver. .Pp -The -.Cm flags -keyword may be used on each -.Dq Li "device digi" -line in the kernel configuration file -to change the pinout of the interface or to use new PC/Xe cards -which can work with an 8K memory window in compatibility mode -(with a 64K memory window). -Note -that using 8K memory window doesn't mean shorter input/output buffers, it means -only that all buffers will be mapped to the same memory address and switched as -needed. -.Pp -The -.Cm port -value must be the same -as the -port -set on the card by jumpers. -For PC/Xi cards the same rule is applicable to the -.Cm iomem -value. -It must be the same as the memory address set on the card -by jumpers. -.\"Some documentation gives the address as a ``paragraph'' or ``segment''; -.\"you can get the value of address by adding the digit "0" at end of -.\"paragraph value, e.g., 0xfc000 -> 0xfc0000. -For PC/Xe cards there is no need to use jumpers for this purpose. -In fact there are no jumpers to do it. -Just -write the address you want as the -.Cm iomem -value in kernel config file and the card will be programmed -to use this address. -.Pp -The same range of memory addresses may be used -for all the DigiBoards installed -(but not for any other card or real memory). -DigiBoards -with a large amount of memory (256K or 512K and perhaps -even 128K) must be mapped -to memory addresses outside of the first megabyte. -If the computer -has more than 15 megabytes of memory then there is no free address space -outside of the first megabyte where such DigiBoards can be mapped. -In this case you -may need to reduce the amount of memory in the computer. -But many machines provide a better solution. -They have the ability to -.Dq "turn off" -the memory in the 16th megabyte (addresses 0xF00000 - 0xFFFFFF) -using the -BIOS setup. -Then the DigiBoard's address space can be set to this -.Dq hole . -.\" XXX the following should be true for all serial drivers and -.\" should not be repeated in the man pages for all serial drivers. -.\" It was copied from sio.4. The only changes were s/sio/digi/g. -.Pp Serial ports controlled by the .Nm driver can be used for both diff --git a/share/man/man4/man4.i386/ep.4 b/share/man/man4/man4.i386/ep.4 index 1edf659f50..2ae1c0ea2c 100644 --- a/share/man/man4/man4.i386/ep.4 +++ b/share/man/man4/man4.i386/ep.4 @@ -40,8 +40,7 @@ .Sh DESCRIPTION The .Nm -device driver supports the 3c509 (ISA), 3c529 (MCA), -and various PCMCIA cards including the 3c589. +device driver supports various PCMCIA cards including the 3c589. Various models of these cards come with a different assortment of connectors: .Bl -tag -width xxxxxxxxxxxxxxxxxxxx @@ -71,13 +70,6 @@ Use the UTP port. .Pp If there are multiple cards in the computer, they are searched for in the following order: bus, slot, then ethernet address. -.Sh NOTES -The 3c509 card has no jumpers to set the address. -3Com supplies software to set the address of the card in software. -To find the card on the ISA bus, the kernel performs a complex -scan operation at IO address 0x110. -Beware! -Avoid placing other cards at that address! .Sh DIAGNOSTICS .Bl -diag .It ep0: reset (status: %x) @@ -87,11 +79,6 @@ This is not fatal. .It ep0: eeprom failed to come ready The eeprom failed to come ready. This probably means the card is wedged. -.It ep0: 3c509 in test mode. Erase pencil mark! -This means that someone has scribbled with pencil -in the test area on the card. -Erase the pencil mark and reboot. -(This is not a joke). .El .Sh SEE ALSO .Xr ed 4 , diff --git a/share/man/man4/man4.i386/ex.4 b/share/man/man4/man4.i386/ex.4 index 67dcef97bf..d7dc3f6aa6 100644 --- a/share/man/man4/man4.i386/ex.4 +++ b/share/man/man4/man4.i386/ex.4 @@ -32,17 +32,12 @@ .Nm ex .Nd "Ethernet device driver for the Intel EtherExpress Pro/10 and Pro/10+" .Sh SYNOPSIS -.Cd "device ex0 at isa? port? irq ?" +.Cd "device ex" .Sh DESCRIPTION The .Nm driver provides support for the 16-bit PCI Intel EtherExpress Pro/10 and Pro/10+ Ethernet cards based on the Intel i82595 chip. -.Pp -If the port start address isn't found, the card will be searched for in the -I/O address range 0x200 - 0x3a0. If the IRQ isn't specified, it will be -read from the EEPROM on the card. For correct operation on newer -cards the Plug-N-Play support should be disabled. .Sh DIAGNOSTICS .Bl -diag .It "ex%d: Intel EtherExpress Pro/10, address XX:XX:XX:XX:XX:XX, connector %s" diff --git a/share/man/man4/man4.i386/sbni.4 b/share/man/man4/man4.i386/sbni.4 index 998a629b2e..6e6208ce15 100644 --- a/share/man/man4/man4.i386/sbni.4 +++ b/share/man/man4/man4.i386/sbni.4 @@ -30,58 +30,19 @@ .Nm sbni .Nd Granch SBNI12 leased line modem driver .Sh SYNOPSIS -.Cd "device sbni0 at isa? port 0x210 irq 5" -.Cd "device sbni1 at isa? port 0x2c0 irq 11 flags 0xe9123456" +.Cd "device sbni" .Sh DESCRIPTION The .Nm driver provides support for leased line modems of following models: .Pp -.Bl -tag -compact -width ".Pa SBNI12-10, SBNI12D-10, ISA and PCI" -.It Pa SBNI12-02, SBNI12D-02 -.It Pa SBNI12-04, SBNI12D-04 -.It Pa SBNI12-05, SBNI12D-05, ISA and PCI -.It Pa SBNI12-10, SBNI12D-10, ISA and PCI +.Bl -tag -compact -width ".Pa SBNI12-10, SBNI12D-10, PCI" +.It Pa SBNI12-05, SBNI12D-05, PCI +.It Pa SBNI12-10, SBNI12D-10, PCI .El .Pp and a kit for data link over a voice band -SBNI12-11, SBNI12D-11, ISA and PCI. -.Pp -In addition to the standard port and irq specifications, the -.Nm -driver also supports a number of -.Em flags -which can set baud rate, receive level, and low three bytes of Ethernet -MAC-address (high three always are 00:ff:01), because Granch modems is -presented to the system as Ethernet-like netcards. -.Pp -The high byte of the -.Em flags -is a bit field, it's used to specify SBNI adapter receive level/baud rate: -.Bd -literal - Bits 0-3: receive level (0x00..0x0f) - Bits 4-5: baud rate number: - 00 - 0 baud rate (2Mb in fast mode/500kb in slow) - 01 - 1 baud rate (1Mb/250kb) - 10 - 2 baud rate (500kb/125kb) - 11 - 3 baud rate (250kb/62.5kb) - Bit 6 : use fixed receive level - if bit 6 is set then receive level will be set according - to bits 0-3 value, otherwise receive level will be - autodetected - Bit 7 : use fixed baud rate - if bit 7 is set then baud rate will be set according to - bits 4-5 value, otherwise baud rate is set to 2Mb - -E.g.: -device sbni0 at isa? port 0x210 irq 5 flags 0xefdead - - baud rate 2 Mb (default), receive level autodetected, - MAC address will be 00:ff:01:ef:de:ad - -device sbni1 at isa? port 0x214 irq 7 flags 0xd6abcdef - - baud rate 1 Mb, receive level 0x06 (fixed), - MAC address 00:ff:01:ab:cd:ef -.Ed +SBNI12-11, SBNI12D-11, PCI. .Sh FILES The sources for the driver reside in: .Pp diff --git a/share/man/man4/si.4 b/share/man/man4/si.4 index 0e1d23b2ee..ed24c600dd 100644 --- a/share/man/man4/si.4 +++ b/share/man/man4/si.4 @@ -7,16 +7,12 @@ .Nd "driver for Specialix International SI/XIO or SX intelligent serial card" .Sh SYNOPSIS .Cd "device si" -.Cd "device si0 at isa? irq 12 iomem 0xd0000" .Sh DESCRIPTION The Specialix SI/XIO and SX hardware makes up an 8 to 32 port RS-232 serial multiplexor. .Pp -The first instance of the device lines above is for PCI host cards, -the second is for ISA host cards. -.Pp The system uses two components: A "Host adapter", which is plugged into -an ISA or PCI slot and provides intelligence and buffering/processing +a PCI slot and provides intelligence and buffering/processing capabilities, as well as an external bus in the form of a 37 pin cable. .Pp On this cable, "modules" are connected. The "SI" module comes in a 4 and 8 @@ -37,18 +33,6 @@ SX modules are only supported when connected to an SX host card. SI or XIO modules are supported on any host card. .Pp -The host adapter uses a shared memory block in the traditional ISA bus -"hole" between 0xA0000 and 0xEFFFF. The adapter can be configured outside -range, but requires the memory range to be explicitly non-cached. The -driver does not yet support this mode of operation. -.Pp -SX ISA Host cards have an 8/16 bit mode switch or jumper on them. -This switch -or jumper MUST be set for 8 bit mode. -.Pp -The ISA adapters can use Irq's 11, 12 or 15 (and 9 and 10 in the case of -SX host cards). -.Pp The si device driver may have some of its configuration settings changed at run-time with the .Xr sicontrol 8 @@ -79,8 +63,6 @@ CLOCAL is honored. An open on a cua port will always succeed, but DCD transitions will be honored after DCD rises for the first time. .Pp Up to four SI/XIO host cards may be controlled by the si driver. -Due to the lack of available interrupts, only 3 ISA SI/XIO host cards can be -used at once. .Pp The lowest 5 bits of the minor device number are used to select the port number on the module cluster. @@ -168,9 +150,6 @@ The poll frequency is set by The driver does not yet support baud rates higher than 115,200 on SX modules. .Pp -Operation outside the traditional ISA "hole" is not yet supported, although it -should work if the test is removed from the probe routine. -.Pp Multiple host cards are supported although combinations of hosts on different bus types have not been tested - device numbering is known to be a problem and may lead to unexpected results. diff --git a/share/man/man4/sn.4 b/share/man/man4/sn.4 index 12a0d68e4a..a985070b71 100644 --- a/share/man/man4/sn.4 +++ b/share/man/man4/sn.4 @@ -35,7 +35,7 @@ .Sh DESCRIPTION The .Nm -device driver supports SMC9xxx based ISA and PCMCIA cards. +device driver supports SMC9xxx based PCMCIA cards. .Sh SEE ALSO .Xr ed 4 , .Xr ep 4 , diff --git a/share/man/man4/stg.4 b/share/man/man4/stg.4 index 85dbb72856..c17fba3039 100644 --- a/share/man/man4/stg.4 +++ b/share/man/man4/stg.4 @@ -22,7 +22,6 @@ .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" $FreeBSD: src/share/man/man4/stg.4,v 1.8 2006/06/18 09:53:00 brueffer Exp $ -.\" $DragonFly: src/share/man/man4/stg.4,v 1.1 2008/07/27 18:42:15 thomas Exp $ .\" .Dd August 8, 2004 .Dt STG 4 @@ -35,18 +34,9 @@ To compile this driver into the kernel, place the following lines in your kernel configuration file: .Bd -ragged -offset indent +.Cd "device pci" .Cd "device scbus" .Cd "device stg" -.Pp -For one or more ISA cards: -.Cd "device isa" -.Pp -In -.Pa /boot/device.hints : -.Cd hint.stg.0.at="isa" -.Pp -For one or more PCI cards: -.Cd "device pci" .Ed .Pp Alternatively, to load the driver as a @@ -58,7 +48,7 @@ stg_load="YES" .Sh DESCRIPTION The .Nm -driver provides support for ISA, PCCARD and PCI controllers based on +driver provides support for PCCARD and PCI controllers based on Future Domain SCSI controller chips including the TMC-16C30, 16C50 and 32C60. .Sh HARDWARE Controllers supported by the diff --git a/sys/conf/files b/sys/conf/files index 0a9dfc7b62..cf8c7100a6 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -136,7 +136,6 @@ dev/disk/advansys/adwmcode.c optional adw dev/netif/ae/if_ae.c optional ae dev/netif/age/if_age.c optional age dev/netif/an/if_an.c optional an -dev/netif/an/if_an_isa.c optional an isa dev/netif/an/if_an_pci.c optional an pci dev/netif/an/if_an_pccard.c optional an pccard dev/netif/ar/if_ar.c optional ar @@ -285,7 +284,6 @@ dev/disk/buslogic/bt_pci.c optional bt pci dev/disk/ccd/ccd.c optional ccd dev/raid/ciss/ciss.c optional ciss dev/netif/cs/if_cs.c optional cs -dev/netif/cs/if_cs_isa.c optional cs isa dev/netif/cs/if_cs_pccard.c optional cs pccard dev/misc/dcons/dcons.c optional dcons dev/misc/dcons/dcons_crom.c optional dcons_crom @@ -296,7 +294,6 @@ dev/netif/ed/if_ed.c optional nowerror ed dev/netif/ed/if_ed_pccard.c optional ed pccard dev/netif/ed/if_ed_pci.c optional ed pci dev/netif/ep/if_ep.c optional ep -dev/netif/ep/if_ep_isa.c optional ep isa dev/netif/ep/if_ep_pccard.c optional ep pccard dev/netif/em/if_em.c optional em dev/netif/emx/if_emx.c optional emx @@ -330,7 +327,6 @@ dev/netif/ig_hal/e1000_vf.c optional ig_hal dev/atm/en/midway.c optional en dev/netif/et/if_et.c optional et dev/netif/ex/if_ex.c optional ex -dev/netif/ex/if_ex_isa.c optional ex isa dev/netif/ex/if_ex_pccard.c optional ex pccard bus/firewire/firewire.c optional firewire bus/firewire/fwcrom.c optional firewire @@ -738,17 +734,14 @@ bus/smbus/smb.c optional smb dev/serial/si/si.c optional si dev/serial/si/si2_z280.c optional si dev/serial/si/si3_t225.c optional si -dev/serial/si/si_isa.c optional si isa dev/serial/si/si_pci.c optional si pci dev/netif/sln/if_sln.c optional sln pci dev/netif/sn/if_sn.c optional sn -dev/netif/sn/if_sn_isa.c optional sn isa dev/netif/sn/if_sn_pccard.c optional sn pccard dev/misc/snp/snp.c optional snp dev/netif/sr/if_sr.c optional sr dev/netif/sr/if_sr_pci.c optional sr pci -dev/disk/stg/tmc18c30.c optional stg -dev/disk/stg/tmc18c30_isa.c optional stg isa +dev/disk/stg/tmc18c30.c optional stg dev/disk/stg/tmc18c30_pccard.c optional stg pccard dev/crypto/tpm/tpm.c optional tpm dev/crypto/tpm/tpm_acpi.c optional tpm acpi @@ -1786,7 +1779,6 @@ dev/netif/lgue/if_lgue.c optional lgue usb dev/netif/rue/if_rue.c optional rue usb dev/netif/lnc/am7990.c optional lnc dev/netif/lnc/am79900.c optional lnc -dev/netif/lnc/if_lnc_isa.c optional lnc isa dev/netif/lnc/if_lnc_pci.c optional lnc pci dev/netif/lnc/lance.c optional lnc bus/isa/isa_if.m optional isa diff --git a/sys/config/LINT b/sys/config/LINT index 7147a6dad4..93a2d4861a 100644 --- a/sys/config/LINT +++ b/sys/config/LINT @@ -1126,7 +1126,7 @@ device npx0 at nexus? port IO_NPX flags 0x0 irq 13 # device bt -device adv0 at isa? +device adv device adw device aic device ncv @@ -1311,17 +1311,17 @@ device puc # PCI and ISA varieties. # xe: Xircom/Intel EtherExpress Pro100/16 PC Card ethernet controller. # -device ar0 at isa? port 0x300 irq 10 iomem 0xd0000 -device cs0 at isa? port 0x300 -device ed0 at isa? port 0x280 irq 5 iomem 0xd8000 +device ar +device cs +device ed device ep device ex -device fe0 at isa? port 0x300 -device lnc0 at isa? port 0x280 irq 10 drq 0 -device sbni0 at isa? port 0x210 irq 5 flags 0xefdead +device fe +device lnc +device sbni device sln device sr -device sn0 at isa? port 0x300 irq 10 +device sn # Wlan support is mandatory for some wireless LAN devices. options IEEE80211_DEBUG #enable debugging msgs @@ -1458,7 +1458,7 @@ device ecc device joy0 at isa? port IO_GAME device cy device nrp -device si0 at isa? iomem 0xd0000 irq 12 +device si device spic0 at isa? irq 0 port 0x10a0 device stl # nullmodem terminal driver diff --git a/sys/config/LINT64 b/sys/config/LINT64 index e82a181ef4..4d11311f29 100644 --- a/sys/config/LINT64 +++ b/sys/config/LINT64 @@ -1004,7 +1004,7 @@ options SC_TWOBUTTON_MOUSE # device bt -device adv0 at isa? +device adv device adw device aic device ncv @@ -1180,13 +1180,13 @@ device puc # PCI and ISA varieties. # xe: Xircom/Intel EtherExpress Pro100/16 PC Card ethernet controller. # -device cs0 at isa? port 0x300 -device ed0 at isa? port 0x280 irq 5 iomem 0xd8000 +device cs +device ed device ep device ex -device lnc0 at isa? port 0x280 irq 10 drq 0 +device lnc device sln -device sn0 at isa? port 0x300 irq 10 +device sn # Wlan support is mandatory for some wireless LAN devices. options IEEE80211_DEBUG #enable debugging msgs @@ -1308,7 +1308,7 @@ device "snd_uaudio" device ecc device joy0 at isa? port IO_GAME device nrp -device si0 at isa? iomem 0xd0000 irq 12 +device si # nullmodem terminal driver device nmdm device tpm diff --git a/sys/dev/disk/advansys/adv_isa.c b/sys/dev/disk/advansys/adv_isa.c deleted file mode 100644 index a960a40913..0000000000 --- a/sys/dev/disk/advansys/adv_isa.c +++ /dev/null @@ -1,417 +0,0 @@ -/* - * Device probe and attach routines for the following - * Advanced Systems Inc. SCSI controllers: - * - * Connectivity Products: - * ABP510/5150 - Bus-Master ISA (240 CDB) * - * ABP5140 - Bus-Master ISA PnP (16 CDB) * ** - * ABP5142 - Bus-Master ISA PnP with floppy (16 CDB) *** - * - * Single Channel Products: - * ABP542 - Bus-Master ISA with floppy (240 CDB) - * ABP842 - Bus-Master VL (240 CDB) - * - * Dual Channel Products: - * ABP852 - Dual Channel Bus-Master VL (240 CDB Per Channel) - * - * * This board has been shipped by HP with the 4020i CD-R drive. - * The board has no BIOS so it cannot control a boot device, but - * it can control any secondary SCSI device. - * ** This board has been sold by SIIG as the i540 SpeedMaster. - * *** This board has been sold by SIIG as the i542 SpeedMaster. - * - * Copyright (c) 1996, 1997 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, this list of conditions, and the following disclaimer, - * without modification, immediately at the beginning of the file. - * 2. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD: src/sys/dev/advansys/adv_isa.c,v 1.14.2.5 2002/01/06 21:21:42 dwmalone Exp $ - */ - -#include -#include -#include -#include -#include -#include - -#include - -#include "advansys.h" - -#include - -#define ADV_ISA_MAX_DMA_ADDR (0x00FFFFFFL) -#define ADV_ISA_MAX_DMA_COUNT (0x00FFFFFFL) - -#define ADV_VL_MAX_DMA_ADDR (0x07FFFFFFL) -#define ADV_VL_MAX_DMA_COUNT (0x07FFFFFFL) - -/* - * The overrun buffer shared amongst all ISA/VL adapters. - */ -static u_int8_t* overrun_buf; -static bus_dma_tag_t overrun_dmat; -static bus_dmamap_t overrun_dmamap; -static bus_addr_t overrun_physbase; - -/* Possible port addresses an ISA or VL adapter can live at */ -static u_int16_t adv_isa_ioports[] = -{ - 0x100, - 0x110, /* First selection in BIOS setup */ - 0x120, - 0x130, /* Second selection in BIOS setup */ - 0x140, - 0x150, /* Third selection in BIOS setup */ - 0x190, /* Fourth selection in BIOS setup */ - 0x210, /* Fifth selection in BIOS setup */ - 0x230, /* Sixth selection in BIOS setup */ - 0x250, /* Seventh selection in BIOS setup */ - 0x330 /* Eighth and default selection in BIOS setup */ -}; - -#define MAX_ISA_IOPORT_INDEX (NELEM(adv_isa_ioports) - 1) - -static int adv_isa_probe(device_t dev); -static int adv_isa_attach(device_t dev); -static void adv_set_isapnp_wait_for_key(void); -static int adv_get_isa_dma_channel(struct adv_softc *adv); -static int adv_set_isa_dma_settings(struct adv_softc *adv); - -static int -adv_isa_probe(device_t dev) -{ - int port_index; - int max_port_index; - u_long iobase, iocount, irq; - int user_iobase = 0; - int rid = 0; - void *ih; - struct resource *iores, *irqres; - - /* - * Default to scanning all possible device locations. - */ - port_index = 0; - max_port_index = MAX_ISA_IOPORT_INDEX; - - if (bus_get_resource(dev, SYS_RES_IOPORT, 0, &iobase, &iocount) == 0) { - user_iobase = 1; - for (;port_index <= max_port_index; port_index++) - if (iobase <= adv_isa_ioports[port_index]) - break; - if ((port_index > max_port_index) - || (iobase != adv_isa_ioports[port_index])) { - if (bootverbose) - kprintf("adv%d: Invalid baseport of 0x%lx specified. " - "Nearest valid baseport is 0x%x. Failing " - "probe.\n", device_get_unit(dev), iobase, - (port_index <= max_port_index) ? - adv_isa_ioports[port_index] : - adv_isa_ioports[max_port_index]); - return ENXIO; - } - max_port_index = port_index; - } - - /* Perform the actual probing */ - adv_set_isapnp_wait_for_key(); - for (;port_index <= max_port_index; port_index++) { - u_int16_t port_addr = adv_isa_ioports[port_index]; - bus_size_t maxsegsz; - bus_size_t maxsize; - bus_addr_t lowaddr; - int error; - struct adv_softc *adv; - - if (port_addr == 0) - /* Already been attached */ - continue; - - if (bus_set_resource(dev, SYS_RES_IOPORT, 0, port_addr, 1, -1)) - continue; - - /* XXX what is the real portsize? */ - iores = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0, 1, - RF_ACTIVE); - if (iores == NULL) - continue; - - if (adv_find_signature(rman_get_bustag(iores), - rman_get_bushandle(iores)) == 0) { - bus_release_resource(dev, SYS_RES_IOPORT, 0, iores); - continue; - } - - /* - * Got one. Now allocate our softc - * and see if we can initialize the card. - */ - adv = adv_alloc(dev, rman_get_bustag(iores), - rman_get_bushandle(iores)); - if (adv == NULL) { - bus_release_resource(dev, SYS_RES_IOPORT, 0, iores); - break; - } - - /* - * Stop the chip. - */ - ADV_OUTB(adv, ADV_CHIP_CTRL, ADV_CC_HALT); - ADV_OUTW(adv, ADV_CHIP_STATUS, 0); - /* - * Determine the chip version. - */ - adv->chip_version = ADV_INB(adv, ADV_NONEISA_CHIP_REVISION); - if ((adv->chip_version >= ADV_CHIP_MIN_VER_VL) - && (adv->chip_version <= ADV_CHIP_MAX_VER_VL)) { - adv->type = ADV_VL; - maxsegsz = ADV_VL_MAX_DMA_COUNT; - maxsize = BUS_SPACE_MAXSIZE_32BIT; - lowaddr = ADV_VL_MAX_DMA_ADDR; - bus_delete_resource(dev, SYS_RES_DRQ, 0); - } else if ((adv->chip_version >= ADV_CHIP_MIN_VER_ISA) - && (adv->chip_version <= ADV_CHIP_MAX_VER_ISA)) { - if (adv->chip_version >= ADV_CHIP_MIN_VER_ISA_PNP) { - adv->type = ADV_ISAPNP; - ADV_OUTB(adv, ADV_REG_IFC, - ADV_IFC_INIT_DEFAULT); - } else { - adv->type = ADV_ISA; - } - maxsegsz = ADV_ISA_MAX_DMA_COUNT; - maxsize = BUS_SPACE_MAXSIZE_24BIT; - lowaddr = ADV_ISA_MAX_DMA_ADDR; - adv->isa_dma_speed = ADV_DEF_ISA_DMA_SPEED; - adv->isa_dma_channel = adv_get_isa_dma_channel(adv); - bus_set_resource(dev, SYS_RES_DRQ, 0, - adv->isa_dma_channel, 1, -1); - } else { - panic("advisaprobe: Unknown card revision"); - } - - /* - * Allocate a parent dmatag for all tags created - * by the MI portions of the advansys driver - */ - /* XXX Should be a child of the ISA bus dma tag */ - error = bus_dma_tag_create(/*parent*/NULL, - /*alignemnt*/1, - /*boundary*/0, - lowaddr, - /*highaddr*/BUS_SPACE_MAXADDR, - /*filter*/NULL, - /*filterarg*/NULL, - maxsize, - /*nsegs*/BUS_SPACE_UNRESTRICTED, - maxsegsz, - /*flags*/0, - &adv->parent_dmat); - - if (error != 0) { - kprintf("%s: Could not allocate DMA tag - error %d\n", - adv_name(adv), error); - adv_free(adv); - bus_release_resource(dev, SYS_RES_IOPORT, 0, iores); - break; - } - - adv->init_level += 2; - - if (overrun_buf == NULL) { - /* Need to allocate our overrun buffer */ - if (bus_dma_tag_create(adv->parent_dmat, - /*alignment*/8, - /*boundary*/0, - ADV_ISA_MAX_DMA_ADDR, - BUS_SPACE_MAXADDR, - /*filter*/NULL, - /*filterarg*/NULL, - ADV_OVERRUN_BSIZE, - /*nsegments*/1, - BUS_SPACE_MAXSIZE_32BIT, - /*flags*/0, - &overrun_dmat) != 0) { - adv_free(adv); - bus_release_resource(dev, SYS_RES_IOPORT, 0, - iores); - break; - } - if (bus_dmamem_alloc(overrun_dmat, - (void **)&overrun_buf, - BUS_DMA_NOWAIT, - &overrun_dmamap) != 0) { - bus_dma_tag_destroy(overrun_dmat); - adv_free(adv); - bus_release_resource(dev, SYS_RES_IOPORT, 0, - iores); - break; - } - /* And permanently map it in */ - bus_dmamap_load(overrun_dmat, overrun_dmamap, - overrun_buf, ADV_OVERRUN_BSIZE, - adv_map, &overrun_physbase, - /*flags*/0); - } - - adv->overrun_physbase = overrun_physbase; - - if (adv_init(adv) != 0) { - bus_dmamap_unload(overrun_dmat, overrun_dmamap); - bus_dmamem_free(overrun_dmat, overrun_buf, - overrun_dmamap); - bus_dma_tag_destroy(overrun_dmat); - adv_free(adv); - bus_release_resource(dev, SYS_RES_IOPORT, 0, iores); - break; - } - - switch (adv->type) { - case ADV_ISAPNP: - if (adv->chip_version == ADV_CHIP_VER_ASYN_BUG) { - adv->bug_fix_control - |= ADV_BUG_FIX_ASYN_USE_SYN; - adv->fix_asyn_xfer = ~0; - } - /* Fall Through */ - case ADV_ISA: - adv->max_dma_count = ADV_ISA_MAX_DMA_COUNT; - adv->max_dma_addr = ADV_ISA_MAX_DMA_ADDR; - adv_set_isa_dma_settings(adv); - break; - - case ADV_VL: - adv->max_dma_count = ADV_VL_MAX_DMA_COUNT; - adv->max_dma_addr = ADV_VL_MAX_DMA_ADDR; - break; - default: - panic("advisaprobe: Invalid card type"); - } - - /* Determine our IRQ */ - if (bus_get_resource(dev, SYS_RES_IRQ, 0, &irq, NULL)) { - int chip_irq = adv_get_chip_irq(adv); - - bus_set_resource(dev, SYS_RES_IRQ, 0, chip_irq, 1, - machintr_legacy_intr_cpuid(chip_irq)); - } else { - adv_set_chip_irq(adv, irq); - } - - irqres = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, - RF_ACTIVE); - if (irqres == NULL || - bus_setup_intr(dev, irqres, 0, adv_intr, adv, - &ih, NULL)) { - bus_dmamap_unload(overrun_dmat, overrun_dmamap); - bus_dmamem_free(overrun_dmat, overrun_buf, - overrun_dmamap); - bus_dma_tag_destroy(overrun_dmat); - adv_free(adv); - bus_release_resource(dev, SYS_RES_IOPORT, 0, iores); - break; - } - - /* Mark as probed */ - adv_isa_ioports[port_index] = 0; - return 0; - } - - if (user_iobase) - bus_set_resource(dev, SYS_RES_IOPORT, 0, iobase, iocount, -1); - else - bus_delete_resource(dev, SYS_RES_IOPORT, 0); - - return ENXIO; -} - -static int -adv_isa_attach(device_t dev) -{ - struct adv_softc *adv = device_get_softc(dev); - - return (adv_attach(adv)); -} - -static int -adv_get_isa_dma_channel(struct adv_softc *adv) -{ - int channel; - - channel = ADV_INW(adv, ADV_CONFIG_LSW) & ADV_CFG_LSW_ISA_DMA_CHANNEL; - if (channel == 0x03) - return (0); - else if (channel == 0x00) - return (7); - return (channel + 4); -} - -static int -adv_set_isa_dma_settings(struct adv_softc *adv) -{ - u_int16_t cfg_lsw; - u_int8_t value; - - if ((adv->isa_dma_channel >= 5) && (adv->isa_dma_channel <= 7)) { - if (adv->isa_dma_channel == 7) - value = 0x00; - else - value = adv->isa_dma_channel - 4; - cfg_lsw = ADV_INW(adv, ADV_CONFIG_LSW) - & ~ADV_CFG_LSW_ISA_DMA_CHANNEL; - cfg_lsw |= value; - ADV_OUTW(adv, ADV_CONFIG_LSW, cfg_lsw); - - adv->isa_dma_speed &= 0x07; - adv_set_bank(adv, 1); - ADV_OUTB(adv, ADV_DMA_SPEED, adv->isa_dma_speed); - adv_set_bank(adv, 0); - isa_dmacascade(adv->isa_dma_channel); - } - return (0); -} - -static void -adv_set_isapnp_wait_for_key(void) -{ - static int isapnp_wait_set = 0; - if (isapnp_wait_set == 0) { - outb(ADV_ISA_PNP_PORT_ADDR, 0x02); - outb(ADV_ISA_PNP_PORT_WRITE, 0x02); - isapnp_wait_set++; - } -} - -static device_method_t adv_isa_methods[] = { - /* Device interface */ - DEVMETHOD(device_probe, adv_isa_probe), - DEVMETHOD(device_attach, adv_isa_attach), - DEVMETHOD_END -}; - -static driver_t adv_isa_driver = { - "adv", adv_isa_methods, sizeof(struct adv_softc) -}; - -static devclass_t adv_isa_devclass; -DRIVER_MODULE(adv, isa, adv_isa_driver, adv_isa_devclass, NULL, NULL); diff --git a/sys/dev/disk/advansys/advansys.c b/sys/dev/disk/advansys/advansys.c index 263211387b..5d18e563f7 100644 --- a/sys/dev/disk/advansys/advansys.c +++ b/sys/dev/disk/advansys/advansys.c @@ -2,8 +2,7 @@ * Generic driver for the Advanced Systems Inc. SCSI controllers * Product specific probe and attach routines can be found in: * - * i386/isa/adv_isa.c ABP5140, ABP542, ABP5150, ABP842, ABP852 - * pci/adv_pci.c ABP920, ABP930, ABP930U, ABP930UA, ABP940, ABP940U, + * adv_pci.c ABP920, ABP930, ABP930U, ABP930UA, ABP940, ABP940U, * ABP940UA, ABP950, ABP960, ABP960U, ABP960UA, * ABP970, ABP970U * diff --git a/sys/dev/disk/stg/Makefile b/sys/dev/disk/stg/Makefile index 8c0961475e..c3f59a02d4 100644 --- a/sys/dev/disk/stg/Makefile +++ b/sys/dev/disk/stg/Makefile @@ -1,8 +1,8 @@ # $FreeBSD: src/sys/modules/stg/Makefile,v 1.1.2.2 2002/01/02 07:59:12 non Exp $ KMOD= stg -SRCS= tmc18c30.c tmc18c30_isa.c tmc18c30_pccard.c -SRCS+= device_if.h bus_if.h pci_if.h isa_if.h card_if.h pccarddevs.h +SRCS= tmc18c30.c tmc18c30_pccard.c +SRCS+= device_if.h bus_if.h pci_if.h card_if.h pccarddevs.h SRCS+= opt_cam.h opt_scsi.h opt_ddb.h .include diff --git a/sys/dev/disk/stg/tmc18c30_isa.c b/sys/dev/disk/stg/tmc18c30_isa.c deleted file mode 100644 index 2683eb6163..0000000000 --- a/sys/dev/disk/stg/tmc18c30_isa.c +++ /dev/null @@ -1,285 +0,0 @@ -/* $FreeBSD: src/sys/dev/stg/tmc18c30_isa.c,v 1.2.2.4 2001/09/04 04:45:23 non Exp $ */ -/* $NecBSD: tmc18c30_pisa.c,v 1.22 1998/11/26 01:59:21 honda Exp $ */ -/* $NetBSD$ */ - -/* -* [Ported for FreeBSD] -* Copyright (c) 2000 -* Noriaki Mitsunaga, Mitsuru Iwasaki and Takanori Watanabe. -* All rights reserved. -* [NetBSD for NEC PC-98 series] -* Copyright (c) 1996, 1997, 1998 -* NetBSD/pc98 porting staff. All rights reserved. -* Copyright (c) 1996, 1997, 1998 -* Naofumi HONDA. All rights reserved. -* Copyright (c) 1996, 1997, 1998 -* Kouichi Matsuda. 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, 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. The name of the author may not be used to endorse or promote products -* derived from this software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, -* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -* POSSIBILITY OF SUCH DAMAGE. -*/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include - -#include -#include -#include - -#include "tmc18c30reg.h" -#include "tmc18c30var.h" - -#define STG_HOSTID 7 - -static int stgprobe(device_t devi); -static int stgattach(device_t devi); - -static void stg_isa_unload (device_t); - -static void -stg_isa_intr(void * arg) -{ - stgintr(arg); -} - -static void -stg_release_resource(device_t dev) -{ - struct stg_softc *sc = device_get_softc(dev); - - if (sc->stg_intrhand) { - bus_teardown_intr(dev, sc->irq_res, sc->stg_intrhand); - } - - if (sc->port_res) { - bus_release_resource(dev, SYS_RES_IOPORT, - sc->port_rid, sc->port_res); - } - - if (sc->irq_res) { - bus_release_resource(dev, SYS_RES_IRQ, - sc->irq_rid, sc->irq_res); - } - - if (sc->mem_res) { - bus_release_resource(dev, SYS_RES_MEMORY, - sc->mem_rid, sc->mem_res); - } -} - -static int -stg_alloc_resource(device_t dev) -{ - struct stg_softc *sc = device_get_softc(dev); - u_long maddr, msize; - int error; - - sc->port_rid = 0; - sc->port_res = bus_alloc_resource(dev, SYS_RES_IOPORT, &sc->port_rid, - 0, ~0, STGIOSZ, RF_ACTIVE); - if (sc->port_res == NULL) { - stg_release_resource(dev); - return(ENOMEM); - } - - sc->irq_rid = 0; - sc->irq_res = bus_alloc_resource(dev, SYS_RES_IRQ, &sc->irq_rid, - 0, ~0, 1, RF_ACTIVE); - if (sc->irq_res == NULL) { - stg_release_resource(dev); - return(ENOMEM); - } - - error = bus_get_resource(dev, SYS_RES_MEMORY, 0, &maddr, &msize); - if (error) { - return(0); /* XXX */ - } - - /* no need to allocate memory if not configured */ - if (maddr == 0 || msize == 0) { - return(0); - } - - sc->mem_rid = 0; - sc->mem_res = bus_alloc_resource(dev, SYS_RES_MEMORY, &sc->mem_rid, - 0, ~0, 1, RF_ACTIVE); - if (sc->mem_res == NULL) { - stg_release_resource(dev); - return(ENOMEM); - } - - return(0); -} - -static int -stg_isa_probe(device_t dev) -{ - struct stg_softc *sc = device_get_softc(dev); - int error; - - bzero(sc, sizeof(struct stg_softc)); - - error = stg_alloc_resource(dev); - if (error) { - return(error); - } - - if (stgprobe(dev) == 0) { - stg_release_resource(dev); - return(ENXIO); - } - - stg_release_resource(dev); - - return(0); -} - -static int -stg_isa_attach(device_t dev) -{ - struct stg_softc *sc = device_get_softc(dev); - int error; - - error = stg_alloc_resource(dev); - if (error) { - return(error); - } - - error = bus_setup_intr(dev, sc->irq_res, 0, - stg_isa_intr, (void *)sc, - &sc->stg_intrhand, NULL); - if (error) { - stg_release_resource(dev); - return(error); - } - - if (stgattach(dev) == 0) { - stg_release_resource(dev); - return(ENXIO); - } - - return(0); -} - -static void -stg_isa_detach(device_t dev) -{ - stg_isa_unload(dev); - stg_release_resource(dev); -} - -static device_method_t stg_isa_methods[] = { - /* Device interface */ - DEVMETHOD(device_probe, stg_isa_probe), - DEVMETHOD(device_attach, stg_isa_attach), - DEVMETHOD(device_detach, stg_isa_detach), - - DEVMETHOD_END -}; - -static driver_t stg_isa_driver = { - "stg", - stg_isa_methods, - sizeof(struct stg_softc), -}; - -static devclass_t stg_devclass; - -DRIVER_MODULE(stg, isa, stg_isa_driver, stg_devclass, NULL, NULL); - -static void -stg_isa_unload(device_t devi) -{ - struct stg_softc *sc = device_get_softc(devi); - - kprintf("%s: unload\n",sc->sc_sclow.sl_xname); - crit_enter(); - scsi_low_deactivate((struct scsi_low_softc *)sc); - scsi_low_dettach(&sc->sc_sclow); - crit_exit(); -} - -static int -stgprobe(device_t devi) -{ - int rv; - struct stg_softc *sc = device_get_softc(devi); - - rv = stgprobesubr(rman_get_bustag(sc->port_res), - rman_get_bushandle(sc->port_res), - device_get_flags(devi)); - - return rv; -} - -static int -stgattach(device_t devi) -{ - struct stg_softc *sc; - struct scsi_low_softc *slp; - u_int32_t flags = device_get_flags(devi); - u_int iobase = bus_get_resource_start(devi, SYS_RES_IOPORT, 0); - char dvname[16]; - - strcpy(dvname,"stg"); - - - if (iobase == 0) - { - kprintf("%s: no ioaddr is given\n", dvname); - return (0); - } - - sc = device_get_softc(devi); - if (sc == NULL) { - return(0); - } - - slp = &sc->sc_sclow; - slp->sl_dev = devi; - sc->sc_iot = rman_get_bustag(sc->port_res); - sc->sc_ioh = rman_get_bushandle(sc->port_res); - - slp->sl_hostid = STG_HOSTID; - slp->sl_cfgflags = flags; - - crit_enter(); - stgattachsubr(sc); - crit_exit(); - - return(STGIOSZ); -} diff --git a/sys/dev/netif/an/Makefile b/sys/dev/netif/an/Makefile index ef59008005..97b1958c15 100644 --- a/sys/dev/netif/an/Makefile +++ b/sys/dev/netif/an/Makefile @@ -1,8 +1,8 @@ # $FreeBSD: src/sys/modules/an/Makefile,v 1.2 2000/01/28 11:26:26 bde Exp $ KMOD = if_an -SRCS = if_an.c if_an_pccard.c if_an_pci.c if_an_isa.c -SRCS += opt_inet.h device_if.h bus_if.h pci_if.h isa_if.h card_if.h +SRCS = if_an.c if_an_pccard.c if_an_pci.c +SRCS += opt_inet.h device_if.h bus_if.h pci_if.h card_if.h SRCS += pccarddevs.h pcidevs.h .if !defined(BUILDING_WITH_KERNEL) diff --git a/sys/dev/netif/an/if_an_isa.c b/sys/dev/netif/an/if_an_isa.c deleted file mode 100644 index d5f1b1bffc..0000000000 --- a/sys/dev/netif/an/if_an_isa.c +++ /dev/null @@ -1,155 +0,0 @@ -/* - * Copyright (c) 1997, 1998, 1999 - * Bill Paul . 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, 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Bill Paul. - * 4. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD: src/sys/dev/an/if_an_isa.c,v 1.1.2.5 2003/02/01 03:25:12 ambrisko Exp $ - */ - -/* - * Aironet 4500/4800 802.11 PCMCIA/ISA/PCI driver for FreeBSD. - * - * Written by Bill Paul - * Electrical Engineering Department - * Columbia University, New York City - */ - -#include "opt_inet.h" -#ifdef INET -#define ANCACHE -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include "if_aironet_ieee.h" -#include "if_anreg.h" - -static struct isa_pnp_id an_ids[] = { - { 0x0100ec06, "Aironet ISA4500/ISA4800" }, - { 0, NULL } -}; - -static int an_probe_isa (device_t); -static int an_attach_isa (device_t); - -static int -an_probe_isa(device_t dev) -{ - int error; - - error = ISA_PNP_PROBE(device_get_parent(dev), dev, an_ids); - if (error == ENXIO) - return(error); - - error = an_probe(dev); - if (error) - goto back; - - error = an_alloc_irq(dev, 0, 0); - if (!error) - device_set_desc(dev, "Aironet ISA4500/ISA4800"); -back: - an_release_resources(dev); - return (error); -} - -static int -an_attach_isa(device_t dev) -{ - struct an_softc *sc = device_get_softc(dev); - struct ifnet *ifp = &sc->arpcom.ac_if; - int flags = device_get_flags(dev); - int error; - - an_alloc_port(dev, sc->port_rid, 1); - an_alloc_irq(dev, sc->irq_rid, 0); - - sc->an_bhandle = rman_get_bushandle(sc->port_res); - sc->an_btag = rman_get_bustag(sc->port_res); - - error = an_attach(sc, dev, flags); - if (error) - goto fail; - - ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->irq_res)); - - error = bus_setup_intr(dev, sc->irq_res, INTR_MPSAFE, - an_intr, sc, &sc->irq_handle, - sc->arpcom.ac_if.if_serializer); - if (error) { - ether_ifdetach(&sc->arpcom.ac_if); - ifmedia_removeall(&sc->an_ifmedia); - goto fail; - } - - return (0); - -fail: - an_release_resources(dev); - return(error); -} - -static device_method_t an_isa_methods[] = { - /* Device interface */ - DEVMETHOD(device_probe, an_probe_isa), - DEVMETHOD(device_attach, an_attach_isa), - DEVMETHOD(device_detach, an_detach), - DEVMETHOD(device_shutdown, an_shutdown), - DEVMETHOD_END -}; - -static driver_t an_isa_driver = { - "an", - an_isa_methods, - sizeof(struct an_softc) -}; - -static devclass_t an_isa_devclass; - -DRIVER_MODULE(if_an, isa, an_isa_driver, an_isa_devclass, NULL, NULL); diff --git a/sys/dev/netif/ar/Makefile b/sys/dev/netif/ar/Makefile index 68114c90cc..519167771d 100644 --- a/sys/dev/netif/ar/Makefile +++ b/sys/dev/netif/ar/Makefile @@ -1,7 +1,7 @@ # $FreeBSD: src/sys/modules/ar/Makefile,v 1.3.2.1 2002/06/17 15:11:03 jhay Exp $ KMOD = if_ar -SRCS = if_ar.c if_ar_isa.c if_ar_pci.c -SRCS += device_if.h bus_if.h pci_if.h isa_if.h opt_netgraph.h pcidevs.h +SRCS = if_ar.c if_ar_pci.c +SRCS += device_if.h bus_if.h pci_if.h opt_netgraph.h pcidevs.h .include diff --git a/sys/dev/netif/ar/if_ar_isa.c b/sys/dev/netif/ar/if_ar_isa.c deleted file mode 100644 index 0f007024f0..0000000000 --- a/sys/dev/netif/ar/if_ar_isa.c +++ /dev/null @@ -1,223 +0,0 @@ -/*- - * Copyright (c) 1995 - 2001 John Hay. 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, 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. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY John Hay ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL John Hay BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD: src/sys/dev/ar/if_ar_isa.c,v 1.54 2005/01/06 01:42:28 imp Exp $ - */ - -/* - * Programming assumptions and other issues. - * - * The descriptors of a DMA channel will fit in a 16K memory window. - * - * The buffers of a transmit DMA channel will fit in a 16K memory window. - * - * Only the ISA bus cards with X.21 and V.35 is tested. - * - * When interface is going up, handshaking is set and it is only cleared - * when the interface is down'ed. - * - * There should be a way to set/reset Raw HDLC/PPP, Loopback, DCE/DTE, - * internal/external clock, etc..... - */ - -#include -#include -#include -#include -#include -#include - -#include -#include "isa_if.h" - -#include -#include - -#ifdef TRACE -#define TRC(x) x -#else -#define TRC(x) -#endif - -#define TRCL(x) x - -static int ar_isa_probe (device_t); -static int ar_isa_attach (device_t); - -static struct isa_pnp_id ar_ids[] = { - {0, NULL} -}; - -static device_method_t ar_methods[] = { - DEVMETHOD(device_probe, ar_isa_probe), - DEVMETHOD(device_attach, ar_isa_attach), - DEVMETHOD(device_detach, ar_detach), - DEVMETHOD_END -}; - -static driver_t ar_isa_driver = { - "ar", - ar_methods, - sizeof (struct ar_hardc) -}; - -DRIVER_MODULE(if_ar, isa, ar_isa_driver, ar_devclass, NULL, NULL); - -/* - * Probe to see if it is there. - * Get its information and fill it in. - */ -static int -ar_isa_probe(device_t device) -{ - int error; - u_long membase, memsize; - struct ar_hardc *hc; - - error = ISA_PNP_PROBE(device_get_parent(device), device, ar_ids); - if(error == ENXIO || error == 0) - return (error); - - hc = (struct ar_hardc *)device_get_softc(device); - - if((error = ar_allocate_ioport(device, 0, ARC_IO_SIZ))) { - return (ENXIO); - } - - /* - * Now see if the card is realy there. - * - * XXX For now I just check the undocumented ports - * for "570". We will probably have to do more checking. - */ - if((ar_inb(hc, AR_ID_5) != '5') || - (ar_inb(hc, AR_ID_7) != '7') || - (ar_inb(hc, AR_ID_0) != '0')) { - ar_deallocate_resources(device); - return (ENXIO); - } - membase = bus_get_resource_start(device, SYS_RES_MEMORY, 0); - memsize = ar_inb(hc, AR_REV); - memsize = 1 << ((memsize & AR_WSIZ_MSK) >> AR_WSIZ_SHFT); - memsize *= ARC_WIN_SIZ; - error = bus_set_resource(device, SYS_RES_MEMORY, 0, membase, memsize, - -1); - ar_deallocate_resources(device); - - return (error); -} - -/* - * Malloc memory for the softc structures. - * Reset the card to put it in a known state. - * Register the ports on the adapter. - * Fill in the info for each port. - * Attach each port to sppp and bpf. - */ -static int -ar_isa_attach(device_t device) -{ - u_int tmp; - u_long irq, junk; - struct ar_hardc *hc; - - hc = (struct ar_hardc *)device_get_softc(device); - if(ar_allocate_ioport(device, 0, ARC_IO_SIZ)) - return (ENXIO); - - tmp = ar_inb(hc, AR_BMI); - hc->bustype = tmp & AR_BUS_MSK; - hc->memsize = (tmp & AR_MEM_MSK) >> AR_MEM_SHFT; - hc->memsize = 1 << hc->memsize; - hc->memsize <<= 16; - hc->interface[0] = (tmp & AR_IFACE_MSK); - hc->interface[1] = hc->interface[0]; - hc->interface[2] = hc->interface[0]; - hc->interface[3] = hc->interface[0]; - tmp = ar_inb(hc, AR_REV); - hc->revision = tmp & AR_REV_MSK; - hc->winsize = 1 << ((tmp & AR_WSIZ_MSK) >> AR_WSIZ_SHFT); - hc->winsize *= ARC_WIN_SIZ; - hc->winmsk = hc->winsize - 1; - hc->numports = ar_inb(hc, AR_PNUM); - hc->handshake = ar_inb(hc, AR_HNDSH); - - if(ar_allocate_memory(device, 0, hc->winsize)) - return (ENXIO); - - hc->mem_start = rman_get_virtual(hc->res_memory); - hc->mem_end = hc->mem_start + hc->winsize; - hc->cunit = device_get_unit(device); - - switch(hc->interface[0]) { - case AR_IFACE_EIA_232: - kprintf("ar%d: The EIA 232 interface is not supported.\n", - hc->cunit); - ar_deallocate_resources(device); - return (ENXIO); - case AR_IFACE_V_35: - break; - case AR_IFACE_EIA_530: - kprintf("ar%d: WARNING: The EIA 530 interface is untested.\n", - hc->cunit); - break; - case AR_IFACE_X_21: - break; - case AR_IFACE_COMBO: - kprintf("ar%d: WARNING: The COMBO interface is untested.\n", - hc->cunit); - break; - } - - /* - * Do a little sanity check. - */ - if((hc->numports > NPORT) || (hc->memsize > (512*1024))) { - ar_deallocate_resources(device); - return (ENXIO); - } - - if(ar_allocate_irq(device, 0, 1)) - return (ENXIO); - - if(bus_get_resource(device, SYS_RES_IRQ, 0, &irq, &junk)) { - ar_deallocate_resources(device); - return (ENXIO); - } - hc->isa_irq = irq; - - if(ar_attach(device)) { - ar_deallocate_resources(device); - return (ENXIO); - } - - return (0); -} - -/* - ********************************* END ************************************ - */ diff --git a/sys/dev/netif/cs/if_cs_isa.c b/sys/dev/netif/cs/if_cs_isa.c deleted file mode 100644 index 08538e7b6e..0000000000 --- a/sys/dev/netif/cs/if_cs_isa.c +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright (c) 1997,1998 Maxim Bolotin and Oleg Sharoiko. - * 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 unmodified, 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD: src/sys/dev/cs/if_cs_isa.c,v 1.1.2.1 2001/01/25 20:13:48 imp Exp $ - */ - -#include -#include -#include -#include -#include - -#include -#include -#include - -#include - -#include "if_csvar.h" - -static int cs_isa_probe (device_t); - -static struct isa_pnp_id cs_ids[] = { - { 0x4060630e, NULL }, /* CSC6040 */ - { 0x10104d24, NULL }, /* IBM EtherJet */ - { 0, NULL } -}; - -/* - * Determine if the device is present - */ -static int -cs_isa_probe(device_t dev) -{ - int error = 0; - - /* Check isapnp ids */ - error = ISA_PNP_PROBE(device_get_parent(dev), dev, cs_ids); - - /* If the card had a PnP ID that didn't match any we know about */ - if (!(error == 0 || error == ENOENT)) - return error; - - error = cs_cs89x0_probe(dev); - if (error == 0) - error = cs_alloc_irq(dev, 0, 0); - - cs_release_resources(dev); - return (error); -} - -static device_method_t cs_isa_methods[] = { - /* Device interface */ - DEVMETHOD(device_probe, cs_isa_probe), - DEVMETHOD(device_attach, cs_attach), - DEVMETHOD(device_detach, cs_detach), - - DEVMETHOD_END -}; - -static driver_t cs_isa_driver = { - "cs", - cs_isa_methods, - sizeof(struct cs_softc), -}; - -extern devclass_t cs_devclass; - -DRIVER_MODULE(if_cs, isa, cs_isa_driver, cs_devclass, NULL, NULL); -MODULE_DEPEND(if_cs, isa, 1, 1, 1); diff --git a/sys/dev/netif/ed/Makefile b/sys/dev/netif/ed/Makefile index cee4e0608d..5d293c35fa 100644 --- a/sys/dev/netif/ed/Makefile +++ b/sys/dev/netif/ed/Makefile @@ -1,6 +1,6 @@ KMOD = if_ed -SRCS = if_ed.c if_ed_isa.c if_ed_pccard.c if_ed_pci.c \ - card_if.h pccarddevs.h device_if.h bus_if.h pci_if.h isa_if.h \ +SRCS = if_ed.c if_ed_pccard.c if_ed_pci.c \ + card_if.h pccarddevs.h device_if.h bus_if.h pci_if.h \ miibus_if.h pcidevs.h \ opt_ed.h diff --git a/sys/dev/netif/ed/if_ed_isa.c b/sys/dev/netif/ed/if_ed_isa.c deleted file mode 100644 index b33b44216d..0000000000 --- a/sys/dev/netif/ed/if_ed_isa.c +++ /dev/null @@ -1,191 +0,0 @@ -/* - * Copyright (c) 1995, David Greenman - * 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 unmodified, 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD: src/sys/dev/ed/if_ed_isa.c,v 1.15 2003/10/31 18:31:58 brooks Exp $ - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include - -#include "if_edvar.h" - -static int ed_isa_probe (device_t); -static int ed_isa_attach (device_t); -static int ed_isa_detach (device_t); - -static struct isa_pnp_id ed_ids[] = { - { 0x1684a34d, NULL }, /* SMC8416 */ - { 0xd680d041, NULL }, /* PNP80d6 */ - { 0x1980635e, NULL }, /* WSC8019 */ - { 0x0131d805, NULL }, /* ANX3101 */ - { 0x01200507, NULL }, /* AXE2001 */ - { 0x19808c4a, NULL }, /* RTL8019 */ - { 0x0090252a, NULL }, /* JQE9000 */ - { 0x0020832e, NULL }, /* KTC2000 */ - { 0x4cf48906, NULL }, /* ATIf44c */ - { 0, NULL } -}; - -static int -ed_isa_probe(device_t dev) -{ - int flags = device_get_flags(dev); - int error = 0; - - /* Check isapnp ids */ - error = ISA_PNP_PROBE(device_get_parent(dev), dev, ed_ids); - - /* If the card had a PnP ID that didn't match any we know about */ - if (error == ENXIO) { - goto end; - } - - /* If we had some other problem. */ - if (!(error == 0 || error == ENOENT)) { - goto end; - } - - /* Heuristic probes */ - - error = ed_probe_WD80x3(dev, 0, flags); - if (error == 0) - goto end; - ed_release_resources(dev); - - error = ed_probe_3Com(dev, 0, flags); - if (error == 0) - goto end; - ed_release_resources(dev); - - error = ed_probe_SIC(dev, 0, flags); - if (error == 0) - goto end; - ed_release_resources(dev); - - error = ed_probe_Novell(dev, 0, flags); - if (error == 0) - goto end; - ed_release_resources(dev); - - error = ed_probe_HP_pclanp(dev, 0, flags); - if (error == 0) - goto end; - ed_release_resources(dev); - -end: - if (error == 0) - error = ed_alloc_irq(dev, 0, 0); - - ed_release_resources(dev); - return (error); -} - -static int -ed_isa_attach(device_t dev) -{ - struct ed_softc *sc = device_get_softc(dev); - int error; - - if (sc->port_used > 0) - ed_alloc_port(dev, sc->port_rid, sc->port_used); - if (sc->mem_used) - ed_alloc_memory(dev, sc->mem_rid, sc->mem_used); - - ed_alloc_irq(dev, sc->irq_rid, 0); - - error = ed_attach(dev); - if (error == 0) { - struct ifnet *ifp = &sc->arpcom.ac_if; - - ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->irq_res)); - - error = bus_setup_intr(dev, sc->irq_res, INTR_MPSAFE, - edintr, sc, &sc->irq_handle, - ifp->if_serializer); - if (error) - ed_isa_detach(dev); - } else { - ed_release_resources(dev); - } - return (error); -} - -static int -ed_isa_detach(device_t dev) -{ - struct ed_softc *sc = device_get_softc(dev); - struct ifnet *ifp = &sc->arpcom.ac_if; - - lwkt_serialize_enter(ifp->if_serializer); - - if (sc->gone) { - device_printf(dev, "already unloaded\n"); - lwkt_serialize_exit(ifp->if_serializer); - return (0); - } - ed_stop(sc); - ifp->if_flags &= ~IFF_RUNNING; - sc->gone = 1; - bus_teardown_intr(dev, sc->irq_res, sc->irq_handle); - - lwkt_serialize_exit(ifp->if_serializer); - - ether_ifdetach(ifp); - ed_release_resources(dev); - return (0); -} - -static device_method_t ed_isa_methods[] = { - /* Device interface */ - DEVMETHOD(device_probe, ed_isa_probe), - DEVMETHOD(device_attach, ed_isa_attach), - DEVMETHOD(device_attach, ed_isa_detach), - - DEVMETHOD_END -}; - -static driver_t ed_isa_driver = { - "ed", - ed_isa_methods, - sizeof(struct ed_softc) -}; - -DRIVER_MODULE(if_ed, isa, ed_isa_driver, ed_devclass, NULL, NULL); -MODULE_DEPEND(if_ed, isa, 1, 1, 1); diff --git a/sys/dev/netif/ep/Makefile b/sys/dev/netif/ep/Makefile index 2503ee7573..4b4d33c53c 100644 --- a/sys/dev/netif/ep/Makefile +++ b/sys/dev/netif/ep/Makefile @@ -1,5 +1,5 @@ KMOD = if_ep -SRCS = if_ep.c if_ep_pccard.c if_ep_isa.c -SRCS += device_if.h bus_if.h pci_if.h isa_if.h card_if.h pccarddevs.h +SRCS = if_ep.c if_ep_pccard.c +SRCS += device_if.h bus_if.h pci_if.h card_if.h pccarddevs.h .include diff --git a/sys/dev/netif/ep/if_ep_isa.c b/sys/dev/netif/ep/if_ep_isa.c deleted file mode 100644 index 23d7c1b9be..0000000000 --- a/sys/dev/netif/ep/if_ep_isa.c +++ /dev/null @@ -1,359 +0,0 @@ -/* - * Copyright (c) 1994 Herb Peyerl - * 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, 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Herb Peyerl. - * 4. The name of Herb Peyerl may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD: src/sys/dev/ep/if_ep_isa.c,v 1.8.2.1 2000/12/16 03:47:57 nyan Exp $ - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include - -#include -#include - -#include "if_epreg.h" -#include "if_epvar.h" -#include "../elink_layer/elink.h" - -static u_int16_t get_eeprom_data (int, int); - -static int ep_isa_identify (driver_t *, device_t); -static int ep_isa_probe (device_t); -static int ep_isa_attach (device_t); - -struct isa_ident { - u_int32_t id; - char * name; -}; -const char * ep_isa_match_id (u_int32_t, struct isa_ident *); - -#define ISA_ID_3C509_XXX 0x0506d509 -#define ISA_ID_3C509_TP 0x506d5090 -#define ISA_ID_3C509_BNC 0x506d5091 -#define ISA_ID_3C509_COMBO 0x506d5094 -#define ISA_ID_3C509_TPO 0x506d5095 -#define ISA_ID_3C509_TPC 0x506d5098 - -static struct isa_ident ep_isa_devs[] = { - { ISA_ID_3C509_TP, "3Com 3C509-TP EtherLink III" }, - { ISA_ID_3C509_BNC, "3Com 3C509-BNC EtherLink III" }, - { ISA_ID_3C509_COMBO, "3Com 3C509-Combo EtherLink III" }, - { ISA_ID_3C509_TPO, "3Com 3C509-TPO EtherLink III" }, - { ISA_ID_3C509_TPC, "3Com 3C509-TPC EtherLink III" }, - { 0, NULL }, -}; - -static struct isa_pnp_id ep_ids[] = { - { 0x90506d50, "3Com 3C509B-TP EtherLink III (PnP)" }, /* TCM5090 */ - { 0x91506d50, "3Com 3C509B-BNC EtherLink III (PnP)" },/* TCM5091 */ - { 0x94506d50, "3Com 3C509B-Combo EtherLink III (PnP)" },/* TCM5094 */ - { 0x95506d50, "3Com 3C509B-TPO EtherLink III (PnP)" },/* TCM5095 */ - { 0x98506d50, "3Com 3C509B-TPC EtherLink III (PnP)" },/* TCM5098 */ - { 0xf780d041, NULL }, /* PNP80f7 */ - { 0, NULL }, -}; - -/* - * We get eeprom data from the id_port given an offset into the eeprom. - * Basically; after the ID_sequence is sent to all of the cards; they enter - * the ID_CMD state where they will accept command requests. 0x80-0xbf loads - * the eeprom data. We then read the port 16 times and with every read; the - * cards check for contention (ie: if one card writes a 0 bit and another - * writes a 1 bit then the host sees a 0. At the end of the cycle; each card - * compares the data on the bus; if there is a difference then that card goes - * into ID_WAIT state again). In the meantime; one bit of data is returned in - * the AX register which is conveniently returned to us by inb(). Hence; we - * read 16 times getting one bit of data with each read. - */ - -static u_int16_t -get_eeprom_data(int id_port, int offset) -{ - int i; - u_int16_t data = 0; - - outb(id_port, EEPROM_CMD_RD|offset); - DELAY(BIT_DELAY_MULTIPLE * 1000); - for (i = 0; i < 16; i++) { - DELAY(50); - data = (data << 1) | (inw(id_port) & 1); - } - return (data); -} - -const char * -ep_isa_match_id(u_int32_t id, struct isa_ident *isa_devs) -{ - struct isa_ident * i = isa_devs; - - while(i->name != NULL) { - if (id == i->id) - return (i->name); - i++; - } - /* - * If we see a card that is likely to be a 3c509 - * return something so that it will work; be annoying - * so that the user will tell us about it though. - */ - if ((id >> 4) == ISA_ID_3C509_XXX) { - return ("Unknown 3c509; notify maintainer!"); - } - return (NULL); -} - -static int -ep_isa_identify(driver_t *driver, device_t parent) -{ - int tag = EP_LAST_TAG; - int found = 0; - int i; - int j; - const char * desc; - u_int16_t data; - u_int32_t irq; - u_int32_t ioport; - u_int32_t isa_id; - device_t child; - - /* - * Rescans not currently supported. - */ - if (device_get_state(parent) == DS_ATTACHED) - return (0); - - /* - * Check for the existance of the EISA bus. - */ - outb(ELINK_ID_PORT, 0); - outb(ELINK_ID_PORT, 0); - elink_idseq(ELINK_509_POLY); - elink_reset(); - - DELAY(DELAY_MULTIPLE * 10000); - - for (i = 0; i < EP_MAX_BOARDS; i++) { - - outb(ELINK_ID_PORT, 0); - outb(ELINK_ID_PORT, 0); - elink_idseq(ELINK_509_POLY); - DELAY(400); - - /* For the first probe, clear all - * board's tag registers. - * Otherwise kill off already-found - * boards. -- linux 3c509.c - */ - if (i == 0) { - outb(ELINK_ID_PORT, 0xd0); - } else { - outb(ELINK_ID_PORT, 0xd8); - } - - /* Get out of loop if we're out of cards. */ - data = get_eeprom_data(ELINK_ID_PORT, EEPROM_MFG_ID); - if (data != MFG_ID) { - break; - } - - /* resolve contention using the Ethernet address */ - for (j = 0; j < 3; j++) { - get_eeprom_data(ELINK_ID_PORT, j); - } - - /* - * Construct an 'isa_id' in 'EISA' - * format. - */ - data = get_eeprom_data(ELINK_ID_PORT, EEPROM_MFG_ID); - isa_id = (htons(data) << 16); - data = get_eeprom_data(ELINK_ID_PORT, EEPROM_PROD_ID); - isa_id |= htons(data); - - /* Find known ISA boards */ - desc = ep_isa_match_id(isa_id, ep_isa_devs); - if (!desc) { - if (bootverbose) { - device_printf(parent, "if_ep: unknown ID 0x%08x\n", - isa_id); - } - continue; - } - - /* Retreive IRQ */ - data = get_eeprom_data(ELINK_ID_PORT, EEPROM_RESOURCE_CFG); - irq = (data >> 12); - - /* Retreive IOPORT */ - data = get_eeprom_data(ELINK_ID_PORT, EEPROM_ADDR_CFG); - ioport = (((data & 0x1f) << 4) + 0x200); - - /* Test for an adapter with PnP support. */ - data = get_eeprom_data(ELINK_ID_PORT, EEPROM_CAP); - if (data == CAP_ISA) { - data = get_eeprom_data(ELINK_ID_PORT, EEPROM_INT_CONFIG_1); - if (data & ICW1_IAS_PNP) { - if (bootverbose) { - device_printf(parent, "if_ep: <%s> at 0x%03x in PnP mode!\n", - desc, ioport); - } - /* Set the adaptor tag so that the next card can be found. */ - outb(ELINK_ID_PORT, tag--); - continue; - } - } - - /* Set the adaptor tag so that the next card can be found. */ - outb(ELINK_ID_PORT, tag--); - - /* Activate the adaptor at the EEPROM location. */ - outb(ELINK_ID_PORT, ACTIVATE_ADAPTER_TO_CONFIG); - - /* Test for an adapter in TEST mode. */ - outw(ioport + EP_COMMAND, WINDOW_SELECT | 0); - data = inw(ioport + EP_W0_EEPROM_COMMAND); - if (data & EEPROM_TST_MODE) { - device_printf(parent, "if_ep: <%s> at port 0x%03x in TEST mode! Erase pencil mark.\n", - desc, ioport); - continue; - } - - child = BUS_ADD_CHILD(parent, parent, - ISA_ORDER_SPECULATIVE, "ep", -1); - device_set_desc_copy(child, desc); - device_set_driver(child, driver); - bus_set_resource(child, SYS_RES_IRQ, 0, irq, 1, - machintr_legacy_intr_cpuid(irq)); - bus_set_resource(child, SYS_RES_IOPORT, 0, ioport, EP_IOSIZE, -1); - - if (bootverbose) { - device_printf(parent, "if_ep: <%s> at port 0x%03x-0x%03x irq %d\n", - desc, ioport, ioport + EP_IOSIZE, irq); - } - - found++; - } - return (found ? 0 : ENXIO); -} - -static int -ep_isa_probe(device_t dev) -{ - int error = 0; - - /* Check isapnp ids */ - error = ISA_PNP_PROBE(device_get_parent(dev), dev, ep_ids); - - /* If the card had a PnP ID that didn't match any we know about */ - if (error == ENXIO) { - return (error); - } - - /* If we had some other problem. */ - if (!(error == 0 || error == ENOENT)) { - return (error); - } - - /* If we have the resources we need then we're good to go. */ - if ((bus_get_resource_start(dev, SYS_RES_IOPORT, 0) != 0) && - (bus_get_resource_start(dev, SYS_RES_IRQ, 0) != 0)) { - return (0); - } - - return (ENXIO); -} - -static int -ep_isa_attach(device_t dev) -{ - struct ep_softc * sc = device_get_softc(dev); - struct ifnet * ifp = &sc->arpcom.ac_if; - int error = 0; - - if ((error = ep_alloc(dev))) { - device_printf(dev, "ep_alloc() failed! (%d)\n", error); - goto bad; - } - - ep_get_media(sc); - - GO_WINDOW(0); - SET_IRQ(BASE, rman_get_start(sc->irq)); - - if ((error = ep_attach(sc))) { - device_printf(dev, "ep_attach() failed! (%d)\n", error); - goto bad; - } - - ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->irq)); - - error = bus_setup_intr(dev, sc->irq, INTR_MPSAFE, ep_intr, - sc, &sc->ep_intrhand, ifp->if_serializer); - if (error) { - device_printf(dev, "bus_setup_intr() failed! (%d)\n", error); - goto bad; - } - - return (0); -bad: - ep_free(dev); - return (error); -} - -static device_method_t ep_isa_methods[] = { - /* Device interface */ - DEVMETHOD(device_identify, ep_isa_identify), - DEVMETHOD(device_probe, ep_isa_probe), - DEVMETHOD(device_attach, ep_isa_attach), - - DEVMETHOD_END -}; - -static driver_t ep_isa_driver = { - "ep", - ep_isa_methods, - sizeof(struct ep_softc), -}; - -extern devclass_t ep_devclass; - -DRIVER_MODULE(if_ep, isa, ep_isa_driver, ep_devclass, NULL, NULL); diff --git a/sys/dev/netif/ex/if_ex_isa.c b/sys/dev/netif/ex/if_ex_isa.c deleted file mode 100644 index 6b8918bd07..0000000000 --- a/sys/dev/netif/ex/if_ex_isa.c +++ /dev/null @@ -1,296 +0,0 @@ -/*- - * Copyright (c) 2000 Matthew N. Dodd - * 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, 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD: src/sys/dev/ex/if_ex_isa.c,v 1.3.2.1 2001/03/05 05:33:20 imp Exp $ - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include -#include -#include -#include - -#include -#include - -#include "if_exreg.h" -#include "if_exvar.h" - -/* Bus Front End Functions */ -static int ex_isa_identify (driver_t *, device_t); -static int ex_isa_probe (device_t); -static int ex_isa_attach (device_t); - -/* - * We need an identify function to 'probe' the ISA bus. - */ -static device_method_t ex_methods[] = { - /* Device interface */ - DEVMETHOD(device_identify, ex_isa_identify), - DEVMETHOD(device_probe, ex_isa_probe), - DEVMETHOD(device_attach, ex_isa_attach), - - DEVMETHOD_END -}; - -static driver_t ex_driver = { - "ex", - ex_methods, - sizeof(struct ex_softc), -}; - -devclass_t ex_devclass; - -DRIVER_MODULE(if_ex, isa, ex_driver, ex_devclass, NULL, NULL); - -static struct isa_pnp_id ex_ids[] = { - { 0x3110d425, NULL }, /* INT1031 */ - { 0x3010d425, NULL }, /* INT1030 */ - { 0, NULL }, -}; - -/* - * Non-destructive identify. - */ -static int -ex_isa_identify (driver_t *driver, device_t parent) -{ - device_t child; - u_int32_t ioport; - u_char enaddr[6]; - u_int irq; - int tmp; - int count; - const char * desc; - - /* - * Rescanning ISA I/O ports is not supported. - */ - if (device_get_state(parent) == DS_ATTACHED) - return (0); - - if (bootverbose) - kprintf("ex_isa_identify()\n"); - - count = 0; - for (ioport = 0x200; ioport < 0x3a0; ioport += 0x10) { - - /* No board found at address */ - if (!look_for_card(ioport)) { - continue; - } - - if (bootverbose) - kprintf("ex: Found card at 0x%03x!\n", ioport); - - /* Board in PnP mode */ - if (eeprom_read(ioport, EE_W0) & EE_W0_PNP) { - /* Reset the card. */ - outb(ioport + CMD_REG, Reset_CMD); - DELAY(500); - if (bootverbose) - kprintf("ex: card at 0x%03x in PnP mode!\n", ioport); - continue; - } - - bzero(enaddr, sizeof(enaddr)); - - /* Reset the card. */ - outb(ioport + CMD_REG, Reset_CMD); - DELAY(400); - - ex_get_address(ioport, enaddr); - tmp = eeprom_read(ioport, EE_W1) & EE_W1_INT_SEL; - - /* work out which set of irq <-> internal tables to use */ - if (ex_card_type(enaddr) == CARD_TYPE_EX_10_PLUS) { - irq = plus_ee2irqmap[tmp]; - desc = "Intel Pro/10+"; - } else { - irq = ee2irqmap[tmp]; - desc = "Intel Pro/10"; - } - - child = BUS_ADD_CHILD(parent, parent, - ISA_ORDER_SPECULATIVE, "ex", -1); - device_set_desc_copy(child, desc); - device_set_driver(child, driver); - bus_set_resource(child, SYS_RES_IRQ, 0, irq, 1, - machintr_legacy_intr_cpuid(irq)); - bus_set_resource(child, SYS_RES_IOPORT, 0, ioport, EX_IOSIZE, -1); - ++count; - - if (bootverbose) - kprintf("ex: Adding board at 0x%03x, irq %d\n", ioport, irq); - } - return (count ? 0 : ENXIO); -} - -static int -ex_isa_probe(device_t dev) -{ - u_int iobase; - u_int irq; - u_char * ee2irq; - u_char enaddr[6]; - int tmp; - int error; - - /* Check isapnp ids */ - error = ISA_PNP_PROBE(device_get_parent(dev), dev, ex_ids); - - /* If the card had a PnP ID that didn't match any we know about */ - if (error == ENXIO) { - return(error); - } - - /* If we had some other problem. */ - if (!(error == 0 || error == ENOENT)) { - return(error); - } - - iobase = bus_get_resource_start(dev, SYS_RES_IOPORT, 0); - if (!iobase) { - kprintf("ex: no iobase?\n"); - return(ENXIO); - } - - if (!look_for_card(iobase)) { - kprintf("ex: no card found at 0x%03x\n", iobase); - return(ENXIO); - } - - if (bootverbose) - kprintf("ex: ex_isa_probe() found card at 0x%03x\n", iobase); - - /* - * Reset the card. - */ - outb(iobase + CMD_REG, Reset_CMD); - DELAY(800); - - ex_get_address(iobase, enaddr); - - /* work out which set of irq <-> internal tables to use */ - if (ex_card_type(enaddr) == CARD_TYPE_EX_10_PLUS) - ee2irq = plus_ee2irqmap; - else - ee2irq = ee2irqmap; - - tmp = eeprom_read(iobase, EE_W1) & EE_W1_INT_SEL; - irq = bus_get_resource_start(dev, SYS_RES_IRQ, 0); - - if (irq > 0) { - /* This will happen if board is in PnP mode. */ - if (ee2irq[tmp] != irq) { - kprintf("ex: WARNING: board's EEPROM is configured" - " for IRQ %d, using %d\n", - ee2irq[tmp], irq); - } - } else { - irq = ee2irq[tmp]; - bus_set_resource(dev, SYS_RES_IRQ, 0, irq, 1, - machintr_legacy_intr_cpuid(irq)); - } - - if (irq == 0) { - kprintf("ex: invalid IRQ.\n"); - return(ENXIO); - } - - return(0); -} - -static int -ex_isa_attach(device_t dev) -{ - struct ex_softc * sc = device_get_softc(dev); - struct ifnet * ifp = &sc->arpcom.ac_if; - int error = 0; - u_int16_t temp; - - sc->dev = dev; - sc->ioport_rid = 0; - sc->irq_rid = 0; - - if ((error = ex_alloc_resources(dev)) != 0) { - device_printf(dev, "ex_alloc_resources() failed!\n"); - goto bad; - } - - /* - * Fill in several fields of the softc structure: - * - I/O base address. - * - Hardware Ethernet address. - * - IRQ number (if not supplied in config file, read it from EEPROM). - * - Connector type. - */ - sc->iobase = rman_get_start(sc->ioport); - sc->irq_no = rman_get_start(sc->irq); - - ex_get_address(sc->iobase, sc->arpcom.ac_enaddr); - - temp = eeprom_read(sc->iobase, EE_W0); - device_printf(sc->dev, "%s config, %s bus, ", - (temp & EE_W0_PNP) ? "PnP" : "Manual", - (temp & EE_W0_BUS16) ? "16-bit" : "8-bit"); - - temp = eeprom_read(sc->iobase, EE_W6); - kprintf("board id 0x%03x, stepping 0x%01x\n", - (temp & EE_W6_BOARD_MASK) >> EE_W6_BOARD_SHIFT, - temp & EE_W6_STEP_MASK); - - if ((error = ex_attach(dev)) != 0) { - device_printf(dev, "ex_attach() failed!\n"); - goto bad; - } - - ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->irq)); - - error = bus_setup_intr(dev, sc->irq, INTR_MPSAFE, - ex_intr, (void *)sc, &sc->ih, - ifp->if_serializer); - if (error) { - device_printf(dev, "bus_setup_intr() failed!\n"); - goto bad; - } - - return(0); -bad: - ex_release_resources(dev); - return (error); -} diff --git a/sys/dev/netif/ex/if_ex_pccard.c b/sys/dev/netif/ex/if_ex_pccard.c index 66454cd1eb..700a61f61c 100644 --- a/sys/dev/netif/ex/if_ex_pccard.c +++ b/sys/dev/netif/ex/if_ex_pccard.c @@ -79,7 +79,7 @@ static driver_t ex_pccard_driver = { sizeof(struct ex_softc), }; -extern devclass_t ex_devclass; +devclass_t ex_devclass; DRIVER_MODULE(if_ex, pccard, ex_pccard_driver, ex_devclass, NULL, NULL); diff --git a/sys/dev/netif/fe/if_fe_isa.c b/sys/dev/netif/fe/if_fe_isa.c deleted file mode 100644 index b447e4bf19..0000000000 --- a/sys/dev/netif/fe/if_fe_isa.c +++ /dev/null @@ -1,1059 +0,0 @@ -/* - * All Rights Reserved, Copyright (C) Fujitsu Limited 1995 - * - * This software may be used, modified, copied, distributed, and sold, in - * both source and binary form provided that the above copyright, these - * terms and the following disclaimer are retained. The name of the author - * and/or the contributor may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND THE CONTRIBUTOR ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR THE CONTRIBUTOR BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION. - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD: src/sys/dev/fe/if_fe_isa.c,v 1.2.2.1 2000/09/22 10:01:47 nyan Exp $ - */ - -#include "opt_fe.h" -#include "opt_inet.h" -#include "opt_ipx.h" - -#include -#include -#include -#include -#include -#include -#include - -#include - -#include -#include -#include -#include - -#include -#include - -#include "mb86960.h" -#include "if_fereg.h" -#include "if_fevar.h" - -#include - -/* - * ISA specific code. - */ -static int fe_isa_probe(device_t); -static int fe_isa_attach(device_t); - -static device_method_t fe_isa_methods[] = { - /* Device interface */ - DEVMETHOD(device_probe, fe_isa_probe), - DEVMETHOD(device_attach, fe_isa_attach), - - DEVMETHOD_END -}; - -static driver_t fe_isa_driver = { - "fe", - fe_isa_methods, - sizeof (struct fe_softc) -}; - -DRIVER_MODULE(if_fe, isa, fe_isa_driver, fe_devclass, NULL, NULL); - - -static int fe_probe_ssi(device_t); -static int fe_probe_jli(device_t); -static int fe_probe_fmv(device_t); -static int fe_probe_lnx(device_t); -static int fe_probe_gwy(device_t); -static int fe_probe_ubn(device_t); - -/* - * Determine if the device is present at a specified I/O address. The - * main entry to the driver. - */ -static int -fe_isa_probe(device_t dev) -{ - struct fe_softc *sc; - int error; - - /* Check isapnp ids */ - if (isa_get_vendorid(dev)) - return (ENXIO); - - /* Prepare for the softc struct. */ - sc = device_get_softc(dev); - sc->sc_unit = device_get_unit(dev); - - /* Probe for supported boards. */ - if ((error = fe_probe_ssi(dev)) == 0) - goto end; - fe_release_resource(dev); - - if ((error = fe_probe_jli(dev)) == 0) - goto end; - fe_release_resource(dev); - - if ((error = fe_probe_fmv(dev)) == 0) - goto end; - fe_release_resource(dev); - - if ((error = fe_probe_lnx(dev)) == 0) - goto end; - fe_release_resource(dev); - - if ((error = fe_probe_ubn(dev)) == 0) - goto end; - fe_release_resource(dev); - - if ((error = fe_probe_gwy(dev)) == 0) - goto end; - fe_release_resource(dev); - -end: - if (error == 0) - error = fe_alloc_irq(dev, 0); - - fe_release_resource(dev); - return (error); -} - -static int -fe_isa_attach(device_t dev) -{ - struct fe_softc *sc = device_get_softc(dev); - - if (sc->port_used) - fe_alloc_port(dev, sc->port_used); - fe_alloc_irq(dev, 0); - - return fe_attach(dev); -} - - -/* - * Probe and initialization for Fujitsu FMV-180 series boards - */ - -static void -fe_init_fmv(struct fe_softc *sc) -{ - /* Initialize ASIC. */ - fe_outb(sc, FE_FMV3, 0); - fe_outb(sc, FE_FMV10, 0); - -#if 0 - /* "Refresh" hardware configuration. FIXME. */ - fe_outb(sc, FE_FMV2, fe_inb(sc, FE_FMV2)); -#endif - - /* Turn the "master interrupt control" flag of ASIC on. */ - fe_outb(sc, FE_FMV3, FE_FMV3_IRQENB); -} - -static void -fe_msel_fmv184(struct fe_softc *sc) -{ - u_char port; - - /* FMV-184 has a special "register" to switch between AUI/BNC. - Determine the value to write into the register, based on the - user-specified media selection. */ - port = (IFM_SUBTYPE(sc->media.ifm_media) == IFM_10_2) ? 0x00 : 0x01; - - /* The register is #5 on exntesion register bank... - (Details of the register layout is not yet discovered.) */ - fe_outb(sc, 0x1B, 0x46); /* ??? */ - fe_outb(sc, 0x1E, 0x04); /* select ex-reg #4. */ - fe_outb(sc, 0x1F, 0xC8); /* ??? */ - fe_outb(sc, 0x1E, 0x05); /* select ex-reg #5. */ - fe_outb(sc, 0x1F, port); /* Switch the media. */ - fe_outb(sc, 0x1E, 0x04); /* select ex-reg #4. */ - fe_outb(sc, 0x1F, 0x00); /* ??? */ - fe_outb(sc, 0x1B, 0x00); /* ??? */ - - /* Make sure to select "external tranceiver" on MB86964. */ - fe_outb(sc, FE_BMPR13, sc->proto_bmpr13 | FE_B13_PORT_AUI); -} - -static int -fe_probe_fmv(device_t dev) -{ - struct fe_softc *sc = device_get_softc(dev); - int n; - u_long iobase, irq; - - static u_short const irqmap [ 4 ] = { 3, 7, 10, 15 }; - - static struct fe_simple_probe_struct const probe_table [] = { - { FE_DLCR2, 0x71, 0x00 }, - { FE_DLCR4, 0x08, 0x00 }, - - { FE_FMV0, 0x78, 0x50 }, /* ERRDY+PRRDY */ - { FE_FMV1, 0xB0, 0x00 }, /* FMV-183/4 has 0x48 bits. */ - { FE_FMV3, 0x7F, 0x00 }, - - { 0 } - }; - - /* Board subtypes; it lists known FMV-180 variants. */ - struct subtype { - u_short mcode; - u_short mbitmap; - u_short defmedia; - char const * str; - }; - static struct subtype const typelist [] = { - { 0x0005, MB_HA|MB_HT|MB_H5, MB_HA, "FMV-181" }, - { 0x0105, MB_HA|MB_HT|MB_H5, MB_HA, "FMV-181A" }, - { 0x0003, MB_HM, MB_HM, "FMV-182" }, - { 0x0103, MB_HM, MB_HM, "FMV-182A" }, - { 0x0804, MB_HT, MB_HT, "FMV-183" }, - { 0x0C04, MB_HT, MB_HT, "FMV-183 (on-board)" }, - { 0x0803, MB_H2|MB_H5, MB_H2, "FMV-184" }, - { 0, MB_HA, MB_HA, "unknown FMV-180 (?)" }, - }; - struct subtype const * type; - - /* Media indicator and "Hardware revision ID" */ - u_short mcode; - - /* See if the specified address is possible for FMV-180 - series. 220, 240, 260, 280, 2A0, 2C0, 300, and 340 are - allowed for all boards, and 200, 2E0, 320, 360, 380, 3A0, - 3C0, and 3E0 for PnP boards. */ - if (bus_get_resource(dev, SYS_RES_IOPORT, 0, &iobase, NULL) != 0) - return ENXIO; - if ((iobase & ~0x1E0) != 0x200) - return ENXIO; - - /* FMV-180 occupies 32 I/O addresses. */ - if (fe_alloc_port(dev, 32)) - return ENXIO; - - /* Setup an I/O address mapping table and some others. */ - fe_softc_defaults(sc); - - /* Simple probe. */ - if (!fe_simple_probe(sc, probe_table)) - return ENXIO; - - /* Get our station address from EEPROM, and make sure it is - Fujitsu's. */ - fe_inblk(sc, FE_FMV4, sc->sc_enaddr, ETHER_ADDR_LEN); - if (!valid_Ether_p(sc->sc_enaddr, 0x00000E)) - return ENXIO; - - /* Find the supported media and "hardware revision" to know - the model identification. */ - mcode = (fe_inb(sc, FE_FMV0) & FE_FMV0_MEDIA) - | ((fe_inb(sc, FE_FMV1) & FE_FMV1_REV) << 8); - - /* Determine the card type. */ - for (type = typelist; type->mcode != 0; type++) { - if (type->mcode == mcode) - break; - } - if (type->mcode == 0) { - /* Unknown card type... Hope the driver works. */ - sc->stability |= UNSTABLE_TYPE; - if (bootverbose) { - device_printf(dev, "unknown config: %x-%x-%x-%x\n", - fe_inb(sc, FE_FMV0), - fe_inb(sc, FE_FMV1), - fe_inb(sc, FE_FMV2), - fe_inb(sc, FE_FMV3)); - } - } - - /* Setup the board type and media information. */ - sc->type = FE_TYPE_FMV; - sc->typestr = type->str; - sc->mbitmap = type->mbitmap; - sc->defmedia = type->defmedia; - sc->msel = fe_msel_965; - - if (type->mbitmap == (MB_H2 | MB_H5)) { - /* FMV184 requires a special media selection procedure. */ - sc->msel = fe_msel_fmv184; - } - - /* - * An FMV-180 has been probed. - * Determine which IRQ to be used. - * - * In this version, we give a priority to the kernel config file. - * If the EEPROM and config don't match, say it to the user for - * an attention. - */ - n = (fe_inb(sc, FE_FMV2) & FE_FMV2_IRS) >> FE_FMV2_IRS_SHIFT; - - irq = 0; - bus_get_resource(dev, SYS_RES_IRQ, 0, &irq, NULL); - if (irq == NO_IRQ) { - int intr = irqmap[n]; - - /* Just use the probed value. */ - bus_set_resource(dev, SYS_RES_IRQ, 0, intr, 1, - machintr_legacy_intr_cpuid(intr)); - } else if (irq != irqmap[n]) { - /* Don't match. */ - sc->stability |= UNSTABLE_IRQ; - } - - /* We need an init hook to initialize ASIC before we start. */ - sc->init = fe_init_fmv; - - return 0; -} - -/* - * Fujitsu MB86965 JLI mode probe routines. - * - * 86965 has a special operating mode called JLI (mode 0), under which - * the chip interfaces with ISA bus with a software-programmable - * configuration. (The Fujitsu document calls the feature "Plug and - * play," but it is not compatible with the ISA-PnP spec. designed by - * Intel and Microsoft.) Ethernet cards designed to use JLI are - * almost same, but there are two things which require board-specific - * probe routines: EEPROM layout and IRQ pin connection. - * - * JLI provides a handy way to access EEPROM which should contains the - * chip configuration information (such as I/O port address) as well - * as Ethernet station (MAC) address. The chip configuration info. is - * stored on a fixed location. However, the station address can be - * located anywhere in the EEPROM; it is up to the board designer to - * determine the location. (The manual just says "somewhere in the - * EEPROM.") The fe driver must somehow find out the correct - * location. - * - * Another problem resides in the IRQ pin connection. JLI provides a - * user to choose an IRQ from up to four predefined IRQs. The 86965 - * chip has a register to select one out of the four possibilities. - * However, the selection is against the four IRQ pins on the chip. - * (So-called IRQ-A, -B, -C and -D.) It is (again) up to the board - * designer to determine which pin to connect which IRQ line on the - * ISA bus. We need a vendor (or model, for some vendor) specific IRQ - * mapping table. - * - * The routine fe_probe_jli() provides all probe and initialization - * processes which are common to all JLI implementation, and sub-probe - * routines supply board-specific actions. - * - * JLI sub-probe routine has the following template: - * - * u_short const * func (struct fe_softc * sc, u_char const * eeprom); - * - * where eeprom is a pointer to an array of 32 byte data read from the - * config EEPROM on the board. It retuns an IRQ mapping table for the - * board, when the corresponding implementation is detected. It - * returns a NULL otherwise. - * - * Primary purpose of the functin is to analize the config EEPROM, - * determine if it matches with the pattern of that of supported card, - * and extract necessary information from it. One of the information - * expected to be extracted from EEPROM is the Ethernet station (MAC) - * address, which must be set to the softc table of the interface by - * the board-specific routine. - */ - -/* JLI sub-probe for Allied-Telesyn/Allied-Telesis AT1700/RE2000 series. */ -static u_short const * -fe_probe_jli_ati(struct fe_softc * sc, u_char const * eeprom) -{ - int i; - static u_short const irqmaps_ati [4][4] = - { - { 3, 4, 5, 9 }, - { 10, 11, 12, 15 }, - { 3, 11, 5, 15 }, - { 10, 11, 14, 15 }, - }; - - /* Make sure the EEPROM contains Allied-Telesis/Allied-Telesyn - bit pattern. */ - if (eeprom[1] != 0x00) return NULL; - for (i = 2; i < 8; i++) if (eeprom[i] != 0xFF) return NULL; - for (i = 14; i < 24; i++) if (eeprom[i] != 0xFF) return NULL; - - /* Get our station address from EEPROM, and make sure the - EEPROM contains ATI's address. */ - bcopy(eeprom + 8, sc->sc_enaddr, ETHER_ADDR_LEN); - if (!valid_Ether_p(sc->sc_enaddr, 0x0000F4)) - return NULL; - - /* - * The following model identification codes are stolen - * from the NetBSD port of the fe driver. My reviewers - * suggested minor revision. - */ - - /* Determine the card type. */ - switch (eeprom[FE_ATI_EEP_MODEL]) { - case FE_ATI_MODEL_AT1700T: - sc->typestr = "AT-1700T/RE2001"; - sc->mbitmap = MB_HT; - sc->defmedia = MB_HT; - break; - case FE_ATI_MODEL_AT1700BT: - sc->typestr = "AT-1700BT/RE2003"; - sc->mbitmap = MB_HA | MB_HT | MB_H2; - break; - case FE_ATI_MODEL_AT1700FT: - sc->typestr = "AT-1700FT/RE2009"; - sc->mbitmap = MB_HA | MB_HT | MB_HF; - break; - case FE_ATI_MODEL_AT1700AT: - sc->typestr = "AT-1700AT/RE2005"; - sc->mbitmap = MB_HA | MB_HT | MB_H5; - break; - default: - sc->typestr = "unknown AT-1700/RE2000"; - sc->stability |= UNSTABLE_TYPE | UNSTABLE_IRQ; - break; - } - sc->type = FE_TYPE_JLI; - -#if 0 - /* Should we extract default media from eeprom? Linux driver - for AT1700 does it, although previous releases of FreeBSD - don't. FIXME. */ - /* Determine the default media selection from the config - EEPROM. The byte at offset EEP_MEDIA is believed to - contain BMPR13 value to be set. We just ignore STP bit or - squelch bit, since we don't support those. (It is - intentional.) */ - switch (eeprom[FE_ATI_EEP_MEDIA] & FE_B13_PORT) { - case FE_B13_AUTO: - sc->defmedia = MB_HA; - break; - case FE_B13_TP: - sc->defmedia = MB_HT; - break; - case FE_B13_AUI: - sc->defmedia = sc->mbitmap & (MB_H2|MB_H5|MB_H5); /*XXX*/ - break; - default: - sc->defmedia = MB_HA; - break; - } - - /* Make sure the default media is compatible with the supported - ones. */ - if ((sc->defmedia & sc->mbitmap) == 0) { - if (sc->defmedia == MB_HA) { - sc->defmedia = MB_HT; - } else { - sc->defmedia = MB_HA; - } - } -#endif - - /* - * Try to determine IRQ settings. - * Different models use different ranges of IRQs. - */ - switch ((eeprom[FE_ATI_EEP_REVISION] & 0xf0) - |(eeprom[FE_ATI_EEP_MAGIC] & 0x04)) { - case 0x30: case 0x34: return irqmaps_ati[3]; - case 0x10: case 0x14: - case 0x50: case 0x54: return irqmaps_ati[2]; - case 0x44: case 0x64: return irqmaps_ati[1]; - default: return irqmaps_ati[0]; - } -} - -/* JLI sub-probe and msel hook for ICL Ethernet. */ -static void -fe_msel_icl(struct fe_softc *sc) -{ - u_char d4; - - /* Switch between UTP and "external tranceiver" as always. */ - fe_msel_965(sc); - - /* The board needs one more bit (on DLCR4) be set appropriately. */ - if (IFM_SUBTYPE(sc->media.ifm_media) == IFM_10_5) { - d4 = sc->proto_dlcr4 | FE_D4_CNTRL; - } else { - d4 = sc->proto_dlcr4 & ~FE_D4_CNTRL; - } - fe_outb(sc, FE_DLCR4, d4); -} - -static u_short const * -fe_probe_jli_icl(struct fe_softc * sc, u_char const * eeprom) -{ - int i; - u_short defmedia; - u_char d6; - static u_short const irqmap_icl [4] = { 9, 10, 5, 15 }; - - /* Make sure the EEPROM contains ICL bit pattern. */ - for (i = 24; i < 39; i++) { - if (eeprom[i] != 0x20 && (eeprom[i] & 0xF0) != 0x30) return NULL; - } - for (i = 112; i < 122; i++) { - if (eeprom[i] != 0x20 && (eeprom[i] & 0xF0) != 0x30) return NULL; - } - - /* Make sure the EEPROM contains ICL's permanent station - address. If it isn't, probably this board is not an - ICL's. */ - if (!valid_Ether_p(eeprom+122, 0x00004B)) - return NULL; - - /* Check if the "configured" Ethernet address in the EEPROM is - valid. Use it if it is, or use the "permanent" address instead. */ - if (valid_Ether_p(eeprom+4, 0x020000)) { - /* The configured address is valid. Use it. */ - bcopy(eeprom+4, sc->sc_enaddr, ETHER_ADDR_LEN); - } else { - /* The configured address is invalid. Use permanent. */ - bcopy(eeprom+122, sc->sc_enaddr, ETHER_ADDR_LEN); - } - - /* Determine model and supported media. */ - switch (eeprom[0x5E]) { - case 0: - sc->typestr = "EtherTeam16i/COMBO"; - sc->mbitmap = MB_HA | MB_HT | MB_H5 | MB_H2; - break; - case 1: - sc->typestr = "EtherTeam16i/TP"; - sc->mbitmap = MB_HT; - break; - case 2: - sc->typestr = "EtherTeam16i/ErgoPro"; - sc->mbitmap = MB_HA | MB_HT | MB_H5; - break; - case 4: - sc->typestr = "EtherTeam16i/DUO"; - sc->mbitmap = MB_HA | MB_HT | MB_H2; - break; - default: - sc->typestr = "EtherTeam16i"; - sc->stability |= UNSTABLE_TYPE; - if (bootverbose) { - kprintf("fe%d: unknown model code %02x for EtherTeam16i\n", - sc->sc_unit, eeprom[0x5E]); - } - break; - } - sc->type = FE_TYPE_JLI; - - /* I'm not sure the following msel hook is required by all - models or COMBO only... FIXME. */ - sc->msel = fe_msel_icl; - - /* Make the configured media selection the default media. */ - switch (eeprom[0x28]) { - case 0: defmedia = MB_HA; break; - case 1: defmedia = MB_H5; break; - case 2: defmedia = MB_HT; break; - case 3: defmedia = MB_H2; break; - default: - if (bootverbose) { - kprintf("fe%d: unknown default media: %02x\n", - sc->sc_unit, eeprom[0x28]); - } - defmedia = MB_HA; - break; - } - - /* Make sure the default media is compatible with the - supported media. */ - if ((defmedia & sc->mbitmap) == 0) { - if (bootverbose) { - kprintf("fe%d: default media adjusted\n", sc->sc_unit); - } - defmedia = sc->mbitmap; - } - - /* Keep the determined default media. */ - sc->defmedia = defmedia; - - /* ICL has "fat" models. We have to program 86965 to properly - reflect the hardware. */ - d6 = sc->proto_dlcr6 & ~(FE_D6_BUFSIZ | FE_D6_BBW); - switch ((eeprom[0x61] << 8) | eeprom[0x60]) { - case 0x2008: d6 |= FE_D6_BUFSIZ_32KB | FE_D6_BBW_BYTE; break; - case 0x4010: d6 |= FE_D6_BUFSIZ_64KB | FE_D6_BBW_WORD; break; - default: - /* We can't support it, since we don't know which bits - to set in DLCR6. */ - kprintf("fe%d: unknown SRAM config for ICL\n", sc->sc_unit); - return NULL; - } - sc->proto_dlcr6 = d6; - - /* Returns the IRQ table for the ICL board. */ - return irqmap_icl; -} - -/* JLI sub-probe for RATOC REX-5586/5587. */ -static u_short const * -fe_probe_jli_rex(struct fe_softc * sc, u_char const * eeprom) -{ - int i; - static u_short const irqmap_rex [4] = { 3, 4, 5, NO_IRQ }; - - /* Make sure the EEPROM contains RATOC's config pattern. */ - if (eeprom[1] != eeprom[0]) return NULL; - for (i = 8; i < 32; i++) if (eeprom[i] != 0xFF) return NULL; - - /* Get our station address from EEPROM. Note that RATOC - stores it "byte-swapped" in each word. (I don't know why.) - So, we just can't use bcopy().*/ - sc->sc_enaddr[0] = eeprom[3]; - sc->sc_enaddr[1] = eeprom[2]; - sc->sc_enaddr[2] = eeprom[5]; - sc->sc_enaddr[3] = eeprom[4]; - sc->sc_enaddr[4] = eeprom[7]; - sc->sc_enaddr[5] = eeprom[6]; - - /* Make sure the EEPROM contains RATOC's station address. */ - if (!valid_Ether_p(sc->sc_enaddr, 0x00C0D0)) - return NULL; - - /* I don't know any sub-model identification. */ - sc->type = FE_TYPE_JLI; - sc->typestr = "REX-5586/5587"; - - /* Returns the IRQ for the RATOC board. */ - return irqmap_rex; -} - -/* JLI sub-probe for Unknown board. */ -static u_short const * -fe_probe_jli_unk(struct fe_softc * sc, u_char const * eeprom) -{ - int i, n, romsize; - static u_short const irqmap [4] = { NO_IRQ, NO_IRQ, NO_IRQ, NO_IRQ }; - - /* The generic JLI probe considered this board has an 86965 - in JLI mode, but any other board-specific routines could - not find the matching implementation. So, we "guess" the - location by looking for a bit pattern which looks like a - MAC address. */ - - /* Determine how large the EEPROM is. */ - for (romsize = JLI_EEPROM_SIZE/2; romsize > 16; romsize >>= 1) { - for (i = 0; i < romsize; i++) { - if (eeprom[i] != eeprom[i+romsize]) - break; - } - if (i < romsize) - break; - } - romsize <<= 1; - - /* Look for a bit pattern which looks like a MAC address. */ - for (n = 2; n <= romsize - ETHER_ADDR_LEN; n += 2) { - if (!valid_Ether_p(eeprom + n, 0x000000)) - continue; - } - - /* If no reasonable address was found, we can't go further. */ - if (n > romsize - ETHER_ADDR_LEN) - return NULL; - - /* Extract our (guessed) station address. */ - bcopy(eeprom+n, sc->sc_enaddr, ETHER_ADDR_LEN); - - /* We are not sure what type of board it is... */ - sc->type = FE_TYPE_JLI; - sc->typestr = "(unknown JLI)"; - sc->stability |= UNSTABLE_TYPE | UNSTABLE_MAC; - - /* Returns the totally unknown IRQ mapping table. */ - return irqmap; -} - -/* - * Probe and initialization for all JLI implementations. - */ - -static int -fe_probe_jli(device_t dev) -{ - struct fe_softc *sc = device_get_softc(dev); - int i, n, error, xirq; - u_long iobase, irq; - u_char eeprom [JLI_EEPROM_SIZE]; - u_short const * irqmap; - - static u_short const baseaddr [8] = - { 0x260, 0x280, 0x2A0, 0x240, 0x340, 0x320, 0x380, 0x300 }; - static struct fe_simple_probe_struct const probe_table [] = { - { FE_DLCR1, 0x20, 0x00 }, - { FE_DLCR2, 0x50, 0x00 }, - { FE_DLCR4, 0x08, 0x00 }, - { FE_DLCR5, 0x80, 0x00 }, -#if 0 - { FE_BMPR16, 0x1B, 0x00 }, - { FE_BMPR17, 0x7F, 0x00 }, -#endif - { 0 } - }; - - /* - * See if the specified address is possible for MB86965A JLI mode. - */ - if (bus_get_resource(dev, SYS_RES_IOPORT, 0, &iobase, NULL) != 0) - return ENXIO; - for (i = 0; i < 8; i++) { - if (baseaddr[i] == iobase) - break; - } - if (i == 8) - return ENXIO; - - /* 86965 JLI occupies 32 I/O addresses. */ - if (fe_alloc_port(dev, 32)) - return ENXIO; - - /* Fill the softc struct with reasonable default. */ - fe_softc_defaults(sc); - - /* - * We should test if MB86965A is on the base address now. - * Unfortunately, it is very hard to probe it reliably, since - * we have no way to reset the chip under software control. - * On cold boot, we could check the "signature" bit patterns - * described in the Fujitsu document. On warm boot, however, - * we can predict almost nothing about register values. - */ - if (!fe_simple_probe(sc, probe_table)) - return ENXIO; - - /* Check if our I/O address matches config info on 86965. */ - n = (fe_inb(sc, FE_BMPR19) & FE_B19_ADDR) >> FE_B19_ADDR_SHIFT; - if (baseaddr[n] != iobase) - return ENXIO; - - /* - * We are now almost sure we have an MB86965 at the given - * address. So, read EEPROM through it. We have to write - * into LSI registers to read from EEPROM. I want to avoid it - * at this stage, but I cannot test the presence of the chip - * any further without reading EEPROM. FIXME. - */ - fe_read_eeprom_jli(sc, eeprom); - - /* Make sure that config info in EEPROM and 86965 agree. */ - if (eeprom[FE_EEPROM_CONF] != fe_inb(sc, FE_BMPR19)) - return ENXIO; - - /* Use 86965 media selection scheme, unless othewise - specified. It is "AUTO always" and "select with BMPR13." - This behaviour covers most of the 86965 based board (as - minimum requirements.) It is backward compatible with - previous versions, also. */ - sc->mbitmap = MB_HA; - sc->defmedia = MB_HA; - sc->msel = fe_msel_965; - - /* Perform board-specific probe, one by one. Note that the - order of probe is important and should not be changed - arbitrarily. */ - if ((irqmap = fe_probe_jli_ati(sc, eeprom)) == NULL - && (irqmap = fe_probe_jli_rex(sc, eeprom)) == NULL - && (irqmap = fe_probe_jli_icl(sc, eeprom)) == NULL - && (irqmap = fe_probe_jli_unk(sc, eeprom)) == NULL) - return ENXIO; - - /* Find the IRQ read from EEPROM. */ - n = (fe_inb(sc, FE_BMPR19) & FE_B19_IRQ) >> FE_B19_IRQ_SHIFT; - xirq = irqmap[n]; - - /* Try to determine IRQ setting. */ - error = bus_get_resource(dev, SYS_RES_IRQ, 0, &irq, NULL); - if (error && xirq == NO_IRQ) { - /* The device must be configured with an explicit IRQ. */ - device_printf(dev, "IRQ auto-detection does not work\n"); - return ENXIO; - } else if (error && xirq != NO_IRQ) { - /* Just use the probed IRQ value. */ - bus_set_resource(dev, SYS_RES_IRQ, 0, xirq, 1, - machintr_legacy_intr_cpuid(xirq)); - } else if (!error && xirq == NO_IRQ) { - /* No problem. Go ahead. */ - } else if (irq == xirq) { - /* Good. Go ahead. */ - } else { - /* User must be warned in this case. */ - sc->stability |= UNSTABLE_IRQ; - } - - /* Setup a hook, which resets te 86965 when the driver is being - initialized. This may solve a nasty bug. FIXME. */ - sc->init = fe_init_jli; - - return 0; -} - -/* Probe for TDK LAK-AX031, which is an SSi 78Q8377A based board. */ -static int -fe_probe_ssi(device_t dev) -{ - struct fe_softc *sc = device_get_softc(dev); - u_long iobase, irq; - - u_char eeprom [SSI_EEPROM_SIZE]; - static struct fe_simple_probe_struct probe_table [] = { - { FE_DLCR2, 0x08, 0x00 }, - { FE_DLCR4, 0x08, 0x00 }, - { 0 } - }; - - /* See if the specified I/O address is possible for 78Q8377A. */ - if (bus_get_resource(dev, SYS_RES_IOPORT, 0, &iobase, NULL) != 0) - return ENXIO; - if ((iobase & ~0x3F0) != 0x000) - return ENXIO; - - /* We have 16 registers. */ - if (fe_alloc_port(dev, 16)) - return ENXIO; - - /* Fill the softc struct with default values. */ - fe_softc_defaults(sc); - - /* See if the card is on its address. */ - if (!fe_simple_probe(sc, probe_table)) - return ENXIO; - - /* We now have to read the config EEPROM. We should be very - careful, since doing so destroys a register. (Remember, we - are not yet sure we have a LAK-AX031 board here.) Don't - remember to select BMPRs bofore reading EEPROM, since other - register bank may be selected before the probe() is called. */ - fe_read_eeprom_ssi(sc, eeprom); - - /* Make sure the Ethernet (MAC) station address is of TDK's. */ - if (!valid_Ether_p(eeprom+FE_SSI_EEP_ADDR, 0x008098)) - return ENXIO; - bcopy(eeprom + FE_SSI_EEP_ADDR, sc->sc_enaddr, ETHER_ADDR_LEN); - - /* This looks like a TDK-AX031 board. It requires an explicit - IRQ setting in config, since we currently don't know how we - can find the IRQ value assigned by ISA PnP manager. */ - if (bus_get_resource(dev, SYS_RES_IRQ, 0, &irq, NULL) != 0) { - fe_irq_failure("LAK-AX031", sc->sc_unit, NO_IRQ, NULL); - return ENXIO; - } - - /* Fill softc struct accordingly. */ - sc->type = FE_TYPE_SSI; - sc->typestr = "LAK-AX031"; - sc->mbitmap = MB_HT; - sc->defmedia = MB_HT; - - return 0; -} - -/* - * Probe and initialization for TDK/LANX LAC-AX012/013 boards. - */ -static int -fe_probe_lnx(device_t dev) -{ - struct fe_softc *sc = device_get_softc(dev); - u_long iobase, irq; - - u_char eeprom [LNX_EEPROM_SIZE]; - static struct fe_simple_probe_struct probe_table [] = { - { FE_DLCR2, 0x58, 0x00 }, - { FE_DLCR4, 0x08, 0x00 }, - { 0 } - }; - - /* See if the specified I/O address is possible for TDK/LANX boards. */ - /* 300, 320, 340, and 360 are allowed. */ - if (bus_get_resource(dev, SYS_RES_IOPORT, 0, &iobase, NULL) != 0) - return ENXIO; - if ((iobase & ~0x060) != 0x300) - return ENXIO; - - /* We have 32 registers. */ - if (fe_alloc_port(dev, 32)) - return ENXIO; - - /* Fill the softc struct with default values. */ - fe_softc_defaults(sc); - - /* See if the card is on its address. */ - if (!fe_simple_probe(sc, probe_table)) - return ENXIO; - - /* We now have to read the config EEPROM. We should be very - careful, since doing so destroys a register. (Remember, we - are not yet sure we have a LAC-AX012/AX013 board here.) */ - fe_read_eeprom_lnx(sc, eeprom); - - /* Make sure the Ethernet (MAC) station address is of TDK/LANX's. */ - if (!valid_Ether_p(eeprom, 0x008098)) - return ENXIO; - bcopy(eeprom, sc->sc_enaddr, ETHER_ADDR_LEN); - - /* This looks like a TDK/LANX board. It requires an - explicit IRQ setting in config. Make sure we have one, - determining an appropriate value for the IRQ control - register. */ - irq = 0; - bus_get_resource(dev, SYS_RES_IRQ, 0, &irq, NULL); - switch (irq) { - case 3: sc->priv_info = 0x40 | LNX_CLK_LO | LNX_SDA_HI; break; - case 4: sc->priv_info = 0x20 | LNX_CLK_LO | LNX_SDA_HI; break; - case 5: sc->priv_info = 0x10 | LNX_CLK_LO | LNX_SDA_HI; break; - case 9: sc->priv_info = 0x80 | LNX_CLK_LO | LNX_SDA_HI; break; - default: - fe_irq_failure("LAC-AX012/AX013", sc->sc_unit, irq, "3/4/5/9"); - return ENXIO; - } - - /* Fill softc struct accordingly. */ - sc->type = FE_TYPE_LNX; - sc->typestr = "LAC-AX012/AX013"; - sc->init = fe_init_lnx; - - return 0; -} - -/* - * Probe and initialization for Gateway Communications' old cards. - */ -static int -fe_probe_gwy(device_t dev) -{ - struct fe_softc *sc = device_get_softc(dev); - u_long iobase, irq; - - static struct fe_simple_probe_struct probe_table [] = { - /* { FE_DLCR2, 0x70, 0x00 }, */ - { FE_DLCR2, 0x58, 0x00 }, - { FE_DLCR4, 0x08, 0x00 }, - { 0 } - }; - - /* See if the specified I/O address is possible for Gateway boards. */ - if (bus_get_resource(dev, SYS_RES_IOPORT, 0, &iobase, NULL) != 0) - return ENXIO; - if ((iobase & ~0x1E0) != 0x200) - return ENXIO; - - /* That's all. The card occupies 32 I/O addresses, as always. */ - if (fe_alloc_port(dev, 32)) - return ENXIO; - - /* Setup an I/O address mapping table and some others. */ - fe_softc_defaults(sc); - - /* See if the card is on its address. */ - if (!fe_simple_probe(sc, probe_table)) - return ENXIO; - - /* Get our station address from EEPROM. */ - fe_inblk(sc, 0x18, sc->sc_enaddr, ETHER_ADDR_LEN); - - /* Make sure it is Gateway Communication's. */ - if (!valid_Ether_p(sc->sc_enaddr, 0x000061)) - return ENXIO; - - /* Gateway's board requires an explicit IRQ to work, since it - is not possible to probe the setting of jumpers. */ - if (bus_get_resource(dev, SYS_RES_IRQ, 0, &irq, NULL) != 0) { - fe_irq_failure("Gateway Ethernet", sc->sc_unit, NO_IRQ, NULL); - return ENXIO; - } - - /* Fill softc struct accordingly. */ - sc->type = FE_TYPE_GWY; - sc->typestr = "Gateway Ethernet (Fujitsu chipset)"; - - return 0; -} - -/* Probe and initialization for Ungermann-Bass Network - K.K. "Access/PC" boards. */ -static int -fe_probe_ubn(device_t dev) -{ - struct fe_softc *sc = device_get_softc(dev); - u_long iobase, irq; -#if 0 - u_char sum; -#endif - static struct fe_simple_probe_struct const probe_table [] = { - { FE_DLCR2, 0x58, 0x00 }, - { FE_DLCR4, 0x08, 0x00 }, - { 0 } - }; - - /* See if the specified I/O address is possible for AccessPC/ISA. */ - if (bus_get_resource(dev, SYS_RES_IOPORT, 0, &iobase, NULL) != 0) - return ENXIO; - if ((iobase & ~0x0E0) != 0x300) - return ENXIO; - - /* We have 32 registers. */ - if (fe_alloc_port(dev, 32)) - return ENXIO; - - /* Setup an I/O address mapping table and some others. */ - fe_softc_defaults(sc); - - /* Simple probe. */ - if (!fe_simple_probe(sc, probe_table)) - return ENXIO; - - /* Get our station address form ID ROM and make sure it is UBN's. */ - fe_inblk(sc, 0x18, sc->sc_enaddr, ETHER_ADDR_LEN); - if (!valid_Ether_p(sc->sc_enaddr, 0x00DD01)) - return ENXIO; -#if 0 - /* Calculate checksum. */ - sum = fe_inb(sc, 0x1e); - for (i = 0; i < ETHER_ADDR_LEN; i++) { - sum ^= sc->sc_enaddr[i]; - } - if (sum != 0) - return ENXIO; -#endif - /* This looks like an AccessPC/ISA board. It requires an - explicit IRQ setting in config. Make sure we have one, - determining an appropriate value for the IRQ control - register. */ - irq = 0; - bus_get_resource(dev, SYS_RES_IRQ, 0, &irq, NULL); - switch (irq) { - case 3: sc->priv_info = 0x02; break; - case 4: sc->priv_info = 0x04; break; - case 5: sc->priv_info = 0x08; break; - case 10: sc->priv_info = 0x10; break; - default: - fe_irq_failure("Access/PC", sc->sc_unit, irq, "3/4/5/10"); - return ENXIO; - } - - /* Fill softc struct accordingly. */ - sc->type = FE_TYPE_UBN; - sc->typestr = "Access/PC"; - sc->init = fe_init_ubn; - - return 0; -} diff --git a/sys/dev/netif/lnc/Makefile b/sys/dev/netif/lnc/Makefile index fef90c9c93..ee3e803d63 100644 --- a/sys/dev/netif/lnc/Makefile +++ b/sys/dev/netif/lnc/Makefile @@ -1,7 +1,5 @@ -# $DragonFly: src/sys/dev/netif/lnc/Makefile,v 1.3 2006/07/07 14:16:29 sephe Exp $ - KMOD = if_lnc -SRCS = lance.c if_lnc_isa.c if_lnc_pci.c am7990.c am79900.c -SRCS += device_if.h bus_if.h pci_if.h isa_if.h opt_inet.h - +SRCS = lance.c if_lnc_pci.c am7990.c am79900.c +SRCS += device_if.h bus_if.h pci_if.h opt_inet.h + .include diff --git a/sys/dev/netif/lnc/if_lnc_isa.c b/sys/dev/netif/lnc/if_lnc_isa.c deleted file mode 100644 index 82d3853427..0000000000 --- a/sys/dev/netif/lnc/if_lnc_isa.c +++ /dev/null @@ -1,514 +0,0 @@ -/* $NetBSD: if_le_isa.c,v 1.41 2005/12/24 20:27:41 perry Exp $ */ -/* $FreeBSD: src/sys/dev/le/if_le_isa.c,v 1.1 2006/05/17 21:25:22 marius Exp $ */ - -/*- - * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc. - * All rights reserved. - * - * This code is derived from software contributed to The NetBSD Foundation - * by Charles M. Hannum and by Jason R. Thorpe of the Numerical Aerospace - * Simulation Facility, NASA Ames Research Center. - * - * 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, 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -/*- - * Copyright (c) 1992, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Ralph Campbell and Rick Macklem. - * - * 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, 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. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * @(#)if_le.c 8.2 (Berkeley) 11/16/93 - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include - -#include -#include -#include - -#define LE_ISA_MEMSIZE (16*1024) -#define PCNET_RDP 0x10 -#define PCNET_RAP 0x12 - -struct le_isa_softc { - struct am7990_softc sc_am7990; /* glue to MI code */ - - bus_size_t sc_rap; /* offsets to LANCE... */ - bus_size_t sc_rdp; /* ...registers */ - - int sc_rrid; - struct resource *sc_rres; - bus_space_tag_t sc_regt; - bus_space_handle_t sc_regh; - - int sc_drid; - struct resource *sc_dres; - - int sc_irid; - struct resource *sc_ires; - void *sc_ih; - - bus_dma_tag_t sc_pdmat; - bus_dma_tag_t sc_dmat; - bus_dmamap_t sc_dmam; -}; - -static device_probe_t le_isa_probe; -static device_attach_t le_isa_attach; -static device_detach_t le_isa_detach; -static device_resume_t le_isa_resume; -static device_suspend_t le_isa_suspend; - -static device_method_t le_isa_methods[] = { - /* Device interface */ - DEVMETHOD(device_probe, le_isa_probe), - DEVMETHOD(device_attach, le_isa_attach), - DEVMETHOD(device_detach, le_isa_detach), - /* We can just use the suspend method here. */ - DEVMETHOD(device_shutdown, le_isa_suspend), - DEVMETHOD(device_suspend, le_isa_suspend), - DEVMETHOD(device_resume, le_isa_resume), - - DEVMETHOD_END -}; - -DEFINE_CLASS_0(lnc, le_isa_driver, le_isa_methods, sizeof(struct le_isa_softc)); -DRIVER_MODULE(lnc, isa, le_isa_driver, le_devclass, NULL, NULL); -MODULE_DEPEND(lnc, ether, 1, 1, 1); - -static const struct le_isa_param { - const char *name; - u_long iosize; - bus_size_t rap; - bus_size_t rdp; - bus_size_t macstart; - int macstride; -} le_isa_params[] = { - { "BICC Isolan", 24, 0xe, 0xc, 0, 2 }, - { "Novell NE2100", 16, 0x12, 0x10, 0, 1 } -}; - -static struct isa_pnp_id le_isa_ids[] = { - { 0x0322690e, "Cabletron E2200 Single Chip" }, /* CSI2203 */ - { 0x0110490a, "Boca LANCard Combo" }, /* BRI1001 */ - { 0x0100a60a, "Melco Inc. LGY-IV" }, /* BUF0001 */ - { 0xd880d041, "Novell NE2100" }, /* PNP80D8 */ - { 0x0082d041, "Cabletron E2100 Series DNI" }, /* PNP8200 */ - { 0x3182d041, "AMD AM1500T/AM2100" }, /* PNP8231 */ - { 0x8c82d041, "AMD PCnet-ISA" }, /* PNP828C */ - { 0x8d82d041, "AMD PCnet-32" }, /* PNP828D */ - { 0xcefaedfe, "Racal InterLan EtherBlaster" }, /* _WMFACE */ - { 0, NULL } -}; - -static void le_isa_wrcsr(struct lance_softc *, uint16_t, uint16_t); -static uint16_t le_isa_rdcsr(struct lance_softc *, uint16_t); -static bus_dmamap_callback_t le_isa_dma_callback; -static int le_isa_probe_legacy(device_t, const struct le_isa_param *); - -static void -le_isa_wrcsr(struct lance_softc *sc, uint16_t port, uint16_t val) -{ - struct le_isa_softc *lesc = (struct le_isa_softc *)sc; - - bus_space_write_2(lesc->sc_regt, lesc->sc_regh, lesc->sc_rap, port); - bus_space_barrier(lesc->sc_regt, lesc->sc_regh, lesc->sc_rap, 2, - BUS_SPACE_BARRIER_WRITE); - bus_space_write_2(lesc->sc_regt, lesc->sc_regh, lesc->sc_rdp, val); -} - -static uint16_t -le_isa_rdcsr(struct lance_softc *sc, uint16_t port) -{ - struct le_isa_softc *lesc = (struct le_isa_softc *)sc; - - bus_space_write_2(lesc->sc_regt, lesc->sc_regh, lesc->sc_rap, port); - bus_space_barrier(lesc->sc_regt, lesc->sc_regh, lesc->sc_rap, 2, - BUS_SPACE_BARRIER_WRITE); - return (bus_space_read_2(lesc->sc_regt, lesc->sc_regh, lesc->sc_rdp)); -} - -static void -le_isa_dma_callback(void *xsc, bus_dma_segment_t *segs, int nsegs, int error) -{ - struct lance_softc *sc = (struct lance_softc *)xsc; - - if (error != 0) - return; - KASSERT(nsegs == 1, ("%s: bad DMA segment count", __func__)); - sc->sc_addr = segs[0].ds_addr; -} - -static int -le_isa_probe_legacy(device_t dev, const struct le_isa_param *leip) -{ - struct le_isa_softc *lesc; - struct lance_softc *sc; - int error; - - lesc = device_get_softc(dev); - sc = &lesc->sc_am7990.lsc; - - lesc->sc_rrid = 0; - lesc->sc_rres = bus_alloc_resource(dev, SYS_RES_IOPORT, &lesc->sc_rrid, - 0, ~0, leip->iosize, RF_ACTIVE); - if (lesc->sc_rres == NULL) - return (ENXIO); - lesc->sc_regt = rman_get_bustag(lesc->sc_rres); - lesc->sc_regh = rman_get_bushandle(lesc->sc_rres); - lesc->sc_rap = leip->rap; - lesc->sc_rdp = leip->rdp; - - /* Stop the chip and put it in a known state. */ - le_isa_wrcsr(sc, LE_CSR0, LE_C0_STOP); - DELAY(100); - if (le_isa_rdcsr(sc, LE_CSR0) != LE_C0_STOP) { - error = ENXIO; - goto fail; - } - le_isa_wrcsr(sc, LE_CSR3, 0); - error = 0; - - fail: - bus_release_resource(dev, SYS_RES_IOPORT, lesc->sc_rrid, lesc->sc_rres); - return (error); -} - -static int -le_isa_probe(device_t dev) -{ - int i; - - switch (ISA_PNP_PROBE(device_get_parent(dev), dev, le_isa_ids)) { - case 0: - return (-20); - case ENOENT: - for (i = 0; i < NELEM(le_isa_params); i++) { - if (le_isa_probe_legacy(dev, &le_isa_params[i]) == 0) { - device_set_desc(dev, le_isa_params[i].name); - return (-20); - } - } - /* FALLTHROUGH */ - case ENXIO: - default: - return (ENXIO); - } -} - -static int -le_isa_attach(device_t dev) -{ - struct le_isa_softc *lesc; - struct lance_softc *sc; - bus_size_t macstart, rap, rdp; - int error, i, macstride; - - lesc = device_get_softc(dev); - sc = &lesc->sc_am7990.lsc; - - lesc->sc_rrid = 0; - switch (ISA_PNP_PROBE(device_get_parent(dev), dev, le_isa_ids)) { - case 0: - lesc->sc_rres = bus_alloc_resource_any(dev, SYS_RES_IOPORT, - &lesc->sc_rrid, RF_ACTIVE); - rap = PCNET_RAP; - rdp = PCNET_RDP; - macstart = 0; - macstride = 1; - break; - case ENOENT: - for (i = 0; i < NELEM(le_isa_params); i++) { - if (le_isa_probe_legacy(dev, &le_isa_params[i]) == 0) { - lesc->sc_rres = bus_alloc_resource(dev, - SYS_RES_IOPORT, &lesc->sc_rrid, 0, ~0, - le_isa_params[i].iosize, RF_ACTIVE); - rap = le_isa_params[i].rap; - rdp = le_isa_params[i].rdp; - macstart = le_isa_params[i].macstart; - macstride = le_isa_params[i].macstride; - goto found; - } - } - /* FALLTHROUGH */ - case ENXIO: - default: - device_printf(dev, "cannot determine chip\n"); - error = ENXIO; - goto fail_mtx; - } - - found: - if (lesc->sc_rres == NULL) { - device_printf(dev, "cannot allocate registers\n"); - error = ENXIO; - goto fail_mtx; - } - lesc->sc_regt = rman_get_bustag(lesc->sc_rres); - lesc->sc_regh = rman_get_bushandle(lesc->sc_rres); - lesc->sc_rap = rap; - lesc->sc_rdp = rdp; - - lesc->sc_drid = 0; - if ((lesc->sc_dres = bus_alloc_resource_any(dev, SYS_RES_DRQ, - &lesc->sc_drid, RF_ACTIVE)) == NULL) { - device_printf(dev, "cannot allocate DMA channel\n"); - error = ENXIO; - goto fail_rres; - } - - lesc->sc_irid = 0; - if ((lesc->sc_ires = bus_alloc_resource_any(dev, SYS_RES_IRQ, - &lesc->sc_irid, RF_SHAREABLE | RF_ACTIVE)) == NULL) { - device_printf(dev, "cannot allocate interrupt\n"); - error = ENXIO; - goto fail_dres; - } - - error = bus_dma_tag_create( - NULL, /* parent */ - 1, 0, /* alignment, boundary */ - BUS_SPACE_MAXADDR_24BIT, /* lowaddr */ - BUS_SPACE_MAXADDR, /* highaddr */ - NULL, NULL, /* filter, filterarg */ - BUS_SPACE_MAXSIZE_32BIT, /* maxsize */ - 0, /* nsegments */ - BUS_SPACE_MAXSIZE_32BIT, /* maxsegsize */ - BUS_DMA_WAITOK, /* flags */ - &lesc->sc_pdmat); - if (error != 0) { - device_printf(dev, "cannot allocate parent DMA tag\n"); - goto fail_ires; - } - - sc->sc_memsize = LE_ISA_MEMSIZE; - /* - * For Am79C90, Am79C961 and Am79C961A the init block must be 2-byte - * aligned and the ring descriptors must be 8-byte aligned. - */ - error = bus_dma_tag_create( - lesc->sc_pdmat, /* parent */ - 8, 0, /* alignment, boundary */ - BUS_SPACE_MAXADDR_24BIT, /* lowaddr */ - BUS_SPACE_MAXADDR, /* highaddr */ - NULL, NULL, /* filter, filterarg */ - sc->sc_memsize, /* maxsize */ - 1, /* nsegments */ - sc->sc_memsize, /* maxsegsize */ - BUS_DMA_WAITOK, /* flags */ - &lesc->sc_dmat); - if (error != 0) { - device_printf(dev, "cannot allocate buffer DMA tag\n"); - goto fail_pdtag; - } - - error = bus_dmamem_alloc(lesc->sc_dmat, (void **)&sc->sc_mem, - BUS_DMA_WAITOK | BUS_DMA_COHERENT, &lesc->sc_dmam); - if (error != 0) { - device_printf(dev, "cannot allocate DMA buffer memory\n"); - goto fail_dtag; - } - - sc->sc_addr = 0; - error = bus_dmamap_load(lesc->sc_dmat, lesc->sc_dmam, sc->sc_mem, - sc->sc_memsize, le_isa_dma_callback, sc, 0); - if (error != 0 || sc->sc_addr == 0) { - device_printf(dev, "cannot load DMA buffer map\n"); - goto fail_dmem; - } - - isa_dmacascade(rman_get_start(lesc->sc_dres)); - - sc->sc_flags = 0; - sc->sc_conf3 = 0; - - /* - * Extract the physical MAC address from the ROM. - */ - for (i = 0; i < sizeof(sc->sc_enaddr); i++) - sc->sc_enaddr[i] = bus_space_read_1(lesc->sc_regt, - lesc->sc_regh, macstart + i * macstride); - - sc->sc_copytodesc = lance_copytobuf_contig; - sc->sc_copyfromdesc = lance_copyfrombuf_contig; - sc->sc_copytobuf = lance_copytobuf_contig; - sc->sc_copyfrombuf = lance_copyfrombuf_contig; - sc->sc_zerobuf = lance_zerobuf_contig; - - sc->sc_rdcsr = le_isa_rdcsr; - sc->sc_wrcsr = le_isa_wrcsr; - sc->sc_hwreset = NULL; - sc->sc_hwinit = NULL; - sc->sc_hwintr = NULL; - sc->sc_nocarrier = NULL; - sc->sc_mediachange = NULL; - sc->sc_mediastatus = NULL; - sc->sc_supmedia = NULL; - - error = am7990_config(&lesc->sc_am7990, device_get_name(dev), - device_get_unit(dev)); - if (error != 0) { - device_printf(dev, "cannot attach Am7990\n"); - goto fail_dmap; - } - - ifq_set_cpuid(&sc->ifp->if_snd, rman_get_cpuid(lesc->sc_ires)); - - error = bus_setup_intr(dev, lesc->sc_ires, INTR_MPSAFE, - am7990_intr, sc, &lesc->sc_ih, sc->ifp->if_serializer); - if (error != 0) { - device_printf(dev, "cannot set up interrupt\n"); - goto fail_am7990; - } - - return (0); - - fail_am7990: - am7990_detach(&lesc->sc_am7990); - fail_dmap: - bus_dmamap_unload(lesc->sc_dmat, lesc->sc_dmam); - fail_dmem: - bus_dmamem_free(lesc->sc_dmat, sc->sc_mem, lesc->sc_dmam); - fail_dtag: - bus_dma_tag_destroy(lesc->sc_dmat); - fail_pdtag: - bus_dma_tag_destroy(lesc->sc_pdmat); - fail_ires: - bus_release_resource(dev, SYS_RES_IRQ, lesc->sc_irid, lesc->sc_ires); - fail_dres: - bus_release_resource(dev, SYS_RES_DRQ, lesc->sc_drid, lesc->sc_dres); - fail_rres: - bus_release_resource(dev, SYS_RES_IOPORT, lesc->sc_rrid, lesc->sc_rres); - fail_mtx: - return (error); -} - -static int -le_isa_detach(device_t dev) -{ - struct le_isa_softc *lesc; - struct lance_softc *sc; - - lesc = device_get_softc(dev); - sc = &lesc->sc_am7990.lsc; - - if (device_is_attached(dev)) { - lwkt_serialize_enter(sc->ifp->if_serializer); - lance_stop(sc); - bus_teardown_intr(dev, lesc->sc_ires, lesc->sc_ih); - lwkt_serialize_exit(sc->ifp->if_serializer); - - am7990_detach(&lesc->sc_am7990); - } - - if (lesc->sc_ires) - bus_release_resource(dev, SYS_RES_IRQ, lesc->sc_irid, lesc->sc_ires); - if (lesc->sc_dres) - bus_release_resource(dev, SYS_RES_DRQ, lesc->sc_drid, lesc->sc_dres); - if (lesc->sc_rres) - bus_release_resource(dev, SYS_RES_IOPORT, lesc->sc_rrid, lesc->sc_rres); - if (lesc->sc_dmam) { - bus_dmamap_unload(lesc->sc_dmat, lesc->sc_dmam); - bus_dmamem_free(lesc->sc_dmat, sc->sc_mem, lesc->sc_dmam); - } - if (lesc->sc_dmat) - bus_dma_tag_destroy(lesc->sc_dmat); - if (lesc->sc_pdmat) - bus_dma_tag_destroy(lesc->sc_pdmat); - - return (0); -} - -static int -le_isa_suspend(device_t dev) -{ - struct le_isa_softc *lesc; - - lesc = device_get_softc(dev); - - lance_suspend(&lesc->sc_am7990.lsc); - - return (0); -} - -static int -le_isa_resume(device_t dev) -{ - struct le_isa_softc *lesc; - - lesc = device_get_softc(dev); - - lance_resume(&lesc->sc_am7990.lsc); - - return (0); -} diff --git a/sys/dev/netif/sn/if_sn_isa.c b/sys/dev/netif/sn/if_sn_isa.c deleted file mode 100644 index 8bfb9bc20b..0000000000 --- a/sys/dev/netif/sn/if_sn_isa.c +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (c) 1999 M. Warner Losh - * 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, 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Herb Peyerl. - * 4. The name of Herb Peyerl may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD: src/sys/dev/sn/if_sn_isa.c,v 1.3.2.1 2001/01/25 19:38:18 imp Exp $ - */ - -#include -#include -#include -#include -#include - -#include -#include -#include - -#include - -#include "if_snvar.h" - -static int sn_isa_probe (device_t); -static int sn_isa_attach (device_t); - -static int -sn_isa_probe (device_t dev) -{ - if (isa_get_logicalid(dev)) /* skip PnP probes */ - return (ENXIO); - if (sn_probe(dev, 0) != 0) - return (ENXIO); - return (0); -} - -static int -sn_isa_attach (device_t dev) -{ - struct sn_softc *sc = device_get_softc(dev); - - sc->pccard_enaddr = 0; - return (sn_attach(dev)); -} - -static device_method_t sn_isa_methods[] = { - /* Device interface */ - DEVMETHOD(device_probe, sn_isa_probe), - DEVMETHOD(device_attach, sn_isa_attach), - - DEVMETHOD_END -}; - -static driver_t sn_isa_driver = { - "sn", - sn_isa_methods, - sizeof(struct sn_softc), -}; - -extern devclass_t sn_devclass; - -DRIVER_MODULE(if_sn, isa, sn_isa_driver, sn_devclass, NULL, NULL); diff --git a/sys/dev/serial/digi/Makefile b/sys/dev/serial/digi/Makefile index bbb5ad65a6..10b2c4309f 100644 --- a/sys/dev/serial/digi/Makefile +++ b/sys/dev/serial/digi/Makefile @@ -1,5 +1,5 @@ KMOD= digi -SRCS= digi.c digi_pci.c digi_isa.c digi_bios.c +SRCS= digi.c digi_pci.c digi_bios.c SRCS+= bus_if.h pci_if.h device_if.h SRCS+= opt_compat.h diff --git a/sys/dev/serial/digi/digi_isa.c b/sys/dev/serial/digi/digi_isa.c deleted file mode 100644 index 778a77786f..0000000000 --- a/sys/dev/serial/digi/digi_isa.c +++ /dev/null @@ -1,470 +0,0 @@ -/*- - * Copyright (c) 2001 Brian Somers - * based on work by Slawa Olhovchenkov - * John Prince - * Eric Hernes - * 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, 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD: src/sys/dev/digi/digi_isa.c,v 1.12 2003/08/24 17:46:03 obrien Exp $ - */ - -/*- - * TODO: - * Figure out how to make the non-Xi boards use memory addresses other - * than 0xd0000 !!! - */ - -#include - -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include - -/* Valid i/o addresses are any of these with either 0 or 4 added */ -static u_long digi_validio[] = { - 0x100, 0x110, 0x120, 0x200, 0x220, 0x300, 0x320 -}; -#define DIGI_NVALIDIO NELEM(digi_validio) -#define IO_SIZE 0x04 - -static u_long digi_validmem[] = { - 0x80000, 0x88000, 0x90000, 0x98000, 0xa0000, 0xa8000, 0xb0000, 0xb8000, - 0xc0000, 0xc8000, 0xd0000, 0xd8000, 0xe0000, 0xe8000, 0xf0000, 0xf8000, - 0xf0000000, 0xf1000000, 0xf2000000, 0xf3000000, 0xf4000000, 0xf5000000, - 0xf6000000, 0xf7000000, 0xf8000000, 0xf9000000, 0xfa000000, 0xfb000000, - 0xfc000000, 0xfd000000, 0xfe000000, 0xff000000 -}; -#define DIGI_NVALIDMEM NELEM(digi_validmem) - -static u_char * -digi_isa_setwin(struct digi_softc *sc, unsigned int addr) -{ - outb(sc->wport, sc->window = FEPWIN | (addr >> sc->win_bits)); - return (sc->vmem + (addr % sc->win_size)); -} - -static u_char * -digi_xi_setwin(struct digi_softc *sc, unsigned int addr) -{ - outb(sc->wport, sc->window = FEPMEM); - return (sc->vmem + addr); -} - -static void -digi_isa_hidewin(struct digi_softc *sc) -{ - outb(sc->wport, sc->window = 0); - /* outb(sc->port, 0); */ -} - -static void -digi_isa_towin(struct digi_softc *sc, int win) -{ - outb(sc->wport, sc->window = win); -} - -static void -digi_xi_towin(struct digi_softc *sc, int win) -{ - outb(sc->wport, sc->window = FEPMEM); -} - -/* - * sc->port should be set and its resource allocated. - */ -static int -digi_isa_check(struct digi_softc *sc) -{ - int i, ident; - - sc->name = NULL; - - /* Invasive probe - reset the card */ - outb(sc->port, FEPRST); - for (i = 0; (inb(sc->port) & FEPMASK) != FEPRST; i++) { - if (i == hz / 10) - return (0); - digi_delay(sc, "digirst", 1); - } - DLOG(DIGIDB_INIT, (sc->dev, "got reset after %d iterations\n", i)); - - ident = inb(sc->port); - - /* - * NOTE, this probe is all wrong. I haven't got the data sheets ! - */ - - DLOG(DIGIDB_INIT, (sc->dev, "board type is 0x%x\n", ident)); - if (ident & 0x1) { - switch (ident) { - case 0x05: - case 0x15: - case 0x25: - case 0x35: - sc->model = PCXI; - sc->csigs = &digi_xixe_signals; - switch (ident & 0x30) { - case 0: - sc->name = "Digiboard PC/Xi 64K"; - sc->mem_seg = 0xf000; - sc->win_size = 0x10000; - sc->win_bits = 16; - break; - case 0x10: - sc->name = "Digiboard PC/Xi 128K"; - sc->mem_seg = 0xE000; - sc->win_size = 0x20000; - sc->win_bits = 17; - break; - case 0x20: - sc->name = "Digiboard PC/Xi 256K"; - sc->mem_seg = 0xC000; - sc->win_size = 0x40000; - sc->win_bits = 18; - break; - case 0x30: - sc->name = "Digiboard PC/Xi 512K"; - sc->mem_seg = 0x8000; - sc->win_size = 0x80000; - sc->win_bits = 19; - break; - } - sc->wport = sc->port; - sc->module = "Xe"; - - sc->setwin = digi_xi_setwin; - sc->hidewin = digi_isa_hidewin; - sc->towin = digi_xi_towin; - break; - - case 0xf5: - sc->name = "Digiboard PC/Xem"; - sc->model = PCXEM; - sc->csigs = &digi_normal_signals; - sc->win_size = 0x8000; - sc->win_bits = 15; - sc->wport = sc->port + 1; - sc->module = "Xem"; - - sc->setwin = digi_isa_setwin; - sc->hidewin = digi_isa_hidewin; - sc->towin = digi_isa_towin; - break; - } - } else { - outb(sc->port, 1); - ident = inb(sc->port); - - if (ident & 0x1) { - device_printf(sc->dev, "PC/Xm is unsupported\n"); - return (0); - } - - sc->mem_seg = 0xf000; - - if (!(ident & 0xc0)) { - sc->name = "Digiboard PC/Xe 64K"; - sc->model = PCXE; - sc->csigs = &digi_xixe_signals; - sc->win_size = 0x10000; - sc->win_bits = 16; - sc->wport = sc->port; - } else { - sc->name = "Digiboard PC/Xe 64/8K (windowed)"; - sc->model = PCXEVE; - sc->csigs = &digi_normal_signals; - sc->win_size = 0x2000; - sc->win_bits = 13; - sc->wport = sc->port + 1; - } - sc->module = "Xe"; - - sc->setwin = digi_isa_setwin; - sc->hidewin = digi_isa_hidewin; - sc->towin = digi_isa_towin; - } - - return (sc->name != NULL); -} - -static int -digi_isa_probe(device_t dev) -{ - struct digi_softc *sc = device_get_softc(dev); - int i; - - KASSERT(sc, ("digi%d: softc not allocated in digi_isa_probe", - device_get_unit(dev))); - - bzero(sc, sizeof(*sc)); - sc->status = DIGI_STATUS_NOTINIT; - sc->dev = dev; - sc->res.unit = device_get_unit(dev); - if (sc->res.unit >= 16) { - /* Don't overflow our control mask */ - device_printf(dev, "At most 16 digiboards may be used\n"); - return (ENXIO); - } - DLOG(DIGIDB_INIT, (sc->dev, "probing on isa bus\n")); - - /* Check that we've got a valid i/o address */ - if ((sc->port = bus_get_resource_start(dev, SYS_RES_IOPORT, 0)) == 0) { - DLOG(DIGIDB_INIT, (sc->dev, "io address not given\n")); - return (ENXIO); - } - for (i = 0; i < DIGI_NVALIDIO; i++) - if (sc->port == digi_validio[i] || - sc->port == digi_validio[i] + 4) - break; - if (i == DIGI_NVALIDIO) { - device_printf(dev, "0x%03x: Invalid i/o address\n", sc->port); - return (ENXIO); - } - - /* Ditto for our memory address */ - if ((sc->pmem = bus_get_resource_start(dev, SYS_RES_MEMORY, 0)) == 0) - return (ENXIO); - for (i = 0; i < DIGI_NVALIDMEM; i++) - if (sc->pmem == digi_validmem[i]) - break; - if (i == DIGI_NVALIDMEM) { - device_printf(dev, "0x%lx: Invalid memory address\n", sc->pmem); - return (ENXIO); - } - if ((sc->pmem & 0xfffffful) != sc->pmem) { - device_printf(dev, "0x%lx: Memory address not supported\n", - sc->pmem); - return (ENXIO); - } - sc->vmem = (u_char *)sc->pmem; - - DLOG(DIGIDB_INIT, (sc->dev, "isa? port 0x%03x mem 0x%lx\n", - sc->port, sc->pmem)); - - /* Temporarily map our io ports */ - sc->res.iorid = 0; - sc->res.io = bus_alloc_resource(dev, SYS_RES_IOPORT, &sc->res.iorid, - 0ul, ~0ul, IO_SIZE, RF_ACTIVE); - if (sc->res.io == NULL) - return (ENXIO); - - /* Check the type of card and get internal memory characteristics */ - if (!digi_isa_check(sc)) { - bus_release_resource(dev, SYS_RES_IOPORT, sc->res.iorid, - sc->res.io); - return (ENXIO); - } - - /* Temporarily map our memory */ - sc->res.mrid = 0; - sc->res.mem = bus_alloc_resource(dev, SYS_RES_MEMORY, &sc->res.mrid, - 0ul, ~0ul, sc->win_size, RF_ALLOCATED); - if (sc->res.mem == NULL) { - device_printf(dev, "0x%lx: Memory range is in use\n", sc->pmem); - bus_release_resource(dev, SYS_RES_IOPORT, sc->res.iorid, - sc->res.io); - return (ENXIO); - } - - outb(sc->port, FEPCLR); /* drop RESET */ - sc->hidewin(sc); /* set initial sc->window */ - - bus_release_resource(dev, SYS_RES_MEMORY, sc->res.mrid, sc->res.mem); - bus_release_resource(dev, SYS_RES_IOPORT, sc->res.iorid, sc->res.io); - - /* Let digi_isa_attach() know what we've found */ - bus_set_resource(dev, SYS_RES_IOPORT, 0, sc->port, IO_SIZE, -1); - bus_set_resource(dev, SYS_RES_MEMORY, 0, sc->pmem, sc->win_size, -1); - - DLOG(DIGIDB_INIT, (sc->dev, "Probe returns -10\n")); - - return (-10); /* Other drivers are preferred for now */ -} - -static int -digi_isa_attach(device_t dev) -{ - struct digi_softc *sc = device_get_softc(dev); - int i, t, res; - u_char *ptr; - int reset; - u_long msize, iosize; - long scport; - - KASSERT(sc, ("digi%d: softc not allocated in digi_isa_attach", - device_get_unit(dev))); - - res = ENXIO; - bzero(sc, sizeof(*sc)); - sc->status = DIGI_STATUS_NOTINIT; - sc->dev = dev; - sc->res.unit = device_get_unit(dev); - DLOG(DIGIDB_INIT, (sc->dev, "attaching\n")); - - bus_get_resource(dev, SYS_RES_IOPORT, 0, &scport, &iosize); - bus_get_resource(dev, SYS_RES_MEMORY, 0, &sc->pmem, &msize); - sc->port = scport; - /* sc->altpin = !!(device_get_flags(dev) & DGBFLAG_ALTPIN); */ - - /* Allocate resources (verified in digi_isa_probe()) */ - sc->res.iorid = 0; - sc->res.io = bus_alloc_resource(dev, SYS_RES_IOPORT, &sc->res.iorid, - 0ul, ~0ul, iosize, RF_ACTIVE); - if (sc->res.io == NULL) - return (ENXIO); - - /* Check the type of card and get internal memory characteristics */ - DLOG(DIGIDB_INIT, (sc->dev, "Checking card type\n")); - if (!digi_isa_check(sc)) - goto failed; - - callout_init(&sc->callout); - callout_init(&sc->inttest); - - sc->res.mrid = 0; - sc->res.mem = bus_alloc_resource(dev, SYS_RES_MEMORY, &sc->res.mrid, - 0ul, ~0ul, msize, RF_ACTIVE); - if (sc->res.mem == NULL) { - device_printf(dev, "0x%lx: Memory range is in use\n", sc->pmem); - sc->hidewin(sc); - goto failed; - } - - /* map memory */ - sc->vmem = pmap_mapdev(sc->pmem, msize); - sc->msize = msize; - - DLOG(DIGIDB_INIT, (sc->dev, "internal memory segment 0x%x\n", - sc->mem_seg)); - - /* Start by resetting the card */ - reset = FEPRST; - if (sc->model == PCXI) - reset |= FEPMEM; - - outb(sc->port, reset); - for (i = 0; (inb(sc->port) & FEPMASK) != reset; i++) { - if (i == hz / 10) { - device_printf(dev, "1st reset failed\n"); - sc->hidewin(sc); - goto failed; - } - digi_delay(sc, "digirst1", 1); - } - DLOG(DIGIDB_INIT, (sc->dev, "got reset after %d iterations\n", i)); - - if (sc->model != PCXI) { - t = (sc->pmem >> 8) & 0xffe0; - if (sc->model == PCXEVE) - t |= 0x10; /* enable windowing */ - outb(sc->port + 2, t & 0xff); - outb(sc->port + 3, t >> 8); - } - - if (sc->model == PCXI || sc->model == PCXE) { - outb(sc->port, FEPRST | FEPMEM); - for (i = 0; (inb(sc->port) & FEPMASK) != FEPRST; i++) { - if (i == hz / 10) { - device_printf(dev, - "memory reservation failed (0x%02x)\n", - inb(sc->port)); - sc->hidewin(sc); - goto failed; - } - digi_delay(sc, "digirst2", 1); - } - DLOG(DIGIDB_INIT, (sc->dev, "got memory after %d iterations\n", - i)); - } - - DLOG(DIGIDB_INIT, (sc->dev, "short memory test\n")); - ptr = sc->setwin(sc, BOTWIN); - vD(ptr) = 0xA55A3CC3; - if (vD(ptr) != 0xA55A3CC3) { - device_printf(dev, "1st memory test failed\n"); - sc->hidewin(sc); - goto failed; - } - DLOG(DIGIDB_INIT, (sc->dev, "1st memory test ok\n")); - - ptr = sc->setwin(sc, TOPWIN); - vD(ptr) = 0x5AA5C33C; - if (vD(ptr) != 0x5AA5C33C) { - device_printf(dev, "2nd memory test failed\n"); - sc->hidewin(sc); - goto failed; - } - DLOG(DIGIDB_INIT, (sc->dev, "2nd memory test ok\n")); - - ptr = sc->setwin(sc, BIOSCODE + ((0xf000 - sc->mem_seg) << 4)); - vD(ptr) = 0x5AA5C33C; - if (vD(ptr) != 0x5AA5C33C) { - device_printf(dev, "3rd (BIOS) memory test failed\n"); - sc->hidewin(sc); - goto failed; - } - DLOG(DIGIDB_INIT, (sc->dev, "3rd memory test ok\n")); - - if ((res = digi_attach(sc)) == 0) - return (0); - -failed: - if (sc->res.mem != NULL) { - bus_release_resource(dev, SYS_RES_MEMORY, sc->res.mrid, - sc->res.mem); - sc->res.mem = NULL; - } - if (sc->res.io != NULL) { - bus_release_resource(dev, SYS_RES_IOPORT, sc->res.iorid, - sc->res.io); - sc->res.io = NULL; - } - - return (res); -} - -static device_method_t digi_isa_methods[] = { - /* Device interface */ - DEVMETHOD(device_probe, digi_isa_probe), - DEVMETHOD(device_attach, digi_isa_attach), - DEVMETHOD(device_detach, digi_detach), - DEVMETHOD(device_shutdown, digi_shutdown), - DEVMETHOD_END -}; - -static driver_t digi_isa_drv = { - "digi", - digi_isa_methods, - sizeof(struct digi_softc), -}; -DRIVER_MODULE(digi, isa, digi_isa_drv, digi_devclass, NULL, NULL); diff --git a/sys/dev/serial/si/si_isa.c b/sys/dev/serial/si/si_isa.c deleted file mode 100644 index b87a208f45..0000000000 --- a/sys/dev/serial/si/si_isa.c +++ /dev/null @@ -1,325 +0,0 @@ -/* - * Device driver for Specialix range (SI/XIO) of serial line multiplexors. - * - * Copyright (C) 2000, Peter Wemm - * - * 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 - * notices, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notices, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN - * NO EVENT SHALL THE AUTHORS BE LIABLE. - * - * $FreeBSD: src/sys/dev/si/si_isa.c,v 1.1 2000/01/24 07:24:01 peter Exp $ - */ - -#include "opt_debug_si.h" - -#include -#include -#include -#include -#include - -#include "sireg.h" -#include "sivar.h" - -#include - -/* Look for a valid board at the given mem addr */ -static int -si_isa_probe(device_t dev) -{ - struct si_softc *sc; - int type; - u_int i, ramsize; - volatile unsigned char was, *ux; - volatile unsigned char *maddr; - unsigned char *paddr; - int unit; - - sc = device_get_softc(dev); - unit = device_get_unit(dev); - - sc->sc_mem_rid = 0; - sc->sc_mem_res = bus_alloc_resource(dev, SYS_RES_MEMORY, - &sc->sc_mem_rid, - 0, ~0, SIPROBEALLOC, RF_ACTIVE); - if (!sc->sc_mem_res) - return ENXIO; - paddr = (caddr_t)rman_get_start(sc->sc_mem_res);/* physical */ - maddr = rman_get_virtual(sc->sc_mem_res); /* in kvm */ - - DPRINT((0, DBG_AUTOBOOT, "si%d: probe at virtual=%p physical=%p\n", - unit, maddr, paddr)); - - /* - * this is a lie, but it's easier than trying to handle caching - * and ram conflicts in the >1M and <16M region. - */ - if ((caddr_t)paddr < (caddr_t)0xA0000 || - (caddr_t)paddr >= (caddr_t)0x100000) { - kprintf("si%d: iomem (%p) out of range\n", - unit, (void *)paddr); - goto fail; - } - - if (((uintptr_t)paddr & 0x7fff) != 0) { - DPRINT((0, DBG_AUTOBOOT|DBG_FAIL, - "si%d: iomem (%p) not on 32k boundary\n", unit, paddr)); - goto fail; - } - - /* Is there anything out there? (0x17 is just an arbitrary number) */ - *maddr = 0x17; - if (*maddr != 0x17) { - DPRINT((0, DBG_AUTOBOOT|DBG_FAIL, - "si%d: 0x17 check fail at phys %p\n", unit, paddr)); - goto fail; - } - /* - * Let's look first for a JET ISA card, since that's pretty easy - * - * All jet hosts are supposed to have this string in the IDROM, - * but it's not worth checking on self-IDing busses like PCI. - */ - { - unsigned char *jet_chk_str = "JET HOST BY KEV#"; - - for (i = 0; i < strlen(jet_chk_str); i++) - if (jet_chk_str[i] != *(maddr + SIJETIDSTR + 2 * i)) - goto try_mk2; - } - DPRINT((0, DBG_AUTOBOOT|DBG_FAIL, "si%d: JET first check - 0x%x\n", - unit, (*(maddr+SIJETIDBASE)))); - if (*(maddr+SIJETIDBASE) != (SISPLXID&0xff)) - goto try_mk2; - DPRINT((0, DBG_AUTOBOOT|DBG_FAIL, "si%d: JET second check - 0x%x\n", - unit, (*(maddr+SIJETIDBASE+2)))); - if (*(maddr+SIJETIDBASE+2) != ((SISPLXID&0xff00)>>8)) - goto try_mk2; - /* It must be a Jet ISA or RIO card */ - DPRINT((0, DBG_AUTOBOOT|DBG_FAIL, "si%d: JET id check - 0x%x\n", - unit, (*(maddr+SIUNIQID)))); - if ((*(maddr+SIUNIQID) & 0xf0) != 0x20) - goto try_mk2; - /* It must be a Jet ISA SI/XIO card */ - *(maddr + SIJETCONFIG) = 0; - type = SIJETISA; - ramsize = SIJET_RAMSIZE; - goto got_card; - -try_mk2: - /* - * OK, now to see if whatever responded is really an SI card. - * Try for a MK II next (SIHOST2) - */ - for (i = SIPLSIG; i < SIPLSIG + 8; i++) - if ((*(maddr+i) & 7) != (~(unsigned char)i & 7)) - goto try_mk1; - - /* It must be an SIHOST2 */ - *(maddr + SIPLRESET) = 0; - *(maddr + SIPLIRQCLR) = 0; - *(maddr + SIPLIRQSET) = 0x10; - type = SIHOST2; - ramsize = SIHOST2_RAMSIZE; - goto got_card; - -try_mk1: - /* - * Its not a MK II, so try for a MK I (SIHOST) - */ - *(maddr+SIRESET) = 0x0; /* reset the card */ - *(maddr+SIINTCL) = 0x0; /* clear int */ - *(maddr+SIRAM) = 0x17; - if (*(maddr+SIRAM) != (unsigned char)0x17) - goto fail; - *(maddr+0x7ff8) = 0x17; - if (*(maddr+0x7ff8) != (unsigned char)0x17) { - DPRINT((0, DBG_AUTOBOOT|DBG_FAIL, - "si%d: 0x17 check fail at phys %p = 0x%x\n", - unit, paddr+0x77f8, *(maddr+0x77f8))); - goto fail; - } - - /* It must be an SIHOST (maybe?) - there must be a better way XXX */ - type = SIHOST; - ramsize = SIHOST_RAMSIZE; - -got_card: - DPRINT((0, DBG_AUTOBOOT, "si%d: found type %d card, try memory test\n", - unit, type)); - /* Try the acid test */ - ux = maddr + SIRAM; - for (i = 0; i < ramsize; i++, ux++) - *ux = (unsigned char)(i&0xff); - ux = maddr + SIRAM; - for (i = 0; i < ramsize; i++, ux++) { - if ((was = *ux) != (unsigned char)(i&0xff)) { - DPRINT((0, DBG_AUTOBOOT|DBG_FAIL, - "si%d: match fail at phys %p, was %x should be %x\n", - unit, paddr + i, was, i&0xff)); - goto fail; - } - } - - /* clear out the RAM */ - ux = maddr + SIRAM; - for (i = 0; i < ramsize; i++) - *ux++ = 0; - ux = maddr + SIRAM; - for (i = 0; i < ramsize; i++) { - if ((was = *ux++) != 0) { - DPRINT((0, DBG_AUTOBOOT|DBG_FAIL, - "si%d: clear fail at phys %p, was %x\n", - unit, paddr + i, was)); - goto fail; - } - } - - /* - * Success, we've found a valid board, now fill in - * the adapter structure. - */ - switch (type) { - case SIHOST2: - switch (isa_get_irq(dev)) { - case 11: - case 12: - case 15: - break; - default: -bad_irq: - DPRINT((0, DBG_AUTOBOOT|DBG_FAIL, - "si%d: bad IRQ value - %d\n", - unit, isa_get_irq(dev))); - goto fail; - } - sc->sc_memsize = SIHOST2_MEMSIZE; - break; - case SIHOST: - switch (isa_get_irq(dev)) { - case 11: - case 12: - case 15: - break; - default: - goto bad_irq; - } - sc->sc_memsize = SIHOST_MEMSIZE; - break; - case SIJETISA: - switch (isa_get_irq(dev)) { - case 9: - case 10: - case 11: - case 12: - case 15: - break; - default: - goto bad_irq; - } - sc->sc_memsize = SIJETISA_MEMSIZE; - break; - case SIMCA: /* MCA */ - default: - kprintf("si%d: card type %d not supported\n", unit, type); - goto fail; - } - sc->sc_type = type; - bus_release_resource(dev, SYS_RES_MEMORY, - sc->sc_mem_rid, sc->sc_mem_res); - sc->sc_mem_res = 0; - return (0); /* success! */ - -fail: - if (sc->sc_mem_res) { - bus_release_resource(dev, SYS_RES_MEMORY, - sc->sc_mem_rid, sc->sc_mem_res); - sc->sc_mem_res = 0; - } - return(EINVAL); -} - -static int -si_isa_attach(device_t dev) -{ - int error; - void *ih; - struct si_softc *sc; - - error = 0; - ih = NULL; - sc = device_get_softc(dev); - - sc->sc_mem_rid = 0; - sc->sc_mem_res = bus_alloc_resource(dev, SYS_RES_MEMORY, - &sc->sc_mem_rid, - 0, ~0, 1, RF_ACTIVE); - if (!sc->sc_mem_res) { - device_printf(dev, "couldn't map memory\n"); - goto fail; - } - sc->sc_paddr = (caddr_t)rman_get_start(sc->sc_mem_res); - sc->sc_maddr = rman_get_virtual(sc->sc_mem_res); - - sc->sc_irq_rid = 0; - sc->sc_irq_res = bus_alloc_resource(dev, SYS_RES_IRQ, &sc->sc_irq_rid, - 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE); - if (!sc->sc_irq_res) { - device_printf(dev, "couldn't allocate interrupt\n"); - goto fail; - } - sc->sc_irq = rman_get_start(sc->sc_irq_res); - error = bus_setup_intr(dev, sc->sc_irq_res, INTR_MPSAFE, si_intr, sc, &ih, NULL); - if (error) { - device_printf(dev, "couldn't activate interrupt\n"); - goto fail; - } - - error = siattach(dev); - if (error) - goto fail; - return (0); /* success */ - -fail: - if (error == 0) - error = ENXIO; - if (sc->sc_irq_res) { - if (ih) - bus_teardown_intr(dev, sc->sc_irq_res, ih); - bus_release_resource(dev, SYS_RES_IRQ, - sc->sc_irq_rid, sc->sc_irq_res); - sc->sc_irq_res = 0; - } - if (sc->sc_mem_res) { - bus_release_resource(dev, SYS_RES_MEMORY, - sc->sc_mem_rid, sc->sc_mem_res); - sc->sc_mem_res = 0; - } - return (error); -} - -static device_method_t si_isa_methods[] = { - /* Device interface */ - DEVMETHOD(device_probe, si_isa_probe), - DEVMETHOD(device_attach, si_isa_attach), - - DEVMETHOD_END -}; - -static driver_t si_isa_driver = { - "si", - si_isa_methods, - sizeof(struct si_softc), -}; - -DRIVER_MODULE(si, isa, si_isa_driver, si_devclass, NULL, NULL); diff --git a/sys/netgraph/sync_ar/Makefile b/sys/netgraph/sync_ar/Makefile index 0131ab45f0..9f165cac27 100644 --- a/sys/netgraph/sync_ar/Makefile +++ b/sys/netgraph/sync_ar/Makefile @@ -2,8 +2,8 @@ .PATH: ${.CURDIR}/../../dev/netif/ar KMOD = ng_sync_ar -SRCS = if_ar.c if_ar_isa.c if_ar_pci.c -SRCS += device_if.h bus_if.h pci_if.h pcidevs.h isa_if.h opt_netgraph.h +SRCS = if_ar.c if_ar_pci.c +SRCS += device_if.h bus_if.h pci_if.h pcidevs.h opt_netgraph.h opt_netgraph.h: echo "#define NETGRAPH" > ${.TARGET} diff --git a/sys/platform/pc32/conf/files b/sys/platform/pc32/conf/files index f5d12259b1..e6a9e72f79 100644 --- a/sys/platform/pc32/conf/files +++ b/sys/platform/pc32/conf/files @@ -93,8 +93,6 @@ bf_enc.o optional crypto \ crypto/des/arch/i386/des_enc.S optional crypto crypto/des/des_ecb.c optional crypto crypto/des/des_setkey.c optional crypto -dev/disk/advansys/adv_isa.c optional adv isa -dev/netif/ar/if_ar_isa.c optional ar isa ${OSACPI_MD_DIR}/OsdEnvironment.c optional acpi ${OSACPI_MD_DIR}/acpi_cpu_machdep.c optional acpi @@ -130,7 +128,6 @@ dev/crypto/padlock/padlock_rng.c optional padlock dev/crypto/padlock/rng_harvest_i386.S optional padlock dev/crypto/rdrand/rdrand.c optional rdrand dev/crypto/rdrand/rdrand_harvest_i386.S optional rdrand -dev/netif/ed/if_ed_isa.c optional ed isa dev/video/fb/fb.c optional fb dev/video/fb/fb.c optional vga dev/video/fb/splash.c optional splash @@ -138,7 +135,6 @@ dev/video/fb/vga.c optional vga dev/powermng/est/est.c optional cpu_enable_est dev/powermng/longrun/longrun.c optional cpu_enable_longrun dev/netif/fe/if_fe.c optional fe -dev/netif/fe/if_fe_isa.c optional fe isa dev/netif/fe/if_fe_pccard.c optional fe pccard dev/netif/ndis/if_ndis.c optional ndis dev/netif/ndis/if_ndis_pccard.c optional ndis pccard diff --git a/sys/platform/pc32/i386/userconfig.c b/sys/platform/pc32/i386/userconfig.c index d32b8a299f..c32a14c9fc 100644 --- a/sys/platform/pc32/i386/userconfig.c +++ b/sys/platform/pc32/i386/userconfig.c @@ -309,7 +309,6 @@ typedef struct static DEVCLASS_INFO devclass_names[] = { { "Storage : ", CLS_STORAGE}, -{ "Network : ", CLS_NETWORK}, { "Communications : ", CLS_COMMS}, { "Input : ", CLS_INPUT}, { "Miscellaneous : ", CLS_MISC}, @@ -328,25 +327,12 @@ static DEVCLASS_INFO devclass_names[] = { static DEV_INFO device_info[] = { /*---Name----- ---Description---------------------------------------------- */ -{"adv", "AdvanSys SCSI narrow controller", 0, CLS_STORAGE}, -{"stg", "TMC 18C30/18C50 based SCSI cards", 0, CLS_STORAGE}, {"ata", "ATA/ATAPI compatible disk controller", 0, CLS_STORAGE}, {"fdc", "Floppy disk controller", FLG_FIXED, CLS_STORAGE}, {"ad", "ATA/ATAPI compatible storage device", FLG_INVISIBLE, CLS_STORAGE}, {"fd", "Floppy disk device", FLG_INVISIBLE, CLS_STORAGE}, -{"cs", "IBM EtherJet, CS89x0-based Ethernet adapters",0, CLS_NETWORK}, -{"ed", "NE1000,NE2000,3C503,WD/SMC80xx Ethernet adapters",0, CLS_NETWORK}, -{"ep", "3C509 Ethernet adapter", 0, CLS_NETWORK}, -{"ex", "Intel EtherExpress Pro/10 Ethernet adapter", 0, CLS_NETWORK}, -{"fe", "Fujitsu MB86960A/MB86965A Ethernet adapters", 0, CLS_NETWORK}, -{"lnc", "Isolan, Novell NE2100/NE32-VL Ethernet adapters", 0,CLS_NETWORK}, -{"sn", "SMC/Megahertz Ethernet adapters", 0,CLS_NETWORK}, -{"xe", "Xircom PC Card Ethernet adapter", 0, CLS_NETWORK}, -{"sbni", "Granch SBNI12-xx adapters", 0, CLS_NETWORK}, - {"sio", "8250/16450/16550 Serial port", 0, CLS_COMMS}, -{"si", "Specialix SI/XIO/SX async adapter", 0, CLS_COMMS}, {"ppc", "Parallel Port chipset", 0, CLS_COMMS}, {"atkbdc", "Keyboard controller", FLG_INVISIBLE, CLS_INPUT}, -- 2.41.0