Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
662c8869
Commit
662c8869
authored
Sep 25, 2003
by
Linus Torvalds
Browse files
Options
Browse Files
Download
Plain Diff
Merge
bk://kernel.bkbits.net/jgarzik/net-drivers-2.5
into home.osdl.org:/home/torvalds/v2.5/linux
parents
3cd77e0c
f96d1ee4
Changes
40
Show whitespace changes
Inline
Side-by-side
Showing
40 changed files
with
956 additions
and
1442 deletions
+956
-1442
Documentation/networking/sk98lin.txt
Documentation/networking/sk98lin.txt
+11
-222
drivers/net/3c503.c
drivers/net/3c503.c
+0
-9
drivers/net/3c509.c
drivers/net/3c509.c
+5
-4
drivers/net/8390.c
drivers/net/8390.c
+0
-11
drivers/net/Kconfig
drivers/net/Kconfig
+24
-150
drivers/net/ac3200.c
drivers/net/ac3200.c
+0
-10
drivers/net/arcnet/Kconfig
drivers/net/arcnet/Kconfig
+15
-25
drivers/net/e2100.c
drivers/net/e2100.c
+0
-10
drivers/net/hamradio/baycom_epp.c
drivers/net/hamradio/baycom_epp.c
+42
-37
drivers/net/hamradio/baycom_par.c
drivers/net/hamradio/baycom_par.c
+27
-32
drivers/net/hamradio/baycom_ser_fdx.c
drivers/net/hamradio/baycom_ser_fdx.c
+27
-33
drivers/net/hamradio/baycom_ser_hdx.c
drivers/net/hamradio/baycom_ser_hdx.c
+27
-32
drivers/net/hamradio/hdlcdrv.c
drivers/net/hamradio/hdlcdrv.c
+35
-55
drivers/net/hp-plus.c
drivers/net/hp-plus.c
+0
-11
drivers/net/hp.c
drivers/net/hp.c
+0
-11
drivers/net/ne.c
drivers/net/ne.c
+0
-9
drivers/net/ne2.c
drivers/net/ne2.c
+0
-8
drivers/net/ne2k-pci.c
drivers/net/ne2k-pci.c
+38
-11
drivers/net/ne2k_cbus.c
drivers/net/ne2k_cbus.c
+14
-41
drivers/net/saa9730.c
drivers/net/saa9730.c
+148
-49
drivers/net/saa9730.h
drivers/net/saa9730.h
+1
-0
drivers/net/sk98lin/h/skdrv1st.h
drivers/net/sk98lin/h/skdrv1st.h
+5
-2
drivers/net/sk98lin/h/skdrv2nd.h
drivers/net/sk98lin/h/skdrv2nd.h
+20
-4
drivers/net/sk98lin/h/skgeinit.h
drivers/net/sk98lin/h/skgeinit.h
+9
-10
drivers/net/sk98lin/h/sktypes.h
drivers/net/sk98lin/h/sktypes.h
+5
-2
drivers/net/sk98lin/h/skversion.h
drivers/net/sk98lin/h/skversion.h
+16
-5
drivers/net/sk98lin/skdim.c
drivers/net/sk98lin/skdim.c
+15
-3
drivers/net/sk98lin/skge.c
drivers/net/sk98lin/skge.c
+258
-84
drivers/net/sk98lin/skproc.c
drivers/net/sk98lin/skproc.c
+59
-228
drivers/net/smc-ultra.c
drivers/net/smc-ultra.c
+0
-13
drivers/net/tlan.c
drivers/net/tlan.c
+6
-1
drivers/net/tulip/Kconfig
drivers/net/tulip/Kconfig
+18
-30
drivers/net/wd.c
drivers/net/wd.c
+0
-10
drivers/net/wireless/Makefile
drivers/net/wireless/Makefile
+3
-1
drivers/net/wireless/arlan-main.c
drivers/net/wireless/arlan-main.c
+81
-190
drivers/net/wireless/arlan-proc.c
drivers/net/wireless/arlan-proc.c
+5
-20
drivers/net/wireless/arlan.h
drivers/net/wireless/arlan.h
+37
-67
drivers/net/wireless/atmel.c
drivers/net/wireless/atmel.c
+1
-1
drivers/net/wireless/atmel_cs.c
drivers/net/wireless/atmel_cs.c
+3
-1
include/linux/hdlcdrv.h
include/linux/hdlcdrv.h
+1
-0
No files found.
Documentation/networking/sk98lin.txt
View file @
662c8869
...
...
@@ -2,9 +2,9 @@
All rights reserved
===========================================================================
sk98lin.txt created
18-Jul
-2003
sk98lin.txt created
23-Sep
-2003
Readme File for sk98lin v6.1
4
Readme File for sk98lin v6.1
8
Marvell Yukon/SysKonnect SK-98xx Gigabit Ethernet Adapter family driver for LINUX
This file contains
...
...
@@ -19,7 +19,6 @@ This file contains
5 Large Frame Support
6 VLAN and Link Aggregation Support (IEEE 802.1, 802.1q, 802.3ad)
7 Troubleshooting
8 History
===========================================================================
...
...
@@ -76,8 +75,8 @@ follows:
To integrate the driver permanently into the kernel, proceed as follows:
1. Select the menu "Network device support" and then "Ethernet(1000Mbit)"
2. Mark "Marvell Yukon
/SysKonnect SK-98xx/SK-95xx Gigabit Ethernet Adapter
support"
with (*)
2. Mark "Marvell Yukon
Chipset / SysKonnect SK-98xx family support"
with (*)
3. Build a new kernel when the configuration of the above options is
finished.
4. Install the new kernel.
...
...
@@ -88,8 +87,8 @@ To use the driver as a module, proceed as follows:
1. Enable 'loadable module support' in the kernel.
2. For automatic driver start, enable the 'Kernel module loader'.
3. Select the menu "Network device support" and then "Ethernet(1000Mbit)"
4. Mark "Marvell Yukon
/SysKonnect SK-98xx/SK-95xx Gigabit Ethernet Adapter
support"
with (M)
4. Mark "Marvell Yukon
Chipset / SysKonnect SK-98xx family support"
with (M)
5. Execute the command "make modules".
6. Execute the command "make modules_install".
The appropiate modules will be installed.
...
...
@@ -201,7 +200,7 @@ You also want to set DuplexCapabilities on the first adapter
to FULL, and on the second adapter to HALF.
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
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
port reports during auto-negotiation. It can be set for each port
individually.
Possible modes:
-- Sym = Symetric: both link partners are allowed to send
-- Sym = Sym
m
etric: both link partners are allowed to send
PAUSE frames
-- SymOrRem = SymetricOrRemote: both or only remote partner
-- SymOrRem = Sym
m
etricOrRemote: both or only remote partner
are allowed to send PAUSE frames
-- LocSend = LocalSend: only local link partner is allowed
to send PAUSE frames
...
...
@@ -286,7 +285,7 @@ with this parameter.
4.2 Adapter Parameters
-----------------------
Connection Type
Connection Type
(SK-98xx V2.0 copper adapters only)
---------------
Parameter: ConType
Values: Auto, 100FD, 100HD, 10FD, 10HD
...
...
@@ -546,7 +545,7 @@ Problem: Upon driver start, the following error message is displayed:
Nr: 0xcc
Msg: SkGeInitPort() cannot init running ports"
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 (Sym
m
etric MultiProcessor)
kernel.
Solution: Configure your kernel appropriately and recompile the kernel or
the modules.
...
...
@@ -564,216 +563,6 @@ information is available:
- 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***
drivers/net/3c503.c
View file @
662c8869
...
...
@@ -692,12 +692,3 @@ cleanup_module(void)
}
}
#endif
/* MODULE */
/*
* Local variables:
* version-control: t
* kept-new-versions: 5
* c-indent-level: 4
* End:
*/
drivers/net/3c509.c
View file @
662c8869
...
...
@@ -382,9 +382,7 @@ static int __init el3_probe(int card_idx)
#if defined(__ISAPNP__) && !defined(CONFIG_X86_PC9800)
static
int
pnp_cards
;
struct
pnp_dev
*
idev
=
NULL
;
#endif
/* __ISAPNP__ */
#if defined(__ISAPNP__) && !defined(CONFIG_X86_PC9800)
if
(
nopnp
==
1
)
goto
no_pnp
;
...
...
@@ -440,12 +438,15 @@ static int __init el3_probe(int card_idx)
#else
/* Select an open I/O location at 0x1*0 to do contention select. */
for
(
;
id_port
<
0x200
;
id_port
+=
0x10
)
{
if
(
check_region
(
id_port
,
1
))
if
(
!
request_region
(
id_port
,
1
,
"3c509"
))
continue
;
outb
(
0x00
,
id_port
);
outb
(
0xff
,
id_port
);
if
(
inb
(
id_port
)
&
0x01
)
if
(
inb
(
id_port
)
&
0x01
){
release_region
(
id_port
,
1
);
break
;
}
else
release_region
(
id_port
,
1
);
}
if
(
id_port
>=
0x200
)
{
/* Rare -- do we really need a warning? */
...
...
drivers/net/8390.c
View file @
662c8869
...
...
@@ -1173,14 +1173,3 @@ void cleanup_module(void)
#endif
/* MODULE */
MODULE_LICENSE
(
"GPL"
);
/*
* Local variables:
* compile-command: "gcc -D__KERNEL__ -I/usr/src/linux/net/inet -Wall -Wstrict-prototypes -O6 -m486 -c 8390.c"
* version-control: t
* kept-new-versions: 5
* c-indent-level: 4
* tab-width: 4
* End:
*/
drivers/net/Kconfig
View file @
662c8869
...
...
@@ -1891,18 +1891,23 @@ config SK98LIN
by this driver:
- 3Com 3C940 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/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/2TX 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
- N-Way PCI-Bus Giga-Card 1000/100/10Mbps(L)
- DGE-530T Gigabit Ethernet Adapter
- EG1032 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-8002 Adapter
- Marvell RDK-8003 Adapter
...
...
@@ -1911,27 +1916,31 @@ config SK98LIN
- Marvell RDK-8007 Adapter
- Marvell RDK-8008 Adapter
- Marvell RDK-8009 Adapter
- Marvell RDK-8010 Adapter
- Marvell RDK-8011 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 V2.0 Gigabit Ethernet 10/100/1000Base-T Adapter
- SK-9822 Gigabit Ethernet Server Adapter (SK-NET GE-T dual link)
- 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-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-9851 V2.0 Gigabit Ethernet 1000Base-SX Adapter
- 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-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-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 dual link adapters support link-failover and dual port features.
...
...
@@ -1945,141 +1954,6 @@ config SK98LIN
To compile this driver as a module, choose M here: the module
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
tristate "Broadcom Tigon3 support"
depends on PCI
...
...
drivers/net/ac3200.c
View file @
662c8869
...
...
@@ -396,13 +396,3 @@ cleanup_module(void)
}
}
#endif
/* MODULE */
/*
* Local variables:
* compile-command: "gcc -D__KERNEL__ -I/usr/src/linux/net/inet -Wall -Wstrict-prototypes -O6 -m486 -c ac3200.c"
* version-control: t
* kept-new-versions: 5
* tab-width: 4
* End:
*/
drivers/net/arcnet/Kconfig
View file @
662c8869
...
...
@@ -21,11 +21,9 @@ config ARCNET
from <http://www.tldp.org/docs.html#howto>(even though ARCnet
is not really Ethernet).
This driver is also available as a module ( = code which can be
inserted in and removed from the running kernel whenever you want).
The module will be called arcnet. If you want to compile it as a
module, say M here and read <file:Documentation/modules.txt> as well
as <file:Documentation/networking/net-modules.txt>.
To compile this driver as a module, choose M here and read
<file:Documentation/networking/net-modules.txt>. The module will
be called arcnet.
config ARCNET_1201
tristate "Enable standard ARCNet packet format (RFC 1201)"
...
...
@@ -69,11 +67,9 @@ config ARCNET_COM90xx
have always used the old ARCnet driver without knowing what type of
card you had, this is probably the one for you.
This driver is also available as a module ( = code which can be
inserted in and removed from the running kernel whenever you want).
The module will be called com90xx. If you want to compile it as a
module, say M here and read <file:Documentation/modules.txt> as well
as <file:Documentation/networking/net-modules.txt>.
To compile this driver as a module, choose M here and read
<file:Documentation/networking/net-modules.txt>. The module will
be called com90xx.
config ARCNET_COM90xxIO
tristate "ARCnet COM90xx (IO mapped) chipset driver"
...
...
@@ -84,11 +80,9 @@ config ARCNET_COM90xxIO
the normal driver. Only use it if your card doesn't support shared
memory.
This driver is also available as a module ( = code which can be
inserted in and removed from the running kernel whenever you want).
The module will be called com90io. If you want to compile it as a
module, say M here and read <file:Documentation/modules.txt> as well
as <file:Documentation/networking/net-modules.txt>.
To compile this driver as a module, choose M here and read
<file:Documentation/networking/net-modules.txt>. The module will
be called com90io.
config ARCNET_RIM_I
tristate "ARCnet COM90xx (RIM I) chipset driver"
...
...
@@ -99,11 +93,9 @@ config ARCNET_RIM_I
driver is completely untested, so if you have one of these cards,
please mail dwmw2@infradead.org, especially if it works!
This driver is also available as a module ( = code which can be
inserted in and removed from the running kernel whenever you
want). The module will be called arc-rimi. If you want to compile
it as a module, say M here and read <file:Documentation/modules.txt>
as well as <file:Documentation/networking/net-modules.txt>.
To compile this driver as a module, choose M here and read
<file:Documentation/networking/net-modules.txt>. The module will
be called arc-rimi.
config ARCNET_COM20020
tristate "ARCnet COM20020 chipset driver"
...
...
@@ -113,11 +105,9 @@ config ARCNET_COM20020
things as promiscuous mode, so packet sniffing is possible, and
extra diagnostic information.
This driver is also available as a module ( = code which can be
inserted in and removed from the running kernel whenever you want).
The module will be called com20020. If you want to compile it as
a module, say M here and read <file:Documentation/modules.txt> as
well as <file:Documentation/networking/net-modules.txt>.
To compile this driver as a module, choose M here and read
<file:Documentation/networking/net-modules.txt>. The module will
be called com20020.
config ARCNET_COM20020_ISA
tristate "Support for COM20020 on ISA"
...
...
drivers/net/e2100.c
View file @
662c8869
...
...
@@ -440,13 +440,3 @@ cleanup_module(void)
}
}
#endif
/* MODULE */
/*
* Local variables:
* compile-command: "gcc -D__KERNEL__ -I/usr/src/linux/net/inet -Wall -Wstrict-prototypes -O6 -m486 -c e2100.c"
* version-control: t
* tab-width: 4
* kept-new-versions: 5
* End:
*/
drivers/net/hamradio/baycom_epp.c
View file @
662c8869
...
...
@@ -98,7 +98,7 @@ KERN_INFO "baycom_epp: version 0.7 compiled " __TIME__ " " __DATE__ "\n";
#define NR_PORTS 4
static
struct
net_device
baycom_device
[
NR_PORTS
];
static
struct
net_device
*
baycom_device
[
NR_PORTS
];
/* --------------------------------------------------------------------- */
...
...
@@ -1084,7 +1084,6 @@ static int epp_open(struct net_device *dev)
/* start the bottom half stuff */
schedule_delayed_work
(
&
bc
->
run_work
,
1
);
netif_start_queue
(
dev
);
MOD_INC_USE_COUNT
;
return
0
;
epptimeout:
...
...
@@ -1119,7 +1118,6 @@ static int epp_close(struct net_device *dev)
bc
->
skb
=
NULL
;
printk
(
KERN_INFO
"%s: close epp at iobase 0x%lx irq %u
\n
"
,
bc_drvname
,
dev
->
base_addr
,
dev
->
irq
);
MOD_DEC_USE_COUNT
;
return
0
;
}
...
...
@@ -1357,69 +1355,76 @@ MODULE_LICENSE("GPL");
/* --------------------------------------------------------------------- */
static
void
__init
baycom_epp_setup
(
struct
net_device
*
dev
)
{
struct
baycom_state
*
bc
=
dev
->
priv
;
/*
* initialize part of the baycom_state struct
*/
bc
->
magic
=
BAYCOM_MAGIC
;
bc
->
cfg
.
fclk
=
19666600
;
bc
->
cfg
.
bps
=
9600
;
/*
* initialize part of the device struct
*/
dev
->
init
=
baycom_probe
;
}
static
int
__init
init_baycomepp
(
void
)
{
struct
net_device
*
dev
;
int
i
,
found
=
0
;
char
set_hw
=
1
;
struct
baycom_state
*
bc
;
printk
(
bc_drvinfo
);
/*
* register net devices
*/
for
(
i
=
0
;
i
<
NR_PORTS
;
i
++
)
{
dev
=
baycom_device
+
i
;
struct
net_device
*
dev
;
dev
=
alloc_netdev
(
sizeof
(
struct
baycom_state
),
"bce%d"
,
baycom_epp_setup
);
if
(
!
dev
)
{
printk
(
KERN_WARNING
"bce%d : out of memory
\n
"
,
i
);
return
found
?
0
:
-
ENOMEM
;
}
sprintf
(
dev
->
name
,
"bce%d"
,
i
);
dev
->
base_addr
=
iobase
[
i
];
if
(
!
mode
[
i
])
set_hw
=
0
;
if
(
!
set_hw
)
iobase
[
i
]
=
0
;
memset
(
dev
,
0
,
sizeof
(
struct
net_device
));
if
(
!
(
bc
=
dev
->
priv
=
kmalloc
(
sizeof
(
struct
baycom_state
),
GFP_KERNEL
)))
return
-
ENOMEM
;
/*
* initialize part of the baycom_state struct
*/
memset
(
bc
,
0
,
sizeof
(
struct
baycom_state
));
bc
->
magic
=
BAYCOM_MAGIC
;
sprintf
(
dev
->
name
,
"bce%d"
,
i
);
bc
->
cfg
.
fclk
=
19666600
;
bc
->
cfg
.
bps
=
9600
;
/*
* initialize part of the device struct
*/
dev
->
if_port
=
0
;
dev
->
init
=
baycom_probe
;
dev
->
base_addr
=
iobase
[
i
];
dev
->
irq
=
0
;
dev
->
dma
=
0
;
if
(
register_netdev
(
dev
))
{
printk
(
KERN_WARNING
"%s: cannot register net device %s
\n
"
,
bc_drvname
,
dev
->
name
);
kfree
(
dev
->
priv
);
return
-
ENXIO
;
kfree
(
dev
);
break
;
}
if
(
set_hw
&&
baycom_setmode
(
bc
,
mode
[
i
]))
if
(
set_hw
&&
baycom_setmode
(
dev
->
priv
,
mode
[
i
]))
set_hw
=
0
;
baycom_device
[
i
]
=
dev
;
found
++
;
}
if
(
!
found
)
return
-
ENXIO
;
return
0
;
return
found
?
0
:
-
ENXIO
;
}
static
void
__exit
cleanup_baycomepp
(
void
)
{
struct
net_device
*
dev
;
struct
baycom_state
*
bc
;
int
i
;
for
(
i
=
0
;
i
<
NR_PORTS
;
i
++
)
{
dev
=
baycom_device
+
i
;
bc
=
(
struct
baycom_state
*
)
dev
->
priv
;
if
(
bc
)
{
struct
net_device
*
dev
=
baycom_device
[
i
];
if
(
dev
)
{
struct
baycom_state
*
bc
=
dev
->
priv
;
if
(
bc
->
magic
==
BAYCOM_MAGIC
)
{
unregister_netdev
(
dev
);
kfree
(
dev
->
pri
v
);
free_netdev
(
de
v
);
}
else
printk
(
paranoia_str
,
"cleanup_module"
);
}
...
...
drivers/net/hamradio/baycom_par.c
View file @
662c8869
...
...
@@ -107,7 +107,7 @@ KERN_INFO "baycom_par: version 0.9 compiled " __TIME__ " " __DATE__ "\n";
#define NR_PORTS 4
static
struct
net_device
baycom_device
[
NR_PORTS
];
static
struct
net_device
*
baycom_device
[
NR_PORTS
];
/* --------------------------------------------------------------------- */
...
...
@@ -352,7 +352,6 @@ static int par96_open(struct net_device *dev)
pp
->
ops
->
enable_irq
(
pp
);
printk
(
KERN_INFO
"%s: par96 at iobase 0x%lx irq %u options 0x%x
\n
"
,
bc_drvname
,
dev
->
base_addr
,
dev
->
irq
,
bc
->
options
);
MOD_INC_USE_COUNT
;
return
0
;
}
...
...
@@ -374,7 +373,6 @@ static int par96_close(struct net_device *dev)
parport_unregister_device
(
bc
->
pdev
);
printk
(
KERN_INFO
"%s: close par96 at iobase 0x%lx irq %u
\n
"
,
bc_drvname
,
dev
->
base_addr
,
dev
->
irq
);
MOD_DEC_USE_COUNT
;
return
0
;
}
...
...
@@ -389,11 +387,11 @@ static int baycom_ioctl(struct net_device *dev, struct ifreq *ifr,
/* --------------------------------------------------------------------- */
static
struct
hdlcdrv_ops
par96_ops
=
{
bc_drvname
,
bc_drvinfo
,
par96_open
,
par96_close
,
baycom_ioctl
.
drvname
=
bc_drvname
,
.
drvinfo
=
bc_drvinfo
,
.
open
=
par96_open
,
.
close
=
par96_close
,
.
ioctl
=
baycom_ioctl
};
/* --------------------------------------------------------------------- */
...
...
@@ -498,35 +496,38 @@ MODULE_LICENSE("GPL");
static
int
__init
init_baycompar
(
void
)
{
int
i
,
j
,
found
=
0
;
int
i
,
found
=
0
;
char
set_hw
=
1
;
struct
baycom_state
*
bc
;
printk
(
bc_drvinfo
);
/*
* register net devices
*/
for
(
i
=
0
;
i
<
NR_PORTS
;
i
++
)
{
struct
net_device
*
dev
=
baycom_device
+
i
;
struct
net_device
*
dev
;
struct
baycom_state
*
bc
;
char
ifname
[
IFNAMSIZ
];
sprintf
(
ifname
,
"bcp%d"
,
i
);
if
(
!
mode
[
i
])
set_hw
=
0
;
if
(
!
set_hw
)
iobase
[
i
]
=
0
;
j
=
hdlcdrv_register_hdlcdrv
(
dev
,
&
par96_ops
,
sizeof
(
struct
baycom_state
),
dev
=
hdlcdrv_register
(
&
par96_ops
,
sizeof
(
struct
baycom_state
),
ifname
,
iobase
[
i
],
0
,
0
);
if
(
!
j
)
{
if
(
IS_ERR
(
dev
))
break
;
bc
=
(
struct
baycom_state
*
)
dev
->
priv
;
if
(
set_hw
&&
baycom_setmode
(
bc
,
mode
[
i
]))
set_hw
=
0
;
found
++
;
}
else
{
printk
(
KERN_WARNING
"%s: cannot register net device
\n
"
,
bc_drvname
);
}
baycom_device
[
i
]
=
dev
;
}
if
(
!
found
)
return
-
ENXIO
;
return
0
;
...
...
@@ -537,16 +538,10 @@ static void __exit cleanup_baycompar(void)
int
i
;
for
(
i
=
0
;
i
<
NR_PORTS
;
i
++
)
{
struct
net_device
*
dev
=
baycom_device
+
i
;
struct
baycom_state
*
bc
=
(
struct
baycom_state
*
)
dev
->
priv
;
struct
net_device
*
dev
=
baycom_device
[
i
];
if
(
bc
)
{
if
(
bc
->
hdrv
.
magic
!=
HDLCDRV_MAGIC
)
printk
(
KERN_ERR
"baycom: invalid magic in "
"cleanup_module
\n
"
);
else
hdlcdrv_unregister_hdlcdrv
(
dev
);
}
if
(
dev
)
hdlcdrv_unregister
(
dev
);
}
}
...
...
drivers/net/hamradio/baycom_ser_fdx.c
View file @
662c8869
...
...
@@ -94,7 +94,7 @@ KERN_INFO "baycom_ser_fdx: version 0.10 compiled " __TIME__ " " __DATE__ "\n";
#define NR_PORTS 4
static
struct
net_device
baycom_device
[
NR_PORTS
];
static
struct
net_device
*
baycom_device
[
NR_PORTS
];
/* --------------------------------------------------------------------- */
...
...
@@ -459,7 +459,6 @@ static int ser12_open(struct net_device *dev)
hdlcdrv_setdcd
(
&
bc
->
hdrv
,
0
);
printk
(
KERN_INFO
"%s: ser_fdx at iobase 0x%lx irq %u baud %u uart %s
\n
"
,
bc_drvname
,
dev
->
base_addr
,
dev
->
irq
,
bc
->
baud
,
uart_str
[
u
]);
MOD_INC_USE_COUNT
;
return
0
;
}
...
...
@@ -480,7 +479,6 @@ static int ser12_close(struct net_device *dev)
release_region
(
dev
->
base_addr
,
SER12_EXTENT
);
printk
(
KERN_INFO
"%s: close ser_fdx at iobase 0x%lx irq %u
\n
"
,
bc_drvname
,
dev
->
base_addr
,
dev
->
irq
);
MOD_DEC_USE_COUNT
;
return
0
;
}
...
...
@@ -497,11 +495,11 @@ static int baycom_ioctl(struct net_device *dev, struct ifreq *ifr,
/* --------------------------------------------------------------------- */
static
struct
hdlcdrv_ops
ser12_ops
=
{
bc_drvname
,
bc_drvinfo
,
ser12_open
,
ser12_close
,
baycom_ioctl
.
drvname
=
bc_drvname
,
.
drvinfo
=
bc_drvinfo
,
.
open
=
ser12_open
,
.
close
=
ser12_close
,
.
ioctl
=
baycom_ioctl
,
};
/* --------------------------------------------------------------------- */
...
...
@@ -621,36 +619,39 @@ MODULE_LICENSE("GPL");
static
int
__init
init_baycomserfdx
(
void
)
{
int
i
,
j
,
found
=
0
;
int
i
,
found
=
0
;
char
set_hw
=
1
;
struct
baycom_state
*
bc
;
printk
(
bc_drvinfo
);
/*
* register net devices
*/
for
(
i
=
0
;
i
<
NR_PORTS
;
i
++
)
{
struct
net_device
*
dev
=
baycom_device
+
i
;
struct
net_device
*
dev
;
struct
baycom_state
*
bc
;
char
ifname
[
IFNAMSIZ
];
sprintf
(
ifname
,
"bcsf%d"
,
i
);
if
(
!
mode
[
i
])
set_hw
=
0
;
if
(
!
set_hw
)
iobase
[
i
]
=
irq
[
i
]
=
0
;
j
=
hdlcdrv_register_hdlcdrv
(
dev
,
&
ser12_ops
,
sizeof
(
struct
baycom_state
),
dev
=
hdlcdrv_register
(
&
ser12_ops
,
sizeof
(
struct
baycom_state
),
ifname
,
iobase
[
i
],
irq
[
i
],
0
);
if
(
!
j
)
{
if
(
IS_ERR
(
dev
))
break
;
bc
=
(
struct
baycom_state
*
)
dev
->
priv
;
if
(
set_hw
&&
baycom_setmode
(
bc
,
mode
[
i
]))
set_hw
=
0
;
bc
->
baud
=
baud
[
i
];
found
++
;
}
else
{
printk
(
KERN_WARNING
"%s: cannot register net device
\n
"
,
bc_drvname
);
}
baycom_device
[
i
]
=
dev
;
}
if
(
!
found
)
return
-
ENXIO
;
return
0
;
...
...
@@ -661,16 +662,9 @@ static void __exit cleanup_baycomserfdx(void)
int
i
;
for
(
i
=
0
;
i
<
NR_PORTS
;
i
++
)
{
struct
net_device
*
dev
=
baycom_device
+
i
;
struct
baycom_state
*
bc
=
(
struct
baycom_state
*
)
dev
->
priv
;
if
(
bc
)
{
if
(
bc
->
hdrv
.
magic
!=
HDLCDRV_MAGIC
)
printk
(
KERN_ERR
"baycom: invalid magic in "
"cleanup_module
\n
"
);
else
hdlcdrv_unregister_hdlcdrv
(
dev
);
}
struct
net_device
*
dev
=
baycom_device
[
i
];
if
(
dev
)
hdlcdrv_unregister
(
dev
);
}
}
...
...
drivers/net/hamradio/baycom_ser_hdx.c
View file @
662c8869
...
...
@@ -84,7 +84,7 @@ KERN_INFO "baycom_ser_hdx: version 0.10 compiled " __TIME__ " " __DATE__ "\n";
#define NR_PORTS 4
static
struct
net_device
baycom_device
[
NR_PORTS
];
static
struct
net_device
*
baycom_device
[
NR_PORTS
];
/* --------------------------------------------------------------------- */
...
...
@@ -504,7 +504,6 @@ static int ser12_open(struct net_device *dev)
ser12_set_divisor
(
dev
,
bc
->
opt_dcd
?
6
:
4
);
printk
(
KERN_INFO
"%s: ser12 at iobase 0x%lx irq %u uart %s
\n
"
,
bc_drvname
,
dev
->
base_addr
,
dev
->
irq
,
uart_str
[
u
]);
MOD_INC_USE_COUNT
;
return
0
;
}
...
...
@@ -525,7 +524,6 @@ static int ser12_close(struct net_device *dev)
release_region
(
dev
->
base_addr
,
SER12_EXTENT
);
printk
(
KERN_INFO
"%s: close ser12 at iobase 0x%lx irq %u
\n
"
,
bc_drvname
,
dev
->
base_addr
,
dev
->
irq
);
MOD_DEC_USE_COUNT
;
return
0
;
}
...
...
@@ -542,11 +540,11 @@ static int baycom_ioctl(struct net_device *dev, struct ifreq *ifr,
/* --------------------------------------------------------------------- */
static
struct
hdlcdrv_ops
ser12_ops
=
{
bc_drvname
,
bc_drvinfo
,
ser12_open
,
ser12_close
,
baycom_ioctl
.
drvname
=
bc_drvname
,
.
drvinfo
=
bc_drvinfo
,
.
open
=
ser12_open
,
.
close
=
ser12_close
,
.
ioctl
=
baycom_ioctl
,
};
/* --------------------------------------------------------------------- */
...
...
@@ -658,35 +656,38 @@ MODULE_LICENSE("GPL");
static
int
__init
init_baycomserhdx
(
void
)
{
int
i
,
j
,
found
=
0
;
int
i
,
found
=
0
;
char
set_hw
=
1
;
struct
baycom_state
*
bc
;
printk
(
bc_drvinfo
);
/*
* register net devices
*/
for
(
i
=
0
;
i
<
NR_PORTS
;
i
++
)
{
struct
net_device
*
dev
=
baycom_device
+
i
;
struct
net_device
*
dev
;
struct
baycom_state
*
bc
;
char
ifname
[
IFNAMSIZ
];
sprintf
(
ifname
,
"bcsh%d"
,
i
);
if
(
!
mode
[
i
])
set_hw
=
0
;
if
(
!
set_hw
)
iobase
[
i
]
=
irq
[
i
]
=
0
;
j
=
hdlcdrv_register_hdlcdrv
(
dev
,
&
ser12_ops
,
sizeof
(
struct
baycom_state
),
dev
=
hdlcdrv_register
(
&
ser12_ops
,
sizeof
(
struct
baycom_state
),
ifname
,
iobase
[
i
],
irq
[
i
],
0
);
if
(
!
j
)
{
if
(
IS_ERR
(
dev
))
break
;
bc
=
(
struct
baycom_state
*
)
dev
->
priv
;
if
(
set_hw
&&
baycom_setmode
(
bc
,
mode
[
i
]))
set_hw
=
0
;
found
++
;
}
else
{
printk
(
KERN_WARNING
"%s: cannot register net device
\n
"
,
bc_drvname
);
}
baycom_device
[
i
]
=
dev
;
}
if
(
!
found
)
return
-
ENXIO
;
return
0
;
...
...
@@ -697,16 +698,10 @@ static void __exit cleanup_baycomserhdx(void)
int
i
;
for
(
i
=
0
;
i
<
NR_PORTS
;
i
++
)
{
struct
net_device
*
dev
=
baycom_device
+
i
;
struct
baycom_state
*
bc
=
(
struct
baycom_state
*
)
dev
->
priv
;
struct
net_device
*
dev
=
baycom_device
[
i
];
if
(
bc
)
{
if
(
bc
->
hdrv
.
magic
!=
HDLCDRV_MAGIC
)
printk
(
KERN_ERR
"baycom: invalid magic in "
"cleanup_module
\n
"
);
else
hdlcdrv_unregister_hdlcdrv
(
dev
);
}
if
(
dev
)
hdlcdrv_unregister
(
dev
);
}
}
...
...
drivers/net/hamradio/hdlcdrv.c
View file @
662c8869
...
...
@@ -553,6 +553,7 @@ static int hdlcdrv_open(struct net_device *dev)
/*
* initialise some variables
*/
s
->
opened
=
1
;
s
->
hdlcrx
.
hbuf
.
rd
=
s
->
hdlcrx
.
hbuf
.
wr
=
0
;
s
->
hdlcrx
.
in_hdlc_rx
=
0
;
s
->
hdlcrx
.
rx_state
=
0
;
...
...
@@ -592,6 +593,7 @@ static int hdlcdrv_close(struct net_device *dev)
if
(
s
->
skb
)
dev_kfree_skb
(
s
->
skb
);
s
->
skb
=
NULL
;
s
->
opened
=
0
;
return
i
;
}
...
...
@@ -728,25 +730,15 @@ static int hdlcdrv_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
/* --------------------------------------------------------------------- */
/*
* Check for a network adaptor of this type, and return '0' if one exists.
* If dev->base_addr == 0, probe all likely locations.
* If dev->base_addr == 1, always return failure.
* If dev->base_addr == 2, allocate space for the device and return success
* (detachable devices only).
* Initialize fields in hdlcdrv
*/
static
int
hdlcdrv_probe
(
struct
net_device
*
dev
)
static
void
hdlcdrv_setup
(
struct
net_device
*
dev
)
{
const
struct
hdlcdrv_channel_params
dflt_ch_params
=
{
static
const
struct
hdlcdrv_channel_params
dflt_ch_params
=
{
20
,
2
,
10
,
40
,
0
};
struct
hdlcdrv_state
*
s
;
struct
hdlcdrv_state
*
s
=
dev
->
priv
;
;
if
(
!
dev
)
return
-
ENXIO
;
/*
* not a real probe! only initialize data structures
*/
s
=
(
struct
hdlcdrv_state
*
)
dev
->
priv
;
/*
* initialize the hdlcdrv_state struct
*/
...
...
@@ -805,72 +797,60 @@ static int hdlcdrv_probe(struct net_device *dev)
memcpy
(
dev
->
broadcast
,
ax25_bcast
,
AX25_ADDR_LEN
);
memcpy
(
dev
->
dev_addr
,
ax25_nocall
,
AX25_ADDR_LEN
);
dev
->
tx_queue_len
=
16
;
/* New style flags */
dev
->
flags
=
0
;
return
0
;
}
/* --------------------------------------------------------------------- */
int
hdlcdrv_register_hdlcdrv
(
struct
net_device
*
dev
,
const
struct
hdlcdrv_ops
*
ops
,
unsigned
int
privsize
,
char
*
ifname
,
struct
net_device
*
hdlcdrv_register
(
const
struct
hdlcdrv_ops
*
ops
,
unsigned
int
privsize
,
const
char
*
ifname
,
unsigned
int
baseaddr
,
unsigned
int
irq
,
unsigned
int
dma
)
{
struct
net_device
*
dev
;
struct
hdlcdrv_state
*
s
;
int
err
;
BUG_ON
(
ops
==
NULL
);
if
(
!
dev
||
!
ops
)
return
-
EACCES
;
if
(
privsize
<
sizeof
(
struct
hdlcdrv_state
))
privsize
=
sizeof
(
struct
hdlcdrv_state
);
memset
(
dev
,
0
,
sizeof
(
struct
net_device
));
if
(
!
(
s
=
dev
->
priv
=
kmalloc
(
privsize
,
GFP_KERNEL
)))
return
-
ENOMEM
;
dev
=
alloc_netdev
(
privsize
,
ifname
,
hdlcdrv_setup
);
if
(
!
dev
)
return
ERR_PTR
(
-
ENOMEM
);
/*
* initialize part of the hdlcdrv_state struct
*/
memset
(
s
,
0
,
privsize
)
;
s
=
dev
->
priv
;
s
->
magic
=
HDLCDRV_MAGIC
;
strncpy
(
dev
->
name
,
ifname
,
sizeof
(
dev
->
name
));
s
->
ops
=
ops
;
/*
* initialize part of the device struct
*/
dev
->
if_port
=
0
;
dev
->
init
=
hdlcdrv_probe
;
dev
->
base_addr
=
baseaddr
;
dev
->
irq
=
irq
;
dev
->
dma
=
dma
;
if
(
register_netdev
(
dev
))
{
err
=
register_netdev
(
dev
);
if
(
err
<
0
)
{
printk
(
KERN_WARNING
"hdlcdrv: cannot register net "
"device %s
\n
"
,
dev
->
name
);
kfree
(
dev
->
priv
);
return
-
ENXIO
;
kfree
(
dev
);
dev
=
ERR_PTR
(
err
)
;
}
MOD_INC_USE_COUNT
;
return
0
;
return
dev
;
}
/* --------------------------------------------------------------------- */
int
hdlcdrv_unregister_hdlcdrv
(
struct
net_device
*
dev
)
void
hdlcdrv_unregister
(
struct
net_device
*
dev
)
{
struct
hdlcdrv_state
*
s
;
struct
hdlcdrv_state
*
s
=
dev
->
priv
;
if
(
!
dev
)
return
-
EINVAL
;
if
(
!
(
s
=
(
struct
hdlcdrv_state
*
)
dev
->
priv
))
return
-
EINVAL
;
if
(
s
->
magic
!=
HDLCDRV_MAGIC
)
return
-
EINVAL
;
if
(
s
->
ops
->
close
)
BUG_ON
(
s
->
magic
!=
HDLCDRV_MAGIC
);
if
(
s
->
opened
&&
s
->
ops
->
close
)
s
->
ops
->
close
(
dev
);
unregister_netdev
(
dev
);
kfree
(
s
);
MOD_DEC_USE_COUNT
;
return
0
;
free_netdev
(
dev
);
}
/* --------------------------------------------------------------------- */
...
...
@@ -878,8 +858,8 @@ int hdlcdrv_unregister_hdlcdrv(struct net_device *dev)
EXPORT_SYMBOL
(
hdlcdrv_receiver
);
EXPORT_SYMBOL
(
hdlcdrv_transmitter
);
EXPORT_SYMBOL
(
hdlcdrv_arbitrate
);
EXPORT_SYMBOL
(
hdlcdrv_register
_hdlcdrv
);
EXPORT_SYMBOL
(
hdlcdrv_unregister
_hdlcdrv
);
EXPORT_SYMBOL
(
hdlcdrv_register
);
EXPORT_SYMBOL
(
hdlcdrv_unregister
);
/* --------------------------------------------------------------------- */
...
...
drivers/net/hp-plus.c
View file @
662c8869
...
...
@@ -457,14 +457,3 @@ cleanup_module(void)
}
}
#endif
/* MODULE */
/*
* Local variables:
* compile-command: "gcc -D__KERNEL__ -I/usr/src/linux/net/inet -Wall -Wstrict-prototypes -O6 -m486 -c hp-plus.c"
* version-control: t
* kept-new-versions: 5
* tab-width: 4
* c-indent-level: 4
* End:
*/
drivers/net/hp.c
View file @
662c8869
...
...
@@ -429,14 +429,3 @@ cleanup_module(void)
}
}
#endif
/* MODULE */
/*
* Local variables:
* compile-command: "gcc -D__KERNEL__ -I/usr/src/linux/net/inet -Wall -Wstrict-prototypes -O6 -m486 -c hp.c"
* version-control: t
* kept-new-versions: 5
* tab-width: 4
* c-indent-level: 4
* End:
*/
drivers/net/ne.c
View file @
662c8869
...
...
@@ -798,12 +798,3 @@ void cleanup_module(void)
}
}
#endif
/* MODULE */
/*
* Local variables:
* compile-command: "gcc -DKERNEL -Wall -O6 -fomit-frame-pointer -I/usr/src/linux/net/tcp -c ne.c"
* version-control: t
* kept-new-versions: 5
* End:
*/
drivers/net/ne2.c
View file @
662c8869
...
...
@@ -790,11 +790,3 @@ void cleanup_module(void)
}
}
#endif
/* MODULE */
/*
* Local variables:
* compile-command: "gcc -DKERNEL -Wall -O6 -fomit-frame-pointer -I/usr/src/linux/net/tcp -c ne2.c"
* version-control: t
* kept-new-versions: 5
* End:
*/
drivers/net/ne2k-pci.c
View file @
662c8869
...
...
@@ -26,8 +26,8 @@
*/
#define DRV_NAME "ne2k-pci"
#define DRV_VERSION "1.0
2
"
#define DRV_RELDATE "
10/19/2000
"
#define DRV_VERSION "1.0
3
"
#define DRV_RELDATE "
9/22/2003
"
/* The user-configurable values.
...
...
@@ -380,21 +380,48 @@ static int __devinit ne2k_pci_init_one (struct pci_dev *pdev,
}
/*
* Magic incantation sequence for full duplex on the supported cards.
*/
static
inline
int
set_realtek_fdx
(
struct
net_device
*
dev
)
{
long
ioaddr
=
dev
->
base_addr
;
outb
(
0xC0
+
E8390_NODMA
,
ioaddr
+
NE_CMD
);
/* Page 3 */
outb
(
0xC0
,
ioaddr
+
0x01
);
/* Enable writes to CONFIG3 */
outb
(
0x40
,
ioaddr
+
0x06
);
/* Enable full duplex */
outb
(
0x00
,
ioaddr
+
0x01
);
/* Disable writes to CONFIG3 */
outb
(
E8390_PAGE0
+
E8390_NODMA
,
ioaddr
+
NE_CMD
);
/* Page 0 */
return
0
;
}
static
inline
int
set_holtek_fdx
(
struct
net_device
*
dev
)
{
long
ioaddr
=
dev
->
base_addr
;
outb
(
inb
(
ioaddr
+
0x20
)
|
0x80
,
ioaddr
+
0x20
);
return
0
;
}
static
int
ne2k_pci_set_fdx
(
struct
net_device
*
dev
)
{
if
(
ei_status
.
ne2k_flags
&
REALTEK_FDX
)
return
set_realtek_fdx
(
dev
);
else
if
(
ei_status
.
ne2k_flags
&
HOLTEK_FDX
)
return
set_holtek_fdx
(
dev
);
return
-
EOPNOTSUPP
;
}
static
int
ne2k_pci_open
(
struct
net_device
*
dev
)
{
int
ret
=
request_irq
(
dev
->
irq
,
ei_interrupt
,
SA_SHIRQ
,
dev
->
name
,
dev
);
if
(
ret
)
return
ret
;
/* Set full duplex for the chips that we know about. */
if
(
ei_status
.
ne2k_flags
&
FORCE_FDX
)
{
long
ioaddr
=
dev
->
base_addr
;
if
(
ei_status
.
ne2k_flags
&
REALTEK_FDX
)
{
outb
(
0xC0
+
E8390_NODMA
,
ioaddr
+
NE_CMD
);
/* Page 3 */
outb
(
inb
(
ioaddr
+
0x20
)
|
0x80
,
ioaddr
+
0x20
);
}
else
if
(
ei_status
.
ne2k_flags
&
HOLTEK_FDX
)
outb
(
inb
(
ioaddr
+
0x20
)
|
0x80
,
ioaddr
+
0x20
);
}
if
(
ei_status
.
ne2k_flags
&
FORCE_FDX
)
ne2k_pci_set_fdx
(
dev
);
ei_open
(
dev
);
return
0
;
}
...
...
drivers/net/ne2k_cbus.c
View file @
662c8869
/* ne.c: A general non-shared-memory NS8390 ethernet driver for linux. */
/*
Written 1992-94 by Donald Becker.
ne2k_cbus.c: A driver for the NE2000 like ethernet on NEC PC-9800.
This is a copy of the 2.5.66 Linux ISA NE2000 driver "ne.c"
(Donald Becker/Paul Gortmaker) with the NEC PC-9800 specific
changes added by Osamu Tomita.
From ne.c:
-----------
Copyright 1993 United States Government as represented by the
Director, National Security Agency.
This software may be used and distributed according to the terms
of the GNU General Public License, incorporated herein by reference.
The author may be reached as becker@scyld.com, or C/O
Scyld Computing Corporation, 410 Severn Ave., Suite 210, Annapolis MD 21403
This driver should work with many programmed-I/O 8390-based ethernet
boards. Currently it supports the NE1000, NE2000, many clones,
and some Cabletron products.
Changelog:
Paul Gortmaker : use ENISR_RDC to monitor Tx PIO uploads, made
sanity checks and bad clone support optional.
Paul Gortmaker : new reset code, reset card after probe at boot.
Paul Gortmaker : multiple card support for module users.
Paul Gortmaker : Support for PCI ne2k clones, similar to lance.c
Paul Gortmaker : Allow users with bad cards to avoid full probe.
Paul Gortmaker : PCI probe changes, more PCI cards supported.
rjohnson@analogic.com : Changed init order so an interrupt will only
occur after memory is allocated for dev->priv. Deallocated memory
last in cleanup_modue()
Richard Guenther : Added support for ISAPnP cards
Paul Gortmaker : Discontinued PCI support - use ne2k-pci.c instead.
Osamu Tomita : Separate driver for NEC PC-9800.
-----------
*/
/* Routines for the NatSemi-based designs (NE[12]000). */
static
const
char
version1
[]
=
"ne.c:v1.10 9/23/94 Donald Becker (becker@scyld.com)
\n
"
;
static
const
char
version2
[]
=
"Last modified Nov 1, 2000 by Paul Gortmaker
\n
"
;
static
const
char
version
[]
=
"ne2k_cbus.c:v1.0 3/24/03 Osamu Tomita
\n
"
;
#include <linux/module.h>
#include <linux/kernel.h>
...
...
@@ -273,7 +254,7 @@ static int __init ne_probe1(struct net_device *dev, int ioaddr)
}
if
(
ei_debug
&&
version_printed
++
==
0
)
printk
(
KERN_INFO
"%s"
KERN_INFO
"%s"
,
version1
,
version2
);
printk
(
KERN_INFO
"%s"
,
version
);
printk
(
KERN_INFO
"NE*000 ethercard probe at %#3x:"
,
ioaddr
);
...
...
@@ -839,9 +820,9 @@ int init_module(void)
return
0
;
}
if
(
io
[
this_dev
]
!=
0
)
printk
(
KERN_WARNING
"ne
.c
: No NE*000 card found at i/o = %#x
\n
"
,
io
[
this_dev
]);
printk
(
KERN_WARNING
"ne
2k_cbus
: No NE*000 card found at i/o = %#x
\n
"
,
io
[
this_dev
]);
else
printk
(
KERN_NOTICE
"ne
.c
: You must supply
\"
io=0xNNN
\"
value(s) for C-Bus cards.
\n
"
);
printk
(
KERN_NOTICE
"ne
2k_cbus
: You must supply
\"
io=0xNNN
\"
value(s) for C-Bus cards.
\n
"
);
return
-
ENXIO
;
}
return
0
;
...
...
@@ -869,11 +850,3 @@ void cleanup_module(void)
}
#endif
/* MODULE */
/*
* Local variables:
* compile-command: "gcc -DKERNEL -Wall -O6 -fomit-frame-pointer -I/usr/src/linux/net/tcp -c ne.c"
* version-control: t
* kept-new-versions: 5
* End:
*/
drivers/net/saa9730.c
View file @
662c8869
...
...
@@ -21,6 +21,11 @@
*
* SAA9730 ethernet driver.
*
* Changes:
* Angelo Dell'Aera <buffer@antifork.org> : Conversion to the new PCI API (pci_driver).
* Conversion to spinlocks.
* Error handling fixes.
*
*/
#include <linux/init.h>
...
...
@@ -30,6 +35,7 @@
#include <linux/module.h>
#include <linux/skbuff.h>
#include <linux/pci.h>
#include <linux/spinlock.h>
#include <asm/addrspace.h>
#include <asm/mips-boards/prom.h>
...
...
@@ -42,6 +48,15 @@ int lan_saa9730_debug = LAN_SAA9730_DEBUG;
int
lan_saa9730_debug
;
#endif
#define DRV_MODULE_NAME "saa9730"
static
struct
pci_device_id
saa9730_pci_tbl
[]
=
{
{
PCI_VENDOR_ID_PHILIPS
,
PCI_DEVICE_ID_PHILIPS_SAA9370
,
PCI_ANY_ID
,
PCI_ANY_ID
,
0
,
0
,
0UL
},
{
0
,
}
};
MODULE_DEVICE_TABLE
(
pci
,
saa9730_pci_tbl
);
/* Non-zero only if the current card is a PCI with BIOS-set IRQ. */
static
unsigned
int
pci_irq_line
;
...
...
@@ -216,6 +231,9 @@ static int lan_saa9730_allocate_buffers(struct lan_saa9730_private *lp)
buffer_start
=
(
unsigned
int
)
kmalloc
(
mem_size
,
GFP_DMA
|
GFP_KERNEL
);
if
(
!
buffer_start
)
return
-
ENOMEM
;
/*
* Set DMA buffer to kseg1 (uncached).
* Make sure to flush before using it uncached.
...
...
@@ -887,13 +905,14 @@ static int lan_saa9730_start_xmit(struct sk_buff *skb,
printk
(
"Send packet: skb=%08x
\n
"
,
(
unsigned
int
)
skb
);
skblen
=
skb
->
len
;
save_and_cli
(
flags
);
spin_lock_irqsave
(
&
lp
->
lock
,
flags
);
len
=
(
skblen
<=
ETH_ZLEN
)
?
ETH_ZLEN
:
skblen
;
if
(
lan_saa9730_write
(
lp
,
skb
,
skblen
))
{
restore_flags
(
flags
);
printk
(
"Error when writing packet to controller: skb=%08x
\n
"
,
spin_unlock_irqrestore
(
&
lp
->
lock
,
flags
);
printk
(
"Error when writing packet to controller: skb=%08x
\n
"
,
(
unsigned
int
)
skb
);
netif_stop_queue
(
dev
);
return
-
1
;
...
...
@@ -906,7 +925,7 @@ static int lan_saa9730_start_xmit(struct sk_buff *skb,
netif_start_queue
(
dev
);
dev_kfree_skb
(
skb
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
lp
->
lock
,
flags
);
return
0
;
}
...
...
@@ -971,16 +990,42 @@ static void lan_saa9730_set_multicast(struct net_device *dev)
lan_saa9730_restart
(
lp
);
}
static
void
__devexit
saa9730_remove_one
(
struct
pci_dev
*
pdev
)
{
struct
net_device
*
dev
=
pci_get_drvdata
(
pdev
);
if
(
dev
)
{
if
(
dev
->
priv
)
kfree
(
dev
->
priv
);
unregister_netdev
(
dev
);
free_netdev
(
dev
);
pci_release_regions
(
pdev
);
pci_disable_device
(
pdev
);
pci_set_drvdata
(
pdev
,
NULL
);
}
}
static
int
lan_saa9730_init
(
struct
net_device
*
dev
,
int
ioaddr
,
int
irq
)
{
struct
lan_saa9730_private
*
lp
;
unsigned
char
ethernet_addr
[
6
];
int
ret
=
0
;
dev
=
init_etherdev
(
dev
,
0
);
if
(
!
dev
)
return
-
ENOMEM
;
dev
->
open
=
lan_saa9730_open_fail
;
if
(
get_ethernet_addr
(
ethernet_addr
))
return
-
1
;
if
(
get_ethernet_addr
(
ethernet_addr
))
{
ret
=
-
ENODEV
;
goto
out
;
}
memcpy
(
dev
->
dev_addr
,
ethernet_addr
,
6
);
dev
->
base_addr
=
ioaddr
;
...
...
@@ -995,6 +1040,11 @@ static int lan_saa9730_init(struct net_device *dev, int ioaddr, int irq)
GFP_DMA
|
GFP_KERNEL
)
+
7
)
&
~
7
);
if
(
!
lp
)
{
ret
=
-
ENOMEM
;
goto
out
;
}
dev
->
priv
=
lp
;
memset
(
lp
,
0
,
sizeof
(
*
lp
));
...
...
@@ -1007,32 +1057,34 @@ static int lan_saa9730_init(struct net_device *dev, int ioaddr, int irq)
SAA9730_EVM_REGS_ADDR
);
/* Allocate LAN RX/TX frame buffer space. */
if
(
lan_saa9730_allocate_buffers
(
lp
))
return
-
1
;
if
(
(
ret
=
lan_saa9730_allocate_buffers
(
lp
)
))
goto
out
;
/* Stop LAN controller. */
if
(
lan_saa9730_stop
(
lp
))
return
-
1
;
if
(
(
ret
=
lan_saa9730_stop
(
lp
)))
goto
out
;
/* Initialize CAM registers. */
if
(
lan_saa9730_cam_init
(
dev
))
return
-
1
;
if
(
(
ret
=
lan_saa9730_cam_init
(
dev
)
))
goto
out
;
/* Initialize MII registers. */
if
(
lan_saa9730_mii_init
(
lp
))
return
-
1
;
if
(
(
ret
=
lan_saa9730_mii_init
(
lp
)
))
goto
out
;
/* Initialize control registers. */
if
(
lan_saa9730_control_init
(
lp
))
return
-
1
;
if
(
(
ret
=
lan_saa9730_control_init
(
lp
)))
goto
out
;
/* Load CAM registers. */
if
(
lan_saa9730_cam_load
(
lp
))
return
-
1
;
if
(
(
ret
=
lan_saa9730_cam_load
(
lp
)))
goto
out
;
/* Initialize DMA context registers. */
if
(
lan_saa9730_dma_init
(
lp
))
return
-
1
;
if
((
ret
=
lan_saa9730_dma_init
(
lp
)))
goto
out
;
spin_lock_init
(
&
lp
->
lock
);
dev
->
open
=
lan_saa9730_open
;
dev
->
hard_start_xmit
=
lan_saa9730_start_xmit
;
...
...
@@ -1044,22 +1096,39 @@ static int lan_saa9730_init(struct net_device *dev, int ioaddr, int irq)
dev
->
dma
=
0
;
return
0
;
out:
if
(
dev
)
{
if
(
dev
->
priv
)
kfree
(
dev
->
priv
);
unregister_netdevice
(
dev
);
free_netdev
(
dev
);
}
return
ret
;
}
static
int
__
init
saa9730_probe
(
void
)
static
int
__
devinit
saa9730_init_one
(
struct
pci_dev
*
pdev
,
const
struct
pci_device_id
*
ent
)
{
struct
net_device
*
dev
=
NULL
;
struct
pci_dev
*
pdev
=
NULL
;
unsigned
int
pci_ioaddr
;
int
err
;
if
(
lan_saa9730_debug
>
1
)
printk
(
"saa9730.c: PCI bios is present, checking for devices...
\n
"
);
printk
(
"saa9730.c: PCI bios is present, checking for devices...
\n
"
);
while
((
pdev
=
pci_find_device
(
PCI_VENDOR_ID_PHILIPS
,
PCI_DEVICE_ID_PHILIPS_SAA9730
,
pdev
)))
{
unsigned
int
pci_ioaddr
;
err
=
pci_enable_device
(
pdev
);
if
(
err
)
{
printk
(
KERN_ERR
"Cannot enable PCI device, aborting.
\n
"
);
goto
out
;
}
err
=
pci_request_regions
(
pdev
,
DRV_MODULE_NAME
);
if
(
err
)
{
printk
(
KERN_ERR
"Cannot obtain PCI resources, aborting.
\n
"
);
goto
out_disable_pdev
;
}
pci_irq_line
=
pdev
->
irq
;
/* LAN base address in located at BAR 1. */
...
...
@@ -1069,15 +1138,45 @@ static int __init saa9730_probe(void)
printk
(
"Found SAA9730 (PCI) at %#x, irq %d.
\n
"
,
pci_ioaddr
,
pci_irq_line
);
if
(
!
lan_saa9730_init
(
dev
,
pci_ioaddr
,
pci_irq_line
))
return
0
;
else
printk
(
"Lan init failed.
\n
"
)
;
err
=
lan_saa9730_init
(
dev
,
pci_ioaddr
,
pci_irq_line
);
if
(
err
)
{
printk
(
"Lan init failed"
);
goto
out_disable_pdev
;
}
return
-
ENODEV
;
pci_set_drvdata
(
pdev
,
dev
);
return
0
;
out_disable_pdev:
pci_disable_device
(
pdev
);
out:
pci_set_drvdata
(
pdev
,
NULL
);
return
err
;
}
static
struct
pci_driver
saa9730_driver
=
{
.
name
=
DRV_MODULE_NAME
,
.
id_table
=
saa9730_pci_tbl
,
.
probe
=
saa9730_init_one
,
.
remove
=
__devexit_p
(
saa9730_remove_one
),
};
static
int
__init
saa9730_init
(
void
)
{
return
pci_module_init
(
&
saa9730_driver
);
}
static
void
__exit
saa9730_cleanup
(
void
)
{
pci_unregister_driver
(
&
saa9730_driver
);
}
module_init
(
saa9730_probe
);
module_init
(
saa9730_init
);
module_exit
(
saa9730_cleanup
);
MODULE_LICENSE
(
"GPL"
);
drivers/net/saa9730.h
View file @
662c8869
...
...
@@ -365,6 +365,7 @@ struct lan_saa9730_private {
unsigned
char
PhysicalAddress
[
LAN_SAA9730_CAM_ENTRIES
][
6
];
struct
net_device_stats
stats
;
spinlock_t
lock
;
};
#endif
/* _SAA9730_H */
drivers/net/sk98lin/h/skdrv1st.h
View file @
662c8869
...
...
@@ -2,8 +2,8 @@
*
* Name: skdrv1st.h
* Project: GEnesis, PCI Gigabit Ethernet Adapter
* Version: $Revision: 1.1
5
$
* Date: $Date: 2003/07/
17 14:54:09
$
* Version: $Revision: 1.1 $
* Date: $Date: 2003/07/
21 07:22:43
$
* Purpose: First header file for driver and all other modules
*
******************************************************************************/
...
...
@@ -26,6 +26,9 @@
* History:
*
* $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
* Fix: Corrected SK_PNMI_READ macros to copy right amount of bytes
*
...
...
drivers/net/sk98lin/h/skdrv2nd.h
View file @
662c8869
...
...
@@ -2,8 +2,8 @@
*
* Name: skdrv2nd.h
* Project: GEnesis, PCI Gigabit Ethernet Adapter
* Version: $Revision: 1.
19
$
* Date: $Date: 2003/0
7/07 09:53:10
$
* Version: $Revision: 1.
3
$
* Date: $Date: 2003/0
8/12 16:51:18
$
* Purpose: Second header file for driver and all other modules
*
******************************************************************************/
...
...
@@ -26,6 +26,16 @@
* History:
*
* $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
* Fix: Removed proprietary RxTx defines and used the ones from skgehw.h instead
*
...
...
@@ -315,12 +325,13 @@ struct s_IOCTL {
#define C_OFFSET_IPHEADER C_LEN_ETHERMAC_HEADER
#define C_OFFSET_IPHEADER_IPPROTO 9
#define C_OFFSET_TCPHEADER_TCPCS 16
#define C_OFFSET_UDPHEADER_UDPCS 6
#define C_OFFSET_IPPROTO ( (C_LEN_ETHERMAC_HEADER) + \
(C_OFFSET_IPHEADER_IPPROTO) )
#define C_PROTO_ID_UDP
6
/* refer to RFC 790 or Stevens' */
#define C_PROTO_ID_TCP
17
/* TCP/IP illustrated for details */
#define C_PROTO_ID_UDP
17
/* refer to RFC 790 or Stevens' */
#define C_PROTO_ID_TCP
6
/* TCP/IP illustrated for details */
/* TX and RX descriptors *****************************************************/
...
...
@@ -390,6 +401,7 @@ struct s_TxD {
typedef
struct
s_DevNet
DEV_NET
;
struct
s_DevNet
{
struct
proc_dir_entry
*
proc
;
int
PortNr
;
int
NetNr
;
int
Mtu
;
...
...
@@ -550,6 +562,10 @@ struct s_AC {
/* Only for tests */
int
PortUp
;
int
PortDown
;
int
ChipsetType
;
/* Chipset family type
* 0 == Genesis family support
* 1 == Yukon family support
*/
};
...
...
drivers/net/sk98lin/h/skgeinit.h
View file @
662c8869
...
...
@@ -722,15 +722,14 @@ typedef struct s_GeInit {
/*
* Error numbers and messages for skxmac2.c and skgeinit.c
*/
#define SKERR_HWI_E001 (SK_ERRBASE_HWINIT)
#define SKERR_HWI_E001MSG "SkXmClrExactAddr() has got i
nvalid
parameters"
#define SKERR_HWI_E001MSG "SkXmClrExactAddr() has got i
llegal
parameters"
#define SKERR_HWI_E002 (SKERR_HWI_E001+1)
#define SKERR_HWI_E002MSG "SkGeInit(): Level 1 call missing"
#define SKERR_HWI_E003 (SKERR_HWI_E002+1)
#define SKERR_HWI_E003MSG "SkGeInit() called with i
nvalid
init Level"
#define SKERR_HWI_E003MSG "SkGeInit() called with i
llegal
init Level"
#define SKERR_HWI_E004 (SKERR_HWI_E003+1)
#define SKERR_HWI_E004MSG "SkGeInitPort(): Queue Size i
nvalid
configured"
#define SKERR_HWI_E004MSG "SkGeInitPort(): Queue Size i
llegal
configured"
#define SKERR_HWI_E005 (SKERR_HWI_E004+1)
#define SKERR_HWI_E005MSG "SkGeInitPort(): cannot init running ports"
#define SKERR_HWI_E006 (SKERR_HWI_E005+1)
...
...
@@ -752,21 +751,21 @@ typedef struct s_GeInit {
#define SKERR_HWI_E014 (SKERR_HWI_E013+1)
#define SKERR_HWI_E014MSG "SkGeInitPort(): unknown GIPortUsage specified"
#define SKERR_HWI_E015 (SKERR_HWI_E014+1)
#define SKERR_HWI_E015MSG "I
nvalid
Link mode parameter"
#define SKERR_HWI_E015MSG "I
llegal
Link mode parameter"
#define SKERR_HWI_E016 (SKERR_HWI_E015+1)
#define SKERR_HWI_E016MSG "I
nvalid
Flow control mode parameter"
#define SKERR_HWI_E016MSG "I
llegal
Flow control mode parameter"
#define SKERR_HWI_E017 (SKERR_HWI_E016+1)
#define SKERR_HWI_E017MSG "I
nvalid
value specified for GIPollTimerVal"
#define SKERR_HWI_E017MSG "I
llegal
value specified for GIPollTimerVal"
#define SKERR_HWI_E018 (SKERR_HWI_E017+1)
#define SKERR_HWI_E018MSG "FATAL: SkGeStopPort() does not terminate (Tx)"
#define SKERR_HWI_E019 (SKERR_HWI_E018+1)
#define SKERR_HWI_E019MSG "I
nvalid
Speed parameter"
#define SKERR_HWI_E019MSG "I
llegal
Speed parameter"
#define SKERR_HWI_E020 (SKERR_HWI_E019+1)
#define SKERR_HWI_E020MSG "I
nvalid
Master/Slave parameter"
#define SKERR_HWI_E020MSG "I
llegal
Master/Slave parameter"
#define SKERR_HWI_E021 (SKERR_HWI_E020+1)
#define SKERR_HWI_E021MSG "MacUpdateStats(): cannot update statistic counter"
#define SKERR_HWI_E022 (SKERR_HWI_E021+1)
#define SKERR_HWI_E022MSG "MacStatistic(): i
nvalid
statistic base address"
#define SKERR_HWI_E022MSG "MacStatistic(): i
llegal
statistic base address"
#define SKERR_HWI_E023 (SKERR_HWI_E022+1)
#define SKERR_HWI_E023MSG "SkGeInitPort(): Transmit Queue Size too small"
#define SKERR_HWI_E024 (SKERR_HWI_E023+1)
...
...
drivers/net/sk98lin/h/sktypes.h
View file @
662c8869
...
...
@@ -2,8 +2,8 @@
*
* Name: sktypes.h
* Project: GEnesis, PCI Gigabit Ethernet Adapter
* Version: $Revision: 1.
3
$
* Date: $Date: 2003/0
2/25 14:16:40
$
* Version: $Revision: 1.
1
$
* Date: $Date: 2003/0
7/21 07:26:01
$
* Purpose: Define data types for Linux
*
******************************************************************************/
...
...
@@ -26,6 +26,9 @@
* History:
*
* $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
* Fix: Copyright statement
*
...
...
drivers/net/sk98lin/h/skversion.h
View file @
662c8869
...
...
@@ -2,8 +2,8 @@
*
* Name: version.h
* Project: GEnesis, PCI Gigabit Ethernet Adapter
* Version: $Revision: 1.
4
$
* Date: $Date: 2003/0
2/25 14:16:40
$
* Version: $Revision: 1.
3
$
* Date: $Date: 2003/0
8/25 13:34:48
$
* Purpose: SK specific Error log support
*
******************************************************************************/
...
...
@@ -25,6 +25,15 @@
*
* History:
* $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
* Fix: Copyright statement
*
...
...
@@ -42,13 +51,15 @@
******************************************************************************/
#ifdef lint
static
const
char
SysKonnectFileId
[]
=
"@(#) (C) SysKonnect GmbH."
;
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.1
4
\n" \
#define BOOT_STRING "sk98lin: Network Device Driver v6.1
8
\n" \
"(C)Copyright 1999-2003 Marvell(R)."
#define VER_STRING "6.1
4
"
#define VER_STRING "6.1
8
"
drivers/net/sk98lin/skdim.c
View file @
662c8869
...
...
@@ -2,8 +2,8 @@
*
* Name: skdim.c
* Project: GEnesis, PCI Gigabit Ethernet Adapter
* Version: $Revision: 1.
4
$
* Date: $Date: 2003/0
7/07 09:45:47
$
* Version: $Revision: 1.
2
$
* Date: $Date: 2003/0
8/21 12:35:05
$
* Purpose: All functions to maintain interrupt moderation
*
******************************************************************************/
...
...
@@ -26,6 +26,12 @@
* History:
*
* $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
* Fix: Compiler warnings corrected
*
...
...
@@ -56,7 +62,7 @@
#ifndef lint
static
const
char
SysKonnectFileId
[]
=
"@(#) $Id: skdim.c,v 1.
4 2003/07/07 09:45:47 rroesl
er Exp $ (C) SysKonnect."
;
"@(#) $Id: skdim.c,v 1.
2 2003/08/21 12:35:05 mlindn
er Exp $ (C) SysKonnect."
;
#endif
#define __SKADDR_C
...
...
@@ -312,6 +318,12 @@ GetCurrentSystemLoad(SK_AC *pAC) {
unsigned
int
TotalTime
=
0
;
unsigned
int
UsedTime
=
0
;
unsigned
int
SystemLoad
=
0
;
#ifdef CONFIG_SMP
unsigned
int
SKNumCpus
=
smp_num_cpus
;
#else
unsigned
int
SKNumCpus
=
1
;
#endif
/* unsigned int NbrCpu = 0; */
/*
...
...
drivers/net/sk98lin/skge.c
View file @
662c8869
/******************************************************************************
*
* Name: skge.c
* Project: GEnesis, PCI Gigabit Ethernet Adapter
* Version: $Revision: 1.
63
$
* Date: $Date: 2003/0
7/15 09:26:23
$
* Version: $Revision: 1.
11
$
* Date: $Date: 2003/0
8/26 16:05:19
$
* Purpose: The main driver source module
*
******************************************************************************/
...
...
@@ -57,6 +56,52 @@
* History:
*
* $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
* Fix: Removed memory leak when sending short padded frames
*
...
...
@@ -361,6 +406,7 @@
* <linux/module.h>
*
* "h/skdrv1st.h"
* <linux/version.h>
* <linux/types.h>
* <linux/kernel.h>
* <linux/string.h>
...
...
@@ -407,7 +453,10 @@
#include <linux/module.h>
#include <linux/init.h>
#ifdef CONFIG_PROC_FS
#include <linux/proc_fs.h>
#endif
#include "h/skdrv1st.h"
#include "h/skdrv2nd.h"
...
...
@@ -514,6 +563,7 @@ static void ClearTxRing(SK_AC*, TX_PORT*);
static
int
SkGeChangeMtu
(
struct
SK_NET_DEVICE
*
dev
,
int
new_mtu
);
static
void
PortReInitBmu
(
SK_AC
*
,
int
);
static
int
SkGeIocMib
(
DEV_NET
*
,
unsigned
int
,
int
);
static
int
SkGeInitPCI
(
SK_AC
*
pAC
);
static
void
StartDrvCleanupTimer
(
SK_AC
*
pAC
);
static
void
StopDrvCleanupTimer
(
SK_AC
*
pAC
);
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
struct
proc_dir_entry
*
pSkRootDir
;
extern
int
sk_proc_read
(
char
*
buffer
,
char
**
buffer_location
,
off_t
offset
,
int
buffer_length
,
int
*
eof
,
void
*
data
);
#endif
extern
void
SkDimEnableModerationIfNeeded
(
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}};
static
uintptr_t
RxQueueAddr
[
SK_MAX_MACS
]
=
{
0x400
,
0x480
};
#ifdef CONFIG_PROC_FS
static
struct
proc_dir_entry
*
pSkRootDir
;
#endif
/*****************************************************************************
...
...
@@ -572,17 +628,19 @@ static struct proc_dir_entry *pSkRootDir;
*/
static
int
__init
skge_probe
(
void
)
{
int
proc_root_initialized
=
0
;
int
boards_found
=
0
;
int
vendor_flag
=
SK_FALSE
;
SK_AC
*
pAC
;
DEV_NET
*
pNet
=
NULL
;
struct
proc_dir_entry
*
pProcFile
;
struct
pci_dev
*
pdev
=
NULL
;
unsigned
long
base_address
;
struct
SK_NET_DEVICE
*
dev
=
NULL
;
SK_BOOL
DeviceFound
=
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
)
return
-
ENODEV
;
...
...
@@ -603,7 +661,7 @@ static int __init skge_probe (void)
continue
;
/* Configure DMA attributes. */
if
(
pci_set_dma_mask
(
pdev
,
(
u64
)
0xffffffffffffffff
)
&&
if
(
pci_set_dma_mask
(
pdev
,
(
u64
)
0xffffffffffffffff
ULL
)
&&
pci_set_dma_mask
(
pdev
,
(
u64
)
0xffffffff
))
continue
;
...
...
@@ -623,6 +681,8 @@ static int __init skge_probe (void)
pNet
=
dev
->
priv
;
pNet
->
pAC
=
kmalloc
(
sizeof
(
SK_AC
),
GFP_KERNEL
);
if
(
pNet
->
pAC
==
NULL
){
dev
->
get_stats
=
NULL
;
unregister_netdev
(
dev
);
kfree
(
dev
->
priv
);
printk
(
KERN_ERR
"Unable to allocate adapter "
"structure!
\n
"
);
...
...
@@ -649,6 +709,14 @@ static int __init skge_probe (void)
pNet
->
Mtu
=
1500
;
pNet
->
Up
=
0
;
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
);
dev
->
open
=
&
SkGeOpen
;
...
...
@@ -664,7 +732,7 @@ static int __init skge_probe (void)
#ifdef SK_ZEROCOPY
#ifdef USE_SK_TX_CHECKSUM
if
(
pAC
->
GIni
.
GIChipId
==
CHIP_ID_YUKON
)
{
if
(
pAC
->
ChipsetType
)
{
/* Use only if yukon hardware */
/* SK and ZEROCOPY - fly baby... */
dev
->
features
|=
NETIF_F_SG
|
NETIF_F_IP_CSUM
;
...
...
@@ -672,41 +740,6 @@ static int __init skge_probe (void)
#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
;
if
(
SkGeBoardInit
(
dev
,
pAC
))
{
FreeResources
(
dev
);
...
...
@@ -718,6 +751,7 @@ static int __init skge_probe (void)
(
caddr_t
)
&
pAC
->
Addr
.
Net
[
0
].
CurrentMacAddress
,
6
);
/* First adapter... Create proc and print message */
#ifdef CONFIG_PROC_FS
if
(
!
DeviceFound
)
{
DeviceFound
=
SK_TRUE
;
SK_MEMCPY
(
&
SK_Root_Dir_entry
,
BootString
,
...
...
@@ -730,11 +764,8 @@ static int __init skge_probe (void)
pSkRootDir
->
owner
=
THIS_MODULE
;
proc_root_initialized
=
1
;
}
}
/* Create proc file */
pProcFile
=
create_proc_entry
(
dev
->
name
,
S_IFREG
|
S_IXUSR
|
S_IWGRP
|
S_IROTH
,
...
...
@@ -747,13 +778,15 @@ static int __init skge_probe (void)
pProcFile
->
size
=
sizeof
(
dev
->
name
+
1
);
pProcFile
->
data
=
(
void
*
)
pProcFile
;
pProcFile
->
owner
=
THIS_MODULE
;
#endif
pNet
->
PortNr
=
0
;
pNet
->
NetNr
=
0
;
#ifdef SK_ZEROCOPY
#ifdef USE_SK_TX_CHECKSUM
if
(
pAC
->
GIni
.
GIChipId
==
CHIP_ID_YUKON
)
{
if
(
pAC
->
ChipsetType
)
{
/* SG and ZEROCOPY - fly baby... */
dev
->
features
|=
NETIF_F_SG
|
NETIF_F_IP_CSUM
;
}
...
...
@@ -790,13 +823,14 @@ static int __init skge_probe (void)
#ifdef SK_ZEROCOPY
#ifdef USE_SK_TX_CHECKSUM
if
(
pAC
->
GIni
.
GIChipId
==
CHIP_ID_YUKON
)
{
if
(
pAC
->
ChipsetType
)
{
/* SG and ZEROCOPY - fly baby... */
dev
->
features
|=
NETIF_F_SG
|
NETIF_F_IP_CSUM
;
}
#endif
#endif
#ifdef CONFIG_PROC_FS
pProcFile
=
create_proc_entry
(
dev
->
name
,
S_IFREG
|
S_IXUSR
|
S_IWGRP
|
S_IROTH
,
pSkRootDir
);
...
...
@@ -808,6 +842,7 @@ static int __init skge_probe (void)
pProcFile
->
size
=
sizeof
(
dev
->
name
+
1
);
pProcFile
->
data
=
(
void
*
)
pProcFile
;
pProcFile
->
owner
=
THIS_MODULE
;
#endif
memcpy
((
caddr_t
)
&
dev
->
dev_addr
,
(
caddr_t
)
&
pAC
->
Addr
.
Net
[
1
].
CurrentMacAddress
,
6
);
...
...
@@ -841,6 +876,68 @@ static int __init skge_probe (void)
}
/* 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
...
...
@@ -862,6 +959,9 @@ SK_AC *pAC;
pNet
=
(
DEV_NET
*
)
dev
->
priv
;
pAC
=
pNet
->
pAC
;
AllocFlag
=
pAC
->
AllocFlag
;
if
(
pAC
->
PciDev
)
{
pci_release_regions
(
pAC
->
PciDev
);
}
if
(
AllocFlag
&
SK_ALLOC_IRQ
)
{
free_irq
(
dev
->
irq
,
dev
);
}
...
...
@@ -1086,8 +1186,10 @@ SK_EVPARA EvPara;
SkGeRootDev
=
next
;
}
#ifdef CONFIG_PROC_FS
/* clear proc-dir */
remove_proc_entry
(
pSkRootDir
->
name
,
proc_net
);
#endif
}
/* skge_cleanup_module */
...
...
@@ -1171,6 +1273,13 @@ SK_BOOL DualNet;
SkRlmtInit
(
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
);
if
(
pAC
->
RlmtNets
==
2
)
{
pAC
->
GIni
.
GIPortUsage
=
SK_MUL_LINK
;
...
...
@@ -1185,7 +1294,7 @@ SK_BOOL DualNet;
Ret
=
request_irq
(
dev
->
irq
,
SkGeIsrOnePort
,
SA_SHIRQ
,
pAC
->
Name
,
dev
);
}
else
{
printk
(
KERN_WARNING
"%s: I
nvalid
number of ports: %d
\n
"
,
printk
(
KERN_WARNING
"%s: I
llegal
number of ports: %d
\n
"
,
dev
->
name
,
pAC
->
GIni
.
GIMacsFound
);
return
-
EAGAIN
;
}
...
...
@@ -2117,7 +2226,7 @@ struct sk_buff *pMessage) /* pointer to send-message */
*/
if
(
BytesSend
<
C_LEN_ETHERNET_MINSIZE
)
{
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
);
}
...
...
@@ -2141,7 +2250,7 @@ struct sk_buff *pMessage) /* pointer to send-message */
*/
PhysAddr
=
(
SK_U64
)
pci_map_page
(
pAC
->
PciDev
,
virt_to_page
(
pMessage
->
data
),
offset_in_page
(
pMessage
->
data
),
((
unsigned
long
)
pMessage
->
data
&
~
PAGE_MASK
),
pMessage
->
len
,
PCI_DMA_TODEVICE
);
pTxd
->
VDataLow
=
(
SK_U32
)
(
PhysAddr
&
0xffffffff
);
...
...
@@ -2149,18 +2258,22 @@ struct sk_buff *pMessage) /* pointer to send-message */
pTxd
->
pMBuf
=
pMessage
;
if
(
pMessage
->
ip_summed
==
CHECKSUM_HW
)
{
Protocol
=
((
SK_U8
)
pMessage
->
data
[
C_OFFSET_IPPROTO
]
&
0xf
);
if
((
Protocol
==
C_PROTO_ID_TCP
)
&&
(
pAC
->
GIni
.
GIChipRev
!=
0
))
{
pTxd
->
TBControl
=
BMU_UDP_CHECK
;
Protocol
=
((
SK_U8
)
pMessage
->
data
[
C_OFFSET_IPPROTO
]
&
0xff
);
if
((
Protocol
==
C_PROTO_ID_UDP
)
&&
(
pAC
->
GIni
.
GIChipRev
==
0
)
&&
(
pAC
->
GIni
.
GIChipId
==
CHIP_ID_YUKON
))
{
pTxd
->
TBControl
=
BMU_TCP_CHECK
;
}
else
{
pTxd
->
TBControl
=
BMU_
TCP_CHECK
;
pTxd
->
TBControl
=
BMU_
UDP_CHECK
;
}
IpHeaderLength
=
(
SK_U8
)
pMessage
->
data
[
C_OFFSET_IPHEADER
];
IpHeaderLength
=
(
IpHeaderLength
&
0xf
)
*
4
;
pTxd
->
TcpSumOfs
=
0
;
/* PH-Checksum already calculated */
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
->
TBControl
|=
BMU_OWN
|
BMU_STF
|
...
...
@@ -2258,7 +2371,7 @@ struct sk_buff *pMessage) /* pointer to send-message */
*/
PhysAddr
=
(
SK_U64
)
pci_map_page
(
pAC
->
PciDev
,
virt_to_page
(
pMessage
->
data
),
offset_in_page
(
pMessage
->
data
),
((
unsigned
long
)
pMessage
->
data
&
~
PAGE_MASK
),
skb_headlen
(
pMessage
),
PCI_DMA_TODEVICE
);
...
...
@@ -2275,17 +2388,21 @@ struct sk_buff *pMessage) /* pointer to send-message */
** opcode for udp is not working in the hardware yet
** (Revision 2.0)
*/
Protocol
=
((
SK_U8
)
pMessage
->
data
[
C_OFFSET_IPPROTO
]
&
0xf
);
if
((
Protocol
==
C_PROTO_ID_TCP
)
&&
(
pAC
->
GIni
.
GIChipRev
!=
0
))
{
pTxd
->
TBControl
|=
BMU_UDP_CHECK
;
Protocol
=
((
SK_U8
)
pMessage
->
data
[
C_OFFSET_IPPROTO
]
&
0xff
);
if
((
Protocol
==
C_PROTO_ID_UDP
)
&&
(
pAC
->
GIni
.
GIChipRev
==
0
)
&&
(
pAC
->
GIni
.
GIChipId
==
CHIP_ID_YUKON
))
{
pTxd
->
TBControl
|=
BMU_TCP_CHECK
;
}
else
{
pTxd
->
TBControl
|=
BMU_
TCP_CHECK
;
pTxd
->
TBControl
|=
BMU_
UDP_CHECK
;
}
IpHeaderLength
=
((
SK_U8
)
pMessage
->
data
[
C_OFFSET_IPHEADER
]
&
0xf
)
*
4
;
pTxd
->
TcpSumOfs
=
0
;
/* PH-Checksum already claculated */
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
;
}
else
{
pTxd
->
TBControl
=
BMU_CHECK
|
BMU_SW
|
BMU_STF
|
...
...
@@ -2324,11 +2441,12 @@ struct sk_buff *pMessage) /* pointer to send-message */
** opcode for udp is not working in the hardware yet
** (revision 2.0)
*/
if
(
(
Protocol
==
C_PROTO_ID_TCP
)
&&
(
pAC
->
GIni
.
GIChipRev
!=
0
)
)
{
pTxd
->
TBControl
|=
BMU_UDP_CHECK
;
if
((
Protocol
==
C_PROTO_ID_UDP
)
&&
(
pAC
->
GIni
.
GIChipRev
==
0
)
&&
(
pAC
->
GIni
.
GIChipId
==
CHIP_ID_YUKON
))
{
pTxd
->
TBControl
|=
BMU_TCP_CHECK
;
}
else
{
pTxd
->
TBControl
|=
BMU_
TCP_CHECK
;
pTxd
->
TBControl
|=
BMU_
UDP_CHECK
;
}
}
else
{
pTxd
->
TBControl
=
BMU_CHECK
|
BMU_SW
|
BMU_OWN
;
...
...
@@ -2517,7 +2635,8 @@ SK_U64 PhysAddr; /* physical address of a rx buffer */
Length
=
pAC
->
RxBufSize
;
PhysAddr
=
(
SK_U64
)
pci_map_page
(
pAC
->
PciDev
,
virt_to_page
(
pMsgBlock
->
data
),
offset_in_page
(
pMsgBlock
->
data
),
((
unsigned
long
)
pMsgBlock
->
data
&
~
PAGE_MASK
),
pAC
->
RxBufSize
-
2
,
PCI_DMA_FROMDEVICE
);
...
...
@@ -2789,7 +2908,7 @@ SK_U64 PhysAddr;
/* Frame not padded => TCP offload! */
if
((((
Csum1
&
0xfffe
)
&&
(
Csum2
&
0xfffe
))
&&
(
pAC
->
GIni
.
GIChipId
==
CHIP_ID_GENESIS
))
||
(
pAC
->
GIni
.
GIChipId
==
CHIP_ID_YUKON
))
{
(
pAC
->
ChipsetType
))
{
Result
=
SkCsGetReceiveInfo
(
pAC
,
&
pMsg
->
data
[
14
],
Csum1
,
Csum2
,
pRxPort
->
PortIndex
);
...
...
@@ -3556,21 +3675,26 @@ int HeaderLength = sizeof(SK_U32) + sizeof(SK_U32);
Length
=
sizeof
(
pAC
->
PnmiStruct
)
+
HeaderLength
;
}
if
(
NULL
==
(
pMemBuf
=
kmalloc
(
Length
,
GFP_KERNEL
)))
{
return
-
E
FAULT
;
return
-
E
NOMEM
;
}
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
)
{
return
-
EFAULT
;
Err
=
-
EFAULT
;
goto
fault_gen
;
}
if
(
copy_to_user
(
Ioctl
.
pData
,
pMemBuf
,
Length
)
)
{
return
-
EFAULT
;
Err
=
-
EFAULT
;
goto
fault_gen
;
}
Ioctl
.
Len
=
Length
;
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 */
break
;
default:
...
...
@@ -3657,6 +3781,7 @@ int AutoNeg = 1; /* autoneg off (0) or on (1) */
int
DuplexCap
=
0
;
/* 0=both,1=full,2=half */
int
FlowCtrl
=
SK_FLOW_MODE_SYM_OR_REM
;
/* FlowControl */
int
MSMode
=
SK_MS_MODE_AUTO
;
/* master/slave mode */
SK_BOOL
IsConTypeDefined
=
SK_TRUE
;
SK_BOOL
IsLinkSpeedDefined
=
SK_TRUE
;
SK_BOOL
IsFlowCtrlDefined
=
SK_TRUE
;
...
...
@@ -3687,6 +3812,7 @@ int Capabilities[3][3] =
#define AN_SENS 2
#define M_CurrPort pAC->GIni.GP[Port]
/*
** Set the default values first for both ports!
*/
...
...
@@ -3720,6 +3846,21 @@ int Capabilities[3][3] =
if
(
(
ConType
!=
NULL
)
&&
(
pAC
->
Index
<
SK_MAX_CARD_PARAM
)
&&
(
ConType
[
pAC
->
Index
]
!=
NULL
)
)
{
/* 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 */
}
else
if
(
strcmp
(
ConType
[
pAC
->
Index
],
"Auto"
)
==
0
)
{
...
...
@@ -3795,8 +3936,7 @@ int Capabilities[3][3] =
** Check speed parameter:
** Only copper type adapter and GE V2 cards
*/
if
(((
pAC
->
GIni
.
GIChipId
!=
CHIP_ID_YUKON
)
||
(
pAC
->
GIni
.
GICopperType
!=
SK_TRUE
))
&&
if
(((
!
pAC
->
ChipsetType
)
||
(
pAC
->
GIni
.
GICopperType
!=
SK_TRUE
))
&&
((
LinkSpeed
!=
SK_LSPEED_AUTO
)
&&
(
LinkSpeed
!=
SK_LSPEED_1000MBPS
)))
{
printk
(
"%s: Illegal value for Speed_A. "
...
...
@@ -3858,6 +3998,16 @@ int Capabilities[3][3] =
/*
** 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
)
{
printk
(
"%s, Port A: DuplexCapabilities"
" ignored using Sense mode
\n
"
,
pAC
->
dev
[
0
]
->
name
);
...
...
@@ -3985,8 +4135,7 @@ int Capabilities[3][3] =
** Check speed parameter:
** Only copper type adapter and GE V2 cards
*/
if
(((
pAC
->
GIni
.
GIChipId
!=
CHIP_ID_YUKON
)
||
(
pAC
->
GIni
.
GICopperType
!=
SK_TRUE
))
&&
if
(((
!
pAC
->
ChipsetType
)
||
(
pAC
->
GIni
.
GICopperType
!=
SK_TRUE
))
&&
((
LinkSpeed
!=
SK_LSPEED_AUTO
)
&&
(
LinkSpeed
!=
SK_LSPEED_1000MBPS
)))
{
printk
(
"%s: Illegal value for Speed_B. "
...
...
@@ -4045,9 +4194,20 @@ int Capabilities[3][3] =
}
}
/*
** 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
)
{
printk
(
"%s, Port B: DuplexCapabilities"
" ignored using Sense mode
\n
"
,
pAC
->
dev
[
1
]
->
name
);
...
...
@@ -4274,7 +4434,7 @@ int Capabilities[3][3] =
}
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
;
}
else
{
pAC
->
DynIrqModInfo
.
MaxModIntsPerSec
=
IntsPerSec
[
pAC
->
Index
];
...
...
@@ -4755,8 +4915,22 @@ SK_BOOL DualNet;
}
}
/*
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
if
(
pAC
->
GIni
.
GIChipId
==
CHIP_ID_YUKON
)
if
(
pAC
->
ChipsetType
)
#ifdef USE_SK_TX_CHECKSUM
printk
(
" scatter-gather: enabled
\n
"
);
#else
...
...
drivers/net/sk98lin/skproc.c
View file @
662c8869
...
...
@@ -2,8 +2,8 @@
*
* Name: skproc.c
* Project: GEnesis, PCI Gigabit Ethernet Adapter
* Version: $Revision: 1.
8
$
* Date: $Date: 2003/0
6/27 14:41:42
$
* Version: $Revision: 1.
2
$
* Date: $Date: 2003/0
8/12 16:45:29
$
* Purpose: Funktions to display statictic data
*
******************************************************************************/
...
...
@@ -28,6 +28,13 @@
* History:
*
* $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
* Corrected compiler-warning kernel 2.2
*
...
...
@@ -86,23 +93,9 @@
#include "h/skdrv1st.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
char
*
SkNumber
(
char
*
str
,
long
long
num
,
int
base
,
int
size
,
int
precision
,
int
type
);
int
sk_proc_read
(
char
*
buffer
,
char
**
buffer_location
,
...
...
@@ -137,7 +130,6 @@ void *data)
int
i
;
DEV_NET
*
pNet
;
SK_AC
*
pAC
;
char
test_buf
[
100
];
char
sens_msg
[
50
];
unsigned
long
Flags
;
unsigned
int
Size
;
...
...
@@ -247,13 +239,11 @@ void *data)
"
\n
Receive statistics
\n\n
"
);
len
+=
sprintf
(
buffer
+
len
,
"Received bytes %s
\n
"
,
SkNumber
(
test_buf
,
pPnmiStat
->
StatRxOctetsOkCts
,
10
,
0
,
-
1
,
0
));
"Received bytes %Ld
\n
"
,
(
unsigned
long
long
)
pPnmiStat
->
StatRxOctetsOkCts
);
len
+=
sprintf
(
buffer
+
len
,
"Received packets %s
\n
"
,
SkNumber
(
test_buf
,
pPnmiStat
->
StatRxOkCts
,
10
,
0
,
-
1
,
0
));
"Received packets %Ld
\n
"
,
(
unsigned
long
long
)
pPnmiStat
->
StatRxOkCts
);
#if 0
if (pAC->GIni.GP[0].PhyType == SK_PHY_XMAC &&
pAC->HWRevision < 12) {
...
...
@@ -267,71 +257,56 @@ void *data)
pPnmiStat
->
StatRxTooLongCts
;
len
+=
sprintf
(
buffer
+
len
,
"Receive errors %s
\n
"
,
SkNumber
(
test_buf
,
pPnmiStruct
->
InErrorsCts
,
10
,
0
,
-
1
,
0
));
"Receive errors %Ld
\n
"
,
(
unsigned
long
long
)
pPnmiStruct
->
InErrorsCts
);
len
+=
sprintf
(
buffer
+
len
,
"Receive dropped %s
\n
"
,
SkNumber
(
test_buf
,
pPnmiStruct
->
RxNoBufCts
,
10
,
0
,
-
1
,
0
));
"Receive dropped %Ld
\n
"
,
(
unsigned
long
long
)
pPnmiStruct
->
RxNoBufCts
);
len
+=
sprintf
(
buffer
+
len
,
"Received multicast %s
\n
"
,
SkNumber
(
test_buf
,
pPnmiStat
->
StatRxMulticastOkCts
,
10
,
0
,
-
1
,
0
));
"Received multicast %Ld
\n
"
,
(
unsigned
long
long
)
pPnmiStat
->
StatRxMulticastOkCts
);
len
+=
sprintf
(
buffer
+
len
,
"Receive error types
\n
"
);
len
+=
sprintf
(
buffer
+
len
,
" length %s
\n
"
,
SkNumber
(
test_buf
,
pPnmiStat
->
StatRxRuntCts
,
10
,
0
,
-
1
,
0
));
" length %Ld
\n
"
,
(
unsigned
long
long
)
pPnmiStat
->
StatRxRuntCts
);
len
+=
sprintf
(
buffer
+
len
,
" buffer overflow %s
\n
"
,
SkNumber
(
test_buf
,
pPnmiStat
->
StatRxFifoOverflowCts
,
10
,
0
,
-
1
,
0
));
" buffer overflow %Ld
\n
"
,
(
unsigned
long
long
)
pPnmiStat
->
StatRxFifoOverflowCts
);
len
+=
sprintf
(
buffer
+
len
,
" bad crc %s
\n
"
,
SkNumber
(
test_buf
,
pPnmiStat
->
StatRxFcsCts
,
10
,
0
,
-
1
,
0
));
" bad crc %Ld
\n
"
,
(
unsigned
long
long
)
pPnmiStat
->
StatRxFcsCts
);
len
+=
sprintf
(
buffer
+
len
,
" framing %s
\n
"
,
SkNumber
(
test_buf
,
pPnmiStat
->
StatRxFramingCts
,
10
,
0
,
-
1
,
0
));
" framing %Ld
\n
"
,
(
unsigned
long
long
)
pPnmiStat
->
StatRxFramingCts
);
len
+=
sprintf
(
buffer
+
len
,
" missed frames %s
\n
"
,
SkNumber
(
test_buf
,
pPnmiStat
->
StatRxMissedCts
,
10
,
0
,
-
1
,
0
));
" missed frames %Ld
\n
"
,
(
unsigned
long
long
)
pPnmiStat
->
StatRxMissedCts
);
if
(
pNet
->
Mtu
>
1500
)
pPnmiStat
->
StatRxTooLongCts
=
0
;
len
+=
sprintf
(
buffer
+
len
,
" too long %s
\n
"
,
SkNumber
(
test_buf
,
pPnmiStat
->
StatRxTooLongCts
,
10
,
0
,
-
1
,
0
));
" too long %Ld
\n
"
,
(
unsigned
long
long
)
pPnmiStat
->
StatRxTooLongCts
);
len
+=
sprintf
(
buffer
+
len
,
" carrier extension %s
\n
"
,
SkNumber
(
test_buf
,
pPnmiStat
->
StatRxCextCts
,
10
,
0
,
-
1
,
0
));
" carrier extension %Ld
\n
"
,
(
unsigned
long
long
)
pPnmiStat
->
StatRxCextCts
);
len
+=
sprintf
(
buffer
+
len
,
" too short %s
\n
"
,
SkNumber
(
test_buf
,
pPnmiStat
->
StatRxShortsCts
,
10
,
0
,
-
1
,
0
));
" too short %Ld
\n
"
,
(
unsigned
long
long
)
pPnmiStat
->
StatRxShortsCts
);
len
+=
sprintf
(
buffer
+
len
,
" symbol %s
\n
"
,
SkNumber
(
test_buf
,
pPnmiStat
->
StatRxSymbolCts
,
10
,
0
,
-
1
,
0
));
" symbol %Ld
\n
"
,
(
unsigned
long
long
)
pPnmiStat
->
StatRxSymbolCts
);
len
+=
sprintf
(
buffer
+
len
,
" LLC MAC size %s
\n
"
,
SkNumber
(
test_buf
,
pPnmiStat
->
StatRxIRLengthCts
,
10
,
0
,
-
1
,
0
));
" LLC MAC size %Ld
\n
"
,
(
unsigned
long
long
)
pPnmiStat
->
StatRxIRLengthCts
);
len
+=
sprintf
(
buffer
+
len
,
" carrier event %s
\n
"
,
SkNumber
(
test_buf
,
pPnmiStat
->
StatRxCarrierCts
,
10
,
0
,
-
1
,
0
));
" carrier event %Ld
\n
"
,
(
unsigned
long
long
)
pPnmiStat
->
StatRxCarrierCts
);
len
+=
sprintf
(
buffer
+
len
,
" jabber %s
\n
"
,
SkNumber
(
test_buf
,
pPnmiStat
->
StatRxJabberCts
,
10
,
0
,
-
1
,
0
));
" jabber %Ld
\n
"
,
(
unsigned
long
long
)
pPnmiStat
->
StatRxJabberCts
);
/*Transmit statistics */
...
...
@@ -339,42 +314,34 @@ void *data)
"
\n
Transmit statistics
\n\n
"
);
len
+=
sprintf
(
buffer
+
len
,
"Transmited bytes %s
\n
"
,
SkNumber
(
test_buf
,
pPnmiStat
->
StatTxOctetsOkCts
,
10
,
0
,
-
1
,
0
));
"Transmited bytes %Ld
\n
"
,
(
unsigned
long
long
)
pPnmiStat
->
StatTxOctetsOkCts
);
len
+=
sprintf
(
buffer
+
len
,
"Transmited packets %s
\n
"
,
SkNumber
(
test_buf
,
pPnmiStat
->
StatTxOkCts
,
10
,
0
,
-
1
,
0
));
"Transmited packets %Ld
\n
"
,
(
unsigned
long
long
)
pPnmiStat
->
StatTxOkCts
);
len
+=
sprintf
(
buffer
+
len
,
"Transmit errors %s
\n
"
,
SkNumber
(
test_buf
,
pPnmiStat
->
StatTxSingleCollisionCts
,
10
,
0
,
-
1
,
0
));
"Transmit errors %Ld
\n
"
,
(
unsigned
long
long
)
pPnmiStat
->
StatTxSingleCollisionCts
);
len
+=
sprintf
(
buffer
+
len
,
"Transmit dropped %s
\n
"
,
SkNumber
(
test_buf
,
pPnmiStruct
->
TxNoBufCts
,
10
,
0
,
-
1
,
0
));
"Transmit dropped %Ld
\n
"
,
(
unsigned
long
long
)
pPnmiStruct
->
TxNoBufCts
);
len
+=
sprintf
(
buffer
+
len
,
"Transmit collisions %s
\n
"
,
SkNumber
(
test_buf
,
pPnmiStat
->
StatTxSingleCollisionCts
,
10
,
0
,
-
1
,
0
));
"Transmit collisions %Ld
\n
"
,
(
unsigned
long
long
)
pPnmiStat
->
StatTxSingleCollisionCts
);
len
+=
sprintf
(
buffer
+
len
,
"Transmit error types
\n
"
);
len
+=
sprintf
(
buffer
+
len
,
" excessive collision %ld
\n
"
,
pAC
->
stats
.
tx_aborted_errors
);
len
+=
sprintf
(
buffer
+
len
,
" carrier %s
\n
"
,
SkNumber
(
test_buf
,
pPnmiStat
->
StatTxCarrierCts
,
10
,
0
,
-
1
,
0
));
" carrier %Ld
\n
"
,
(
unsigned
long
long
)
pPnmiStat
->
StatTxCarrierCts
);
len
+=
sprintf
(
buffer
+
len
,
" fifo underrun %s
\n
"
,
SkNumber
(
test_buf
,
pPnmiStat
->
StatTxFifoUnderrunCts
,
10
,
0
,
-
1
,
0
));
" fifo underrun %Ld
\n
"
,
(
unsigned
long
long
)
pPnmiStat
->
StatTxFifoUnderrunCts
);
len
+=
sprintf
(
buffer
+
len
,
" heartbeat %s
\n
"
,
SkNumber
(
test_buf
,
pPnmiStat
->
StatTxCarrierCts
,
10
,
0
,
-
1
,
0
));
" heartbeat %Ld
\n
"
,
(
unsigned
long
long
)
pPnmiStat
->
StatTxCarrierCts
);
len
+=
sprintf
(
buffer
+
len
,
" window %ld
\n
"
,
pAC
->
stats
.
tx_window_errors
);
...
...
@@ -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
;
}
drivers/net/smc-ultra.c
View file @
662c8869
...
...
@@ -562,16 +562,3 @@ cleanup_module(void)
}
}
#endif
/* MODULE */
/*
* Local variables:
* compile-command: "gcc -D__KERNEL__ -Wall -O6 -I/usr/src/linux/net/inet -c smc-ultra.c"
* version-control: t
* kept-new-versions: 5
* c-indent-level: 4
* c-basic-offset: 4
* tab-width: 4
* End:
*/
drivers/net/tlan.c
View file @
662c8869
...
...
@@ -884,6 +884,8 @@ static int TLan_Init( struct net_device *dev )
}
dev
->
addr_len
=
6
;
netif_carrier_off
(
dev
);
/* Device methods */
dev
->
open
=
&
TLan_Open
;
dev
->
hard_start_xmit
=
&
TLan_StartTx
;
...
...
@@ -2205,6 +2207,8 @@ TLan_ResetAdapter( struct net_device *dev )
priv
->
tlanFullDuplex
=
FALSE
;
priv
->
phyOnline
=
0
;
netif_carrier_off
(
dev
);
/* 1. Assert reset bit. */
data
=
inl
(
dev
->
base_addr
+
TLAN_HOST_CMD
);
...
...
@@ -2368,6 +2372,7 @@ TLan_FinishReset( struct net_device *dev )
}
outl
(
priv
->
rxListDMA
,
dev
->
base_addr
+
TLAN_CH_PARM
);
outl
(
TLAN_HC_GO
|
TLAN_HC_RT
,
dev
->
base_addr
+
TLAN_HOST_CMD
);
netif_carrier_on
(
dev
);
}
else
{
printk
(
"TLAN: %s: Link inactive, will retry in 10 secs...
\n
"
,
dev
->
name
);
TLan_SetTimer
(
dev
,
(
10
*
HZ
),
TLAN_TIMER_FINISH_RESET
);
...
...
drivers/net/tulip/Kconfig
View file @
662c8869
...
...
@@ -23,11 +23,9 @@ config DE2104X
will say Y here.) Do read the Ethernet-HOWTO, available from
<http://www.tldp.org/docs.html#howto>.
This driver is also available as a module ( = code which can be
inserted in and removed from the running kernel whenever you want).
The module will be called de2104x. If you want to compile it as a
module, say M here and read <file:Documentation/modules.txt> as well
as <file:Documentation/networking/net-modules.txt>.
To compile this driver as a module, choose M here and read
<file:Documentation/networking/net-modules.txt>. The module will
be called de2104x.
config TULIP
tristate "DECchip Tulip (dc2114x) PCI support"
...
...
@@ -44,11 +42,9 @@ config TULIP
information is contained in
<file:Documentation/networking/tulip.txt>.
This driver is also available as a module ( = code which can be
inserted in and removed from the running kernel whenever you want).
The module will be called tulip. If you want to compile it as a
module, say M here and read <file:Documentation/modules.txt> as well
as <file:Documentation/networking/net-modules.txt>.
To compile this driver as a module, choose M here and read
<file:Documentation/networking/net-modules.txt>. The module will
be called tulip.
config TULIP_MWI
bool "New bus configuration (EXPERIMENTAL)"
...
...
@@ -82,11 +78,9 @@ config DE4X5
information is contained in
<file:Documentation/networking/de4x5.txt>.
This driver is also available as a module ( = code which can be
inserted in and removed from the running kernel whenever you want).
The module will be called de4x5. If you want to compile it as a
module, say M here and read <file:Documentation/modules.txt> as well
as <file:Documentation/networking/net-modules.txt>.
To compile this driver as a module, choose M here and read
<file:Documentation/networking/net-modules.txt>. The module will
be called de4x5.
config WINBOND_840
tristate "Winbond W89c840 Ethernet support"
...
...
@@ -106,11 +100,9 @@ config DM9102
(Ethernet) card, say Y. Some information is contained in the file
<file:Documentation/networking/dmfe.txt>.
This driver is also available as a module ( = code which can be
inserted in and removed from the running kernel whenever you want).
The module will be called dmfe. If you want to compile it as a
module, say M here and read <file:Documentation/modules.txt> as well
as <file:Documentation/networking/net-modules.txt>.
To compile this driver as a module, choose M here and read
<file:Documentation/networking/net-modules.txt>. The module will
be called dmfe.
config PCMCIA_XIRCOM
tristate "Xircom CardBus support (new driver)"
...
...
@@ -121,11 +113,9 @@ config PCMCIA_XIRCOM
as with work-alike chips from Lite-On (PNIC) and Macronix (MXIC) and
ASIX.
This driver is also available as a module ( = code which can be
inserted in and removed from the running kernel whenever you want).
The module will be called xircom_cb. If you want to compile
it as a module, say M here and read
<file:Documentation/modules.txt>. If unsure, say N.
To compile this driver as a module, choose M here and read
<file:Documentation/networking/net-modules.txt>. The module will
be called xircom_cb. If unsure, say N.
config PCMCIA_XIRTULIP
tristate "Xircom Tulip-like CardBus support (old driver)"
...
...
@@ -136,11 +126,9 @@ config PCMCIA_XIRTULIP
as with work-alike chips from Lite-On (PNIC) and Macronix (MXIC) and
ASIX.
This driver is also available as a module ( = code which can be
inserted in and removed from the running kernel whenever you want).
The module will be called xircom_tulip_cb. If you want to compile
it as a module, say M here and read
<file:Documentation/modules.txt>. If unsure, say N.
To compile this driver as a module, choose M here and read
<file:Documentation/networking/net-modules.txt>. The module will
be called xircom_tulip_cb. If unsure, say N.
endmenu
drivers/net/wd.c
View file @
662c8869
...
...
@@ -511,13 +511,3 @@ cleanup_module(void)
}
}
#endif
/* MODULE */
/*
* Local variables:
* compile-command: "gcc -D__KERNEL__ -I/usr/src/linux/net/inet -Wall -Wstrict-prototypes -O6 -m486 -c wd.c"
* version-control: t
* tab-width: 4
* kept-new-versions: 5
* End:
*/
drivers/net/wireless/Makefile
View file @
662c8869
...
...
@@ -3,7 +3,9 @@
#
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
obj-$(CONFIG_WAVELAN)
+=
wavelan.o
...
...
drivers/net/wireless/arlan.c
→
drivers/net/wireless/arlan
-main
.c
View file @
662c8869
...
...
@@ -16,15 +16,12 @@
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
];
int
last_arlan
;
static
int
SID
=
SIDUNKNOWN
;
static
int
radioNodeId
=
radioNodeIdUNKNOWN
;
static
char
encryptionKey
[
12
]
=
{
'a'
,
'b'
,
'c'
,
'd'
,
'e'
,
'f'
,
'g'
,
'h'
};
static
char
*
siteName
=
siteNameUNKNOWN
;
static
int
mem
=
memUNKNOWN
;
int
arlan_debug
=
debugUNKNOWN
;
static
int
probe
=
probeUNKNOWN
;
static
int
numDevices
=
numDevicesUNKNOWN
;
static
int
spreadingCode
=
spreadingCodeUNKNOWN
;
static
int
channelNumber
=
channelNumberUNKNOWN
;
...
...
@@ -34,7 +31,6 @@ static int registrationMode = registrationModeUNKNOWN;
static
int
keyStart
;
static
int
tx_delay_ms
;
static
int
retries
=
5
;
static
int
async
=
1
;
static
int
tx_queue_len
=
1
;
static
int
arlan_EEPROM_bad
;
...
...
@@ -48,7 +44,6 @@ static int txScrambled = 1;
static
int
mdebug
;
#endif
#if LINUX_VERSION_CODE > 0x20100
MODULE_PARM
(
irq
,
"i"
);
MODULE_PARM
(
mem
,
"i"
);
MODULE_PARM
(
probe
,
"i"
);
...
...
@@ -91,23 +86,6 @@ MODULE_PARM_DESC(arlan_exit_debug, "(ignored)");
MODULE_PARM_DESC
(
arlan_entry_and_exit_debug
,
"(ignored)"
);
#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
];
static
int
arlans_found
;
...
...
@@ -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_process_interrupt
(
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
long
arlan_time
(
void
)
static
inline
long
us2ticks
(
int
us
)
{
struct
timeval
timev
;
do_gettimeofday
(
&
timev
);
return
((
long
long
)
timev
.
tv_sec
*
1000000
+
timev
.
tv_usec
);
};
return
us
*
(
1000000
/
HZ
);
}
#ifdef ARLAN_ENTRY_EXIT_DEBUGGING
#define ARLAN_DEBUG_ENTRY(name) \
...
...
@@ -161,35 +135,9 @@ static inline long long arlan_time(void)
clearClearInterrupt(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
)
{
struct
arlan_private
*
priv
=
((
struct
arlan_private
*
)
dev
->
priv
)
;
struct
arlan_private
*
priv
=
dev
->
priv
;
priv
->
stats
.
tx_errors
++
;
if
(
priv
->
Conf
->
tx_delay_ms
)
...
...
@@ -202,24 +150,22 @@ static inline int arlan_drop_tx(struct net_device *dev)
TXHEAD
(
dev
).
offset
=
0
;
TXTAIL
(
dev
).
offset
=
0
;
priv
->
txLast
=
0
;
priv
->
txOffset
=
0
;
priv
->
bad
=
0
;
if
(
!
priv
->
under_reset
&&
!
priv
->
under_config
)
netif_wake_queue
(
dev
);
}
return
1
;
}
;
}
int
arlan_command
(
struct
net_device
*
dev
,
int
command_p
)
{
volatile
struct
arlan_shmem
*
arlan
=
((
struct
arlan_private
*
)
dev
->
priv
)
->
card
;
struct
arlan_conf_stru
*
conf
=
((
struct
arlan_private
*
)
dev
->
priv
)
->
Conf
;
struct
arlan_private
*
priv
=
(
struct
arlan_private
*
)
dev
->
priv
;
struct
arlan_private
*
priv
=
dev
->
priv
;
volatile
struct
arlan_shmem
*
arlan
=
priv
->
card
;
struct
arlan_conf_stru
*
conf
=
priv
->
Conf
;
int
udelayed
=
0
;
int
i
=
0
;
long
long
time_mks
=
arlan_time
()
;
unsigned
long
flags
;
ARLAN_DEBUG_ENTRY
(
"arlan_command"
);
...
...
@@ -227,14 +173,14 @@ int arlan_command(struct net_device *dev, int command_p)
priv
->
card_polling_interval
=
1
;
if
(
arlan_debug
&
ARLAN_DEBUG_CHAIN_LOCKS
)
printk
(
KERN_DEBUG
"arlan_command, %lx
lock %lx commandByte %x waiting %
x incoming %x
\n
"
,
jiffies
,
priv
->
command_lock
,
READSHMB
(
arlan
->
commandByte
),
printk
(
KERN_DEBUG
"arlan_command, %lx
commandByte %x waiting %l
x incoming %x
\n
"
,
jiffies
,
READSHMB
(
arlan
->
commandByte
),
priv
->
waiting_command_mask
,
command_p
);
priv
->
waiting_command_mask
|=
command_p
;
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
;
if
(
priv
->
waiting_command_mask
&
ARLAN_COMMAND_INT_ACK
)
...
...
@@ -249,13 +195,8 @@ int arlan_command(struct net_device *dev, int command_p)
}
/* 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 */
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)
if
(
priv
->
tx_command_given
||
priv
->
rx_command_given
)
{
printk
(
KERN_ERR
"%s: Reset under tx or rx command
\n
"
,
dev
->
name
);
}
;
}
netif_stop_queue
(
dev
);
if
(
arlan_debug
&
ARLAN_DEBUG_RESET
)
printk
(
KERN_ERR
"%s: Doing chip reset
\n
"
,
dev
->
name
);
...
...
@@ -373,7 +314,6 @@ int arlan_command(struct net_device *dev, int command_p)
WRITESHM
(
arlan
->
resetFlag
,
0xff
,
u_char
);
clearChannelAttention
(
dev
);
clearHardwareReset
(
dev
);
priv
->
numResets
++
;
priv
->
card_polling_interval
=
HZ
/
4
;
priv
->
waiting_command_mask
&=
~
ARLAN_COMMAND_RESET
;
priv
->
waiting_command_mask
|=
ARLAN_COMMAND_INT_RACK
;
...
...
@@ -441,7 +381,6 @@ int arlan_command(struct net_device *dev, int command_p)
WRITESHMB
(
arlan
->
commandParameter
[
0
],
conf
->
rxParameter
);
arlan_interrupt_lancpu
(
dev
);
priv
->
rx_command_given
=
0
;
// mnjah, bad
priv
->
last_rx_time
=
arlan_time
();
priv
->
waiting_command_mask
&=
~
ARLAN_COMMAND_RX
;
priv
->
card_polling_interval
=
1
;
}
...
...
@@ -455,24 +394,24 @@ int arlan_command(struct net_device *dev, int command_p)
{
priv
->
waiting_command_mask
&=
~
ARLAN_COMMAND_TBUSY_CLEAR
;
netif_wake_queue
(
dev
);
}
;
}
}
else
if
(
priv
->
waiting_command_mask
&
ARLAN_COMMAND_TX
)
{
if
(
!
test_and_set_bit
(
0
,
(
void
*
)
&
priv
->
tx_command_given
))
{
if
((
time_mks
-
priv
->
last_tx_time
>
conf
->
rx_tweak1
)
||
(
time_mks
-
priv
->
last_rx_int_ack_time
<
conf
->
rx_tweak2
))
if
(
time_after
(
jiffies
,
priv
->
tx_last_sent
+
us2ticks
(
conf
->
rx_tweak1
))
||
time_before
(
jiffies
,
priv
->
last_rx_int_ack_time
+
us2ticks
(
conf
->
rx_tweak2
)))
{
setInterruptEnable
(
dev
);
memset_io
((
void
*
)
arlan
->
commandParameter
,
0
,
0xf
);
WRITESHMB
(
arlan
->
commandByte
,
ARLAN_COM_TX_ENABLE
|
ARLAN_COM_INT
);
memcpy_toio
((
void
*
)
arlan
->
commandParameter
,
&
TXLAST
(
dev
),
14
);
// for ( i=1 ; i < 15 ; i++) printk("%02x:",READSHMB(arlan->commandParameter[i]));
priv
->
last_command_was_rx
=
0
;
priv
->
tx_last_sent
=
jiffies
;
arlan_interrupt_lancpu
(
dev
);
priv
->
last_tx_time
=
arlan_time
();
priv
->
tx_command_given
=
1
;
priv
->
waiting_command_mask
&=
~
ARLAN_COMMAND_TX
;
priv
->
card_polling_interval
=
1
;
...
...
@@ -522,42 +461,35 @@ int arlan_command(struct net_device *dev, int command_p)
udelay
(
10
);
if
(
READSHMB
(
arlan
->
commandByte
))
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"
);
priv
->
last_command_buff_free_time
=
jiffies
;
return
0
;
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
;
if
(
arlan_debug
&
ARLAN_DEBUG_CARD_STATE
)
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"
);
return
1
;
bad_end:
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"
);
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
)
{
struct
arlan_private
*
priv
=
((
struct
arlan_private
*
)
dev
->
priv
)
;
struct
arlan_private
*
priv
=
dev
->
priv
;
int
times
=
0
;
while
(
priv
->
waiting_command_mask
&&
times
<
8
)
...
...
@@ -578,7 +510,7 @@ static inline void arlan_command_process(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"
);
...
...
@@ -597,15 +529,12 @@ static inline void arlan_retransmit_now(struct net_device *dev)
}
else
IFDEBUG
(
ARLAN_DEBUG_TX_CHAIN
)
printk
(
KERN_ERR
"ReTransmit buff empty"
);
priv
->
txOffset
=
0
;
netif_wake_queue
(
dev
);
return
;
}
arlan_command
(
dev
,
ARLAN_COMMAND_TX
);
priv
->
nof_tx
++
;
priv
->
Conf
->
driverRetransmissions
++
;
priv
->
retransmissions
++
;
...
...
@@ -619,19 +548,14 @@ static inline void arlan_retransmit_now(struct net_device *dev)
static
void
arlan_registration_timer
(
unsigned
long
data
)
{
struct
net_device
*
dev
=
(
struct
net_device
*
)
data
;
struct
arlan_private
*
priv
=
(
struct
arlan_private
*
)
dev
->
priv
;
int
lostTime
=
((
int
)
(
jiffies
-
priv
->
registrationLastSeen
))
*
1000
/
HZ
;
struct
arlan_private
*
priv
=
dev
->
priv
;
int
bh_mark_needed
=
0
;
int
next_tick
=
1
;
priv
->
timer_chain_active
=
1
;
long
lostTime
=
((
long
)
jiffies
-
(
long
)
priv
->
registrationLastSeen
)
*
(
1000
/
HZ
);
if
(
registrationBad
(
dev
))
{
//debug=100;
priv
->
registrationLostCount
++
;
if
(
lostTime
>
7000
&&
lostTime
<
7200
)
{
...
...
@@ -654,19 +578,19 @@ static void arlan_registration_timer(unsigned long data)
if
(
priv
->
Conf
->
registrationMode
&&
lostTime
>
10000
&&
priv
->
registrationLostCount
)
{
printk
(
KERN_NOTICE
"%s registration is back after %
d milliseconds
\n
"
,
dev
->
name
,
((
int
)
(
jiffies
-
priv
->
registrationLastSeen
)
*
1000
)
/
HZ
);
printk
(
KERN_NOTICE
"%s registration is back after %
ld milliseconds
\n
"
,
dev
->
name
,
lostTime
);
}
priv
->
registrationLastSeen
=
jiffies
;
priv
->
registrationLostCount
=
0
;
priv
->
reRegisterExp
=
1
;
if
(
!
netif_running
(
dev
)
)
netif_wake_queue
(
dev
);
if
(
priv
->
tx_last_sent
>
priv
->
tx_last_cleared
&&
jiffies
-
priv
->
tx_last_sent
>
5
*
HZ
){
if
(
time_after
(
priv
->
tx_last_sent
,
priv
->
tx_last_cleared
)
&&
time_after
(
jiffies
,
priv
->
tx_last_sent
*
5
*
HZ
)
){
arlan_command
(
dev
,
ARLAN_COMMAND_CLEAN_AND_RESET
);
priv
->
tx_last_cleared
=
jiffies
;
}
;
}
}
...
...
@@ -693,7 +617,6 @@ static void arlan_registration_timer(unsigned long data)
}
if
(
!
(
TXHEAD
(
dev
).
offset
&&
TXTAIL
(
dev
).
offset
))
{
priv
->
txOffset
=
0
;
netif_wake_queue
(
dev
);
}
priv
->
tx_done_delayed
=
0
;
...
...
@@ -701,7 +624,6 @@ static void arlan_registration_timer(unsigned long data)
}
if
(
bh_mark_needed
)
{
priv
->
txOffset
=
0
;
netif_wake_queue
(
dev
);
}
arlan_process_interrupt
(
dev
);
...
...
@@ -709,7 +631,6 @@ static void arlan_registration_timer(unsigned long data)
if
(
next_tick
<
priv
->
card_polling_interval
)
next_tick
=
priv
->
card_polling_interval
;
priv
->
timer_chain_active
=
0
;
priv
->
timer
.
expires
=
jiffies
+
next_tick
;
add_timer
(
&
priv
->
timer
);
...
...
@@ -720,7 +641,8 @@ static void arlan_registration_timer(unsigned long data)
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
,
txStatus
,
rxStatus
,
interruptInProgress
,
commandByte
;
...
...
@@ -749,7 +671,7 @@ static int arlan_hw_tx(struct net_device *dev, char *buf, int length)
{
int
i
;
struct
arlan_private
*
priv
=
(
struct
arlan_private
*
)
dev
->
priv
;
struct
arlan_private
*
priv
=
dev
->
priv
;
volatile
struct
arlan_shmem
*
arlan
=
priv
->
card
;
struct
arlan_conf_stru
*
conf
=
priv
->
Conf
;
...
...
@@ -807,13 +729,13 @@ static int arlan_hw_tx(struct net_device *dev, char *buf, int length)
priv
->
out_bytes10
+=
length
;
if
(
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
;
priv
->
out_bytes
=
0
;
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
);
priv
->
out_bytes10
=
0
;
...
...
@@ -838,9 +760,7 @@ static int arlan_hw_tx(struct net_device *dev, char *buf, int length)
arlan_command
(
dev
,
ARLAN_COMMAND_TX
);
priv
->
last_command_was_rx
=
0
;
priv
->
tx_last_sent
=
jiffies
;
priv
->
nof_tx
++
;
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)
static
int
arlan_hw_config
(
struct
net_device
*
dev
)
{
volatile
struct
arlan_shmem
*
arlan
=
((
struct
arlan_private
*
)
dev
->
priv
)
->
card
;
struct
arlan_conf_stru
*
conf
=
((
struct
arlan_private
*
)
dev
->
priv
)
->
Conf
;
struct
arlan_
private
*
priv
=
(
struct
arlan_private
*
)
dev
->
priv
;
struct
arlan_private
*
priv
=
dev
->
priv
;
volatile
struct
arlan_shmem
*
arlan
=
priv
->
card
;
struct
arlan_
conf_stru
*
conf
=
priv
->
Conf
;
ARLAN_DEBUG_ENTRY
(
"arlan_hw_config"
);
...
...
@@ -935,8 +855,9 @@ static int arlan_hw_config(struct net_device *dev)
static
int
arlan_read_card_configuration
(
struct
net_device
*
dev
)
{
u_char
tlx415
;
volatile
struct
arlan_shmem
*
arlan
=
((
struct
arlan_private
*
)
dev
->
priv
)
->
card
;
struct
arlan_conf_stru
*
conf
=
((
struct
arlan_private
*
)
dev
->
priv
)
->
Conf
;
struct
arlan_private
*
priv
=
dev
->
priv
;
volatile
struct
arlan_shmem
*
arlan
=
priv
->
card
;
struct
arlan_conf_stru
*
conf
=
priv
->
Conf
;
ARLAN_DEBUG_ENTRY
(
"arlan_read_card_configuration"
);
...
...
@@ -1036,7 +957,6 @@ static int arlan_read_card_configuration(struct net_device *dev)
conf
->
siteName
[
16
]
=
'\0'
;
conf
->
retries
=
retries
;
conf
->
tx_delay_ms
=
tx_delay_ms
;
conf
->
async
=
async
;
conf
->
ReTransmitPacketMaxSize
=
200
;
conf
->
waitReTransmitPacketMaxSize
=
200
;
conf
->
txAckTimeoutMs
=
900
;
...
...
@@ -1067,7 +987,7 @@ static int __init arlan_check_fingerprint(int memaddr)
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));
return
-
ENODEV
;
}
;
}
memcpy_fromio
(
tempBuf
,
arlan
->
textRegion
,
29
);
tempBuf
[
30
]
=
0
;
...
...
@@ -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
)
{
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"
);
if
(
new_mtu
>
2032
)
...
...
@@ -1217,13 +1138,13 @@ static int __init
dev
->
tx_timeout
=
arlan_tx_timeout
;
dev
->
watchdog_timeo
=
3
*
HZ
;
((
struct
arlan_private
*
)
dev
->
priv
)
->
irq_test_done
=
0
;
ap
->
irq_test_done
=
0
;
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
;
((
struct
arlan_private
*
)
dev
->
priv
)
->
Conf
->
rx_tweak1
=
30
;
((
struct
arlan_private
*
)
dev
->
priv
)
->
Conf
->
rx_tweak2
=
0
;
ap
->
Conf
->
pre_Command_Wait
=
40
;
ap
->
Conf
->
rx_tweak1
=
30
;
ap
->
Conf
->
rx_tweak2
=
0
;
ARLAN_DEBUG_EXIT
(
"arlan_allocate_device"
);
return
(
int
)
dev
;
...
...
@@ -1267,7 +1188,7 @@ static int __init arlan_probe_here(struct net_device *dev, int memaddr)
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
;
int
ret
=
0
;
...
...
@@ -1278,7 +1199,7 @@ static int arlan_open(struct net_device *dev)
if
(
ret
!=
0
)
return
ret
;
arlan
=
((
struct
arlan_private
*
)
dev
->
priv
)
->
card
;
arlan
=
priv
->
card
;
ret
=
request_irq
(
dev
->
irq
,
&
arlan_interrupt
,
0
,
dev
->
name
,
dev
);
if
(
ret
)
{
...
...
@@ -1291,18 +1212,14 @@ static int arlan_open(struct net_device *dev)
priv
->
bad
=
0
;
priv
->
lastReset
=
0
;
priv
->
reset
=
0
;
priv
->
open_time
=
jiffies
;
memcpy_fromio
(
dev
->
dev_addr
,
arlan
->
lanCardNodeId
,
6
);
memset
(
dev
->
broadcast
,
0xff
,
6
);
priv
->
txOffset
=
0
;
dev
->
tx_queue_len
=
tx_queue_len
;
priv
->
interrupt_processing_active
=
0
;
priv
->
command_lock
=
0
;
spin_lock_init
(
&
priv
->
lock
)
;
netif_start_queue
(
dev
);
init_MUTEX
(
&
priv
->
card_lock
);
myATOMIC_INIT
(
priv
->
card_users
,
1
);
/* damn 2.0.33 */
priv
->
registrationLostCount
=
0
;
priv
->
registrationLastSeen
=
jiffies
;
priv
->
txLast
=
0
;
...
...
@@ -1310,9 +1227,6 @@ static int arlan_open(struct net_device *dev)
priv
->
rx_command_given
=
0
;
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_cleared
=
jiffies
;
priv
->
Conf
->
writeEEPROM
=
0
;
...
...
@@ -1327,12 +1241,6 @@ static int arlan_open(struct net_device *dev)
mdelay
(
200
);
add_timer
(
&
priv
->
timer
);
#ifdef CONFIG_PROC_FS
#ifndef MODULE
if
(
arlan_device
[
0
])
init_arlan_proc
();
#endif
#endif
ARLAN_DEBUG_EXIT
(
"arlan_open"
);
return
0
;
}
...
...
@@ -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
)
{
struct
arlan_private
*
priv
=
((
struct
arlan_private
*
)
dev
->
priv
);
short
length
;
unsigned
char
*
buf
;
...
...
@@ -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
;
buf
=
skb
->
data
;
if
(
priv
->
txOffset
+
length
+
0x12
>
0x800
)
{
if
(
length
+
0x12
>
0x800
)
{
printk
(
KERN_ERR
"TX RING overflow
\n
"
);
netif_stop_queue
(
dev
);
}
...
...
@@ -1372,13 +1279,11 @@ static int arlan_tx(struct sk_buff *skb, struct net_device *dev)
dev_kfree_skb
(
skb
);
arlan_process_interrupt
(
dev
);
priv
->
tx_chain_active
=
0
;
ARLAN_DEBUG_EXIT
(
"arlan_tx"
);
return
0
;
bad_end:
arlan_process_interrupt
(
dev
);
priv
->
tx_chain_active
=
0
;
netif_stop_queue
(
dev
);
ARLAN_DEBUG_EXIT
(
"arlan_tx"
);
return
1
;
...
...
@@ -1387,7 +1292,7 @@ static int arlan_tx(struct sk_buff *skb, 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
)
return
1
;
...
...
@@ -1397,7 +1302,7 @@ static inline int DoNotReTransmitCrap(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
)
return
1
;
...
...
@@ -1406,7 +1311,7 @@ static inline int DoNotWaitReTransmitCrap(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"
);
...
...
@@ -1417,11 +1322,11 @@ static inline void arlan_queue_retransmit(struct net_device *dev)
priv
->
ReTransmitRequested
++
;
ARLAN_DEBUG_EXIT
(
"arlan_queue_retransmit"
);
}
;
}
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"
);
...
...
@@ -1442,13 +1347,12 @@ static inline void RetryOrFail(struct net_device *dev)
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"
);
priv
->
tx_last_cleared
=
jiffies
;
priv
->
tx_command_given
=
0
;
priv
->
nof_tx_ack
++
;
switch
(
status
)
{
case
1
:
...
...
@@ -1477,7 +1381,6 @@ static void arlan_tx_done_interrupt(struct net_device *dev, int status)
}
if
(
!
TXHEAD
(
dev
).
offset
||
!
TXTAIL
(
dev
).
offset
)
{
priv
->
txOffset
=
0
;
netif_wake_queue
(
dev
);
}
}
...
...
@@ -1586,7 +1489,7 @@ static void arlan_rx_interrupt(struct net_device *dev, u_char rxStatus, u_short
char
*
skbtmp
;
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
;
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
priv
->
in_bytes10
+=
pkt_len
;
if
(
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
;
priv
->
in_bytes
=
0
;
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
);
priv
->
in_bytes10
=
0
;
...
...
@@ -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
)
{
struct
arlan_private
*
priv
=
(
struct
arlan_private
*
)
dev
->
priv
;
struct
arlan_private
*
priv
=
dev
->
priv
;
volatile
struct
arlan_shmem
*
arlan
=
priv
->
card
;
u_char
rxStatus
=
READSHMB
(
arlan
->
rxStatus
);
u_char
txStatus
=
READSHMB
(
arlan
->
txStatus
);
...
...
@@ -1758,7 +1661,7 @@ static void arlan_process_interrupt(struct net_device *dev)
&&
(
interrupt_count
<
5
))
{
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_ENABLE
);
...
...
@@ -1770,7 +1673,6 @@ static void arlan_process_interrupt(struct net_device *dev)
if
(
rxStatus
==
0
&&
txStatus
==
0
)
{
priv
->
last_command_was_rx
=
0
;
if
(
priv
->
irq_test_done
)
{
if
(
!
registrationBad
(
dev
))
...
...
@@ -1797,7 +1699,6 @@ static void arlan_process_interrupt(struct net_device *dev)
}
if
(
rxStatus
>
2
&&
rxStatus
<
0xff
)
{
priv
->
last_command_was_rx
=
0
;
WRITESHMB
(
arlan
->
rxStatus
,
0x00
);
printk
(
KERN_ERR
"%s unknown rxStatus reason tx %d rx %d "
,
dev
->
name
,
txStatus
,
rxStatus
);
...
...
@@ -1805,7 +1706,6 @@ static void arlan_process_interrupt(struct net_device *dev)
}
if
(
rxStatus
==
0xff
)
{
priv
->
last_command_was_rx
=
0
;
WRITESHMB
(
arlan
->
rxStatus
,
0x00
);
arlan_command
(
dev
,
ARLAN_COMMAND_RX
);
if
(
registrationBad
(
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
)
{
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
;
u_char
rxStatus
=
READSHMB
(
arlan
->
rxStatus
);
u_char
txStatus
=
READSHMB
(
arlan
->
txStatus
);
...
...
@@ -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
)
{
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
)
{
printk
(
KERN_CRIT
"arlan: No Device priv
\n
"
);
...
...
@@ -1889,7 +1783,6 @@ static int arlan_close(struct net_device *dev)
IFDEBUG
(
ARLAN_DEBUG_STARTUP
)
printk
(
KERN_NOTICE
"%s: Closing device
\n
"
,
dev
->
name
);
priv
->
open_time
=
0
;
netif_stop_queue
(
dev
);
free_irq
(
dev
->
irq
,
dev
);
...
...
@@ -1913,8 +1806,8 @@ static long alignLong(volatile u_char * ptr)
static
struct
net_device_stats
*
arlan_statistics
(
struct
net_device
*
dev
)
{
struct
arlan_private
*
priv
=
(
struct
arlan_private
*
)
dev
->
priv
;
volatile
struct
arlan_shmem
*
arlan
=
((
struct
arlan_private
*
)
dev
->
priv
)
->
card
;
struct
arlan_private
*
priv
=
dev
->
priv
;
volatile
struct
arlan_shmem
*
arlan
=
priv
->
card
;
ARLAN_DEBUG_ENTRY
(
"arlan_statistics"
);
...
...
@@ -1943,8 +1836,9 @@ static struct net_device_stats *arlan_statistics(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_conf_stru
*
conf
=
((
struct
arlan_private
*
)
dev
->
priv
)
->
Conf
;
struct
arlan_private
*
priv
=
dev
->
priv
;
volatile
struct
arlan_shmem
*
arlan
=
priv
->
card
;
struct
arlan_conf_stru
*
conf
=
priv
->
Conf
;
int
board_conf_needed
=
0
;
...
...
@@ -1982,9 +1876,6 @@ int __init arlan_probe(struct net_device *dev)
return
-
ENODEV
;
arlans_found
++
;
if
(
arlans_found
==
1
)
siteName
=
kmalloc
(
100
,
GFP_KERNEL
);
return
0
;
}
...
...
@@ -2021,10 +1912,6 @@ int init_module(void)
if
(
numDevices
==
0
)
return
-
ENODEV
;
siteName
=
kmalloc
(
100
,
GFP_KERNEL
);
if
(
siteName
==
NULL
)
return
-
ENOMEM
;
for
(
i
=
0
;
i
<
numDevices
&&
i
<
MAX_ARLANS
;
i
++
)
{
if
(
!
arlan_allocate_device
(
i
,
NULL
))
...
...
@@ -2037,6 +1924,7 @@ int init_module(void)
arlan_probe_everywhere
(
arlan_device
[
i
]);
// arlan_command(arlan_device[i], ARLAN_COMMAND_POWERDOWN );
}
init_arlan_proc
();
printk
(
KERN_INFO
"Arlan driver %s
\n
"
,
arlan_version
);
ARLAN_DEBUG_EXIT
(
"init_module"
);
return
0
;
...
...
@@ -2052,6 +1940,9 @@ void cleanup_module(void)
IFDEBUG
(
ARLAN_DEBUG_SHUTDOWN
)
printk
(
KERN_INFO
"arlan: unloading module
\n
"
);
cleanup_arlan_proc
();
for
(
i
=
0
;
i
<
MAX_ARLANS
;
i
++
)
{
if
(
arlan_device
[
i
])
...
...
drivers/net/wireless/arlan-proc.c
View file @
662c8869
...
...
@@ -108,7 +108,7 @@ static const char *arlan_diagnostic_info_string(struct net_device *dev)
default:
return
"ERROR unknown Diagnostic info reply code "
;
}
}
;
}
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,
CTBLN(32,cardNo,lParameter),\
CTBLN(33,cardNo,_15),\
CTBLN(34,cardNo,headerSize),\
CTBLN(35,cardNo,async),\
CTBLN(36,cardNo,tx_delay_ms),\
CTBLN(37,cardNo,retries),\
CTBLN(38,cardNo,ReTransmitPacketMaxSize),\
...
...
@@ -1233,7 +1232,7 @@ static ctl_table arlan_root_table[] =
static
struct
ctl_table_header
*
arlan_device_sysctl_header
;
int
init_arlan_proc
(
void
)
int
__init
init_arlan_proc
(
void
)
{
int
i
=
0
;
...
...
@@ -1247,25 +1246,11 @@ int init_arlan_proc(void)
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
);
arlan_device_sysctl_header
=
NULL
;
return
;
};
#endif // MODULE
MODULE_LICENSE
(
"GPL"
);
}
drivers/net/wireless/arlan.h
View file @
662c8869
...
...
@@ -39,14 +39,16 @@
#define ARLAN_RCV_PROMISC 1
#define ARLAN_RCV_CONTROL 2
#ifdef CONFIG_PROC_FS
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
extern
struct
net_device
*
arlan_device
[
MAX_ARLANS
];
extern
int
arlan_debug
;
extern
char
*
siteName
;
extern
int
arlan_entry_debug
;
extern
int
arlan_exit_debug
;
extern
int
testMemory
;
...
...
@@ -67,8 +69,6 @@ extern int arlan_command(struct net_device * dev, int command);
#define channelSetUNKNOWN 0
#define systemIdUNKNOWN -1
#define registrationModeUNKNOWN -1
#define siteNameUNKNOWN "LinuxSite"
#define IFDEBUG( L ) if ( (L) & arlan_debug )
...
...
@@ -293,7 +293,6 @@ struct arlan_conf_stru {
int
lParameter
;
int
_15
;
int
headerSize
;
int
async
;
int
retries
;
int
tx_delay_ms
;
int
waitReTransmitPacketMaxSize
;
...
...
@@ -332,83 +331,56 @@ struct TxParam
volatile
unsigned
char
scrambled
;
};
struct
TxRingPoint
{
struct
TxParam
txParam
;
};
#define TX_RING_SIZE 2
/* Information that need to be kept for each board. */
struct
arlan_private
{
struct
net_device_stats
stats
;
long
open_time
;
/* Useless example local info. */
struct
arlan_shmem
*
card
;
struct
arlan_shmem
*
conf
;
struct
TxParam
txParam
;
int
multicastLength
;
char
multicastList
[
ARLAN_MAX_MULTICAST_ADDRS
][
6
];
int
promiscModeEnabled
;
struct
arlan_conf_stru
*
Conf
;
int
bad
;
int
reset
;
long
long
lastReset
;
unsigned
long
lastReset
;
struct
timer_list
timer
;
struct
timer_list
tx_delay_timer
;
struct
timer_list
tx_retry_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
reRegisterExp
;
int
nof_tx
;
int
nof_tx_ack
;
int
last_nof_tx
;
int
last_nof_tx_ack
;
int
irq_test_done
;
int
last_command_was_rx
;
struct
TxParam
txRing
[
TX_RING_SIZE
];
char
reTransmitBuff
[
0x800
];
volatile
int
txLast
;
volatile
int
txNew
;
volatile
int
txOffset
;
volatile
char
ReTransmitRequested
;
volatile
unsigned
long
tx_done_delayed
;
volatile
long
long
registrationLastSeen
;
volatile
char
under_command
;
volatile
char
under_toggle
;
volatile
long
long
tx_last_sent
;
volatile
long
long
tx_last_cleared
;
volatile
u_char
under_tx
;
volatile
int
retransmissions
;
volatile
int
tx_chain_active
;
volatile
int
timer_chain_active
;
volatile
int
interrupt_ack_requested
;
volatile
long
command_lock
;
volatile
int
rx_command_needed
;
volatile
int
tx_command_needed
;
volatile
int
waiting_command_mask
;
volatile
int
card_polling_interval
;
volatile
int
last_command_buff_free_time
;
volatile
int
numResets
;
volatile
int
under_reset
;
volatile
int
under_config
;
volatile
int
rx_command_given
;
volatile
long
tx_command_given
;
volatile
long
interrupt_processing_active
;
volatile
long
long
last_tx_time
;
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
txLast
;
unsigned
ReTransmitRequested
;
unsigned
long
tx_done_delayed
;
unsigned
long
registrationLastSeen
;
unsigned
long
tx_last_sent
;
unsigned
long
tx_last_cleared
;
unsigned
long
retransmissions
;
unsigned
long
interrupt_ack_requested
;
spinlock_t
lock
;
unsigned
long
waiting_command_mask
;
unsigned
long
card_polling_interval
;
unsigned
long
last_command_buff_free_time
;
int
under_reset
;
int
under_config
;
int
rx_command_given
;
int
tx_command_given
;
unsigned
long
interrupt_processing_active
;
unsigned
long
last_rx_int_ack_time
;
unsigned
long
in_bytes
;
unsigned
long
out_bytes
;
unsigned
long
in_time
;
unsigned
long
out_time
;
unsigned
long
in_time10
;
unsigned
long
out_time10
;
unsigned
long
in_bytes10
;
unsigned
long
out_bytes10
;
int
init_etherdev_alloc
;
};
...
...
@@ -497,13 +469,11 @@ struct arlan_private {
#define arlan_interrupt_lancpu(dev) {\
int cr; \
\
priv->under_toggle++; \
cr = readControlRegister(dev);\
if (cr & ARLAN_CHANNEL_ATTENTION){ \
writeControlRegister(dev, (cr & ~ARLAN_CHANNEL_ATTENTION));\
}else \
writeControlRegister(dev, (cr | ARLAN_CHANNEL_ATTENTION));\
priv->under_toggle=0; \
}
#define clearChannelAttention(dev){ \
...
...
drivers/net/wireless/atmel.c
View file @
662c8869
...
...
@@ -521,7 +521,6 @@ struct atmel_private {
int
operating_mode
,
power_mode
;
time_t
last_qual
;
int
beacons_this_sec
;
u64
last_beacon_timestamp
;
int
channel
;
int
reg_domain
;
int
tx_rate
;
...
...
@@ -559,6 +558,7 @@ struct atmel_private {
int
SSID_size
,
new_SSID_size
;
u8
CurrentBSSID
[
6
],
BSSID
[
6
];
u8
SSID
[
MAX_SSID_LENGTH
],
new_SSID
[
MAX_SSID_LENGTH
];
u64
last_beacon_timestamp
;
u8
rx_buf
[
MAX_WIRELESS_BODY
];
};
...
...
drivers/net/wireless/atmel_cs.c
View file @
662c8869
...
...
@@ -341,7 +341,9 @@ static struct {
{
0
,
0
,
"SMC/2632W"
,
"atmel_at76c502d.bin"
,
"SMC 2632W-V3"
},
{
0xd601
,
0x0007
,
NULL
,
"atmel_at76c502.bin"
,
"Sitecom WLAN-011"
},
/* suspect - from a usenet posting. */
{
0x01bf
,
0x3302
,
NULL
,
"atmel_at76c502d.bin"
,
"Belkin F5D6060u"
},
/* " " " " " */
{
0
,
0
,
"BT/Voyager 1020 Laptop Adapter"
,
"atmel_at76c502.bin"
,
"BT Voyager 1020"
}
{
0
,
0
,
"BT/Voyager 1020 Laptop Adapter"
,
"atmel_at76c502.bin"
,
"BT Voyager 1020"
},
{
0
,
0
,
"IEEE 802.11b/Wireless LAN PC Card"
,
"atmel_at76c502.bin"
,
"Siemens Gigaset PC Card II"
},
{
0
,
0
,
"CNet/CNWLC 11Mbps Wireless PC Card V-5"
,
"atmel_at76c502e.bin"
,
"CNet CNWLC-811ARL"
}
};
/* This is strictly temporary, until PCMCIA devices get integrated into the device model. */
...
...
include/linux/hdlcdrv.h
View file @
662c8869
...
...
@@ -180,6 +180,7 @@ struct hdlcdrv_ops {
struct
hdlcdrv_state
{
int
magic
;
int
opened
;
const
struct
hdlcdrv_ops
*
ops
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment