Commit 49e68be0 authored by Jeff Garzik's avatar Jeff Garzik

Manual merge of drivers/net/*/Kconfig changes.

parents c8931e4d 8ab7991e
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
All rights reserved All rights reserved
=========================================================================== ===========================================================================
sk98lin.txt created 18-Jul-2003 sk98lin.txt created 23-Sep-2003
Readme File for sk98lin v6.14 Readme File for sk98lin v6.18
Marvell Yukon/SysKonnect SK-98xx Gigabit Ethernet Adapter family driver for LINUX Marvell Yukon/SysKonnect SK-98xx Gigabit Ethernet Adapter family driver for LINUX
This file contains This file contains
...@@ -19,7 +19,6 @@ This file contains ...@@ -19,7 +19,6 @@ This file contains
5 Large Frame Support 5 Large Frame Support
6 VLAN and Link Aggregation Support (IEEE 802.1, 802.1q, 802.3ad) 6 VLAN and Link Aggregation Support (IEEE 802.1, 802.1q, 802.3ad)
7 Troubleshooting 7 Troubleshooting
8 History
=========================================================================== ===========================================================================
...@@ -76,8 +75,8 @@ follows: ...@@ -76,8 +75,8 @@ follows:
To integrate the driver permanently into the kernel, proceed as follows: To integrate the driver permanently into the kernel, proceed as follows:
1. Select the menu "Network device support" and then "Ethernet(1000Mbit)" 1. Select the menu "Network device support" and then "Ethernet(1000Mbit)"
2. Mark "Marvell Yukon/SysKonnect SK-98xx/SK-95xx Gigabit Ethernet Adapter 2. Mark "Marvell Yukon Chipset / SysKonnect SK-98xx family support"
support" with (*) with (*)
3. Build a new kernel when the configuration of the above options is 3. Build a new kernel when the configuration of the above options is
finished. finished.
4. Install the new kernel. 4. Install the new kernel.
...@@ -88,8 +87,8 @@ To use the driver as a module, proceed as follows: ...@@ -88,8 +87,8 @@ To use the driver as a module, proceed as follows:
1. Enable 'loadable module support' in the kernel. 1. Enable 'loadable module support' in the kernel.
2. For automatic driver start, enable the 'Kernel module loader'. 2. For automatic driver start, enable the 'Kernel module loader'.
3. Select the menu "Network device support" and then "Ethernet(1000Mbit)" 3. Select the menu "Network device support" and then "Ethernet(1000Mbit)"
4. Mark "Marvell Yukon/SysKonnect SK-98xx/SK-95xx Gigabit Ethernet Adapter 4. Mark "Marvell Yukon Chipset / SysKonnect SK-98xx family support"
support" with (M) with (M)
5. Execute the command "make modules". 5. Execute the command "make modules".
6. Execute the command "make modules_install". 6. Execute the command "make modules_install".
The appropiate modules will be installed. The appropiate modules will be installed.
...@@ -201,7 +200,7 @@ You also want to set DuplexCapabilities on the first adapter ...@@ -201,7 +200,7 @@ You also want to set DuplexCapabilities on the first adapter
to FULL, and on the second adapter to HALF. to FULL, and on the second adapter to HALF.
Then, you must enter: Then, you must enter:
modprobe sk98lin AutoNeg=On,Off DupCap=Full,Half modprobe sk98lin AutoNeg_A=On,Off DupCap_A=Full,Half
NOTE: The number of adapters that can be configured this way is NOTE: The number of adapters that can be configured this way is
limited in the driver (file skge.c, constant SK_MAX_CARD_PARAM). limited in the driver (file skge.c, constant SK_MAX_CARD_PARAM).
...@@ -259,9 +258,9 @@ This parameter can be used to set the flow control capabilities the ...@@ -259,9 +258,9 @@ This parameter can be used to set the flow control capabilities the
port reports during auto-negotiation. It can be set for each port port reports during auto-negotiation. It can be set for each port
individually. individually.
Possible modes: Possible modes:
-- Sym = Symetric: both link partners are allowed to send -- Sym = Symmetric: both link partners are allowed to send
PAUSE frames PAUSE frames
-- SymOrRem = SymetricOrRemote: both or only remote partner -- SymOrRem = SymmetricOrRemote: both or only remote partner
are allowed to send PAUSE frames are allowed to send PAUSE frames
-- LocSend = LocalSend: only local link partner is allowed -- LocSend = LocalSend: only local link partner is allowed
to send PAUSE frames to send PAUSE frames
...@@ -286,7 +285,7 @@ with this parameter. ...@@ -286,7 +285,7 @@ with this parameter.
4.2 Adapter Parameters 4.2 Adapter Parameters
----------------------- -----------------------
Connection Type Connection Type (SK-98xx V2.0 copper adapters only)
--------------- ---------------
Parameter: ConType Parameter: ConType
Values: Auto, 100FD, 100HD, 10FD, 10HD Values: Auto, 100FD, 100HD, 10FD, 10HD
...@@ -546,7 +545,7 @@ Problem: Upon driver start, the following error message is displayed: ...@@ -546,7 +545,7 @@ Problem: Upon driver start, the following error message is displayed:
Nr: 0xcc Nr: 0xcc
Msg: SkGeInitPort() cannot init running ports" Msg: SkGeInitPort() cannot init running ports"
Reason: You are using a driver compiled for single processor machines Reason: You are using a driver compiled for single processor machines
on a multiprocessor machine with SMP (Symetric MultiProcessor) on a multiprocessor machine with SMP (Symmetric MultiProcessor)
kernel. kernel.
Solution: Configure your kernel appropriately and recompile the kernel or Solution: Configure your kernel appropriately and recompile the kernel or
the modules. the modules.
...@@ -564,216 +563,6 @@ information is available: ...@@ -564,216 +563,6 @@ information is available:
- Driver version - Driver version
*** ***
8 History
==========
VERSION 6.14
New Features:
- None
Problems fixed:
- Fix: memory leak when sending short padded frames
- Fix: helptext for menuconfig in kernel 2.6 updated
- Fix: PNMI_READ defines retrieve correct amount of bytes
Known limitations:
- None
VERSION 6.13
New Features:
- New parameter ConType combining different per-port parameters
Problems fixed:
- Fix: change of MTU-size without warning (bugreport #10721)
- Fix: HW checksumming when Kernel 2.5/2.6 corrected
- Fix: Padding of small packets (<60 bytes) not 0xaa, but 0x00 instead
- Fix: Minor edits corrected
- Fix: Obsolete function SetQueueSize() removed
- Fix: Removed proprietary defines - used defines from skgehw.h instead
Known limitations:
- None
VERSION 6.12
New Features:
- enabling/disabling checksum
Problems fixed:
- Fix: KLM load/unload using new refcount interface for Kernel 2.5/2.6
Known limitations:
- None
VERSION 6.11 (In-Kernel version)
New Features:
- Support for Kernel 2.5/2.6
- Support for new IO-control MIB data structure
- New SkOsGetTime function
Problems fixed:
- Fix: Race condition with broken LM80 chip
- Fix: Common modules update (#10803, #10768, #10767)
- Fix: Dim, ProcFS, Isr, Module Support changes for Kernel 2.5/2.6
Known limitations:
- None
VERSION 6.10
New Features:
- none
Problems fixed:
- Fix: Race condition with padded frames
Known limitations:
- None
VERSION 6.09
New Features:
- none
Problems fixed:
- Fix: Disabled HW Error IRQ on 32-bit Yukon if sensor IRQ occurs
- Fix: Delay race condition with some server machines
Known limitations:
- None
VERSION 6.08
New Features:
- Add: Dynamic Interrupt moderation
- Add: Blink mode verification
- Fix: CSUM changes
Problems fixed:
- Fix: CSUM changes
Known limitations:
- None
VERSION 6.04 - 6.07
New Features:
- Common modules update
Problems fixed:
- none
Known limitations:
- None
VERSION 6.03
New Features:
- Common modules update
Problems fixed:
- Remove useless init_module/cleanup_module forward declarations
Known limitations:
- None
VERSION 6.02 (In-Kernel version)
New Features:
- Common modules update
Problems fixed:
- Boot message cleanup
Known limitations:
- None
VERSION 6.00 (In-Kernel version)
New Features:
- Support for SK-98xx V2.0 adapters
- Support for gmac
- Support for kernel 2.4.x and kernel 2.2.x
- Zerocopy support for kernel 2.4.x with sendfile()
- Support for scatter-gather functionality with sendfile()
- Speed support for SK-98xx V2.0 adapters
- New ProcFs entries
- New module parameters
Problems fixed:
- ProcFS initialization
- csum packet error
- Ierror/crc counter error (#10767)
- rx_too_long counter error (#10751)
Known limitations:
- None
VERSION 4.11
New Features:
- none
Problems fixed:
- Error statistic counter fix (#10620)
- RLMT-Fixes (#10659, #10639, #10650)
- LM80 sensor initialization fix (#10623)
- SK-CSUM memory fixes (#10610).
Known limitations:
- None
VERSION 4.10
New Features:
- New ProcFs entries
Problems fixed:
- Corrected some printk's
Known limitations:
- None
VERSION 4.09
New Features:
- IFF_RUNNING support (link status)
- New ProcFs entries
Problems fixed:
- too long counters
- too short counters
- Kernel error compilation
Known limitations:
- None
VERSION 4.06 (In-Kernel version)
Problems fixed:
- MTU init problems
VERSION 4.04
Problems fixed:
- removed VLAN error messages
VERSION 4.02 (In-Kernel version)
New Features:
- Add Kernel 2.4 changes
Known limitations:
- None
VERSION 4.01 (In-Kernel version)
Problems fixed:
- Full statistics support for DualNet mode
Known limitations:
- None
VERSION 4.00 (In-Kernel version)
Problems fixed:
- Memory leak found
New Features:
- Proc filesystem integration
- DualNet functionality integrated
- Rlmt networks added
Known limitations:
- statistics partially incorrect in DualNet mode
VERSION 3.04 (In-Kernel version)
Problems fixed:
- Driver start failed on UltraSPARC
- Rx checksum calculation for big endian machines did not work
- Jumbo frames were counted as input-errors in netstat
VERSION 3.03 (Standalone version)
Problems fixed:
- Compilation did not find script "printver.sh" if "." not in PATH
Known limitations:
- None
VERSION 3.02 (In-Kernel version)
Problems fixed:
- None
New Features:
- Integration in Linux kernel source (2.2.14 and 2.3.29)
Known limitations:
- None
VERSION 3.01
Problems fixed:
- None
New Features:
- Full source release
Known limitations:
- None
VERSION 3.00
Problems fixed:
- None
New Features:
- Support for 1000Base-T adapters (SK-9821 and SK-9822)
Known limitations:
- None
***End of Readme File*** ***End of Readme File***
...@@ -1891,18 +1891,23 @@ config SK98LIN ...@@ -1891,18 +1891,23 @@ config SK98LIN
by this driver: by this driver:
- 3Com 3C940 Gigabit LOM Ethernet Adapter - 3Com 3C940 Gigabit LOM Ethernet Adapter
- 3Com 3C941 Gigabit LOM Ethernet Adapter - 3Com 3C941 Gigabit LOM Ethernet Adapter
- Allied Telesyn AT-2970SX Gigabit Ethernet Adapter
- Allied Telesyn AT-2970LX Gigabit Ethernet Adapter - Allied Telesyn AT-2970LX Gigabit Ethernet Adapter
- Allied Telesyn AT-2970LX/2SC Gigabit Ethernet Adapter
- Allied Telesyn AT-2970SX Gigabit Ethernet Adapter
- Allied Telesyn AT-2970SX/2SC Gigabit Ethernet Adapter
- Allied Telesyn AT-2970TX Gigabit Ethernet Adapter - Allied Telesyn AT-2970TX Gigabit Ethernet Adapter
- Allied Telesyn AT-2970TX/2TX Gigabit Ethernet Adapter
- Allied Telesyn AT-2971SX Gigabit Ethernet Adapter - Allied Telesyn AT-2971SX Gigabit Ethernet Adapter
- Allied Telesyn AT-2971T Gigabit Ethernet Adapter - Allied Telesyn AT-2971T Gigabit Ethernet Adapter
- Allied Telesyn AT-2970SX/2SC Gigabit Ethernet Adapter
- Allied Telesyn AT-2970LX/2SC Gigabit Ethernet Adapter
- Allied Telesyn AT-2970TX/2TX Gigabit Ethernet Adapter
- N-Way PCI-Bus Giga-Card 1000/100/10Mbps(L)
- DGE-530T Gigabit Ethernet Adapter - DGE-530T Gigabit Ethernet Adapter
- EG1032 v2 Instant Gigabit Network Adapter - EG1032 v2 Instant Gigabit Network Adapter
- EG1064 v2 Instant Gigabit Network Adapter - EG1064 v2 Instant Gigabit Network Adapter
- Marvell 88E8001 Gigabit LOM Ethernet Adapter (Abit)
- Marvell 88E8001 Gigabit LOM Ethernet Adapter (Asus)
- Marvell 88E8001 Gigabit LOM Ethernet Adapter (ECS)
- Marvell 88E8001 Gigabit LOM Ethernet Adapter (Epox)
- Marvell 88E8001 Gigabit LOM Ethernet Adapter (Gigabyte)
- Marvell 88E8001 Gigabit LOM Ethernet Adapter (Iwill)
- Marvell RDK-8001 Adapter - Marvell RDK-8001 Adapter
- Marvell RDK-8002 Adapter - Marvell RDK-8002 Adapter
- Marvell RDK-8003 Adapter - Marvell RDK-8003 Adapter
...@@ -1911,27 +1916,31 @@ config SK98LIN ...@@ -1911,27 +1916,31 @@ config SK98LIN
- Marvell RDK-8007 Adapter - Marvell RDK-8007 Adapter
- Marvell RDK-8008 Adapter - Marvell RDK-8008 Adapter
- Marvell RDK-8009 Adapter - Marvell RDK-8009 Adapter
- Marvell RDK-8010 Adapter
- Marvell RDK-8011 Adapter - Marvell RDK-8011 Adapter
- Marvell RDK-8012 Adapter - Marvell RDK-8012 Adapter
- Marvell Yukon Gigabit Ethernet 10/100/1000Base-T Adapter - Marvell Yukon Gigabit Ethernet 10/100/1000Base-T Adapter (32 bit)
- Marvell Yukon Gigabit Ethernet 10/100/1000Base-T Adapter (64 bit)
- N-Way PCI-Bus Giga-Card 1000/100/10Mbps(L)
- SK-9521 10/100/1000Base-T Adapter
- SK-9521 V2.0 10/100/1000Base-T Adapter
- SK-9821 Gigabit Ethernet Server Adapter (SK-NET GE-T) - SK-9821 Gigabit Ethernet Server Adapter (SK-NET GE-T)
- SK-9821 V2.0 Gigabit Ethernet 10/100/1000Base-T Adapter
- SK-9822 Gigabit Ethernet Server Adapter (SK-NET GE-T dual link) - SK-9822 Gigabit Ethernet Server Adapter (SK-NET GE-T dual link)
- SK-9841 Gigabit Ethernet Server Adapter (SK-NET GE-LX) - SK-9841 Gigabit Ethernet Server Adapter (SK-NET GE-LX)
- SK-9841 V2.0 Gigabit Ethernet 1000Base-LX Adapter
- SK-9842 Gigabit Ethernet Server Adapter (SK-NET GE-LX dual link) - SK-9842 Gigabit Ethernet Server Adapter (SK-NET GE-LX dual link)
- SK-9843 Gigabit Ethernet Server Adapter (SK-NET GE-SX) - SK-9843 Gigabit Ethernet Server Adapter (SK-NET GE-SX)
- SK-9843 V2.0 Gigabit Ethernet 1000Base-SX Adapter
- SK-9844 Gigabit Ethernet Server Adapter (SK-NET GE-SX dual link) - SK-9844 Gigabit Ethernet Server Adapter (SK-NET GE-SX dual link)
- SK-9851 V2.0 Gigabit Ethernet 1000Base-SX Adapter
- SK-9861 Gigabit Ethernet Server Adapter (SK-NET GE-SX Volition) - SK-9861 Gigabit Ethernet Server Adapter (SK-NET GE-SX Volition)
- SK-9861 V2.0 Gigabit Ethernet 1000Base-SX Adapter
- SK-9862 Gigabit Ethernet Server Adapter (SK-NET GE-SX Volition dual link) - SK-9862 Gigabit Ethernet Server Adapter (SK-NET GE-SX Volition dual link)
- SK-9871 Gigabit Ethernet Server Adapter (SK-NET GE-ZX) - SK-9871 Gigabit Ethernet Server Adapter (SK-NET GE-ZX)
- SK-9872 Gigabit Ethernet Server Adapter (SK-NET GE-ZX dual link)
- SK-9521 V2.0 10/100/1000Base-T Adapter
- SK-9821 V2.0 Gigabit Ethernet 10/100/1000Base-T Adapter
- SK-9841 V2.0 Gigabit Ethernet 1000Base-LX Adapter
- SK-9843 V2.0 Gigabit Ethernet 1000Base-SX Adapter
- SK-9851 V2.0 Gigabit Ethernet 1000Base-SX Adapter
- SK-9861 V2.0 Gigabit Ethernet 1000Base-SX Adapter
- SK-9871 V2.0 Gigabit Ethernet 1000Base-ZX Adapter - SK-9871 V2.0 Gigabit Ethernet 1000Base-ZX Adapter
- SK-9521 10/100/1000Base-T Adapter - SK-9872 Gigabit Ethernet Server Adapter (SK-NET GE-ZX dual link)
- SMC EZ Card 1000 (SMC9452TXV.2)
The adapters support Jumbo Frames. The adapters support Jumbo Frames.
The dual link adapters support link-failover and dual port features. The dual link adapters support link-failover and dual port features.
...@@ -1941,145 +1950,10 @@ config SK98LIN ...@@ -1941,145 +1950,10 @@ config SK98LIN
optional driver parameters. optional driver parameters.
Questions concerning this driver may be addressed to: Questions concerning this driver may be addressed to:
linux@syskonnect.de linux@syskonnect.de
To compile this driver as a module, choose M here: the module To compile this driver as a module, choose M here: the module
will be called sk98lin. This is recommended. will be called sk98lin. This is recommended.
config CONFIG_SK98LIN_T1
bool "3Com 3C940/3C941 Gigabit Ethernet Adapter"
depends on SK98LIN
help
This driver supports:
- 3Com 3C940 Gigabit LOM Ethernet Adapter
- 3Com 3C941 Gigabit LOM Ethernet Adapter
Questions concerning this driver may be addressed to:
linux@syskonnect.de
config CONFIG_SK98LIN_T2
bool "Allied Telesyn AT-29xx Gigabit Ethernet Adapter"
depends on SK98LIN
help
This driver supports:
- Allied Telesyn AT-2970SX Gigabit Ethernet Adapter
- Allied Telesyn AT-2970LX Gigabit Ethernet Adapter
- Allied Telesyn AT-2970TX Gigabit Ethernet Adapter
- Allied Telesyn AT-2971SX Gigabit Ethernet Adapter
- Allied Telesyn AT-2971T Gigabit Ethernet Adapter
- Allied Telesyn AT-2970SX/2SC Gigabit Ethernet Adapter
- Allied Telesyn AT-2970LX/2SC Gigabit Ethernet Adapter
- Allied Telesyn AT-2970TX/2TX Gigabit Ethernet Adapter
Questions concerning this driver may be addressed to:
linux@syskonnect.de
config CONFIG_SK98LIN_T3
bool "CNet N-Way Gigabit Ethernet Adapter"
depends on SK98LIN
help
This driver supports:
- N-Way PCI-Bus Giga-Card 1000/100/10Mbps(L)
Questions concerning this driver may be addressed to:
linux@syskonnect.de
config CONFIG_SK98LIN_T4
bool "D-Link DGE-530T Gigabit Ethernet Adapter"
depends on SK98LIN
help
This driver supports:
- DGE-530T Gigabit Ethernet Adapter
Questions concerning this driver may be addressed to:
linux@syskonnect.de
config CONFIG_SK98LIN_T5
bool "Linksys EG10xx Ethernet Server Adapter"
depends on SK98LIN
help
This driver supports:
- EG1032 v2 Instant Gigabit Network Adapter
- EG1064 v2 Instant Gigabit Network Adapter
Questions concerning this driver may be addressed to:
linux@syskonnect.de
config CONFIG_SK98LIN_T6
bool "Marvell RDK-80xx Adapter"
depends on SK98LIN
help
This driver supports:
- Marvell RDK-8001 Adapter
- Marvell RDK-8002 Adapter
- Marvell RDK-8003 Adapter
- Marvell RDK-8004 Adapter
- Marvell RDK-8006 Adapter
- Marvell RDK-8007 Adapter
- Marvell RDK-8008 Adapter
- Marvell RDK-8009 Adapter
- Marvell RDK-8011 Adapter
- Marvell RDK-8012 Adapter
Questions concerning this driver may be addressed to:
linux@syskonnect.de
config CONFIG_SK98LIN_T7
bool "Marvell Yukon Gigabit Ethernet Adapter"
depends on SK98LIN
help
This driver supports:
- Marvell Yukon Gigabit Ethernet 10/100/1000Base-T Adapter
Questions concerning this driver may be addressed to:
linux@syskonnect.de
config CONFIG_SK98LIN_T8
bool "SysKonnect SK-98xx Server Gigabit Adapter"
depends on SK98LIN
help
This driver supports:
- SK-9821 Gigabit Ethernet Server Adapter (SK-NET GE-T)
- SK-9822 Gigabit Ethernet Server Adapter (SK-NET GE-T dual link)
- SK-9841 Gigabit Ethernet Server Adapter (SK-NET GE-LX)
- SK-9842 Gigabit Ethernet Server Adapter (SK-NET GE-LX dual link)
- SK-9843 Gigabit Ethernet Server Adapter (SK-NET GE-SX)
- SK-9844 Gigabit Ethernet Server Adapter (SK-NET GE-SX dual link)
- SK-9861 Gigabit Ethernet Server Adapter (SK-NET GE-SX Volition)
- SK-9862 Gigabit Ethernet Server Adapter (SK-NET GE-SX Volition dual link)
- SK-9871 Gigabit Ethernet Server Adapter (SK-NET GE-ZX)
- SK-9872 Gigabit Ethernet Server Adapter (SK-NET GE-ZX dual link)
Questions concerning this driver may be addressed to:
linux@syskonnect.de
config CONFIG_SK98LIN_T9
bool "SysKonnect SK-98xx V2.0 Gigabit Ethernet Adapter"
depends on SK98LIN
help
This driver supports:
- SK-9521 V2.0 10/100/1000Base-T Adapter
- SK-9821 V2.0 Gigabit Ethernet 10/100/1000Base-T Adapter
- SK-9841 V2.0 Gigabit Ethernet 1000Base-LX Adapter
- SK-9843 V2.0 Gigabit Ethernet 1000Base-SX Adapter
- SK-9851 V2.0 Gigabit Ethernet 1000Base-SX Adapter
- SK-9861 V2.0 Gigabit Ethernet 1000Base-SX Adapter
- SK-9871 V2.0 Gigabit Ethernet 1000Base-ZX Adapter
- SK-9521 10/100/1000Base-T Adapter
Questions concerning this driver may be addressed to:
linux@syskonnect.de
config TIGON3 config TIGON3
tristate "Broadcom Tigon3 support" tristate "Broadcom Tigon3 support"
depends on PCI depends on PCI
......
...@@ -21,11 +21,9 @@ config ARCNET ...@@ -21,11 +21,9 @@ config ARCNET
from <http://www.tldp.org/docs.html#howto>(even though ARCnet from <http://www.tldp.org/docs.html#howto>(even though ARCnet
is not really Ethernet). is not really Ethernet).
This driver is also available as a module ( = code which can be To compile this driver as a module, choose M here and read
inserted in and removed from the running kernel whenever you want). <file:Documentation/networking/net-modules.txt>. The module will
The module will be called arcnet. If you want to compile it as a be called arcnet.
module, say M here and read <file:Documentation/modules.txt> as well
as <file:Documentation/networking/net-modules.txt>.
config ARCNET_1201 config ARCNET_1201
tristate "Enable standard ARCNet packet format (RFC 1201)" tristate "Enable standard ARCNet packet format (RFC 1201)"
...@@ -69,11 +67,9 @@ config ARCNET_COM90xx ...@@ -69,11 +67,9 @@ config ARCNET_COM90xx
have always used the old ARCnet driver without knowing what type of have always used the old ARCnet driver without knowing what type of
card you had, this is probably the one for you. card you had, this is probably the one for you.
This driver is also available as a module ( = code which can be To compile this driver as a module, choose M here and read
inserted in and removed from the running kernel whenever you want). <file:Documentation/networking/net-modules.txt>. The module will
The module will be called com90xx. If you want to compile it as a be called com90xx.
module, say M here and read <file:Documentation/modules.txt> as well
as <file:Documentation/networking/net-modules.txt>.
config ARCNET_COM90xxIO config ARCNET_COM90xxIO
tristate "ARCnet COM90xx (IO mapped) chipset driver" tristate "ARCnet COM90xx (IO mapped) chipset driver"
...@@ -84,11 +80,9 @@ config ARCNET_COM90xxIO ...@@ -84,11 +80,9 @@ config ARCNET_COM90xxIO
the normal driver. Only use it if your card doesn't support shared the normal driver. Only use it if your card doesn't support shared
memory. memory.
This driver is also available as a module ( = code which can be To compile this driver as a module, choose M here and read
inserted in and removed from the running kernel whenever you want). <file:Documentation/networking/net-modules.txt>. The module will
The module will be called com90io. If you want to compile it as a be called com90io.
module, say M here and read <file:Documentation/modules.txt> as well
as <file:Documentation/networking/net-modules.txt>.
config ARCNET_RIM_I config ARCNET_RIM_I
tristate "ARCnet COM90xx (RIM I) chipset driver" tristate "ARCnet COM90xx (RIM I) chipset driver"
...@@ -99,11 +93,9 @@ config ARCNET_RIM_I ...@@ -99,11 +93,9 @@ config ARCNET_RIM_I
driver is completely untested, so if you have one of these cards, driver is completely untested, so if you have one of these cards,
please mail dwmw2@infradead.org, especially if it works! please mail dwmw2@infradead.org, especially if it works!
This driver is also available as a module ( = code which can be To compile this driver as a module, choose M here and read
inserted in and removed from the running kernel whenever you <file:Documentation/networking/net-modules.txt>. The module will
want). The module will be called arc-rimi. If you want to compile be called arc-rimi.
it as a module, say M here and read <file:Documentation/modules.txt>
as well as <file:Documentation/networking/net-modules.txt>.
config ARCNET_COM20020 config ARCNET_COM20020
tristate "ARCnet COM20020 chipset driver" tristate "ARCnet COM20020 chipset driver"
...@@ -113,11 +105,9 @@ config ARCNET_COM20020 ...@@ -113,11 +105,9 @@ config ARCNET_COM20020
things as promiscuous mode, so packet sniffing is possible, and things as promiscuous mode, so packet sniffing is possible, and
extra diagnostic information. extra diagnostic information.
This driver is also available as a module ( = code which can be To compile this driver as a module, choose M here and read
inserted in and removed from the running kernel whenever you want). <file:Documentation/networking/net-modules.txt>. The module will
The module will be called com20020. If you want to compile it as be called com20020.
a module, say M here and read <file:Documentation/modules.txt> as
well as <file:Documentation/networking/net-modules.txt>.
config ARCNET_COM20020_ISA config ARCNET_COM20020_ISA
tristate "Support for COM20020 on ISA" tristate "Support for COM20020 on ISA"
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
* *
* Name: skdrv1st.h * Name: skdrv1st.h
* Project: GEnesis, PCI Gigabit Ethernet Adapter * Project: GEnesis, PCI Gigabit Ethernet Adapter
* Version: $Revision: 1.15 $ * Version: $Revision: 1.1 $
* Date: $Date: 2003/07/17 14:54:09 $ * Date: $Date: 2003/07/21 07:22:43 $
* Purpose: First header file for driver and all other modules * Purpose: First header file for driver and all other modules
* *
******************************************************************************/ ******************************************************************************/
...@@ -26,6 +26,9 @@ ...@@ -26,6 +26,9 @@
* History: * History:
* *
* $Log: skdrv1st.h,v $ * $Log: skdrv1st.h,v $
* Revision 1.1 2003/07/21 07:22:43 rroesler
* Fix: Re-Enter after CVS crash
*
* Revision 1.15 2003/07/17 14:54:09 rroesler * Revision 1.15 2003/07/17 14:54:09 rroesler
* Fix: Corrected SK_PNMI_READ macros to copy right amount of bytes * Fix: Corrected SK_PNMI_READ macros to copy right amount of bytes
* *
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
* *
* Name: skdrv2nd.h * Name: skdrv2nd.h
* Project: GEnesis, PCI Gigabit Ethernet Adapter * Project: GEnesis, PCI Gigabit Ethernet Adapter
* Version: $Revision: 1.19 $ * Version: $Revision: 1.3 $
* Date: $Date: 2003/07/07 09:53:10 $ * Date: $Date: 2003/08/12 16:51:18 $
* Purpose: Second header file for driver and all other modules * Purpose: Second header file for driver and all other modules
* *
******************************************************************************/ ******************************************************************************/
...@@ -26,6 +26,16 @@ ...@@ -26,6 +26,16 @@
* History: * History:
* *
* $Log: skdrv2nd.h,v $ * $Log: skdrv2nd.h,v $
* Revision 1.3 2003/08/12 16:51:18 mlindner
* Fix: UDP and TCP Proto checks
* Fix: UDP header offset
*
* Revision 1.2 2003/08/07 10:50:54 mlindner
* Add: Speed and HW-Csum support for Yukon Lite chipset
*
* Revision 1.1 2003/07/21 07:25:29 rroesler
* Fix: Re-Enter after CVS crash
*
* Revision 1.19 2003/07/07 09:53:10 rroesler * Revision 1.19 2003/07/07 09:53:10 rroesler
* Fix: Removed proprietary RxTx defines and used the ones from skgehw.h instead * Fix: Removed proprietary RxTx defines and used the ones from skgehw.h instead
* *
...@@ -315,12 +325,13 @@ struct s_IOCTL { ...@@ -315,12 +325,13 @@ struct s_IOCTL {
#define C_OFFSET_IPHEADER C_LEN_ETHERMAC_HEADER #define C_OFFSET_IPHEADER C_LEN_ETHERMAC_HEADER
#define C_OFFSET_IPHEADER_IPPROTO 9 #define C_OFFSET_IPHEADER_IPPROTO 9
#define C_OFFSET_TCPHEADER_TCPCS 16 #define C_OFFSET_TCPHEADER_TCPCS 16
#define C_OFFSET_UDPHEADER_UDPCS 6
#define C_OFFSET_IPPROTO ( (C_LEN_ETHERMAC_HEADER) + \ #define C_OFFSET_IPPROTO ( (C_LEN_ETHERMAC_HEADER) + \
(C_OFFSET_IPHEADER_IPPROTO) ) (C_OFFSET_IPHEADER_IPPROTO) )
#define C_PROTO_ID_UDP 6 /* refer to RFC 790 or Stevens' */ #define C_PROTO_ID_UDP 17 /* refer to RFC 790 or Stevens' */
#define C_PROTO_ID_TCP 17 /* TCP/IP illustrated for details */ #define C_PROTO_ID_TCP 6 /* TCP/IP illustrated for details */
/* TX and RX descriptors *****************************************************/ /* TX and RX descriptors *****************************************************/
...@@ -390,6 +401,7 @@ struct s_TxD { ...@@ -390,6 +401,7 @@ struct s_TxD {
typedef struct s_DevNet DEV_NET; typedef struct s_DevNet DEV_NET;
struct s_DevNet { struct s_DevNet {
struct proc_dir_entry *proc;
int PortNr; int PortNr;
int NetNr; int NetNr;
int Mtu; int Mtu;
...@@ -550,6 +562,10 @@ struct s_AC { ...@@ -550,6 +562,10 @@ struct s_AC {
/* Only for tests */ /* Only for tests */
int PortUp; int PortUp;
int PortDown; int PortDown;
int ChipsetType; /* Chipset family type
* 0 == Genesis family support
* 1 == Yukon family support
*/
}; };
......
...@@ -722,15 +722,14 @@ typedef struct s_GeInit { ...@@ -722,15 +722,14 @@ typedef struct s_GeInit {
/* /*
* Error numbers and messages for skxmac2.c and skgeinit.c * Error numbers and messages for skxmac2.c and skgeinit.c
*/ */
#define SKERR_HWI_E001 (SK_ERRBASE_HWINIT) #define SKERR_HWI_E001 (SK_ERRBASE_HWINIT)
#define SKERR_HWI_E001MSG "SkXmClrExactAddr() has got invalid parameters" #define SKERR_HWI_E001MSG "SkXmClrExactAddr() has got illegal parameters"
#define SKERR_HWI_E002 (SKERR_HWI_E001+1) #define SKERR_HWI_E002 (SKERR_HWI_E001+1)
#define SKERR_HWI_E002MSG "SkGeInit(): Level 1 call missing" #define SKERR_HWI_E002MSG "SkGeInit(): Level 1 call missing"
#define SKERR_HWI_E003 (SKERR_HWI_E002+1) #define SKERR_HWI_E003 (SKERR_HWI_E002+1)
#define SKERR_HWI_E003MSG "SkGeInit() called with invalid init Level" #define SKERR_HWI_E003MSG "SkGeInit() called with illegal init Level"
#define SKERR_HWI_E004 (SKERR_HWI_E003+1) #define SKERR_HWI_E004 (SKERR_HWI_E003+1)
#define SKERR_HWI_E004MSG "SkGeInitPort(): Queue Size invalid configured" #define SKERR_HWI_E004MSG "SkGeInitPort(): Queue Size illegal configured"
#define SKERR_HWI_E005 (SKERR_HWI_E004+1) #define SKERR_HWI_E005 (SKERR_HWI_E004+1)
#define SKERR_HWI_E005MSG "SkGeInitPort(): cannot init running ports" #define SKERR_HWI_E005MSG "SkGeInitPort(): cannot init running ports"
#define SKERR_HWI_E006 (SKERR_HWI_E005+1) #define SKERR_HWI_E006 (SKERR_HWI_E005+1)
...@@ -752,21 +751,21 @@ typedef struct s_GeInit { ...@@ -752,21 +751,21 @@ typedef struct s_GeInit {
#define SKERR_HWI_E014 (SKERR_HWI_E013+1) #define SKERR_HWI_E014 (SKERR_HWI_E013+1)
#define SKERR_HWI_E014MSG "SkGeInitPort(): unknown GIPortUsage specified" #define SKERR_HWI_E014MSG "SkGeInitPort(): unknown GIPortUsage specified"
#define SKERR_HWI_E015 (SKERR_HWI_E014+1) #define SKERR_HWI_E015 (SKERR_HWI_E014+1)
#define SKERR_HWI_E015MSG "Invalid Link mode parameter" #define SKERR_HWI_E015MSG "Illegal Link mode parameter"
#define SKERR_HWI_E016 (SKERR_HWI_E015+1) #define SKERR_HWI_E016 (SKERR_HWI_E015+1)
#define SKERR_HWI_E016MSG "Invalid Flow control mode parameter" #define SKERR_HWI_E016MSG "Illegal Flow control mode parameter"
#define SKERR_HWI_E017 (SKERR_HWI_E016+1) #define SKERR_HWI_E017 (SKERR_HWI_E016+1)
#define SKERR_HWI_E017MSG "Invalid value specified for GIPollTimerVal" #define SKERR_HWI_E017MSG "Illegal value specified for GIPollTimerVal"
#define SKERR_HWI_E018 (SKERR_HWI_E017+1) #define SKERR_HWI_E018 (SKERR_HWI_E017+1)
#define SKERR_HWI_E018MSG "FATAL: SkGeStopPort() does not terminate (Tx)" #define SKERR_HWI_E018MSG "FATAL: SkGeStopPort() does not terminate (Tx)"
#define SKERR_HWI_E019 (SKERR_HWI_E018+1) #define SKERR_HWI_E019 (SKERR_HWI_E018+1)
#define SKERR_HWI_E019MSG "Invalid Speed parameter" #define SKERR_HWI_E019MSG "Illegal Speed parameter"
#define SKERR_HWI_E020 (SKERR_HWI_E019+1) #define SKERR_HWI_E020 (SKERR_HWI_E019+1)
#define SKERR_HWI_E020MSG "Invalid Master/Slave parameter" #define SKERR_HWI_E020MSG "Illegal Master/Slave parameter"
#define SKERR_HWI_E021 (SKERR_HWI_E020+1) #define SKERR_HWI_E021 (SKERR_HWI_E020+1)
#define SKERR_HWI_E021MSG "MacUpdateStats(): cannot update statistic counter" #define SKERR_HWI_E021MSG "MacUpdateStats(): cannot update statistic counter"
#define SKERR_HWI_E022 (SKERR_HWI_E021+1) #define SKERR_HWI_E022 (SKERR_HWI_E021+1)
#define SKERR_HWI_E022MSG "MacStatistic(): invalid statistic base address" #define SKERR_HWI_E022MSG "MacStatistic(): illegal statistic base address"
#define SKERR_HWI_E023 (SKERR_HWI_E022+1) #define SKERR_HWI_E023 (SKERR_HWI_E022+1)
#define SKERR_HWI_E023MSG "SkGeInitPort(): Transmit Queue Size too small" #define SKERR_HWI_E023MSG "SkGeInitPort(): Transmit Queue Size too small"
#define SKERR_HWI_E024 (SKERR_HWI_E023+1) #define SKERR_HWI_E024 (SKERR_HWI_E023+1)
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
* *
* Name: sktypes.h * Name: sktypes.h
* Project: GEnesis, PCI Gigabit Ethernet Adapter * Project: GEnesis, PCI Gigabit Ethernet Adapter
* Version: $Revision: 1.3 $ * Version: $Revision: 1.1 $
* Date: $Date: 2003/02/25 14:16:40 $ * Date: $Date: 2003/07/21 07:26:01 $
* Purpose: Define data types for Linux * Purpose: Define data types for Linux
* *
******************************************************************************/ ******************************************************************************/
...@@ -26,6 +26,9 @@ ...@@ -26,6 +26,9 @@
* History: * History:
* *
* $Log: sktypes.h,v $ * $Log: sktypes.h,v $
* Revision 1.1 2003/07/21 07:26:01 rroesler
* Fix: Re-Enter after CVS crash
*
* Revision 1.3 2003/02/25 14:16:40 mlindner * Revision 1.3 2003/02/25 14:16:40 mlindner
* Fix: Copyright statement * Fix: Copyright statement
* *
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
* *
* Name: version.h * Name: version.h
* Project: GEnesis, PCI Gigabit Ethernet Adapter * Project: GEnesis, PCI Gigabit Ethernet Adapter
* Version: $Revision: 1.4 $ * Version: $Revision: 1.3 $
* Date: $Date: 2003/02/25 14:16:40 $ * Date: $Date: 2003/08/25 13:34:48 $
* Purpose: SK specific Error log support * Purpose: SK specific Error log support
* *
******************************************************************************/ ******************************************************************************/
...@@ -25,6 +25,15 @@ ...@@ -25,6 +25,15 @@
* *
* History: * History:
* $Log: skversion.h,v $ * $Log: skversion.h,v $
* Revision 1.3 2003/08/25 13:34:48 mlindner
* Fix: Lint changes
*
* Revision 1.2 2003/08/13 12:01:01 mlindner
* Add: Changes for Lint
*
* Revision 1.1 2003/07/24 09:29:56 rroesler
* Fix: Re-Enter after CVS crash
*
* Revision 1.4 2003/02/25 14:16:40 mlindner * Revision 1.4 2003/02/25 14:16:40 mlindner
* Fix: Copyright statement * Fix: Copyright statement
* *
...@@ -42,13 +51,15 @@ ...@@ -42,13 +51,15 @@
******************************************************************************/ ******************************************************************************/
#ifdef lint
static const char SysKonnectFileId[] = "@(#) (C) SysKonnect GmbH."; static const char SysKonnectFileId[] = "@(#) (C) SysKonnect GmbH.";
static const char SysKonnectBuildNumber[] = static const char SysKonnectBuildNumber[] =
"@(#)SK-BUILD: 6.14 PL: 01"; "@(#)SK-BUILD: 6.18 PL: 01";
#endif /* !defined(lint) */
#define BOOT_STRING "sk98lin: Network Device Driver v6.14\n" \ #define BOOT_STRING "sk98lin: Network Device Driver v6.18\n" \
"(C)Copyright 1999-2003 Marvell(R)." "(C)Copyright 1999-2003 Marvell(R)."
#define VER_STRING "6.14" #define VER_STRING "6.18"
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
* *
* Name: skdim.c * Name: skdim.c
* Project: GEnesis, PCI Gigabit Ethernet Adapter * Project: GEnesis, PCI Gigabit Ethernet Adapter
* Version: $Revision: 1.4 $ * Version: $Revision: 1.2 $
* Date: $Date: 2003/07/07 09:45:47 $ * Date: $Date: 2003/08/21 12:35:05 $
* Purpose: All functions to maintain interrupt moderation * Purpose: All functions to maintain interrupt moderation
* *
******************************************************************************/ ******************************************************************************/
...@@ -26,6 +26,12 @@ ...@@ -26,6 +26,12 @@
* History: * History:
* *
* $Log: skdim.c,v $ * $Log: skdim.c,v $
* Revision 1.2 2003/08/21 12:35:05 mlindner
* Fix: Corrected CPU detection and compile errors on single CPU machines
*
* Revision 1.1 2003/07/18 13:39:55 rroesler
* Fix: Re-enter after CVS crash
*
* Revision 1.4 2003/07/07 09:45:47 rroesler * Revision 1.4 2003/07/07 09:45:47 rroesler
* Fix: Compiler warnings corrected * Fix: Compiler warnings corrected
* *
...@@ -56,7 +62,7 @@ ...@@ -56,7 +62,7 @@
#ifndef lint #ifndef lint
static const char SysKonnectFileId[] = static const char SysKonnectFileId[] =
"@(#) $Id: skdim.c,v 1.4 2003/07/07 09:45:47 rroesler Exp $ (C) SysKonnect."; "@(#) $Id: skdim.c,v 1.2 2003/08/21 12:35:05 mlindner Exp $ (C) SysKonnect.";
#endif #endif
#define __SKADDR_C #define __SKADDR_C
...@@ -312,6 +318,12 @@ GetCurrentSystemLoad(SK_AC *pAC) { ...@@ -312,6 +318,12 @@ GetCurrentSystemLoad(SK_AC *pAC) {
unsigned int TotalTime = 0; unsigned int TotalTime = 0;
unsigned int UsedTime = 0; unsigned int UsedTime = 0;
unsigned int SystemLoad = 0; unsigned int SystemLoad = 0;
#ifdef CONFIG_SMP
unsigned int SKNumCpus = smp_num_cpus;
#else
unsigned int SKNumCpus = 1;
#endif
/* unsigned int NbrCpu = 0; */ /* unsigned int NbrCpu = 0; */
/* /*
......
/****************************************************************************** /******************************************************************************
* *
* Name: skge.c * Name: skge.c
* Project: GEnesis, PCI Gigabit Ethernet Adapter * Project: GEnesis, PCI Gigabit Ethernet Adapter
* Version: $Revision: 1.63 $ * Version: $Revision: 1.11 $
* Date: $Date: 2003/07/15 09:26:23 $ * Date: $Date: 2003/08/26 16:05:19 $
* Purpose: The main driver source module * Purpose: The main driver source module
* *
******************************************************************************/ ******************************************************************************/
...@@ -57,6 +56,52 @@ ...@@ -57,6 +56,52 @@
* History: * History:
* *
* $Log: skge.c,v $ * $Log: skge.c,v $
* Revision 1.16 2003/09/23 11:07:35 mlindner
* Fix: IO-control return race condition
* Fix: Interrupt moderation value check
*
* Revision 1.15 2003/09/22 08:40:05 mlindner
* Add: Added DRIVER_FILE_NAME and DRIVER_REL_DATE
*
* Revision 1.14 2003/09/22 08:11:10 mlindner
* Add: New function for PCI initialization (SkGeInitPCI)
* Add: Yukon Plus changes (ChipID, PCI...)
* Fix: TCP and UDP Checksum calculation
*
* Revision 1.11 2003/08/26 16:05:19 mlindner
* Fix: Compiler warnings (void *)
*
* Revision 1.10 2003/08/25 09:24:08 mlindner
* Add: Dynamic Interrupt Moderation (DIM) port up message
*
* Revision 1.9 2003/08/21 14:09:43 mlindner
* Fix: Disable Half Duplex with Gigabit-Speed (Yukon). Enable Full Duplex.
*
* Revision 1.8 2003/08/19 15:09:18 mlindner
* Fix: Ignore ConType parameter if empty value
*
* Revision 1.7 2003/08/13 12:00:35 mlindner
* Fix: Removed useless defines
*
* Revision 1.6 2003/08/12 16:49:41 mlindner
* Fix: UDP and TCP HW-CSum calculation (Kernel 2.5/2.6)
* Fix: UDP and TCP Proto checks
* Fix: Build without ProcFS
* Fix: Kernel 2.6 editorial changes
*
* Revision 1.5 2003/08/07 12:25:07 mlindner
* Fix: ConType parameter check and error detection
* Fix: Insert various fixes applied to the kernel tree
*
* Revision 1.4 2003/08/07 10:50:21 mlindner
* Add: Speed and HW-Csum support for Yukon Lite chipset
*
* Revision 1.3 2003/08/06 11:24:08 mlindner
* Add: Kernel updates
*
* Revision 1.2 2003/07/21 08:28:47 rroesler
* Fix: Handle padded bytes using skb_put()
*
* Revision 1.63 2003/07/15 09:26:23 rroesler * Revision 1.63 2003/07/15 09:26:23 rroesler
* Fix: Removed memory leak when sending short padded frames * Fix: Removed memory leak when sending short padded frames
* *
...@@ -361,6 +406,7 @@ ...@@ -361,6 +406,7 @@
* <linux/module.h> * <linux/module.h>
* *
* "h/skdrv1st.h" * "h/skdrv1st.h"
* <linux/version.h>
* <linux/types.h> * <linux/types.h>
* <linux/kernel.h> * <linux/kernel.h>
* <linux/string.h> * <linux/string.h>
...@@ -407,7 +453,10 @@ ...@@ -407,7 +453,10 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/init.h> #include <linux/init.h>
#ifdef CONFIG_PROC_FS
#include <linux/proc_fs.h> #include <linux/proc_fs.h>
#endif
#include "h/skdrv1st.h" #include "h/skdrv1st.h"
#include "h/skdrv2nd.h" #include "h/skdrv2nd.h"
...@@ -514,6 +563,7 @@ static void ClearTxRing(SK_AC*, TX_PORT*); ...@@ -514,6 +563,7 @@ static void ClearTxRing(SK_AC*, TX_PORT*);
static int SkGeChangeMtu(struct SK_NET_DEVICE *dev, int new_mtu); static int SkGeChangeMtu(struct SK_NET_DEVICE *dev, int new_mtu);
static void PortReInitBmu(SK_AC*, int); static void PortReInitBmu(SK_AC*, int);
static int SkGeIocMib(DEV_NET*, unsigned int, int); static int SkGeIocMib(DEV_NET*, unsigned int, int);
static int SkGeInitPCI(SK_AC *pAC);
static void StartDrvCleanupTimer(SK_AC *pAC); static void StartDrvCleanupTimer(SK_AC *pAC);
static void StopDrvCleanupTimer(SK_AC *pAC); static void StopDrvCleanupTimer(SK_AC *pAC);
static int XmitFrameSG(SK_AC*, TX_PORT*, struct sk_buff*); static int XmitFrameSG(SK_AC*, TX_PORT*, struct sk_buff*);
...@@ -524,14 +574,17 @@ static int XmitFrameSG(SK_AC*, TX_PORT*, struct sk_buff*); ...@@ -524,14 +574,17 @@ static int XmitFrameSG(SK_AC*, TX_PORT*, struct sk_buff*);
* *
******************************************************************************/ ******************************************************************************/
#ifdef CONFIG_PROC_FS
static const char SK_Root_Dir_entry[] = "sk98lin"; static const char SK_Root_Dir_entry[] = "sk98lin";
static struct proc_dir_entry *pSkRootDir; static struct proc_dir_entry *pSkRootDir;
extern int sk_proc_read( char *buffer, extern int sk_proc_read( char *buffer,
char **buffer_location, char **buffer_location,
off_t offset, off_t offset,
int buffer_length, int buffer_length,
int *eof, int *eof,
void *data); void *data);
#endif
extern void SkDimEnableModerationIfNeeded(SK_AC *pAC); extern void SkDimEnableModerationIfNeeded(SK_AC *pAC);
extern void SkDimDisplayModerationSettings(SK_AC *pAC); extern void SkDimDisplayModerationSettings(SK_AC *pAC);
...@@ -554,7 +607,10 @@ static uintptr_t TxQueueAddr[SK_MAX_MACS][2] = {{0x680, 0x600},{0x780, 0x700}}; ...@@ -554,7 +607,10 @@ static uintptr_t TxQueueAddr[SK_MAX_MACS][2] = {{0x680, 0x600},{0x780, 0x700}};
static uintptr_t RxQueueAddr[SK_MAX_MACS] = {0x400, 0x480}; static uintptr_t RxQueueAddr[SK_MAX_MACS] = {0x400, 0x480};
#ifdef CONFIG_PROC_FS
static struct proc_dir_entry *pSkRootDir; static struct proc_dir_entry *pSkRootDir;
#endif
/***************************************************************************** /*****************************************************************************
...@@ -572,17 +628,19 @@ static struct proc_dir_entry *pSkRootDir; ...@@ -572,17 +628,19 @@ static struct proc_dir_entry *pSkRootDir;
*/ */
static int __init skge_probe (void) static int __init skge_probe (void)
{ {
int proc_root_initialized = 0;
int boards_found = 0; int boards_found = 0;
int vendor_flag = SK_FALSE; int vendor_flag = SK_FALSE;
SK_AC *pAC; SK_AC *pAC;
DEV_NET *pNet = NULL; DEV_NET *pNet = NULL;
struct proc_dir_entry *pProcFile;
struct pci_dev *pdev = NULL; struct pci_dev *pdev = NULL;
unsigned long base_address;
struct SK_NET_DEVICE *dev = NULL; struct SK_NET_DEVICE *dev = NULL;
SK_BOOL DeviceFound = SK_FALSE; SK_BOOL DeviceFound = SK_FALSE;
SK_BOOL BootStringCount = SK_FALSE; SK_BOOL BootStringCount = SK_FALSE;
int retval;
#ifdef CONFIG_PROC_FS
int proc_root_initialized = 0;
struct proc_dir_entry *pProcFile;
#endif
if (probed) if (probed)
return -ENODEV; return -ENODEV;
...@@ -603,7 +661,7 @@ static int __init skge_probe (void) ...@@ -603,7 +661,7 @@ static int __init skge_probe (void)
continue; continue;
/* Configure DMA attributes. */ /* Configure DMA attributes. */
if (pci_set_dma_mask(pdev, (u64) 0xffffffffffffffff) && if (pci_set_dma_mask(pdev, (u64) 0xffffffffffffffffULL) &&
pci_set_dma_mask(pdev, (u64) 0xffffffff)) pci_set_dma_mask(pdev, (u64) 0xffffffff))
continue; continue;
...@@ -623,6 +681,8 @@ static int __init skge_probe (void) ...@@ -623,6 +681,8 @@ static int __init skge_probe (void)
pNet = dev->priv; pNet = dev->priv;
pNet->pAC = kmalloc(sizeof(SK_AC), GFP_KERNEL); pNet->pAC = kmalloc(sizeof(SK_AC), GFP_KERNEL);
if (pNet->pAC == NULL){ if (pNet->pAC == NULL){
dev->get_stats = NULL;
unregister_netdev(dev);
kfree(dev->priv); kfree(dev->priv);
printk(KERN_ERR "Unable to allocate adapter " printk(KERN_ERR "Unable to allocate adapter "
"structure!\n"); "structure!\n");
...@@ -649,6 +709,14 @@ static int __init skge_probe (void) ...@@ -649,6 +709,14 @@ static int __init skge_probe (void)
pNet->Mtu = 1500; pNet->Mtu = 1500;
pNet->Up = 0; pNet->Up = 0;
dev->irq = pdev->irq; dev->irq = pdev->irq;
retval = SkGeInitPCI(pAC);
if (retval) {
printk("SKGE: PCI setup failed: %i\n", retval);
dev->get_stats = NULL;
unregister_netdev(dev);
kfree(dev);
continue;
}
SET_MODULE_OWNER(dev); SET_MODULE_OWNER(dev);
dev->open = &SkGeOpen; dev->open = &SkGeOpen;
...@@ -664,7 +732,7 @@ static int __init skge_probe (void) ...@@ -664,7 +732,7 @@ static int __init skge_probe (void)
#ifdef SK_ZEROCOPY #ifdef SK_ZEROCOPY
#ifdef USE_SK_TX_CHECKSUM #ifdef USE_SK_TX_CHECKSUM
if (pAC->GIni.GIChipId == CHIP_ID_YUKON) { if (pAC->ChipsetType) {
/* Use only if yukon hardware */ /* Use only if yukon hardware */
/* SK and ZEROCOPY - fly baby... */ /* SK and ZEROCOPY - fly baby... */
dev->features |= NETIF_F_SG | NETIF_F_IP_CSUM; dev->features |= NETIF_F_SG | NETIF_F_IP_CSUM;
...@@ -672,41 +740,6 @@ static int __init skge_probe (void) ...@@ -672,41 +740,6 @@ static int __init skge_probe (void)
#endif #endif
#endif #endif
/*
* Dummy value.
*/
dev->base_addr = 42;
pci_set_master(pdev);
pci_set_master(pdev);
base_address = pci_resource_start (pdev, 0);
#ifdef SK_BIG_ENDIAN
/*
* On big endian machines, we use the adapter's aibility of
* reading the descriptors as big endian.
*/
{
SK_U32 our2;
SkPciReadCfgDWord(pAC, PCI_OUR_REG_2, &our2);
our2 |= PCI_REV_DESC;
SkPciWriteCfgDWord(pAC, PCI_OUR_REG_2, our2);
}
#endif
/*
* Remap the regs into kernel space.
*/
pAC->IoBase = (char*)ioremap(base_address, 0x4000);
if (!pAC->IoBase){
printk(KERN_ERR "%s: Unable to map I/O register, "
"SK 98xx No. %i will be disabled.\n",
dev->name, boards_found);
kfree(dev);
break;
}
pAC->Index = boards_found; pAC->Index = boards_found;
if (SkGeBoardInit(dev, pAC)) { if (SkGeBoardInit(dev, pAC)) {
FreeResources(dev); FreeResources(dev);
...@@ -718,6 +751,7 @@ static int __init skge_probe (void) ...@@ -718,6 +751,7 @@ static int __init skge_probe (void)
(caddr_t) &pAC->Addr.Net[0].CurrentMacAddress, 6); (caddr_t) &pAC->Addr.Net[0].CurrentMacAddress, 6);
/* First adapter... Create proc and print message */ /* First adapter... Create proc and print message */
#ifdef CONFIG_PROC_FS
if (!DeviceFound) { if (!DeviceFound) {
DeviceFound = SK_TRUE; DeviceFound = SK_TRUE;
SK_MEMCPY(&SK_Root_Dir_entry, BootString, SK_MEMCPY(&SK_Root_Dir_entry, BootString,
...@@ -730,11 +764,8 @@ static int __init skge_probe (void) ...@@ -730,11 +764,8 @@ static int __init skge_probe (void)
pSkRootDir->owner = THIS_MODULE; pSkRootDir->owner = THIS_MODULE;
proc_root_initialized = 1; proc_root_initialized = 1;
} }
} }
/* Create proc file */ /* Create proc file */
pProcFile = create_proc_entry(dev->name, pProcFile = create_proc_entry(dev->name,
S_IFREG | S_IXUSR | S_IWGRP | S_IROTH, S_IFREG | S_IXUSR | S_IWGRP | S_IROTH,
...@@ -747,13 +778,15 @@ static int __init skge_probe (void) ...@@ -747,13 +778,15 @@ static int __init skge_probe (void)
pProcFile->size = sizeof(dev->name + 1); pProcFile->size = sizeof(dev->name + 1);
pProcFile->data = (void *)pProcFile; pProcFile->data = (void *)pProcFile;
pProcFile->owner = THIS_MODULE; pProcFile->owner = THIS_MODULE;
#endif
pNet->PortNr = 0; pNet->PortNr = 0;
pNet->NetNr = 0; pNet->NetNr = 0;
#ifdef SK_ZEROCOPY #ifdef SK_ZEROCOPY
#ifdef USE_SK_TX_CHECKSUM #ifdef USE_SK_TX_CHECKSUM
if (pAC->GIni.GIChipId == CHIP_ID_YUKON) { if (pAC->ChipsetType) {
/* SG and ZEROCOPY - fly baby... */ /* SG and ZEROCOPY - fly baby... */
dev->features |= NETIF_F_SG | NETIF_F_IP_CSUM; dev->features |= NETIF_F_SG | NETIF_F_IP_CSUM;
} }
...@@ -790,13 +823,14 @@ static int __init skge_probe (void) ...@@ -790,13 +823,14 @@ static int __init skge_probe (void)
#ifdef SK_ZEROCOPY #ifdef SK_ZEROCOPY
#ifdef USE_SK_TX_CHECKSUM #ifdef USE_SK_TX_CHECKSUM
if (pAC->GIni.GIChipId == CHIP_ID_YUKON) { if (pAC->ChipsetType) {
/* SG and ZEROCOPY - fly baby... */ /* SG and ZEROCOPY - fly baby... */
dev->features |= NETIF_F_SG | NETIF_F_IP_CSUM; dev->features |= NETIF_F_SG | NETIF_F_IP_CSUM;
} }
#endif #endif
#endif #endif
#ifdef CONFIG_PROC_FS
pProcFile = create_proc_entry(dev->name, pProcFile = create_proc_entry(dev->name,
S_IFREG | S_IXUSR | S_IWGRP | S_IROTH, S_IFREG | S_IXUSR | S_IWGRP | S_IROTH,
pSkRootDir); pSkRootDir);
...@@ -808,6 +842,7 @@ static int __init skge_probe (void) ...@@ -808,6 +842,7 @@ static int __init skge_probe (void)
pProcFile->size = sizeof(dev->name + 1); pProcFile->size = sizeof(dev->name + 1);
pProcFile->data = (void *)pProcFile; pProcFile->data = (void *)pProcFile;
pProcFile->owner = THIS_MODULE; pProcFile->owner = THIS_MODULE;
#endif
memcpy((caddr_t) &dev->dev_addr, memcpy((caddr_t) &dev->dev_addr,
(caddr_t) &pAC->Addr.Net[1].CurrentMacAddress, 6); (caddr_t) &pAC->Addr.Net[1].CurrentMacAddress, 6);
...@@ -841,6 +876,68 @@ static int __init skge_probe (void) ...@@ -841,6 +876,68 @@ static int __init skge_probe (void)
} /* skge_probe */ } /* skge_probe */
/*****************************************************************************
*
* SkGeInitPCI - Init the PCI resources
*
* Description:
* This function initialize the PCI resources and IO
*
* Returns: N/A
*
*/
int SkGeInitPCI(SK_AC *pAC)
{
struct SK_NET_DEVICE *dev = pAC->dev[0];
struct pci_dev *pdev = pAC->PciDev;
int retval;
if (pci_enable_device(pdev) != 0) {
return 1;
}
dev->mem_start = pci_resource_start (pdev, 0);
pci_set_master(pdev);
if (pci_request_regions(pdev, pAC->Name) != 0) {
retval = 2;
goto out_disable;
}
#ifdef SK_BIG_ENDIAN
/*
* On big endian machines, we use the adapter's aibility of
* reading the descriptors as big endian.
*/
{
SK_U32 our2;
SkPciReadCfgDWord(pAC, PCI_OUR_REG_2, &our2);
our2 |= PCI_REV_DESC;
SkPciWriteCfgDWord(pAC, PCI_OUR_REG_2, our2);
}
#endif
/*
* Remap the regs into kernel space.
*/
pAC->IoBase = (char*)ioremap_nocache(dev->mem_start, 0x4000);
if (!pAC->IoBase){
retval = 3;
goto out_release;
}
return 0;
out_release:
pci_release_regions(pdev);
out_disable:
pci_disable_device(pdev);
return retval;
}
/***************************************************************************** /*****************************************************************************
* *
* FreeResources - release resources allocated for adapter * FreeResources - release resources allocated for adapter
...@@ -862,6 +959,9 @@ SK_AC *pAC; ...@@ -862,6 +959,9 @@ SK_AC *pAC;
pNet = (DEV_NET*) dev->priv; pNet = (DEV_NET*) dev->priv;
pAC = pNet->pAC; pAC = pNet->pAC;
AllocFlag = pAC->AllocFlag; AllocFlag = pAC->AllocFlag;
if (pAC->PciDev) {
pci_release_regions(pAC->PciDev);
}
if (AllocFlag & SK_ALLOC_IRQ) { if (AllocFlag & SK_ALLOC_IRQ) {
free_irq(dev->irq, dev); free_irq(dev->irq, dev);
} }
...@@ -1086,8 +1186,10 @@ SK_EVPARA EvPara; ...@@ -1086,8 +1186,10 @@ SK_EVPARA EvPara;
SkGeRootDev = next; SkGeRootDev = next;
} }
#ifdef CONFIG_PROC_FS
/* clear proc-dir */ /* clear proc-dir */
remove_proc_entry(pSkRootDir->name, proc_net); remove_proc_entry(pSkRootDir->name, proc_net);
#endif
} /* skge_cleanup_module */ } /* skge_cleanup_module */
...@@ -1171,6 +1273,13 @@ SK_BOOL DualNet; ...@@ -1171,6 +1273,13 @@ SK_BOOL DualNet;
SkRlmtInit( pAC, pAC->IoBase, SK_INIT_IO); SkRlmtInit( pAC, pAC->IoBase, SK_INIT_IO);
SkTimerInit(pAC, pAC->IoBase, SK_INIT_IO); SkTimerInit(pAC, pAC->IoBase, SK_INIT_IO);
/* Set chipset type support */
pAC->ChipsetType = 0;
if ((pAC->GIni.GIChipId == CHIP_ID_YUKON) ||
(pAC->GIni.GIChipId == CHIP_ID_YUKON_LITE)) {
pAC->ChipsetType = 1;
}
GetConfiguration(pAC); GetConfiguration(pAC);
if (pAC->RlmtNets == 2) { if (pAC->RlmtNets == 2) {
pAC->GIni.GIPortUsage = SK_MUL_LINK; pAC->GIni.GIPortUsage = SK_MUL_LINK;
...@@ -1185,11 +1294,11 @@ SK_BOOL DualNet; ...@@ -1185,11 +1294,11 @@ SK_BOOL DualNet;
Ret = request_irq(dev->irq, SkGeIsrOnePort, SA_SHIRQ, Ret = request_irq(dev->irq, SkGeIsrOnePort, SA_SHIRQ,
pAC->Name, dev); pAC->Name, dev);
} else { } else {
printk(KERN_WARNING "%s: Invalid number of ports: %d\n", printk(KERN_WARNING "%s: Illegal number of ports: %d\n",
dev->name, pAC->GIni.GIMacsFound); dev->name, pAC->GIni.GIMacsFound);
return -EAGAIN; return -EAGAIN;
} }
if (Ret) { if (Ret) {
printk(KERN_WARNING "%s: Requested IRQ %d is busy.\n", printk(KERN_WARNING "%s: Requested IRQ %d is busy.\n",
dev->name, dev->irq); dev->name, dev->irq);
...@@ -2117,7 +2226,7 @@ struct sk_buff *pMessage) /* pointer to send-message */ ...@@ -2117,7 +2226,7 @@ struct sk_buff *pMessage) /* pointer to send-message */
*/ */
if (BytesSend < C_LEN_ETHERNET_MINSIZE) { if (BytesSend < C_LEN_ETHERNET_MINSIZE) {
skb_put(pMessage, (C_LEN_ETHERNET_MINSIZE-BytesSend)); skb_put(pMessage, (C_LEN_ETHERNET_MINSIZE-BytesSend));
memset( ((void *)(pMessage->data))+BytesSend, SK_MEMSET( ((char *)(pMessage->data))+BytesSend,
0, C_LEN_ETHERNET_MINSIZE-BytesSend); 0, C_LEN_ETHERNET_MINSIZE-BytesSend);
} }
...@@ -2141,7 +2250,7 @@ struct sk_buff *pMessage) /* pointer to send-message */ ...@@ -2141,7 +2250,7 @@ struct sk_buff *pMessage) /* pointer to send-message */
*/ */
PhysAddr = (SK_U64) pci_map_page(pAC->PciDev, PhysAddr = (SK_U64) pci_map_page(pAC->PciDev,
virt_to_page(pMessage->data), virt_to_page(pMessage->data),
offset_in_page(pMessage->data), ((unsigned long) pMessage->data & ~PAGE_MASK),
pMessage->len, pMessage->len,
PCI_DMA_TODEVICE); PCI_DMA_TODEVICE);
pTxd->VDataLow = (SK_U32) (PhysAddr & 0xffffffff); pTxd->VDataLow = (SK_U32) (PhysAddr & 0xffffffff);
...@@ -2149,18 +2258,22 @@ struct sk_buff *pMessage) /* pointer to send-message */ ...@@ -2149,18 +2258,22 @@ struct sk_buff *pMessage) /* pointer to send-message */
pTxd->pMBuf = pMessage; pTxd->pMBuf = pMessage;
if (pMessage->ip_summed == CHECKSUM_HW) { if (pMessage->ip_summed == CHECKSUM_HW) {
Protocol = ((SK_U8)pMessage->data[C_OFFSET_IPPROTO] & 0xf); Protocol = ((SK_U8)pMessage->data[C_OFFSET_IPPROTO] & 0xff);
if ((Protocol == C_PROTO_ID_TCP) && (pAC->GIni.GIChipRev != 0)) { if ((Protocol == C_PROTO_ID_UDP) &&
pTxd->TBControl = BMU_UDP_CHECK; (pAC->GIni.GIChipRev == 0) &&
(pAC->GIni.GIChipId == CHIP_ID_YUKON)) {
pTxd->TBControl = BMU_TCP_CHECK;
} else { } else {
pTxd->TBControl = BMU_TCP_CHECK ; pTxd->TBControl = BMU_UDP_CHECK;
} }
IpHeaderLength = (SK_U8)pMessage->data[C_OFFSET_IPHEADER]; IpHeaderLength = (SK_U8)pMessage->data[C_OFFSET_IPHEADER];
IpHeaderLength = (IpHeaderLength & 0xf) * 4; IpHeaderLength = (IpHeaderLength & 0xf) * 4;
pTxd->TcpSumOfs = 0; /* PH-Checksum already calculated */ pTxd->TcpSumOfs = 0; /* PH-Checksum already calculated */
pTxd->TcpSumSt = C_LEN_ETHERMAC_HEADER + IpHeaderLength + pTxd->TcpSumSt = C_LEN_ETHERMAC_HEADER + IpHeaderLength +
C_OFFSET_TCPHEADER_TCPCS; (Protocol == C_PROTO_ID_UDP ?
C_OFFSET_UDPHEADER_UDPCS :
C_OFFSET_TCPHEADER_TCPCS);
pTxd->TcpSumWr = C_LEN_ETHERMAC_HEADER + IpHeaderLength; pTxd->TcpSumWr = C_LEN_ETHERMAC_HEADER + IpHeaderLength;
pTxd->TBControl |= BMU_OWN | BMU_STF | pTxd->TBControl |= BMU_OWN | BMU_STF |
...@@ -2175,7 +2288,7 @@ struct sk_buff *pMessage) /* pointer to send-message */ ...@@ -2175,7 +2288,7 @@ struct sk_buff *pMessage) /* pointer to send-message */
#ifdef USE_TX_COMPLETE #ifdef USE_TX_COMPLETE
BMU_IRQ_EOF | BMU_IRQ_EOF |
#endif #endif
pMessage->len; pMessage->len;
} }
/* /*
...@@ -2258,7 +2371,7 @@ struct sk_buff *pMessage) /* pointer to send-message */ ...@@ -2258,7 +2371,7 @@ struct sk_buff *pMessage) /* pointer to send-message */
*/ */
PhysAddr = (SK_U64) pci_map_page(pAC->PciDev, PhysAddr = (SK_U64) pci_map_page(pAC->PciDev,
virt_to_page(pMessage->data), virt_to_page(pMessage->data),
offset_in_page(pMessage->data), ((unsigned long) pMessage->data & ~PAGE_MASK),
skb_headlen(pMessage), skb_headlen(pMessage),
PCI_DMA_TODEVICE); PCI_DMA_TODEVICE);
...@@ -2275,17 +2388,21 @@ struct sk_buff *pMessage) /* pointer to send-message */ ...@@ -2275,17 +2388,21 @@ struct sk_buff *pMessage) /* pointer to send-message */
** opcode for udp is not working in the hardware yet ** opcode for udp is not working in the hardware yet
** (Revision 2.0) ** (Revision 2.0)
*/ */
Protocol = ((SK_U8)pMessage->data[C_OFFSET_IPPROTO] & 0xf); Protocol = ((SK_U8)pMessage->data[C_OFFSET_IPPROTO] & 0xff);
if ((Protocol == C_PROTO_ID_TCP) && (pAC->GIni.GIChipRev != 0)) { if ((Protocol == C_PROTO_ID_UDP) &&
pTxd->TBControl |= BMU_UDP_CHECK; (pAC->GIni.GIChipRev == 0) &&
(pAC->GIni.GIChipId == CHIP_ID_YUKON)) {
pTxd->TBControl |= BMU_TCP_CHECK;
} else { } else {
pTxd->TBControl |= BMU_TCP_CHECK ; pTxd->TBControl |= BMU_UDP_CHECK;
} }
IpHeaderLength = ((SK_U8)pMessage->data[C_OFFSET_IPHEADER] & 0xf)*4; IpHeaderLength = ((SK_U8)pMessage->data[C_OFFSET_IPHEADER] & 0xf)*4;
pTxd->TcpSumOfs = 0; /* PH-Checksum already claculated */ pTxd->TcpSumOfs = 0; /* PH-Checksum already claculated */
pTxd->TcpSumSt = C_LEN_ETHERMAC_HEADER + IpHeaderLength + pTxd->TcpSumSt = C_LEN_ETHERMAC_HEADER + IpHeaderLength +
C_OFFSET_TCPHEADER_TCPCS; (Protocol == C_PROTO_ID_UDP ?
C_OFFSET_UDPHEADER_UDPCS :
C_OFFSET_TCPHEADER_TCPCS);
pTxd->TcpSumWr = C_LEN_ETHERMAC_HEADER + IpHeaderLength; pTxd->TcpSumWr = C_LEN_ETHERMAC_HEADER + IpHeaderLength;
} else { } else {
pTxd->TBControl = BMU_CHECK | BMU_SW | BMU_STF | pTxd->TBControl = BMU_CHECK | BMU_SW | BMU_STF |
...@@ -2324,11 +2441,12 @@ struct sk_buff *pMessage) /* pointer to send-message */ ...@@ -2324,11 +2441,12 @@ struct sk_buff *pMessage) /* pointer to send-message */
** opcode for udp is not working in the hardware yet ** opcode for udp is not working in the hardware yet
** (revision 2.0) ** (revision 2.0)
*/ */
if ( (Protocol == C_PROTO_ID_TCP) && if ((Protocol == C_PROTO_ID_UDP) &&
(pAC->GIni.GIChipRev != 0) ) { (pAC->GIni.GIChipRev == 0) &&
pTxd->TBControl |= BMU_UDP_CHECK ; (pAC->GIni.GIChipId == CHIP_ID_YUKON)) {
pTxd->TBControl |= BMU_TCP_CHECK;
} else { } else {
pTxd->TBControl |= BMU_TCP_CHECK ; pTxd->TBControl |= BMU_UDP_CHECK;
} }
} else { } else {
pTxd->TBControl = BMU_CHECK | BMU_SW | BMU_OWN; pTxd->TBControl = BMU_CHECK | BMU_SW | BMU_OWN;
...@@ -2517,7 +2635,8 @@ SK_U64 PhysAddr; /* physical address of a rx buffer */ ...@@ -2517,7 +2635,8 @@ SK_U64 PhysAddr; /* physical address of a rx buffer */
Length = pAC->RxBufSize; Length = pAC->RxBufSize;
PhysAddr = (SK_U64) pci_map_page(pAC->PciDev, PhysAddr = (SK_U64) pci_map_page(pAC->PciDev,
virt_to_page(pMsgBlock->data), virt_to_page(pMsgBlock->data),
offset_in_page(pMsgBlock->data), ((unsigned long) pMsgBlock->data &
~PAGE_MASK),
pAC->RxBufSize - 2, pAC->RxBufSize - 2,
PCI_DMA_FROMDEVICE); PCI_DMA_FROMDEVICE);
...@@ -2789,7 +2908,7 @@ SK_U64 PhysAddr; ...@@ -2789,7 +2908,7 @@ SK_U64 PhysAddr;
/* Frame not padded => TCP offload! */ /* Frame not padded => TCP offload! */
if ((((Csum1 & 0xfffe) && (Csum2 & 0xfffe)) && if ((((Csum1 & 0xfffe) && (Csum2 & 0xfffe)) &&
(pAC->GIni.GIChipId == CHIP_ID_GENESIS)) || (pAC->GIni.GIChipId == CHIP_ID_GENESIS)) ||
(pAC->GIni.GIChipId == CHIP_ID_YUKON)) { (pAC->ChipsetType)) {
Result = SkCsGetReceiveInfo(pAC, Result = SkCsGetReceiveInfo(pAC,
&pMsg->data[14], &pMsg->data[14],
Csum1, Csum2, pRxPort->PortIndex); Csum1, Csum2, pRxPort->PortIndex);
...@@ -3556,21 +3675,26 @@ int HeaderLength = sizeof(SK_U32) + sizeof(SK_U32); ...@@ -3556,21 +3675,26 @@ int HeaderLength = sizeof(SK_U32) + sizeof(SK_U32);
Length = sizeof(pAC->PnmiStruct) + HeaderLength; Length = sizeof(pAC->PnmiStruct) + HeaderLength;
} }
if (NULL == (pMemBuf = kmalloc(Length, GFP_KERNEL))) { if (NULL == (pMemBuf = kmalloc(Length, GFP_KERNEL))) {
return -EFAULT; return -ENOMEM;
} }
if(copy_from_user(pMemBuf, Ioctl.pData, Length)) { if(copy_from_user(pMemBuf, Ioctl.pData, Length)) {
return -EFAULT; Err = -EFAULT;
goto fault_gen;
} }
if ((Ret = SkPnmiGenIoctl(pAC, pAC->IoBase, pMemBuf, &Length, 0)) < 0) { if ((Ret = SkPnmiGenIoctl(pAC, pAC->IoBase, pMemBuf, &Length, 0)) < 0) {
return -EFAULT; Err = -EFAULT;
goto fault_gen;
} }
if(copy_to_user(Ioctl.pData, pMemBuf, Length) ) { if(copy_to_user(Ioctl.pData, pMemBuf, Length) ) {
return -EFAULT; Err = -EFAULT;
goto fault_gen;
} }
Ioctl.Len = Length; Ioctl.Len = Length;
if(copy_to_user(rq->ifr_data, &Ioctl, sizeof(SK_GE_IOCTL))) { if(copy_to_user(rq->ifr_data, &Ioctl, sizeof(SK_GE_IOCTL))) {
return -EFAULT; Err = -EFAULT;
goto fault_gen;
} }
fault_gen:
kfree(pMemBuf); /* cleanup everything */ kfree(pMemBuf); /* cleanup everything */
break; break;
default: default:
...@@ -3657,6 +3781,7 @@ int AutoNeg = 1; /* autoneg off (0) or on (1) */ ...@@ -3657,6 +3781,7 @@ int AutoNeg = 1; /* autoneg off (0) or on (1) */
int DuplexCap = 0; /* 0=both,1=full,2=half */ int DuplexCap = 0; /* 0=both,1=full,2=half */
int FlowCtrl = SK_FLOW_MODE_SYM_OR_REM; /* FlowControl */ int FlowCtrl = SK_FLOW_MODE_SYM_OR_REM; /* FlowControl */
int MSMode = SK_MS_MODE_AUTO; /* master/slave mode */ int MSMode = SK_MS_MODE_AUTO; /* master/slave mode */
SK_BOOL IsConTypeDefined = SK_TRUE; SK_BOOL IsConTypeDefined = SK_TRUE;
SK_BOOL IsLinkSpeedDefined = SK_TRUE; SK_BOOL IsLinkSpeedDefined = SK_TRUE;
SK_BOOL IsFlowCtrlDefined = SK_TRUE; SK_BOOL IsFlowCtrlDefined = SK_TRUE;
...@@ -3687,6 +3812,7 @@ int Capabilities[3][3] = ...@@ -3687,6 +3812,7 @@ int Capabilities[3][3] =
#define AN_SENS 2 #define AN_SENS 2
#define M_CurrPort pAC->GIni.GP[Port] #define M_CurrPort pAC->GIni.GP[Port]
/* /*
** Set the default values first for both ports! ** Set the default values first for both ports!
*/ */
...@@ -3720,9 +3846,24 @@ int Capabilities[3][3] = ...@@ -3720,9 +3846,24 @@ int Capabilities[3][3] =
if ( (ConType != NULL) && if ( (ConType != NULL) &&
(pAC->Index < SK_MAX_CARD_PARAM) && (pAC->Index < SK_MAX_CARD_PARAM) &&
(ConType[pAC->Index] != NULL) ) { (ConType[pAC->Index] != NULL) ) {
if (strcmp(ConType[pAC->Index],"")==0) {
/* Check chipset family */
if ((!pAC->ChipsetType) &&
(strcmp(ConType[pAC->Index],"Auto")!=0) &&
(strcmp(ConType[pAC->Index],"")!=0)) {
/* Set the speed parameter back */
printk("%s: Illegal value \"%s\" "
"for ConType."
" Using Auto.\n",
pAC->dev[0]->name,
ConType[pAC->Index]);
sprintf(ConType[pAC->Index], "Auto");
}
if (strcmp(ConType[pAC->Index],"")==0) {
IsConTypeDefined = SK_FALSE; /* No ConType defined */ IsConTypeDefined = SK_FALSE; /* No ConType defined */
} else if (strcmp(ConType[pAC->Index],"Auto")==0) { } else if (strcmp(ConType[pAC->Index],"Auto")==0) {
for (Port = 0; Port < SK_MAX_MACS; Port++) { for (Port = 0; Port < SK_MAX_MACS; Port++) {
M_CurrPort.PLinkModeConf = Capabilities[AN_ON][DC_BOTH]; M_CurrPort.PLinkModeConf = Capabilities[AN_ON][DC_BOTH];
M_CurrPort.PFlowCtrlMode = SK_FLOW_MODE_SYM_OR_REM; M_CurrPort.PFlowCtrlMode = SK_FLOW_MODE_SYM_OR_REM;
...@@ -3795,8 +3936,7 @@ int Capabilities[3][3] = ...@@ -3795,8 +3936,7 @@ int Capabilities[3][3] =
** Check speed parameter: ** Check speed parameter:
** Only copper type adapter and GE V2 cards ** Only copper type adapter and GE V2 cards
*/ */
if (((pAC->GIni.GIChipId != CHIP_ID_YUKON) || if (((!pAC->ChipsetType) || (pAC->GIni.GICopperType != SK_TRUE)) &&
(pAC->GIni.GICopperType != SK_TRUE)) &&
((LinkSpeed != SK_LSPEED_AUTO) && ((LinkSpeed != SK_LSPEED_AUTO) &&
(LinkSpeed != SK_LSPEED_1000MBPS))) { (LinkSpeed != SK_LSPEED_1000MBPS))) {
printk("%s: Illegal value for Speed_A. " printk("%s: Illegal value for Speed_A. "
...@@ -3858,6 +3998,16 @@ int Capabilities[3][3] = ...@@ -3858,6 +3998,16 @@ int Capabilities[3][3] =
/* /*
** Check for illegal combinations ** Check for illegal combinations
*/ */
if ((LinkSpeed = SK_LSPEED_1000MBPS) &&
((DuplexCap == SK_LMODE_STAT_AUTOHALF) ||
(DuplexCap == SK_LMODE_STAT_HALF)) &&
(pAC->ChipsetType)) {
printk("%s: Half Duplex not possible with Gigabit speed!\n"
" Using Full Duplex.\n",
pAC->dev[0]->name);
DuplexCap = DC_FULL;
}
if ( AutoSet && AutoNeg==AN_SENS && DupSet) { if ( AutoSet && AutoNeg==AN_SENS && DupSet) {
printk("%s, Port A: DuplexCapabilities" printk("%s, Port A: DuplexCapabilities"
" ignored using Sense mode\n", pAC->dev[0]->name); " ignored using Sense mode\n", pAC->dev[0]->name);
...@@ -3985,8 +4135,7 @@ int Capabilities[3][3] = ...@@ -3985,8 +4135,7 @@ int Capabilities[3][3] =
** Check speed parameter: ** Check speed parameter:
** Only copper type adapter and GE V2 cards ** Only copper type adapter and GE V2 cards
*/ */
if (((pAC->GIni.GIChipId != CHIP_ID_YUKON) || if (((!pAC->ChipsetType) || (pAC->GIni.GICopperType != SK_TRUE)) &&
(pAC->GIni.GICopperType != SK_TRUE)) &&
((LinkSpeed != SK_LSPEED_AUTO) && ((LinkSpeed != SK_LSPEED_AUTO) &&
(LinkSpeed != SK_LSPEED_1000MBPS))) { (LinkSpeed != SK_LSPEED_1000MBPS))) {
printk("%s: Illegal value for Speed_B. " printk("%s: Illegal value for Speed_B. "
...@@ -4044,10 +4193,21 @@ int Capabilities[3][3] = ...@@ -4044,10 +4193,21 @@ int Capabilities[3][3] =
pAC->dev[0]->name, DupCap_B[pAC->Index]); pAC->dev[0]->name, DupCap_B[pAC->Index]);
} }
} }
/* /*
** Check for illegal combinations ** Check for illegal combinations
*/ */
if ((LinkSpeed = SK_LSPEED_1000MBPS) &&
((DuplexCap == SK_LMODE_STAT_AUTOHALF) ||
(DuplexCap == SK_LMODE_STAT_HALF)) &&
(pAC->ChipsetType)) {
printk("%s: Half Duplex not possible with Gigabit speed!\n"
" Using Full Duplex.\n",
pAC->dev[1]->name);
DuplexCap = DC_FULL;
}
if (AutoSet && AutoNeg==AN_SENS && DupSet) { if (AutoSet && AutoNeg==AN_SENS && DupSet) {
printk("%s, Port B: DuplexCapabilities" printk("%s, Port B: DuplexCapabilities"
" ignored using Sense mode\n", pAC->dev[1]->name); " ignored using Sense mode\n", pAC->dev[1]->name);
...@@ -4274,7 +4434,7 @@ int Capabilities[3][3] = ...@@ -4274,7 +4434,7 @@ int Capabilities[3][3] =
} }
if (IntsPerSec[pAC->Index] != 0) { if (IntsPerSec[pAC->Index] != 0) {
if ((IntsPerSec[pAC->Index]< 30)&&(IntsPerSec[pAC->Index]> 40000)) { if ((IntsPerSec[pAC->Index]< 30) || (IntsPerSec[pAC->Index]> 40000)) {
pAC->DynIrqModInfo.MaxModIntsPerSec = C_INTS_PER_SEC_DEFAULT; pAC->DynIrqModInfo.MaxModIntsPerSec = C_INTS_PER_SEC_DEFAULT;
} else { } else {
pAC->DynIrqModInfo.MaxModIntsPerSec = IntsPerSec[pAC->Index]; pAC->DynIrqModInfo.MaxModIntsPerSec = IntsPerSec[pAC->Index];
...@@ -4754,9 +4914,23 @@ SK_BOOL DualNet; ...@@ -4754,9 +4914,23 @@ SK_BOOL DualNet;
printk(" role: ???\n"); printk(" role: ???\n");
} }
} }
/*
Display dim (dynamic interrupt moderation)
informations
*/
if (pAC->DynIrqModInfo.IntModTypeSelect == C_INT_MOD_STATIC)
printk(" irq moderation: static (%d ints/sec)\n",
pAC->DynIrqModInfo.MaxModIntsPerSec);
else if (pAC->DynIrqModInfo.IntModTypeSelect == C_INT_MOD_DYNAMIC)
printk(" irq moderation: dynamic (%d ints/sec)\n",
pAC->DynIrqModInfo.MaxModIntsPerSec);
else
printk(" irq moderation: disabled\n");
#ifdef SK_ZEROCOPY #ifdef SK_ZEROCOPY
if (pAC->GIni.GIChipId == CHIP_ID_YUKON) if (pAC->ChipsetType)
#ifdef USE_SK_TX_CHECKSUM #ifdef USE_SK_TX_CHECKSUM
printk(" scatter-gather: enabled\n"); printk(" scatter-gather: enabled\n");
#else #else
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
* *
* Name: skproc.c * Name: skproc.c
* Project: GEnesis, PCI Gigabit Ethernet Adapter * Project: GEnesis, PCI Gigabit Ethernet Adapter
* Version: $Revision: 1.8 $ * Version: $Revision: 1.2 $
* Date: $Date: 2003/06/27 14:41:42 $ * Date: $Date: 2003/08/12 16:45:29 $
* Purpose: Funktions to display statictic data * Purpose: Funktions to display statictic data
* *
******************************************************************************/ ******************************************************************************/
...@@ -28,6 +28,13 @@ ...@@ -28,6 +28,13 @@
* History: * History:
* *
* $Log: skproc.c,v $ * $Log: skproc.c,v $
* Revision 1.2 2003/08/12 16:45:29 mlindner
* Add: Removed SkNumber and SkDoDiv
* Add: Counter output as (unsigned long long)
*
* Revision 1.1 2003/07/18 13:39:57 rroesler
* Fix: Re-enter after CVS crash
*
* Revision 1.8 2003/06/27 14:41:42 rroesler * Revision 1.8 2003/06/27 14:41:42 rroesler
* Corrected compiler-warning kernel 2.2 * Corrected compiler-warning kernel 2.2
* *
...@@ -86,23 +93,9 @@ ...@@ -86,23 +93,9 @@
#include "h/skdrv1st.h" #include "h/skdrv1st.h"
#include "h/skdrv2nd.h" #include "h/skdrv2nd.h"
#define ZEROPAD 1 /* pad with zero */
#define SIGN 2 /* unsigned/signed long */
#define PLUS 4 /* show plus */
#define SPACE 8 /* space if plus */
#define LEFT 16 /* left justified */
#define SPECIALX 32 /* 0x */
#define LARGE 64
extern struct net_device *SkGeRootDev; extern struct net_device *SkGeRootDev;
extern char * SkNumber(
char * str,
long long num,
int base,
int size,
int precision,
int type);
int sk_proc_read(char *buffer, int sk_proc_read(char *buffer,
char **buffer_location, char **buffer_location,
...@@ -137,7 +130,6 @@ void *data) ...@@ -137,7 +130,6 @@ void *data)
int i; int i;
DEV_NET *pNet; DEV_NET *pNet;
SK_AC *pAC; SK_AC *pAC;
char test_buf[100];
char sens_msg[50]; char sens_msg[50];
unsigned long Flags; unsigned long Flags;
unsigned int Size; unsigned int Size;
...@@ -247,13 +239,11 @@ void *data) ...@@ -247,13 +239,11 @@ void *data)
"\nReceive statistics\n\n"); "\nReceive statistics\n\n");
len += sprintf(buffer + len, len += sprintf(buffer + len,
"Received bytes %s\n", "Received bytes %Ld\n",
SkNumber(test_buf, pPnmiStat->StatRxOctetsOkCts, (unsigned long long) pPnmiStat->StatRxOctetsOkCts);
10,0,-1,0));
len += sprintf(buffer + len, len += sprintf(buffer + len,
"Received packets %s\n", "Received packets %Ld\n",
SkNumber(test_buf, pPnmiStat->StatRxOkCts, (unsigned long long) pPnmiStat->StatRxOkCts);
10,0,-1,0));
#if 0 #if 0
if (pAC->GIni.GP[0].PhyType == SK_PHY_XMAC && if (pAC->GIni.GP[0].PhyType == SK_PHY_XMAC &&
pAC->HWRevision < 12) { pAC->HWRevision < 12) {
...@@ -267,71 +257,56 @@ void *data) ...@@ -267,71 +257,56 @@ void *data)
pPnmiStat->StatRxTooLongCts; pPnmiStat->StatRxTooLongCts;
len += sprintf(buffer + len, len += sprintf(buffer + len,
"Receive errors %s\n", "Receive errors %Ld\n",
SkNumber(test_buf, pPnmiStruct->InErrorsCts, (unsigned long long) pPnmiStruct->InErrorsCts);
10,0,-1,0));
len += sprintf(buffer + len, len += sprintf(buffer + len,
"Receive dropped %s\n", "Receive dropped %Ld\n",
SkNumber(test_buf, pPnmiStruct->RxNoBufCts, (unsigned long long) pPnmiStruct->RxNoBufCts);
10,0,-1,0));
len += sprintf(buffer + len, len += sprintf(buffer + len,
"Received multicast %s\n", "Received multicast %Ld\n",
SkNumber(test_buf, pPnmiStat->StatRxMulticastOkCts, (unsigned long long) pPnmiStat->StatRxMulticastOkCts);
10,0,-1,0));
len += sprintf(buffer + len, len += sprintf(buffer + len,
"Receive error types\n"); "Receive error types\n");
len += sprintf(buffer + len, len += sprintf(buffer + len,
" length %s\n", " length %Ld\n",
SkNumber(test_buf, pPnmiStat->StatRxRuntCts, (unsigned long long) pPnmiStat->StatRxRuntCts);
10, 0, -1, 0));
len += sprintf(buffer + len, len += sprintf(buffer + len,
" buffer overflow %s\n", " buffer overflow %Ld\n",
SkNumber(test_buf, pPnmiStat->StatRxFifoOverflowCts, (unsigned long long) pPnmiStat->StatRxFifoOverflowCts);
10, 0, -1, 0));
len += sprintf(buffer + len, len += sprintf(buffer + len,
" bad crc %s\n", " bad crc %Ld\n",
SkNumber(test_buf, pPnmiStat->StatRxFcsCts, (unsigned long long) pPnmiStat->StatRxFcsCts);
10, 0, -1, 0));
len += sprintf(buffer + len, len += sprintf(buffer + len,
" framing %s\n", " framing %Ld\n",
SkNumber(test_buf, pPnmiStat->StatRxFramingCts, (unsigned long long) pPnmiStat->StatRxFramingCts);
10, 0, -1, 0));
len += sprintf(buffer + len, len += sprintf(buffer + len,
" missed frames %s\n", " missed frames %Ld\n",
SkNumber(test_buf, pPnmiStat->StatRxMissedCts, (unsigned long long) pPnmiStat->StatRxMissedCts);
10, 0, -1, 0));
if (pNet->Mtu > 1500) if (pNet->Mtu > 1500)
pPnmiStat->StatRxTooLongCts = 0; pPnmiStat->StatRxTooLongCts = 0;
len += sprintf(buffer + len, len += sprintf(buffer + len,
" too long %s\n", " too long %Ld\n",
SkNumber(test_buf, pPnmiStat->StatRxTooLongCts, (unsigned long long) pPnmiStat->StatRxTooLongCts);
10, 0, -1, 0));
len += sprintf(buffer + len, len += sprintf(buffer + len,
" carrier extension %s\n", " carrier extension %Ld\n",
SkNumber(test_buf, pPnmiStat->StatRxCextCts, (unsigned long long) pPnmiStat->StatRxCextCts);
10, 0, -1, 0));
len += sprintf(buffer + len, len += sprintf(buffer + len,
" too short %s\n", " too short %Ld\n",
SkNumber(test_buf, pPnmiStat->StatRxShortsCts, (unsigned long long) pPnmiStat->StatRxShortsCts);
10, 0, -1, 0));
len += sprintf(buffer + len, len += sprintf(buffer + len,
" symbol %s\n", " symbol %Ld\n",
SkNumber(test_buf, pPnmiStat->StatRxSymbolCts, (unsigned long long) pPnmiStat->StatRxSymbolCts);
10, 0, -1, 0));
len += sprintf(buffer + len, len += sprintf(buffer + len,
" LLC MAC size %s\n", " LLC MAC size %Ld\n",
SkNumber(test_buf, pPnmiStat->StatRxIRLengthCts, (unsigned long long) pPnmiStat->StatRxIRLengthCts);
10, 0, -1, 0));
len += sprintf(buffer + len, len += sprintf(buffer + len,
" carrier event %s\n", " carrier event %Ld\n",
SkNumber(test_buf, pPnmiStat->StatRxCarrierCts, (unsigned long long) pPnmiStat->StatRxCarrierCts);
10, 0, -1, 0));
len += sprintf(buffer + len, len += sprintf(buffer + len,
" jabber %s\n", " jabber %Ld\n",
SkNumber(test_buf, pPnmiStat->StatRxJabberCts, (unsigned long long) pPnmiStat->StatRxJabberCts);
10, 0, -1, 0));
/*Transmit statistics */ /*Transmit statistics */
...@@ -339,42 +314,34 @@ void *data) ...@@ -339,42 +314,34 @@ void *data)
"\nTransmit statistics\n\n"); "\nTransmit statistics\n\n");
len += sprintf(buffer + len, len += sprintf(buffer + len,
"Transmited bytes %s\n", "Transmited bytes %Ld\n",
SkNumber(test_buf, pPnmiStat->StatTxOctetsOkCts, (unsigned long long) pPnmiStat->StatTxOctetsOkCts);
10,0,-1,0));
len += sprintf(buffer + len, len += sprintf(buffer + len,
"Transmited packets %s\n", "Transmited packets %Ld\n",
SkNumber(test_buf, pPnmiStat->StatTxOkCts, (unsigned long long) pPnmiStat->StatTxOkCts);
10,0,-1,0));
len += sprintf(buffer + len, len += sprintf(buffer + len,
"Transmit errors %s\n", "Transmit errors %Ld\n",
SkNumber(test_buf, pPnmiStat->StatTxSingleCollisionCts, (unsigned long long) pPnmiStat->StatTxSingleCollisionCts);
10,0,-1,0));
len += sprintf(buffer + len, len += sprintf(buffer + len,
"Transmit dropped %s\n", "Transmit dropped %Ld\n",
SkNumber(test_buf, pPnmiStruct->TxNoBufCts, (unsigned long long) pPnmiStruct->TxNoBufCts);
10,0,-1,0));
len += sprintf(buffer + len, len += sprintf(buffer + len,
"Transmit collisions %s\n", "Transmit collisions %Ld\n",
SkNumber(test_buf, pPnmiStat->StatTxSingleCollisionCts, (unsigned long long) pPnmiStat->StatTxSingleCollisionCts);
10,0,-1,0));
len += sprintf(buffer + len, len += sprintf(buffer + len,
"Transmit error types\n"); "Transmit error types\n");
len += sprintf(buffer + len, len += sprintf(buffer + len,
" excessive collision %ld\n", " excessive collision %ld\n",
pAC->stats.tx_aborted_errors); pAC->stats.tx_aborted_errors);
len += sprintf(buffer + len, len += sprintf(buffer + len,
" carrier %s\n", " carrier %Ld\n",
SkNumber(test_buf, pPnmiStat->StatTxCarrierCts, (unsigned long long) pPnmiStat->StatTxCarrierCts);
10, 0, -1, 0));
len += sprintf(buffer + len, len += sprintf(buffer + len,
" fifo underrun %s\n", " fifo underrun %Ld\n",
SkNumber(test_buf, pPnmiStat->StatTxFifoUnderrunCts, (unsigned long long) pPnmiStat->StatTxFifoUnderrunCts);
10, 0, -1, 0));
len += sprintf(buffer + len, len += sprintf(buffer + len,
" heartbeat %s\n", " heartbeat %Ld\n",
SkNumber(test_buf, pPnmiStat->StatTxCarrierCts, (unsigned long long) pPnmiStat->StatTxCarrierCts);
10, 0, -1, 0));
len += sprintf(buffer + len, len += sprintf(buffer + len,
" window %ld\n", " window %ld\n",
pAC->stats.tx_window_errors); pAC->stats.tx_window_errors);
...@@ -396,139 +363,3 @@ void *data) ...@@ -396,139 +363,3 @@ void *data)
} }
/*****************************************************************************
*
* SkDoDiv - convert 64bit number
*
* Description:
* This function "converts" a long long number.
*
* Returns:
* remainder of division
*/
static long SkDoDiv (long long Dividend, int Divisor, long long *pErg)
{
long Rest;
long long Ergebnis;
long Akku;
Akku = Dividend >> 32;
Ergebnis = ((long long) (Akku / Divisor)) << 32;
Rest = Akku % Divisor ;
Akku = Rest << 16;
Akku |= ((Dividend & 0xFFFF0000) >> 16);
Ergebnis += ((long long) (Akku / Divisor)) << 16;
Rest = Akku % Divisor ;
Akku = Rest << 16;
Akku |= (Dividend & 0xFFFF);
Ergebnis += (Akku / Divisor);
Rest = Akku % Divisor ;
*pErg = Ergebnis;
return (Rest);
}
#if 0
#define do_div(n,base) ({ \
long long __res; \
__res = ((unsigned long long) n) % (unsigned) base; \
n = ((unsigned long long) n) / (unsigned) base; \
__res; })
#endif
/*****************************************************************************
*
* SkNumber - Print results
*
* Description:
* This function converts a long long number into a string.
*
* Returns:
* number as string
*/
char * SkNumber(char * str, long long num, int base, int size, int precision
,int type)
{
char c,sign,tmp[66], *strorg = str;
const char *digits="0123456789abcdefghijklmnopqrstuvwxyz";
int i;
if (type & LARGE)
digits = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
if (type & LEFT)
type &= ~ZEROPAD;
if (base < 2 || base > 36)
return 0;
c = (type & ZEROPAD) ? '0' : ' ';
sign = 0;
if (type & SIGN) {
if (num < 0) {
sign = '-';
num = -num;
size--;
} else if (type & PLUS) {
sign = '+';
size--;
} else if (type & SPACE) {
sign = ' ';
size--;
}
}
if (type & SPECIALX) {
if (base == 16)
size -= 2;
else if (base == 8)
size--;
}
i = 0;
if (num == 0)
tmp[i++]='0';
else while (num != 0)
tmp[i++] = digits[SkDoDiv(num,base, &num)];
if (i > precision)
precision = i;
size -= precision;
if (!(type&(ZEROPAD+LEFT)))
while(size-->0)
*str++ = ' ';
if (sign)
*str++ = sign;
if (type & SPECIALX) {
if (base==8)
*str++ = '0';
else if (base==16) {
*str++ = '0';
*str++ = digits[33];
}
}
if (!(type & LEFT))
while (size-- > 0)
*str++ = c;
while (i < precision--)
*str++ = '0';
while (i-- > 0)
*str++ = tmp[i];
while (size-- > 0)
*str++ = ' ';
str[0] = '\0';
return strorg;
}
...@@ -883,7 +883,9 @@ static int TLan_Init( struct net_device *dev ) ...@@ -883,7 +883,9 @@ static int TLan_Init( struct net_device *dev )
err ); err );
} }
dev->addr_len = 6; dev->addr_len = 6;
netif_carrier_off(dev);
/* Device methods */ /* Device methods */
dev->open = &TLan_Open; dev->open = &TLan_Open;
dev->hard_start_xmit = &TLan_StartTx; dev->hard_start_xmit = &TLan_StartTx;
...@@ -2205,6 +2207,8 @@ TLan_ResetAdapter( struct net_device *dev ) ...@@ -2205,6 +2207,8 @@ TLan_ResetAdapter( struct net_device *dev )
priv->tlanFullDuplex = FALSE; priv->tlanFullDuplex = FALSE;
priv->phyOnline=0; priv->phyOnline=0;
netif_carrier_off(dev);
/* 1. Assert reset bit. */ /* 1. Assert reset bit. */
data = inl(dev->base_addr + TLAN_HOST_CMD); data = inl(dev->base_addr + TLAN_HOST_CMD);
...@@ -2368,6 +2372,7 @@ TLan_FinishReset( struct net_device *dev ) ...@@ -2368,6 +2372,7 @@ TLan_FinishReset( struct net_device *dev )
} }
outl( priv->rxListDMA, dev->base_addr + TLAN_CH_PARM ); outl( priv->rxListDMA, dev->base_addr + TLAN_CH_PARM );
outl( TLAN_HC_GO | TLAN_HC_RT, dev->base_addr + TLAN_HOST_CMD ); outl( TLAN_HC_GO | TLAN_HC_RT, dev->base_addr + TLAN_HOST_CMD );
netif_carrier_on(dev);
} else { } else {
printk( "TLAN: %s: Link inactive, will retry in 10 secs...\n", dev->name ); printk( "TLAN: %s: Link inactive, will retry in 10 secs...\n", dev->name );
TLan_SetTimer( dev, (10*HZ), TLAN_TIMER_FINISH_RESET ); TLan_SetTimer( dev, (10*HZ), TLAN_TIMER_FINISH_RESET );
......
...@@ -23,11 +23,9 @@ config DE2104X ...@@ -23,11 +23,9 @@ config DE2104X
will say Y here.) Do read the Ethernet-HOWTO, available from will say Y here.) Do read the Ethernet-HOWTO, available from
<http://www.tldp.org/docs.html#howto>. <http://www.tldp.org/docs.html#howto>.
This driver is also available as a module ( = code which can be To compile this driver as a module, choose M here and read
inserted in and removed from the running kernel whenever you want). <file:Documentation/networking/net-modules.txt>. The module will
The module will be called de2104x. If you want to compile it as a be called de2104x.
module, say M here and read <file:Documentation/modules.txt> as well
as <file:Documentation/networking/net-modules.txt>.
config TULIP config TULIP
tristate "DECchip Tulip (dc2114x) PCI support" tristate "DECchip Tulip (dc2114x) PCI support"
...@@ -44,11 +42,9 @@ config TULIP ...@@ -44,11 +42,9 @@ config TULIP
information is contained in information is contained in
<file:Documentation/networking/tulip.txt>. <file:Documentation/networking/tulip.txt>.
This driver is also available as a module ( = code which can be To compile this driver as a module, choose M here and read
inserted in and removed from the running kernel whenever you want). <file:Documentation/networking/net-modules.txt>. The module will
The module will be called tulip. If you want to compile it as a be called tulip.
module, say M here and read <file:Documentation/modules.txt> as well
as <file:Documentation/networking/net-modules.txt>.
config TULIP_MWI config TULIP_MWI
bool "New bus configuration (EXPERIMENTAL)" bool "New bus configuration (EXPERIMENTAL)"
...@@ -82,11 +78,9 @@ config DE4X5 ...@@ -82,11 +78,9 @@ config DE4X5
information is contained in information is contained in
<file:Documentation/networking/de4x5.txt>. <file:Documentation/networking/de4x5.txt>.
This driver is also available as a module ( = code which can be To compile this driver as a module, choose M here and read
inserted in and removed from the running kernel whenever you want). <file:Documentation/networking/net-modules.txt>. The module will
The module will be called de4x5. If you want to compile it as a be called de4x5.
module, say M here and read <file:Documentation/modules.txt> as well
as <file:Documentation/networking/net-modules.txt>.
config WINBOND_840 config WINBOND_840
tristate "Winbond W89c840 Ethernet support" tristate "Winbond W89c840 Ethernet support"
...@@ -106,11 +100,9 @@ config DM9102 ...@@ -106,11 +100,9 @@ config DM9102
(Ethernet) card, say Y. Some information is contained in the file (Ethernet) card, say Y. Some information is contained in the file
<file:Documentation/networking/dmfe.txt>. <file:Documentation/networking/dmfe.txt>.
This driver is also available as a module ( = code which can be To compile this driver as a module, choose M here and read
inserted in and removed from the running kernel whenever you want). <file:Documentation/networking/net-modules.txt>. The module will
The module will be called dmfe. If you want to compile it as a be called dmfe.
module, say M here and read <file:Documentation/modules.txt> as well
as <file:Documentation/networking/net-modules.txt>.
config PCMCIA_XIRCOM config PCMCIA_XIRCOM
tristate "Xircom CardBus support (new driver)" tristate "Xircom CardBus support (new driver)"
...@@ -121,11 +113,9 @@ config PCMCIA_XIRCOM ...@@ -121,11 +113,9 @@ config PCMCIA_XIRCOM
as with work-alike chips from Lite-On (PNIC) and Macronix (MXIC) and as with work-alike chips from Lite-On (PNIC) and Macronix (MXIC) and
ASIX. ASIX.
This driver is also available as a module ( = code which can be To compile this driver as a module, choose M here and read
inserted in and removed from the running kernel whenever you want). <file:Documentation/networking/net-modules.txt>. The module will
The module will be called xircom_cb. If you want to compile be called xircom_cb. If unsure, say N.
it as a module, say M here and read
<file:Documentation/modules.txt>. If unsure, say N.
config PCMCIA_XIRTULIP config PCMCIA_XIRTULIP
tristate "Xircom Tulip-like CardBus support (old driver)" tristate "Xircom Tulip-like CardBus support (old driver)"
...@@ -136,11 +126,9 @@ config PCMCIA_XIRTULIP ...@@ -136,11 +126,9 @@ config PCMCIA_XIRTULIP
as with work-alike chips from Lite-On (PNIC) and Macronix (MXIC) and as with work-alike chips from Lite-On (PNIC) and Macronix (MXIC) and
ASIX. ASIX.
This driver is also available as a module ( = code which can be To compile this driver as a module, choose M here and read
inserted in and removed from the running kernel whenever you want). <file:Documentation/networking/net-modules.txt>. The module will
The module will be called xircom_tulip_cb. If you want to compile be called xircom_tulip_cb. If unsure, say N.
it as a module, say M here and read
<file:Documentation/modules.txt>. If unsure, say N.
endmenu endmenu
...@@ -3,7 +3,9 @@ ...@@ -3,7 +3,9 @@
# #
obj-$(CONFIG_STRIP) += strip.o obj-$(CONFIG_STRIP) += strip.o
obj-$(CONFIG_ARLAN) += arlan.o arlan-proc.o obj-$(CONFIG_ARLAN) += arlan.o
arlan-objs := arlan-main.o arlan-proc.o
# Obsolete cards # Obsolete cards
obj-$(CONFIG_WAVELAN) += wavelan.o obj-$(CONFIG_WAVELAN) += wavelan.o
......
...@@ -16,15 +16,12 @@ ...@@ -16,15 +16,12 @@
static const char *arlan_version = "C.Jennigs 97 & Elmer.Joandi@ut.ee Oct'98, http://www.ylenurme.ee/~elmer/655/"; static const char *arlan_version = "C.Jennigs 97 & Elmer.Joandi@ut.ee Oct'98, http://www.ylenurme.ee/~elmer/655/";
struct net_device *arlan_device[MAX_ARLANS]; struct net_device *arlan_device[MAX_ARLANS];
int last_arlan;
static int SID = SIDUNKNOWN; static int SID = SIDUNKNOWN;
static int radioNodeId = radioNodeIdUNKNOWN; static int radioNodeId = radioNodeIdUNKNOWN;
static char encryptionKey[12] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'}; static char encryptionKey[12] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'};
static char *siteName = siteNameUNKNOWN;
static int mem = memUNKNOWN; static int mem = memUNKNOWN;
int arlan_debug = debugUNKNOWN; int arlan_debug = debugUNKNOWN;
static int probe = probeUNKNOWN;
static int numDevices = numDevicesUNKNOWN; static int numDevices = numDevicesUNKNOWN;
static int spreadingCode = spreadingCodeUNKNOWN; static int spreadingCode = spreadingCodeUNKNOWN;
static int channelNumber = channelNumberUNKNOWN; static int channelNumber = channelNumberUNKNOWN;
...@@ -34,7 +31,6 @@ static int registrationMode = registrationModeUNKNOWN; ...@@ -34,7 +31,6 @@ static int registrationMode = registrationModeUNKNOWN;
static int keyStart; static int keyStart;
static int tx_delay_ms; static int tx_delay_ms;
static int retries = 5; static int retries = 5;
static int async = 1;
static int tx_queue_len = 1; static int tx_queue_len = 1;
static int arlan_EEPROM_bad; static int arlan_EEPROM_bad;
...@@ -48,7 +44,6 @@ static int txScrambled = 1; ...@@ -48,7 +44,6 @@ static int txScrambled = 1;
static int mdebug; static int mdebug;
#endif #endif
#if LINUX_VERSION_CODE > 0x20100
MODULE_PARM(irq, "i"); MODULE_PARM(irq, "i");
MODULE_PARM(mem, "i"); MODULE_PARM(mem, "i");
MODULE_PARM(probe, "i"); MODULE_PARM(probe, "i");
...@@ -91,23 +86,6 @@ MODULE_PARM_DESC(arlan_exit_debug, "(ignored)"); ...@@ -91,23 +86,6 @@ MODULE_PARM_DESC(arlan_exit_debug, "(ignored)");
MODULE_PARM_DESC(arlan_entry_and_exit_debug, "(ignored)"); MODULE_PARM_DESC(arlan_entry_and_exit_debug, "(ignored)");
#endif #endif
EXPORT_SYMBOL(arlan_device);
EXPORT_SYMBOL(arlan_conf);
EXPORT_SYMBOL(last_arlan);
// #warning kernel 2.1.110 tested
#define myATOMIC_INIT(a,b) atomic_set(&(a),b)
#else
#define test_and_set_bit set_bit
#if LINUX_VERSION_CODE != 0x20024
// #warning kernel 2.0.36 tested
#endif
#define myATOMIC_INIT(a,b) a = b;
#endif
struct arlan_conf_stru arlan_conf[MAX_ARLANS]; struct arlan_conf_stru arlan_conf[MAX_ARLANS];
static int arlans_found; static int arlans_found;
...@@ -125,16 +103,12 @@ static void arlan_tx_done_interrupt (struct net_device * dev, int status); ...@@ -125,16 +103,12 @@ static void arlan_tx_done_interrupt (struct net_device * dev, int status);
static void arlan_rx_interrupt (struct net_device * dev, u_char rxStatus, u_short, u_short); static void arlan_rx_interrupt (struct net_device * dev, u_char rxStatus, u_short, u_short);
static void arlan_process_interrupt (struct net_device * dev); static void arlan_process_interrupt (struct net_device * dev);
static void arlan_tx_timeout (struct net_device *dev); static void arlan_tx_timeout (struct net_device *dev);
int arlan_command(struct net_device * dev, int command);
EXPORT_SYMBOL(arlan_command); static inline long us2ticks(int us)
static inline long long arlan_time(void)
{ {
struct timeval timev; return us * (1000000 / HZ);
do_gettimeofday(&timev); }
return ((long long) timev.tv_sec * 1000000 + timev.tv_usec);
};
#ifdef ARLAN_ENTRY_EXIT_DEBUGGING #ifdef ARLAN_ENTRY_EXIT_DEBUGGING
#define ARLAN_DEBUG_ENTRY(name) \ #define ARLAN_DEBUG_ENTRY(name) \
...@@ -161,35 +135,9 @@ static inline long long arlan_time(void) ...@@ -161,35 +135,9 @@ static inline long long arlan_time(void)
clearClearInterrupt(dev);\ clearClearInterrupt(dev);\
setClearInterrupt(dev); setClearInterrupt(dev);
#define ARLAN_COMMAND_LOCK(dev) \
if (atomic_dec_and_test(&((struct arlan_private * )dev->priv)->card_users))\
arlan_wait_command_complete_short(dev,__LINE__);
#define ARLAN_COMMAND_UNLOCK(dev) \
atomic_inc(&((struct arlan_private * )dev->priv)->card_users);
#define ARLAN_COMMAND_INC(dev) \
{((struct arlan_private *) dev->priv)->under_command++;}
#define ARLAN_COMMAND_ZERO(dev) \
{((struct arlan_private *) dev->priv)->under_command =0;}
#define ARLAN_UNDER_COMMAND(dev)\
(((struct arlan_private *) dev->priv)->under_command)
#define ARLAN_COMMAND_START(dev) ARLAN_COMMAND_INC(dev)
#define ARLAN_COMMAND_END(dev) ARLAN_COMMAND_ZERO(dev)
#define ARLAN_TOGGLE_START(dev)\
{((struct arlan_private *) dev->priv)->under_toggle++;}
#define ARLAN_TOGGLE_END(dev)\
{((struct arlan_private *) dev->priv)->under_toggle=0;}
#define ARLAN_UNDER_TOGGLE(dev)\
(((struct arlan_private *) dev->priv)->under_toggle)
static inline int arlan_drop_tx(struct net_device *dev) static inline int arlan_drop_tx(struct net_device *dev)
{ {
struct arlan_private *priv = ((struct arlan_private *) dev->priv); struct arlan_private *priv = dev->priv;
priv->stats.tx_errors++; priv->stats.tx_errors++;
if (priv->Conf->tx_delay_ms) if (priv->Conf->tx_delay_ms)
...@@ -202,24 +150,22 @@ static inline int arlan_drop_tx(struct net_device *dev) ...@@ -202,24 +150,22 @@ static inline int arlan_drop_tx(struct net_device *dev)
TXHEAD(dev).offset = 0; TXHEAD(dev).offset = 0;
TXTAIL(dev).offset = 0; TXTAIL(dev).offset = 0;
priv->txLast = 0; priv->txLast = 0;
priv->txOffset = 0;
priv->bad = 0; priv->bad = 0;
if (!priv->under_reset && !priv->under_config) if (!priv->under_reset && !priv->under_config)
netif_wake_queue (dev); netif_wake_queue (dev);
} }
return 1; return 1;
}; }
int arlan_command(struct net_device *dev, int command_p) int arlan_command(struct net_device *dev, int command_p)
{ {
struct arlan_private *priv = dev->priv;
volatile struct arlan_shmem *arlan = ((struct arlan_private *) dev->priv)->card; volatile struct arlan_shmem *arlan = priv->card;
struct arlan_conf_stru *conf = ((struct arlan_private *) dev->priv)->Conf; struct arlan_conf_stru *conf = priv->Conf;
struct arlan_private *priv = (struct arlan_private *) dev->priv;
int udelayed = 0; int udelayed = 0;
int i = 0; int i = 0;
long long time_mks = arlan_time(); unsigned long flags;
ARLAN_DEBUG_ENTRY("arlan_command"); ARLAN_DEBUG_ENTRY("arlan_command");
...@@ -227,14 +173,14 @@ int arlan_command(struct net_device *dev, int command_p) ...@@ -227,14 +173,14 @@ int arlan_command(struct net_device *dev, int command_p)
priv->card_polling_interval = 1; priv->card_polling_interval = 1;
if (arlan_debug & ARLAN_DEBUG_CHAIN_LOCKS) if (arlan_debug & ARLAN_DEBUG_CHAIN_LOCKS)
printk(KERN_DEBUG "arlan_command, %lx lock %lx commandByte %x waiting %x incoming %x \n", printk(KERN_DEBUG "arlan_command, %lx commandByte %x waiting %lx incoming %x \n",
jiffies, priv->command_lock, READSHMB(arlan->commandByte), jiffies, READSHMB(arlan->commandByte),
priv->waiting_command_mask, command_p); priv->waiting_command_mask, command_p);
priv->waiting_command_mask |= command_p; priv->waiting_command_mask |= command_p;
if (priv->waiting_command_mask & ARLAN_COMMAND_RESET) if (priv->waiting_command_mask & ARLAN_COMMAND_RESET)
if (jiffies - priv->lastReset < 5 * HZ) if (time_after(jiffies, priv->lastReset + 5 * HZ))
priv->waiting_command_mask &= ~ARLAN_COMMAND_RESET; priv->waiting_command_mask &= ~ARLAN_COMMAND_RESET;
if (priv->waiting_command_mask & ARLAN_COMMAND_INT_ACK) if (priv->waiting_command_mask & ARLAN_COMMAND_INT_ACK)
...@@ -249,13 +195,8 @@ int arlan_command(struct net_device *dev, int command_p) ...@@ -249,13 +195,8 @@ int arlan_command(struct net_device *dev, int command_p)
} }
/* Card access serializing lock */ /* Card access serializing lock */
spin_lock_irqsave(&priv->lock, flags);
if (test_and_set_bit(0, (void *) &priv->command_lock))
{
if (arlan_debug & ARLAN_DEBUG_CHAIN_LOCKS)
printk(KERN_DEBUG "arlan_command: entered when command locked \n");
goto command_busy_end;
}
/* Check cards status and waiting */ /* Check cards status and waiting */
if (priv->waiting_command_mask & (ARLAN_COMMAND_LONG_WAIT_NOW | ARLAN_COMMAND_WAIT_NOW)) if (priv->waiting_command_mask & (ARLAN_COMMAND_LONG_WAIT_NOW | ARLAN_COMMAND_WAIT_NOW))
...@@ -361,7 +302,7 @@ int arlan_command(struct net_device *dev, int command_p) ...@@ -361,7 +302,7 @@ int arlan_command(struct net_device *dev, int command_p)
if (priv->tx_command_given || priv->rx_command_given) if (priv->tx_command_given || priv->rx_command_given)
{ {
printk(KERN_ERR "%s: Reset under tx or rx command \n", dev->name); printk(KERN_ERR "%s: Reset under tx or rx command \n", dev->name);
}; }
netif_stop_queue (dev); netif_stop_queue (dev);
if (arlan_debug & ARLAN_DEBUG_RESET) if (arlan_debug & ARLAN_DEBUG_RESET)
printk(KERN_ERR "%s: Doing chip reset\n", dev->name); printk(KERN_ERR "%s: Doing chip reset\n", dev->name);
...@@ -373,7 +314,6 @@ int arlan_command(struct net_device *dev, int command_p) ...@@ -373,7 +314,6 @@ int arlan_command(struct net_device *dev, int command_p)
WRITESHM(arlan->resetFlag, 0xff, u_char); WRITESHM(arlan->resetFlag, 0xff, u_char);
clearChannelAttention(dev); clearChannelAttention(dev);
clearHardwareReset(dev); clearHardwareReset(dev);
priv->numResets++;
priv->card_polling_interval = HZ / 4; priv->card_polling_interval = HZ / 4;
priv->waiting_command_mask &= ~ARLAN_COMMAND_RESET; priv->waiting_command_mask &= ~ARLAN_COMMAND_RESET;
priv->waiting_command_mask |= ARLAN_COMMAND_INT_RACK; priv->waiting_command_mask |= ARLAN_COMMAND_INT_RACK;
...@@ -441,7 +381,6 @@ int arlan_command(struct net_device *dev, int command_p) ...@@ -441,7 +381,6 @@ int arlan_command(struct net_device *dev, int command_p)
WRITESHMB(arlan->commandParameter[0], conf->rxParameter); WRITESHMB(arlan->commandParameter[0], conf->rxParameter);
arlan_interrupt_lancpu(dev); arlan_interrupt_lancpu(dev);
priv->rx_command_given = 0; // mnjah, bad priv->rx_command_given = 0; // mnjah, bad
priv->last_rx_time = arlan_time();
priv->waiting_command_mask &= ~ARLAN_COMMAND_RX; priv->waiting_command_mask &= ~ARLAN_COMMAND_RX;
priv->card_polling_interval = 1; priv->card_polling_interval = 1;
} }
...@@ -455,24 +394,24 @@ int arlan_command(struct net_device *dev, int command_p) ...@@ -455,24 +394,24 @@ int arlan_command(struct net_device *dev, int command_p)
{ {
priv->waiting_command_mask &= ~ARLAN_COMMAND_TBUSY_CLEAR; priv->waiting_command_mask &= ~ARLAN_COMMAND_TBUSY_CLEAR;
netif_wake_queue (dev); netif_wake_queue (dev);
}; }
} }
else if (priv->waiting_command_mask & ARLAN_COMMAND_TX) else if (priv->waiting_command_mask & ARLAN_COMMAND_TX)
{ {
if (!test_and_set_bit(0, (void *) &priv->tx_command_given)) if (!test_and_set_bit(0, (void *) &priv->tx_command_given))
{ {
if ((time_mks - priv->last_tx_time > conf->rx_tweak1) || if (time_after(jiffies,
(time_mks - priv->last_rx_int_ack_time < conf->rx_tweak2)) priv->tx_last_sent + us2ticks(conf->rx_tweak1))
|| time_before(jiffies,
priv->last_rx_int_ack_time + us2ticks(conf->rx_tweak2)))
{ {
setInterruptEnable(dev); setInterruptEnable(dev);
memset_io((void *) arlan->commandParameter, 0, 0xf); memset_io((void *) arlan->commandParameter, 0, 0xf);
WRITESHMB(arlan->commandByte, ARLAN_COM_TX_ENABLE | ARLAN_COM_INT); WRITESHMB(arlan->commandByte, ARLAN_COM_TX_ENABLE | ARLAN_COM_INT);
memcpy_toio((void *) arlan->commandParameter, &TXLAST(dev), 14); memcpy_toio((void *) arlan->commandParameter, &TXLAST(dev), 14);
// for ( i=1 ; i < 15 ; i++) printk("%02x:",READSHMB(arlan->commandParameter[i])); // for ( i=1 ; i < 15 ; i++) printk("%02x:",READSHMB(arlan->commandParameter[i]));
priv->last_command_was_rx = 0;
priv->tx_last_sent = jiffies; priv->tx_last_sent = jiffies;
arlan_interrupt_lancpu(dev); arlan_interrupt_lancpu(dev);
priv->last_tx_time = arlan_time();
priv->tx_command_given = 1; priv->tx_command_given = 1;
priv->waiting_command_mask &= ~ARLAN_COMMAND_TX; priv->waiting_command_mask &= ~ARLAN_COMMAND_TX;
priv->card_polling_interval = 1; priv->card_polling_interval = 1;
...@@ -522,42 +461,35 @@ int arlan_command(struct net_device *dev, int command_p) ...@@ -522,42 +461,35 @@ int arlan_command(struct net_device *dev, int command_p)
udelay(10); udelay(10);
if (READSHMB(arlan->commandByte)) if (READSHMB(arlan->commandByte))
if (arlan_debug & ARLAN_DEBUG_CARD_STATE) if (arlan_debug & ARLAN_DEBUG_CARD_STATE)
printk(KERN_ERR "card busy leaving command %x \n", priv->waiting_command_mask); printk(KERN_ERR "card busy leaving command %lx\n", priv->waiting_command_mask);
priv->command_lock = 0; spin_unlock_irqrestore(&priv->lock, flags);
ARLAN_DEBUG_EXIT("arlan_command"); ARLAN_DEBUG_EXIT("arlan_command");
priv->last_command_buff_free_time = jiffies; priv->last_command_buff_free_time = jiffies;
return 0; return 0;
card_busy_end: card_busy_end:
if (jiffies - priv->last_command_buff_free_time > HZ) if (time_after(jiffies, priv->last_command_buff_free_time + HZ))
priv->waiting_command_mask |= ARLAN_COMMAND_CLEAN_AND_RESET; priv->waiting_command_mask |= ARLAN_COMMAND_CLEAN_AND_RESET;
if (arlan_debug & ARLAN_DEBUG_CARD_STATE) if (arlan_debug & ARLAN_DEBUG_CARD_STATE)
printk(KERN_ERR "%s arlan_command card busy end \n", dev->name); printk(KERN_ERR "%s arlan_command card busy end \n", dev->name);
priv->command_lock = 0; spin_unlock_irqrestore(&priv->lock, flags);
ARLAN_DEBUG_EXIT("arlan_command"); ARLAN_DEBUG_EXIT("arlan_command");
return 1; return 1;
bad_end: bad_end:
printk(KERN_ERR "%s arlan_command bad end \n", dev->name); printk(KERN_ERR "%s arlan_command bad end \n", dev->name);
priv->command_lock = 0; spin_unlock_irqrestore(&priv->lock, flags);
ARLAN_DEBUG_EXIT("arlan_command"); ARLAN_DEBUG_EXIT("arlan_command");
return -1; return -1;
}
command_busy_end:
if (arlan_debug & ARLAN_DEBUG_CARD_STATE)
printk(KERN_ERR "%s arlan_command command busy end \n", dev->name);
ARLAN_DEBUG_EXIT("arlan_command");
return 2;
};
static inline void arlan_command_process(struct net_device *dev) static inline void arlan_command_process(struct net_device *dev)
{ {
struct arlan_private *priv = ((struct arlan_private *) dev->priv); struct arlan_private *priv = dev->priv;
int times = 0; int times = 0;
while (priv->waiting_command_mask && times < 8) while (priv->waiting_command_mask && times < 8)
...@@ -578,7 +510,7 @@ static inline void arlan_command_process(struct net_device *dev) ...@@ -578,7 +510,7 @@ static inline void arlan_command_process(struct net_device *dev)
static inline void arlan_retransmit_now(struct net_device *dev) static inline void arlan_retransmit_now(struct net_device *dev)
{ {
struct arlan_private *priv = ((struct arlan_private *) dev->priv); struct arlan_private *priv = dev->priv;
ARLAN_DEBUG_ENTRY("arlan_retransmit_now"); ARLAN_DEBUG_ENTRY("arlan_retransmit_now");
...@@ -597,15 +529,12 @@ static inline void arlan_retransmit_now(struct net_device *dev) ...@@ -597,15 +529,12 @@ static inline void arlan_retransmit_now(struct net_device *dev)
} }
else else
IFDEBUG(ARLAN_DEBUG_TX_CHAIN) printk(KERN_ERR "ReTransmit buff empty"); IFDEBUG(ARLAN_DEBUG_TX_CHAIN) printk(KERN_ERR "ReTransmit buff empty");
priv->txOffset = 0;
netif_wake_queue (dev); netif_wake_queue (dev);
return; return;
} }
arlan_command(dev, ARLAN_COMMAND_TX); arlan_command(dev, ARLAN_COMMAND_TX);
priv->nof_tx++;
priv->Conf->driverRetransmissions++; priv->Conf->driverRetransmissions++;
priv->retransmissions++; priv->retransmissions++;
...@@ -619,19 +548,14 @@ static inline void arlan_retransmit_now(struct net_device *dev) ...@@ -619,19 +548,14 @@ static inline void arlan_retransmit_now(struct net_device *dev)
static void arlan_registration_timer(unsigned long data) static void arlan_registration_timer(unsigned long data)
{ {
struct net_device *dev = (struct net_device *) data; struct net_device *dev = (struct net_device *) data;
struct arlan_private *priv = (struct arlan_private *) dev->priv; struct arlan_private *priv = dev->priv;
int lostTime = ((int) (jiffies - priv->registrationLastSeen)) * 1000 / HZ;
int bh_mark_needed = 0; int bh_mark_needed = 0;
int next_tick = 1; int next_tick = 1;
long lostTime = ((long)jiffies - (long)priv->registrationLastSeen)
* (1000/HZ);
priv->timer_chain_active = 1;
if (registrationBad(dev)) if (registrationBad(dev))
{ {
//debug=100;
priv->registrationLostCount++; priv->registrationLostCount++;
if (lostTime > 7000 && lostTime < 7200) if (lostTime > 7000 && lostTime < 7200)
{ {
...@@ -654,19 +578,19 @@ static void arlan_registration_timer(unsigned long data) ...@@ -654,19 +578,19 @@ static void arlan_registration_timer(unsigned long data)
if (priv->Conf->registrationMode && lostTime > 10000 && if (priv->Conf->registrationMode && lostTime > 10000 &&
priv->registrationLostCount) priv->registrationLostCount)
{ {
printk(KERN_NOTICE "%s registration is back after %d milliseconds\n", dev->name, printk(KERN_NOTICE "%s registration is back after %ld milliseconds\n",
((int) (jiffies - priv->registrationLastSeen) * 1000) / HZ); dev->name, lostTime);
} }
priv->registrationLastSeen = jiffies; priv->registrationLastSeen = jiffies;
priv->registrationLostCount = 0; priv->registrationLostCount = 0;
priv->reRegisterExp = 1; priv->reRegisterExp = 1;
if (!netif_running(dev) ) if (!netif_running(dev) )
netif_wake_queue(dev); netif_wake_queue(dev);
if (priv->tx_last_sent > priv->tx_last_cleared && if (time_after(priv->tx_last_sent,priv->tx_last_cleared) &&
jiffies - priv->tx_last_sent > 5*HZ ){ time_after(jiffies, priv->tx_last_sent * 5*HZ) ){
arlan_command(dev, ARLAN_COMMAND_CLEAN_AND_RESET); arlan_command(dev, ARLAN_COMMAND_CLEAN_AND_RESET);
priv->tx_last_cleared = jiffies; priv->tx_last_cleared = jiffies;
}; }
} }
...@@ -693,7 +617,6 @@ static void arlan_registration_timer(unsigned long data) ...@@ -693,7 +617,6 @@ static void arlan_registration_timer(unsigned long data)
} }
if (!(TXHEAD(dev).offset && TXTAIL(dev).offset)) if (!(TXHEAD(dev).offset && TXTAIL(dev).offset))
{ {
priv->txOffset = 0;
netif_wake_queue (dev); netif_wake_queue (dev);
} }
priv->tx_done_delayed = 0; priv->tx_done_delayed = 0;
...@@ -701,7 +624,6 @@ static void arlan_registration_timer(unsigned long data) ...@@ -701,7 +624,6 @@ static void arlan_registration_timer(unsigned long data)
} }
if (bh_mark_needed) if (bh_mark_needed)
{ {
priv->txOffset = 0;
netif_wake_queue (dev); netif_wake_queue (dev);
} }
arlan_process_interrupt(dev); arlan_process_interrupt(dev);
...@@ -709,7 +631,6 @@ static void arlan_registration_timer(unsigned long data) ...@@ -709,7 +631,6 @@ static void arlan_registration_timer(unsigned long data)
if (next_tick < priv->card_polling_interval) if (next_tick < priv->card_polling_interval)
next_tick = priv->card_polling_interval; next_tick = priv->card_polling_interval;
priv->timer_chain_active = 0;
priv->timer.expires = jiffies + next_tick; priv->timer.expires = jiffies + next_tick;
add_timer(&priv->timer); add_timer(&priv->timer);
...@@ -720,7 +641,8 @@ static void arlan_registration_timer(unsigned long data) ...@@ -720,7 +641,8 @@ static void arlan_registration_timer(unsigned long data)
static void arlan_print_registers(struct net_device *dev, int line) static void arlan_print_registers(struct net_device *dev, int line)
{ {
volatile struct arlan_shmem *arlan = ((struct arlan_private *) dev->priv)->card; struct arlan_private *priv = dev->priv;
volatile struct arlan_shmem *arlan = priv->card;
u_char hostcpuLock, lancpuLock, controlRegister, cntrlRegImage, u_char hostcpuLock, lancpuLock, controlRegister, cntrlRegImage,
txStatus, rxStatus, interruptInProgress, commandByte; txStatus, rxStatus, interruptInProgress, commandByte;
...@@ -749,7 +671,7 @@ static int arlan_hw_tx(struct net_device *dev, char *buf, int length) ...@@ -749,7 +671,7 @@ static int arlan_hw_tx(struct net_device *dev, char *buf, int length)
{ {
int i; int i;
struct arlan_private *priv = (struct arlan_private *) dev->priv; struct arlan_private *priv = dev->priv;
volatile struct arlan_shmem *arlan = priv->card; volatile struct arlan_shmem *arlan = priv->card;
struct arlan_conf_stru *conf = priv->Conf; struct arlan_conf_stru *conf = priv->Conf;
...@@ -807,13 +729,13 @@ static int arlan_hw_tx(struct net_device *dev, char *buf, int length) ...@@ -807,13 +729,13 @@ static int arlan_hw_tx(struct net_device *dev, char *buf, int length)
priv->out_bytes10 += length; priv->out_bytes10 += length;
if (conf->measure_rate < 1) if (conf->measure_rate < 1)
conf->measure_rate = 1; conf->measure_rate = 1;
if (jiffies - priv->out_time > conf->measure_rate * HZ) if (time_after(jiffies, priv->out_time + conf->measure_rate * HZ))
{ {
conf->out_speed = priv->out_bytes / conf->measure_rate; conf->out_speed = priv->out_bytes / conf->measure_rate;
priv->out_bytes = 0; priv->out_bytes = 0;
priv->out_time = jiffies; priv->out_time = jiffies;
} }
if (jiffies - priv->out_time10 > conf->measure_rate * HZ * 10) if (time_after(jiffies, priv->out_time10 + conf->measure_rate * 10*HZ))
{ {
conf->out_speed10 = priv->out_bytes10 / (10 * conf->measure_rate); conf->out_speed10 = priv->out_bytes10 / (10 * conf->measure_rate);
priv->out_bytes10 = 0; priv->out_bytes10 = 0;
...@@ -838,9 +760,7 @@ static int arlan_hw_tx(struct net_device *dev, char *buf, int length) ...@@ -838,9 +760,7 @@ static int arlan_hw_tx(struct net_device *dev, char *buf, int length)
arlan_command(dev, ARLAN_COMMAND_TX); arlan_command(dev, ARLAN_COMMAND_TX);
priv->last_command_was_rx = 0;
priv->tx_last_sent = jiffies; priv->tx_last_sent = jiffies;
priv->nof_tx++;
IFDEBUG(ARLAN_DEBUG_TX_CHAIN) printk("%s TX Qued %d bytes \n", dev->name, length); IFDEBUG(ARLAN_DEBUG_TX_CHAIN) printk("%s TX Qued %d bytes \n", dev->name, length);
...@@ -852,9 +772,9 @@ static int arlan_hw_tx(struct net_device *dev, char *buf, int length) ...@@ -852,9 +772,9 @@ static int arlan_hw_tx(struct net_device *dev, char *buf, int length)
static int arlan_hw_config(struct net_device *dev) static int arlan_hw_config(struct net_device *dev)
{ {
volatile struct arlan_shmem *arlan = ((struct arlan_private *) dev->priv)->card; struct arlan_private *priv = dev->priv;
struct arlan_conf_stru *conf = ((struct arlan_private *) dev->priv)->Conf; volatile struct arlan_shmem *arlan = priv->card;
struct arlan_private *priv = (struct arlan_private *) dev->priv; struct arlan_conf_stru *conf = priv->Conf;
ARLAN_DEBUG_ENTRY("arlan_hw_config"); ARLAN_DEBUG_ENTRY("arlan_hw_config");
...@@ -935,8 +855,9 @@ static int arlan_hw_config(struct net_device *dev) ...@@ -935,8 +855,9 @@ static int arlan_hw_config(struct net_device *dev)
static int arlan_read_card_configuration(struct net_device *dev) static int arlan_read_card_configuration(struct net_device *dev)
{ {
u_char tlx415; u_char tlx415;
volatile struct arlan_shmem *arlan = ((struct arlan_private *) dev->priv)->card; struct arlan_private *priv = dev->priv;
struct arlan_conf_stru *conf = ((struct arlan_private *) dev->priv)->Conf; volatile struct arlan_shmem *arlan = priv->card;
struct arlan_conf_stru *conf = priv->Conf;
ARLAN_DEBUG_ENTRY("arlan_read_card_configuration"); ARLAN_DEBUG_ENTRY("arlan_read_card_configuration");
...@@ -1036,7 +957,6 @@ static int arlan_read_card_configuration(struct net_device *dev) ...@@ -1036,7 +957,6 @@ static int arlan_read_card_configuration(struct net_device *dev)
conf->siteName[16] = '\0'; conf->siteName[16] = '\0';
conf->retries = retries; conf->retries = retries;
conf->tx_delay_ms = tx_delay_ms; conf->tx_delay_ms = tx_delay_ms;
conf->async = async;
conf->ReTransmitPacketMaxSize = 200; conf->ReTransmitPacketMaxSize = 200;
conf->waitReTransmitPacketMaxSize = 200; conf->waitReTransmitPacketMaxSize = 200;
conf->txAckTimeoutMs = 900; conf->txAckTimeoutMs = 900;
...@@ -1067,7 +987,7 @@ static int __init arlan_check_fingerprint(int memaddr) ...@@ -1067,7 +987,7 @@ static int __init arlan_check_fingerprint(int memaddr)
if (check_mem_region(virt_to_phys((void *)memaddr),0x2000 )){ if (check_mem_region(virt_to_phys((void *)memaddr),0x2000 )){
// printk(KERN_WARNING "arlan: memory region %lx excluded from probing \n",virt_to_phys((void*)memaddr)); // printk(KERN_WARNING "arlan: memory region %lx excluded from probing \n",virt_to_phys((void*)memaddr));
return -ENODEV; return -ENODEV;
}; }
memcpy_fromio(tempBuf, arlan->textRegion, 29); memcpy_fromio(tempBuf, arlan->textRegion, 29);
tempBuf[30] = 0; tempBuf[30] = 0;
...@@ -1128,7 +1048,8 @@ static int __init arlan_probe_everywhere(struct net_device *dev) ...@@ -1128,7 +1048,8 @@ static int __init arlan_probe_everywhere(struct net_device *dev)
static int arlan_change_mtu(struct net_device *dev, int new_mtu) static int arlan_change_mtu(struct net_device *dev, int new_mtu)
{ {
struct arlan_conf_stru *conf = ((struct arlan_private *) dev->priv)->Conf; struct arlan_private *priv = dev->priv;
struct arlan_conf_stru *conf = priv->Conf;
ARLAN_DEBUG_ENTRY("arlan_change_mtu"); ARLAN_DEBUG_ENTRY("arlan_change_mtu");
if (new_mtu > 2032) if (new_mtu > 2032)
...@@ -1217,13 +1138,13 @@ static int __init ...@@ -1217,13 +1138,13 @@ static int __init
dev->tx_timeout = arlan_tx_timeout; dev->tx_timeout = arlan_tx_timeout;
dev->watchdog_timeo = 3*HZ; dev->watchdog_timeo = 3*HZ;
((struct arlan_private *) dev->priv)->irq_test_done = 0; ap->irq_test_done = 0;
arlan_device[num] = dev; arlan_device[num] = dev;
((struct arlan_private *) arlan_device[num]->priv)->Conf = &(arlan_conf[num]); ap->Conf = &arlan_conf[num];
((struct arlan_private *) dev->priv)->Conf->pre_Command_Wait = 40; ap->Conf->pre_Command_Wait = 40;
((struct arlan_private *) dev->priv)->Conf->rx_tweak1 = 30; ap->Conf->rx_tweak1 = 30;
((struct arlan_private *) dev->priv)->Conf->rx_tweak2 = 0; ap->Conf->rx_tweak2 = 0;
ARLAN_DEBUG_EXIT("arlan_allocate_device"); ARLAN_DEBUG_EXIT("arlan_allocate_device");
return (int) dev; return (int) dev;
...@@ -1267,7 +1188,7 @@ static int __init arlan_probe_here(struct net_device *dev, int memaddr) ...@@ -1267,7 +1188,7 @@ static int __init arlan_probe_here(struct net_device *dev, int memaddr)
static int arlan_open(struct net_device *dev) static int arlan_open(struct net_device *dev)
{ {
struct arlan_private *priv = (struct arlan_private *) dev->priv; struct arlan_private *priv = dev->priv;
volatile struct arlan_shmem *arlan = priv->card; volatile struct arlan_shmem *arlan = priv->card;
int ret = 0; int ret = 0;
...@@ -1278,7 +1199,7 @@ static int arlan_open(struct net_device *dev) ...@@ -1278,7 +1199,7 @@ static int arlan_open(struct net_device *dev)
if (ret != 0) if (ret != 0)
return ret; return ret;
arlan = ((struct arlan_private *) dev->priv)->card; arlan = priv->card;
ret = request_irq(dev->irq, &arlan_interrupt, 0, dev->name, dev); ret = request_irq(dev->irq, &arlan_interrupt, 0, dev->name, dev);
if (ret) if (ret)
{ {
...@@ -1291,18 +1212,14 @@ static int arlan_open(struct net_device *dev) ...@@ -1291,18 +1212,14 @@ static int arlan_open(struct net_device *dev)
priv->bad = 0; priv->bad = 0;
priv->lastReset = 0; priv->lastReset = 0;
priv->reset = 0; priv->reset = 0;
priv->open_time = jiffies;
memcpy_fromio(dev->dev_addr, arlan->lanCardNodeId, 6); memcpy_fromio(dev->dev_addr, arlan->lanCardNodeId, 6);
memset(dev->broadcast, 0xff, 6); memset(dev->broadcast, 0xff, 6);
priv->txOffset = 0;
dev->tx_queue_len = tx_queue_len; dev->tx_queue_len = tx_queue_len;
priv->interrupt_processing_active = 0; priv->interrupt_processing_active = 0;
priv->command_lock = 0; spin_lock_init(&priv->lock);
netif_start_queue (dev); netif_start_queue (dev);
init_MUTEX(&priv->card_lock);
myATOMIC_INIT(priv->card_users, 1); /* damn 2.0.33 */
priv->registrationLostCount = 0; priv->registrationLostCount = 0;
priv->registrationLastSeen = jiffies; priv->registrationLastSeen = jiffies;
priv->txLast = 0; priv->txLast = 0;
...@@ -1310,9 +1227,6 @@ static int arlan_open(struct net_device *dev) ...@@ -1310,9 +1227,6 @@ static int arlan_open(struct net_device *dev)
priv->rx_command_given = 0; priv->rx_command_given = 0;
priv->reRegisterExp = 1; priv->reRegisterExp = 1;
priv->nof_tx = 0;
priv->nof_tx_ack = 0;
priv->last_command_was_rx = 0;
priv->tx_last_sent = jiffies - 1; priv->tx_last_sent = jiffies - 1;
priv->tx_last_cleared = jiffies; priv->tx_last_cleared = jiffies;
priv->Conf->writeEEPROM = 0; priv->Conf->writeEEPROM = 0;
...@@ -1327,12 +1241,6 @@ static int arlan_open(struct net_device *dev) ...@@ -1327,12 +1241,6 @@ static int arlan_open(struct net_device *dev)
mdelay(200); mdelay(200);
add_timer(&priv->timer); add_timer(&priv->timer);
#ifdef CONFIG_PROC_FS
#ifndef MODULE
if (arlan_device[0])
init_arlan_proc();
#endif
#endif
ARLAN_DEBUG_EXIT("arlan_open"); ARLAN_DEBUG_EXIT("arlan_open");
return 0; return 0;
} }
...@@ -1350,7 +1258,6 @@ static void arlan_tx_timeout (struct net_device *dev) ...@@ -1350,7 +1258,6 @@ static void arlan_tx_timeout (struct net_device *dev)
static int arlan_tx(struct sk_buff *skb, struct net_device *dev) static int arlan_tx(struct sk_buff *skb, struct net_device *dev)
{ {
struct arlan_private *priv = ((struct arlan_private *) dev->priv);
short length; short length;
unsigned char *buf; unsigned char *buf;
...@@ -1359,7 +1266,7 @@ static int arlan_tx(struct sk_buff *skb, struct net_device *dev) ...@@ -1359,7 +1266,7 @@ static int arlan_tx(struct sk_buff *skb, struct net_device *dev)
length = ETH_ZLEN < skb->len ? skb->len : ETH_ZLEN; length = ETH_ZLEN < skb->len ? skb->len : ETH_ZLEN;
buf = skb->data; buf = skb->data;
if (priv->txOffset + length + 0x12 > 0x800) { if (length + 0x12 > 0x800) {
printk(KERN_ERR "TX RING overflow \n"); printk(KERN_ERR "TX RING overflow \n");
netif_stop_queue (dev); netif_stop_queue (dev);
} }
...@@ -1372,13 +1279,11 @@ static int arlan_tx(struct sk_buff *skb, struct net_device *dev) ...@@ -1372,13 +1279,11 @@ static int arlan_tx(struct sk_buff *skb, struct net_device *dev)
dev_kfree_skb(skb); dev_kfree_skb(skb);
arlan_process_interrupt(dev); arlan_process_interrupt(dev);
priv->tx_chain_active = 0;
ARLAN_DEBUG_EXIT("arlan_tx"); ARLAN_DEBUG_EXIT("arlan_tx");
return 0; return 0;
bad_end: bad_end:
arlan_process_interrupt(dev); arlan_process_interrupt(dev);
priv->tx_chain_active = 0;
netif_stop_queue (dev); netif_stop_queue (dev);
ARLAN_DEBUG_EXIT("arlan_tx"); ARLAN_DEBUG_EXIT("arlan_tx");
return 1; return 1;
...@@ -1387,7 +1292,7 @@ static int arlan_tx(struct sk_buff *skb, struct net_device *dev) ...@@ -1387,7 +1292,7 @@ static int arlan_tx(struct sk_buff *skb, struct net_device *dev)
static inline int DoNotReTransmitCrap(struct net_device *dev) static inline int DoNotReTransmitCrap(struct net_device *dev)
{ {
struct arlan_private *priv = ((struct arlan_private *) dev->priv); struct arlan_private *priv = dev->priv;
if (TXLAST(dev).length < priv->Conf->ReTransmitPacketMaxSize) if (TXLAST(dev).length < priv->Conf->ReTransmitPacketMaxSize)
return 1; return 1;
...@@ -1397,7 +1302,7 @@ static inline int DoNotReTransmitCrap(struct net_device *dev) ...@@ -1397,7 +1302,7 @@ static inline int DoNotReTransmitCrap(struct net_device *dev)
static inline int DoNotWaitReTransmitCrap(struct net_device *dev) static inline int DoNotWaitReTransmitCrap(struct net_device *dev)
{ {
struct arlan_private *priv = ((struct arlan_private *) dev->priv); struct arlan_private *priv = dev->priv;
if (TXLAST(dev).length < priv->Conf->waitReTransmitPacketMaxSize) if (TXLAST(dev).length < priv->Conf->waitReTransmitPacketMaxSize)
return 1; return 1;
...@@ -1406,7 +1311,7 @@ static inline int DoNotWaitReTransmitCrap(struct net_device *dev) ...@@ -1406,7 +1311,7 @@ static inline int DoNotWaitReTransmitCrap(struct net_device *dev)
static inline void arlan_queue_retransmit(struct net_device *dev) static inline void arlan_queue_retransmit(struct net_device *dev)
{ {
struct arlan_private *priv = ((struct arlan_private *) dev->priv); struct arlan_private *priv = dev->priv;
ARLAN_DEBUG_ENTRY("arlan_queue_retransmit"); ARLAN_DEBUG_ENTRY("arlan_queue_retransmit");
...@@ -1417,11 +1322,11 @@ static inline void arlan_queue_retransmit(struct net_device *dev) ...@@ -1417,11 +1322,11 @@ static inline void arlan_queue_retransmit(struct net_device *dev)
priv->ReTransmitRequested++; priv->ReTransmitRequested++;
ARLAN_DEBUG_EXIT("arlan_queue_retransmit"); ARLAN_DEBUG_EXIT("arlan_queue_retransmit");
}; }
static inline void RetryOrFail(struct net_device *dev) static inline void RetryOrFail(struct net_device *dev)
{ {
struct arlan_private *priv = ((struct arlan_private *) dev->priv); struct arlan_private *priv = dev->priv;
ARLAN_DEBUG_ENTRY("RetryOrFail"); ARLAN_DEBUG_ENTRY("RetryOrFail");
...@@ -1442,13 +1347,12 @@ static inline void RetryOrFail(struct net_device *dev) ...@@ -1442,13 +1347,12 @@ static inline void RetryOrFail(struct net_device *dev)
static void arlan_tx_done_interrupt(struct net_device *dev, int status) static void arlan_tx_done_interrupt(struct net_device *dev, int status)
{ {
struct arlan_private *priv = ((struct arlan_private *) dev->priv); struct arlan_private *priv = dev->priv;
ARLAN_DEBUG_ENTRY("arlan_tx_done_interrupt"); ARLAN_DEBUG_ENTRY("arlan_tx_done_interrupt");
priv->tx_last_cleared = jiffies; priv->tx_last_cleared = jiffies;
priv->tx_command_given = 0; priv->tx_command_given = 0;
priv->nof_tx_ack++;
switch (status) switch (status)
{ {
case 1: case 1:
...@@ -1477,7 +1381,6 @@ static void arlan_tx_done_interrupt(struct net_device *dev, int status) ...@@ -1477,7 +1381,6 @@ static void arlan_tx_done_interrupt(struct net_device *dev, int status)
} }
if (!TXHEAD(dev).offset || !TXTAIL(dev).offset) if (!TXHEAD(dev).offset || !TXTAIL(dev).offset)
{ {
priv->txOffset = 0;
netif_wake_queue (dev); netif_wake_queue (dev);
} }
} }
...@@ -1586,7 +1489,7 @@ static void arlan_rx_interrupt(struct net_device *dev, u_char rxStatus, u_short ...@@ -1586,7 +1489,7 @@ static void arlan_rx_interrupt(struct net_device *dev, u_char rxStatus, u_short
char *skbtmp; char *skbtmp;
int i = 0; int i = 0;
struct arlan_private *priv = (struct arlan_private *) dev->priv; struct arlan_private *priv = dev->priv;
volatile struct arlan_shmem *arlan = priv->card; volatile struct arlan_shmem *arlan = priv->card;
struct arlan_conf_stru *conf = priv->Conf; struct arlan_conf_stru *conf = priv->Conf;
...@@ -1609,13 +1512,13 @@ static void arlan_rx_interrupt(struct net_device *dev, u_char rxStatus, u_short ...@@ -1609,13 +1512,13 @@ static void arlan_rx_interrupt(struct net_device *dev, u_char rxStatus, u_short
priv->in_bytes10 += pkt_len; priv->in_bytes10 += pkt_len;
if (conf->measure_rate < 1) if (conf->measure_rate < 1)
conf->measure_rate = 1; conf->measure_rate = 1;
if (jiffies - priv->in_time > conf->measure_rate * HZ) if (time_after(jiffies, priv->in_time + conf->measure_rate * HZ))
{ {
conf->in_speed = priv->in_bytes / conf->measure_rate; conf->in_speed = priv->in_bytes / conf->measure_rate;
priv->in_bytes = 0; priv->in_bytes = 0;
priv->in_time = jiffies; priv->in_time = jiffies;
} }
if (jiffies - priv->in_time10 > conf->measure_rate * HZ * 10) if (time_after(jiffies, priv->in_time10 + conf->measure_rate * 10*HZ))
{ {
conf->in_speed10 = priv->in_bytes10 / (10 * conf->measure_rate); conf->in_speed10 = priv->in_bytes10 / (10 * conf->measure_rate);
priv->in_bytes10 = 0; priv->in_bytes10 = 0;
...@@ -1738,7 +1641,7 @@ static void arlan_rx_interrupt(struct net_device *dev, u_char rxStatus, u_short ...@@ -1738,7 +1641,7 @@ static void arlan_rx_interrupt(struct net_device *dev, u_char rxStatus, u_short
static void arlan_process_interrupt(struct net_device *dev) static void arlan_process_interrupt(struct net_device *dev)
{ {
struct arlan_private *priv = (struct arlan_private *) dev->priv; struct arlan_private *priv = dev->priv;
volatile struct arlan_shmem *arlan = priv->card; volatile struct arlan_shmem *arlan = priv->card;
u_char rxStatus = READSHMB(arlan->rxStatus); u_char rxStatus = READSHMB(arlan->rxStatus);
u_char txStatus = READSHMB(arlan->txStatus); u_char txStatus = READSHMB(arlan->txStatus);
...@@ -1758,7 +1661,7 @@ static void arlan_process_interrupt(struct net_device *dev) ...@@ -1758,7 +1661,7 @@ static void arlan_process_interrupt(struct net_device *dev)
&& (interrupt_count < 5)) && (interrupt_count < 5))
{ {
if (rxStatus) if (rxStatus)
priv->last_rx_int_ack_time = arlan_time(); priv->last_rx_int_ack_time = jiffies;
arlan_command(dev, ARLAN_COMMAND_INT_ACK); arlan_command(dev, ARLAN_COMMAND_INT_ACK);
arlan_command(dev, ARLAN_COMMAND_INT_ENABLE); arlan_command(dev, ARLAN_COMMAND_INT_ENABLE);
...@@ -1770,7 +1673,6 @@ static void arlan_process_interrupt(struct net_device *dev) ...@@ -1770,7 +1673,6 @@ static void arlan_process_interrupt(struct net_device *dev)
if (rxStatus == 0 && txStatus == 0) if (rxStatus == 0 && txStatus == 0)
{ {
priv->last_command_was_rx = 0;
if (priv->irq_test_done) if (priv->irq_test_done)
{ {
if (!registrationBad(dev)) if (!registrationBad(dev))
...@@ -1797,7 +1699,6 @@ static void arlan_process_interrupt(struct net_device *dev) ...@@ -1797,7 +1699,6 @@ static void arlan_process_interrupt(struct net_device *dev)
} }
if (rxStatus > 2 && rxStatus < 0xff) if (rxStatus > 2 && rxStatus < 0xff)
{ {
priv->last_command_was_rx = 0;
WRITESHMB(arlan->rxStatus, 0x00); WRITESHMB(arlan->rxStatus, 0x00);
printk(KERN_ERR "%s unknown rxStatus reason tx %d rx %d ", printk(KERN_ERR "%s unknown rxStatus reason tx %d rx %d ",
dev->name, txStatus, rxStatus); dev->name, txStatus, rxStatus);
...@@ -1805,7 +1706,6 @@ static void arlan_process_interrupt(struct net_device *dev) ...@@ -1805,7 +1706,6 @@ static void arlan_process_interrupt(struct net_device *dev)
} }
if (rxStatus == 0xff) if (rxStatus == 0xff)
{ {
priv->last_command_was_rx = 0;
WRITESHMB(arlan->rxStatus, 0x00); WRITESHMB(arlan->rxStatus, 0x00);
arlan_command(dev, ARLAN_COMMAND_RX); arlan_command(dev, ARLAN_COMMAND_RX);
if (registrationBad(dev)) if (registrationBad(dev))
...@@ -1844,7 +1744,7 @@ static void arlan_process_interrupt(struct net_device *dev) ...@@ -1844,7 +1744,7 @@ static void arlan_process_interrupt(struct net_device *dev)
static irqreturn_t arlan_interrupt(int irq, void *dev_id, struct pt_regs *regs) static irqreturn_t arlan_interrupt(int irq, void *dev_id, struct pt_regs *regs)
{ {
struct net_device *dev = dev_id; struct net_device *dev = dev_id;
struct arlan_private *priv = (struct arlan_private *) dev->priv; struct arlan_private *priv = dev->priv;
volatile struct arlan_shmem *arlan = priv->card; volatile struct arlan_shmem *arlan = priv->card;
u_char rxStatus = READSHMB(arlan->rxStatus); u_char rxStatus = READSHMB(arlan->rxStatus);
u_char txStatus = READSHMB(arlan->txStatus); u_char txStatus = READSHMB(arlan->txStatus);
...@@ -1867,14 +1767,8 @@ static irqreturn_t arlan_interrupt(int irq, void *dev_id, struct pt_regs *regs) ...@@ -1867,14 +1767,8 @@ static irqreturn_t arlan_interrupt(int irq, void *dev_id, struct pt_regs *regs)
static int arlan_close(struct net_device *dev) static int arlan_close(struct net_device *dev)
{ {
struct arlan_private *priv = (struct arlan_private *) dev->priv; struct arlan_private *priv = dev->priv;
if (!dev)
{
printk(KERN_CRIT "arlan: No Device\n");
return 0;
}
priv = (struct arlan_private *) dev->priv;
if (!priv) if (!priv)
{ {
printk(KERN_CRIT "arlan: No Device priv \n"); printk(KERN_CRIT "arlan: No Device priv \n");
...@@ -1889,7 +1783,6 @@ static int arlan_close(struct net_device *dev) ...@@ -1889,7 +1783,6 @@ static int arlan_close(struct net_device *dev)
IFDEBUG(ARLAN_DEBUG_STARTUP) IFDEBUG(ARLAN_DEBUG_STARTUP)
printk(KERN_NOTICE "%s: Closing device\n", dev->name); printk(KERN_NOTICE "%s: Closing device\n", dev->name);
priv->open_time = 0;
netif_stop_queue(dev); netif_stop_queue(dev);
free_irq(dev->irq, dev); free_irq(dev->irq, dev);
...@@ -1913,8 +1806,8 @@ static long alignLong(volatile u_char * ptr) ...@@ -1913,8 +1806,8 @@ static long alignLong(volatile u_char * ptr)
static struct net_device_stats *arlan_statistics(struct net_device *dev) static struct net_device_stats *arlan_statistics(struct net_device *dev)
{ {
struct arlan_private *priv = (struct arlan_private *) dev->priv; struct arlan_private *priv = dev->priv;
volatile struct arlan_shmem *arlan = ((struct arlan_private *) dev->priv)->card; volatile struct arlan_shmem *arlan = priv->card;
ARLAN_DEBUG_ENTRY("arlan_statistics"); ARLAN_DEBUG_ENTRY("arlan_statistics");
...@@ -1943,8 +1836,9 @@ static struct net_device_stats *arlan_statistics(struct net_device *dev) ...@@ -1943,8 +1836,9 @@ static struct net_device_stats *arlan_statistics(struct net_device *dev)
static void arlan_set_multicast(struct net_device *dev) static void arlan_set_multicast(struct net_device *dev)
{ {
volatile struct arlan_shmem *arlan = ((struct arlan_private *) dev->priv)->card; struct arlan_private *priv = dev->priv;
struct arlan_conf_stru *conf = ((struct arlan_private *) dev->priv)->Conf; volatile struct arlan_shmem *arlan = priv->card;
struct arlan_conf_stru *conf = priv->Conf;
int board_conf_needed = 0; int board_conf_needed = 0;
...@@ -1982,9 +1876,6 @@ int __init arlan_probe(struct net_device *dev) ...@@ -1982,9 +1876,6 @@ int __init arlan_probe(struct net_device *dev)
return -ENODEV; return -ENODEV;
arlans_found++; arlans_found++;
if (arlans_found == 1)
siteName = kmalloc(100, GFP_KERNEL);
return 0; return 0;
} }
...@@ -2021,10 +1912,6 @@ int init_module(void) ...@@ -2021,10 +1912,6 @@ int init_module(void)
if (numDevices == 0) if (numDevices == 0)
return -ENODEV; return -ENODEV;
siteName = kmalloc(100, GFP_KERNEL);
if(siteName==NULL)
return -ENOMEM;
for (i = 0; i < numDevices && i < MAX_ARLANS; i++) for (i = 0; i < numDevices && i < MAX_ARLANS; i++)
{ {
if (!arlan_allocate_device(i, NULL)) if (!arlan_allocate_device(i, NULL))
...@@ -2037,6 +1924,7 @@ int init_module(void) ...@@ -2037,6 +1924,7 @@ int init_module(void)
arlan_probe_everywhere(arlan_device[i]); arlan_probe_everywhere(arlan_device[i]);
// arlan_command(arlan_device[i], ARLAN_COMMAND_POWERDOWN ); // arlan_command(arlan_device[i], ARLAN_COMMAND_POWERDOWN );
} }
init_arlan_proc();
printk(KERN_INFO "Arlan driver %s\n", arlan_version); printk(KERN_INFO "Arlan driver %s\n", arlan_version);
ARLAN_DEBUG_EXIT("init_module"); ARLAN_DEBUG_EXIT("init_module");
return 0; return 0;
...@@ -2052,6 +1940,9 @@ void cleanup_module(void) ...@@ -2052,6 +1940,9 @@ void cleanup_module(void)
IFDEBUG(ARLAN_DEBUG_SHUTDOWN) IFDEBUG(ARLAN_DEBUG_SHUTDOWN)
printk(KERN_INFO "arlan: unloading module\n"); printk(KERN_INFO "arlan: unloading module\n");
cleanup_arlan_proc();
for (i = 0; i < MAX_ARLANS; i++) for (i = 0; i < MAX_ARLANS; i++)
{ {
if (arlan_device[i]) if (arlan_device[i])
......
...@@ -108,7 +108,7 @@ static const char *arlan_diagnostic_info_string(struct net_device *dev) ...@@ -108,7 +108,7 @@ static const char *arlan_diagnostic_info_string(struct net_device *dev)
default: default:
return "ERROR unknown Diagnostic info reply code "; return "ERROR unknown Diagnostic info reply code ";
} }
}; }
static const char *arlan_hardware_type_string(struct net_device *dev) static const char *arlan_hardware_type_string(struct net_device *dev)
{ {
...@@ -866,7 +866,6 @@ static int arlan_sysctl_reset(ctl_table * ctl, int write, struct file *filp, ...@@ -866,7 +866,6 @@ static int arlan_sysctl_reset(ctl_table * ctl, int write, struct file *filp,
CTBLN(32,cardNo,lParameter),\ CTBLN(32,cardNo,lParameter),\
CTBLN(33,cardNo,_15),\ CTBLN(33,cardNo,_15),\
CTBLN(34,cardNo,headerSize),\ CTBLN(34,cardNo,headerSize),\
CTBLN(35,cardNo,async),\
CTBLN(36,cardNo,tx_delay_ms),\ CTBLN(36,cardNo,tx_delay_ms),\
CTBLN(37,cardNo,retries),\ CTBLN(37,cardNo,retries),\
CTBLN(38,cardNo,ReTransmitPacketMaxSize),\ CTBLN(38,cardNo,ReTransmitPacketMaxSize),\
...@@ -1233,7 +1232,7 @@ static ctl_table arlan_root_table[] = ...@@ -1233,7 +1232,7 @@ static ctl_table arlan_root_table[] =
static struct ctl_table_header *arlan_device_sysctl_header; static struct ctl_table_header *arlan_device_sysctl_header;
int init_arlan_proc(void) int __init init_arlan_proc(void)
{ {
int i = 0; int i = 0;
...@@ -1247,25 +1246,11 @@ int init_arlan_proc(void) ...@@ -1247,25 +1246,11 @@ int init_arlan_proc(void)
return 0; return 0;
}; }
#ifdef MODULE
int init_module(void)
{
return init_arlan_proc();
};
void cleanup_module(void) void __exit cleanup_arlan_proc(void)
{ {
unregister_sysctl_table(arlan_device_sysctl_header); unregister_sysctl_table(arlan_device_sysctl_header);
arlan_device_sysctl_header = NULL; arlan_device_sysctl_header = NULL;
return; }
};
#endif // MODULE
MODULE_LICENSE("GPL");
...@@ -39,14 +39,16 @@ ...@@ -39,14 +39,16 @@
#define ARLAN_RCV_PROMISC 1 #define ARLAN_RCV_PROMISC 1
#define ARLAN_RCV_CONTROL 2 #define ARLAN_RCV_CONTROL 2
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS
extern int init_arlan_proc(void); extern int init_arlan_proc(void);
extern void cleanup_arlan_proc(void);
#else
#define init_arlan_proc() (0)
#define cleanup_arlan_proc() do { } while (0);
#endif #endif
extern struct net_device *arlan_device[MAX_ARLANS]; extern struct net_device *arlan_device[MAX_ARLANS];
extern int arlan_debug; extern int arlan_debug;
extern char * siteName;
extern int arlan_entry_debug; extern int arlan_entry_debug;
extern int arlan_exit_debug; extern int arlan_exit_debug;
extern int testMemory; extern int testMemory;
...@@ -67,8 +69,6 @@ extern int arlan_command(struct net_device * dev, int command); ...@@ -67,8 +69,6 @@ extern int arlan_command(struct net_device * dev, int command);
#define channelSetUNKNOWN 0 #define channelSetUNKNOWN 0
#define systemIdUNKNOWN -1 #define systemIdUNKNOWN -1
#define registrationModeUNKNOWN -1 #define registrationModeUNKNOWN -1
#define siteNameUNKNOWN "LinuxSite"
#define IFDEBUG( L ) if ( (L) & arlan_debug ) #define IFDEBUG( L ) if ( (L) & arlan_debug )
...@@ -293,7 +293,6 @@ struct arlan_conf_stru { ...@@ -293,7 +293,6 @@ struct arlan_conf_stru {
int lParameter; int lParameter;
int _15; int _15;
int headerSize; int headerSize;
int async;
int retries; int retries;
int tx_delay_ms; int tx_delay_ms;
int waitReTransmitPacketMaxSize; int waitReTransmitPacketMaxSize;
...@@ -332,83 +331,56 @@ struct TxParam ...@@ -332,83 +331,56 @@ struct TxParam
volatile unsigned char scrambled; volatile unsigned char scrambled;
}; };
struct TxRingPoint {
struct TxParam txParam;
};
#define TX_RING_SIZE 2 #define TX_RING_SIZE 2
/* Information that need to be kept for each board. */ /* Information that need to be kept for each board. */
struct arlan_private { struct arlan_private {
struct net_device_stats stats; struct net_device_stats stats;
long open_time; /* Useless example local info. */
struct arlan_shmem * card; struct arlan_shmem * card;
struct arlan_shmem * conf; struct arlan_shmem * conf;
struct TxParam txParam;
int multicastLength;
char multicastList[ARLAN_MAX_MULTICAST_ADDRS][6];
int promiscModeEnabled;
struct arlan_conf_stru * Conf; struct arlan_conf_stru * Conf;
int bad; int bad;
int reset; int reset;
long long lastReset; unsigned long lastReset;
struct timer_list timer; struct timer_list timer;
struct timer_list tx_delay_timer; struct timer_list tx_delay_timer;
struct timer_list tx_retry_timer; struct timer_list tx_retry_timer;
struct timer_list rx_check_timer; struct timer_list rx_check_timer;
struct semaphore card_lock;
atomic_t card_users;
atomic_t delay_on;
atomic_t retr_on;
int registrationLostCount; int registrationLostCount;
int reRegisterExp; int reRegisterExp;
int nof_tx;
int nof_tx_ack;
int last_nof_tx;
int last_nof_tx_ack;
int irq_test_done; int irq_test_done;
int last_command_was_rx;
struct TxParam txRing[TX_RING_SIZE]; struct TxParam txRing[TX_RING_SIZE];
char reTransmitBuff[0x800]; char reTransmitBuff[0x800];
volatile int txLast; int txLast;
volatile int txNew; unsigned ReTransmitRequested;
volatile int txOffset; unsigned long tx_done_delayed;
volatile char ReTransmitRequested; unsigned long registrationLastSeen;
volatile unsigned long tx_done_delayed;
volatile long long registrationLastSeen; unsigned long tx_last_sent;
volatile char under_command; unsigned long tx_last_cleared;
volatile char under_toggle; unsigned long retransmissions;
volatile long long tx_last_sent; unsigned long interrupt_ack_requested;
volatile long long tx_last_cleared; spinlock_t lock;
volatile u_char under_tx; unsigned long waiting_command_mask;
volatile int retransmissions; unsigned long card_polling_interval;
volatile int tx_chain_active; unsigned long last_command_buff_free_time;
volatile int timer_chain_active;
volatile int interrupt_ack_requested; int under_reset;
volatile long command_lock; int under_config;
volatile int rx_command_needed; int rx_command_given;
volatile int tx_command_needed; int tx_command_given;
volatile int waiting_command_mask; unsigned long interrupt_processing_active;
volatile int card_polling_interval; unsigned long last_rx_int_ack_time;
volatile int last_command_buff_free_time; unsigned long in_bytes;
volatile int numResets; unsigned long out_bytes;
volatile int under_reset; unsigned long in_time;
volatile int under_config; unsigned long out_time;
volatile int rx_command_given; unsigned long in_time10;
volatile long tx_command_given; unsigned long out_time10;
volatile long interrupt_processing_active; unsigned long in_bytes10;
volatile long long last_tx_time; unsigned long out_bytes10;
volatile long long last_rx_time;
volatile long long last_rx_int_ack_time;
int in_bytes;
int out_bytes;
int in_time;
int out_time;
int in_time10;
int out_time10;
int in_bytes10;
int out_bytes10;
int init_etherdev_alloc; int init_etherdev_alloc;
}; };
...@@ -497,13 +469,11 @@ struct arlan_private { ...@@ -497,13 +469,11 @@ struct arlan_private {
#define arlan_interrupt_lancpu(dev) {\ #define arlan_interrupt_lancpu(dev) {\
int cr; \ int cr; \
\ \
priv->under_toggle++; \
cr = readControlRegister(dev);\ cr = readControlRegister(dev);\
if (cr & ARLAN_CHANNEL_ATTENTION){ \ if (cr & ARLAN_CHANNEL_ATTENTION){ \
writeControlRegister(dev, (cr & ~ARLAN_CHANNEL_ATTENTION));\ writeControlRegister(dev, (cr & ~ARLAN_CHANNEL_ATTENTION));\
}else \ }else \
writeControlRegister(dev, (cr | ARLAN_CHANNEL_ATTENTION));\ writeControlRegister(dev, (cr | ARLAN_CHANNEL_ATTENTION));\
priv->under_toggle=0; \
} }
#define clearChannelAttention(dev){ \ #define clearChannelAttention(dev){ \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment