Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
gsplhtlxg
clone-Linux
提交
5fdf193b
C
clone-Linux
项目概览
gsplhtlxg
/
clone-Linux
通知
2
Star
0
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
clone-Linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
5fdf193b
编写于
8月 18, 2005
作者:
L
Linus Torvalds
浏览文件
操作
浏览文件
下载
差异文件
Merge head 'upstream-fixes' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6
上级
f3ed8b44
2ae2d77c
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
37 addition
and
30 deletion
+37
-30
drivers/net/8139cp.c
drivers/net/8139cp.c
+7
-0
drivers/net/dm9000.c
drivers/net/dm9000.c
+26
-26
drivers/net/ioc3-eth.c
drivers/net/ioc3-eth.c
+4
-4
未找到文件。
drivers/net/8139cp.c
浏览文件 @
5fdf193b
...
...
@@ -1897,6 +1897,7 @@ static int cp_resume (struct pci_dev *pdev)
{
struct
net_device
*
dev
;
struct
cp_private
*
cp
;
unsigned
long
flags
;
dev
=
pci_get_drvdata
(
pdev
);
cp
=
netdev_priv
(
dev
);
...
...
@@ -1910,6 +1911,12 @@ static int cp_resume (struct pci_dev *pdev)
cp_init_hw
(
cp
);
netif_start_queue
(
dev
);
spin_lock_irqsave
(
&
cp
->
lock
,
flags
);
mii_check_media
(
&
cp
->
mii_if
,
netif_msg_link
(
cp
),
FALSE
);
spin_unlock_irqrestore
(
&
cp
->
lock
,
flags
);
return
0
;
}
...
...
drivers/net/dm9000.c
浏览文件 @
5fdf193b
...
...
@@ -48,6 +48,10 @@
* net_device_stats
* * introduced tx_timeout function
* * reworked locking
*
* 01-Jul-2005 Ben Dooks <ben@simtec.co.uk>
* * fixed spinlock call without pointer
* * ensure spinlock is initialised
*/
#include <linux/module.h>
...
...
@@ -148,7 +152,6 @@ static int dm9000_probe(struct device *);
static
int
dm9000_open
(
struct
net_device
*
);
static
int
dm9000_start_xmit
(
struct
sk_buff
*
,
struct
net_device
*
);
static
int
dm9000_stop
(
struct
net_device
*
);
static
int
dm9000_do_ioctl
(
struct
net_device
*
,
struct
ifreq
*
,
int
);
static
void
dm9000_timer
(
unsigned
long
);
...
...
@@ -322,7 +325,7 @@ static void dm9000_timeout(struct net_device *dev)
/* Save previous register address */
reg_save
=
readb
(
db
->
io_addr
);
spin_lock_irqsave
(
db
->
lock
,
flags
);
spin_lock_irqsave
(
&
db
->
lock
,
flags
);
netif_stop_queue
(
dev
);
dm9000_reset
(
db
);
...
...
@@ -333,7 +336,7 @@ static void dm9000_timeout(struct net_device *dev)
/* Restore previous register address */
writeb
(
reg_save
,
db
->
io_addr
);
spin_unlock_irqrestore
(
db
->
lock
,
flags
);
spin_unlock_irqrestore
(
&
db
->
lock
,
flags
);
}
...
...
@@ -387,8 +390,6 @@ dm9000_probe(struct device *dev)
int
i
;
u32
id_val
;
printk
(
KERN_INFO
"%s Ethernet Driver
\n
"
,
CARDNAME
);
/* Init network device */
ndev
=
alloc_etherdev
(
sizeof
(
struct
board_info
));
if
(
!
ndev
)
{
...
...
@@ -405,6 +406,8 @@ dm9000_probe(struct device *dev)
db
=
(
struct
board_info
*
)
ndev
->
priv
;
memset
(
db
,
0
,
sizeof
(
*
db
));
spin_lock_init
(
&
db
->
lock
);
if
(
pdev
->
num_resources
<
2
)
{
ret
=
-
ENODEV
;
goto
out
;
...
...
@@ -541,7 +544,6 @@ dm9000_probe(struct device *dev)
ndev
->
stop
=
&
dm9000_stop
;
ndev
->
get_stats
=
&
dm9000_get_stats
;
ndev
->
set_multicast_list
=
&
dm9000_hash_table
;
ndev
->
do_ioctl
=
&
dm9000_do_ioctl
;
#ifdef DM9000_PROGRAM_EEPROM
program_eeprom
(
db
);
...
...
@@ -612,7 +614,7 @@ dm9000_open(struct net_device *dev)
/* set and active a timer process */
init_timer
(
&
db
->
timer
);
db
->
timer
.
expires
=
DM9000_TIMER_WUT
*
2
;
db
->
timer
.
expires
=
DM9000_TIMER_WUT
;
db
->
timer
.
data
=
(
unsigned
long
)
dev
;
db
->
timer
.
function
=
&
dm9000_timer
;
add_timer
(
&
db
->
timer
);
...
...
@@ -845,15 +847,6 @@ dm9000_get_stats(struct net_device *dev)
return
&
db
->
stats
;
}
/*
* Process the upper socket ioctl command
*/
static
int
dm9000_do_ioctl
(
struct
net_device
*
dev
,
struct
ifreq
*
ifr
,
int
cmd
)
{
PRINTK1
(
"entering %s
\n
"
,
__FUNCTION__
);
return
0
;
}
/*
* A periodic timer routine
...
...
@@ -864,21 +857,11 @@ dm9000_timer(unsigned long data)
{
struct
net_device
*
dev
=
(
struct
net_device
*
)
data
;
board_info_t
*
db
=
(
board_info_t
*
)
dev
->
priv
;
u8
reg_save
;
unsigned
long
flags
;
PRINTK3
(
"dm9000_timer()
\n
"
);
spin_lock_irqsave
(
db
->
lock
,
flags
);
/* Save previous register address */
reg_save
=
readb
(
db
->
io_addr
);
mii_check_media
(
&
db
->
mii
,
netif_msg_link
(
db
),
0
);
/* Restore previous register address */
writeb
(
reg_save
,
db
->
io_addr
);
spin_unlock_irqrestore
(
db
->
lock
,
flags
);
/* Set timer again */
db
->
timer
.
expires
=
DM9000_TIMER_WUT
;
add_timer
(
&
db
->
timer
);
...
...
@@ -1098,9 +1081,14 @@ dm9000_phy_read(struct net_device *dev, int phy_reg_unused, int reg)
{
board_info_t
*
db
=
(
board_info_t
*
)
dev
->
priv
;
unsigned
long
flags
;
unsigned
int
reg_save
;
int
ret
;
spin_lock_irqsave
(
&
db
->
lock
,
flags
);
/* Save previous register address */
reg_save
=
readb
(
db
->
io_addr
);
/* Fill the phyxcer register into REG_0C */
iow
(
db
,
DM9000_EPAR
,
DM9000_PHY
|
reg
);
...
...
@@ -1111,6 +1099,9 @@ dm9000_phy_read(struct net_device *dev, int phy_reg_unused, int reg)
/* The read data keeps on REG_0D & REG_0E */
ret
=
(
ior
(
db
,
DM9000_EPDRH
)
<<
8
)
|
ior
(
db
,
DM9000_EPDRL
);
/* restore the previous address */
writeb
(
reg_save
,
db
->
io_addr
);
spin_unlock_irqrestore
(
&
db
->
lock
,
flags
);
return
ret
;
...
...
@@ -1124,9 +1115,13 @@ dm9000_phy_write(struct net_device *dev, int phyaddr_unused, int reg, int value)
{
board_info_t
*
db
=
(
board_info_t
*
)
dev
->
priv
;
unsigned
long
flags
;
unsigned
long
reg_save
;
spin_lock_irqsave
(
&
db
->
lock
,
flags
);
/* Save previous register address */
reg_save
=
readb
(
db
->
io_addr
);
/* Fill the phyxcer register into REG_0C */
iow
(
db
,
DM9000_EPAR
,
DM9000_PHY
|
reg
);
...
...
@@ -1138,6 +1133,9 @@ dm9000_phy_write(struct net_device *dev, int phyaddr_unused, int reg, int value)
udelay
(
500
);
/* Wait write complete */
iow
(
db
,
DM9000_EPCR
,
0x0
);
/* Clear phyxcer write command */
/* restore the previous address */
writeb
(
reg_save
,
db
->
io_addr
);
spin_unlock_irqrestore
(
&
db
->
lock
,
flags
);
}
...
...
@@ -1202,6 +1200,8 @@ static struct device_driver dm9000_driver = {
static
int
__init
dm9000_init
(
void
)
{
printk
(
KERN_INFO
"%s Ethernet Driver
\n
"
,
CARDNAME
);
return
driver_register
(
&
dm9000_driver
);
/* search board and register */
}
...
...
drivers/net/ioc3-eth.c
浏览文件 @
5fdf193b
...
...
@@ -499,7 +499,7 @@ static int ioc3_mdio_read(struct net_device *dev, int phy, int reg)
ioc3_w_micr
((
phy
<<
MICR_PHYADDR_SHIFT
)
|
reg
|
MICR_READTRIG
);
while
(
ioc3_r_micr
()
&
MICR_BUSY
);
return
ioc3_r_mi
c
r
()
&
MIDR_DATA_MASK
;
return
ioc3_r_mi
dr_
r
()
&
MIDR_DATA_MASK
;
}
static
void
ioc3_mdio_write
(
struct
net_device
*
dev
,
int
phy
,
int
reg
,
int
data
)
...
...
@@ -1291,7 +1291,6 @@ static int ioc3_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
dev
->
features
=
NETIF_F_IP_CSUM
;
#endif
ioc3_setup_duplex
(
ip
);
sw_physid1
=
ioc3_mdio_read
(
dev
,
ip
->
mii
.
phy_id
,
MII_PHYSID1
);
sw_physid2
=
ioc3_mdio_read
(
dev
,
ip
->
mii
.
phy_id
,
MII_PHYSID2
);
...
...
@@ -1300,6 +1299,7 @@ static int ioc3_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
goto
out_stop
;
mii_check_media
(
&
ip
->
mii
,
1
,
1
);
ioc3_setup_duplex
(
ip
);
vendor
=
(
sw_physid1
<<
12
)
|
(
sw_physid2
>>
4
);
model
=
(
sw_physid2
>>
4
)
&
0x3f
;
...
...
@@ -1524,7 +1524,7 @@ static void ioc3_get_drvinfo (struct net_device *dev,
struct
ethtool_drvinfo
*
info
)
{
struct
ioc3_private
*
ip
=
netdev_priv
(
dev
);
strcpy
(
info
->
driver
,
IOC3_NAME
);
strcpy
(
info
->
version
,
IOC3_VERSION
);
strcpy
(
info
->
bus_info
,
pci_name
(
ip
->
pdev
));
...
...
@@ -1550,7 +1550,7 @@ static int ioc3_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
spin_lock_irq
(
&
ip
->
ioc3_lock
);
rc
=
mii_ethtool_sset
(
&
ip
->
mii
,
cmd
);
spin_unlock_irq
(
&
ip
->
ioc3_lock
);
return
rc
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录