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
Kirill Smelkov
linux
Commits
bb3ab01c
Commit
bb3ab01c
authored
Apr 30, 2002
by
Mufasa Yang
Committed by
Jeff Garzik
Apr 30, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add support for SiS962 phy to sis900 net driver.
Also introduce new maintainer.
parent
46001b90
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
8 deletions
+50
-8
drivers/net/sis900.c
drivers/net/sis900.c
+44
-7
drivers/net/sis900.h
drivers/net/sis900.h
+6
-1
No files found.
drivers/net/sis900.c
View file @
bb3ab01c
/* sis900.c: A SiS 900/7016 PCI Fast Ethernet driver for Linux.
Copyright 1999 Silicon Integrated System Corporation
Revision: 1.08.0
2 Jan. 4
2002
Revision: 1.08.0
4 Apr. 25
2002
Modified from the driver which is originally written by Donald Becker.
...
...
@@ -18,8 +18,9 @@
preliminary Rev. 1.0 Jan. 18, 1998
http://www.sis.com.tw/support/databook.htm
Rev 1.08.04 Apr. 25 2002 Mufasa Yang <mufasa@sis.com.tw> added SiS962 support
Rev 1.08.03 Feb. 1 2002 Matt Domsch <Matt_Domsch@dell.com> update to use library crc32 function
Rev 1.08.02 Nov. 30 2001 Hui-Fen Hsu workaround for EDB & bug fix for dhcp problem
Jan. 4 2002 Matt Domsch <Matt_Domsch@dell.com> update to use library crc32 function
Rev 1.08.01 Aug. 25 2001 Hui-Fen Hsu update for 630ET & workaround for ICS1893 PHY
Rev 1.08.00 Jun. 11 2001 Hui-Fen Hsu workaround for RTL8201 PHY and some bug fix
Rev 1.07.11 Apr. 2 2001 Hui-Fen Hsu updates PCI drivers to use the new pci_set_dma_mask for kernel 2.4.3
...
...
@@ -60,8 +61,8 @@
#include <linux/etherdevice.h>
#include <linux/skbuff.h>
#include <linux/delay.h>
#include <linux/crc32.h>
#include <linux/ethtool.h>
#include <linux/crc32.h>
#include <asm/processor.h>
/* Processor type for cache alignment. */
#include <asm/bitops.h>
...
...
@@ -71,7 +72,7 @@
#include "sis900.h"
#define SIS900_MODULE_NAME "sis900"
#define SIS900_DRV_VERSION "v1.08.0
2 1/4
/2002"
#define SIS900_DRV_VERSION "v1.08.0
4 4/25
/2002"
static
char
version
[]
__devinitdata
=
KERN_INFO
"sis900.c: "
SIS900_DRV_VERSION
"
\n
"
;
...
...
@@ -307,6 +308,40 @@ static int __devinit sis635_get_mac_addr(struct pci_dev * pci_dev, struct net_de
return
1
;
}
/**
* sis962_get_mac_addr: - Get MAC address for SiS962 model
* @pci_dev: the sis900 pci device
* @net_dev: the net device to get address for
*
* SiS962 model, use EEPROM to store MAC address. And EEPROM is shared by
* LAN and 1394. When access EEPROM, send EEREQ signal to hardware first
* and wait for EEGNT. If EEGNT is ON, EEPROM is permitted to be access
* by LAN, otherwise is not. After MAC address is read from EEPROM, send
* EEDONE signal to refuse EEPROM access by LAN.
* MAC address is read into @net_dev->dev_addr.
*/
static
int
__devinit
sis962_get_mac_addr
(
struct
pci_dev
*
pci_dev
,
struct
net_device
*
net_dev
)
{
long
ioaddr
=
net_dev
->
base_addr
;
long
ee_addr
=
ioaddr
+
mear
;
u32
waittime
=
0
;
int
ret
=
0
;
outl
(
EEREQ
,
ee_addr
);
while
(
waittime
<
2000
)
{
if
(
inl
(
ee_addr
)
&
EEGNT
)
{
ret
=
sis900_get_mac_addr
(
pci_dev
,
net_dev
);
outl
(
EEDONE
,
ee_addr
);
return
(
ret
);
}
else
{
udelay
(
1
);
waittime
++
;
}
}
outl
(
EEDONE
,
ee_addr
);
return
0
;
}
/**
* sis900_probe: - Probe for sis900 device
...
...
@@ -408,6 +443,8 @@ static int __devinit sis900_probe (struct pci_dev *pci_dev, const struct pci_dev
ret
=
sis630e_get_mac_addr
(
pci_dev
,
net_dev
);
else
if
((
revision
>
0x81
)
&&
(
revision
<=
0x90
)
)
ret
=
sis635_get_mac_addr
(
pci_dev
,
net_dev
);
else
if
(
revision
==
SIS962_900_REV
)
ret
=
sis962_get_mac_addr
(
pci_dev
,
net_dev
);
else
ret
=
sis900_get_mac_addr
(
pci_dev
,
net_dev
);
...
...
@@ -1983,7 +2020,7 @@ static u16 sis900_compute_hashtable_index(u8 *addr, u8 revision)
u32
crc
=
ether_crc
(
6
,
addr
);
/* leave 8 or 7 most siginifant bits */
if
((
revision
=
=
SIS635A_900_REV
)
||
(
revision
==
SIS900B_900_REV
))
if
((
revision
>
=
SIS635A_900_REV
)
||
(
revision
==
SIS900B_900_REV
))
return
((
int
)(
crc
>>
24
));
else
return
((
int
)(
crc
>>
25
));
...
...
@@ -2009,7 +2046,7 @@ static void set_rx_mode(struct net_device *net_dev)
/* 635 Hash Table entires = 256(2^16) */
pci_read_config_byte
(
sis_priv
->
pci_dev
,
PCI_CLASS_REVISION
,
&
revision
);
if
((
revision
=
=
SIS635A_900_REV
)
||
(
revision
==
SIS900B_900_REV
))
if
((
revision
>
=
SIS635A_900_REV
)
||
(
revision
==
SIS900B_900_REV
))
table_entries
=
16
;
else
table_entries
=
8
;
...
...
@@ -2090,7 +2127,7 @@ static void sis900_reset(struct net_device *net_dev)
}
pci_read_config_byte
(
sis_priv
->
pci_dev
,
PCI_CLASS_REVISION
,
&
revision
);
if
(
(
revision
=
=
SIS635A_900_REV
)
||
(
revision
==
SIS900B_900_REV
)
)
if
(
(
revision
>
=
SIS635A_900_REV
)
||
(
revision
==
SIS900B_900_REV
)
)
outl
(
PESEL
|
RND_CNT
,
ioaddr
+
cfg
);
else
outl
(
PESEL
,
ioaddr
+
cfg
);
...
...
drivers/net/sis900.h
View file @
bb3ab01c
...
...
@@ -135,6 +135,11 @@ enum sis900_eeprom_command {
EEaddrMask
=
0x013F
,
EEcmdShift
=
16
};
/* For SiS962, request the eeprom software access */
enum
sis962_eeprom_command
{
EEREQ
=
0x00000400
,
EEDONE
=
0x00000200
,
EEGNT
=
0x00000100
};
/* Manamgement Data I/O (mdio) frame */
#define MIIread 0x6000
#define MIIwrite 0x5002
...
...
@@ -240,7 +245,7 @@ enum sis900_revision_id {
SIS630A_900_REV
=
0x80
,
SIS630E_900_REV
=
0x81
,
SIS630S_900_REV
=
0x82
,
SIS630EA1_900_REV
=
0x83
,
SIS630ET_900_REV
=
0x84
,
SIS635A_900_REV
=
0x90
,
SIS900B_900_REV
=
0x03
SIS9
62_900_REV
=
0X91
,
SIS9
00B_900_REV
=
0x03
};
enum
sis630_revision_id
{
...
...
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