Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
38778204
cloud-kernel
项目概览
openanolis
/
cloud-kernel
大约 1 年 前同步成功
通知
155
Star
36
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
38778204
编写于
5月 25, 2005
作者:
提交者:
Jeff Garzik
5月 25, 2005
浏览文件
操作
浏览文件
下载
差异文件
Automatic merge of /spare/repo/netdev-2.6 branch sis900
上级
8cf0d9d0
6da0f685
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
50 addition
and
3 deletion
+50
-3
drivers/net/Kconfig
drivers/net/Kconfig
+1
-0
drivers/net/sis900.c
drivers/net/sis900.c
+49
-3
未找到文件。
drivers/net/Kconfig
浏览文件 @
38778204
...
...
@@ -1555,6 +1555,7 @@ config SIS900
tristate "SiS 900/7016 PCI Fast Ethernet Adapter support"
depends on NET_PCI && PCI
select CRC32
select MII
---help---
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
...
...
drivers/net/sis900.c
浏览文件 @
38778204
...
...
@@ -162,6 +162,7 @@ struct sis900_private {
struct
mii_phy
*
mii
;
struct
mii_phy
*
first_mii
;
/* record the first mii structure */
unsigned
int
cur_phy
;
struct
mii_if_info
mii_info
;
struct
timer_list
timer
;
/* Link status detection timer. */
u8
autong_complete
;
/* 1: auto-negotiate complete */
...
...
@@ -203,7 +204,7 @@ static int sis900_open(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
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
sis900_timer
(
unsigned
long
data
);
static
void
sis900_check_mode
(
struct
net_device
*
net_dev
,
struct
mii_phy
*
mii_phy
);
...
...
@@ -478,7 +479,13 @@ static int __devinit sis900_probe(struct pci_dev *pci_dev,
sis_priv
->
msg_enable
=
sis900_debug
;
else
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 */
pci_read_config_byte
(
pci_dev
,
PCI_CLASS_REVISION
,
&
(
sis_priv
->
chipset_rev
));
if
(
netif_msg_probe
(
sis_priv
))
...
...
@@ -725,6 +732,8 @@ static u16 sis900_default_phy(struct net_device * net_dev)
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
&=
(
~
MII_CNTL_ISOLATE
);
...
...
@@ -852,7 +861,7 @@ static void mdio_reset(long mdio_addr)
* 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
;
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)
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
=
{
.
get_drvinfo
=
sis900_get_drvinfo
,
.
get_msglevel
=
sis900_get_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
,
};
/**
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录