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
38778204
Commit
38778204
authored
May 25, 2005
by
Committed by
Jeff Garzik
May 25, 2005
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of /spare/repo/netdev-2.6 branch sis900
parents
8cf0d9d0
6da0f685
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
3 deletions
+50
-3
drivers/net/Kconfig
drivers/net/Kconfig
+1
-0
drivers/net/sis900.c
drivers/net/sis900.c
+49
-3
No files found.
drivers/net/Kconfig
View file @
38778204
...
@@ -1555,6 +1555,7 @@ config SIS900
...
@@ -1555,6 +1555,7 @@ config SIS900
tristate "SiS 900/7016 PCI Fast Ethernet Adapter support"
tristate "SiS 900/7016 PCI Fast Ethernet Adapter support"
depends on NET_PCI && PCI
depends on NET_PCI && PCI
select CRC32
select CRC32
select MII
---help---
---help---
This is a driver for the Fast Ethernet PCI network cards based on
This is a driver for the Fast Ethernet PCI network cards based on
the SiS 900 and SiS 7016 chips. The SiS 900 core is also embedded in
the SiS 900 and SiS 7016 chips. The SiS 900 core is also embedded in
...
...
drivers/net/sis900.c
View file @
38778204
...
@@ -162,6 +162,7 @@ struct sis900_private {
...
@@ -162,6 +162,7 @@ struct sis900_private {
struct
mii_phy
*
mii
;
struct
mii_phy
*
mii
;
struct
mii_phy
*
first_mii
;
/* record the first mii structure */
struct
mii_phy
*
first_mii
;
/* record the first mii structure */
unsigned
int
cur_phy
;
unsigned
int
cur_phy
;
struct
mii_if_info
mii_info
;
struct
timer_list
timer
;
/* Link status detection timer. */
struct
timer_list
timer
;
/* Link status detection timer. */
u8
autong_complete
;
/* 1: auto-negotiate complete */
u8
autong_complete
;
/* 1: auto-negotiate complete */
...
@@ -203,7 +204,7 @@ static int sis900_open(struct net_device *net_dev);
...
@@ -203,7 +204,7 @@ static int sis900_open(struct net_device *net_dev);
static
int
sis900_mii_probe
(
struct
net_device
*
net_dev
);
static
int
sis900_mii_probe
(
struct
net_device
*
net_dev
);
static
void
sis900_init_rxfilter
(
struct
net_device
*
net_dev
);
static
void
sis900_init_rxfilter
(
struct
net_device
*
net_dev
);
static
u16
read_eeprom
(
long
ioaddr
,
int
location
);
static
u16
read_eeprom
(
long
ioaddr
,
int
location
);
static
u16
mdio_read
(
struct
net_device
*
net_dev
,
int
phy_id
,
int
location
);
static
int
mdio_read
(
struct
net_device
*
net_dev
,
int
phy_id
,
int
location
);
static
void
mdio_write
(
struct
net_device
*
net_dev
,
int
phy_id
,
int
location
,
int
val
);
static
void
mdio_write
(
struct
net_device
*
net_dev
,
int
phy_id
,
int
location
,
int
val
);
static
void
sis900_timer
(
unsigned
long
data
);
static
void
sis900_timer
(
unsigned
long
data
);
static
void
sis900_check_mode
(
struct
net_device
*
net_dev
,
struct
mii_phy
*
mii_phy
);
static
void
sis900_check_mode
(
struct
net_device
*
net_dev
,
struct
mii_phy
*
mii_phy
);
...
@@ -479,6 +480,12 @@ static int __devinit sis900_probe(struct pci_dev *pci_dev,
...
@@ -479,6 +480,12 @@ static int __devinit sis900_probe(struct pci_dev *pci_dev,
else
else
sis_priv
->
msg_enable
=
SIS900_DEF_MSG
;
sis_priv
->
msg_enable
=
SIS900_DEF_MSG
;
sis_priv
->
mii_info
.
dev
=
net_dev
;
sis_priv
->
mii_info
.
mdio_read
=
mdio_read
;
sis_priv
->
mii_info
.
mdio_write
=
mdio_write
;
sis_priv
->
mii_info
.
phy_id_mask
=
0x1f
;
sis_priv
->
mii_info
.
reg_num_mask
=
0x1f
;
/* Get Mac address according to the chip revision */
/* Get Mac address according to the chip revision */
pci_read_config_byte
(
pci_dev
,
PCI_CLASS_REVISION
,
&
(
sis_priv
->
chipset_rev
));
pci_read_config_byte
(
pci_dev
,
PCI_CLASS_REVISION
,
&
(
sis_priv
->
chipset_rev
));
if
(
netif_msg_probe
(
sis_priv
))
if
(
netif_msg_probe
(
sis_priv
))
...
@@ -725,6 +732,8 @@ static u16 sis900_default_phy(struct net_device * net_dev)
...
@@ -725,6 +732,8 @@ static u16 sis900_default_phy(struct net_device * net_dev)
pci_name
(
sis_priv
->
pci_dev
),
sis_priv
->
cur_phy
);
pci_name
(
sis_priv
->
pci_dev
),
sis_priv
->
cur_phy
);
}
}
sis_priv
->
mii_info
.
phy_id
=
sis_priv
->
cur_phy
;
status
=
mdio_read
(
net_dev
,
sis_priv
->
cur_phy
,
MII_CONTROL
);
status
=
mdio_read
(
net_dev
,
sis_priv
->
cur_phy
,
MII_CONTROL
);
status
&=
(
~
MII_CNTL_ISOLATE
);
status
&=
(
~
MII_CNTL_ISOLATE
);
...
@@ -852,7 +861,7 @@ static void mdio_reset(long mdio_addr)
...
@@ -852,7 +861,7 @@ static void mdio_reset(long mdio_addr)
* Please see SiS7014 or ICS spec
* Please see SiS7014 or ICS spec
*/
*/
static
u16
mdio_read
(
struct
net_device
*
net_dev
,
int
phy_id
,
int
location
)
static
int
mdio_read
(
struct
net_device
*
net_dev
,
int
phy_id
,
int
location
)
{
{
long
mdio_addr
=
net_dev
->
base_addr
+
mear
;
long
mdio_addr
=
net_dev
->
base_addr
+
mear
;
int
mii_cmd
=
MIIread
|
(
phy_id
<<
MIIpmdShift
)
|
(
location
<<
MIIregShift
);
int
mii_cmd
=
MIIread
|
(
phy_id
<<
MIIpmdShift
)
|
(
location
<<
MIIregShift
);
...
@@ -1966,10 +1975,47 @@ static void sis900_set_msglevel(struct net_device *net_dev, u32 value)
...
@@ -1966,10 +1975,47 @@ static void sis900_set_msglevel(struct net_device *net_dev, u32 value)
sis_priv
->
msg_enable
=
value
;
sis_priv
->
msg_enable
=
value
;
}
}
static
u32
sis900_get_link
(
struct
net_device
*
net_dev
)
{
struct
sis900_private
*
sis_priv
=
net_dev
->
priv
;
return
mii_link_ok
(
&
sis_priv
->
mii_info
);
}
static
int
sis900_get_settings
(
struct
net_device
*
net_dev
,
struct
ethtool_cmd
*
cmd
)
{
struct
sis900_private
*
sis_priv
=
net_dev
->
priv
;
spin_lock_irq
(
&
sis_priv
->
lock
);
mii_ethtool_gset
(
&
sis_priv
->
mii_info
,
cmd
);
spin_unlock_irq
(
&
sis_priv
->
lock
);
return
0
;
}
static
int
sis900_set_settings
(
struct
net_device
*
net_dev
,
struct
ethtool_cmd
*
cmd
)
{
struct
sis900_private
*
sis_priv
=
net_dev
->
priv
;
int
rt
;
spin_lock_irq
(
&
sis_priv
->
lock
);
rt
=
mii_ethtool_sset
(
&
sis_priv
->
mii_info
,
cmd
);
spin_unlock_irq
(
&
sis_priv
->
lock
);
return
rt
;
}
static
int
sis900_nway_reset
(
struct
net_device
*
net_dev
)
{
struct
sis900_private
*
sis_priv
=
net_dev
->
priv
;
return
mii_nway_restart
(
&
sis_priv
->
mii_info
);
}
static
struct
ethtool_ops
sis900_ethtool_ops
=
{
static
struct
ethtool_ops
sis900_ethtool_ops
=
{
.
get_drvinfo
=
sis900_get_drvinfo
,
.
get_drvinfo
=
sis900_get_drvinfo
,
.
get_msglevel
=
sis900_get_msglevel
,
.
get_msglevel
=
sis900_get_msglevel
,
.
set_msglevel
=
sis900_set_msglevel
,
.
set_msglevel
=
sis900_set_msglevel
,
.
get_link
=
sis900_get_link
,
.
get_settings
=
sis900_get_settings
,
.
set_settings
=
sis900_set_settings
,
.
nway_reset
=
sis900_nway_reset
,
};
};
/**
/**
...
...
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