tokenring: delete all remaining driver support
This represents the mass deletion of the of the tokenring support. It gets rid of: - the net/tr.c which the drivers depended on - the drivers/net component - the Kbuild infrastructure around it - any tokenring related CONFIG_ settings in any defconfigs - the tokenring headers in the include/linux dir - the firmware associated with the tokenring drivers. - any associated token ring documentation. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
This commit is contained in:
Родитель
211ed86510
Коммит
ee446fd5e6
|
@ -996,7 +996,6 @@ Table 1-9: Network info in /proc/net
|
|||
snmp SNMP data
|
||||
sockstat Socket statistics
|
||||
tcp TCP sockets
|
||||
tr_rif Token ring RIF routing table
|
||||
udp UDP sockets
|
||||
unix UNIX domain sockets
|
||||
wireless Wireless interface data (Wavelan etc)
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
00-INDEX
|
||||
- this file
|
||||
3c359.txt
|
||||
- information on the 3Com TokenLink Velocity XL (3c5359) driver.
|
||||
3c505.txt
|
||||
- information on the 3Com EtherLink Plus (3c505) driver.
|
||||
3c509.txt
|
||||
|
@ -142,8 +140,6 @@ netif-msg.txt
|
|||
- Design of the network interface message level setting (NETIF_MSG_*).
|
||||
nfc.txt
|
||||
- The Linux Near Field Communication (NFS) subsystem.
|
||||
olympic.txt
|
||||
- IBM PCI Pit/Pit-Phy/Olympic Token Ring driver info.
|
||||
openvswitch.txt
|
||||
- Open vSwitch developer documentation.
|
||||
operstates.txt
|
||||
|
@ -184,8 +180,6 @@ skfp.txt
|
|||
- SysKonnect FDDI (SK-5xxx, Compaq Netelligent) driver info.
|
||||
smc9.txt
|
||||
- the driver for SMC's 9000 series of Ethernet cards
|
||||
smctr.txt
|
||||
- SMC TokenCard TokenRing Linux driver info.
|
||||
spider-net.txt
|
||||
- README for the Spidernet Driver (as found in PS3 / Cell BE).
|
||||
stmmac.txt
|
||||
|
@ -200,8 +194,6 @@ tcp-thin.txt
|
|||
- kernel tuning options for low rate 'thin' TCP streams.
|
||||
tlan.txt
|
||||
- ThunderLAN (Compaq Netelligent 10/100, Olicom OC-2xxx) driver info.
|
||||
tms380tr.txt
|
||||
- SysKonnect Token Ring ISA/PCI adapter driver info.
|
||||
tproxy.txt
|
||||
- Transparent proxy support user guide.
|
||||
tuntap.txt
|
||||
|
|
|
@ -1,58 +0,0 @@
|
|||
|
||||
3COM PCI TOKEN LINK VELOCITY XL TOKEN RING CARDS README
|
||||
|
||||
Release 0.9.0 - Release
|
||||
Jul 17th 2000 Mike Phillips
|
||||
|
||||
1.2.0 - Final
|
||||
Feb 17th 2002 Mike Phillips
|
||||
Updated for submission to the 2.4.x kernel.
|
||||
|
||||
Thanks:
|
||||
Terry Murphy from 3Com for tech docs and support,
|
||||
Adam D. Ligas for testing the driver.
|
||||
|
||||
Note:
|
||||
This driver will NOT work with the 3C339 Token Ring cards, you need
|
||||
to use the tms380 driver instead.
|
||||
|
||||
Options:
|
||||
|
||||
The driver accepts three options: ringspeed, pkt_buf_sz and message_level.
|
||||
|
||||
These options can be specified differently for each card found.
|
||||
|
||||
ringspeed: Has one of three settings 0 (default), 4 or 16. 0 will
|
||||
make the card autosense the ringspeed and join at the appropriate speed,
|
||||
this will be the default option for most people. 4 or 16 allow you to
|
||||
explicitly force the card to operate at a certain speed. The card will fail
|
||||
if you try to insert it at the wrong speed. (Although some hubs will allow
|
||||
this so be *very* careful). The main purpose for explicitly setting the ring
|
||||
speed is for when the card is first on the ring. In autosense mode, if the card
|
||||
cannot detect any active monitors on the ring it will open at the same speed as
|
||||
its last opening. This can be hazardous if this speed does not match the speed
|
||||
you want the ring to operate at.
|
||||
|
||||
pkt_buf_sz: This is this initial receive buffer allocation size. This will
|
||||
default to 4096 if no value is entered. You may increase performance of the
|
||||
driver by setting this to a value larger than the network packet size, although
|
||||
the driver now re-sizes buffers based on MTU settings as well.
|
||||
|
||||
message_level: Controls level of messages created by the driver. Defaults to 0:
|
||||
which only displays start-up and critical messages. Presently any non-zero
|
||||
value will display all soft messages as well. NB This does not turn
|
||||
debugging messages on, that must be done by modified the source code.
|
||||
|
||||
Variable MTU size:
|
||||
|
||||
The driver can handle a MTU size up to either 4500 or 18000 depending upon
|
||||
ring speed. The driver also changes the size of the receive buffers as part
|
||||
of the mtu re-sizing, so if you set mtu = 18000, you will need to be able
|
||||
to allocate 16 * (sk_buff with 18000 buffer size) call it 18500 bytes per ring
|
||||
position = 296,000 bytes of memory space, plus of course anything
|
||||
necessary for the tx sk_buff's. Remember this is per card, so if you are
|
||||
building routers, gateway's etc, you could start to use a lot of memory
|
||||
real fast.
|
||||
|
||||
2/17/02 Mike Phillips
|
||||
|
|
@ -1,79 +0,0 @@
|
|||
|
||||
IBM PCI Pit/Pit-Phy/Olympic CHIPSET BASED TOKEN RING CARDS README
|
||||
|
||||
Release 0.2.0 - Release
|
||||
June 8th 1999 Peter De Schrijver & Mike Phillips
|
||||
Release 0.9.C - Release
|
||||
April 18th 2001 Mike Phillips
|
||||
|
||||
Thanks:
|
||||
Erik De Cock, Adrian Bridgett and Frank Fiene for their
|
||||
patience and testing.
|
||||
Donald Champion for the cardbus support
|
||||
Kyle Lucke for the dma api changes.
|
||||
Jonathon Bitner for hardware support.
|
||||
Everybody on linux-tr for their continued support.
|
||||
|
||||
Options:
|
||||
|
||||
The driver accepts four options: ringspeed, pkt_buf_sz,
|
||||
message_level and network_monitor.
|
||||
|
||||
These options can be specified differently for each card found.
|
||||
|
||||
ringspeed: Has one of three settings 0 (default), 4 or 16. 0 will
|
||||
make the card autosense the ringspeed and join at the appropriate speed,
|
||||
this will be the default option for most people. 4 or 16 allow you to
|
||||
explicitly force the card to operate at a certain speed. The card will fail
|
||||
if you try to insert it at the wrong speed. (Although some hubs will allow
|
||||
this so be *very* careful). The main purpose for explicitly setting the ring
|
||||
speed is for when the card is first on the ring. In autosense mode, if the card
|
||||
cannot detect any active monitors on the ring it will not open, so you must
|
||||
re-init the card at the appropriate speed. Unfortunately at present the only
|
||||
way of doing this is rmmod and insmod which is a bit tough if it is compiled
|
||||
in the kernel.
|
||||
|
||||
pkt_buf_sz: This is this initial receive buffer allocation size. This will
|
||||
default to 4096 if no value is entered. You may increase performance of the
|
||||
driver by setting this to a value larger than the network packet size, although
|
||||
the driver now re-sizes buffers based on MTU settings as well.
|
||||
|
||||
message_level: Controls level of messages created by the driver. Defaults to 0:
|
||||
which only displays start-up and critical messages. Presently any non-zero
|
||||
value will display all soft messages as well. NB This does not turn
|
||||
debugging messages on, that must be done by modified the source code.
|
||||
|
||||
network_monitor: Any non-zero value will provide a quasi network monitoring
|
||||
mode. All unexpected MAC frames (beaconing etc.) will be received
|
||||
by the driver and the source and destination addresses printed.
|
||||
Also an entry will be added in /proc/net called olympic_tr%d, where tr%d
|
||||
is the registered device name, i.e tr0, tr1, etc. This displays low
|
||||
level information about the configuration of the ring and the adapter.
|
||||
This feature has been designed for network administrators to assist in
|
||||
the diagnosis of network / ring problems. (This used to OLYMPIC_NETWORK_MONITOR,
|
||||
but has now changed to allow each adapter to be configured differently and
|
||||
to alleviate the necessity to re-compile olympic to turn the option on).
|
||||
|
||||
Multi-card:
|
||||
|
||||
The driver will detect multiple cards and will work with shared interrupts,
|
||||
each card is assigned the next token ring device, i.e. tr0 , tr1, tr2. The
|
||||
driver should also happily reside in the system with other drivers. It has
|
||||
been tested with ibmtr.c running, and I personally have had one Olicom PCI
|
||||
card and two IBM olympic cards (all on the same interrupt), all running
|
||||
together.
|
||||
|
||||
Variable MTU size:
|
||||
|
||||
The driver can handle a MTU size up to either 4500 or 18000 depending upon
|
||||
ring speed. The driver also changes the size of the receive buffers as part
|
||||
of the mtu re-sizing, so if you set mtu = 18000, you will need to be able
|
||||
to allocate 16 * (sk_buff with 18000 buffer size) call it 18500 bytes per ring
|
||||
position = 296,000 bytes of memory space, plus of course anything
|
||||
necessary for the tx sk_buff's. Remember this is per card, so if you are
|
||||
building routers, gateway's etc, you could start to use a lot of memory
|
||||
real fast.
|
||||
|
||||
|
||||
6/8/99 Peter De Schrijver and Mike Phillips
|
||||
|
|
@ -1,66 +0,0 @@
|
|||
Text File for the SMC TokenCard TokenRing Linux driver (smctr.c).
|
||||
By Jay Schulist <jschlst@samba.org>
|
||||
|
||||
The Linux SMC Token Ring driver works with the SMC TokenCard Elite (8115T)
|
||||
ISA and SMC TokenCard Elite/A (8115T/A) MCA adapters.
|
||||
|
||||
Latest information on this driver can be obtained on the Linux-SNA WWW site.
|
||||
Please point your browser to: http://www.linux-sna.org
|
||||
|
||||
This driver is rather simple to use. Select Y to Token Ring adapter support
|
||||
in the kernel configuration. A choice for SMC Token Ring adapters will
|
||||
appear. This drives supports all SMC ISA/MCA adapters. Choose this
|
||||
option. I personally recommend compiling the driver as a module (M), but if you
|
||||
you would like to compile it statically answer Y instead.
|
||||
|
||||
This driver supports multiple adapters without the need to load multiple copies
|
||||
of the driver. You should be able to load up to 7 adapters without any kernel
|
||||
modifications, if you are in need of more please contact the maintainer of this
|
||||
driver.
|
||||
|
||||
Load the driver either by lilo/loadlin or as a module. When a module using the
|
||||
following command will suffice for most:
|
||||
|
||||
# modprobe smctr
|
||||
smctr.c: v1.00 12/6/99 by jschlst@samba.org
|
||||
tr0: SMC TokenCard 8115T at Io 0x300, Irq 10, Rom 0xd8000, Ram 0xcc000.
|
||||
|
||||
Now just setup the device via ifconfig and set and routes you may have. After
|
||||
this you are ready to start sending some tokens.
|
||||
|
||||
Errata:
|
||||
1). For anyone wondering where to pick up the SMC adapters please browse
|
||||
to http://www.smc.com
|
||||
|
||||
2). If you are the first/only Token Ring Client on a Token Ring LAN, please
|
||||
specify the ringspeed with the ringspeed=[4/16] module option. If no
|
||||
ringspeed is specified the driver will attempt to autodetect the ring
|
||||
speed and/or if the adapter is the first/only station on the ring take
|
||||
the appropriate actions.
|
||||
|
||||
NOTE: Default ring speed is 16MB UTP.
|
||||
|
||||
3). PnP support for this adapter sucks. I recommend hard setting the
|
||||
IO/MEM/IRQ by the jumpers on the adapter. If this is not possible
|
||||
load the module with the following io=[ioaddr] mem=[mem_addr]
|
||||
irq=[irq_num].
|
||||
|
||||
The following IRQ, IO, and MEM settings are supported.
|
||||
|
||||
IO ports:
|
||||
0x200, 0x220, 0x240, 0x260, 0x280, 0x2A0, 0x2C0, 0x2E0, 0x300,
|
||||
0x320, 0x340, 0x360, 0x380.
|
||||
|
||||
IRQs:
|
||||
2, 3, 4, 5, 7, 8, 9, 10, 11, 12, 13, 14, 15
|
||||
|
||||
Memory addresses:
|
||||
0xA0000, 0xA4000, 0xA8000, 0xAC000, 0xB0000, 0xB4000,
|
||||
0xB8000, 0xBC000, 0xC0000, 0xC4000, 0xC8000, 0xCC000,
|
||||
0xD0000, 0xD4000, 0xD8000, 0xDC000, 0xE0000, 0xE4000,
|
||||
0xE8000, 0xEC000, 0xF0000, 0xF4000, 0xF8000, 0xFC000
|
||||
|
||||
This driver is under the GNU General Public License. Its Firmware image is
|
||||
included as an initialized C-array and is licensed by SMC to the Linux
|
||||
users of this driver. However no warranty about its fitness is expressed or
|
||||
implied by SMC.
|
|
@ -1,147 +0,0 @@
|
|||
Text file for the Linux SysKonnect Token Ring ISA/PCI Adapter Driver.
|
||||
Text file by: Jay Schulist <jschlst@samba.org>
|
||||
|
||||
The Linux SysKonnect Token Ring driver works with the SysKonnect TR4/16(+) ISA,
|
||||
SysKonnect TR4/16(+) PCI, SysKonnect TR4/16 PCI, and older revisions of the
|
||||
SK NET TR4/16 ISA card.
|
||||
|
||||
Latest information on this driver can be obtained on the Linux-SNA WWW site.
|
||||
Please point your browser to:
|
||||
http://www.linux-sna.org
|
||||
|
||||
Many thanks to Christoph Goos for his excellent work on this driver and
|
||||
SysKonnect for donating the adapters to Linux-SNA for the testing and
|
||||
maintenance of this device driver.
|
||||
|
||||
Important information to be noted:
|
||||
1. Adapters can be slow to open (~20 secs) and close (~5 secs), please be
|
||||
patient.
|
||||
2. This driver works very well when autoprobing for adapters. Why even
|
||||
think about those nasty io/int/dma settings of modprobe when the driver
|
||||
will do it all for you!
|
||||
|
||||
This driver is rather simple to use. Select Y to Token Ring adapter support
|
||||
in the kernel configuration. A choice for SysKonnect Token Ring adapters will
|
||||
appear. This drives supports all SysKonnect ISA and PCI adapters. Choose this
|
||||
option. I personally recommend compiling the driver as a module (M), but if you
|
||||
you would like to compile it statically answer Y instead.
|
||||
|
||||
This driver supports multiple adapters without the need to load multiple copies
|
||||
of the driver. You should be able to load up to 7 adapters without any kernel
|
||||
modifications, if you are in need of more please contact the maintainer of this
|
||||
driver.
|
||||
|
||||
Load the driver either by lilo/loadlin or as a module. When a module using the
|
||||
following command will suffice for most:
|
||||
|
||||
# modprobe sktr
|
||||
|
||||
This will produce output similar to the following: (Output is user specific)
|
||||
|
||||
sktr.c: v1.01 08/29/97 by Christoph Goos
|
||||
tr0: SK NET TR 4/16 PCI found at 0x6100, using IRQ 17.
|
||||
tr1: SK NET TR 4/16 PCI found at 0x6200, using IRQ 16.
|
||||
tr2: SK NET TR 4/16 ISA found at 0xa20, using IRQ 10 and DMA 5.
|
||||
|
||||
Now just setup the device via ifconfig and set and routes you may have. After
|
||||
this you are ready to start sending some tokens.
|
||||
|
||||
Errata:
|
||||
For anyone wondering where to pick up the SysKonnect adapters please browse
|
||||
to http://www.syskonnect.com
|
||||
|
||||
This driver is under the GNU General Public License. Its Firmware image is
|
||||
included as an initialized C-array and is licensed by SysKonnect to the Linux
|
||||
users of this driver. However no warranty about its fitness is expressed or
|
||||
implied by SysKonnect.
|
||||
|
||||
Below find attached the setting for the SK NET TR 4/16 ISA adapters
|
||||
-------------------------------------------------------------------
|
||||
|
||||
***************************
|
||||
*** C O N T E N T S ***
|
||||
***************************
|
||||
|
||||
1) Location of DIP-Switch W1
|
||||
2) Default settings
|
||||
3) DIP-Switch W1 description
|
||||
|
||||
|
||||
==============================================================
|
||||
CHAPTER 1 LOCATION OF DIP-SWITCH
|
||||
==============================================================
|
||||
|
||||
UÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
|
||||
þUÄÄÄÄÄÄ¿ UÄÄÄÄÄ¿ UÄÄÄ¿ þ
|
||||
þAÄÄÄÄÄÄU W1 AÄÄÄÄÄU UÄÄÄÄ¿ þ þ þ
|
||||
þUÄÄÄÄÄÄ¿ þ þ þ þ UÄÄÅ¿
|
||||
þAÄÄÄÄÄÄU UÄÄÄÄÄÄÄÄÄÄÄ¿ AÄÄÄÄU þ þ þ þþ
|
||||
þUÄÄÄÄÄÄ¿ þ þ UÄÄÄ¿ AÄÄÄU AÄÄÅU
|
||||
þAÄÄÄÄÄÄU þ TMS380C26 þ þ þ þ
|
||||
þUÄÄÄÄÄÄ¿ þ þ AÄÄÄU AÄ¿
|
||||
þAÄÄÄÄÄÄU þ þ þ þ
|
||||
þ AÄÄÄÄÄÄÄÄÄÄÄU þ þ
|
||||
þ þ þ
|
||||
þ AÄU
|
||||
þ þ
|
||||
þ þ
|
||||
þ þ
|
||||
þ þ
|
||||
AÄÄÄÄÄÄÄÄÄÄÄÄAÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄAÄÄAÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄAÄÄÄÄÄÄÄÄÄU
|
||||
AÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄU AÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄU
|
||||
|
||||
==============================================================
|
||||
CHAPTER 2 DEFAULT SETTINGS
|
||||
==============================================================
|
||||
|
||||
W1 1 2 3 4 5 6 7 8
|
||||
+------------------------------+
|
||||
| ON X |
|
||||
| OFF X X X X X X X |
|
||||
+------------------------------+
|
||||
|
||||
W1.1 = ON Adapter drives address lines SA17..19
|
||||
W1.2 - 1.5 = OFF BootROM disabled
|
||||
W1.6 - 1.8 = OFF I/O address 0A20h
|
||||
|
||||
==============================================================
|
||||
CHAPTER 3 DIP SWITCH W1 DESCRIPTION
|
||||
==============================================================
|
||||
|
||||
UÄÄÄAÄÄÄAÄÄÄAÄÄÄAÄÄÄAÄÄÄAÄÄÄAÄÄÄ¿ ON
|
||||
þ 1 þ 2 þ 3 þ 4 þ 5 þ 6 þ 7 þ 8 þ
|
||||
AÄÄÄAÄÄÄAÄÄÄAÄÄÄAÄÄÄAÄÄÄAÄÄÄAÄÄÄU OFF
|
||||
|AD | BootROM Addr. | I/O |
|
||||
+-+-+-------+-------+-----+-----+
|
||||
| | |
|
||||
| | +------ 6 7 8
|
||||
| | ON ON ON 1900h
|
||||
| | ON ON OFF 0900h
|
||||
| | ON OFF ON 1980h
|
||||
| | ON OFF OFF 0980h
|
||||
| | OFF ON ON 1b20h
|
||||
| | OFF ON OFF 0b20h
|
||||
| | OFF OFF ON 1a20h
|
||||
| | OFF OFF OFF 0a20h (+)
|
||||
| |
|
||||
| |
|
||||
| +-------- 2 3 4 5
|
||||
| OFF x x x disabled (+)
|
||||
| ON ON ON ON C0000
|
||||
| ON ON ON OFF C4000
|
||||
| ON ON OFF ON C8000
|
||||
| ON ON OFF OFF CC000
|
||||
| ON OFF ON ON D0000
|
||||
| ON OFF ON OFF D4000
|
||||
| ON OFF OFF ON D8000
|
||||
| ON OFF OFF OFF DC000
|
||||
|
|
||||
|
|
||||
+----- 1
|
||||
OFF adapter does NOT drive SA<17..19>
|
||||
ON adapter drives SA<17..19> (+)
|
||||
|
||||
|
||||
(+) means default setting
|
||||
|
||||
********************************
|
|
@ -346,11 +346,8 @@ CONFIG_CHELSIO_T1=m
|
|||
CONFIG_IXGB=m
|
||||
CONFIG_S2IO=m
|
||||
CONFIG_MYRI10GE=m
|
||||
CONFIG_TR=y
|
||||
CONFIG_IBMOL=m
|
||||
CONFIG_IBMLS=m
|
||||
CONFIG_3C359=m
|
||||
CONFIG_TMS380TR=m
|
||||
CONFIG_TMSPCI=m
|
||||
CONFIG_ABYSS=m
|
||||
CONFIG_USB_CATC=m
|
||||
|
@ -376,7 +373,6 @@ CONFIG_PCMCIA_SMC91C92=m
|
|||
CONFIG_PCMCIA_XIRC2PS=m
|
||||
CONFIG_PCMCIA_AXNET=m
|
||||
CONFIG_ARCNET_COM20020_CS=m
|
||||
CONFIG_PCMCIA_IBMTR=m
|
||||
CONFIG_WAN=y
|
||||
CONFIG_LANMEDIA=m
|
||||
CONFIG_HDLC=m
|
||||
|
|
|
@ -332,11 +332,6 @@ CONFIG_XT2000_SONIC=y
|
|||
# CONFIG_IXGB is not set
|
||||
# CONFIG_S2IO is not set
|
||||
|
||||
#
|
||||
# Token Ring devices
|
||||
#
|
||||
# CONFIG_TR is not set
|
||||
|
||||
#
|
||||
# Wireless LAN (non-hamradio)
|
||||
#
|
||||
|
|
|
@ -69,7 +69,6 @@
|
|||
#include <linux/spinlock.h>
|
||||
#include <linux/workqueue.h>
|
||||
#include <linux/delay.h>
|
||||
// #include <linux/trdevice.h>
|
||||
|
||||
#include <asm/uaccess.h>
|
||||
#include <asm/io.h>
|
||||
|
|
|
@ -282,8 +282,6 @@ source "drivers/net/slip/Kconfig"
|
|||
|
||||
source "drivers/s390/net/Kconfig"
|
||||
|
||||
source "drivers/net/tokenring/Kconfig"
|
||||
|
||||
source "drivers/net/usb/Kconfig"
|
||||
|
||||
source "drivers/net/wireless/Kconfig"
|
||||
|
|
|
@ -50,7 +50,6 @@ obj-$(CONFIG_SLIP) += slip/
|
|||
obj-$(CONFIG_SLHC) += slip/
|
||||
obj-$(CONFIG_NET_SB1000) += sb1000.o
|
||||
obj-$(CONFIG_SUNGEM_PHY) += sungem_phy.o
|
||||
obj-$(CONFIG_TR) += tokenring/
|
||||
obj-$(CONFIG_WAN) += wan/
|
||||
obj-$(CONFIG_WLAN) += wireless/
|
||||
obj-$(CONFIG_WIMAX) += wimax/
|
||||
|
|
|
@ -29,7 +29,6 @@
|
|||
*/
|
||||
#include <linux/netdevice.h>
|
||||
#include <linux/etherdevice.h>
|
||||
#include <linux/trdevice.h>
|
||||
#include <linux/errno.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/netlink.h>
|
||||
|
@ -284,46 +283,6 @@ static void __init ethif_probe2(int unit)
|
|||
probe_list2(unit, parport_probes, base_addr == 0));
|
||||
}
|
||||
|
||||
#ifdef CONFIG_TR
|
||||
/* Token-ring device probe */
|
||||
extern int ibmtr_probe_card(struct net_device *);
|
||||
extern struct net_device *smctr_probe(int unit);
|
||||
|
||||
static struct devprobe2 tr_probes2[] __initdata = {
|
||||
#ifdef CONFIG_SMCTR
|
||||
{smctr_probe, 0},
|
||||
#endif
|
||||
{NULL, 0},
|
||||
};
|
||||
|
||||
static __init int trif_probe(int unit)
|
||||
{
|
||||
int err = -ENODEV;
|
||||
#ifdef CONFIG_IBMTR
|
||||
struct net_device *dev = alloc_trdev(0);
|
||||
if (!dev)
|
||||
return -ENOMEM;
|
||||
|
||||
sprintf(dev->name, "tr%d", unit);
|
||||
netdev_boot_setup_check(dev);
|
||||
err = ibmtr_probe_card(dev);
|
||||
if (err)
|
||||
free_netdev(dev);
|
||||
#endif
|
||||
return err;
|
||||
}
|
||||
|
||||
static void __init trif_probe2(int unit)
|
||||
{
|
||||
unsigned long base_addr = netdev_boot_base("tr", unit);
|
||||
|
||||
if (base_addr == 1)
|
||||
return;
|
||||
probe_list2(unit, tr_probes2, base_addr == 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/* Statically configured drivers -- order matters here. */
|
||||
static int __init net_olddevs_init(void)
|
||||
{
|
||||
|
@ -332,11 +291,6 @@ static int __init net_olddevs_init(void)
|
|||
#ifdef CONFIG_SBNI
|
||||
for (num = 0; num < 8; ++num)
|
||||
sbni_probe(num);
|
||||
#endif
|
||||
#ifdef CONFIG_TR
|
||||
for (num = 0; num < 8; ++num)
|
||||
if (!trif_probe(num))
|
||||
trif_probe2(num);
|
||||
#endif
|
||||
for (num = 0; num < 8; ++num)
|
||||
ethif_probe2(num);
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1,291 +0,0 @@
|
|||
/*
|
||||
* 3c359.h (c) 2000 Mike Phillips (mikep@linuxtr.net) All Rights Reserved
|
||||
*
|
||||
* Linux driver for 3Com 3C359 Token Link PCI XL cards.
|
||||
*
|
||||
* This software may be used and distributed according to the terms
|
||||
* of the GNU General Public License Version 2 or (at your option)
|
||||
* any later verion, incorporated herein by reference.
|
||||
*/
|
||||
|
||||
/* Memory Access Commands */
|
||||
#define IO_BYTE_READ 0x28 << 24
|
||||
#define IO_BYTE_WRITE 0x18 << 24
|
||||
#define IO_WORD_READ 0x20 << 24
|
||||
#define IO_WORD_WRITE 0x10 << 24
|
||||
#define MMIO_BYTE_READ 0x88 << 24
|
||||
#define MMIO_BYTE_WRITE 0x48 << 24
|
||||
#define MMIO_WORD_READ 0x80 << 24
|
||||
#define MMIO_WORD_WRITE 0x40 << 24
|
||||
#define MEM_BYTE_READ 0x8C << 24
|
||||
#define MEM_BYTE_WRITE 0x4C << 24
|
||||
#define MEM_WORD_READ 0x84 << 24
|
||||
#define MEM_WORD_WRITE 0x44 << 24
|
||||
|
||||
#define PMBAR 0x1C80
|
||||
#define PMB_CPHOLD (1<<10)
|
||||
|
||||
#define CPATTENTION 0x180D
|
||||
#define CPA_PMBARVIS (1<<7)
|
||||
#define CPA_MEMWREN (1<<6)
|
||||
|
||||
#define SWITCHSETTINGS 0x1C88
|
||||
#define EECONTROL 0x1C8A
|
||||
#define EEDATA 0x1C8C
|
||||
#define EEREAD 0x0080
|
||||
#define EEWRITE 0x0040
|
||||
#define EEERASE 0x0060
|
||||
#define EE_ENABLE_WRITE 0x0030
|
||||
#define EEBUSY (1<<15)
|
||||
|
||||
#define WRBR 0xCDE02
|
||||
#define WWOR 0xCDE04
|
||||
#define WWCR 0xCDE06
|
||||
#define MACSTATUS 0xCDE08
|
||||
#define MISR_RW 0xCDE0B
|
||||
#define MISR_AND 0xCDE2B
|
||||
#define MISR_SET 0xCDE4B
|
||||
#define RXBUFAREA 0xCDE10
|
||||
#define RXEARLYTHRESH 0xCDE12
|
||||
#define TXSTARTTHRESH 0x58
|
||||
#define DNPRIREQTHRESH 0x2C
|
||||
|
||||
#define MISR_CSRB (1<<5)
|
||||
#define MISR_RASB (1<<4)
|
||||
#define MISR_SRBFR (1<<3)
|
||||
#define MISR_ASBFR (1<<2)
|
||||
#define MISR_ARBF (1<<1)
|
||||
|
||||
/* MISR Flags memory locations */
|
||||
#define MF_SSBF 0xDFFE0
|
||||
#define MF_ARBF 0xDFFE1
|
||||
#define MF_ASBFR 0xDFFE2
|
||||
#define MF_SRBFR 0xDFFE3
|
||||
#define MF_RASB 0xDFFE4
|
||||
#define MF_CSRB 0xDFFE5
|
||||
|
||||
#define MMIO_MACDATA 0x10
|
||||
#define MMIO_MAC_ACCESS_CMD 0x14
|
||||
#define MMIO_TIMER 0x1A
|
||||
#define MMIO_DMA_CTRL 0x20
|
||||
#define MMIO_DNLISTPTR 0x24
|
||||
#define MMIO_HASHFILTER 0x28
|
||||
#define MMIO_CONFIG 0x29
|
||||
#define MMIO_DNPRIREQTHRESH 0x2C
|
||||
#define MMIO_DNPOLL 0x2D
|
||||
#define MMIO_UPPKTSTATUS 0x30
|
||||
#define MMIO_FREETIMER 0x34
|
||||
#define MMIO_COUNTDOWN 0x36
|
||||
#define MMIO_UPLISTPTR 0x38
|
||||
#define MMIO_UPPOLL 0x3C
|
||||
#define MMIO_UPBURSTTHRESH 0x40
|
||||
#define MMIO_DNBURSTTHRESH 0x41
|
||||
#define MMIO_INTSTATUS_AUTO 0x56
|
||||
#define MMIO_TXSTARTTHRESH 0x58
|
||||
#define MMIO_INTERRUPTENABLE 0x5A
|
||||
#define MMIO_INDICATIONENABLE 0x5C
|
||||
#define MMIO_COMMAND 0x5E /* These two are meant to be the same */
|
||||
#define MMIO_INTSTATUS 0x5E /* Makes the code more readable this way */
|
||||
#define INTSTAT_CMD_IN_PROGRESS (1<<12)
|
||||
#define INTSTAT_SRB (1<<14)
|
||||
#define INTSTAT_INTLATCH (1<<0)
|
||||
|
||||
/* Indication / Interrupt Mask
|
||||
* Annoyingly the bits to be set in the indication and interrupt enable
|
||||
* do not match with the actual bits received in the interrupt, although
|
||||
* they are in the same order.
|
||||
* The mapping for the indication / interrupt are:
|
||||
* Bit Indication / Interrupt
|
||||
* 0 HostError
|
||||
* 1 txcomplete
|
||||
* 2 updneeded
|
||||
* 3 rxcomplete
|
||||
* 4 intrequested
|
||||
* 5 macerror
|
||||
* 6 dncomplete
|
||||
* 7 upcomplete
|
||||
* 8 txunderrun
|
||||
* 9 asbf
|
||||
* 10 srbr
|
||||
* 11 arbc
|
||||
*
|
||||
* The only ones we don't want to receive are txcomplete and rxcomplete
|
||||
* we use dncomplete and upcomplete instead.
|
||||
*/
|
||||
|
||||
#define INT_MASK 0xFF5
|
||||
|
||||
/* Note the subtle difference here, IND and INT */
|
||||
|
||||
#define SETINDENABLE (8<<12)
|
||||
#define SETINTENABLE (7<<12)
|
||||
#define SRBBIT (1<<10)
|
||||
#define ASBBIT (1<<9)
|
||||
#define ARBBIT (1<<11)
|
||||
|
||||
#define SRB 0xDFE90
|
||||
#define ASB 0xDFED0
|
||||
#define ARB 0xD0000
|
||||
#define SCRATCH 0xDFEF0
|
||||
|
||||
#define INT_REQUEST 0x6000 /* (6 << 12) */
|
||||
#define ACK_INTERRUPT 0x6800 /* (13 <<11) */
|
||||
#define GLOBAL_RESET 0x00
|
||||
#define DNDISABLE 0x5000
|
||||
#define DNENABLE 0x4800
|
||||
#define DNSTALL 0x3002
|
||||
#define DNRESET 0x5800
|
||||
#define DNUNSTALL 0x3003
|
||||
#define UPRESET 0x2800
|
||||
#define UPSTALL 0x3000
|
||||
#define UPUNSTALL 0x3001
|
||||
#define SETCONFIG 0x4000
|
||||
#define SETTXSTARTTHRESH 0x9800
|
||||
|
||||
/* Received Interrupts */
|
||||
#define ASBFINT (1<<13)
|
||||
#define SRBRINT (1<<14)
|
||||
#define ARBCINT (1<<15)
|
||||
#define TXUNDERRUN (1<<11)
|
||||
|
||||
#define UPCOMPINT (1<<10)
|
||||
#define DNCOMPINT (1<<9)
|
||||
#define HARDERRINT (1<<7)
|
||||
#define RXCOMPLETE (1<<4)
|
||||
#define TXCOMPINT (1<<2)
|
||||
#define HOSTERRINT (1<<1)
|
||||
|
||||
/* Receive descriptor bits */
|
||||
#define RXOVERRUN cpu_to_le32(1<<19)
|
||||
#define RXFC cpu_to_le32(1<<21)
|
||||
#define RXAR cpu_to_le32(1<<22)
|
||||
#define RXUPDCOMPLETE cpu_to_le32(1<<23)
|
||||
#define RXUPDFULL cpu_to_le32(1<<24)
|
||||
#define RXUPLASTFRAG cpu_to_le32(1<<31)
|
||||
|
||||
/* Transmit descriptor bits */
|
||||
#define TXDNCOMPLETE cpu_to_le32(1<<16)
|
||||
#define TXTXINDICATE cpu_to_le32(1<<27)
|
||||
#define TXDPDEMPTY cpu_to_le32(1<<29)
|
||||
#define TXDNINDICATE cpu_to_le32(1<<31)
|
||||
#define TXDNFRAGLAST cpu_to_le32(1<<31)
|
||||
|
||||
/* Interrupts to Acknowledge */
|
||||
#define LATCH_ACK 1
|
||||
#define TXCOMPACK (1<<1)
|
||||
#define INTREQACK (1<<2)
|
||||
#define DNCOMPACK (1<<3)
|
||||
#define UPCOMPACK (1<<4)
|
||||
#define ASBFACK (1<<5)
|
||||
#define SRBRACK (1<<6)
|
||||
#define ARBCACK (1<<7)
|
||||
|
||||
#define XL_IO_SPACE 128
|
||||
#define SRB_COMMAND_SIZE 50
|
||||
|
||||
/* Adapter Commands */
|
||||
#define REQUEST_INT 0x00
|
||||
#define MODIFY_OPEN_PARMS 0x01
|
||||
#define RESTORE_OPEN_PARMS 0x02
|
||||
#define OPEN_NIC 0x03
|
||||
#define CLOSE_NIC 0x04
|
||||
#define SET_SLEEP_MODE 0x05
|
||||
#define SET_GROUP_ADDRESS 0x06
|
||||
#define SET_FUNC_ADDRESS 0x07
|
||||
#define READ_LOG 0x08
|
||||
#define SET_MULTICAST_MODE 0x0C
|
||||
#define CHANGE_WAKEUP_PATTERN 0x0D
|
||||
#define GET_STATISTICS 0x13
|
||||
#define SET_RECEIVE_MODE 0x1F
|
||||
|
||||
/* ARB Commands */
|
||||
#define RECEIVE_DATA 0x81
|
||||
#define RING_STATUS_CHANGE 0x84
|
||||
|
||||
/* ASB Commands */
|
||||
#define ASB_RECEIVE_DATE 0x81
|
||||
|
||||
/* Defines for LAN STATUS CHANGE reports */
|
||||
#define LSC_SIG_LOSS 0x8000
|
||||
#define LSC_HARD_ERR 0x4000
|
||||
#define LSC_SOFT_ERR 0x2000
|
||||
#define LSC_TRAN_BCN 0x1000
|
||||
#define LSC_LWF 0x0800
|
||||
#define LSC_ARW 0x0400
|
||||
#define LSC_FPE 0x0200
|
||||
#define LSC_RR 0x0100
|
||||
#define LSC_CO 0x0080
|
||||
#define LSC_SS 0x0040
|
||||
#define LSC_RING_REC 0x0020
|
||||
#define LSC_SR_CO 0x0010
|
||||
#define LSC_FDX_MODE 0x0004
|
||||
|
||||
#define XL_MAX_ADAPTERS 8 /* 0x08 __MODULE_STRING can't hand 0xnn */
|
||||
|
||||
/* 3c359 defaults for buffers */
|
||||
|
||||
#define XL_RX_RING_SIZE 16 /* must be a power of 2 */
|
||||
#define XL_TX_RING_SIZE 16 /* must be a power of 2 */
|
||||
|
||||
#define PKT_BUF_SZ 4096 /* Default packet size */
|
||||
|
||||
/* 3c359 data structures */
|
||||
|
||||
struct xl_tx_desc {
|
||||
__le32 dnnextptr;
|
||||
__le32 framestartheader;
|
||||
__le32 buffer;
|
||||
__le32 buffer_length;
|
||||
};
|
||||
|
||||
struct xl_rx_desc {
|
||||
__le32 upnextptr;
|
||||
__le32 framestatus;
|
||||
__le32 upfragaddr;
|
||||
__le32 upfraglen;
|
||||
};
|
||||
|
||||
struct xl_private {
|
||||
|
||||
|
||||
/* These two structures must be aligned on 8 byte boundaries */
|
||||
|
||||
/* struct xl_rx_desc xl_rx_ring[XL_RX_RING_SIZE]; */
|
||||
/* struct xl_tx_desc xl_tx_ring[XL_TX_RING_SIZE]; */
|
||||
struct xl_rx_desc *xl_rx_ring ;
|
||||
struct xl_tx_desc *xl_tx_ring ;
|
||||
struct sk_buff *tx_ring_skb[XL_TX_RING_SIZE], *rx_ring_skb[XL_RX_RING_SIZE];
|
||||
int tx_ring_head, tx_ring_tail ;
|
||||
int rx_ring_tail, rx_ring_no ;
|
||||
int free_ring_entries ;
|
||||
|
||||
u16 srb;
|
||||
u16 arb;
|
||||
u16 asb;
|
||||
|
||||
u8 __iomem *xl_mmio;
|
||||
const char *xl_card_name;
|
||||
struct pci_dev *pdev ;
|
||||
|
||||
spinlock_t xl_lock ;
|
||||
|
||||
volatile int srb_queued;
|
||||
struct wait_queue *srb_wait;
|
||||
volatile int asb_queued;
|
||||
|
||||
u16 mac_buffer ;
|
||||
u16 xl_lan_status ;
|
||||
u8 xl_ring_speed ;
|
||||
u16 pkt_buf_sz ;
|
||||
u8 xl_message_level;
|
||||
u16 xl_copy_all_options ;
|
||||
unsigned char xl_functional_addr[4] ;
|
||||
u16 xl_addr_table_addr, xl_parms_addr ;
|
||||
u8 xl_laa[6] ;
|
||||
u32 rx_ring_dma_addr ;
|
||||
u32 tx_ring_dma_addr ;
|
||||
|
||||
/* firmware section */
|
||||
const struct firmware *fw;
|
||||
};
|
||||
|
|
@ -1,199 +0,0 @@
|
|||
#
|
||||
# Token Ring driver configuration
|
||||
#
|
||||
|
||||
# So far, we only have PCI, ISA, and MCA token ring devices
|
||||
menuconfig TR
|
||||
bool "Token Ring driver support"
|
||||
depends on NETDEVICES && !UML
|
||||
depends on (PCI || ISA || MCA || CCW || PCMCIA)
|
||||
help
|
||||
Token Ring is IBM's way of communication on a local network; the
|
||||
rest of the world uses Ethernet. To participate on a Token Ring
|
||||
network, you need a special Token ring network card. If you are
|
||||
connected to such a Token Ring network and want to use your Token
|
||||
Ring card under Linux, say Y here and to the driver for your
|
||||
particular card below and read the Token-Ring mini-HOWTO, available
|
||||
from <http://www.tldp.org/docs.html#howto>. Most people can
|
||||
say N here.
|
||||
|
||||
if TR
|
||||
|
||||
config WANT_LLC
|
||||
def_bool y
|
||||
select LLC
|
||||
|
||||
config PCMCIA_IBMTR
|
||||
tristate "IBM PCMCIA tokenring adapter support"
|
||||
depends on IBMTR!=y && PCMCIA
|
||||
---help---
|
||||
Say Y here if you intend to attach this type of Token Ring PCMCIA
|
||||
card to your computer. You then also need to say Y to "Token Ring
|
||||
driver support".
|
||||
|
||||
To compile this driver as a module, choose M here: the module will be
|
||||
called ibmtr_cs.
|
||||
|
||||
config IBMTR
|
||||
tristate "IBM Tropic chipset based adapter support"
|
||||
depends on ISA || MCA
|
||||
---help---
|
||||
This is support for all IBM Token Ring cards that don't use DMA. If
|
||||
you have such a beast, say Y and read the Token-Ring mini-HOWTO,
|
||||
available from <http://www.tldp.org/docs.html#howto>.
|
||||
|
||||
Warning: this driver will almost definitely fail if more than one
|
||||
active Token Ring card is present.
|
||||
|
||||
To compile this driver as a module, choose M here: the module will be
|
||||
called ibmtr.
|
||||
|
||||
config IBMOL
|
||||
tristate "IBM Olympic chipset PCI adapter support"
|
||||
depends on PCI
|
||||
---help---
|
||||
This is support for all non-Lanstreamer IBM PCI Token Ring Cards.
|
||||
Specifically this is all IBM PCI, PCI Wake On Lan, PCI II, PCI II
|
||||
Wake On Lan, and PCI 100/16/4 adapters.
|
||||
|
||||
If you have such an adapter, say Y and read the Token-Ring
|
||||
mini-HOWTO, available from <http://www.tldp.org/docs.html#howto>.
|
||||
|
||||
To compile this driver as a module, choose M here: the module will be
|
||||
called olympic.
|
||||
|
||||
Also read <file:Documentation/networking/olympic.txt> or check the
|
||||
Linux Token Ring Project site for the latest information at
|
||||
<http://www.linuxtr.net/>.
|
||||
|
||||
config IBMLS
|
||||
tristate "IBM Lanstreamer chipset PCI adapter support"
|
||||
depends on PCI && !64BIT
|
||||
help
|
||||
This is support for IBM Lanstreamer PCI Token Ring Cards.
|
||||
|
||||
If you have such an adapter, say Y and read the Token-Ring
|
||||
mini-HOWTO, available from <http://www.tldp.org/docs.html#howto>.
|
||||
|
||||
To compile this driver as a module, choose M here: the module will be
|
||||
called lanstreamer.
|
||||
|
||||
config 3C359
|
||||
tristate "3Com 3C359 Token Link Velocity XL adapter support"
|
||||
depends on PCI
|
||||
---help---
|
||||
This is support for the 3Com PCI Velocity XL cards, specifically
|
||||
the 3Com 3C359, please note this is not for the 3C339 cards, you
|
||||
should use the tms380 driver instead.
|
||||
|
||||
If you have such an adapter, say Y and read the Token-Ring
|
||||
mini-HOWTO, available from <http://www.tldp.org/docs.html#howto>.
|
||||
|
||||
To compile this driver as a module, choose M here: the module will be
|
||||
called 3c359.
|
||||
|
||||
Also read the file <file:Documentation/networking/3c359.txt> or check the
|
||||
Linux Token Ring Project site for the latest information at
|
||||
<http://www.linuxtr.net>
|
||||
|
||||
config TMS380TR
|
||||
tristate "Generic TMS380 Token Ring ISA/PCI adapter support"
|
||||
depends on PCI || ISA || MCA
|
||||
select FW_LOADER
|
||||
---help---
|
||||
This driver provides generic support for token ring adapters
|
||||
based on the Texas Instruments TMS380 series chipsets. This
|
||||
includes the SysKonnect TR4/16(+) ISA (SK-4190), SysKonnect
|
||||
TR4/16(+) PCI (SK-4590), SysKonnect TR4/16 PCI (SK-4591),
|
||||
Compaq 4/16 PCI, Thomas-Conrad TC4048 4/16 PCI, and several
|
||||
Madge adapters. If you say Y here, you will be asked to select
|
||||
which cards to support below. If you're using modules, each
|
||||
class of card will be supported by a separate module.
|
||||
|
||||
If you have such an adapter and would like to use it, say Y and
|
||||
read the Token-Ring mini-HOWTO, available from
|
||||
<http://www.tldp.org/docs.html#howto>.
|
||||
|
||||
Also read the file <file:Documentation/networking/tms380tr.txt> or
|
||||
check <http://www.auk.cx/tms380tr/>.
|
||||
|
||||
To compile this driver as a module, choose M here: the module will be
|
||||
called tms380tr.
|
||||
|
||||
config TMSPCI
|
||||
tristate "Generic TMS380 PCI support"
|
||||
depends on TMS380TR && PCI
|
||||
---help---
|
||||
This tms380 module supports generic TMS380-based PCI cards.
|
||||
|
||||
These cards are known to work:
|
||||
- Compaq 4/16 TR PCI
|
||||
- SysKonnect TR4/16 PCI (SK-4590/SK-4591)
|
||||
- Thomas-Conrad TC4048 PCI 4/16
|
||||
- 3Com Token Link Velocity
|
||||
|
||||
To compile this driver as a module, choose M here: the module will be
|
||||
called tmspci.
|
||||
|
||||
config SKISA
|
||||
tristate "SysKonnect TR4/16 ISA support"
|
||||
depends on TMS380TR && ISA && ISA_DMA_API
|
||||
help
|
||||
This tms380 module supports SysKonnect TR4/16 ISA cards.
|
||||
|
||||
These cards are known to work:
|
||||
- SysKonnect TR4/16 ISA (SK-4190)
|
||||
|
||||
To compile this driver as a module, choose M here: the module will be
|
||||
called skisa.
|
||||
|
||||
config PROTEON
|
||||
tristate "Proteon ISA support"
|
||||
depends on TMS380TR && ISA && ISA_DMA_API
|
||||
help
|
||||
This tms380 module supports Proteon ISA cards.
|
||||
|
||||
These cards are known to work:
|
||||
- Proteon 1392
|
||||
- Proteon 1392 plus
|
||||
|
||||
To compile this driver as a module, choose M here: the module will be
|
||||
called proteon.
|
||||
|
||||
config ABYSS
|
||||
tristate "Madge Smart 16/4 PCI Mk2 support"
|
||||
depends on TMS380TR && PCI
|
||||
help
|
||||
This tms380 module supports the Madge Smart 16/4 PCI Mk2
|
||||
cards (51-02).
|
||||
|
||||
To compile this driver as a module, choose M here: the module will be
|
||||
called abyss.
|
||||
|
||||
config MADGEMC
|
||||
tristate "Madge Smart 16/4 Ringnode MicroChannel"
|
||||
depends on TMS380TR && MCA
|
||||
help
|
||||
This tms380 module supports the Madge Smart 16/4 MC16 and MC32
|
||||
MicroChannel adapters.
|
||||
|
||||
To compile this driver as a module, choose M here: the module will be
|
||||
called madgemc.
|
||||
|
||||
config SMCTR
|
||||
tristate "SMC ISA/MCA adapter support"
|
||||
depends on (ISA || MCA_LEGACY) && (BROKEN || !64BIT)
|
||||
---help---
|
||||
This is support for the ISA and MCA SMC Token Ring cards,
|
||||
specifically SMC TokenCard Elite (8115T) and SMC TokenCard Elite/A
|
||||
(8115T/A) adapters.
|
||||
|
||||
If you have such an adapter and would like to use it, say Y or M and
|
||||
read the Token-Ring mini-HOWTO, available from
|
||||
<http://www.tldp.org/docs.html#howto> and the file
|
||||
<file:Documentation/networking/smctr.txt>.
|
||||
|
||||
To compile this driver as a module, choose M here: the module will be
|
||||
called smctr.
|
||||
|
||||
endif # TR
|
|
@ -1,16 +0,0 @@
|
|||
#
|
||||
# Makefile for drivers/net/tokenring
|
||||
#
|
||||
|
||||
obj-$(CONFIG_PCMCIA_IBMTR) += ibmtr_cs.o
|
||||
obj-$(CONFIG_IBMTR) += ibmtr.o
|
||||
obj-$(CONFIG_IBMOL) += olympic.o
|
||||
obj-$(CONFIG_IBMLS) += lanstreamer.o
|
||||
obj-$(CONFIG_TMS380TR) += tms380tr.o
|
||||
obj-$(CONFIG_ABYSS) += abyss.o
|
||||
obj-$(CONFIG_MADGEMC) += madgemc.o
|
||||
obj-$(CONFIG_PROTEON) += proteon.o
|
||||
obj-$(CONFIG_TMSPCI) += tmspci.o
|
||||
obj-$(CONFIG_SKISA) += skisa.o
|
||||
obj-$(CONFIG_SMCTR) += smctr.o
|
||||
obj-$(CONFIG_3C359) += 3c359.o
|
|
@ -1,468 +0,0 @@
|
|||
/*
|
||||
* abyss.c: Network driver for the Madge Smart 16/4 PCI Mk2 token ring card.
|
||||
*
|
||||
* Written 1999-2000 by Adam Fritzler
|
||||
*
|
||||
* This software may be used and distributed according to the terms
|
||||
* of the GNU General Public License, incorporated herein by reference.
|
||||
*
|
||||
* This driver module supports the following cards:
|
||||
* - Madge Smart 16/4 PCI Mk2
|
||||
*
|
||||
* Maintainer(s):
|
||||
* AF Adam Fritzler
|
||||
*
|
||||
* Modification History:
|
||||
* 30-Dec-99 AF Split off from the tms380tr driver.
|
||||
* 22-Jan-00 AF Updated to use indirect read/writes
|
||||
* 23-Nov-00 JG New PCI API, cleanups
|
||||
*
|
||||
*
|
||||
* TODO:
|
||||
* 1. See if we can use MMIO instead of inb/outb/inw/outw
|
||||
* 2. Add support for Mk1 (has AT24 attached to the PCI
|
||||
* config registers)
|
||||
*
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/errno.h>
|
||||
#include <linux/pci.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/netdevice.h>
|
||||
#include <linux/trdevice.h>
|
||||
|
||||
#include <asm/io.h>
|
||||
#include <asm/irq.h>
|
||||
|
||||
#include "tms380tr.h"
|
||||
#include "abyss.h" /* Madge-specific constants */
|
||||
|
||||
static char version[] __devinitdata =
|
||||
"abyss.c: v1.02 23/11/2000 by Adam Fritzler\n";
|
||||
|
||||
#define ABYSS_IO_EXTENT 64
|
||||
|
||||
static DEFINE_PCI_DEVICE_TABLE(abyss_pci_tbl) = {
|
||||
{ PCI_VENDOR_ID_MADGE, PCI_DEVICE_ID_MADGE_MK2,
|
||||
PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_NETWORK_TOKEN_RING << 8, 0x00ffffff, },
|
||||
{ } /* Terminating entry */
|
||||
};
|
||||
MODULE_DEVICE_TABLE(pci, abyss_pci_tbl);
|
||||
|
||||
MODULE_LICENSE("GPL");
|
||||
|
||||
static int abyss_open(struct net_device *dev);
|
||||
static int abyss_close(struct net_device *dev);
|
||||
static void abyss_enable(struct net_device *dev);
|
||||
static int abyss_chipset_init(struct net_device *dev);
|
||||
static void abyss_read_eeprom(struct net_device *dev);
|
||||
static unsigned short abyss_setnselout_pins(struct net_device *dev);
|
||||
|
||||
static void at24_writedatabyte(unsigned long regaddr, unsigned char byte);
|
||||
static int at24_sendfullcmd(unsigned long regaddr, unsigned char cmd, unsigned char addr);
|
||||
static int at24_sendcmd(unsigned long regaddr, unsigned char cmd);
|
||||
static unsigned char at24_readdatabit(unsigned long regaddr);
|
||||
static unsigned char at24_readdatabyte(unsigned long regaddr);
|
||||
static int at24_waitforack(unsigned long regaddr);
|
||||
static int at24_waitfornack(unsigned long regaddr);
|
||||
static void at24_setlines(unsigned long regaddr, unsigned char clock, unsigned char data);
|
||||
static void at24_start(unsigned long regaddr);
|
||||
static unsigned char at24_readb(unsigned long regaddr, unsigned char addr);
|
||||
|
||||
static unsigned short abyss_sifreadb(struct net_device *dev, unsigned short reg)
|
||||
{
|
||||
return inb(dev->base_addr + reg);
|
||||
}
|
||||
|
||||
static unsigned short abyss_sifreadw(struct net_device *dev, unsigned short reg)
|
||||
{
|
||||
return inw(dev->base_addr + reg);
|
||||
}
|
||||
|
||||
static void abyss_sifwriteb(struct net_device *dev, unsigned short val, unsigned short reg)
|
||||
{
|
||||
outb(val, dev->base_addr + reg);
|
||||
}
|
||||
|
||||
static void abyss_sifwritew(struct net_device *dev, unsigned short val, unsigned short reg)
|
||||
{
|
||||
outw(val, dev->base_addr + reg);
|
||||
}
|
||||
|
||||
static struct net_device_ops abyss_netdev_ops;
|
||||
|
||||
static int __devinit abyss_attach(struct pci_dev *pdev, const struct pci_device_id *ent)
|
||||
{
|
||||
static int versionprinted;
|
||||
struct net_device *dev;
|
||||
struct net_local *tp;
|
||||
int ret, pci_irq_line;
|
||||
unsigned long pci_ioaddr;
|
||||
|
||||
if (versionprinted++ == 0)
|
||||
printk("%s", version);
|
||||
|
||||
if (pci_enable_device(pdev))
|
||||
return -EIO;
|
||||
|
||||
/* Remove I/O space marker in bit 0. */
|
||||
pci_irq_line = pdev->irq;
|
||||
pci_ioaddr = pci_resource_start (pdev, 0);
|
||||
|
||||
/* At this point we have found a valid card. */
|
||||
|
||||
dev = alloc_trdev(sizeof(struct net_local));
|
||||
if (!dev)
|
||||
return -ENOMEM;
|
||||
|
||||
if (!request_region(pci_ioaddr, ABYSS_IO_EXTENT, dev->name)) {
|
||||
ret = -EBUSY;
|
||||
goto err_out_trdev;
|
||||
}
|
||||
|
||||
ret = request_irq(pdev->irq, tms380tr_interrupt, IRQF_SHARED,
|
||||
dev->name, dev);
|
||||
if (ret)
|
||||
goto err_out_region;
|
||||
|
||||
dev->base_addr = pci_ioaddr;
|
||||
dev->irq = pci_irq_line;
|
||||
|
||||
printk("%s: Madge Smart 16/4 PCI Mk2 (Abyss)\n", dev->name);
|
||||
printk("%s: IO: %#4lx IRQ: %d\n",
|
||||
dev->name, pci_ioaddr, dev->irq);
|
||||
/*
|
||||
* The TMS SIF registers lay 0x10 above the card base address.
|
||||
*/
|
||||
dev->base_addr += 0x10;
|
||||
|
||||
ret = tmsdev_init(dev, &pdev->dev);
|
||||
if (ret) {
|
||||
printk("%s: unable to get memory for dev->priv.\n",
|
||||
dev->name);
|
||||
goto err_out_irq;
|
||||
}
|
||||
|
||||
abyss_read_eeprom(dev);
|
||||
|
||||
printk("%s: Ring Station Address: %pM\n", dev->name, dev->dev_addr);
|
||||
|
||||
tp = netdev_priv(dev);
|
||||
tp->setnselout = abyss_setnselout_pins;
|
||||
tp->sifreadb = abyss_sifreadb;
|
||||
tp->sifreadw = abyss_sifreadw;
|
||||
tp->sifwriteb = abyss_sifwriteb;
|
||||
tp->sifwritew = abyss_sifwritew;
|
||||
|
||||
memcpy(tp->ProductID, "Madge PCI 16/4 Mk2", PROD_ID_SIZE + 1);
|
||||
|
||||
dev->netdev_ops = &abyss_netdev_ops;
|
||||
|
||||
pci_set_drvdata(pdev, dev);
|
||||
SET_NETDEV_DEV(dev, &pdev->dev);
|
||||
|
||||
ret = register_netdev(dev);
|
||||
if (ret)
|
||||
goto err_out_tmsdev;
|
||||
return 0;
|
||||
|
||||
err_out_tmsdev:
|
||||
pci_set_drvdata(pdev, NULL);
|
||||
tmsdev_term(dev);
|
||||
err_out_irq:
|
||||
free_irq(pdev->irq, dev);
|
||||
err_out_region:
|
||||
release_region(pci_ioaddr, ABYSS_IO_EXTENT);
|
||||
err_out_trdev:
|
||||
free_netdev(dev);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static unsigned short abyss_setnselout_pins(struct net_device *dev)
|
||||
{
|
||||
unsigned short val = 0;
|
||||
struct net_local *tp = netdev_priv(dev);
|
||||
|
||||
if(tp->DataRate == SPEED_4)
|
||||
val |= 0x01; /* Set 4Mbps */
|
||||
else
|
||||
val |= 0x00; /* Set 16Mbps */
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
/*
|
||||
* The following Madge boards should use this code:
|
||||
* - Smart 16/4 PCI Mk2 (Abyss)
|
||||
* - Smart 16/4 PCI Mk1 (PCI T)
|
||||
* - Smart 16/4 Client Plus PnP (Big Apple)
|
||||
* - Smart 16/4 Cardbus Mk2
|
||||
*
|
||||
* These access an Atmel AT24 SEEPROM using their glue chip registers.
|
||||
*
|
||||
*/
|
||||
static void at24_writedatabyte(unsigned long regaddr, unsigned char byte)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 8; i++) {
|
||||
at24_setlines(regaddr, 0, (byte >> (7-i))&0x01);
|
||||
at24_setlines(regaddr, 1, (byte >> (7-i))&0x01);
|
||||
at24_setlines(regaddr, 0, (byte >> (7-i))&0x01);
|
||||
}
|
||||
}
|
||||
|
||||
static int at24_sendfullcmd(unsigned long regaddr, unsigned char cmd, unsigned char addr)
|
||||
{
|
||||
if (at24_sendcmd(regaddr, cmd)) {
|
||||
at24_writedatabyte(regaddr, addr);
|
||||
return at24_waitforack(regaddr);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int at24_sendcmd(unsigned long regaddr, unsigned char cmd)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 10; i++) {
|
||||
at24_start(regaddr);
|
||||
at24_writedatabyte(regaddr, cmd);
|
||||
if (at24_waitforack(regaddr))
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static unsigned char at24_readdatabit(unsigned long regaddr)
|
||||
{
|
||||
unsigned char val;
|
||||
|
||||
at24_setlines(regaddr, 0, 1);
|
||||
at24_setlines(regaddr, 1, 1);
|
||||
val = (inb(regaddr) & AT24_DATA)?1:0;
|
||||
at24_setlines(regaddr, 1, 1);
|
||||
at24_setlines(regaddr, 0, 1);
|
||||
return val;
|
||||
}
|
||||
|
||||
static unsigned char at24_readdatabyte(unsigned long regaddr)
|
||||
{
|
||||
unsigned char data = 0;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 8; i++) {
|
||||
data <<= 1;
|
||||
data |= at24_readdatabit(regaddr);
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
static int at24_waitforack(unsigned long regaddr)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 10; i++) {
|
||||
if ((at24_readdatabit(regaddr) & 0x01) == 0x00)
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int at24_waitfornack(unsigned long regaddr)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < 10; i++) {
|
||||
if ((at24_readdatabit(regaddr) & 0x01) == 0x01)
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void at24_setlines(unsigned long regaddr, unsigned char clock, unsigned char data)
|
||||
{
|
||||
unsigned char val = AT24_ENABLE;
|
||||
if (clock)
|
||||
val |= AT24_CLOCK;
|
||||
if (data)
|
||||
val |= AT24_DATA;
|
||||
|
||||
outb(val, regaddr);
|
||||
tms380tr_wait(20); /* Very necessary. */
|
||||
}
|
||||
|
||||
static void at24_start(unsigned long regaddr)
|
||||
{
|
||||
at24_setlines(regaddr, 0, 1);
|
||||
at24_setlines(regaddr, 1, 1);
|
||||
at24_setlines(regaddr, 1, 0);
|
||||
at24_setlines(regaddr, 0, 1);
|
||||
}
|
||||
|
||||
static unsigned char at24_readb(unsigned long regaddr, unsigned char addr)
|
||||
{
|
||||
unsigned char data = 0xff;
|
||||
|
||||
if (at24_sendfullcmd(regaddr, AT24_WRITE, addr)) {
|
||||
if (at24_sendcmd(regaddr, AT24_READ)) {
|
||||
data = at24_readdatabyte(regaddr);
|
||||
if (!at24_waitfornack(regaddr))
|
||||
data = 0xff;
|
||||
}
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Enable basic functions of the Madge chipset needed
|
||||
* for initialization.
|
||||
*/
|
||||
static void abyss_enable(struct net_device *dev)
|
||||
{
|
||||
unsigned char reset_reg;
|
||||
unsigned long ioaddr;
|
||||
|
||||
ioaddr = dev->base_addr;
|
||||
reset_reg = inb(ioaddr + PCIBM2_RESET_REG);
|
||||
reset_reg |= PCIBM2_RESET_REG_CHIP_NRES;
|
||||
outb(reset_reg, ioaddr + PCIBM2_RESET_REG);
|
||||
tms380tr_wait(100);
|
||||
}
|
||||
|
||||
/*
|
||||
* Enable the functions of the Madge chipset needed for
|
||||
* full working order.
|
||||
*/
|
||||
static int abyss_chipset_init(struct net_device *dev)
|
||||
{
|
||||
unsigned char reset_reg;
|
||||
unsigned long ioaddr;
|
||||
|
||||
ioaddr = dev->base_addr;
|
||||
|
||||
reset_reg = inb(ioaddr + PCIBM2_RESET_REG);
|
||||
|
||||
reset_reg |= PCIBM2_RESET_REG_CHIP_NRES;
|
||||
outb(reset_reg, ioaddr + PCIBM2_RESET_REG);
|
||||
|
||||
reset_reg &= ~(PCIBM2_RESET_REG_CHIP_NRES |
|
||||
PCIBM2_RESET_REG_FIFO_NRES |
|
||||
PCIBM2_RESET_REG_SIF_NRES);
|
||||
outb(reset_reg, ioaddr + PCIBM2_RESET_REG);
|
||||
|
||||
tms380tr_wait(100);
|
||||
|
||||
reset_reg |= PCIBM2_RESET_REG_CHIP_NRES;
|
||||
outb(reset_reg, ioaddr + PCIBM2_RESET_REG);
|
||||
|
||||
reset_reg |= PCIBM2_RESET_REG_SIF_NRES;
|
||||
outb(reset_reg, ioaddr + PCIBM2_RESET_REG);
|
||||
|
||||
reset_reg |= PCIBM2_RESET_REG_FIFO_NRES;
|
||||
outb(reset_reg, ioaddr + PCIBM2_RESET_REG);
|
||||
|
||||
outb(PCIBM2_INT_CONTROL_REG_SINTEN |
|
||||
PCIBM2_INT_CONTROL_REG_PCI_ERR_ENABLE,
|
||||
ioaddr + PCIBM2_INT_CONTROL_REG);
|
||||
|
||||
outb(30, ioaddr + PCIBM2_FIFO_THRESHOLD);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void abyss_chipset_close(struct net_device *dev)
|
||||
{
|
||||
unsigned long ioaddr;
|
||||
|
||||
ioaddr = dev->base_addr;
|
||||
outb(0, ioaddr + PCIBM2_RESET_REG);
|
||||
}
|
||||
|
||||
/*
|
||||
* Read configuration data from the AT24 SEEPROM on Madge cards.
|
||||
*
|
||||
*/
|
||||
static void abyss_read_eeprom(struct net_device *dev)
|
||||
{
|
||||
struct net_local *tp;
|
||||
unsigned long ioaddr;
|
||||
unsigned short val;
|
||||
int i;
|
||||
|
||||
tp = netdev_priv(dev);
|
||||
ioaddr = dev->base_addr;
|
||||
|
||||
/* Must enable glue chip first */
|
||||
abyss_enable(dev);
|
||||
|
||||
val = at24_readb(ioaddr + PCIBM2_SEEPROM_REG,
|
||||
PCIBM2_SEEPROM_RING_SPEED);
|
||||
tp->DataRate = val?SPEED_4:SPEED_16; /* set open speed */
|
||||
printk("%s: SEEPROM: ring speed: %dMb/sec\n", dev->name, tp->DataRate);
|
||||
|
||||
val = at24_readb(ioaddr + PCIBM2_SEEPROM_REG,
|
||||
PCIBM2_SEEPROM_RAM_SIZE) * 128;
|
||||
printk("%s: SEEPROM: adapter RAM: %dkb\n", dev->name, val);
|
||||
|
||||
dev->addr_len = 6;
|
||||
for (i = 0; i < 6; i++)
|
||||
dev->dev_addr[i] = at24_readb(ioaddr + PCIBM2_SEEPROM_REG,
|
||||
PCIBM2_SEEPROM_BIA+i);
|
||||
}
|
||||
|
||||
static int abyss_open(struct net_device *dev)
|
||||
{
|
||||
abyss_chipset_init(dev);
|
||||
tms380tr_open(dev);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int abyss_close(struct net_device *dev)
|
||||
{
|
||||
tms380tr_close(dev);
|
||||
abyss_chipset_close(dev);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void __devexit abyss_detach (struct pci_dev *pdev)
|
||||
{
|
||||
struct net_device *dev = pci_get_drvdata(pdev);
|
||||
|
||||
BUG_ON(!dev);
|
||||
unregister_netdev(dev);
|
||||
release_region(dev->base_addr-0x10, ABYSS_IO_EXTENT);
|
||||
free_irq(dev->irq, dev);
|
||||
tmsdev_term(dev);
|
||||
free_netdev(dev);
|
||||
pci_set_drvdata(pdev, NULL);
|
||||
}
|
||||
|
||||
static struct pci_driver abyss_driver = {
|
||||
.name = "abyss",
|
||||
.id_table = abyss_pci_tbl,
|
||||
.probe = abyss_attach,
|
||||
.remove = __devexit_p(abyss_detach),
|
||||
};
|
||||
|
||||
static int __init abyss_init (void)
|
||||
{
|
||||
abyss_netdev_ops = tms380tr_netdev_ops;
|
||||
|
||||
abyss_netdev_ops.ndo_open = abyss_open;
|
||||
abyss_netdev_ops.ndo_stop = abyss_close;
|
||||
|
||||
return pci_register_driver(&abyss_driver);
|
||||
}
|
||||
|
||||
static void __exit abyss_rmmod (void)
|
||||
{
|
||||
pci_unregister_driver (&abyss_driver);
|
||||
}
|
||||
|
||||
module_init(abyss_init);
|
||||
module_exit(abyss_rmmod);
|
||||
|
|
@ -1,58 +0,0 @@
|
|||
/*
|
||||
* abyss.h: Header for the abyss tms380tr module
|
||||
*
|
||||
* Authors:
|
||||
* - Adam Fritzler
|
||||
*/
|
||||
|
||||
#ifndef __LINUX_MADGETR_H
|
||||
#define __LINUX_MADGETR_H
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
/*
|
||||
* For Madge Smart 16/4 PCI Mk2. Since we increment the base address
|
||||
* to get everything correct for the TMS SIF, we do these as negatives
|
||||
* as they fall below the SIF in addressing.
|
||||
*/
|
||||
#define PCIBM2_INT_STATUS_REG ((short)-15)/* 0x01 */
|
||||
#define PCIBM2_INT_CONTROL_REG ((short)-14)/* 0x02 */
|
||||
#define PCIBM2_RESET_REG ((short)-12)/* 0x04 */
|
||||
#define PCIBM2_SEEPROM_REG ((short)-9) /* 0x07 */
|
||||
|
||||
#define PCIBM2_INT_CONTROL_REG_SINTEN 0x02
|
||||
#define PCIBM2_INT_CONTROL_REG_PCI_ERR_ENABLE 0x80
|
||||
#define PCIBM2_INT_STATUS_REG_PCI_ERR 0x80
|
||||
|
||||
#define PCIBM2_RESET_REG_CHIP_NRES 0x01
|
||||
#define PCIBM2_RESET_REG_FIFO_NRES 0x02
|
||||
#define PCIBM2_RESET_REG_SIF_NRES 0x04
|
||||
|
||||
#define PCIBM2_FIFO_THRESHOLD 0x21
|
||||
#define PCIBM2_BURST_LENGTH 0x22
|
||||
|
||||
/*
|
||||
* Bits in PCIBM2_SEEPROM_REG.
|
||||
*/
|
||||
#define AT24_ENABLE 0x04
|
||||
#define AT24_DATA 0x02
|
||||
#define AT24_CLOCK 0x01
|
||||
|
||||
/*
|
||||
* AT24 Commands.
|
||||
*/
|
||||
#define AT24_WRITE 0xA0
|
||||
#define AT24_READ 0xA1
|
||||
|
||||
/*
|
||||
* Addresses in AT24 SEEPROM.
|
||||
*/
|
||||
#define PCIBM2_SEEPROM_BIA 0x12
|
||||
#define PCIBM2_SEEPROM_RING_SPEED 0x18
|
||||
#define PCIBM2_SEEPROM_RAM_SIZE 0x1A
|
||||
#define PCIBM2_SEEPROM_HWF1 0x1C
|
||||
#define PCIBM2_SEEPROM_HWF2 0x1E
|
||||
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
#endif /* __LINUX_MADGETR_H */
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1,370 +0,0 @@
|
|||
/*======================================================================
|
||||
|
||||
A PCMCIA token-ring driver for IBM-based cards
|
||||
|
||||
This driver supports the IBM PCMCIA Token-Ring Card.
|
||||
Written by Steve Kipisz, kipisz@vnet.ibm.com or
|
||||
bungy@ibm.net
|
||||
|
||||
Written 1995,1996.
|
||||
|
||||
This code is based on pcnet_cs.c from David Hinds.
|
||||
|
||||
V2.2.0 February 1999 - Mike Phillips phillim@amtrak.com
|
||||
|
||||
Linux V2.2.x presented significant changes to the underlying
|
||||
ibmtr.c code. Mainly the code became a lot more organized and
|
||||
modular.
|
||||
|
||||
This caused the old PCMCIA Token Ring driver to give up and go
|
||||
home early. Instead of just patching the old code to make it
|
||||
work, the PCMCIA code has been streamlined, updated and possibly
|
||||
improved.
|
||||
|
||||
This code now only contains code required for the Card Services.
|
||||
All we do here is set the card up enough so that the real ibmtr.c
|
||||
driver can find it and work with it properly.
|
||||
|
||||
i.e. We set up the io port, irq, mmio memory and shared ram
|
||||
memory. This enables ibmtr_probe in ibmtr.c to find the card and
|
||||
configure it as though it was a normal ISA and/or PnP card.
|
||||
|
||||
CHANGES
|
||||
|
||||
v2.2.5 April 1999 Mike Phillips (phillim@amtrak.com)
|
||||
Obscure bug fix, required changed to ibmtr.c not ibmtr_cs.c
|
||||
|
||||
v2.2.7 May 1999 Mike Phillips (phillim@amtrak.com)
|
||||
Updated to version 2.2.7 to match the first version of the kernel
|
||||
that the modification to ibmtr.c were incorporated into.
|
||||
|
||||
v2.2.17 July 2000 Burt Silverman (burts@us.ibm.com)
|
||||
Address translation feature of PCMCIA controller is usable so
|
||||
memory windows can be placed in High memory (meaning above
|
||||
0xFFFFF.)
|
||||
|
||||
======================================================================*/
|
||||
|
||||
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
|
||||
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/ptrace.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/string.h>
|
||||
#include <linux/timer.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/netdevice.h>
|
||||
#include <linux/trdevice.h>
|
||||
#include <linux/ibmtr.h>
|
||||
|
||||
#include <pcmcia/cistpl.h>
|
||||
#include <pcmcia/ds.h>
|
||||
|
||||
#include <asm/uaccess.h>
|
||||
#include <asm/io.h>
|
||||
|
||||
#define PCMCIA
|
||||
#include "ibmtr.c"
|
||||
|
||||
|
||||
/*====================================================================*/
|
||||
|
||||
/* Parameters that can be set with 'insmod' */
|
||||
|
||||
/* MMIO base address */
|
||||
static u_long mmiobase = 0xce000;
|
||||
|
||||
/* SRAM base address */
|
||||
static u_long srambase = 0xd0000;
|
||||
|
||||
/* SRAM size 8,16,32,64 */
|
||||
static u_long sramsize = 64;
|
||||
|
||||
/* Ringspeed 4,16 */
|
||||
static int ringspeed = 16;
|
||||
|
||||
module_param(mmiobase, ulong, 0);
|
||||
module_param(srambase, ulong, 0);
|
||||
module_param(sramsize, ulong, 0);
|
||||
module_param(ringspeed, int, 0);
|
||||
MODULE_LICENSE("GPL");
|
||||
|
||||
/*====================================================================*/
|
||||
|
||||
static int ibmtr_config(struct pcmcia_device *link);
|
||||
static void ibmtr_hw_setup(struct net_device *dev, u_int mmiobase);
|
||||
static void ibmtr_release(struct pcmcia_device *link);
|
||||
static void ibmtr_detach(struct pcmcia_device *p_dev);
|
||||
|
||||
/*====================================================================*/
|
||||
|
||||
typedef struct ibmtr_dev_t {
|
||||
struct pcmcia_device *p_dev;
|
||||
struct net_device *dev;
|
||||
struct tok_info *ti;
|
||||
} ibmtr_dev_t;
|
||||
|
||||
static irqreturn_t ibmtr_interrupt(int irq, void *dev_id) {
|
||||
ibmtr_dev_t *info = dev_id;
|
||||
struct net_device *dev = info->dev;
|
||||
return tok_interrupt(irq, dev);
|
||||
};
|
||||
|
||||
static int __devinit ibmtr_attach(struct pcmcia_device *link)
|
||||
{
|
||||
ibmtr_dev_t *info;
|
||||
struct net_device *dev;
|
||||
|
||||
dev_dbg(&link->dev, "ibmtr_attach()\n");
|
||||
|
||||
/* Create new token-ring device */
|
||||
info = kzalloc(sizeof(*info), GFP_KERNEL);
|
||||
if (!info) return -ENOMEM;
|
||||
dev = alloc_trdev(sizeof(struct tok_info));
|
||||
if (!dev) {
|
||||
kfree(info);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
info->p_dev = link;
|
||||
link->priv = info;
|
||||
info->ti = netdev_priv(dev);
|
||||
|
||||
link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
|
||||
link->resource[0]->end = 4;
|
||||
link->config_flags |= CONF_ENABLE_IRQ;
|
||||
link->config_regs = PRESENT_OPTION;
|
||||
|
||||
info->dev = dev;
|
||||
|
||||
return ibmtr_config(link);
|
||||
} /* ibmtr_attach */
|
||||
|
||||
static void ibmtr_detach(struct pcmcia_device *link)
|
||||
{
|
||||
struct ibmtr_dev_t *info = link->priv;
|
||||
struct net_device *dev = info->dev;
|
||||
struct tok_info *ti = netdev_priv(dev);
|
||||
|
||||
dev_dbg(&link->dev, "ibmtr_detach\n");
|
||||
|
||||
/*
|
||||
* When the card removal interrupt hits tok_interrupt(),
|
||||
* bail out early, so we don't crash the machine
|
||||
*/
|
||||
ti->sram_phys |= 1;
|
||||
|
||||
unregister_netdev(dev);
|
||||
|
||||
del_timer_sync(&(ti->tr_timer));
|
||||
|
||||
ibmtr_release(link);
|
||||
|
||||
free_netdev(dev);
|
||||
kfree(info);
|
||||
} /* ibmtr_detach */
|
||||
|
||||
static int __devinit ibmtr_config(struct pcmcia_device *link)
|
||||
{
|
||||
ibmtr_dev_t *info = link->priv;
|
||||
struct net_device *dev = info->dev;
|
||||
struct tok_info *ti = netdev_priv(dev);
|
||||
int i, ret;
|
||||
|
||||
dev_dbg(&link->dev, "ibmtr_config\n");
|
||||
|
||||
link->io_lines = 16;
|
||||
link->config_index = 0x61;
|
||||
|
||||
/* Determine if this is PRIMARY or ALTERNATE. */
|
||||
|
||||
/* Try PRIMARY card at 0xA20-0xA23 */
|
||||
link->resource[0]->start = 0xA20;
|
||||
i = pcmcia_request_io(link);
|
||||
if (i != 0) {
|
||||
/* Couldn't get 0xA20-0xA23. Try ALTERNATE at 0xA24-0xA27. */
|
||||
link->resource[0]->start = 0xA24;
|
||||
ret = pcmcia_request_io(link);
|
||||
if (ret)
|
||||
goto failed;
|
||||
}
|
||||
dev->base_addr = link->resource[0]->start;
|
||||
|
||||
ret = pcmcia_request_exclusive_irq(link, ibmtr_interrupt);
|
||||
if (ret)
|
||||
goto failed;
|
||||
dev->irq = link->irq;
|
||||
ti->irq = link->irq;
|
||||
ti->global_int_enable=GLOBAL_INT_ENABLE+((dev->irq==9) ? 2 : dev->irq);
|
||||
|
||||
/* Allocate the MMIO memory window */
|
||||
link->resource[2]->flags |= WIN_DATA_WIDTH_16|WIN_MEMORY_TYPE_CM|WIN_ENABLE;
|
||||
link->resource[2]->flags |= WIN_USE_WAIT;
|
||||
link->resource[2]->start = 0;
|
||||
link->resource[2]->end = 0x2000;
|
||||
ret = pcmcia_request_window(link, link->resource[2], 250);
|
||||
if (ret)
|
||||
goto failed;
|
||||
|
||||
ret = pcmcia_map_mem_page(link, link->resource[2], mmiobase);
|
||||
if (ret)
|
||||
goto failed;
|
||||
ti->mmio = ioremap(link->resource[2]->start,
|
||||
resource_size(link->resource[2]));
|
||||
|
||||
/* Allocate the SRAM memory window */
|
||||
link->resource[3]->flags = WIN_DATA_WIDTH_16|WIN_MEMORY_TYPE_CM|WIN_ENABLE;
|
||||
link->resource[3]->flags |= WIN_USE_WAIT;
|
||||
link->resource[3]->start = 0;
|
||||
link->resource[3]->end = sramsize * 1024;
|
||||
ret = pcmcia_request_window(link, link->resource[3], 250);
|
||||
if (ret)
|
||||
goto failed;
|
||||
|
||||
ret = pcmcia_map_mem_page(link, link->resource[3], srambase);
|
||||
if (ret)
|
||||
goto failed;
|
||||
|
||||
ti->sram_base = srambase >> 12;
|
||||
ti->sram_virt = ioremap(link->resource[3]->start,
|
||||
resource_size(link->resource[3]));
|
||||
ti->sram_phys = link->resource[3]->start;
|
||||
|
||||
ret = pcmcia_enable_device(link);
|
||||
if (ret)
|
||||
goto failed;
|
||||
|
||||
/* Set up the Token-Ring Controller Configuration Register and
|
||||
turn on the card. Check the "Local Area Network Credit Card
|
||||
Adapters Technical Reference" SC30-3585 for this info. */
|
||||
ibmtr_hw_setup(dev, mmiobase);
|
||||
|
||||
SET_NETDEV_DEV(dev, &link->dev);
|
||||
|
||||
i = ibmtr_probe_card(dev);
|
||||
if (i != 0) {
|
||||
pr_notice("register_netdev() failed\n");
|
||||
goto failed;
|
||||
}
|
||||
|
||||
netdev_info(dev, "port %#3lx, irq %d, mmio %#5lx, sram %#5lx, hwaddr=%pM\n",
|
||||
dev->base_addr, dev->irq,
|
||||
(u_long)ti->mmio, (u_long)(ti->sram_base << 12),
|
||||
dev->dev_addr);
|
||||
return 0;
|
||||
|
||||
failed:
|
||||
ibmtr_release(link);
|
||||
return -ENODEV;
|
||||
} /* ibmtr_config */
|
||||
|
||||
static void ibmtr_release(struct pcmcia_device *link)
|
||||
{
|
||||
ibmtr_dev_t *info = link->priv;
|
||||
struct net_device *dev = info->dev;
|
||||
|
||||
dev_dbg(&link->dev, "ibmtr_release\n");
|
||||
|
||||
if (link->resource[2]->end) {
|
||||
struct tok_info *ti = netdev_priv(dev);
|
||||
iounmap(ti->mmio);
|
||||
}
|
||||
pcmcia_disable_device(link);
|
||||
}
|
||||
|
||||
static int ibmtr_suspend(struct pcmcia_device *link)
|
||||
{
|
||||
ibmtr_dev_t *info = link->priv;
|
||||
struct net_device *dev = info->dev;
|
||||
|
||||
if (link->open)
|
||||
netif_device_detach(dev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int __devinit ibmtr_resume(struct pcmcia_device *link)
|
||||
{
|
||||
ibmtr_dev_t *info = link->priv;
|
||||
struct net_device *dev = info->dev;
|
||||
|
||||
if (link->open) {
|
||||
ibmtr_probe(dev); /* really? */
|
||||
netif_device_attach(dev);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*====================================================================*/
|
||||
|
||||
static void ibmtr_hw_setup(struct net_device *dev, u_int mmiobase)
|
||||
{
|
||||
int i;
|
||||
|
||||
/* Bizarre IBM behavior, there are 16 bits of information we
|
||||
need to set, but the card only allows us to send 4 bits at a
|
||||
time. For each byte sent to base_addr, bits 7-4 tell the
|
||||
card which part of the 16 bits we are setting, bits 3-0 contain
|
||||
the actual information */
|
||||
|
||||
/* First nibble provides 4 bits of mmio */
|
||||
i = (mmiobase >> 16) & 0x0F;
|
||||
outb(i, dev->base_addr);
|
||||
|
||||
/* Second nibble provides 3 bits of mmio */
|
||||
i = 0x10 | ((mmiobase >> 12) & 0x0E);
|
||||
outb(i, dev->base_addr);
|
||||
|
||||
/* Third nibble, hard-coded values */
|
||||
i = 0x26;
|
||||
outb(i, dev->base_addr);
|
||||
|
||||
/* Fourth nibble sets shared ram page size */
|
||||
|
||||
/* 8 = 00, 16 = 01, 32 = 10, 64 = 11 */
|
||||
i = (sramsize >> 4) & 0x07;
|
||||
i = ((i == 4) ? 3 : i) << 2;
|
||||
i |= 0x30;
|
||||
|
||||
if (ringspeed == 16)
|
||||
i |= 2;
|
||||
if (dev->base_addr == 0xA24)
|
||||
i |= 1;
|
||||
outb(i, dev->base_addr);
|
||||
|
||||
/* 0x40 will release the card for use */
|
||||
outb(0x40, dev->base_addr);
|
||||
}
|
||||
|
||||
static const struct pcmcia_device_id ibmtr_ids[] = {
|
||||
PCMCIA_DEVICE_PROD_ID12("3Com", "TokenLink Velocity PC Card", 0x41240e5b, 0x82c3734e),
|
||||
PCMCIA_DEVICE_PROD_ID12("IBM", "TOKEN RING", 0xb569a6e5, 0xbf8eed47),
|
||||
PCMCIA_DEVICE_NULL,
|
||||
};
|
||||
MODULE_DEVICE_TABLE(pcmcia, ibmtr_ids);
|
||||
|
||||
static struct pcmcia_driver ibmtr_cs_driver = {
|
||||
.owner = THIS_MODULE,
|
||||
.name = "ibmtr_cs",
|
||||
.probe = ibmtr_attach,
|
||||
.remove = ibmtr_detach,
|
||||
.id_table = ibmtr_ids,
|
||||
.suspend = ibmtr_suspend,
|
||||
.resume = ibmtr_resume,
|
||||
};
|
||||
|
||||
static int __init init_ibmtr_cs(void)
|
||||
{
|
||||
return pcmcia_register_driver(&ibmtr_cs_driver);
|
||||
}
|
||||
|
||||
static void __exit exit_ibmtr_cs(void)
|
||||
{
|
||||
pcmcia_unregister_driver(&ibmtr_cs_driver);
|
||||
}
|
||||
|
||||
module_init(init_ibmtr_cs);
|
||||
module_exit(exit_ibmtr_cs);
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1,343 +0,0 @@
|
|||
/*
|
||||
* lanstreamer.h -- driver for the IBM Auto LANStreamer PCI Adapter
|
||||
*
|
||||
* Written By: Mike Sullivan, IBM Corporation
|
||||
*
|
||||
* Copyright (C) 1999 IBM Corporation
|
||||
*
|
||||
* Linux driver for IBM PCI tokenring cards based on the LanStreamer MPC
|
||||
* chipset.
|
||||
*
|
||||
* This driver is based on the olympic driver for IBM PCI TokenRing cards (Pit/Pit-Phy/Olympic
|
||||
* chipsets) written by:
|
||||
* 1999 Peter De Schrijver All Rights Reserved
|
||||
* 1999 Mike Phillips (phillim@amtrak.com)
|
||||
*
|
||||
* Base Driver Skeleton:
|
||||
* Written 1993-94 by Donald Becker.
|
||||
*
|
||||
* Copyright 1993 United States Government as represented by the
|
||||
* Director, National Security Agency.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* NO WARRANTY
|
||||
* THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR
|
||||
* CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT
|
||||
* LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
|
||||
* MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is
|
||||
* solely responsible for determining the appropriateness of using and
|
||||
* distributing the Program and assumes all risks associated with its
|
||||
* exercise of rights under this Agreement, including but not limited to
|
||||
* the risks and costs of program errors, damage to or loss of data,
|
||||
* programs or equipment, and unavailability or interruption of operations.
|
||||
*
|
||||
* DISCLAIMER OF LIABILITY
|
||||
* NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), 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 OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED
|
||||
* HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*
|
||||
* 12/10/99 - Alpha Release 0.1.0
|
||||
* First release to the public
|
||||
* 08/15/01 - Added ioctl() definitions and others - Kent Yoder <yoder1@us.ibm.com>
|
||||
*
|
||||
*/
|
||||
|
||||
/* MAX_INTR - the maximum number of times we can loop
|
||||
* inside the interrupt function before returning
|
||||
* control to the OS (maximum value is 256)
|
||||
*/
|
||||
#define MAX_INTR 5
|
||||
|
||||
#define CLS 0x0C
|
||||
#define MLR 0x86
|
||||
#define LTR 0x0D
|
||||
|
||||
#define BCTL 0x60
|
||||
#define BCTL_SOFTRESET (1<<15)
|
||||
#define BCTL_RX_FIFO_8 (1<<1)
|
||||
#define BCTL_TX_FIFO_8 (1<<3)
|
||||
|
||||
#define GPR 0x4a
|
||||
#define GPR_AUTOSENSE (1<<2)
|
||||
#define GPR_16MBPS (1<<3)
|
||||
|
||||
#define LISR 0x10
|
||||
#define LISR_SUM 0x12
|
||||
#define LISR_RUM 0x14
|
||||
|
||||
#define LISR_LIE (1<<15)
|
||||
#define LISR_SLIM (1<<13)
|
||||
#define LISR_SLI (1<<12)
|
||||
#define LISR_BPEI (1<<9)
|
||||
#define LISR_BPE (1<<8)
|
||||
#define LISR_SRB_CMD (1<<5)
|
||||
#define LISR_ASB_REPLY (1<<4)
|
||||
#define LISR_ASB_FREE_REQ (1<<2)
|
||||
#define LISR_ARB_FREE (1<<1)
|
||||
#define LISR_TRB_FRAME (1<<0)
|
||||
|
||||
#define SISR 0x16
|
||||
#define SISR_SUM 0x18
|
||||
#define SISR_RUM 0x1A
|
||||
#define SISR_MASK 0x54
|
||||
#define SISR_MASK_SUM 0x56
|
||||
#define SISR_MASK_RUM 0x58
|
||||
|
||||
#define SISR_MI (1<<15)
|
||||
#define SISR_SERR_ERR (1<<14)
|
||||
#define SISR_TIMER (1<<11)
|
||||
#define SISR_LAP_PAR_ERR (1<<10)
|
||||
#define SISR_LAP_ACC_ERR (1<<9)
|
||||
#define SISR_PAR_ERR (1<<8)
|
||||
#define SISR_ADAPTER_CHECK (1<<6)
|
||||
#define SISR_SRB_REPLY (1<<5)
|
||||
#define SISR_ASB_FREE (1<<4)
|
||||
#define SISR_ARB_CMD (1<<3)
|
||||
#define SISR_TRB_REPLY (1<<2)
|
||||
|
||||
#define MISR_RUM 0x5A
|
||||
#define MISR_MASK 0x5C
|
||||
#define MISR_MASK_RUM 0x5E
|
||||
|
||||
#define MISR_TX2_IDLE (1<<15)
|
||||
#define MISR_TX2_NO_STATUS (1<<14)
|
||||
#define MISR_TX2_HALT (1<<13)
|
||||
#define MISR_TX2_EOF (1<<12)
|
||||
#define MISR_TX1_IDLE (1<<11)
|
||||
#define MISR_TX1_NO_STATUS (1<<10)
|
||||
#define MISR_TX1_HALT (1<<9)
|
||||
#define MISR_TX1_EOF (1<<8)
|
||||
#define MISR_RX_NOBUF (1<<5)
|
||||
#define MISR_RX_EOB (1<<4)
|
||||
#define MISR_RX_NO_STATUS (1<<2)
|
||||
#define MISR_RX_HALT (1<<1)
|
||||
#define MISR_RX_EOF (1<<0)
|
||||
|
||||
#define LAPA 0x62
|
||||
#define LAPE 0x64
|
||||
#define LAPD 0x66
|
||||
#define LAPDINC 0x68
|
||||
#define LAPWWO 0x6A
|
||||
#define LAPWWC 0x6C
|
||||
#define LAPCTL 0x6E
|
||||
|
||||
#define TIMER 0x4E4
|
||||
|
||||
#define BMCTL_SUM 0x50
|
||||
#define BMCTL_RUM 0x52
|
||||
#define BMCTL_TX1_DIS (1<<14)
|
||||
#define BMCTL_TX2_DIS (1<<10)
|
||||
#define BMCTL_RX_DIS (1<<6)
|
||||
#define BMCTL_RX_ENABLED (1<<5)
|
||||
|
||||
#define RXLBDA 0x90
|
||||
#define RXBDA 0x94
|
||||
#define RXSTAT 0x98
|
||||
#define RXDBA 0x9C
|
||||
|
||||
#define TX1LFDA 0xA0
|
||||
#define TX1FDA 0xA4
|
||||
#define TX1STAT 0xA8
|
||||
#define TX1DBA 0xAC
|
||||
#define TX2LFDA 0xB0
|
||||
#define TX2FDA 0xB4
|
||||
#define TX2STAT 0xB8
|
||||
#define TX2DBA 0xBC
|
||||
|
||||
#define STREAMER_IO_SPACE 256
|
||||
|
||||
#define SRB_COMMAND_SIZE 50
|
||||
|
||||
#define STREAMER_MAX_ADAPTERS 8 /* 0x08 __MODULE_STRING can't hand 0xnn */
|
||||
|
||||
/* Defines for LAN STATUS CHANGE reports */
|
||||
#define LSC_SIG_LOSS 0x8000
|
||||
#define LSC_HARD_ERR 0x4000
|
||||
#define LSC_SOFT_ERR 0x2000
|
||||
#define LSC_TRAN_BCN 0x1000
|
||||
#define LSC_LWF 0x0800
|
||||
#define LSC_ARW 0x0400
|
||||
#define LSC_FPE 0x0200
|
||||
#define LSC_RR 0x0100
|
||||
#define LSC_CO 0x0080
|
||||
#define LSC_SS 0x0040
|
||||
#define LSC_RING_REC 0x0020
|
||||
#define LSC_SR_CO 0x0010
|
||||
#define LSC_FDX_MODE 0x0004
|
||||
|
||||
/* Defines for OPEN ADAPTER command */
|
||||
|
||||
#define OPEN_ADAPTER_EXT_WRAP (1<<15)
|
||||
#define OPEN_ADAPTER_DIS_HARDEE (1<<14)
|
||||
#define OPEN_ADAPTER_DIS_SOFTERR (1<<13)
|
||||
#define OPEN_ADAPTER_PASS_ADC_MAC (1<<12)
|
||||
#define OPEN_ADAPTER_PASS_ATT_MAC (1<<11)
|
||||
#define OPEN_ADAPTER_ENABLE_EC (1<<10)
|
||||
#define OPEN_ADAPTER_CONTENDER (1<<8)
|
||||
#define OPEN_ADAPTER_PASS_BEACON (1<<7)
|
||||
#define OPEN_ADAPTER_ENABLE_FDX (1<<6)
|
||||
#define OPEN_ADAPTER_ENABLE_RPL (1<<5)
|
||||
#define OPEN_ADAPTER_INHIBIT_ETR (1<<4)
|
||||
#define OPEN_ADAPTER_INTERNAL_WRAP (1<<3)
|
||||
|
||||
|
||||
/* Defines for SRB Commands */
|
||||
#define SRB_CLOSE_ADAPTER 0x04
|
||||
#define SRB_CONFIGURE_BRIDGE 0x0c
|
||||
#define SRB_CONFIGURE_HP_CHANNEL 0x13
|
||||
#define SRB_MODIFY_BRIDGE_PARMS 0x15
|
||||
#define SRB_MODIFY_OPEN_OPTIONS 0x01
|
||||
#define SRB_MODIFY_RECEIVE_OPTIONS 0x17
|
||||
#define SRB_NO_OPERATION 0x00
|
||||
#define SRB_OPEN_ADAPTER 0x03
|
||||
#define SRB_READ_LOG 0x08
|
||||
#define SRB_READ_SR_COUNTERS 0x16
|
||||
#define SRB_RESET_GROUP_ADDRESS 0x02
|
||||
#define SRB_RESET_TARGET_SEGMETN 0x14
|
||||
#define SRB_SAVE_CONFIGURATION 0x1b
|
||||
#define SRB_SET_BRIDGE_PARMS 0x09
|
||||
#define SRB_SET_FUNC_ADDRESS 0x07
|
||||
#define SRB_SET_GROUP_ADDRESS 0x06
|
||||
#define SRB_SET_TARGET_SEGMENT 0x05
|
||||
|
||||
/* Clear return code */
|
||||
#define STREAMER_CLEAR_RET_CODE 0xfe
|
||||
|
||||
/* ARB Commands */
|
||||
#define ARB_RECEIVE_DATA 0x81
|
||||
#define ARB_LAN_CHANGE_STATUS 0x84
|
||||
|
||||
/* ASB Response commands */
|
||||
#define ASB_RECEIVE_DATA 0x81
|
||||
|
||||
|
||||
/* Streamer defaults for buffers */
|
||||
|
||||
#define STREAMER_RX_RING_SIZE 16 /* should be a power of 2 */
|
||||
/* Setting the number of TX descriptors to 1 is a workaround for an
|
||||
* undocumented hardware problem with the lanstreamer board. Setting
|
||||
* this to something higher may slightly increase the throughput you
|
||||
* can get from the card, but at the risk of locking up the box. -
|
||||
* <yoder1@us.ibm.com>
|
||||
*/
|
||||
#define STREAMER_TX_RING_SIZE 1 /* should be a power of 2 */
|
||||
|
||||
#define PKT_BUF_SZ 4096 /* Default packet size */
|
||||
|
||||
/* Streamer data structures */
|
||||
|
||||
struct streamer_tx_desc {
|
||||
__u32 forward;
|
||||
__u32 status;
|
||||
__u32 bufcnt_framelen;
|
||||
__u32 buffer;
|
||||
__u32 buflen;
|
||||
__u32 rsvd1;
|
||||
__u32 rsvd2;
|
||||
__u32 rsvd3;
|
||||
};
|
||||
|
||||
struct streamer_rx_desc {
|
||||
__u32 forward;
|
||||
__u32 status;
|
||||
__u32 buffer;
|
||||
__u32 framelen_buflen;
|
||||
};
|
||||
|
||||
struct mac_receive_buffer {
|
||||
__u16 next;
|
||||
__u8 padding;
|
||||
__u8 frame_status;
|
||||
__u16 buffer_length;
|
||||
__u8 frame_data;
|
||||
};
|
||||
|
||||
struct streamer_private {
|
||||
|
||||
__u16 srb;
|
||||
__u16 trb;
|
||||
__u16 arb;
|
||||
__u16 asb;
|
||||
|
||||
struct streamer_private *next;
|
||||
struct pci_dev *pci_dev;
|
||||
__u8 __iomem *streamer_mmio;
|
||||
char *streamer_card_name;
|
||||
|
||||
spinlock_t streamer_lock;
|
||||
|
||||
volatile int srb_queued; /* True if an SRB is still posted */
|
||||
wait_queue_head_t srb_wait;
|
||||
|
||||
volatile int asb_queued; /* True if an ASB is posted */
|
||||
|
||||
volatile int trb_queued; /* True if a TRB is posted */
|
||||
wait_queue_head_t trb_wait;
|
||||
|
||||
struct streamer_rx_desc *streamer_rx_ring;
|
||||
struct streamer_tx_desc *streamer_tx_ring;
|
||||
struct sk_buff *tx_ring_skb[STREAMER_TX_RING_SIZE],
|
||||
*rx_ring_skb[STREAMER_RX_RING_SIZE];
|
||||
int tx_ring_free, tx_ring_last_status, rx_ring_last_received,
|
||||
free_tx_ring_entries;
|
||||
|
||||
__u16 streamer_lan_status;
|
||||
__u8 streamer_ring_speed;
|
||||
__u16 pkt_buf_sz;
|
||||
__u8 streamer_receive_options, streamer_copy_all_options,
|
||||
streamer_message_level;
|
||||
__u16 streamer_addr_table_addr, streamer_parms_addr;
|
||||
__u16 mac_rx_buffer;
|
||||
__u8 streamer_laa[6];
|
||||
};
|
||||
|
||||
struct streamer_adapter_addr_table {
|
||||
|
||||
__u8 node_addr[6];
|
||||
__u8 reserved[4];
|
||||
__u8 func_addr[4];
|
||||
};
|
||||
|
||||
struct streamer_parameters_table {
|
||||
|
||||
__u8 phys_addr[4];
|
||||
__u8 up_node_addr[6];
|
||||
__u8 up_phys_addr[4];
|
||||
__u8 poll_addr[6];
|
||||
__u16 reserved;
|
||||
__u16 acc_priority;
|
||||
__u16 auth_source_class;
|
||||
__u16 att_code;
|
||||
__u8 source_addr[6];
|
||||
__u16 beacon_type;
|
||||
__u16 major_vector;
|
||||
__u16 lan_status;
|
||||
__u16 soft_error_time;
|
||||
__u16 reserved1;
|
||||
__u16 local_ring;
|
||||
__u16 mon_error;
|
||||
__u16 beacon_transmit;
|
||||
__u16 beacon_receive;
|
||||
__u16 frame_correl;
|
||||
__u8 beacon_naun[6];
|
||||
__u32 reserved2;
|
||||
__u8 beacon_phys[4];
|
||||
};
|
|
@ -1,761 +0,0 @@
|
|||
/*
|
||||
* madgemc.c: Driver for the Madge Smart 16/4 MC16 MCA token ring card.
|
||||
*
|
||||
* Written 2000 by Adam Fritzler
|
||||
*
|
||||
* This software may be used and distributed according to the terms
|
||||
* of the GNU General Public License, incorporated herein by reference.
|
||||
*
|
||||
* This driver module supports the following cards:
|
||||
* - Madge Smart 16/4 Ringnode MC16
|
||||
* - Madge Smart 16/4 Ringnode MC32 (??)
|
||||
*
|
||||
* Maintainer(s):
|
||||
* AF Adam Fritzler
|
||||
*
|
||||
* Modification History:
|
||||
* 16-Jan-00 AF Created
|
||||
*
|
||||
*/
|
||||
static const char version[] = "madgemc.c: v0.91 23/01/2000 by Adam Fritzler\n";
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <linux/mca.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/errno.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/netdevice.h>
|
||||
#include <linux/trdevice.h>
|
||||
|
||||
#include <asm/io.h>
|
||||
#include <asm/irq.h>
|
||||
|
||||
#include "tms380tr.h"
|
||||
#include "madgemc.h" /* Madge-specific constants */
|
||||
|
||||
#define MADGEMC_IO_EXTENT 32
|
||||
#define MADGEMC_SIF_OFFSET 0x08
|
||||
|
||||
struct card_info {
|
||||
/*
|
||||
* These are read from the BIA ROM.
|
||||
*/
|
||||
unsigned int manid;
|
||||
unsigned int cardtype;
|
||||
unsigned int cardrev;
|
||||
unsigned int ramsize;
|
||||
|
||||
/*
|
||||
* These are read from the MCA POS registers.
|
||||
*/
|
||||
unsigned int burstmode:2;
|
||||
unsigned int fairness:1; /* 0 = Fair, 1 = Unfair */
|
||||
unsigned int arblevel:4;
|
||||
unsigned int ringspeed:2; /* 0 = 4mb, 1 = 16, 2 = Auto/none */
|
||||
unsigned int cabletype:1; /* 0 = RJ45, 1 = DB9 */
|
||||
};
|
||||
|
||||
static int madgemc_open(struct net_device *dev);
|
||||
static int madgemc_close(struct net_device *dev);
|
||||
static int madgemc_chipset_init(struct net_device *dev);
|
||||
static void madgemc_read_rom(struct net_device *dev, struct card_info *card);
|
||||
static unsigned short madgemc_setnselout_pins(struct net_device *dev);
|
||||
static void madgemc_setcabletype(struct net_device *dev, int type);
|
||||
|
||||
static int madgemc_mcaproc(char *buf, int slot, void *d);
|
||||
|
||||
static void madgemc_setregpage(struct net_device *dev, int page);
|
||||
static void madgemc_setsifsel(struct net_device *dev, int val);
|
||||
static void madgemc_setint(struct net_device *dev, int val);
|
||||
|
||||
static irqreturn_t madgemc_interrupt(int irq, void *dev_id);
|
||||
|
||||
/*
|
||||
* These work around paging, however they don't guarantee you're on the
|
||||
* right page.
|
||||
*/
|
||||
#define SIFREADB(reg) (inb(dev->base_addr + ((reg<0x8)?reg:reg-0x8)))
|
||||
#define SIFWRITEB(val, reg) (outb(val, dev->base_addr + ((reg<0x8)?reg:reg-0x8)))
|
||||
#define SIFREADW(reg) (inw(dev->base_addr + ((reg<0x8)?reg:reg-0x8)))
|
||||
#define SIFWRITEW(val, reg) (outw(val, dev->base_addr + ((reg<0x8)?reg:reg-0x8)))
|
||||
|
||||
/*
|
||||
* Read a byte-length value from the register.
|
||||
*/
|
||||
static unsigned short madgemc_sifreadb(struct net_device *dev, unsigned short reg)
|
||||
{
|
||||
unsigned short ret;
|
||||
if (reg<0x8)
|
||||
ret = SIFREADB(reg);
|
||||
else {
|
||||
madgemc_setregpage(dev, 1);
|
||||
ret = SIFREADB(reg);
|
||||
madgemc_setregpage(dev, 0);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* Write a byte-length value to a register.
|
||||
*/
|
||||
static void madgemc_sifwriteb(struct net_device *dev, unsigned short val, unsigned short reg)
|
||||
{
|
||||
if (reg<0x8)
|
||||
SIFWRITEB(val, reg);
|
||||
else {
|
||||
madgemc_setregpage(dev, 1);
|
||||
SIFWRITEB(val, reg);
|
||||
madgemc_setregpage(dev, 0);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Read a word-length value from a register
|
||||
*/
|
||||
static unsigned short madgemc_sifreadw(struct net_device *dev, unsigned short reg)
|
||||
{
|
||||
unsigned short ret;
|
||||
if (reg<0x8)
|
||||
ret = SIFREADW(reg);
|
||||
else {
|
||||
madgemc_setregpage(dev, 1);
|
||||
ret = SIFREADW(reg);
|
||||
madgemc_setregpage(dev, 0);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* Write a word-length value to a register.
|
||||
*/
|
||||
static void madgemc_sifwritew(struct net_device *dev, unsigned short val, unsigned short reg)
|
||||
{
|
||||
if (reg<0x8)
|
||||
SIFWRITEW(val, reg);
|
||||
else {
|
||||
madgemc_setregpage(dev, 1);
|
||||
SIFWRITEW(val, reg);
|
||||
madgemc_setregpage(dev, 0);
|
||||
}
|
||||
}
|
||||
|
||||
static struct net_device_ops madgemc_netdev_ops __read_mostly;
|
||||
|
||||
static int __devinit madgemc_probe(struct device *device)
|
||||
{
|
||||
static int versionprinted;
|
||||
struct net_device *dev;
|
||||
struct net_local *tp;
|
||||
struct card_info *card;
|
||||
struct mca_device *mdev = to_mca_device(device);
|
||||
int ret = 0;
|
||||
|
||||
if (versionprinted++ == 0)
|
||||
printk("%s", version);
|
||||
|
||||
if(mca_device_claimed(mdev))
|
||||
return -EBUSY;
|
||||
mca_device_set_claim(mdev, 1);
|
||||
|
||||
dev = alloc_trdev(sizeof(struct net_local));
|
||||
if (!dev) {
|
||||
printk("madgemc: unable to allocate dev space\n");
|
||||
mca_device_set_claim(mdev, 0);
|
||||
ret = -ENOMEM;
|
||||
goto getout;
|
||||
}
|
||||
|
||||
dev->netdev_ops = &madgemc_netdev_ops;
|
||||
|
||||
card = kmalloc(sizeof(struct card_info), GFP_KERNEL);
|
||||
if (card==NULL) {
|
||||
ret = -ENOMEM;
|
||||
goto getout1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Parse configuration information. This all comes
|
||||
* directly from the publicly available @002d.ADF.
|
||||
* Get it from Madge or your local ADF library.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Base address
|
||||
*/
|
||||
dev->base_addr = 0x0a20 +
|
||||
((mdev->pos[2] & MC16_POS2_ADDR2)?0x0400:0) +
|
||||
((mdev->pos[0] & MC16_POS0_ADDR1)?0x1000:0) +
|
||||
((mdev->pos[3] & MC16_POS3_ADDR3)?0x2000:0);
|
||||
|
||||
/*
|
||||
* Interrupt line
|
||||
*/
|
||||
switch(mdev->pos[0] >> 6) { /* upper two bits */
|
||||
case 0x1: dev->irq = 3; break;
|
||||
case 0x2: dev->irq = 9; break; /* IRQ 2 = IRQ 9 */
|
||||
case 0x3: dev->irq = 10; break;
|
||||
default: dev->irq = 0; break;
|
||||
}
|
||||
|
||||
if (dev->irq == 0) {
|
||||
printk("%s: invalid IRQ\n", dev->name);
|
||||
ret = -EBUSY;
|
||||
goto getout2;
|
||||
}
|
||||
|
||||
if (!request_region(dev->base_addr, MADGEMC_IO_EXTENT,
|
||||
"madgemc")) {
|
||||
printk(KERN_INFO "madgemc: unable to setup Smart MC in slot %d because of I/O base conflict at 0x%04lx\n", mdev->slot, dev->base_addr);
|
||||
dev->base_addr += MADGEMC_SIF_OFFSET;
|
||||
ret = -EBUSY;
|
||||
goto getout2;
|
||||
}
|
||||
dev->base_addr += MADGEMC_SIF_OFFSET;
|
||||
|
||||
/*
|
||||
* Arbitration Level
|
||||
*/
|
||||
card->arblevel = ((mdev->pos[0] >> 1) & 0x7) + 8;
|
||||
|
||||
/*
|
||||
* Burst mode and Fairness
|
||||
*/
|
||||
card->burstmode = ((mdev->pos[2] >> 6) & 0x3);
|
||||
card->fairness = ((mdev->pos[2] >> 4) & 0x1);
|
||||
|
||||
/*
|
||||
* Ring Speed
|
||||
*/
|
||||
if ((mdev->pos[1] >> 2)&0x1)
|
||||
card->ringspeed = 2; /* not selected */
|
||||
else if ((mdev->pos[2] >> 5) & 0x1)
|
||||
card->ringspeed = 1; /* 16Mb */
|
||||
else
|
||||
card->ringspeed = 0; /* 4Mb */
|
||||
|
||||
/*
|
||||
* Cable type
|
||||
*/
|
||||
if ((mdev->pos[1] >> 6)&0x1)
|
||||
card->cabletype = 1; /* STP/DB9 */
|
||||
else
|
||||
card->cabletype = 0; /* UTP/RJ-45 */
|
||||
|
||||
|
||||
/*
|
||||
* ROM Info. This requires us to actually twiddle
|
||||
* bits on the card, so we must ensure above that
|
||||
* the base address is free of conflict (request_region above).
|
||||
*/
|
||||
madgemc_read_rom(dev, card);
|
||||
|
||||
if (card->manid != 0x4d) { /* something went wrong */
|
||||
printk(KERN_INFO "%s: Madge MC ROM read failed (unknown manufacturer ID %02x)\n", dev->name, card->manid);
|
||||
goto getout3;
|
||||
}
|
||||
|
||||
if ((card->cardtype != 0x08) && (card->cardtype != 0x0d)) {
|
||||
printk(KERN_INFO "%s: Madge MC ROM read failed (unknown card ID %02x)\n", dev->name, card->cardtype);
|
||||
ret = -EIO;
|
||||
goto getout3;
|
||||
}
|
||||
|
||||
/* All cards except Rev 0 and 1 MC16's have 256kb of RAM */
|
||||
if ((card->cardtype == 0x08) && (card->cardrev <= 0x01))
|
||||
card->ramsize = 128;
|
||||
else
|
||||
card->ramsize = 256;
|
||||
|
||||
printk("%s: %s Rev %d at 0x%04lx IRQ %d\n",
|
||||
dev->name,
|
||||
(card->cardtype == 0x08)?MADGEMC16_CARDNAME:
|
||||
MADGEMC32_CARDNAME, card->cardrev,
|
||||
dev->base_addr, dev->irq);
|
||||
|
||||
if (card->cardtype == 0x0d)
|
||||
printk("%s: Warning: MC32 support is experimental and highly untested\n", dev->name);
|
||||
|
||||
if (card->ringspeed==2) { /* Unknown */
|
||||
printk("%s: Warning: Ring speed not set in POS -- Please run the reference disk and set it!\n", dev->name);
|
||||
card->ringspeed = 1; /* default to 16mb */
|
||||
}
|
||||
|
||||
printk("%s: RAM Size: %dKB\n", dev->name, card->ramsize);
|
||||
|
||||
printk("%s: Ring Speed: %dMb/sec on %s\n", dev->name,
|
||||
(card->ringspeed)?16:4,
|
||||
card->cabletype?"STP/DB9":"UTP/RJ-45");
|
||||
printk("%s: Arbitration Level: %d\n", dev->name,
|
||||
card->arblevel);
|
||||
|
||||
printk("%s: Burst Mode: ", dev->name);
|
||||
switch(card->burstmode) {
|
||||
case 0: printk("Cycle steal"); break;
|
||||
case 1: printk("Limited burst"); break;
|
||||
case 2: printk("Delayed release"); break;
|
||||
case 3: printk("Immediate release"); break;
|
||||
}
|
||||
printk(" (%s)\n", (card->fairness)?"Unfair":"Fair");
|
||||
|
||||
|
||||
/*
|
||||
* Enable SIF before we assign the interrupt handler,
|
||||
* just in case we get spurious interrupts that need
|
||||
* handling.
|
||||
*/
|
||||
outb(0, dev->base_addr + MC_CONTROL_REG0); /* sanity */
|
||||
madgemc_setsifsel(dev, 1);
|
||||
if (request_irq(dev->irq, madgemc_interrupt, IRQF_SHARED,
|
||||
"madgemc", dev)) {
|
||||
ret = -EBUSY;
|
||||
goto getout3;
|
||||
}
|
||||
|
||||
madgemc_chipset_init(dev); /* enables interrupts! */
|
||||
madgemc_setcabletype(dev, card->cabletype);
|
||||
|
||||
/* Setup MCA structures */
|
||||
mca_device_set_name(mdev, (card->cardtype == 0x08)?MADGEMC16_CARDNAME:MADGEMC32_CARDNAME);
|
||||
mca_set_adapter_procfn(mdev->slot, madgemc_mcaproc, dev);
|
||||
|
||||
printk("%s: Ring Station Address: %pM\n",
|
||||
dev->name, dev->dev_addr);
|
||||
|
||||
if (tmsdev_init(dev, device)) {
|
||||
printk("%s: unable to get memory for dev->priv.\n",
|
||||
dev->name);
|
||||
ret = -ENOMEM;
|
||||
goto getout4;
|
||||
}
|
||||
tp = netdev_priv(dev);
|
||||
|
||||
/*
|
||||
* The MC16 is physically a 32bit card. However, Madge
|
||||
* insists on calling it 16bit, so I'll assume here that
|
||||
* they know what they're talking about. Cut off DMA
|
||||
* at 16mb.
|
||||
*/
|
||||
tp->setnselout = madgemc_setnselout_pins;
|
||||
tp->sifwriteb = madgemc_sifwriteb;
|
||||
tp->sifreadb = madgemc_sifreadb;
|
||||
tp->sifwritew = madgemc_sifwritew;
|
||||
tp->sifreadw = madgemc_sifreadw;
|
||||
tp->DataRate = (card->ringspeed)?SPEED_16:SPEED_4;
|
||||
|
||||
memcpy(tp->ProductID, "Madge MCA 16/4 ", PROD_ID_SIZE + 1);
|
||||
|
||||
tp->tmspriv = card;
|
||||
dev_set_drvdata(device, dev);
|
||||
|
||||
if (register_netdev(dev) == 0)
|
||||
return 0;
|
||||
|
||||
dev_set_drvdata(device, NULL);
|
||||
ret = -ENOMEM;
|
||||
getout4:
|
||||
free_irq(dev->irq, dev);
|
||||
getout3:
|
||||
release_region(dev->base_addr-MADGEMC_SIF_OFFSET,
|
||||
MADGEMC_IO_EXTENT);
|
||||
getout2:
|
||||
kfree(card);
|
||||
getout1:
|
||||
free_netdev(dev);
|
||||
getout:
|
||||
mca_device_set_claim(mdev, 0);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* Handle interrupts generated by the card
|
||||
*
|
||||
* The MicroChannel Madge cards need slightly more handling
|
||||
* after an interrupt than other TMS380 cards do.
|
||||
*
|
||||
* First we must make sure it was this card that generated the
|
||||
* interrupt (since interrupt sharing is allowed). Then,
|
||||
* because we're using level-triggered interrupts (as is
|
||||
* standard on MCA), we must toggle the interrupt line
|
||||
* on the card in order to claim and acknowledge the interrupt.
|
||||
* Once that is done, the interrupt should be handlable in
|
||||
* the normal tms380tr_interrupt() routine.
|
||||
*
|
||||
* There's two ways we can check to see if the interrupt is ours,
|
||||
* both with their own disadvantages...
|
||||
*
|
||||
* 1) Read in the SIFSTS register from the TMS controller. This
|
||||
* is guaranteed to be accurate, however, there's a fairly
|
||||
* large performance penalty for doing so: the Madge chips
|
||||
* must request the register from the Eagle, the Eagle must
|
||||
* read them from its internal bus, and then take the route
|
||||
* back out again, for a 16bit read.
|
||||
*
|
||||
* 2) Use the MC_CONTROL_REG0_SINTR bit from the Madge ASICs.
|
||||
* The major disadvantage here is that the accuracy of the
|
||||
* bit is in question. However, it cuts out the extra read
|
||||
* cycles it takes to read the Eagle's SIF, as its only an
|
||||
* 8bit read, and theoretically the Madge bit is directly
|
||||
* connected to the interrupt latch coming out of the Eagle
|
||||
* hardware (that statement is not verified).
|
||||
*
|
||||
* I can't determine which of these methods has the best win. For now,
|
||||
* we make a compromise. Use the Madge way for the first interrupt,
|
||||
* which should be the fast-path, and then once we hit the first
|
||||
* interrupt, keep on trying using the SIF method until we've
|
||||
* exhausted all contiguous interrupts.
|
||||
*
|
||||
*/
|
||||
static irqreturn_t madgemc_interrupt(int irq, void *dev_id)
|
||||
{
|
||||
int pending,reg1;
|
||||
struct net_device *dev;
|
||||
|
||||
if (!dev_id) {
|
||||
printk("madgemc_interrupt: was not passed a dev_id!\n");
|
||||
return IRQ_NONE;
|
||||
}
|
||||
|
||||
dev = dev_id;
|
||||
|
||||
/* Make sure its really us. -- the Madge way */
|
||||
pending = inb(dev->base_addr + MC_CONTROL_REG0);
|
||||
if (!(pending & MC_CONTROL_REG0_SINTR))
|
||||
return IRQ_NONE; /* not our interrupt */
|
||||
|
||||
/*
|
||||
* Since we're level-triggered, we may miss the rising edge
|
||||
* of the next interrupt while we're off handling this one,
|
||||
* so keep checking until the SIF verifies that it has nothing
|
||||
* left for us to do.
|
||||
*/
|
||||
pending = STS_SYSTEM_IRQ;
|
||||
do {
|
||||
if (pending & STS_SYSTEM_IRQ) {
|
||||
|
||||
/* Toggle the interrupt to reset the latch on card */
|
||||
reg1 = inb(dev->base_addr + MC_CONTROL_REG1);
|
||||
outb(reg1 ^ MC_CONTROL_REG1_SINTEN,
|
||||
dev->base_addr + MC_CONTROL_REG1);
|
||||
outb(reg1, dev->base_addr + MC_CONTROL_REG1);
|
||||
|
||||
/* Continue handling as normal */
|
||||
tms380tr_interrupt(irq, dev_id);
|
||||
|
||||
pending = SIFREADW(SIFSTS); /* restart - the SIF way */
|
||||
|
||||
} else
|
||||
return IRQ_HANDLED;
|
||||
} while (1);
|
||||
|
||||
return IRQ_HANDLED; /* not reachable */
|
||||
}
|
||||
|
||||
/*
|
||||
* Set the card to the preferred ring speed.
|
||||
*
|
||||
* Unlike newer cards, the MC16/32 have their speed selection
|
||||
* circuit connected to the Madge ASICs and not to the TMS380
|
||||
* NSELOUT pins. Set the ASIC bits correctly here, and return
|
||||
* zero to leave the TMS NSELOUT bits unaffected.
|
||||
*
|
||||
*/
|
||||
static unsigned short madgemc_setnselout_pins(struct net_device *dev)
|
||||
{
|
||||
unsigned char reg1;
|
||||
struct net_local *tp = netdev_priv(dev);
|
||||
|
||||
reg1 = inb(dev->base_addr + MC_CONTROL_REG1);
|
||||
|
||||
if(tp->DataRate == SPEED_16)
|
||||
reg1 |= MC_CONTROL_REG1_SPEED_SEL; /* add for 16mb */
|
||||
else if (reg1 & MC_CONTROL_REG1_SPEED_SEL)
|
||||
reg1 ^= MC_CONTROL_REG1_SPEED_SEL; /* remove for 4mb */
|
||||
outb(reg1, dev->base_addr + MC_CONTROL_REG1);
|
||||
|
||||
return 0; /* no change */
|
||||
}
|
||||
|
||||
/*
|
||||
* Set the register page. This equates to the SRSX line
|
||||
* on the TMS380Cx6.
|
||||
*
|
||||
* Register selection is normally done via three contiguous
|
||||
* bits. However, some boards (such as the MC16/32) use only
|
||||
* two bits, plus a separate bit in the glue chip. This
|
||||
* sets the SRSX bit (the top bit). See page 4-17 in the
|
||||
* Yellow Book for which registers are affected.
|
||||
*
|
||||
*/
|
||||
static void madgemc_setregpage(struct net_device *dev, int page)
|
||||
{
|
||||
static int reg1;
|
||||
|
||||
reg1 = inb(dev->base_addr + MC_CONTROL_REG1);
|
||||
if ((page == 0) && (reg1 & MC_CONTROL_REG1_SRSX)) {
|
||||
outb(reg1 ^ MC_CONTROL_REG1_SRSX,
|
||||
dev->base_addr + MC_CONTROL_REG1);
|
||||
}
|
||||
else if (page == 1) {
|
||||
outb(reg1 | MC_CONTROL_REG1_SRSX,
|
||||
dev->base_addr + MC_CONTROL_REG1);
|
||||
}
|
||||
reg1 = inb(dev->base_addr + MC_CONTROL_REG1);
|
||||
}
|
||||
|
||||
/*
|
||||
* The SIF registers are not mapped into register space by default
|
||||
* Set this to 1 to map them, 0 to map the BIA ROM.
|
||||
*
|
||||
*/
|
||||
static void madgemc_setsifsel(struct net_device *dev, int val)
|
||||
{
|
||||
unsigned int reg0;
|
||||
|
||||
reg0 = inb(dev->base_addr + MC_CONTROL_REG0);
|
||||
if ((val == 0) && (reg0 & MC_CONTROL_REG0_SIFSEL)) {
|
||||
outb(reg0 ^ MC_CONTROL_REG0_SIFSEL,
|
||||
dev->base_addr + MC_CONTROL_REG0);
|
||||
} else if (val == 1) {
|
||||
outb(reg0 | MC_CONTROL_REG0_SIFSEL,
|
||||
dev->base_addr + MC_CONTROL_REG0);
|
||||
}
|
||||
reg0 = inb(dev->base_addr + MC_CONTROL_REG0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Enable SIF interrupts
|
||||
*
|
||||
* This does not enable interrupts in the SIF, but rather
|
||||
* enables SIF interrupts to be passed onto the host.
|
||||
*
|
||||
*/
|
||||
static void madgemc_setint(struct net_device *dev, int val)
|
||||
{
|
||||
unsigned int reg1;
|
||||
|
||||
reg1 = inb(dev->base_addr + MC_CONTROL_REG1);
|
||||
if ((val == 0) && (reg1 & MC_CONTROL_REG1_SINTEN)) {
|
||||
outb(reg1 ^ MC_CONTROL_REG1_SINTEN,
|
||||
dev->base_addr + MC_CONTROL_REG1);
|
||||
} else if (val == 1) {
|
||||
outb(reg1 | MC_CONTROL_REG1_SINTEN,
|
||||
dev->base_addr + MC_CONTROL_REG1);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Cable type is set via control register 7. Bit zero high
|
||||
* for UTP, low for STP.
|
||||
*/
|
||||
static void madgemc_setcabletype(struct net_device *dev, int type)
|
||||
{
|
||||
outb((type==0)?MC_CONTROL_REG7_CABLEUTP:MC_CONTROL_REG7_CABLESTP,
|
||||
dev->base_addr + MC_CONTROL_REG7);
|
||||
}
|
||||
|
||||
/*
|
||||
* Enable the functions of the Madge chipset needed for
|
||||
* full working order.
|
||||
*/
|
||||
static int madgemc_chipset_init(struct net_device *dev)
|
||||
{
|
||||
outb(0, dev->base_addr + MC_CONTROL_REG1); /* pull SRESET low */
|
||||
tms380tr_wait(100); /* wait for card to reset */
|
||||
|
||||
/* bring back into normal operating mode */
|
||||
outb(MC_CONTROL_REG1_NSRESET, dev->base_addr + MC_CONTROL_REG1);
|
||||
|
||||
/* map SIF registers */
|
||||
madgemc_setsifsel(dev, 1);
|
||||
|
||||
/* enable SIF interrupts */
|
||||
madgemc_setint(dev, 1);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Disable the board, and put back into power-up state.
|
||||
*/
|
||||
static void madgemc_chipset_close(struct net_device *dev)
|
||||
{
|
||||
/* disable interrupts */
|
||||
madgemc_setint(dev, 0);
|
||||
/* unmap SIF registers */
|
||||
madgemc_setsifsel(dev, 0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Read the card type (MC16 or MC32) from the card.
|
||||
*
|
||||
* The configuration registers are stored in two separate
|
||||
* pages. Pages are flipped by clearing bit 3 of CONTROL_REG0 (PAGE)
|
||||
* for page zero, or setting bit 3 for page one.
|
||||
*
|
||||
* Page zero contains the following data:
|
||||
* Byte 0: Manufacturer ID (0x4D -- ASCII "M")
|
||||
* Byte 1: Card type:
|
||||
* 0x08 for MC16
|
||||
* 0x0D for MC32
|
||||
* Byte 2: Card revision
|
||||
* Byte 3: Mirror of POS config register 0
|
||||
* Byte 4: Mirror of POS 1
|
||||
* Byte 5: Mirror of POS 2
|
||||
*
|
||||
* Page one contains the following data:
|
||||
* Byte 0: Unused
|
||||
* Byte 1-6: BIA, MSB to LSB.
|
||||
*
|
||||
* Note that to read the BIA, we must unmap the SIF registers
|
||||
* by clearing bit 2 of CONTROL_REG0 (SIFSEL), as the data
|
||||
* will reside in the same logical location. For this reason,
|
||||
* _never_ read the BIA while the Eagle processor is running!
|
||||
* The SIF will be completely inaccessible until the BIA operation
|
||||
* is complete.
|
||||
*
|
||||
*/
|
||||
static void madgemc_read_rom(struct net_device *dev, struct card_info *card)
|
||||
{
|
||||
unsigned long ioaddr;
|
||||
unsigned char reg0, reg1, tmpreg0, i;
|
||||
|
||||
ioaddr = dev->base_addr;
|
||||
|
||||
reg0 = inb(ioaddr + MC_CONTROL_REG0);
|
||||
reg1 = inb(ioaddr + MC_CONTROL_REG1);
|
||||
|
||||
/* Switch to page zero and unmap SIF */
|
||||
tmpreg0 = reg0 & ~(MC_CONTROL_REG0_PAGE + MC_CONTROL_REG0_SIFSEL);
|
||||
outb(tmpreg0, ioaddr + MC_CONTROL_REG0);
|
||||
|
||||
card->manid = inb(ioaddr + MC_ROM_MANUFACTURERID);
|
||||
card->cardtype = inb(ioaddr + MC_ROM_ADAPTERID);
|
||||
card->cardrev = inb(ioaddr + MC_ROM_REVISION);
|
||||
|
||||
/* Switch to rom page one */
|
||||
outb(tmpreg0 | MC_CONTROL_REG0_PAGE, ioaddr + MC_CONTROL_REG0);
|
||||
|
||||
/* Read BIA */
|
||||
dev->addr_len = 6;
|
||||
for (i = 0; i < 6; i++)
|
||||
dev->dev_addr[i] = inb(ioaddr + MC_ROM_BIA_START + i);
|
||||
|
||||
/* Restore original register values */
|
||||
outb(reg0, ioaddr + MC_CONTROL_REG0);
|
||||
outb(reg1, ioaddr + MC_CONTROL_REG1);
|
||||
}
|
||||
|
||||
static int madgemc_open(struct net_device *dev)
|
||||
{
|
||||
/*
|
||||
* Go ahead and reinitialize the chipset again, just to
|
||||
* make sure we didn't get left in a bad state.
|
||||
*/
|
||||
madgemc_chipset_init(dev);
|
||||
tms380tr_open(dev);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int madgemc_close(struct net_device *dev)
|
||||
{
|
||||
tms380tr_close(dev);
|
||||
madgemc_chipset_close(dev);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Give some details available from /proc/mca/slotX
|
||||
*/
|
||||
static int madgemc_mcaproc(char *buf, int slot, void *d)
|
||||
{
|
||||
struct net_device *dev = (struct net_device *)d;
|
||||
struct net_local *tp = netdev_priv(dev);
|
||||
struct card_info *curcard = tp->tmspriv;
|
||||
int len = 0;
|
||||
|
||||
len += sprintf(buf+len, "-------\n");
|
||||
if (curcard) {
|
||||
len += sprintf(buf+len, "Card Revision: %d\n", curcard->cardrev);
|
||||
len += sprintf(buf+len, "RAM Size: %dkb\n", curcard->ramsize);
|
||||
len += sprintf(buf+len, "Cable type: %s\n", (curcard->cabletype)?"STP/DB9":"UTP/RJ-45");
|
||||
len += sprintf(buf+len, "Configured ring speed: %dMb/sec\n", (curcard->ringspeed)?16:4);
|
||||
len += sprintf(buf+len, "Running ring speed: %dMb/sec\n", (tp->DataRate==SPEED_16)?16:4);
|
||||
len += sprintf(buf+len, "Device: %s\n", dev->name);
|
||||
len += sprintf(buf+len, "IO Port: 0x%04lx\n", dev->base_addr);
|
||||
len += sprintf(buf+len, "IRQ: %d\n", dev->irq);
|
||||
len += sprintf(buf+len, "Arbitration Level: %d\n", curcard->arblevel);
|
||||
len += sprintf(buf+len, "Burst Mode: ");
|
||||
switch(curcard->burstmode) {
|
||||
case 0: len += sprintf(buf+len, "Cycle steal"); break;
|
||||
case 1: len += sprintf(buf+len, "Limited burst"); break;
|
||||
case 2: len += sprintf(buf+len, "Delayed release"); break;
|
||||
case 3: len += sprintf(buf+len, "Immediate release"); break;
|
||||
}
|
||||
len += sprintf(buf+len, " (%s)\n", (curcard->fairness)?"Unfair":"Fair");
|
||||
|
||||
len += sprintf(buf+len, "Ring Station Address: %pM\n",
|
||||
dev->dev_addr);
|
||||
} else
|
||||
len += sprintf(buf+len, "Card not configured\n");
|
||||
|
||||
return len;
|
||||
}
|
||||
|
||||
static int __devexit madgemc_remove(struct device *device)
|
||||
{
|
||||
struct net_device *dev = dev_get_drvdata(device);
|
||||
struct net_local *tp;
|
||||
struct card_info *card;
|
||||
|
||||
BUG_ON(!dev);
|
||||
|
||||
tp = netdev_priv(dev);
|
||||
card = tp->tmspriv;
|
||||
kfree(card);
|
||||
tp->tmspriv = NULL;
|
||||
|
||||
unregister_netdev(dev);
|
||||
release_region(dev->base_addr-MADGEMC_SIF_OFFSET, MADGEMC_IO_EXTENT);
|
||||
free_irq(dev->irq, dev);
|
||||
tmsdev_term(dev);
|
||||
free_netdev(dev);
|
||||
dev_set_drvdata(device, NULL);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static short madgemc_adapter_ids[] __initdata = {
|
||||
0x002d,
|
||||
0x0000
|
||||
};
|
||||
|
||||
static struct mca_driver madgemc_driver = {
|
||||
.id_table = madgemc_adapter_ids,
|
||||
.driver = {
|
||||
.name = "madgemc",
|
||||
.bus = &mca_bus_type,
|
||||
.probe = madgemc_probe,
|
||||
.remove = __devexit_p(madgemc_remove),
|
||||
},
|
||||
};
|
||||
|
||||
static int __init madgemc_init (void)
|
||||
{
|
||||
madgemc_netdev_ops = tms380tr_netdev_ops;
|
||||
madgemc_netdev_ops.ndo_open = madgemc_open;
|
||||
madgemc_netdev_ops.ndo_stop = madgemc_close;
|
||||
|
||||
return mca_register_driver (&madgemc_driver);
|
||||
}
|
||||
|
||||
static void __exit madgemc_exit (void)
|
||||
{
|
||||
mca_unregister_driver (&madgemc_driver);
|
||||
}
|
||||
|
||||
module_init(madgemc_init);
|
||||
module_exit(madgemc_exit);
|
||||
|
||||
MODULE_LICENSE("GPL");
|
||||
|
|
@ -1,70 +0,0 @@
|
|||
/*
|
||||
* madgemc.h: Header for the madgemc tms380tr module
|
||||
*
|
||||
* Authors:
|
||||
* - Adam Fritzler
|
||||
*/
|
||||
|
||||
#ifndef __LINUX_MADGEMC_H
|
||||
#define __LINUX_MADGEMC_H
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#define MADGEMC16_CARDNAME "Madge Smart 16/4 MC16 Ringnode"
|
||||
#define MADGEMC32_CARDNAME "Madge Smart 16/4 MC32 Ringnode"
|
||||
|
||||
/*
|
||||
* Bit definitions for the POS config registers
|
||||
*/
|
||||
#define MC16_POS0_ADDR1 0x20
|
||||
#define MC16_POS2_ADDR2 0x04
|
||||
#define MC16_POS3_ADDR3 0x20
|
||||
|
||||
#define MC_CONTROL_REG0 ((long)-8) /* 0x00 */
|
||||
#define MC_CONTROL_REG1 ((long)-7) /* 0x01 */
|
||||
#define MC_ADAPTER_POS_REG0 ((long)-6) /* 0x02 */
|
||||
#define MC_ADAPTER_POS_REG1 ((long)-5) /* 0x03 */
|
||||
#define MC_ADAPTER_POS_REG2 ((long)-4) /* 0x04 */
|
||||
#define MC_ADAPTER_REG5_UNUSED ((long)-3) /* 0x05 */
|
||||
#define MC_ADAPTER_REG6_UNUSED ((long)-2) /* 0x06 */
|
||||
#define MC_CONTROL_REG7 ((long)-1) /* 0x07 */
|
||||
|
||||
#define MC_CONTROL_REG0_UNKNOWN1 0x01
|
||||
#define MC_CONTROL_REG0_UNKNOWN2 0x02
|
||||
#define MC_CONTROL_REG0_SIFSEL 0x04
|
||||
#define MC_CONTROL_REG0_PAGE 0x08
|
||||
#define MC_CONTROL_REG0_TESTINTERRUPT 0x10
|
||||
#define MC_CONTROL_REG0_UNKNOWN20 0x20
|
||||
#define MC_CONTROL_REG0_SINTR 0x40
|
||||
#define MC_CONTROL_REG0_UNKNOWN80 0x80
|
||||
|
||||
#define MC_CONTROL_REG1_SINTEN 0x01
|
||||
#define MC_CONTROL_REG1_BITOFDEATH 0x02
|
||||
#define MC_CONTROL_REG1_NSRESET 0x04
|
||||
#define MC_CONTROL_REG1_UNKNOWN8 0x08
|
||||
#define MC_CONTROL_REG1_UNKNOWN10 0x10
|
||||
#define MC_CONTROL_REG1_UNKNOWN20 0x20
|
||||
#define MC_CONTROL_REG1_SRSX 0x40
|
||||
#define MC_CONTROL_REG1_SPEED_SEL 0x80
|
||||
|
||||
#define MC_CONTROL_REG7_CABLESTP 0x00
|
||||
#define MC_CONTROL_REG7_CABLEUTP 0x01
|
||||
|
||||
/*
|
||||
* ROM Page Zero
|
||||
*/
|
||||
#define MC_ROM_MANUFACTURERID 0x00
|
||||
#define MC_ROM_ADAPTERID 0x01
|
||||
#define MC_ROM_REVISION 0x02
|
||||
#define MC_ROM_CONFIG0 0x03
|
||||
#define MC_ROM_CONFIG1 0x04
|
||||
#define MC_ROM_CONFIG2 0x05
|
||||
|
||||
/*
|
||||
* ROM Page One
|
||||
*/
|
||||
#define MC_ROM_UNUSED_BYTE 0x00
|
||||
#define MC_ROM_BIA_START 0x01
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
#endif /* __LINUX_MADGEMC_H */
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1,321 +0,0 @@
|
|||
/*
|
||||
* olympic.h (c) 1999 Peter De Schrijver All Rights Reserved
|
||||
* 1999,2000 Mike Phillips (mikep@linuxtr.net)
|
||||
*
|
||||
* Linux driver for IBM PCI tokenring cards based on the olympic and the PIT/PHY chipset.
|
||||
*
|
||||
* Base Driver Skeleton:
|
||||
* Written 1993-94 by Donald Becker.
|
||||
*
|
||||
* Copyright 1993 United States Government as represented by the
|
||||
* Director, National Security Agency.
|
||||
*
|
||||
* This software may be used and distributed according to the terms
|
||||
* of the GNU General Public License, incorporated herein by reference.
|
||||
*/
|
||||
|
||||
#define CID 0x4e
|
||||
|
||||
#define BCTL 0x70
|
||||
#define BCTL_SOFTRESET (1<<15)
|
||||
#define BCTL_MIMREB (1<<6)
|
||||
#define BCTL_MODE_INDICATOR (1<<5)
|
||||
|
||||
#define GPR 0x4a
|
||||
#define GPR_OPTI_BF (1<<6)
|
||||
#define GPR_NEPTUNE_BF (1<<4)
|
||||
#define GPR_AUTOSENSE (1<<2)
|
||||
#define GPR_16MBPS (1<<3)
|
||||
|
||||
#define PAG 0x85
|
||||
#define LBC 0x8e
|
||||
|
||||
#define LISR 0x10
|
||||
#define LISR_SUM 0x14
|
||||
#define LISR_RWM 0x18
|
||||
|
||||
#define LISR_LIE (1<<15)
|
||||
#define LISR_SLIM (1<<13)
|
||||
#define LISR_SLI (1<<12)
|
||||
#define LISR_PCMSRMASK (1<<11)
|
||||
#define LISR_PCMSRINT (1<<10)
|
||||
#define LISR_WOLMASK (1<<9)
|
||||
#define LISR_WOL (1<<8)
|
||||
#define LISR_SRB_CMD (1<<5)
|
||||
#define LISR_ASB_REPLY (1<<4)
|
||||
#define LISR_ASB_FREE_REQ (1<<2)
|
||||
#define LISR_ARB_FREE (1<<1)
|
||||
#define LISR_TRB_FRAME (1<<0)
|
||||
|
||||
#define SISR 0x20
|
||||
#define SISR_SUM 0x24
|
||||
#define SISR_RWM 0x28
|
||||
#define SISR_RR 0x2C
|
||||
#define SISR_RESMASK 0x30
|
||||
#define SISR_MASK 0x54
|
||||
#define SISR_MASK_SUM 0x58
|
||||
#define SISR_MASK_RWM 0x5C
|
||||
|
||||
#define SISR_TX2_IDLE (1<<31)
|
||||
#define SISR_TX2_HALT (1<<29)
|
||||
#define SISR_TX2_EOF (1<<28)
|
||||
#define SISR_TX1_IDLE (1<<27)
|
||||
#define SISR_TX1_HALT (1<<25)
|
||||
#define SISR_TX1_EOF (1<<24)
|
||||
#define SISR_TIMEOUT (1<<23)
|
||||
#define SISR_RX_NOBUF (1<<22)
|
||||
#define SISR_RX_STATUS (1<<21)
|
||||
#define SISR_RX_HALT (1<<18)
|
||||
#define SISR_RX_EOF_EARLY (1<<16)
|
||||
#define SISR_MI (1<<15)
|
||||
#define SISR_PI (1<<13)
|
||||
#define SISR_ERR (1<<9)
|
||||
#define SISR_ADAPTER_CHECK (1<<6)
|
||||
#define SISR_SRB_REPLY (1<<5)
|
||||
#define SISR_ASB_FREE (1<<4)
|
||||
#define SISR_ARB_CMD (1<<3)
|
||||
#define SISR_TRB_REPLY (1<<2)
|
||||
|
||||
#define EISR 0x34
|
||||
#define EISR_RWM 0x38
|
||||
#define EISR_MASK 0x3c
|
||||
#define EISR_MASK_OPTIONS 0x001FFF7F
|
||||
|
||||
#define LAPA 0x60
|
||||
#define LAPWWO 0x64
|
||||
#define LAPWWC 0x68
|
||||
#define LAPCTL 0x6C
|
||||
#define LAIPD 0x78
|
||||
#define LAIPDDINC 0x7C
|
||||
|
||||
#define TIMER 0x50
|
||||
|
||||
#define CLKCTL 0x74
|
||||
#define CLKCTL_PAUSE (1<<15)
|
||||
|
||||
#define PM_CON 0x4
|
||||
|
||||
#define BMCTL_SUM 0x40
|
||||
#define BMCTL_RWM 0x44
|
||||
#define BMCTL_TX2_DIS (1<<30)
|
||||
#define BMCTL_TX1_DIS (1<<26)
|
||||
#define BMCTL_RX_DIS (1<<22)
|
||||
|
||||
#define BMASR 0xcc
|
||||
|
||||
#define RXDESCQ 0x90
|
||||
#define RXDESCQCNT 0x94
|
||||
#define RXCDA 0x98
|
||||
#define RXENQ 0x9C
|
||||
#define RXSTATQ 0xA0
|
||||
#define RXSTATQCNT 0xA4
|
||||
#define RXCSA 0xA8
|
||||
#define RXCLEN 0xAC
|
||||
#define RXHLEN 0xAE
|
||||
|
||||
#define TXDESCQ_1 0xb0
|
||||
#define TXDESCQ_2 0xd0
|
||||
#define TXDESCQCNT_1 0xb4
|
||||
#define TXDESCQCNT_2 0xd4
|
||||
#define TXCDA_1 0xb8
|
||||
#define TXCDA_2 0xd8
|
||||
#define TXENQ_1 0xbc
|
||||
#define TXENQ_2 0xdc
|
||||
#define TXSTATQ_1 0xc0
|
||||
#define TXSTATQ_2 0xe0
|
||||
#define TXSTATQCNT_1 0xc4
|
||||
#define TXSTATQCNT_2 0xe4
|
||||
#define TXCSA_1 0xc8
|
||||
#define TXCSA_2 0xe8
|
||||
/* Cardbus */
|
||||
#define FERMASK 0xf4
|
||||
#define FERMASK_INT_BIT (1<<15)
|
||||
|
||||
#define OLYMPIC_IO_SPACE 256
|
||||
|
||||
#define SRB_COMMAND_SIZE 50
|
||||
|
||||
#define OLYMPIC_MAX_ADAPTERS 8 /* 0x08 __MODULE_STRING can't hand 0xnn */
|
||||
|
||||
/* Defines for LAN STATUS CHANGE reports */
|
||||
#define LSC_SIG_LOSS 0x8000
|
||||
#define LSC_HARD_ERR 0x4000
|
||||
#define LSC_SOFT_ERR 0x2000
|
||||
#define LSC_TRAN_BCN 0x1000
|
||||
#define LSC_LWF 0x0800
|
||||
#define LSC_ARW 0x0400
|
||||
#define LSC_FPE 0x0200
|
||||
#define LSC_RR 0x0100
|
||||
#define LSC_CO 0x0080
|
||||
#define LSC_SS 0x0040
|
||||
#define LSC_RING_REC 0x0020
|
||||
#define LSC_SR_CO 0x0010
|
||||
#define LSC_FDX_MODE 0x0004
|
||||
|
||||
/* Defines for OPEN ADAPTER command */
|
||||
|
||||
#define OPEN_ADAPTER_EXT_WRAP (1<<15)
|
||||
#define OPEN_ADAPTER_DIS_HARDEE (1<<14)
|
||||
#define OPEN_ADAPTER_DIS_SOFTERR (1<<13)
|
||||
#define OPEN_ADAPTER_PASS_ADC_MAC (1<<12)
|
||||
#define OPEN_ADAPTER_PASS_ATT_MAC (1<<11)
|
||||
#define OPEN_ADAPTER_ENABLE_EC (1<<10)
|
||||
#define OPEN_ADAPTER_CONTENDER (1<<8)
|
||||
#define OPEN_ADAPTER_PASS_BEACON (1<<7)
|
||||
#define OPEN_ADAPTER_ENABLE_FDX (1<<6)
|
||||
#define OPEN_ADAPTER_ENABLE_RPL (1<<5)
|
||||
#define OPEN_ADAPTER_INHIBIT_ETR (1<<4)
|
||||
#define OPEN_ADAPTER_INTERNAL_WRAP (1<<3)
|
||||
#define OPEN_ADAPTER_USE_OPTS2 (1<<0)
|
||||
|
||||
#define OPEN_ADAPTER_2_ENABLE_ONNOW (1<<15)
|
||||
|
||||
/* Defines for SRB Commands */
|
||||
|
||||
#define SRB_ACCESS_REGISTER 0x1f
|
||||
#define SRB_CLOSE_ADAPTER 0x04
|
||||
#define SRB_CONFIGURE_BRIDGE 0x0c
|
||||
#define SRB_CONFIGURE_WAKEUP_EVENT 0x1a
|
||||
#define SRB_MODIFY_BRIDGE_PARMS 0x15
|
||||
#define SRB_MODIFY_OPEN_OPTIONS 0x01
|
||||
#define SRB_MODIFY_RECEIVE_OPTIONS 0x17
|
||||
#define SRB_NO_OPERATION 0x00
|
||||
#define SRB_OPEN_ADAPTER 0x03
|
||||
#define SRB_READ_LOG 0x08
|
||||
#define SRB_READ_SR_COUNTERS 0x16
|
||||
#define SRB_RESET_GROUP_ADDRESS 0x02
|
||||
#define SRB_SAVE_CONFIGURATION 0x1b
|
||||
#define SRB_SET_BRIDGE_PARMS 0x09
|
||||
#define SRB_SET_BRIDGE_TARGETS 0x10
|
||||
#define SRB_SET_FUNC_ADDRESS 0x07
|
||||
#define SRB_SET_GROUP_ADDRESS 0x06
|
||||
#define SRB_SET_GROUP_ADDR_OPTIONS 0x11
|
||||
#define SRB_UPDATE_WAKEUP_PATTERN 0x19
|
||||
|
||||
/* Clear return code */
|
||||
|
||||
#define OLYMPIC_CLEAR_RET_CODE 0xfe
|
||||
|
||||
/* ARB Commands */
|
||||
#define ARB_RECEIVE_DATA 0x81
|
||||
#define ARB_LAN_CHANGE_STATUS 0x84
|
||||
/* ASB Response commands */
|
||||
|
||||
#define ASB_RECEIVE_DATA 0x81
|
||||
|
||||
|
||||
/* Olympic defaults for buffers */
|
||||
|
||||
#define OLYMPIC_RX_RING_SIZE 16 /* should be a power of 2 */
|
||||
#define OLYMPIC_TX_RING_SIZE 8 /* should be a power of 2 */
|
||||
|
||||
#define PKT_BUF_SZ 4096 /* Default packet size */
|
||||
|
||||
/* Olympic data structures */
|
||||
|
||||
/* xxxx These structures are all little endian in hardware. */
|
||||
|
||||
struct olympic_tx_desc {
|
||||
__le32 buffer;
|
||||
__le32 status_length;
|
||||
};
|
||||
|
||||
struct olympic_tx_status {
|
||||
__le32 status;
|
||||
};
|
||||
|
||||
struct olympic_rx_desc {
|
||||
__le32 buffer;
|
||||
__le32 res_length;
|
||||
};
|
||||
|
||||
struct olympic_rx_status {
|
||||
__le32 fragmentcnt_framelen;
|
||||
__le32 status_buffercnt;
|
||||
};
|
||||
/* xxxx END These structures are all little endian in hardware. */
|
||||
/* xxxx There may be more, but I'm pretty sure about these */
|
||||
|
||||
struct mac_receive_buffer {
|
||||
__le16 next ;
|
||||
u8 padding ;
|
||||
u8 frame_status ;
|
||||
__le16 buffer_length ;
|
||||
u8 frame_data ;
|
||||
};
|
||||
|
||||
struct olympic_private {
|
||||
|
||||
u16 srb; /* be16 */
|
||||
u16 trb; /* be16 */
|
||||
u16 arb; /* be16 */
|
||||
u16 asb; /* be16 */
|
||||
|
||||
u8 __iomem *olympic_mmio;
|
||||
u8 __iomem *olympic_lap;
|
||||
struct pci_dev *pdev ;
|
||||
const char *olympic_card_name;
|
||||
|
||||
spinlock_t olympic_lock ;
|
||||
|
||||
volatile int srb_queued; /* True if an SRB is still posted */
|
||||
wait_queue_head_t srb_wait;
|
||||
|
||||
volatile int asb_queued; /* True if an ASB is posted */
|
||||
|
||||
volatile int trb_queued; /* True if a TRB is posted */
|
||||
wait_queue_head_t trb_wait ;
|
||||
|
||||
/* These must be on a 4 byte boundary. */
|
||||
struct olympic_rx_desc olympic_rx_ring[OLYMPIC_RX_RING_SIZE];
|
||||
struct olympic_tx_desc olympic_tx_ring[OLYMPIC_TX_RING_SIZE];
|
||||
struct olympic_rx_status olympic_rx_status_ring[OLYMPIC_RX_RING_SIZE];
|
||||
struct olympic_tx_status olympic_tx_status_ring[OLYMPIC_TX_RING_SIZE];
|
||||
|
||||
struct sk_buff *tx_ring_skb[OLYMPIC_TX_RING_SIZE], *rx_ring_skb[OLYMPIC_RX_RING_SIZE];
|
||||
int tx_ring_free, tx_ring_last_status, rx_ring_last_received,rx_status_last_received, free_tx_ring_entries;
|
||||
|
||||
u16 olympic_lan_status ;
|
||||
u8 olympic_ring_speed ;
|
||||
u16 pkt_buf_sz ;
|
||||
u8 olympic_receive_options, olympic_copy_all_options,olympic_message_level, olympic_network_monitor;
|
||||
u16 olympic_addr_table_addr, olympic_parms_addr ;
|
||||
u8 olympic_laa[6] ;
|
||||
u32 rx_ring_dma_addr;
|
||||
u32 rx_status_ring_dma_addr;
|
||||
u32 tx_ring_dma_addr;
|
||||
u32 tx_status_ring_dma_addr;
|
||||
};
|
||||
|
||||
struct olympic_adapter_addr_table {
|
||||
|
||||
u8 node_addr[6] ;
|
||||
u8 reserved[4] ;
|
||||
u8 func_addr[4] ;
|
||||
} ;
|
||||
|
||||
struct olympic_parameters_table {
|
||||
|
||||
u8 phys_addr[4] ;
|
||||
u8 up_node_addr[6] ;
|
||||
u8 up_phys_addr[4] ;
|
||||
u8 poll_addr[6] ;
|
||||
u16 reserved ;
|
||||
u16 acc_priority ;
|
||||
u16 auth_source_class ;
|
||||
u16 att_code ;
|
||||
u8 source_addr[6] ;
|
||||
u16 beacon_type ;
|
||||
u16 major_vector ;
|
||||
u16 lan_status ;
|
||||
u16 soft_error_time ;
|
||||
u16 reserved1 ;
|
||||
u16 local_ring ;
|
||||
u16 mon_error ;
|
||||
u16 beacon_transmit ;
|
||||
u16 beacon_receive ;
|
||||
u16 frame_correl ;
|
||||
u8 beacon_naun[6] ;
|
||||
u32 reserved2 ;
|
||||
u8 beacon_phys[4] ;
|
||||
};
|
|
@ -1,422 +0,0 @@
|
|||
/*
|
||||
* proteon.c: A network driver for Proteon ISA token ring cards.
|
||||
*
|
||||
* Based on tmspci written 1999 by Adam Fritzler
|
||||
*
|
||||
* Written 2003 by Jochen Friedrich
|
||||
*
|
||||
* This software may be used and distributed according to the terms
|
||||
* of the GNU General Public License, incorporated herein by reference.
|
||||
*
|
||||
* This driver module supports the following cards:
|
||||
* - Proteon 1392, 1392+
|
||||
*
|
||||
* Maintainer(s):
|
||||
* AF Adam Fritzler
|
||||
* JF Jochen Friedrich jochen@scram.de
|
||||
*
|
||||
* Modification History:
|
||||
* 02-Jan-03 JF Created
|
||||
*
|
||||
*/
|
||||
static const char version[] = "proteon.c: v1.00 02/01/2003 by Jochen Friedrich\n";
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/errno.h>
|
||||
#include <linux/pci.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/netdevice.h>
|
||||
#include <linux/trdevice.h>
|
||||
#include <linux/platform_device.h>
|
||||
|
||||
#include <asm/io.h>
|
||||
#include <asm/irq.h>
|
||||
#include <asm/pci.h>
|
||||
#include <asm/dma.h>
|
||||
|
||||
#include "tms380tr.h"
|
||||
|
||||
#define PROTEON_IO_EXTENT 32
|
||||
|
||||
/* A zero-terminated list of I/O addresses to be probed. */
|
||||
static unsigned int portlist[] __initdata = {
|
||||
0x0A20, 0x0E20, 0x1A20, 0x1E20, 0x2A20, 0x2E20, 0x3A20, 0x3E20,// Prot.
|
||||
0x4A20, 0x4E20, 0x5A20, 0x5E20, 0x6A20, 0x6E20, 0x7A20, 0x7E20,// Prot.
|
||||
0x8A20, 0x8E20, 0x9A20, 0x9E20, 0xAA20, 0xAE20, 0xBA20, 0xBE20,// Prot.
|
||||
0xCA20, 0xCE20, 0xDA20, 0xDE20, 0xEA20, 0xEE20, 0xFA20, 0xFE20,// Prot.
|
||||
0
|
||||
};
|
||||
|
||||
/* A zero-terminated list of IRQs to be probed. */
|
||||
static unsigned short irqlist[] = {
|
||||
7, 6, 5, 4, 3, 12, 11, 10, 9,
|
||||
0
|
||||
};
|
||||
|
||||
/* A zero-terminated list of DMAs to be probed. */
|
||||
static int dmalist[] __initdata = {
|
||||
5, 6, 7,
|
||||
0
|
||||
};
|
||||
|
||||
static char cardname[] = "Proteon 1392\0";
|
||||
static u64 dma_mask = ISA_MAX_ADDRESS;
|
||||
static int proteon_open(struct net_device *dev);
|
||||
static void proteon_read_eeprom(struct net_device *dev);
|
||||
static unsigned short proteon_setnselout_pins(struct net_device *dev);
|
||||
|
||||
static unsigned short proteon_sifreadb(struct net_device *dev, unsigned short reg)
|
||||
{
|
||||
return inb(dev->base_addr + reg);
|
||||
}
|
||||
|
||||
static unsigned short proteon_sifreadw(struct net_device *dev, unsigned short reg)
|
||||
{
|
||||
return inw(dev->base_addr + reg);
|
||||
}
|
||||
|
||||
static void proteon_sifwriteb(struct net_device *dev, unsigned short val, unsigned short reg)
|
||||
{
|
||||
outb(val, dev->base_addr + reg);
|
||||
}
|
||||
|
||||
static void proteon_sifwritew(struct net_device *dev, unsigned short val, unsigned short reg)
|
||||
{
|
||||
outw(val, dev->base_addr + reg);
|
||||
}
|
||||
|
||||
static int __init proteon_probe1(struct net_device *dev, int ioaddr)
|
||||
{
|
||||
unsigned char chk1, chk2;
|
||||
int i;
|
||||
|
||||
if (!request_region(ioaddr, PROTEON_IO_EXTENT, cardname))
|
||||
return -ENODEV;
|
||||
|
||||
|
||||
chk1 = inb(ioaddr + 0x1f); /* Get Proteon ID reg 1 */
|
||||
if (chk1 != 0x1f)
|
||||
goto nodev;
|
||||
|
||||
chk1 = inb(ioaddr + 0x1e) & 0x07; /* Get Proteon ID reg 0 */
|
||||
for (i=0; i<16; i++) {
|
||||
chk2 = inb(ioaddr + 0x1e) & 0x07;
|
||||
if (((chk1 + 1) & 0x07) != chk2)
|
||||
goto nodev;
|
||||
chk1 = chk2;
|
||||
}
|
||||
|
||||
dev->base_addr = ioaddr;
|
||||
return 0;
|
||||
nodev:
|
||||
release_region(ioaddr, PROTEON_IO_EXTENT);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
static struct net_device_ops proteon_netdev_ops __read_mostly;
|
||||
|
||||
static int __init setup_card(struct net_device *dev, struct device *pdev)
|
||||
{
|
||||
struct net_local *tp;
|
||||
static int versionprinted;
|
||||
const unsigned *port;
|
||||
int j,err = 0;
|
||||
|
||||
if (!dev)
|
||||
return -ENOMEM;
|
||||
|
||||
if (dev->base_addr) /* probe specific location */
|
||||
err = proteon_probe1(dev, dev->base_addr);
|
||||
else {
|
||||
for (port = portlist; *port; port++) {
|
||||
err = proteon_probe1(dev, *port);
|
||||
if (!err)
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (err)
|
||||
goto out5;
|
||||
|
||||
/* At this point we have found a valid card. */
|
||||
|
||||
if (versionprinted++ == 0)
|
||||
printk(KERN_DEBUG "%s", version);
|
||||
|
||||
err = -EIO;
|
||||
pdev->dma_mask = &dma_mask;
|
||||
if (tmsdev_init(dev, pdev))
|
||||
goto out4;
|
||||
|
||||
dev->base_addr &= ~3;
|
||||
|
||||
proteon_read_eeprom(dev);
|
||||
|
||||
printk(KERN_DEBUG "proteon.c: Ring Station Address: %pM\n",
|
||||
dev->dev_addr);
|
||||
|
||||
tp = netdev_priv(dev);
|
||||
tp->setnselout = proteon_setnselout_pins;
|
||||
|
||||
tp->sifreadb = proteon_sifreadb;
|
||||
tp->sifreadw = proteon_sifreadw;
|
||||
tp->sifwriteb = proteon_sifwriteb;
|
||||
tp->sifwritew = proteon_sifwritew;
|
||||
|
||||
memcpy(tp->ProductID, cardname, PROD_ID_SIZE + 1);
|
||||
|
||||
tp->tmspriv = NULL;
|
||||
|
||||
dev->netdev_ops = &proteon_netdev_ops;
|
||||
|
||||
if (dev->irq == 0)
|
||||
{
|
||||
for(j = 0; irqlist[j] != 0; j++)
|
||||
{
|
||||
dev->irq = irqlist[j];
|
||||
if (!request_irq(dev->irq, tms380tr_interrupt, 0,
|
||||
cardname, dev))
|
||||
break;
|
||||
}
|
||||
|
||||
if(irqlist[j] == 0)
|
||||
{
|
||||
printk(KERN_INFO "proteon.c: AutoSelect no IRQ available\n");
|
||||
goto out3;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for(j = 0; irqlist[j] != 0; j++)
|
||||
if (irqlist[j] == dev->irq)
|
||||
break;
|
||||
if (irqlist[j] == 0)
|
||||
{
|
||||
printk(KERN_INFO "proteon.c: Illegal IRQ %d specified\n",
|
||||
dev->irq);
|
||||
goto out3;
|
||||
}
|
||||
if (request_irq(dev->irq, tms380tr_interrupt, 0,
|
||||
cardname, dev))
|
||||
{
|
||||
printk(KERN_INFO "proteon.c: Selected IRQ %d not available\n",
|
||||
dev->irq);
|
||||
goto out3;
|
||||
}
|
||||
}
|
||||
|
||||
if (dev->dma == 0)
|
||||
{
|
||||
for(j = 0; dmalist[j] != 0; j++)
|
||||
{
|
||||
dev->dma = dmalist[j];
|
||||
if (!request_dma(dev->dma, cardname))
|
||||
break;
|
||||
}
|
||||
|
||||
if(dmalist[j] == 0)
|
||||
{
|
||||
printk(KERN_INFO "proteon.c: AutoSelect no DMA available\n");
|
||||
goto out2;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for(j = 0; dmalist[j] != 0; j++)
|
||||
if (dmalist[j] == dev->dma)
|
||||
break;
|
||||
if (dmalist[j] == 0)
|
||||
{
|
||||
printk(KERN_INFO "proteon.c: Illegal DMA %d specified\n",
|
||||
dev->dma);
|
||||
goto out2;
|
||||
}
|
||||
if (request_dma(dev->dma, cardname))
|
||||
{
|
||||
printk(KERN_INFO "proteon.c: Selected DMA %d not available\n",
|
||||
dev->dma);
|
||||
goto out2;
|
||||
}
|
||||
}
|
||||
|
||||
err = register_netdev(dev);
|
||||
if (err)
|
||||
goto out;
|
||||
|
||||
printk(KERN_DEBUG "%s: IO: %#4lx IRQ: %d DMA: %d\n",
|
||||
dev->name, dev->base_addr, dev->irq, dev->dma);
|
||||
|
||||
return 0;
|
||||
out:
|
||||
free_dma(dev->dma);
|
||||
out2:
|
||||
free_irq(dev->irq, dev);
|
||||
out3:
|
||||
tmsdev_term(dev);
|
||||
out4:
|
||||
release_region(dev->base_addr, PROTEON_IO_EXTENT);
|
||||
out5:
|
||||
return err;
|
||||
}
|
||||
|
||||
/*
|
||||
* Reads MAC address from adapter RAM, which should've read it from
|
||||
* the onboard ROM.
|
||||
*
|
||||
* Calling this on a board that does not support it can be a very
|
||||
* dangerous thing. The Madge board, for instance, will lock your
|
||||
* machine hard when this is called. Luckily, its supported in a
|
||||
* separate driver. --ASF
|
||||
*/
|
||||
static void proteon_read_eeprom(struct net_device *dev)
|
||||
{
|
||||
int i;
|
||||
|
||||
/* Address: 0000:0000 */
|
||||
proteon_sifwritew(dev, 0, SIFADX);
|
||||
proteon_sifwritew(dev, 0, SIFADR);
|
||||
|
||||
/* Read six byte MAC address data */
|
||||
dev->addr_len = 6;
|
||||
for(i = 0; i < 6; i++)
|
||||
dev->dev_addr[i] = proteon_sifreadw(dev, SIFINC) >> 8;
|
||||
}
|
||||
|
||||
static unsigned short proteon_setnselout_pins(struct net_device *dev)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int proteon_open(struct net_device *dev)
|
||||
{
|
||||
struct net_local *tp = netdev_priv(dev);
|
||||
unsigned short val = 0;
|
||||
int i;
|
||||
|
||||
/* Proteon reset sequence */
|
||||
outb(0, dev->base_addr + 0x11);
|
||||
mdelay(20);
|
||||
outb(0x04, dev->base_addr + 0x11);
|
||||
mdelay(20);
|
||||
outb(0, dev->base_addr + 0x11);
|
||||
mdelay(100);
|
||||
|
||||
/* set control/status reg */
|
||||
val = inb(dev->base_addr + 0x11);
|
||||
val |= 0x78;
|
||||
val &= 0xf9;
|
||||
if(tp->DataRate == SPEED_4)
|
||||
val |= 0x20;
|
||||
else
|
||||
val &= ~0x20;
|
||||
|
||||
outb(val, dev->base_addr + 0x11);
|
||||
outb(0xff, dev->base_addr + 0x12);
|
||||
for(i = 0; irqlist[i] != 0; i++)
|
||||
{
|
||||
if(irqlist[i] == dev->irq)
|
||||
break;
|
||||
}
|
||||
val = i;
|
||||
i = (7 - dev->dma) << 4;
|
||||
val |= i;
|
||||
outb(val, dev->base_addr + 0x13);
|
||||
|
||||
return tms380tr_open(dev);
|
||||
}
|
||||
|
||||
#define ISATR_MAX_ADAPTERS 3
|
||||
|
||||
static int io[ISATR_MAX_ADAPTERS];
|
||||
static int irq[ISATR_MAX_ADAPTERS];
|
||||
static int dma[ISATR_MAX_ADAPTERS];
|
||||
|
||||
MODULE_LICENSE("GPL");
|
||||
|
||||
module_param_array(io, int, NULL, 0);
|
||||
module_param_array(irq, int, NULL, 0);
|
||||
module_param_array(dma, int, NULL, 0);
|
||||
|
||||
static struct platform_device *proteon_dev[ISATR_MAX_ADAPTERS];
|
||||
|
||||
static struct platform_driver proteon_driver = {
|
||||
.driver = {
|
||||
.name = "proteon",
|
||||
},
|
||||
};
|
||||
|
||||
static int __init proteon_init(void)
|
||||
{
|
||||
struct net_device *dev;
|
||||
struct platform_device *pdev;
|
||||
int i, num = 0, err = 0;
|
||||
|
||||
proteon_netdev_ops = tms380tr_netdev_ops;
|
||||
proteon_netdev_ops.ndo_open = proteon_open;
|
||||
proteon_netdev_ops.ndo_stop = tms380tr_close;
|
||||
|
||||
err = platform_driver_register(&proteon_driver);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
for (i = 0; i < ISATR_MAX_ADAPTERS ; i++) {
|
||||
dev = alloc_trdev(sizeof(struct net_local));
|
||||
if (!dev)
|
||||
continue;
|
||||
|
||||
dev->base_addr = io[i];
|
||||
dev->irq = irq[i];
|
||||
dev->dma = dma[i];
|
||||
pdev = platform_device_register_simple("proteon",
|
||||
i, NULL, 0);
|
||||
if (IS_ERR(pdev)) {
|
||||
free_netdev(dev);
|
||||
continue;
|
||||
}
|
||||
err = setup_card(dev, &pdev->dev);
|
||||
if (!err) {
|
||||
proteon_dev[i] = pdev;
|
||||
platform_set_drvdata(pdev, dev);
|
||||
++num;
|
||||
} else {
|
||||
platform_device_unregister(pdev);
|
||||
free_netdev(dev);
|
||||
}
|
||||
}
|
||||
|
||||
printk(KERN_NOTICE "proteon.c: %d cards found.\n", num);
|
||||
/* Probe for cards. */
|
||||
if (num == 0) {
|
||||
printk(KERN_NOTICE "proteon.c: No cards found.\n");
|
||||
platform_driver_unregister(&proteon_driver);
|
||||
return -ENODEV;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void __exit proteon_cleanup(void)
|
||||
{
|
||||
struct net_device *dev;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < ISATR_MAX_ADAPTERS ; i++) {
|
||||
struct platform_device *pdev = proteon_dev[i];
|
||||
|
||||
if (!pdev)
|
||||
continue;
|
||||
dev = platform_get_drvdata(pdev);
|
||||
unregister_netdev(dev);
|
||||
release_region(dev->base_addr, PROTEON_IO_EXTENT);
|
||||
free_irq(dev->irq, dev);
|
||||
free_dma(dev->dma);
|
||||
tmsdev_term(dev);
|
||||
free_netdev(dev);
|
||||
platform_set_drvdata(pdev, NULL);
|
||||
platform_device_unregister(pdev);
|
||||
}
|
||||
platform_driver_unregister(&proteon_driver);
|
||||
}
|
||||
|
||||
module_init(proteon_init);
|
||||
module_exit(proteon_cleanup);
|
|
@ -1,432 +0,0 @@
|
|||
/*
|
||||
* skisa.c: A network driver for SK-NET TMS380-based ISA token ring cards.
|
||||
*
|
||||
* Based on tmspci written 1999 by Adam Fritzler
|
||||
*
|
||||
* Written 2000 by Jochen Friedrich
|
||||
* Dedicated to my girlfriend Steffi Bopp
|
||||
*
|
||||
* This software may be used and distributed according to the terms
|
||||
* of the GNU General Public License, incorporated herein by reference.
|
||||
*
|
||||
* This driver module supports the following cards:
|
||||
* - SysKonnect TR4/16(+) ISA (SK-4190)
|
||||
*
|
||||
* Maintainer(s):
|
||||
* AF Adam Fritzler
|
||||
* JF Jochen Friedrich jochen@scram.de
|
||||
*
|
||||
* Modification History:
|
||||
* 14-Jan-01 JF Created
|
||||
* 28-Oct-02 JF Fixed probe of card for static compilation.
|
||||
* Fixed module init to not make hotplug go wild.
|
||||
* 09-Nov-02 JF Fixed early bail out on out of memory
|
||||
* situations if multiple cards are found.
|
||||
* Cleaned up some unnecessary console SPAM.
|
||||
* 09-Dec-02 JF Fixed module reference counting.
|
||||
* 02-Jan-03 JF Renamed to skisa.c
|
||||
*
|
||||
*/
|
||||
static const char version[] = "skisa.c: v1.03 09/12/2002 by Jochen Friedrich\n";
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/errno.h>
|
||||
#include <linux/pci.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/netdevice.h>
|
||||
#include <linux/trdevice.h>
|
||||
#include <linux/platform_device.h>
|
||||
|
||||
#include <asm/io.h>
|
||||
#include <asm/irq.h>
|
||||
#include <asm/pci.h>
|
||||
#include <asm/dma.h>
|
||||
|
||||
#include "tms380tr.h"
|
||||
|
||||
#define SK_ISA_IO_EXTENT 32
|
||||
|
||||
/* A zero-terminated list of I/O addresses to be probed. */
|
||||
static unsigned int portlist[] __initdata = {
|
||||
0x0A20, 0x1A20, 0x0B20, 0x1B20, 0x0980, 0x1980, 0x0900, 0x1900,// SK
|
||||
0
|
||||
};
|
||||
|
||||
/* A zero-terminated list of IRQs to be probed.
|
||||
* Used again after initial probe for sktr_chipset_init, called from sktr_open.
|
||||
*/
|
||||
static const unsigned short irqlist[] = {
|
||||
3, 5, 9, 10, 11, 12, 15,
|
||||
0
|
||||
};
|
||||
|
||||
/* A zero-terminated list of DMAs to be probed. */
|
||||
static int dmalist[] __initdata = {
|
||||
5, 6, 7,
|
||||
0
|
||||
};
|
||||
|
||||
static char isa_cardname[] = "SK NET TR 4/16 ISA\0";
|
||||
static u64 dma_mask = ISA_MAX_ADDRESS;
|
||||
static int sk_isa_open(struct net_device *dev);
|
||||
static void sk_isa_read_eeprom(struct net_device *dev);
|
||||
static unsigned short sk_isa_setnselout_pins(struct net_device *dev);
|
||||
|
||||
static unsigned short sk_isa_sifreadb(struct net_device *dev, unsigned short reg)
|
||||
{
|
||||
return inb(dev->base_addr + reg);
|
||||
}
|
||||
|
||||
static unsigned short sk_isa_sifreadw(struct net_device *dev, unsigned short reg)
|
||||
{
|
||||
return inw(dev->base_addr + reg);
|
||||
}
|
||||
|
||||
static void sk_isa_sifwriteb(struct net_device *dev, unsigned short val, unsigned short reg)
|
||||
{
|
||||
outb(val, dev->base_addr + reg);
|
||||
}
|
||||
|
||||
static void sk_isa_sifwritew(struct net_device *dev, unsigned short val, unsigned short reg)
|
||||
{
|
||||
outw(val, dev->base_addr + reg);
|
||||
}
|
||||
|
||||
|
||||
static int __init sk_isa_probe1(struct net_device *dev, int ioaddr)
|
||||
{
|
||||
unsigned char old, chk1, chk2;
|
||||
|
||||
if (!request_region(ioaddr, SK_ISA_IO_EXTENT, isa_cardname))
|
||||
return -ENODEV;
|
||||
|
||||
old = inb(ioaddr + SIFADR); /* Get the old SIFADR value */
|
||||
|
||||
chk1 = 0; /* Begin with check value 0 */
|
||||
do {
|
||||
/* Write new SIFADR value */
|
||||
outb(chk1, ioaddr + SIFADR);
|
||||
|
||||
/* Read, invert and write */
|
||||
chk2 = inb(ioaddr + SIFADD);
|
||||
chk2 ^= 0x0FE;
|
||||
outb(chk2, ioaddr + SIFADR);
|
||||
|
||||
/* Read, invert and compare */
|
||||
chk2 = inb(ioaddr + SIFADD);
|
||||
chk2 ^= 0x0FE;
|
||||
|
||||
if(chk1 != chk2) {
|
||||
release_region(ioaddr, SK_ISA_IO_EXTENT);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
chk1 -= 2;
|
||||
} while(chk1 != 0); /* Repeat 128 times (all byte values) */
|
||||
|
||||
/* Restore the SIFADR value */
|
||||
outb(old, ioaddr + SIFADR);
|
||||
|
||||
dev->base_addr = ioaddr;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct net_device_ops sk_isa_netdev_ops __read_mostly;
|
||||
|
||||
static int __init setup_card(struct net_device *dev, struct device *pdev)
|
||||
{
|
||||
struct net_local *tp;
|
||||
static int versionprinted;
|
||||
const unsigned *port;
|
||||
int j, err = 0;
|
||||
|
||||
if (!dev)
|
||||
return -ENOMEM;
|
||||
|
||||
if (dev->base_addr) /* probe specific location */
|
||||
err = sk_isa_probe1(dev, dev->base_addr);
|
||||
else {
|
||||
for (port = portlist; *port; port++) {
|
||||
err = sk_isa_probe1(dev, *port);
|
||||
if (!err)
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (err)
|
||||
goto out5;
|
||||
|
||||
/* At this point we have found a valid card. */
|
||||
|
||||
if (versionprinted++ == 0)
|
||||
printk(KERN_DEBUG "%s", version);
|
||||
|
||||
err = -EIO;
|
||||
pdev->dma_mask = &dma_mask;
|
||||
if (tmsdev_init(dev, pdev))
|
||||
goto out4;
|
||||
|
||||
dev->base_addr &= ~3;
|
||||
|
||||
sk_isa_read_eeprom(dev);
|
||||
|
||||
printk(KERN_DEBUG "skisa.c: Ring Station Address: %pM\n",
|
||||
dev->dev_addr);
|
||||
|
||||
tp = netdev_priv(dev);
|
||||
tp->setnselout = sk_isa_setnselout_pins;
|
||||
|
||||
tp->sifreadb = sk_isa_sifreadb;
|
||||
tp->sifreadw = sk_isa_sifreadw;
|
||||
tp->sifwriteb = sk_isa_sifwriteb;
|
||||
tp->sifwritew = sk_isa_sifwritew;
|
||||
|
||||
memcpy(tp->ProductID, isa_cardname, PROD_ID_SIZE + 1);
|
||||
|
||||
tp->tmspriv = NULL;
|
||||
|
||||
dev->netdev_ops = &sk_isa_netdev_ops;
|
||||
|
||||
if (dev->irq == 0)
|
||||
{
|
||||
for(j = 0; irqlist[j] != 0; j++)
|
||||
{
|
||||
dev->irq = irqlist[j];
|
||||
if (!request_irq(dev->irq, tms380tr_interrupt, 0,
|
||||
isa_cardname, dev))
|
||||
break;
|
||||
}
|
||||
|
||||
if(irqlist[j] == 0)
|
||||
{
|
||||
printk(KERN_INFO "skisa.c: AutoSelect no IRQ available\n");
|
||||
goto out3;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for(j = 0; irqlist[j] != 0; j++)
|
||||
if (irqlist[j] == dev->irq)
|
||||
break;
|
||||
if (irqlist[j] == 0)
|
||||
{
|
||||
printk(KERN_INFO "skisa.c: Illegal IRQ %d specified\n",
|
||||
dev->irq);
|
||||
goto out3;
|
||||
}
|
||||
if (request_irq(dev->irq, tms380tr_interrupt, 0,
|
||||
isa_cardname, dev))
|
||||
{
|
||||
printk(KERN_INFO "skisa.c: Selected IRQ %d not available\n",
|
||||
dev->irq);
|
||||
goto out3;
|
||||
}
|
||||
}
|
||||
|
||||
if (dev->dma == 0)
|
||||
{
|
||||
for(j = 0; dmalist[j] != 0; j++)
|
||||
{
|
||||
dev->dma = dmalist[j];
|
||||
if (!request_dma(dev->dma, isa_cardname))
|
||||
break;
|
||||
}
|
||||
|
||||
if(dmalist[j] == 0)
|
||||
{
|
||||
printk(KERN_INFO "skisa.c: AutoSelect no DMA available\n");
|
||||
goto out2;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for(j = 0; dmalist[j] != 0; j++)
|
||||
if (dmalist[j] == dev->dma)
|
||||
break;
|
||||
if (dmalist[j] == 0)
|
||||
{
|
||||
printk(KERN_INFO "skisa.c: Illegal DMA %d specified\n",
|
||||
dev->dma);
|
||||
goto out2;
|
||||
}
|
||||
if (request_dma(dev->dma, isa_cardname))
|
||||
{
|
||||
printk(KERN_INFO "skisa.c: Selected DMA %d not available\n",
|
||||
dev->dma);
|
||||
goto out2;
|
||||
}
|
||||
}
|
||||
|
||||
err = register_netdev(dev);
|
||||
if (err)
|
||||
goto out;
|
||||
|
||||
printk(KERN_DEBUG "%s: IO: %#4lx IRQ: %d DMA: %d\n",
|
||||
dev->name, dev->base_addr, dev->irq, dev->dma);
|
||||
|
||||
return 0;
|
||||
out:
|
||||
free_dma(dev->dma);
|
||||
out2:
|
||||
free_irq(dev->irq, dev);
|
||||
out3:
|
||||
tmsdev_term(dev);
|
||||
out4:
|
||||
release_region(dev->base_addr, SK_ISA_IO_EXTENT);
|
||||
out5:
|
||||
return err;
|
||||
}
|
||||
|
||||
/*
|
||||
* Reads MAC address from adapter RAM, which should've read it from
|
||||
* the onboard ROM.
|
||||
*
|
||||
* Calling this on a board that does not support it can be a very
|
||||
* dangerous thing. The Madge board, for instance, will lock your
|
||||
* machine hard when this is called. Luckily, its supported in a
|
||||
* separate driver. --ASF
|
||||
*/
|
||||
static void sk_isa_read_eeprom(struct net_device *dev)
|
||||
{
|
||||
int i;
|
||||
|
||||
/* Address: 0000:0000 */
|
||||
sk_isa_sifwritew(dev, 0, SIFADX);
|
||||
sk_isa_sifwritew(dev, 0, SIFADR);
|
||||
|
||||
/* Read six byte MAC address data */
|
||||
dev->addr_len = 6;
|
||||
for(i = 0; i < 6; i++)
|
||||
dev->dev_addr[i] = sk_isa_sifreadw(dev, SIFINC) >> 8;
|
||||
}
|
||||
|
||||
static unsigned short sk_isa_setnselout_pins(struct net_device *dev)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int sk_isa_open(struct net_device *dev)
|
||||
{
|
||||
struct net_local *tp = netdev_priv(dev);
|
||||
unsigned short val = 0;
|
||||
unsigned short oldval;
|
||||
int i;
|
||||
|
||||
val = 0;
|
||||
for(i = 0; irqlist[i] != 0; i++)
|
||||
{
|
||||
if(irqlist[i] == dev->irq)
|
||||
break;
|
||||
}
|
||||
|
||||
val |= CYCLE_TIME << 2;
|
||||
val |= i << 4;
|
||||
i = dev->dma - 5;
|
||||
val |= i;
|
||||
if(tp->DataRate == SPEED_4)
|
||||
val |= LINE_SPEED_BIT;
|
||||
else
|
||||
val &= ~LINE_SPEED_BIT;
|
||||
oldval = sk_isa_sifreadb(dev, POSREG);
|
||||
/* Leave cycle bits alone */
|
||||
oldval |= 0xf3;
|
||||
val &= oldval;
|
||||
sk_isa_sifwriteb(dev, val, POSREG);
|
||||
|
||||
return tms380tr_open(dev);
|
||||
}
|
||||
|
||||
#define ISATR_MAX_ADAPTERS 3
|
||||
|
||||
static int io[ISATR_MAX_ADAPTERS];
|
||||
static int irq[ISATR_MAX_ADAPTERS];
|
||||
static int dma[ISATR_MAX_ADAPTERS];
|
||||
|
||||
MODULE_LICENSE("GPL");
|
||||
|
||||
module_param_array(io, int, NULL, 0);
|
||||
module_param_array(irq, int, NULL, 0);
|
||||
module_param_array(dma, int, NULL, 0);
|
||||
|
||||
static struct platform_device *sk_isa_dev[ISATR_MAX_ADAPTERS];
|
||||
|
||||
static struct platform_driver sk_isa_driver = {
|
||||
.driver = {
|
||||
.name = "skisa",
|
||||
},
|
||||
};
|
||||
|
||||
static int __init sk_isa_init(void)
|
||||
{
|
||||
struct net_device *dev;
|
||||
struct platform_device *pdev;
|
||||
int i, num = 0, err = 0;
|
||||
|
||||
sk_isa_netdev_ops = tms380tr_netdev_ops;
|
||||
sk_isa_netdev_ops.ndo_open = sk_isa_open;
|
||||
sk_isa_netdev_ops.ndo_stop = tms380tr_close;
|
||||
|
||||
err = platform_driver_register(&sk_isa_driver);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
for (i = 0; i < ISATR_MAX_ADAPTERS ; i++) {
|
||||
dev = alloc_trdev(sizeof(struct net_local));
|
||||
if (!dev)
|
||||
continue;
|
||||
|
||||
dev->base_addr = io[i];
|
||||
dev->irq = irq[i];
|
||||
dev->dma = dma[i];
|
||||
pdev = platform_device_register_simple("skisa",
|
||||
i, NULL, 0);
|
||||
if (IS_ERR(pdev)) {
|
||||
free_netdev(dev);
|
||||
continue;
|
||||
}
|
||||
err = setup_card(dev, &pdev->dev);
|
||||
if (!err) {
|
||||
sk_isa_dev[i] = pdev;
|
||||
platform_set_drvdata(sk_isa_dev[i], dev);
|
||||
++num;
|
||||
} else {
|
||||
platform_device_unregister(pdev);
|
||||
free_netdev(dev);
|
||||
}
|
||||
}
|
||||
|
||||
printk(KERN_NOTICE "skisa.c: %d cards found.\n", num);
|
||||
/* Probe for cards. */
|
||||
if (num == 0) {
|
||||
printk(KERN_NOTICE "skisa.c: No cards found.\n");
|
||||
platform_driver_unregister(&sk_isa_driver);
|
||||
return -ENODEV;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void __exit sk_isa_cleanup(void)
|
||||
{
|
||||
struct net_device *dev;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < ISATR_MAX_ADAPTERS ; i++) {
|
||||
struct platform_device *pdev = sk_isa_dev[i];
|
||||
|
||||
if (!pdev)
|
||||
continue;
|
||||
dev = platform_get_drvdata(pdev);
|
||||
unregister_netdev(dev);
|
||||
release_region(dev->base_addr, SK_ISA_IO_EXTENT);
|
||||
free_irq(dev->irq, dev);
|
||||
free_dma(dev->dma);
|
||||
tmsdev_term(dev);
|
||||
free_netdev(dev);
|
||||
platform_set_drvdata(pdev, NULL);
|
||||
platform_device_unregister(pdev);
|
||||
}
|
||||
platform_driver_unregister(&sk_isa_driver);
|
||||
}
|
||||
|
||||
module_init(sk_isa_init);
|
||||
module_exit(sk_isa_cleanup);
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1,236 +0,0 @@
|
|||
/*
|
||||
* tmspci.c: A generic network driver for TMS380-based PCI token ring cards.
|
||||
*
|
||||
* Written 1999 by Adam Fritzler
|
||||
*
|
||||
* This software may be used and distributed according to the terms
|
||||
* of the GNU General Public License, incorporated herein by reference.
|
||||
*
|
||||
* This driver module supports the following cards:
|
||||
* - SysKonnect TR4/16(+) PCI (SK-4590)
|
||||
* - SysKonnect TR4/16 PCI (SK-4591)
|
||||
* - Compaq TR 4/16 PCI
|
||||
* - Thomas-Conrad TC4048 4/16 PCI
|
||||
* - 3Com 3C339 Token Link Velocity
|
||||
*
|
||||
* Maintainer(s):
|
||||
* AF Adam Fritzler
|
||||
*
|
||||
* Modification History:
|
||||
* 30-Dec-99 AF Split off from the tms380tr driver.
|
||||
* 22-Jan-00 AF Updated to use indirect read/writes
|
||||
* 23-Nov-00 JG New PCI API, cleanups
|
||||
*
|
||||
* TODO:
|
||||
* 1. See if we can use MMIO instead of port accesses
|
||||
*
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/errno.h>
|
||||
#include <linux/pci.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/netdevice.h>
|
||||
#include <linux/trdevice.h>
|
||||
|
||||
#include <asm/io.h>
|
||||
#include <asm/irq.h>
|
||||
|
||||
#include "tms380tr.h"
|
||||
|
||||
static char version[] __devinitdata =
|
||||
"tmspci.c: v1.02 23/11/2000 by Adam Fritzler\n";
|
||||
|
||||
#define TMS_PCI_IO_EXTENT 32
|
||||
|
||||
struct card_info {
|
||||
unsigned char nselout[2]; /* NSELOUT vals for 4mb([0]) and 16mb([1]) */
|
||||
char *name;
|
||||
};
|
||||
|
||||
static struct card_info card_info_table[] = {
|
||||
{ {0x03, 0x01}, "Compaq 4/16 TR PCI"},
|
||||
{ {0x03, 0x01}, "SK NET TR 4/16 PCI"},
|
||||
{ {0x03, 0x01}, "Thomas-Conrad TC4048 PCI 4/16"},
|
||||
{ {0x03, 0x01}, "3Com Token Link Velocity"},
|
||||
};
|
||||
|
||||
static DEFINE_PCI_DEVICE_TABLE(tmspci_pci_tbl) = {
|
||||
{ PCI_VENDOR_ID_COMPAQ, PCI_DEVICE_ID_COMPAQ_TOKENRING, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
|
||||
{ PCI_VENDOR_ID_SYSKONNECT, PCI_DEVICE_ID_SYSKONNECT_TR, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1 },
|
||||
{ PCI_VENDOR_ID_TCONRAD, PCI_DEVICE_ID_TCONRAD_TOKENRING, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 2 },
|
||||
{ PCI_VENDOR_ID_3COM, PCI_DEVICE_ID_3COM_3C339, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 3 },
|
||||
{ } /* Terminating entry */
|
||||
};
|
||||
MODULE_DEVICE_TABLE(pci, tmspci_pci_tbl);
|
||||
|
||||
MODULE_LICENSE("GPL");
|
||||
|
||||
static void tms_pci_read_eeprom(struct net_device *dev);
|
||||
static unsigned short tms_pci_setnselout_pins(struct net_device *dev);
|
||||
|
||||
static unsigned short tms_pci_sifreadb(struct net_device *dev, unsigned short reg)
|
||||
{
|
||||
return inb(dev->base_addr + reg);
|
||||
}
|
||||
|
||||
static unsigned short tms_pci_sifreadw(struct net_device *dev, unsigned short reg)
|
||||
{
|
||||
return inw(dev->base_addr + reg);
|
||||
}
|
||||
|
||||
static void tms_pci_sifwriteb(struct net_device *dev, unsigned short val, unsigned short reg)
|
||||
{
|
||||
outb(val, dev->base_addr + reg);
|
||||
}
|
||||
|
||||
static void tms_pci_sifwritew(struct net_device *dev, unsigned short val, unsigned short reg)
|
||||
{
|
||||
outw(val, dev->base_addr + reg);
|
||||
}
|
||||
|
||||
static int __devinit tms_pci_attach(struct pci_dev *pdev, const struct pci_device_id *ent)
|
||||
{
|
||||
static int versionprinted;
|
||||
struct net_device *dev;
|
||||
struct net_local *tp;
|
||||
int ret;
|
||||
unsigned int pci_irq_line;
|
||||
unsigned long pci_ioaddr;
|
||||
struct card_info *cardinfo = &card_info_table[ent->driver_data];
|
||||
|
||||
if (versionprinted++ == 0)
|
||||
printk("%s", version);
|
||||
|
||||
if (pci_enable_device(pdev))
|
||||
return -EIO;
|
||||
|
||||
/* Remove I/O space marker in bit 0. */
|
||||
pci_irq_line = pdev->irq;
|
||||
pci_ioaddr = pci_resource_start (pdev, 0);
|
||||
|
||||
/* At this point we have found a valid card. */
|
||||
dev = alloc_trdev(sizeof(struct net_local));
|
||||
if (!dev)
|
||||
return -ENOMEM;
|
||||
|
||||
if (!request_region(pci_ioaddr, TMS_PCI_IO_EXTENT, dev->name)) {
|
||||
ret = -EBUSY;
|
||||
goto err_out_trdev;
|
||||
}
|
||||
|
||||
dev->base_addr = pci_ioaddr;
|
||||
dev->irq = pci_irq_line;
|
||||
dev->dma = 0;
|
||||
|
||||
dev_info(&pdev->dev, "%s\n", cardinfo->name);
|
||||
dev_info(&pdev->dev, " IO: %#4lx IRQ: %d\n", dev->base_addr, dev->irq);
|
||||
|
||||
tms_pci_read_eeprom(dev);
|
||||
|
||||
dev_info(&pdev->dev, " Ring Station Address: %pM\n", dev->dev_addr);
|
||||
|
||||
ret = tmsdev_init(dev, &pdev->dev);
|
||||
if (ret) {
|
||||
dev_info(&pdev->dev, "unable to get memory for dev->priv.\n");
|
||||
goto err_out_region;
|
||||
}
|
||||
|
||||
tp = netdev_priv(dev);
|
||||
tp->setnselout = tms_pci_setnselout_pins;
|
||||
|
||||
tp->sifreadb = tms_pci_sifreadb;
|
||||
tp->sifreadw = tms_pci_sifreadw;
|
||||
tp->sifwriteb = tms_pci_sifwriteb;
|
||||
tp->sifwritew = tms_pci_sifwritew;
|
||||
|
||||
memcpy(tp->ProductID, cardinfo->name, PROD_ID_SIZE + 1);
|
||||
|
||||
tp->tmspriv = cardinfo;
|
||||
|
||||
dev->netdev_ops = &tms380tr_netdev_ops;
|
||||
|
||||
ret = request_irq(pdev->irq, tms380tr_interrupt, IRQF_SHARED,
|
||||
dev->name, dev);
|
||||
if (ret)
|
||||
goto err_out_tmsdev;
|
||||
|
||||
pci_set_drvdata(pdev, dev);
|
||||
SET_NETDEV_DEV(dev, &pdev->dev);
|
||||
|
||||
ret = register_netdev(dev);
|
||||
if (ret)
|
||||
goto err_out_irq;
|
||||
|
||||
return 0;
|
||||
|
||||
err_out_irq:
|
||||
free_irq(pdev->irq, dev);
|
||||
err_out_tmsdev:
|
||||
pci_set_drvdata(pdev, NULL);
|
||||
tmsdev_term(dev);
|
||||
err_out_region:
|
||||
release_region(pci_ioaddr, TMS_PCI_IO_EXTENT);
|
||||
err_out_trdev:
|
||||
free_netdev(dev);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* Reads MAC address from adapter RAM, which should've read it from
|
||||
* the onboard ROM.
|
||||
*
|
||||
* Calling this on a board that does not support it can be a very
|
||||
* dangerous thing. The Madge board, for instance, will lock your
|
||||
* machine hard when this is called. Luckily, its supported in a
|
||||
* separate driver. --ASF
|
||||
*/
|
||||
static void tms_pci_read_eeprom(struct net_device *dev)
|
||||
{
|
||||
int i;
|
||||
|
||||
/* Address: 0000:0000 */
|
||||
tms_pci_sifwritew(dev, 0, SIFADX);
|
||||
tms_pci_sifwritew(dev, 0, SIFADR);
|
||||
|
||||
/* Read six byte MAC address data */
|
||||
dev->addr_len = 6;
|
||||
for(i = 0; i < 6; i++)
|
||||
dev->dev_addr[i] = tms_pci_sifreadw(dev, SIFINC) >> 8;
|
||||
}
|
||||
|
||||
static unsigned short tms_pci_setnselout_pins(struct net_device *dev)
|
||||
{
|
||||
unsigned short val = 0;
|
||||
struct net_local *tp = netdev_priv(dev);
|
||||
struct card_info *cardinfo = tp->tmspriv;
|
||||
|
||||
if(tp->DataRate == SPEED_4)
|
||||
val |= cardinfo->nselout[0]; /* Set 4Mbps */
|
||||
else
|
||||
val |= cardinfo->nselout[1]; /* Set 16Mbps */
|
||||
return val;
|
||||
}
|
||||
|
||||
static void __devexit tms_pci_detach (struct pci_dev *pdev)
|
||||
{
|
||||
struct net_device *dev = pci_get_drvdata(pdev);
|
||||
|
||||
BUG_ON(!dev);
|
||||
unregister_netdev(dev);
|
||||
release_region(dev->base_addr, TMS_PCI_IO_EXTENT);
|
||||
free_irq(dev->irq, dev);
|
||||
tmsdev_term(dev);
|
||||
free_netdev(dev);
|
||||
pci_set_drvdata(pdev, NULL);
|
||||
}
|
||||
|
||||
static struct pci_driver tms_pci_driver = {
|
||||
.name = "tmspci",
|
||||
.id_table = tmspci_pci_tbl,
|
||||
.probe = tms_pci_attach,
|
||||
.remove = __devexit_p(tms_pci_detach),
|
||||
};
|
||||
|
||||
module_pci_driver(tms_pci_driver);
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -26,7 +26,6 @@ fw-shipped- += acenic/tg1.bin
|
|||
else
|
||||
acenic-objs := acenic/tg1.bin acenic/tg2.bin
|
||||
endif
|
||||
fw-shipped-$(CONFIG_3C359) += 3com/3C359.bin
|
||||
fw-shipped-$(CONFIG_ACENIC) += $(acenic-objs)
|
||||
fw-shipped-$(CONFIG_ADAPTEC_STARFIRE) += adaptec/starfire_rx.bin \
|
||||
adaptec/starfire_tx.bin
|
||||
|
@ -86,7 +85,6 @@ fw-shipped-$(CONFIG_SCSI_QLOGIC_1280) += qlogic/1040.bin qlogic/1280.bin \
|
|||
qlogic/12160.bin
|
||||
fw-shipped-$(CONFIG_SCSI_QLOGICPTI) += qlogic/isp1000.bin
|
||||
fw-shipped-$(CONFIG_INFINIBAND_QIB) += qlogic/sd7220.fw
|
||||
fw-shipped-$(CONFIG_SMCTR) += tr_smctr.bin
|
||||
fw-shipped-$(CONFIG_SND_KORG1212) += korg/k1212.dsp
|
||||
fw-shipped-$(CONFIG_SND_MAESTRO3) += ess/maestro3_assp_kernel.fw \
|
||||
ess/maestro3_assp_minisrc.fw
|
||||
|
|
|
@ -88,18 +88,6 @@ Licence: Allegedly GPLv2+, but no source visible. Marked:
|
|||
QLogic ISP1280/ device driver for Linux 2.2.x and 2.4.x
|
||||
Copyright (C) 2001 Qlogic Corporation (www.qlogic.com)
|
||||
|
||||
--------------------------------------------------------------------------
|
||||
Driver: smctr -- SMC ISA/MCA Token Ring adapter
|
||||
|
||||
File: tr_smctr.bin
|
||||
Info: MCT.BIN v6.3C1 03/01/95
|
||||
|
||||
Original licence info:
|
||||
|
||||
* This firmware is licensed to you strictly for use in conjunction
|
||||
* with the use of SMC TokenRing adapters. There is no waranty
|
||||
* expressed or implied about its fitness for any purpose.
|
||||
|
||||
--------------------------------------------------------------------------
|
||||
|
||||
Driver: kaweth -- USB KLSI KL5USB101-based Ethernet device
|
||||
|
@ -567,32 +555,6 @@ Found in hex form in kernel source.
|
|||
|
||||
--------------------------------------------------------------------------
|
||||
|
||||
Driver: 3C359 - 3Com 3C359 Token Link Velocity XL adapter
|
||||
|
||||
File: 3com/3C359.bin
|
||||
|
||||
Licence:
|
||||
/*
|
||||
* The firmware this driver downloads into the tokenring card is a
|
||||
* separate program and is not GPL'd source code, even though the Linux
|
||||
* side driver and the routine that loads this data into the card are.
|
||||
*
|
||||
* This firmware is licensed to you strictly for use in conjunction
|
||||
* with the use of 3Com 3C359 TokenRing adapters. There is no
|
||||
* waranty expressed or implied about its fitness for any purpose.
|
||||
*/
|
||||
/* 3c359_microcode.mac: 3Com 3C359 Tokenring microcode.
|
||||
*
|
||||
* Notes:
|
||||
* - Loaded from xl_init upon adapter initialization.
|
||||
*
|
||||
* Available from 3Com as part of their standard 3C359 driver.
|
||||
*/
|
||||
|
||||
Found in hex form in kernel source.
|
||||
|
||||
--------------------------------------------------------------------------
|
||||
|
||||
Driver: PCMCIA_PCNET - NE2000 compatible PCMCIA adapter
|
||||
|
||||
File: cis/LA-PCM.cis
|
||||
|
|
|
@ -1,477 +0,0 @@
|
|||
:10000000BC1D123B63B4E900001F000101000205A2
|
||||
:10001000010006030100040901000A070100080BA2
|
||||
:1000200001000C000000000F0100100D01000E1374
|
||||
:10003000010014110100120000050015010016193D
|
||||
:1000400001001A1701001800000E00000001000056
|
||||
:100050000004001B01001C0000070000000F00004E
|
||||
:10006000000B001D01001E0000080000000200003F
|
||||
:10007000000C000000060000000D0000000300005E
|
||||
:10008000000A00000009000478C6BC0194049380B3
|
||||
:10009000C84062E9DA1C2C1555555555555555582B
|
||||
:1000A0000BE9E5D595C19D77CEBBA06E1C05F67713
|
||||
:1000B000C602FA9670E81DC0170E02FA587DC05F9E
|
||||
:1000C00072CEECA4C384907A30CD8D7919E76C247C
|
||||
:1000D000279C08390738A84A4CEA4D989B244CC005
|
||||
:1000E00026D3E7545A4DF24C0C13234990326EA498
|
||||
:1000F000DF9371137726E126F8260C4C12260809A7
|
||||
:10010000828260A9307936B0B2A8A772648F9B331F
|
||||
:1001100033F9B839D51173AA75265D2651932A494A
|
||||
:1001200094C99589BC4DC89B809BA099064C862696
|
||||
:10013000589BA49B9937626C679B3330BF366661CE
|
||||
:10014000BF36ECC5BD66825A5031D59D9818293C02
|
||||
:1001500098864C17263E2CB8693B492EB408431AA2
|
||||
:10016000A4F9B351F110F343CD086F6379B3330EA3
|
||||
:100170001398499804DA7CE05279310C982E4DACF2
|
||||
:100180002C8414EE4CFE675EE49A7529D7A9353AA3
|
||||
:10019000945BD59B58B4AF7566AF14A9EF40952515
|
||||
:1001A00008B9AD42FCD8D98C330E1398661E45AC05
|
||||
:1001B000B00C42D3CCA61262DEB4B180497DA2DE7F
|
||||
:1001C000B418C02484E654F5834601681A630CC64B
|
||||
:1001D0001264FA4C351C2C0EAAAAAAAAAAAAAAAA88
|
||||
:1001E000AAAAAAAAAAADD70270E04CF3A1C1D5C0B1
|
||||
:1001F0003CB96939604E58770267933C99E4CF382F
|
||||
:100200001C972E401B903146A35E0E88346A35E061
|
||||
:10021000E8AA351AA9F51546A3EA7D4AA351AA9F73
|
||||
:100220007054A6572EB4CDC8A30CC1DAC6E1CB7A60
|
||||
:10023000D41C68FFCF55A8C02D851117442A300B58
|
||||
:100240004A88C24DB520D5260169516952195260BC
|
||||
:100250001695168296549805A545F3DD6AF9281877
|
||||
:10026000EF003030514E445D12D143E6126F9EBA1A
|
||||
:10027000CCDF25031DE006060A30CCA9EB2D008655
|
||||
:10028000A612654F56D665495F3DE837C940C77825
|
||||
:100290000181828C33184980AE40C518059C6D18C9
|
||||
:1002A000660EF3A0C61262DEF504B4AC6BC61991FB
|
||||
:1002B0007305482E72948073A1C8473666642F3642
|
||||
:1002C0006664079902918E72D10F9D063173A0C3A7
|
||||
:1002D000516A1A20BF3A0C2C7387435E600223FCDC
|
||||
:1002E000E0D635EF9EF5EF92818EF0030305186698
|
||||
:1002F00045CC0B482E700A4039D0E4239B3332178B
|
||||
:100300009B333203CC8548C73814A5CE297ED280D2
|
||||
:10031000A1A8B448882FCE830B1CE1D0D7980488BD
|
||||
:1003200087CE963173A58FF38358D7BE7B82AF9269
|
||||
:10033000818EF0030305186645CC1520B9C8290045
|
||||
:10034000E743908E6CCCC85E6CCCC80F3205231C82
|
||||
:10035000E450D45A17882FCE8310F9D023173A04CB
|
||||
:1003600035E600221639C3A3FCE0D635E0BFF41809
|
||||
:10037000F22D4D43516E5A221F30D417E74191732D
|
||||
:1003800005482E776900E743908E6CCCC85E6CCC34
|
||||
:10039000C80F3205231CEF4C4E0604C99E0BFF41CB
|
||||
:1003A0008F22D4D43516E5A221F35A82FCE8322EEE
|
||||
:1003B00060A905CE1348073A1C8473666642F3664B
|
||||
:1003C000664079902918E70A989C0A9EB5125C7CD1
|
||||
:1003D000C3318B982A7CD3ED38E9D34E74ED499E16
|
||||
:1003E0000BFF418F22D4D43516E5A22DEB45338F78
|
||||
:1003F000FCF7A05F25031DE40E060A30CC0CF3EBDE
|
||||
:1004000040DE61A870920A00E1241E00E1241E0073
|
||||
:10041000E1241E00E1241E00E1241E010F982A0B96
|
||||
:10042000F3A0C8B9A2A4173A6900E743908E7548B3
|
||||
:100430005E706901E6005231CC1814A5CC09829493
|
||||
:10044000730CA091F525CC070684849F30A2A47D6F
|
||||
:100450005075A665014A8EB4CCC435547566A49710
|
||||
:100460007A895053138019E3495C6DCEA940350653
|
||||
:1004700078D25706F1B32A8D972362925D69991C51
|
||||
:100480006A36E6CD46126F9EE1ABE4A30CC0DEAC4B
|
||||
:10049000D40D281BD012A500F84BAD332806A0DEE2
|
||||
:1004A00014973A895DC00DE30690925D699866B92C
|
||||
:1004B0001995E4A8CF9D331849BE7B86AF928C3343
|
||||
:1004C00024140CF4832421C270BFF418F22D4D4380
|
||||
:1004D000516E5A221F32A82FCE8322E605A4173A66
|
||||
:1004E0006900E743908E75485E706901E642A46337
|
||||
:1004F0009802294B9A2978E9405313818132678207
|
||||
:10050000FFD063C8B5350D45AE50087CE0D05F9D87
|
||||
:100510000645CC01A4173A6900E743908E75485E02
|
||||
:10052000706901E659A463981C52973B30528E7D46
|
||||
:100530002A091F51EBA4A40AB99487AEC531380229
|
||||
:10054000FFD063C8B5350D45AE50087CEA20BF3AF0
|
||||
:100550000C8B9A16905CE9A4039D0E4239D5217943
|
||||
:1005600095480F300A918E60EB297300095404CA34
|
||||
:1005700082655265E4CA226572650932E099724C5F
|
||||
:10058000C4E00BFF418F22D4D43516B94021F38A41
|
||||
:1005900082FCE8322E60A905CE9A4039D0E4239D32
|
||||
:1005A00052179954619901E640A4639804B1849864
|
||||
:1005B00018EF2D0305313802FFD063C8B5350D455E
|
||||
:1005C000B968887CE0505F9D0645CC81482E713427
|
||||
:1005D0008F48014815210521E90A5203CE5A4639B0
|
||||
:1005E000CF478E60AB1AF35343EB3524B81B30076B
|
||||
:1005F000098A742F7E41741E1D0D874649D595D1F9
|
||||
:10060000D5D5BBA94E829D053A0A7414E829D0427B
|
||||
:10061000745BCE50C40745BCE20C40745BCE8304CF
|
||||
:10062000F9954D13635E6F313BA08BA2C5398D7870
|
||||
:100630003A22A0006BC1D1546016D991A2E7438C35
|
||||
:1006400024DC1CE05117396B3BCC4B422E6B50BF66
|
||||
:100650003636654F7A185525789823E7503EF38152
|
||||
:100660004C026D3E7153AF78A9D4A629B1BCD9997B
|
||||
:10067000B28E628F222E7516B0B2AB23281654525A
|
||||
:1006800031BCD999B28E6619022E7516502CA9C8A4
|
||||
:10069000C6F520D3E47F4F9C0AD6167F90EE4CEB34
|
||||
:1006A000CFE288BA2F4286AEBDE5A7529F93637909
|
||||
:1006B000EB3308F9945247CD99256F3A0C13E65560
|
||||
:1006C000344C5A4DB52395A548115A0A4395AC2C84
|
||||
:1006D000BA240549B1BCCAA7726C6BC5BDE83169C3
|
||||
:1006E000525D0612653EB1504C7D4FAC0A300B3660
|
||||
:1006F0006411738A838E75129F7BD29958EE822E75
|
||||
:1007000077A0E39D5D4FBC2A532953DE9324BAB3EF
|
||||
:1007100036AA4AC679D4B9DE625A11735050BF372F
|
||||
:10072000366F1323BA0C24CEBDE2A752B28E6B6093
|
||||
:10073000622E751330ACA059CA646379B333651C5B
|
||||
:10074000CC32045CEA2CA059DF231BD4835247DD52
|
||||
:100750007996D49EB3524BA25A1A8D5D7B82A752D2
|
||||
:10076000B28E6619022E7516502C8C321D7B8EA708
|
||||
:1007700052B1BCD9999804DA7CE2ACFE6619022E1B
|
||||
:100780006550BF336664FE7418864C1726D6165221
|
||||
:100790003918DE7ACCC23E651491F36649086E833F
|
||||
:1007A0000933AF31ED0D9D0612622A318D6DE7419F
|
||||
:1007B000827CCAA68987092E29B1AF1039D66497E1
|
||||
:1007C000301D42759344028C24D27AB350F68905C9
|
||||
:1007D000435E6198C02C92253C8B2489490549E7EA
|
||||
:1007E0000CB98498B7AD3344AE5A5186609F38A98E
|
||||
:1007F000A26C6BC48EF45E49461262DEB4CD215CFD
|
||||
:10080000B4A30CC13E7229A26C6BC6126247F0E819
|
||||
:10081000C33204354092A4828810927CCBD42FA49A
|
||||
:1008200002118498B7AD3344AE5A5186609F38A9FF
|
||||
:10083000A26C6BC48EF45E494408493E65EA17D247
|
||||
:100840000108C24C5BD699A42B9694619827CE459B
|
||||
:10085000344D8D78810927CCBD12286C58AFB6F382
|
||||
:10086000A0C13E655344D8D7928E7D4BC2FA612613
|
||||
:10087000063AB36B030549E70CB96F5A66955CB449
|
||||
:10088000A30CC13E7029A26EA4DF9371137726E1F9
|
||||
:1008900026F826C6BC9473F92F0BE9849818EACC85
|
||||
:1008A000EC0C15279C32FF3D56AF928B7AD335D591
|
||||
:1008B000CB4A30CC13E7029A26C6BC947341979179
|
||||
:1008C000F483CE0420628B0516498C24C0C7569051
|
||||
:1008D000C0C15279C32E5BD5A672D294FAAD58C866
|
||||
:1008E000FA9F54B3324BB954A651866B79D0609FAE
|
||||
:1008F0003205344D8D7A4D1E7AB35100A93D59A869
|
||||
:100900007B4482A1AF4A8D52A95241494F3A2E40B1
|
||||
:10091000A49950BE90085279C32E61262DEB4CD07D
|
||||
:1009200015CB4A30CC13E7029A26C6BC48FE1D25DB
|
||||
:1009300046A954A920A4A79D1720524CA85F48049B
|
||||
:100940002309316F5A6680AE5A5186609F3814D1A0
|
||||
:100950003635E4A79D1720524CA2450D8B15F49116
|
||||
:10096000DE8BC928C24C5BD699A95CB4A30CD6F324
|
||||
:10097000A0C13E640A689B1AF16D4CAA92E03694BD
|
||||
:10098000709B297813AEB3AA85D44375093AC9EB95
|
||||
:100990003524B81B328E13487E4EFD40FD40FD408D
|
||||
:1009A000FD40FD40FC13F421F917458A300B335FFD
|
||||
:1009B00083A22A300B335F83A2A8C02DB32070928C
|
||||
:1009C000139ADE741827CCAA689B1AF70745518042
|
||||
:1009D0005B66470738A823E751113FE0E8854601E9
|
||||
:1009E0006D990612654F7A2024BAB33215257BAD76
|
||||
:1009F0003378AE0E73D047CEA730CC44FF83A2A885
|
||||
:100A0000C02CD991C1D11518059B3208BA2C518040
|
||||
:100A100059B3207092E29889FDBCEE1890FC8BA22D
|
||||
:100A2000C52B0D783A22A561AF074551805B66441E
|
||||
:100A30009EB3524B83ADC709BE1F9F74655D0A17F5
|
||||
:100A40007CABA0C24C3849122E384907A30CC13EDA
|
||||
:100A5000655344D8D7ADE700324B9B33344A03008B
|
||||
:100A60009D25CE8324B819998C02124BA199D8C028
|
||||
:100A7000274973CFF93CF47CE79804E92E7F39E3EA
|
||||
:100A80004F4653C06013A4B9E53C03DE8F9CF300CE
|
||||
:100A90009C6FCF3E85F9A336021E6038923E631AE2
|
||||
:100AA000109FCF181092BCD0A40CDCC00F9C9734C0
|
||||
:100AB00062B6E7F3F3A5CF1842341CC2CAFA8E68B7
|
||||
:100AC0005206AF3CA30DBF9E50E1D173CAE03AFC81
|
||||
:100AD000C1091A1E6A5C5B8E634E7773CC6167DD59
|
||||
:100AE000E66C48D1F31B24695108D4421BF467D14A
|
||||
:100AF000804E2FD08CD83009C21E801C46013A4748
|
||||
:100B0000D031A106013A7F4630211804E95E8429DC
|
||||
:100B100000C027CDD0007C9804F92E84628C027D21
|
||||
:100B2000BA3E7E4C027D2E8C61083009F41D0165B1
|
||||
:100B300073009F51D085201804FABD194618C027AC
|
||||
:100B4000DFD194384C027D174657013009F5FA0180
|
||||
:100B50000906013E87A14B88C027DC740D39D300FC
|
||||
:100B60009F73D030B39804FBBD06C483009F47D069
|
||||
:100B70003648CC0271BF3F9A17E63F0821E692A49F
|
||||
:100B80008F9A1031A7F310B184AF3AACDCF773F24F
|
||||
:100B90005CC62ADB9E7E7E97310863D0737B43A8B8
|
||||
:100BA000E63D34EAF3E315BF9F185F45CFE89F5F4A
|
||||
:100BB0009A5B03D0F3D3CE371CD00FBB9E68783B33
|
||||
:100BC000BCCA31E8F9A20212A27351086FD1F346F0
|
||||
:100BD0000138BF40FC23009C21E84951804E91F42C
|
||||
:100BE000210319804E9FD0216306013A568C02746E
|
||||
:100BF000FE75495E63D34A54423513A7D1804E95A2
|
||||
:100C0000E81E9A4C027CDD1BB9E6013E4BA062A3B4
|
||||
:100C1000009F6E8CFCF3009F4BA04218CC027D0716
|
||||
:100C200043DA13009F51D03D349804FABD1C628C06
|
||||
:100C3000027DFD1C6173009F45D1F44E6013EBF4FF
|
||||
:100C400025B033009F43D1A79C1804FB8E8403E991
|
||||
:100C5000804FB9E843C13009F77A0A319804FA3E67
|
||||
:100C6000844041804E82E7418709230423009D058B
|
||||
:100C7000CE961C248C108C0274173A043849182123
|
||||
:100C80001804E82E7450E12460846013A0B9D411D4
|
||||
:100C9000C248C108C0274173A82384918211804EA5
|
||||
:100CA00082E7528E12460846013A0B9D401C248C66
|
||||
:100CB000108C0274173A090E12460846013A0B9836
|
||||
:100CC0006A1C24B0E11804E82E6B50E1258708C0A7
|
||||
:100CD000274173054384961C23009D05CCAA1C2440
|
||||
:100CE000B0E11804E82E70687092C3846013E54484
|
||||
:100CF000F9409D05CE5A1C24B0E11804F9D13E708C
|
||||
:100D000027CF13E5442CA042CB89F2213A0B9C0A51
|
||||
:100D10001C24B0E11804F9D10B3810B3C4213936C2
|
||||
:100D20005C42C8842B79D061C2741524BAD331E5F2
|
||||
:100D300059082908E066634295128100290BC151C8
|
||||
:100D400024B81999902290B418A0914101414141D1
|
||||
:100D50005283CA4028682908BA16109C990B5694E9
|
||||
:100D600090521574C0271A2AD29025D3009D28AB23
|
||||
:100D70004A42174C0270D4842E9804E12A42174C40
|
||||
:100D8000027082904BA60138514842E9804E15A46A
|
||||
:100D90002174C0270FA412E9804E82AC80ACA0ACB5
|
||||
:100DA000A959E5644565CAC84ACE0ACE4ACE95918E
|
||||
:100DB000959495932925C0CCCC88A4975636647217
|
||||
:100DC00090548A9C4508B9B766129309C9B2748ECB
|
||||
:100DD000BA6013E5348EBA6013E4748EBA6013E51A
|
||||
:100DE000691D74C027CA291D74C027CED225D3001F
|
||||
:100DF0009F38A44BA6013E5E912E9804F915225D02
|
||||
:100E00003009F3E912E9804F905225D3009DC5487F
|
||||
:100E100025D3009C45CECD09C9B21A44BA6013E768
|
||||
:100E2000348974C0271C27B79C80C2D776599B93FE
|
||||
:100E30000C64C31D1BF4454BC7C63A37E8814BC74A
|
||||
:100E4000C63A37E8914BC7C632618EB3BCC34A225B
|
||||
:100E5000E6B5249771C987B431AE73A2CF39D25D9C
|
||||
:100E6000044442C0D6DE710616BBDBCE830C64C3DD
|
||||
:100E70001D311304F9954D133293635E6614CC292A
|
||||
:100E80002A5330A6614CC299853A72CCC299850624
|
||||
:100E90001BB30A661414249985330A08B186614C81
|
||||
:100EA000C2842168733B30A661414EA5985330AC93
|
||||
:100EB0005976614CC2B08DD6614CC2B02CF6614CF3
|
||||
:100EC000C2B18CA5985330AC0F24CC2998560F286A
|
||||
:100ED0006615921A1985330ACA850CC2998565C3AD
|
||||
:100EE000D985330ACE7086614CC2B397710C993B99
|
||||
:100EF000CC83580BEA779D064ABE047460E0D14E5D
|
||||
:100F0000384C3EEE3EEE3EEE3EEE30BBCAE11F7781
|
||||
:100F10001F771F771F7727708FBB800E11F771F730
|
||||
:100F20007C6F3CB33602FB8DE655707F2D246955EE
|
||||
:100F30004F58A9231F54F78A95252B750CCCAC5616
|
||||
:100F400051CC51E445CEA21239C0A0AF566A497FB8
|
||||
:100F5000028C09F80BEBAF56766752B28E69A71177
|
||||
:100F600073A8B1BCCAA0A936502C98E70AF566A4AC
|
||||
:100F700097E25A3027BAF7834EA5330A66158DE6F5
|
||||
:100F80005539D2A7AC546016701B728E628F222E18
|
||||
:100F9000751602FB8DE60A953D62A300B701B553B5
|
||||
:100FA000DE2A5494ADD43332B15947314791173AC0
|
||||
:100FB0008848E702B017DC679D4B8DE752AA7BD4C7
|
||||
:100FC000AA92BDD699BC5602FB8CF36666C6F36640
|
||||
:100FD0006662992AF8186870B08A0D5555555552B1
|
||||
:100FE00032E1405C380BEA9B87017DC05F7017DC03
|
||||
:100FF00005F5DC9B017D614D80BEA77982A21F5063
|
||||
:10100000152A8F8B1CE5A5138458E702915405021D
|
||||
:101010004BBD221A947F9C1AC05F421A21D180597D
|
||||
:10102000C06D1C2C0A83555555555555555555556C
|
||||
:1010300055541CB85C6E179C2F385E70E7B85E7014
|
||||
:10104000BCE179C2F385E70BCE179C299C299C292A
|
||||
:101050009C230F5814EE357726219305C9B017D27B
|
||||
:101060001D188A219305C9B017D187AC0A740FAE39
|
||||
:10107000F55A82A3E43A3114BBD7599974A21930B6
|
||||
:101080005C9B017D187AC0A740F843D4638925D0C2
|
||||
:1010900010D61C6A10F5558925D151661F51F5915E
|
||||
:1010A000492E8915986AA3E08A9465640E1317384F
|
||||
:1010B000A8864C1726C05F461EB028631F087A8C8E
|
||||
:1010C0007124BA021AD00D421EAAB124BA2A2D31B7
|
||||
:1010D000F51F587492E8875A6352DEF451694A3E0C
|
||||
:1010E00009694650F0E131730545BD598D8B4A7C45
|
||||
:1010F000D3ED38E9D34E74ED443260B93602FA5B71
|
||||
:10110000DE8A2D29D0E121F5A39221F219305C9BD2
|
||||
:10111000017D21F5A0C6016701B445CEA51239D4E1
|
||||
:101120001C05F440A1C2C3506AAAAAAAAAAAAAAAE4
|
||||
:10113000AAAAAAAAAAAA81AF869F191BE781F3656A
|
||||
:10114000F280BE7017DFDF380BEB0DC380BEA70F38
|
||||
:10115000954F5A94C02CD8B1A7CE5A1173A83AC251
|
||||
:10116000CCB63017DC6F35A9804DA7CE2A1879C5CB
|
||||
:1011700049DE61A822E75033F9986408B99542FC2A
|
||||
:10118000CCD9953D62A248D448E70288B9C1A0E312
|
||||
:101190009D4E62E6CCC66BCE8310C982E4DAC2C82B
|
||||
:1011A0001EC3B93602FAA9EB4E3030FA0DF0A9EBA6
|
||||
:1011B00040B90FAA7AD2C2C8FAA7AD410A47D53DB5
|
||||
:1011C00068ACF1F54F5A97547D4FA8AA551F11737B
|
||||
:1011D0005AB017DE5D59A925D0552A46BCB822AEB3
|
||||
:1011E00045293E14FAE19994CA4ABE3DD699925DCA
|
||||
:1011F0001517C8D7DC15178A401F0A9EACC9654968
|
||||
:101200005C1D10684A3E5BDE83169580BE91745863
|
||||
:10121000A4007C38E7563017DF75A6649745209DFB
|
||||
:10122000035F70545E291DF0A9EACC865495C1D1A4
|
||||
:1012300006830FAA7BD0654945BDE962D291DF04E0
|
||||
:101240005D16291C7D4FAC1A471AA9F5676653280D
|
||||
:10125000B7BD2C5A523BE3DD59A925D1A8AC086B88
|
||||
:10126000EE08ABC5202F854F566675495C1C181DCE
|
||||
:1012700081C26405F080BE355CD017C255F0957C04
|
||||
:10128000255F080BE1017C7BAB3524BA1055931A1E
|
||||
:10129000FB822AF148D7C2A7AB31B2A4AC639D4A06
|
||||
:1012A0008D7C7BAB3524BA1054308D7DC11578AC64
|
||||
:1012B0006F5A94601AE379D4AA4F854F5666D54980
|
||||
:1012C00058C73A9549F045D1629486BC1D13D29017
|
||||
:1012D000FFCF7A83F25031DE006060A11735A85F3E
|
||||
:1012E0009B1B3707441A300B380DBC1CE0D047CE8F
|
||||
:1012F000A0AA7AA1986A92953D6831805B80DAA9AC
|
||||
:10130000EF41952516F7A58B4AC679B333602FAA0E
|
||||
:101310009EB15180599ECAA7AC0A300B67B2ADD5B9
|
||||
:10132000DA925D17A300B32D956E08A958A1173A5C
|
||||
:101330008B017D54F78E9525081CE05602FBC1D128
|
||||
:10134000151805926B3C1D1228C02CA56C11701746
|
||||
:10135000B2384D80BEE02FB4EC4AEDB39E02FB8064
|
||||
:10136000BEE02FB139933E6DE710609F32A9A26CA9
|
||||
:1013700005F440E60A953D6A2300B380DAA7D62A31
|
||||
:10138000030D7017D22E76294FBC54A6516F7A5890
|
||||
:10139000B4AC05F48BA2F40E350D492EB4CC18A5CF
|
||||
:1013A000C8F84A9723E1052E47C28A5C8F85697287
|
||||
:1013B0003E1F4AC3551F5643328CA35E60A845CEDC
|
||||
:1013C0000D602FA3849DD8F017D22E0E1B2384D836
|
||||
:1013D0000BEB89F380BEE02FBB3985DF2203E701E9
|
||||
:1013E0007DC05F7017D11738145BD6A2740D4B7A8D
|
||||
:1013F000B33196946BCC3523D749481573290F5DCB
|
||||
:101400008AC05F4D79843580BE881CC3529F59685D
|
||||
:10141000C02CE036AA7BCD4A92BEF3814A7D5B594F
|
||||
:1014200094CA1C24EEC780BE881CC3529F5968C052
|
||||
:101430002CE036AA7BCD4A92BEF38143849C7B3854
|
||||
:101440000BEBAF70D4EA53009B4F9C5430F38A945B
|
||||
:10145000FAB6B3299422E61A85F9B05993F9D2C4A1
|
||||
:101460003260B936B0B390D977261C2722E896B4FB
|
||||
:1014700023EA9EB511805965862073968D79AD5803
|
||||
:101480000BE917448A4A07D77A82A190FAEF0154F0
|
||||
:10149000BA50D4591E2CE9F38A99856B0B23159702
|
||||
:1014A00072611730D42C738748AA028125DE910D12
|
||||
:1014B0004AC05F7ED280A53EB2D0C86B80BE881C79
|
||||
:1014C000EA0917441A371A917458A371AF074454A4
|
||||
:1014D0006E35E0E8AA640F90FAD06300B380DA2C8E
|
||||
:1014E000738748AA028125DE910D4AC05F48BA275A
|
||||
:1014F000A300B701B74F9CB46BCC3516F566632DCE
|
||||
:10150000291EBA4A40AB99487AEC508B9C0822FCC1
|
||||
:10151000F9B2553D62A92351239C0A3C730D445CEA
|
||||
:10152000E15071CEA11FE7156B0B25ED0B93602FDA
|
||||
:10153000AA9EAC3665495F7A2050087FEF3914497E
|
||||
:10154000011181046040CC59C0AD23EB41B081F260
|
||||
:101550003A41AA5043E4D48654A087C152CA9301A9
|
||||
:1015600032549D2402000052AF1646A7916708B47A
|
||||
:101570000451F16519B46E2DC0AD490092571B742A
|
||||
:10158000455F2351B7440A1006A36E8B6B081F19E1
|
||||
:10159000D1E680828054042A4591A9E459C22D01E4
|
||||
:1015A000140450D3FC558461D980512FE21F465F4B
|
||||
:1015B00040E020154ABC591A9E459C22D01148CBC8
|
||||
:1015C000E81408015415E2C8D4F22CE116808A46CA
|
||||
:1015D0005F527CD9A8F888D05A3CD25C5B80DAA7ED
|
||||
:1015E000D65A0886A45D17A0C3522E88A8221F537E
|
||||
:1015F000EADACCA650E127763C05F54FAB6B329981
|
||||
:1016000043849C7B380BE927ACD492E00EDA384D4A
|
||||
:1016100080BEE67D50BA51AE66EFBCDC7B871E0211
|
||||
:10162000FA93E6CD47C443CD0F349DA300B05501D6
|
||||
:10163000AE038404CE01D0E17002800E89E9221F3E
|
||||
:10164000E0E896B011F4C2CE036A442DC06D48059F
|
||||
:10165000B80DA300B776D5DEB150DC7D77BC54BAA7
|
||||
:10166000527F5814340F9AF381580BEAEF581460E4
|
||||
:1016700016A56C2EF7814BA56F7D5DEEB52E95807E
|
||||
:10168000BEF073BD047CEAFEEB4CDE2953DD6A54E8
|
||||
:1016900094A9EA0A8C02D64C3C05F400EACD56AF78
|
||||
:1016A000C047D29C8D29CAE02FAEBD75999D4AF9DD
|
||||
:1016B000EF517C940C77801818292AF8E0E8AA30BA
|
||||
:1016C0000B2A987C1D1151805954C351F51B3324AA
|
||||
:1016D000BB82A5195C1D1028C02C9AC7C1D1228CD1
|
||||
:1016E00002C994645C0CD68E13602FB80BEA30E309
|
||||
:1016F000C05F48DC780BE800E3C05F6C38D52E355E
|
||||
:101700004F5A8A61AA9F561B32994642C8010C451E
|
||||
:10171000CEA517E6C6CEA9EB151646A24738144348
|
||||
:101720002622E73D602FAA9EB512E07F017DE3E708
|
||||
:101730000293F995445CE5A0E39D4A7F9C54A9EB94
|
||||
:10174000510546B9FCC01B222E64542FCD46CCA7B0
|
||||
:10175000D586CCA65055C645CE5A0E39D4A7F9C564
|
||||
:101760004A9EB5118059C06DCFE600D9117322A1F0
|
||||
:101770007E6A36653EAC366532B017DD3E72D27990
|
||||
:10178000310C982E4C20732A8FF38AADE741827C6E
|
||||
:10179000CAA689B5859FB0F017D51F5454251AA83D
|
||||
:1017A000FF2A946511D74944D5CCA055D8AE0E88F0
|
||||
:1017B0001460164D6322E07286384D80BEE02FB86B
|
||||
:1017C0000BEE02FB8138F017D7D71E02FAFAE3C0FE
|
||||
:1017D0005F4C85900218C85B80DA300B701B4C227E
|
||||
:1017E000D34C33038C2E4C4326D0F56366D095A79B
|
||||
:1017F000CE45330AD61642386EE4CEBD592CD2AB54
|
||||
:10180000BA949DE61AB017D54F5A8B091A88B9C5F4
|
||||
:10181000424730D43216728865BD599925A5602F8C
|
||||
:10182000B860F308B74A1A8FAB0D994651AF38A884
|
||||
:101830008E9065135218A054B1422E61A848E72D2E
|
||||
:1018400016F7A805A5602FA475D251357328157613
|
||||
:101850002B83A20518059358C8B806286384D80BB3
|
||||
:10186000EE02FB80BEE02FA043A7017D4CE3C05FEA
|
||||
:101870007017DC05F4642DC06D1805B80DA5BD6AA0
|
||||
:101880002386AA9EB511A46AA3EA8A8D23E117389C
|
||||
:101890003469719845A6986A3EAC36651946BCE233
|
||||
:1018A000A23A41944D48628152C516F7A88B4A541A
|
||||
:1018B000F5A88C02DC06D1039CB4A9EE0A95252A72
|
||||
:1018C0007AAD46016701B5D7AC0A300B6C4935E6F5
|
||||
:1018D000B567F3006C88B99150BF311B32A7B86867
|
||||
:1018E00095257BAD3378A7CD3ED38E9D34E74ED47E
|
||||
:1018F00022E706848E60A8FF38AB839C2A08F9D4BF
|
||||
:101900002063BC1A060AC05F4642DC06D1805B80B9
|
||||
:10191000DA22E61A848E72D16F5A80871AAA7AD494
|
||||
:1019200048C8D547D5152323E11738348CBA4B7BEB
|
||||
:10193000D402D28C22DC06D51F561B328CA35E71DA
|
||||
:10194000511D20CA26A43140A962B017DF9EF4B70A
|
||||
:10195000C940C778018182B83839491C26C05F70F8
|
||||
:1019600017D4ABE12AF84ABE12AF8F974FCBA7012D
|
||||
:101970007DDA80AA91647F4A81D522C8FE828025C3
|
||||
:1019800048B23EBBDC352E9407E88A9C03E24BA5A7
|
||||
:1019900077ABB332E94BBD598684977A04BA53E1E9
|
||||
:1019A00032EF50D4E63553EB029CC7D77AB330D22E
|
||||
:1019B0005DEA02E9445D1628C02CE0369174455971
|
||||
:1019C00018D54FAC0AC435308B38692BBD5998698E
|
||||
:1019D0002EF512E958674AEF50D58E3E1CA4B0CEC2
|
||||
:1019E00093216E1A481FA22AC30D577AB30D092EF0
|
||||
:1019F000F4435D288B832092384D80BEE02FAC17D6
|
||||
:101A000049B3A582E93EE93674E02FA6CE9C05F4E1
|
||||
:101A1000C22C8C52577AD48D48FAEF50D5AE35533C
|
||||
:101A2000EB028621AAEF56661A4BBD44BA50C4E9B0
|
||||
:101A300053EB028681F5DEA1A8621F5DFEA25D293F
|
||||
:101A400077A86A618D40FD11530C6AA7D60530C78F
|
||||
:101A5000D77FA9574A5DEB481B0C7C8B9D8A53EFBF
|
||||
:101A60006694CA54F5A0C6016E036A9F5676653225
|
||||
:101A70008B7BD2C5A5602FAA7D65A300B701B4C832
|
||||
:101A80005A078FED01D527916701B48B9C541C73C5
|
||||
:101A9000A8845CC150BF365660AB8C8B9C541C73C1
|
||||
:101AA000A8845CC150BF36566C05F553D6A2300BE6
|
||||
:101AB000295B19FCF69445CF150BF33CB32A7AC584
|
||||
:101AC0004601648A31239C0A5DEA34332E95C7CEE1
|
||||
:101AD0002A4FE65020B9310C9BEF391445CE45070B
|
||||
:101AE0001CEA4687AB1B3684A75EAC966752B017DC
|
||||
:101AF000DCFE7B4A22E78A85F99E59977A8D0CCBCA
|
||||
:101B0000A527F3A0443260B937DE72288B9C8A0E79
|
||||
:101B100039D48C05F7E7B82AF92818EF0030305788
|
||||
:101B200007440A508FF07391411F3A9045C0BB188B
|
||||
:101B3000E13602FBFB9E02FAEEE7F5CF017D105C79
|
||||
:101B4000F017D105CF017D53EB2D1805B80DA64236
|
||||
:101B5000DC06D31735A88B9C0A0E39D40CFE7B4AC1
|
||||
:101B600022E6550BF331B3602FBC7CE2A4FE655135
|
||||
:101B70001738141C73A819FCF69445CCAA17E66311
|
||||
:101B8000660AB8CC85A158F6A23548487F4A89959F
|
||||
:101B90002121FD0502549E45910E3C05F507405557
|
||||
:101BA00048523E86A07548523EB5004A9C006BC71D
|
||||
:101BB000CE4527F32A843735DEA0AB231AAEF58352
|
||||
:101BC0005918D743DE2AD094EBDE053A959FCCC353
|
||||
:101BD0002045CCAA17E666CC43264FE741222E705B
|
||||
:101BE0006838E753E02FABBC12D2E9580BEAA7AD37
|
||||
:101BF00045A11FC05F7839C8A08F9D481C24EEC73F
|
||||
:101C000080BEBAF56D6649770D4EA53009B4F9C5A9
|
||||
:101C1000430F38A93F9D02FBCE4511739141C73A4E
|
||||
:101C2000919FCF69445CF150BF33CB32A7AC549045
|
||||
:101C30008D448E702977A8D0CCBA56B0B29D8C86D0
|
||||
:101C40004C172677261C271C249E2361BE8E124F1C
|
||||
:101C500011871CEA5C05F5D7B86A752977AB0D9931
|
||||
:101C600074A54F72A0AA4AC6F36666C63982AF75DC
|
||||
:101C7000A66F146BCE05707396823E7528E13AA765
|
||||
:101C8000AD44601652B61D7AB6B324BB86A75298EF
|
||||
:101C900004DA7CE2A1879C55F79CB5AC2C9533B94E
|
||||
:101CA0003105D953D6A2300B295B022E615A17E6B3
|
||||
:101CB0009CB32A7AC54021A891CE0527F3A5886454
|
||||
:101CC000C172654F58140C8D7EF381445CEF41C79F
|
||||
:101CD0003ABE02FAA9EACECCA92953D6A24647DDDC
|
||||
:101CE0007AC0A30086E29B29788B810998709B2992
|
||||
:101CF000795DD972ED94BCB976133B2A5DB29795A4
|
||||
:101D00002ED94BCA7D5B5994CA1C24EEC794BCC023
|
||||
:101D100026D3E7150C3CE2ACFE7B4A22E78A85F924
|
||||
:101D20009E59977A8D0CCBA527F3A0417262193783
|
||||
:101D3000DE70288B9C8A0E39D48D0F56366D094E75
|
||||
:101D4000BD592CCEA56B0B22D99DC9B297BEF3818C
|
||||
:101D50004A7D65A300938F672978C24DC1D1068261
|
||||
:101D600031AF07383411F3A82A9EA8661AA4A54FEC
|
||||
:101D70005A0C118FAA7BD0654945BDE962D2B19E4C
|
||||
:101D80006CCCC6198709C38E75411F3AA513D5556A
|
||||
:101D900055555555555555555555555555555555F3
|
||||
:101DA00055555555555555555555555555555555E3
|
||||
:0E1DB00055555555555555555555555ACC90C8
|
||||
:00000001FF
|
|
@ -186,7 +186,6 @@ header-y += if_pppox.h
|
|||
header-y += if_slip.h
|
||||
header-y += if_strip.h
|
||||
header-y += if_team.h
|
||||
header-y += if_tr.h
|
||||
header-y += if_tun.h
|
||||
header-y += if_tunnel.h
|
||||
header-y += if_vlan.h
|
||||
|
|
|
@ -1,373 +0,0 @@
|
|||
#ifndef __LINUX_IBMTR_H__
|
||||
#define __LINUX_IBMTR_H__
|
||||
|
||||
/* Definitions for an IBM Token Ring card. */
|
||||
/* This file is distributed under the GNU GPL */
|
||||
|
||||
/* ported to the Alpha architecture 02/20/96 (just used the HZ macro) */
|
||||
|
||||
#define TR_RETRY_INTERVAL (30*HZ) /* 500 on PC = 5 s */
|
||||
#define TR_RST_TIME (msecs_to_jiffies(50)) /* 5 on PC = 50 ms */
|
||||
#define TR_BUSY_INTERVAL (msecs_to_jiffies(200)) /* 5 on PC = 200 ms */
|
||||
#define TR_SPIN_INTERVAL (3*HZ) /* 3 seconds before init timeout */
|
||||
|
||||
#define TR_ISA 1
|
||||
#define TR_MCA 2
|
||||
#define TR_ISAPNP 3
|
||||
#define NOTOK 0
|
||||
|
||||
#define IBMTR_SHARED_RAM_SIZE 0x10000
|
||||
#define IBMTR_IO_EXTENT 4
|
||||
#define IBMTR_MAX_ADAPTERS 4
|
||||
|
||||
#define CHANNEL_ID 0X1F30
|
||||
#define AIP 0X1F00
|
||||
#define AIPADAPTYPE 0X1FA0
|
||||
#define AIPDATARATE 0X1FA2
|
||||
#define AIPEARLYTOKEN 0X1FA4
|
||||
#define AIPAVAILSHRAM 0X1FA6
|
||||
#define AIPSHRAMPAGE 0X1FA8
|
||||
#define AIP4MBDHB 0X1FAA
|
||||
#define AIP16MBDHB 0X1FAC
|
||||
#define AIPFID 0X1FBA
|
||||
|
||||
#define ADAPTRESET 0x1 /* Control Adapter reset (add to base) */
|
||||
#define ADAPTRESETREL 0x2 /* Release Adapter from reset ( """) */
|
||||
#define ADAPTINTREL 0x3 /* Adapter interrupt release */
|
||||
|
||||
#define GLOBAL_INT_ENABLE 0x02f0
|
||||
|
||||
/* MMIO bits 0-4 select register */
|
||||
#define RRR_EVEN 0x00 /* Shared RAM relocation registers - even and odd */
|
||||
/* Used to set the starting address of shared RAM */
|
||||
/* Bits 1 through 7 of this register map to bits 13 through 19 of the shared
|
||||
RAM address.*/
|
||||
/* ie: 0x02 sets RAM address to ...ato! issy su wazzoo !! GODZILLA!!! */
|
||||
#define RRR_ODD 0x01
|
||||
/* Bits 2 and 3 of this register can be read to determine shared RAM size */
|
||||
/* 00 for 8k, 01 for 16k, 10 for 32k, 11 for 64k */
|
||||
#define WRBR_EVEN 0x02 /* Write region base registers - even and odd */
|
||||
#define WRBR_ODD 0x03
|
||||
#define WWOR_EVEN 0x04 /* Write window open registers - even and odd */
|
||||
#define WWOR_ODD 0x05
|
||||
#define WWCR_EVEN 0x06 /* Write window close registers - even and odd */
|
||||
#define WWCR_ODD 0x07
|
||||
|
||||
/* Interrupt status registers - PC system - even and odd */
|
||||
#define ISRP_EVEN 0x08
|
||||
|
||||
#define TCR_INT 0x10 /* Bit 4 - Timer interrupt. The TVR_EVEN timer has
|
||||
expired. */
|
||||
#define ERR_INT 0x08 /* Bit 3 - Error interrupt. The adapter has had an
|
||||
internal error. */
|
||||
#define ACCESS_INT 0x04 /* Bit 2 - Access interrupt. You have attempted to
|
||||
write to an invalid area of shared RAM
|
||||
or an invalid register within the MMIO. */
|
||||
/* In addition, the following bits within ISRP_EVEN can be turned on or off */
|
||||
/* by you to control the interrupt processing: */
|
||||
#define INT_ENABLE 0x40 /* Bit 6 - Interrupt enable. If 0, no interrupts will
|
||||
occur. If 1, interrupts will occur normally.
|
||||
Normally set to 1. */
|
||||
/* Bit 0 - Primary or alternate adapter. Set to zero if this adapter is the
|
||||
primary adapter, 1 if this adapter is the alternate adapter. */
|
||||
|
||||
|
||||
#define ISRP_ODD 0x09
|
||||
|
||||
#define ADAP_CHK_INT 0x40 /* Bit 6 - Adapter check. the adapter has
|
||||
encountered a serious problem and has closed
|
||||
itself. Whoa. */
|
||||
#define SRB_RESP_INT 0x20 /* Bit 5 - SRB response. The adapter has accepted
|
||||
an SRB request and set the return code within
|
||||
the SRB. */
|
||||
#define ASB_FREE_INT 0x10 /* Bit 4 - ASB free. The adapter has read the ASB
|
||||
and this area can be safely reused. This interrupt
|
||||
is only used if your application has set the ASB
|
||||
free request bit in ISRA_ODD or if an error was
|
||||
detected in your response. */
|
||||
#define ARB_CMD_INT 0x08 /* Bit 3 - ARB command. The adapter has given you a
|
||||
command for action. The command is located in the
|
||||
ARB area of shared memory. */
|
||||
#define SSB_RESP_INT 0x04 /* Bit 2 - SSB response. The adapter has posted a
|
||||
response to your SRB (the response is located in
|
||||
the SSB area of shared memory). */
|
||||
/* Bit 1 - Bridge frame forward complete. */
|
||||
|
||||
|
||||
|
||||
#define ISRA_EVEN 0x0A /*Interrupt status registers - adapter - even and odd */
|
||||
/* Bit 7 - Internal parity error (on adapter's internal bus) */
|
||||
/* Bit 6 - Timer interrupt pending */
|
||||
/* Bit 5 - Access interrupt (attempt by adapter to access illegal address) */
|
||||
/* Bit 4 - Adapter microcode problem (microcode dead-man timer expired) */
|
||||
/* Bit 3 - Adapter processor check status */
|
||||
/* Bit 2 - Reserved */
|
||||
/* Bit 1 - Adapter hardware interrupt mask (prevents internal interrupts) */
|
||||
/* Bit 0 - Adapter software interrupt mask (prevents internal software ints) */
|
||||
|
||||
#define ISRA_ODD 0x0B
|
||||
#define CMD_IN_SRB 0x20 /* Bit 5 - Indicates that you have placed a new
|
||||
command in the SRB and are ready for the adapter to
|
||||
process the command. */
|
||||
#define RESP_IN_ASB 0x10 /* Bit 4 - Indicates that you have placed a response
|
||||
(an ASB) in the shared RAM which is available for
|
||||
the adapter's use. */
|
||||
/* Bit 3 - Indicates that you are ready to put an SRB in the shared RAM, but
|
||||
that a previous command is still pending. The adapter will then
|
||||
interrupt you when the previous command is completed */
|
||||
/* Bit 2 - Indicates that you are ready to put an ASB in the shared RAM, but
|
||||
that a previous ASB is still pending. The adapter will then interrupt
|
||||
you when the previous ASB is copied. */
|
||||
#define ARB_FREE 0x2
|
||||
#define SSB_FREE 0x1
|
||||
|
||||
#define TCR_EVEN 0x0C /* Timer control registers - even and odd */
|
||||
#define TCR_ODD 0x0D
|
||||
#define TVR_EVEN 0x0E /* Timer value registers - even and odd */
|
||||
#define TVR_ODD 0x0F
|
||||
#define SRPR_EVEN 0x18 /* Shared RAM paging registers - even and odd */
|
||||
#define SRPR_ENABLE_PAGING 0xc0
|
||||
#define SRPR_ODD 0x19 /* Not used. */
|
||||
#define TOKREAD 0x60
|
||||
#define TOKOR 0x40
|
||||
#define TOKAND 0x20
|
||||
#define TOKWRITE 0x00
|
||||
|
||||
/* MMIO bits 5-6 select operation */
|
||||
/* 00 is used to write to a register */
|
||||
/* 01 is used to bitwise AND a byte with a register */
|
||||
/* 10 is used to bitwise OR a byte with a register */
|
||||
/* 11 is used to read from a register */
|
||||
|
||||
/* MMIO bits 7-8 select area of interest.. see below */
|
||||
/* 00 selects attachment control area. */
|
||||
/* 01 is reserved. */
|
||||
/* 10 selects adapter identification area A containing the adapter encoded
|
||||
address. */
|
||||
/* 11 selects the adapter identification area B containing test patterns. */
|
||||
|
||||
#define PCCHANNELID 5049434F3631313039393020
|
||||
#define MCCHANNELID 4D4152533633583435313820
|
||||
|
||||
#define ACA_OFFSET 0x1e00
|
||||
#define ACA_SET 0x40
|
||||
#define ACA_RESET 0x20
|
||||
#define ACA_RW 0x00
|
||||
|
||||
#ifdef ENABLE_PAGING
|
||||
#define SET_PAGE(x) (writeb((x), ti->mmio + ACA_OFFSET+ ACA_RW + SRPR_EVEN))
|
||||
#else
|
||||
#define SET_PAGE(x)
|
||||
#endif
|
||||
|
||||
/* do_tok_int possible values */
|
||||
#define FIRST_INT 1
|
||||
#define NOT_FIRST 2
|
||||
|
||||
typedef enum { CLOSED, OPEN } open_state;
|
||||
//staic const char *printstate[] = { "CLOSED","OPEN"};
|
||||
|
||||
struct tok_info {
|
||||
unsigned char irq;
|
||||
void __iomem *mmio;
|
||||
unsigned char hw_address[32];
|
||||
unsigned char adapter_type;
|
||||
unsigned char data_rate;
|
||||
unsigned char token_release;
|
||||
unsigned char avail_shared_ram;
|
||||
unsigned char shared_ram_paging;
|
||||
unsigned char turbo;
|
||||
unsigned short dhb_size4mb;
|
||||
unsigned short rbuf_len4;
|
||||
unsigned short rbuf_cnt4;
|
||||
unsigned short maxmtu4;
|
||||
unsigned short dhb_size16mb;
|
||||
unsigned short rbuf_len16;
|
||||
unsigned short rbuf_cnt16;
|
||||
unsigned short maxmtu16;
|
||||
/* Additions by David Morris */
|
||||
unsigned char do_tok_int;
|
||||
wait_queue_head_t wait_for_reset;
|
||||
unsigned char sram_base;
|
||||
/* Additions by Peter De Schrijver */
|
||||
unsigned char page_mask; /* mask to select RAM page to Map*/
|
||||
unsigned char mapped_ram_size; /* size of RAM page */
|
||||
__u32 sram_phys; /* Shared memory base address */
|
||||
void __iomem *sram_virt; /* Shared memory base address */
|
||||
void __iomem *init_srb; /* Initial System Request Block address */
|
||||
void __iomem *srb; /* System Request Block address */
|
||||
void __iomem *ssb; /* System Status Block address */
|
||||
void __iomem *arb; /* Adapter Request Block address */
|
||||
void __iomem *asb; /* Adapter Status Block address */
|
||||
__u8 init_srb_page;
|
||||
__u8 srb_page;
|
||||
__u8 ssb_page;
|
||||
__u8 arb_page;
|
||||
__u8 asb_page;
|
||||
unsigned short exsap_station_id;
|
||||
unsigned short global_int_enable;
|
||||
struct sk_buff *current_skb;
|
||||
|
||||
unsigned char auto_speedsave;
|
||||
open_state open_status, sap_status;
|
||||
enum {MANUAL, AUTOMATIC} open_mode;
|
||||
enum {FAIL, RESTART, REOPEN} open_action;
|
||||
enum {NO, YES} open_failure;
|
||||
unsigned char readlog_pending;
|
||||
unsigned short adapter_int_enable; /* Adapter-specific int enable */
|
||||
struct timer_list tr_timer;
|
||||
unsigned char ring_speed;
|
||||
spinlock_t lock; /* SMP protection */
|
||||
};
|
||||
|
||||
/* token ring adapter commands */
|
||||
#define DIR_INTERRUPT 0x00 /* struct srb_interrupt */
|
||||
#define DIR_MOD_OPEN_PARAMS 0x01
|
||||
#define DIR_OPEN_ADAPTER 0x03 /* struct dir_open_adapter */
|
||||
#define DIR_CLOSE_ADAPTER 0x04
|
||||
#define DIR_SET_GRP_ADDR 0x06
|
||||
#define DIR_SET_FUNC_ADDR 0x07 /* struct srb_set_funct_addr */
|
||||
#define DIR_READ_LOG 0x08 /* struct srb_read_log */
|
||||
#define DLC_OPEN_SAP 0x15 /* struct dlc_open_sap */
|
||||
#define DLC_CLOSE_SAP 0x16
|
||||
#define DATA_LOST 0x20 /* struct asb_rec */
|
||||
#define REC_DATA 0x81 /* struct arb_rec_req */
|
||||
#define XMIT_DATA_REQ 0x82 /* struct arb_xmit_req */
|
||||
#define DLC_STATUS 0x83 /* struct arb_dlc_status */
|
||||
#define RING_STAT_CHANGE 0x84 /* struct dlc_open_sap ??? */
|
||||
|
||||
/* DIR_OPEN_ADAPTER options */
|
||||
#define OPEN_PASS_BCON_MAC 0x0100
|
||||
#define NUM_RCV_BUF 2
|
||||
#define RCV_BUF_LEN 1024
|
||||
#define DHB_LENGTH 2048
|
||||
#define NUM_DHB 2
|
||||
#define DLC_MAX_SAP 2
|
||||
#define DLC_MAX_STA 1
|
||||
|
||||
/* DLC_OPEN_SAP options */
|
||||
#define MAX_I_FIELD 0x0088
|
||||
#define SAP_OPEN_IND_SAP 0x04
|
||||
#define SAP_OPEN_PRIORITY 0x20
|
||||
#define SAP_OPEN_STATION_CNT 0x1
|
||||
#define XMIT_DIR_FRAME 0x0A
|
||||
#define XMIT_UI_FRAME 0x0d
|
||||
#define XMIT_XID_CMD 0x0e
|
||||
#define XMIT_TEST_CMD 0x11
|
||||
|
||||
/* srb close return code */
|
||||
#define SIGNAL_LOSS 0x8000
|
||||
#define HARD_ERROR 0x4000
|
||||
#define XMIT_BEACON 0x1000
|
||||
#define LOBE_FAULT 0x0800
|
||||
#define AUTO_REMOVAL 0x0400
|
||||
#define REMOVE_RECV 0x0100
|
||||
#define LOG_OVERFLOW 0x0080
|
||||
#define RING_RECOVER 0x0020
|
||||
|
||||
struct srb_init_response {
|
||||
unsigned char command;
|
||||
unsigned char init_status;
|
||||
unsigned char init_status_2;
|
||||
unsigned char reserved[3];
|
||||
__u16 bring_up_code;
|
||||
__u16 encoded_address;
|
||||
__u16 level_address;
|
||||
__u16 adapter_address;
|
||||
__u16 parms_address;
|
||||
__u16 mac_address;
|
||||
};
|
||||
|
||||
struct dir_open_adapter {
|
||||
unsigned char command;
|
||||
char reserved[7];
|
||||
__u16 open_options;
|
||||
unsigned char node_address[6];
|
||||
unsigned char group_address[4];
|
||||
unsigned char funct_address[4];
|
||||
__u16 num_rcv_buf;
|
||||
__u16 rcv_buf_len;
|
||||
__u16 dhb_length;
|
||||
unsigned char num_dhb;
|
||||
char reserved2;
|
||||
unsigned char dlc_max_sap;
|
||||
unsigned char dlc_max_sta;
|
||||
unsigned char dlc_max_gsap;
|
||||
unsigned char dlc_max_gmem;
|
||||
unsigned char dlc_t1_tick_1;
|
||||
unsigned char dlc_t2_tick_1;
|
||||
unsigned char dlc_ti_tick_1;
|
||||
unsigned char dlc_t1_tick_2;
|
||||
unsigned char dlc_t2_tick_2;
|
||||
unsigned char dlc_ti_tick_2;
|
||||
unsigned char product_id[18];
|
||||
};
|
||||
|
||||
struct dlc_open_sap {
|
||||
unsigned char command;
|
||||
unsigned char reserved1;
|
||||
unsigned char ret_code;
|
||||
unsigned char reserved2;
|
||||
__u16 station_id;
|
||||
unsigned char timer_t1;
|
||||
unsigned char timer_t2;
|
||||
unsigned char timer_ti;
|
||||
unsigned char maxout;
|
||||
unsigned char maxin;
|
||||
unsigned char maxout_incr;
|
||||
unsigned char max_retry_count;
|
||||
unsigned char gsap_max_mem;
|
||||
__u16 max_i_field;
|
||||
unsigned char sap_value;
|
||||
unsigned char sap_options;
|
||||
unsigned char station_count;
|
||||
unsigned char sap_gsap_mem;
|
||||
unsigned char gsap[0];
|
||||
};
|
||||
|
||||
struct srb_xmit {
|
||||
unsigned char command;
|
||||
unsigned char cmd_corr;
|
||||
unsigned char ret_code;
|
||||
unsigned char reserved1;
|
||||
__u16 station_id;
|
||||
};
|
||||
|
||||
struct arb_rec_req {
|
||||
unsigned char command;
|
||||
unsigned char reserved1[3];
|
||||
__u16 station_id;
|
||||
__u16 rec_buf_addr;
|
||||
unsigned char lan_hdr_len;
|
||||
unsigned char dlc_hdr_len;
|
||||
__u16 frame_len;
|
||||
unsigned char msg_type;
|
||||
};
|
||||
|
||||
struct asb_rec {
|
||||
unsigned char command;
|
||||
unsigned char reserved1;
|
||||
unsigned char ret_code;
|
||||
unsigned char reserved2;
|
||||
__u16 station_id;
|
||||
__u16 rec_buf_addr;
|
||||
};
|
||||
|
||||
struct rec_buf {
|
||||
unsigned char reserved1[2];
|
||||
__u16 buf_ptr;
|
||||
unsigned char reserved2;
|
||||
unsigned char receive_fs;
|
||||
__u16 buf_len;
|
||||
unsigned char data[0];
|
||||
};
|
||||
|
||||
struct srb_set_funct_addr {
|
||||
unsigned char command;
|
||||
unsigned char reserved1;
|
||||
unsigned char ret_code;
|
||||
unsigned char reserved2[3];
|
||||
unsigned char funct_address[4];
|
||||
};
|
||||
|
||||
#endif
|
|
@ -1,103 +0,0 @@
|
|||
/*
|
||||
* INET An implementation of the TCP/IP protocol suite for the LINUX
|
||||
* operating system. INET is implemented using the BSD Socket
|
||||
* interface as the means of communication with the user level.
|
||||
*
|
||||
* Global definitions for the Token-Ring IEEE 802.5 interface.
|
||||
*
|
||||
* Version: @(#)if_tr.h 0.0 07/11/94
|
||||
*
|
||||
* Author: Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
|
||||
* Donald Becker, <becker@super.org>
|
||||
* Peter De Schrijver, <stud11@cc4.kuleuven.ac.be>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version
|
||||
* 2 of the License, or (at your option) any later version.
|
||||
*/
|
||||
#ifndef _LINUX_IF_TR_H
|
||||
#define _LINUX_IF_TR_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <asm/byteorder.h> /* For __be16 */
|
||||
|
||||
/* IEEE 802.5 Token-Ring magic constants. The frame sizes omit the preamble
|
||||
and FCS/CRC (frame check sequence). */
|
||||
#define TR_ALEN 6 /* Octets in one token-ring addr */
|
||||
#define TR_HLEN (sizeof(struct trh_hdr)+sizeof(struct trllc))
|
||||
#define AC 0x10
|
||||
#define LLC_FRAME 0x40
|
||||
|
||||
/* LLC and SNAP constants */
|
||||
#define EXTENDED_SAP 0xAA
|
||||
#define UI_CMD 0x03
|
||||
|
||||
/* This is an Token-Ring frame header. */
|
||||
struct trh_hdr {
|
||||
__u8 ac; /* access control field */
|
||||
__u8 fc; /* frame control field */
|
||||
__u8 daddr[TR_ALEN]; /* destination address */
|
||||
__u8 saddr[TR_ALEN]; /* source address */
|
||||
__be16 rcf; /* route control field */
|
||||
__be16 rseg[8]; /* routing registers */
|
||||
};
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#include <linux/skbuff.h>
|
||||
|
||||
static inline struct trh_hdr *tr_hdr(const struct sk_buff *skb)
|
||||
{
|
||||
return (struct trh_hdr *)skb_mac_header(skb);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* This is an Token-Ring LLC structure */
|
||||
struct trllc {
|
||||
__u8 dsap; /* destination SAP */
|
||||
__u8 ssap; /* source SAP */
|
||||
__u8 llc; /* LLC control field */
|
||||
__u8 protid[3]; /* protocol id */
|
||||
__be16 ethertype; /* ether type field */
|
||||
};
|
||||
|
||||
/* Token-Ring statistics collection data. */
|
||||
struct tr_statistics {
|
||||
unsigned long rx_packets; /* total packets received */
|
||||
unsigned long tx_packets; /* total packets transmitted */
|
||||
unsigned long rx_bytes; /* total bytes received */
|
||||
unsigned long tx_bytes; /* total bytes transmitted */
|
||||
unsigned long rx_errors; /* bad packets received */
|
||||
unsigned long tx_errors; /* packet transmit problems */
|
||||
unsigned long rx_dropped; /* no space in linux buffers */
|
||||
unsigned long tx_dropped; /* no space available in linux */
|
||||
unsigned long multicast; /* multicast packets received */
|
||||
unsigned long transmit_collision;
|
||||
|
||||
/* detailed Token-Ring errors. See IBM Token-Ring Network
|
||||
Architecture for more info */
|
||||
|
||||
unsigned long line_errors;
|
||||
unsigned long internal_errors;
|
||||
unsigned long burst_errors;
|
||||
unsigned long A_C_errors;
|
||||
unsigned long abort_delimiters;
|
||||
unsigned long lost_frames;
|
||||
unsigned long recv_congest_count;
|
||||
unsigned long frame_copied_errors;
|
||||
unsigned long frequency_errors;
|
||||
unsigned long token_errors;
|
||||
unsigned long dummy1;
|
||||
};
|
||||
|
||||
/* source routing stuff */
|
||||
#define TR_RII 0x80
|
||||
#define TR_RCF_DIR_BIT 0x80
|
||||
#define TR_RCF_LEN_MASK 0x1f00
|
||||
#define TR_RCF_BROADCAST 0x8000 /* all-routes broadcast */
|
||||
#define TR_RCF_LIMITED_BROADCAST 0xC000 /* single-route broadcast */
|
||||
#define TR_RCF_FRAME2K 0x20
|
||||
#define TR_RCF_BROADCAST_MASK 0xC000
|
||||
#define TR_MAXRIFLEN 18
|
||||
|
||||
#endif /* _LINUX_IF_TR_H */
|
|
@ -1,37 +0,0 @@
|
|||
/*
|
||||
* INET An implementation of the TCP/IP protocol suite for the LINUX
|
||||
* operating system. NET is implemented using the BSD Socket
|
||||
* interface as the means of communication with the user level.
|
||||
*
|
||||
* Definitions for the Token-ring handlers.
|
||||
*
|
||||
* Version: @(#)eth.h 1.0.4 05/13/93
|
||||
*
|
||||
* Authors: Ross Biro
|
||||
* Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
|
||||
*
|
||||
* Relocated to include/linux where it belongs by Alan Cox
|
||||
* <gw4pts@gw4pts.ampr.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version
|
||||
* 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* WARNING: This move may well be temporary. This file will get merged with others RSN.
|
||||
*
|
||||
*/
|
||||
#ifndef _LINUX_TRDEVICE_H
|
||||
#define _LINUX_TRDEVICE_H
|
||||
|
||||
|
||||
#include <linux/if_tr.h>
|
||||
|
||||
#ifdef __KERNEL__
|
||||
extern __be16 tr_type_trans(struct sk_buff *skb, struct net_device *dev);
|
||||
extern void tr_source_route(struct sk_buff *skb, struct trh_hdr *trh, struct net_device *dev);
|
||||
extern struct net_device *alloc_trdev(int sizeof_priv);
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* _LINUX_TRDEVICE_H */
|
|
@ -4,7 +4,6 @@
|
|||
|
||||
# Check the p8022 selections against net/core/Makefile.
|
||||
obj-$(CONFIG_LLC) += p8022.o psnap.o
|
||||
obj-$(CONFIG_TR) += p8022.o psnap.o tr.o
|
||||
obj-$(CONFIG_NET_FC) += fc.o
|
||||
obj-$(CONFIG_FDDI) += fddi.o
|
||||
obj-$(CONFIG_HIPPI) += hippi.o
|
||||
|
|
669
net/802/tr.c
669
net/802/tr.c
|
@ -1,669 +0,0 @@
|
|||
/*
|
||||
* NET3: Token ring device handling subroutines
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version
|
||||
* 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* Fixes: 3 Feb 97 Paul Norton <pnorton@cts.com> Minor routing fixes.
|
||||
* Added rif table to /proc/net/tr_rif and rif timeout to
|
||||
* /proc/sys/net/token-ring/rif_timeout.
|
||||
* 22 Jun 98 Paul Norton <p.norton@computer.org> Rearranged
|
||||
* tr_header and tr_type_trans to handle passing IPX SNAP and
|
||||
* 802.2 through the correct layers. Eliminated tr_reformat.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <asm/uaccess.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/types.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/jiffies.h>
|
||||
#include <linux/string.h>
|
||||
#include <linux/mm.h>
|
||||
#include <linux/socket.h>
|
||||
#include <linux/in.h>
|
||||
#include <linux/inet.h>
|
||||
#include <linux/netdevice.h>
|
||||
#include <linux/trdevice.h>
|
||||
#include <linux/skbuff.h>
|
||||
#include <linux/errno.h>
|
||||
#include <linux/timer.h>
|
||||
#include <linux/net.h>
|
||||
#include <linux/proc_fs.h>
|
||||
#include <linux/seq_file.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/sysctl.h>
|
||||
#include <linux/slab.h>
|
||||
#include <net/arp.h>
|
||||
#include <net/net_namespace.h>
|
||||
|
||||
static void tr_add_rif_info(struct trh_hdr *trh, struct net_device *dev);
|
||||
static void rif_check_expire(unsigned long dummy);
|
||||
|
||||
#define TR_SR_DEBUG 0
|
||||
|
||||
/*
|
||||
* Each RIF entry we learn is kept this way
|
||||
*/
|
||||
|
||||
struct rif_cache {
|
||||
unsigned char addr[TR_ALEN];
|
||||
int iface;
|
||||
__be16 rcf;
|
||||
__be16 rseg[8];
|
||||
struct rif_cache *next;
|
||||
unsigned long last_used;
|
||||
unsigned char local_ring;
|
||||
};
|
||||
|
||||
#define RIF_TABLE_SIZE 32
|
||||
|
||||
/*
|
||||
* We hash the RIF cache 32 ways. We do after all have to look it
|
||||
* up a lot.
|
||||
*/
|
||||
|
||||
static struct rif_cache *rif_table[RIF_TABLE_SIZE];
|
||||
|
||||
static DEFINE_SPINLOCK(rif_lock);
|
||||
|
||||
|
||||
/*
|
||||
* Garbage disposal timer.
|
||||
*/
|
||||
|
||||
static struct timer_list rif_timer;
|
||||
|
||||
static int sysctl_tr_rif_timeout = 60*10*HZ;
|
||||
|
||||
static inline unsigned long rif_hash(const unsigned char *addr)
|
||||
{
|
||||
unsigned long x;
|
||||
|
||||
x = addr[0];
|
||||
x = (x << 2) ^ addr[1];
|
||||
x = (x << 2) ^ addr[2];
|
||||
x = (x << 2) ^ addr[3];
|
||||
x = (x << 2) ^ addr[4];
|
||||
x = (x << 2) ^ addr[5];
|
||||
|
||||
x ^= x >> 8;
|
||||
|
||||
return x & (RIF_TABLE_SIZE - 1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Put the headers on a token ring packet. Token ring source routing
|
||||
* makes this a little more exciting than on ethernet.
|
||||
*/
|
||||
|
||||
static int tr_header(struct sk_buff *skb, struct net_device *dev,
|
||||
unsigned short type,
|
||||
const void *daddr, const void *saddr, unsigned int len)
|
||||
{
|
||||
struct trh_hdr *trh;
|
||||
int hdr_len;
|
||||
|
||||
/*
|
||||
* Add the 802.2 SNAP header if IP as the IPv4/IPv6 code calls
|
||||
* dev->hard_header directly.
|
||||
*/
|
||||
if (type == ETH_P_IP || type == ETH_P_IPV6 || type == ETH_P_ARP)
|
||||
{
|
||||
struct trllc *trllc;
|
||||
|
||||
hdr_len = sizeof(struct trh_hdr) + sizeof(struct trllc);
|
||||
trh = (struct trh_hdr *)skb_push(skb, hdr_len);
|
||||
trllc = (struct trllc *)(trh+1);
|
||||
trllc->dsap = trllc->ssap = EXTENDED_SAP;
|
||||
trllc->llc = UI_CMD;
|
||||
trllc->protid[0] = trllc->protid[1] = trllc->protid[2] = 0x00;
|
||||
trllc->ethertype = htons(type);
|
||||
}
|
||||
else
|
||||
{
|
||||
hdr_len = sizeof(struct trh_hdr);
|
||||
trh = (struct trh_hdr *)skb_push(skb, hdr_len);
|
||||
}
|
||||
|
||||
trh->ac=AC;
|
||||
trh->fc=LLC_FRAME;
|
||||
|
||||
if(saddr)
|
||||
memcpy(trh->saddr,saddr,dev->addr_len);
|
||||
else
|
||||
memcpy(trh->saddr,dev->dev_addr,dev->addr_len);
|
||||
|
||||
/*
|
||||
* Build the destination and then source route the frame
|
||||
*/
|
||||
|
||||
if(daddr)
|
||||
{
|
||||
memcpy(trh->daddr,daddr,dev->addr_len);
|
||||
tr_source_route(skb, trh, dev);
|
||||
return hdr_len;
|
||||
}
|
||||
|
||||
return -hdr_len;
|
||||
}
|
||||
|
||||
/*
|
||||
* A neighbour discovery of some species (eg arp) has completed. We
|
||||
* can now send the packet.
|
||||
*/
|
||||
|
||||
static int tr_rebuild_header(struct sk_buff *skb)
|
||||
{
|
||||
struct trh_hdr *trh=(struct trh_hdr *)skb->data;
|
||||
struct trllc *trllc=(struct trllc *)(skb->data+sizeof(struct trh_hdr));
|
||||
struct net_device *dev = skb->dev;
|
||||
|
||||
/*
|
||||
* FIXME: We don't yet support IPv6 over token rings
|
||||
*/
|
||||
|
||||
if(trllc->ethertype != htons(ETH_P_IP)) {
|
||||
printk("tr_rebuild_header: Don't know how to resolve type %04X addresses ?\n", ntohs(trllc->ethertype));
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_INET
|
||||
if(arp_find(trh->daddr, skb)) {
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
tr_source_route(skb,trh,dev);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Some of this is a bit hackish. We intercept RIF information
|
||||
* used for source routing. We also grab IP directly and don't feed
|
||||
* it via SNAP.
|
||||
*/
|
||||
|
||||
__be16 tr_type_trans(struct sk_buff *skb, struct net_device *dev)
|
||||
{
|
||||
|
||||
struct trh_hdr *trh;
|
||||
struct trllc *trllc;
|
||||
unsigned int riflen=0;
|
||||
|
||||
skb->dev = dev;
|
||||
skb_reset_mac_header(skb);
|
||||
trh = tr_hdr(skb);
|
||||
|
||||
if(trh->saddr[0] & TR_RII)
|
||||
riflen = (ntohs(trh->rcf) & TR_RCF_LEN_MASK) >> 8;
|
||||
|
||||
trllc = (struct trllc *)(skb->data+sizeof(struct trh_hdr)-TR_MAXRIFLEN+riflen);
|
||||
|
||||
skb_pull(skb,sizeof(struct trh_hdr)-TR_MAXRIFLEN+riflen);
|
||||
|
||||
if(*trh->daddr & 0x80)
|
||||
{
|
||||
if(!memcmp(trh->daddr,dev->broadcast,TR_ALEN))
|
||||
skb->pkt_type=PACKET_BROADCAST;
|
||||
else
|
||||
skb->pkt_type=PACKET_MULTICAST;
|
||||
}
|
||||
else if ( (trh->daddr[0] & 0x01) && (trh->daddr[1] & 0x00) && (trh->daddr[2] & 0x5E))
|
||||
{
|
||||
skb->pkt_type=PACKET_MULTICAST;
|
||||
}
|
||||
else if(dev->flags & IFF_PROMISC)
|
||||
{
|
||||
if(memcmp(trh->daddr, dev->dev_addr, TR_ALEN))
|
||||
skb->pkt_type=PACKET_OTHERHOST;
|
||||
}
|
||||
|
||||
if ((skb->pkt_type != PACKET_BROADCAST) &&
|
||||
(skb->pkt_type != PACKET_MULTICAST))
|
||||
tr_add_rif_info(trh,dev) ;
|
||||
|
||||
/*
|
||||
* Strip the SNAP header from ARP packets since we don't
|
||||
* pass them through to the 802.2/SNAP layers.
|
||||
*/
|
||||
|
||||
if (trllc->dsap == EXTENDED_SAP &&
|
||||
(trllc->ethertype == htons(ETH_P_IP) ||
|
||||
trllc->ethertype == htons(ETH_P_IPV6) ||
|
||||
trllc->ethertype == htons(ETH_P_ARP)))
|
||||
{
|
||||
skb_pull(skb, sizeof(struct trllc));
|
||||
return trllc->ethertype;
|
||||
}
|
||||
|
||||
return htons(ETH_P_TR_802_2);
|
||||
}
|
||||
|
||||
/*
|
||||
* We try to do source routing...
|
||||
*/
|
||||
|
||||
void tr_source_route(struct sk_buff *skb,struct trh_hdr *trh,
|
||||
struct net_device *dev)
|
||||
{
|
||||
int slack;
|
||||
unsigned int hash;
|
||||
struct rif_cache *entry;
|
||||
unsigned char *olddata;
|
||||
unsigned long flags;
|
||||
static const unsigned char mcast_func_addr[]
|
||||
= {0xC0,0x00,0x00,0x04,0x00,0x00};
|
||||
|
||||
spin_lock_irqsave(&rif_lock, flags);
|
||||
|
||||
/*
|
||||
* Broadcasts are single route as stated in RFC 1042
|
||||
*/
|
||||
if( (!memcmp(&(trh->daddr[0]),&(dev->broadcast[0]),TR_ALEN)) ||
|
||||
(!memcmp(&(trh->daddr[0]),&(mcast_func_addr[0]), TR_ALEN)) )
|
||||
{
|
||||
trh->rcf=htons((((sizeof(trh->rcf)) << 8) & TR_RCF_LEN_MASK)
|
||||
| TR_RCF_FRAME2K | TR_RCF_LIMITED_BROADCAST);
|
||||
trh->saddr[0]|=TR_RII;
|
||||
}
|
||||
else
|
||||
{
|
||||
hash = rif_hash(trh->daddr);
|
||||
/*
|
||||
* Walk the hash table and look for an entry
|
||||
*/
|
||||
for(entry=rif_table[hash];entry && memcmp(&(entry->addr[0]),&(trh->daddr[0]),TR_ALEN);entry=entry->next);
|
||||
|
||||
/*
|
||||
* If we found an entry we can route the frame.
|
||||
*/
|
||||
if(entry)
|
||||
{
|
||||
#if TR_SR_DEBUG
|
||||
printk("source routing for %pM\n", trh->daddr);
|
||||
#endif
|
||||
if(!entry->local_ring && (ntohs(entry->rcf) & TR_RCF_LEN_MASK) >> 8)
|
||||
{
|
||||
trh->rcf=entry->rcf;
|
||||
memcpy(&trh->rseg[0],&entry->rseg[0],8*sizeof(unsigned short));
|
||||
trh->rcf^=htons(TR_RCF_DIR_BIT);
|
||||
trh->rcf&=htons(0x1fff); /* Issam Chehab <ichehab@madge1.demon.co.uk> */
|
||||
|
||||
trh->saddr[0]|=TR_RII;
|
||||
#if TR_SR_DEBUG
|
||||
printk("entry found with rcf %04x\n", entry->rcf);
|
||||
}
|
||||
else
|
||||
{
|
||||
printk("entry found but without rcf length, local=%02x\n", entry->local_ring);
|
||||
#endif
|
||||
}
|
||||
entry->last_used=jiffies;
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Without the information we simply have to shout
|
||||
* on the wire. The replies should rapidly clean this
|
||||
* situation up.
|
||||
*/
|
||||
trh->rcf=htons((((sizeof(trh->rcf)) << 8) & TR_RCF_LEN_MASK)
|
||||
| TR_RCF_FRAME2K | TR_RCF_LIMITED_BROADCAST);
|
||||
trh->saddr[0]|=TR_RII;
|
||||
#if TR_SR_DEBUG
|
||||
printk("no entry in rif table found - broadcasting frame\n");
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
/* Compress the RIF here so we don't have to do it in the driver(s) */
|
||||
if (!(trh->saddr[0] & 0x80))
|
||||
slack = 18;
|
||||
else
|
||||
slack = 18 - ((ntohs(trh->rcf) & TR_RCF_LEN_MASK)>>8);
|
||||
olddata = skb->data;
|
||||
spin_unlock_irqrestore(&rif_lock, flags);
|
||||
|
||||
skb_pull(skb, slack);
|
||||
memmove(skb->data, olddata, sizeof(struct trh_hdr) - slack);
|
||||
}
|
||||
|
||||
/*
|
||||
* We have learned some new RIF information for our source
|
||||
* routing.
|
||||
*/
|
||||
|
||||
static void tr_add_rif_info(struct trh_hdr *trh, struct net_device *dev)
|
||||
{
|
||||
unsigned int hash, rii_p = 0;
|
||||
unsigned long flags;
|
||||
struct rif_cache *entry;
|
||||
unsigned char saddr0;
|
||||
|
||||
spin_lock_irqsave(&rif_lock, flags);
|
||||
saddr0 = trh->saddr[0];
|
||||
|
||||
/*
|
||||
* Firstly see if the entry exists
|
||||
*/
|
||||
|
||||
if(trh->saddr[0] & TR_RII)
|
||||
{
|
||||
trh->saddr[0]&=0x7f;
|
||||
if (((ntohs(trh->rcf) & TR_RCF_LEN_MASK) >> 8) > 2)
|
||||
{
|
||||
rii_p = 1;
|
||||
}
|
||||
}
|
||||
|
||||
hash = rif_hash(trh->saddr);
|
||||
for(entry=rif_table[hash];entry && memcmp(&(entry->addr[0]),&(trh->saddr[0]),TR_ALEN);entry=entry->next);
|
||||
|
||||
if(entry==NULL)
|
||||
{
|
||||
#if TR_SR_DEBUG
|
||||
printk("adding rif_entry: addr:%pM rcf:%04X\n",
|
||||
trh->saddr, ntohs(trh->rcf));
|
||||
#endif
|
||||
/*
|
||||
* Allocate our new entry. A failure to allocate loses
|
||||
* use the information. This is harmless.
|
||||
*
|
||||
* FIXME: We ought to keep some kind of cache size
|
||||
* limiting and adjust the timers to suit.
|
||||
*/
|
||||
entry=kmalloc(sizeof(struct rif_cache),GFP_ATOMIC);
|
||||
|
||||
if(!entry)
|
||||
{
|
||||
printk(KERN_DEBUG "tr.c: Couldn't malloc rif cache entry !\n");
|
||||
spin_unlock_irqrestore(&rif_lock, flags);
|
||||
return;
|
||||
}
|
||||
|
||||
memcpy(&(entry->addr[0]),&(trh->saddr[0]),TR_ALEN);
|
||||
entry->iface = dev->ifindex;
|
||||
entry->next=rif_table[hash];
|
||||
entry->last_used=jiffies;
|
||||
rif_table[hash]=entry;
|
||||
|
||||
if (rii_p)
|
||||
{
|
||||
entry->rcf = trh->rcf & htons((unsigned short)~TR_RCF_BROADCAST_MASK);
|
||||
memcpy(&(entry->rseg[0]),&(trh->rseg[0]),8*sizeof(unsigned short));
|
||||
entry->local_ring = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
entry->local_ring = 1;
|
||||
}
|
||||
}
|
||||
else /* Y. Tahara added */
|
||||
{
|
||||
/*
|
||||
* Update existing entries
|
||||
*/
|
||||
if (!entry->local_ring)
|
||||
if (entry->rcf != (trh->rcf & htons((unsigned short)~TR_RCF_BROADCAST_MASK)) &&
|
||||
!(trh->rcf & htons(TR_RCF_BROADCAST_MASK)))
|
||||
{
|
||||
#if TR_SR_DEBUG
|
||||
printk("updating rif_entry: addr:%pM rcf:%04X\n",
|
||||
trh->saddr, ntohs(trh->rcf));
|
||||
#endif
|
||||
entry->rcf = trh->rcf & htons((unsigned short)~TR_RCF_BROADCAST_MASK);
|
||||
memcpy(&(entry->rseg[0]),&(trh->rseg[0]),8*sizeof(unsigned short));
|
||||
}
|
||||
entry->last_used=jiffies;
|
||||
}
|
||||
trh->saddr[0]=saddr0; /* put the routing indicator back for tcpdump */
|
||||
spin_unlock_irqrestore(&rif_lock, flags);
|
||||
}
|
||||
|
||||
/*
|
||||
* Scan the cache with a timer and see what we need to throw out.
|
||||
*/
|
||||
|
||||
static void rif_check_expire(unsigned long dummy)
|
||||
{
|
||||
int i;
|
||||
unsigned long flags, next_interval = jiffies + sysctl_tr_rif_timeout/2;
|
||||
|
||||
spin_lock_irqsave(&rif_lock, flags);
|
||||
|
||||
for(i =0; i < RIF_TABLE_SIZE; i++) {
|
||||
struct rif_cache *entry, **pentry;
|
||||
|
||||
pentry = rif_table+i;
|
||||
while((entry=*pentry) != NULL) {
|
||||
unsigned long expires
|
||||
= entry->last_used + sysctl_tr_rif_timeout;
|
||||
|
||||
if (time_before_eq(expires, jiffies)) {
|
||||
*pentry = entry->next;
|
||||
kfree(entry);
|
||||
} else {
|
||||
pentry = &entry->next;
|
||||
|
||||
if (time_before(expires, next_interval))
|
||||
next_interval = expires;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
spin_unlock_irqrestore(&rif_lock, flags);
|
||||
|
||||
mod_timer(&rif_timer, next_interval);
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* Generate the /proc/net information for the token ring RIF
|
||||
* routing.
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_PROC_FS
|
||||
|
||||
static struct rif_cache *rif_get_idx(loff_t pos)
|
||||
{
|
||||
int i;
|
||||
struct rif_cache *entry;
|
||||
loff_t off = 0;
|
||||
|
||||
for(i = 0; i < RIF_TABLE_SIZE; i++)
|
||||
for(entry = rif_table[i]; entry; entry = entry->next) {
|
||||
if (off == pos)
|
||||
return entry;
|
||||
++off;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void *rif_seq_start(struct seq_file *seq, loff_t *pos)
|
||||
__acquires(&rif_lock)
|
||||
{
|
||||
spin_lock_irq(&rif_lock);
|
||||
|
||||
return *pos ? rif_get_idx(*pos - 1) : SEQ_START_TOKEN;
|
||||
}
|
||||
|
||||
static void *rif_seq_next(struct seq_file *seq, void *v, loff_t *pos)
|
||||
{
|
||||
int i;
|
||||
struct rif_cache *ent = v;
|
||||
|
||||
++*pos;
|
||||
|
||||
if (v == SEQ_START_TOKEN) {
|
||||
i = -1;
|
||||
goto scan;
|
||||
}
|
||||
|
||||
if (ent->next)
|
||||
return ent->next;
|
||||
|
||||
i = rif_hash(ent->addr);
|
||||
scan:
|
||||
while (++i < RIF_TABLE_SIZE) {
|
||||
if ((ent = rif_table[i]) != NULL)
|
||||
return ent;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void rif_seq_stop(struct seq_file *seq, void *v)
|
||||
__releases(&rif_lock)
|
||||
{
|
||||
spin_unlock_irq(&rif_lock);
|
||||
}
|
||||
|
||||
static int rif_seq_show(struct seq_file *seq, void *v)
|
||||
{
|
||||
int j, rcf_len, segment, brdgnmb;
|
||||
struct rif_cache *entry = v;
|
||||
|
||||
if (v == SEQ_START_TOKEN)
|
||||
seq_puts(seq,
|
||||
"if TR address TTL rcf routing segments\n");
|
||||
else {
|
||||
struct net_device *dev = dev_get_by_index(&init_net, entry->iface);
|
||||
long ttl = (long) (entry->last_used + sysctl_tr_rif_timeout)
|
||||
- (long) jiffies;
|
||||
|
||||
seq_printf(seq, "%s %pM %7li ",
|
||||
dev?dev->name:"?",
|
||||
entry->addr,
|
||||
ttl/HZ);
|
||||
|
||||
if (entry->local_ring)
|
||||
seq_puts(seq, "local\n");
|
||||
else {
|
||||
|
||||
seq_printf(seq, "%04X", ntohs(entry->rcf));
|
||||
rcf_len = ((ntohs(entry->rcf) & TR_RCF_LEN_MASK)>>8)-2;
|
||||
if (rcf_len)
|
||||
rcf_len >>= 1;
|
||||
for(j = 1; j < rcf_len; j++) {
|
||||
if(j==1) {
|
||||
segment=ntohs(entry->rseg[j-1])>>4;
|
||||
seq_printf(seq," %03X",segment);
|
||||
}
|
||||
|
||||
segment=ntohs(entry->rseg[j])>>4;
|
||||
brdgnmb=ntohs(entry->rseg[j-1])&0x00f;
|
||||
seq_printf(seq,"-%01X-%03X",brdgnmb,segment);
|
||||
}
|
||||
seq_putc(seq, '\n');
|
||||
}
|
||||
|
||||
if (dev)
|
||||
dev_put(dev);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static const struct seq_operations rif_seq_ops = {
|
||||
.start = rif_seq_start,
|
||||
.next = rif_seq_next,
|
||||
.stop = rif_seq_stop,
|
||||
.show = rif_seq_show,
|
||||
};
|
||||
|
||||
static int rif_seq_open(struct inode *inode, struct file *file)
|
||||
{
|
||||
return seq_open(file, &rif_seq_ops);
|
||||
}
|
||||
|
||||
static const struct file_operations rif_seq_fops = {
|
||||
.owner = THIS_MODULE,
|
||||
.open = rif_seq_open,
|
||||
.read = seq_read,
|
||||
.llseek = seq_lseek,
|
||||
.release = seq_release,
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
static const struct header_ops tr_header_ops = {
|
||||
.create = tr_header,
|
||||
.rebuild= tr_rebuild_header,
|
||||
};
|
||||
|
||||
static void tr_setup(struct net_device *dev)
|
||||
{
|
||||
/*
|
||||
* Configure and register
|
||||
*/
|
||||
|
||||
dev->header_ops = &tr_header_ops;
|
||||
|
||||
dev->hard_header_len = TR_HLEN;
|
||||
dev->mtu = 2000;
|
||||
dev->addr_len = TR_ALEN;
|
||||
dev->tx_queue_len = 100; /* Long queues on tr */
|
||||
|
||||
memset(dev->broadcast,0xFF, TR_ALEN);
|
||||
|
||||
/* New-style flags. */
|
||||
dev->flags = IFF_BROADCAST | IFF_MULTICAST ;
|
||||
}
|
||||
|
||||
/**
|
||||
* alloc_trdev - Register token ring device
|
||||
* @sizeof_priv: Size of additional driver-private structure to be allocated
|
||||
* for this token ring device
|
||||
*
|
||||
* Fill in the fields of the device structure with token ring-generic values.
|
||||
*
|
||||
* Constructs a new net device, complete with a private data area of
|
||||
* size @sizeof_priv. A 32-byte (not bit) alignment is enforced for
|
||||
* this private data area.
|
||||
*/
|
||||
struct net_device *alloc_trdev(int sizeof_priv)
|
||||
{
|
||||
return alloc_netdev(sizeof_priv, "tr%d", tr_setup);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SYSCTL
|
||||
static struct ctl_table tr_table[] = {
|
||||
{
|
||||
.procname = "rif_timeout",
|
||||
.data = &sysctl_tr_rif_timeout,
|
||||
.maxlen = sizeof(int),
|
||||
.mode = 0644,
|
||||
.proc_handler = proc_dointvec
|
||||
},
|
||||
{ },
|
||||
};
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Called during bootup. We don't actually have to initialise
|
||||
* too much for this.
|
||||
*/
|
||||
|
||||
static int __init rif_init(void)
|
||||
{
|
||||
rif_timer.expires = jiffies + sysctl_tr_rif_timeout;
|
||||
setup_timer(&rif_timer, rif_check_expire, 0);
|
||||
add_timer(&rif_timer);
|
||||
#ifdef CONFIG_SYSCTL
|
||||
register_net_sysctl(&init_net, "net/token-ring", tr_table);
|
||||
#endif
|
||||
proc_net_fops_create(&init_net, "tr_rif", S_IRUGO, &rif_seq_fops);
|
||||
return 0;
|
||||
}
|
||||
|
||||
module_init(rif_init);
|
||||
|
||||
EXPORT_SYMBOL(tr_type_trans);
|
||||
EXPORT_SYMBOL(alloc_trdev);
|
||||
|
||||
MODULE_LICENSE("GPL");
|
Загрузка…
Ссылка в новой задаче