Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
3b8f5945
K
Kernel
项目概览
openeuler
/
Kernel
1 年多 前同步成功
通知
8
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
3b8f5945
编写于
1月 14, 2011
作者:
D
David S. Miller
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/jkirsher/net-2.6
上级
886d7f44
af667a29
变更
13
隐藏空白更改
内联
并排
Showing
13 changed file
with
147 addition
and
136 deletion
+147
-136
drivers/net/e1000/e1000_main.c
drivers/net/e1000/e1000_main.c
+9
-1
drivers/net/e1000e/82571.c
drivers/net/e1000e/82571.c
+2
-2
drivers/net/e1000e/Makefile
drivers/net/e1000e/Makefile
+1
-1
drivers/net/e1000e/defines.h
drivers/net/e1000e/defines.h
+1
-1
drivers/net/e1000e/e1000.h
drivers/net/e1000e/e1000.h
+1
-1
drivers/net/e1000e/es2lan.c
drivers/net/e1000e/es2lan.c
+1
-1
drivers/net/e1000e/ethtool.c
drivers/net/e1000e/ethtool.c
+1
-1
drivers/net/e1000e/hw.h
drivers/net/e1000e/hw.h
+2
-2
drivers/net/e1000e/ich8lan.c
drivers/net/e1000e/ich8lan.c
+1
-1
drivers/net/e1000e/lib.c
drivers/net/e1000e/lib.c
+10
-10
drivers/net/e1000e/netdev.c
drivers/net/e1000e/netdev.c
+113
-110
drivers/net/e1000e/param.c
drivers/net/e1000e/param.c
+3
-3
drivers/net/e1000e/phy.c
drivers/net/e1000e/phy.c
+2
-2
未找到文件。
drivers/net/e1000/e1000_main.c
浏览文件 @
3b8f5945
...
...
@@ -3478,9 +3478,17 @@ static irqreturn_t e1000_intr(int irq, void *data)
struct
e1000_hw
*
hw
=
&
adapter
->
hw
;
u32
icr
=
er32
(
ICR
);
if
(
unlikely
((
!
icr
)
||
test_bit
(
__E1000_DOWN
,
&
adapter
->
flags
)
))
if
(
unlikely
((
!
icr
)))
return
IRQ_NONE
;
/* Not our interrupt */
/*
* we might have caused the interrupt, but the above
* read cleared it, and just in case the driver is
* down there is nothing to do so return handled
*/
if
(
unlikely
(
test_bit
(
__E1000_DOWN
,
&
adapter
->
flags
)))
return
IRQ_HANDLED
;
if
(
unlikely
(
icr
&
(
E1000_ICR_RXSEQ
|
E1000_ICR_LSC
)))
{
hw
->
get_link_status
=
1
;
/* guard against interrupt when we're going down */
...
...
drivers/net/e1000e/82571.c
浏览文件 @
3b8f5945
/*******************************************************************************
Intel PRO/1000 Linux driver
Copyright(c) 1999 - 201
0
Intel Corporation.
Copyright(c) 1999 - 201
1
Intel Corporation.
This program is free software; you can redistribute it and/or modify it
under the terms and conditions of the GNU General Public License,
...
...
@@ -1310,7 +1310,7 @@ static void e1000_initialize_hw_bits_82571(struct e1000_hw *hw)
* apply workaround for hardware errata documented in errata
* docs Fixes issue where some error prone or unreliable PCIe
* completions are occurring, particularly with ASPM enabled.
* Without fix, issue can cause
t
x timeouts.
* Without fix, issue can cause
T
x timeouts.
*/
reg
=
er32
(
GCR2
);
reg
|=
1
;
...
...
drivers/net/e1000e/Makefile
浏览文件 @
3b8f5945
################################################################################
#
# Intel PRO/1000 Linux driver
# Copyright(c) 1999 - 20
08
Intel Corporation.
# Copyright(c) 1999 - 20
11
Intel Corporation.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms and conditions of the GNU General Public License,
...
...
drivers/net/e1000e/defines.h
浏览文件 @
3b8f5945
/*******************************************************************************
Intel PRO/1000 Linux driver
Copyright(c) 1999 - 201
0
Intel Corporation.
Copyright(c) 1999 - 201
1
Intel Corporation.
This program is free software; you can redistribute it and/or modify it
under the terms and conditions of the GNU General Public License,
...
...
drivers/net/e1000e/e1000.h
浏览文件 @
3b8f5945
/*******************************************************************************
Intel PRO/1000 Linux driver
Copyright(c) 1999 - 201
0
Intel Corporation.
Copyright(c) 1999 - 201
1
Intel Corporation.
This program is free software; you can redistribute it and/or modify it
under the terms and conditions of the GNU General Public License,
...
...
drivers/net/e1000e/es2lan.c
浏览文件 @
3b8f5945
/*******************************************************************************
Intel PRO/1000 Linux driver
Copyright(c) 1999 - 201
0
Intel Corporation.
Copyright(c) 1999 - 201
1
Intel Corporation.
This program is free software; you can redistribute it and/or modify it
under the terms and conditions of the GNU General Public License,
...
...
drivers/net/e1000e/ethtool.c
浏览文件 @
3b8f5945
/*******************************************************************************
Intel PRO/1000 Linux driver
Copyright(c) 1999 - 201
0
Intel Corporation.
Copyright(c) 1999 - 201
1
Intel Corporation.
This program is free software; you can redistribute it and/or modify it
under the terms and conditions of the GNU General Public License,
...
...
drivers/net/e1000e/hw.h
浏览文件 @
3b8f5945
/*******************************************************************************
Intel PRO/1000 Linux driver
Copyright(c) 1999 - 201
0
Intel Corporation.
Copyright(c) 1999 - 201
1
Intel Corporation.
This program is free software; you can redistribute it and/or modify it
under the terms and conditions of the GNU General Public License,
...
...
@@ -102,7 +102,7 @@ enum e1e_registers {
E1000_RDTR
=
0x02820
,
/* Rx Delay Timer - RW */
E1000_RXDCTL_BASE
=
0x02828
,
/* Rx Descriptor Control - RW */
#define E1000_RXDCTL(_n) (E1000_RXDCTL_BASE + (_n << 8))
E1000_RADV
=
0x0282C
,
/* R
X
Interrupt Absolute Delay Timer - RW */
E1000_RADV
=
0x0282C
,
/* R
x
Interrupt Absolute Delay Timer - RW */
/* Convenience macros
*
...
...
drivers/net/e1000e/ich8lan.c
浏览文件 @
3b8f5945
/*******************************************************************************
Intel PRO/1000 Linux driver
Copyright(c) 1999 - 201
0
Intel Corporation.
Copyright(c) 1999 - 201
1
Intel Corporation.
This program is free software; you can redistribute it and/or modify it
under the terms and conditions of the GNU General Public License,
...
...
drivers/net/e1000e/lib.c
浏览文件 @
3b8f5945
/*******************************************************************************
Intel PRO/1000 Linux driver
Copyright(c) 1999 - 201
0
Intel Corporation.
Copyright(c) 1999 - 201
1
Intel Corporation.
This program is free software; you can redistribute it and/or modify it
under the terms and conditions of the GNU General Public License,
...
...
@@ -533,7 +533,7 @@ s32 e1000e_check_for_fiber_link(struct e1000_hw *hw)
mac
->
autoneg_failed
=
1
;
return
0
;
}
e_dbg
(
"NOT R
X
ing /C/, disable AutoNeg and force link.
\n
"
);
e_dbg
(
"NOT R
x'
ing /C/, disable AutoNeg and force link.
\n
"
);
/* Disable auto-negotiation in the TXCW register */
ew32
(
TXCW
,
(
mac
->
txcw
&
~
E1000_TXCW_ANE
));
...
...
@@ -556,7 +556,7 @@ s32 e1000e_check_for_fiber_link(struct e1000_hw *hw)
* and disable forced link in the Device Control register
* in an attempt to auto-negotiate with our link partner.
*/
e_dbg
(
"R
X
ing /C/, enable AutoNeg and stop forcing link.
\n
"
);
e_dbg
(
"R
x'
ing /C/, enable AutoNeg and stop forcing link.
\n
"
);
ew32
(
TXCW
,
mac
->
txcw
);
ew32
(
CTRL
,
(
ctrl
&
~
E1000_CTRL_SLU
));
...
...
@@ -598,7 +598,7 @@ s32 e1000e_check_for_serdes_link(struct e1000_hw *hw)
mac
->
autoneg_failed
=
1
;
return
0
;
}
e_dbg
(
"NOT R
X
ing /C/, disable AutoNeg and force link.
\n
"
);
e_dbg
(
"NOT R
x'
ing /C/, disable AutoNeg and force link.
\n
"
);
/* Disable auto-negotiation in the TXCW register */
ew32
(
TXCW
,
(
mac
->
txcw
&
~
E1000_TXCW_ANE
));
...
...
@@ -621,7 +621,7 @@ s32 e1000e_check_for_serdes_link(struct e1000_hw *hw)
* and disable forced link in the Device Control register
* in an attempt to auto-negotiate with our link partner.
*/
e_dbg
(
"R
X
ing /C/, enable AutoNeg and stop forcing link.
\n
"
);
e_dbg
(
"R
x'
ing /C/, enable AutoNeg and stop forcing link.
\n
"
);
ew32
(
TXCW
,
mac
->
txcw
);
ew32
(
CTRL
,
(
ctrl
&
~
E1000_CTRL_SLU
));
...
...
@@ -800,9 +800,9 @@ static s32 e1000_commit_fc_settings_generic(struct e1000_hw *hw)
* The possible values of the "fc" parameter are:
* 0: Flow control is completely disabled
* 1: Rx flow control is enabled (we can receive pause frames,
*
but not send pause frames).
*
but not send pause frames).
* 2: Tx flow control is enabled (we can send pause frames but we
*
do not support receiving pause frames).
*
do not support receiving pause frames).
* 3: Both Rx and Tx flow control (symmetric) are enabled.
*/
switch
(
hw
->
fc
.
current_mode
)
{
...
...
@@ -1031,9 +1031,9 @@ s32 e1000e_force_mac_fc(struct e1000_hw *hw)
* The possible values of the "fc" parameter are:
* 0: Flow control is completely disabled
* 1: Rx flow control is enabled (we can receive pause
*
frames but not send pause frames).
*
frames but not send pause frames).
* 2: Tx flow control is enabled (we can send pause frames
*
frames but we do not receive pause frames).
*
frames but we do not receive pause frames).
* 3: Both Rx and Tx flow control (symmetric) is enabled.
* other: No other values should be possible at this point.
*/
...
...
@@ -1189,7 +1189,7 @@ s32 e1000e_config_fc_after_link_up(struct e1000_hw *hw)
}
else
{
hw
->
fc
.
current_mode
=
e1000_fc_rx_pause
;
e_dbg
(
"Flow Control = "
"RX
PAUSE frames only.
\r\n
"
);
"Rx
PAUSE frames only.
\r\n
"
);
}
}
/*
...
...
drivers/net/e1000e/netdev.c
浏览文件 @
3b8f5945
/*******************************************************************************
Intel PRO/1000 Linux driver
Copyright(c) 1999 - 201
0
Intel Corporation.
Copyright(c) 1999 - 201
1
Intel Corporation.
This program is free software; you can redistribute it and/or modify it
under the terms and conditions of the GNU General Public License,
...
...
@@ -77,17 +77,17 @@ struct e1000_reg_info {
char
*
name
;
};
#define E1000_RDFH 0x02410
/* Rx Data FIFO Head - RW */
#define E1000_RDFT 0x02418
/* Rx Data FIFO Tail - RW */
#define E1000_RDFHS 0x02420
/* Rx Data FIFO Head Saved - RW */
#define E1000_RDFTS 0x02428
/* Rx Data FIFO Tail Saved - RW */
#define E1000_RDFPC 0x02430
/* Rx Data FIFO Packet Count - RW */
#define E1000_RDFH 0x02410
/* Rx Data FIFO Head - RW */
#define E1000_RDFT 0x02418
/* Rx Data FIFO Tail - RW */
#define E1000_RDFHS 0x02420
/* Rx Data FIFO Head Saved - RW */
#define E1000_RDFTS 0x02428
/* Rx Data FIFO Tail Saved - RW */
#define E1000_RDFPC 0x02430
/* Rx Data FIFO Packet Count - RW */
#define E1000_TDFH 0x03410
/* Tx Data FIFO Head - RW */
#define E1000_TDFT 0x03418
/* Tx Data FIFO Tail - RW */
#define E1000_TDFHS 0x03420
/* Tx Data FIFO Head Saved - RW */
#define E1000_TDFTS 0x03428
/* Tx Data FIFO Tail Saved - RW */
#define E1000_TDFPC 0x03430
/* Tx Data FIFO Packet Count - RW */
#define E1000_TDFH 0x03410
/* Tx Data FIFO Head - RW */
#define E1000_TDFT 0x03418
/* Tx Data FIFO Tail - RW */
#define E1000_TDFHS 0x03420
/* Tx Data FIFO Head Saved - RW */
#define E1000_TDFTS 0x03428
/* Tx Data FIFO Tail Saved - RW */
#define E1000_TDFPC 0x03430
/* Tx Data FIFO Packet Count - RW */
static
const
struct
e1000_reg_info
e1000_reg_info_tbl
[]
=
{
...
...
@@ -99,7 +99,7 @@ static const struct e1000_reg_info e1000_reg_info_tbl[] = {
/* Interrupt Registers */
{
E1000_ICR
,
"ICR"
},
/* R
X
Registers */
/* R
x
Registers */
{
E1000_RCTL
,
"RCTL"
},
{
E1000_RDLEN
,
"RDLEN"
},
{
E1000_RDH
,
"RDH"
},
...
...
@@ -115,7 +115,7 @@ static const struct e1000_reg_info e1000_reg_info_tbl[] = {
{
E1000_RDFTS
,
"RDFTS"
},
{
E1000_RDFPC
,
"RDFPC"
},
/* T
X
Registers */
/* T
x
Registers */
{
E1000_TCTL
,
"TCTL"
},
{
E1000_TDBAL
,
"TDBAL"
},
{
E1000_TDBAH
,
"TDBAH"
},
...
...
@@ -160,7 +160,7 @@ static void e1000_regdump(struct e1000_hw *hw, struct e1000_reg_info *reginfo)
break
;
default:
printk
(
KERN_INFO
"%-15s %08x
\n
"
,
reginfo
->
name
,
__er32
(
hw
,
reginfo
->
ofs
));
reginfo
->
name
,
__er32
(
hw
,
reginfo
->
ofs
));
return
;
}
...
...
@@ -171,9 +171,8 @@ static void e1000_regdump(struct e1000_hw *hw, struct e1000_reg_info *reginfo)
printk
(
KERN_CONT
"
\n
"
);
}
/*
* e1000e_dump - Print registers,
tx-ring and r
x-ring
* e1000e_dump - Print registers,
Tx-ring and R
x-ring
*/
static
void
e1000e_dump
(
struct
e1000_adapter
*
adapter
)
{
...
...
@@ -182,12 +181,20 @@ static void e1000e_dump(struct e1000_adapter *adapter)
struct
e1000_reg_info
*
reginfo
;
struct
e1000_ring
*
tx_ring
=
adapter
->
tx_ring
;
struct
e1000_tx_desc
*
tx_desc
;
struct
my_u0
{
u64
a
;
u64
b
;
}
*
u0
;
struct
my_u0
{
u64
a
;
u64
b
;
}
*
u0
;
struct
e1000_buffer
*
buffer_info
;
struct
e1000_ring
*
rx_ring
=
adapter
->
rx_ring
;
union
e1000_rx_desc_packet_split
*
rx_desc_ps
;
struct
e1000_rx_desc
*
rx_desc
;
struct
my_u1
{
u64
a
;
u64
b
;
u64
c
;
u64
d
;
}
*
u1
;
struct
my_u1
{
u64
a
;
u64
b
;
u64
c
;
u64
d
;
}
*
u1
;
u32
staterr
;
int
i
=
0
;
...
...
@@ -198,12 +205,10 @@ static void e1000e_dump(struct e1000_adapter *adapter)
if
(
netdev
)
{
dev_info
(
&
adapter
->
pdev
->
dev
,
"Net device Info
\n
"
);
printk
(
KERN_INFO
"Device Name state "
"trans_start last_rx
\n
"
);
"trans_start last_rx
\n
"
);
printk
(
KERN_INFO
"%-15s %016lX %016lX %016lX
\n
"
,
netdev
->
name
,
netdev
->
state
,
netdev
->
trans_start
,
netdev
->
last_rx
);
netdev
->
name
,
netdev
->
state
,
netdev
->
trans_start
,
netdev
->
last_rx
);
}
/* Print Registers */
...
...
@@ -214,26 +219,26 @@ static void e1000e_dump(struct e1000_adapter *adapter)
e1000_regdump
(
hw
,
reginfo
);
}
/* Print T
X
Ring Summary */
/* Print T
x
Ring Summary */
if
(
!
netdev
||
!
netif_running
(
netdev
))
goto
exit
;
dev_info
(
&
adapter
->
pdev
->
dev
,
"T
X Rings
Summary
\n
"
);
dev_info
(
&
adapter
->
pdev
->
dev
,
"T
x Ring
Summary
\n
"
);
printk
(
KERN_INFO
"Queue [NTU] [NTC] [bi(ntc)->dma ]"
" leng ntw timestamp
\n
"
);
" leng ntw timestamp
\n
"
);
buffer_info
=
&
tx_ring
->
buffer_info
[
tx_ring
->
next_to_clean
];
printk
(
KERN_INFO
" %5d %5X %5X %016llX %04X %3X %016llX
\n
"
,
0
,
tx_ring
->
next_to_use
,
tx_ring
->
next_to_clean
,
(
unsigned
long
long
)
buffer_info
->
dma
,
buffer_info
->
length
,
buffer_info
->
next_to_watch
,
(
unsigned
long
long
)
buffer_info
->
time_stamp
);
0
,
tx_ring
->
next_to_use
,
tx_ring
->
next_to_clean
,
(
unsigned
long
long
)
buffer_info
->
dma
,
buffer_info
->
length
,
buffer_info
->
next_to_watch
,
(
unsigned
long
long
)
buffer_info
->
time_stamp
);
/* Print T
X Rings
*/
/* Print T
x Ring
*/
if
(
!
netif_msg_tx_done
(
adapter
))
goto
rx_ring_summary
;
dev_info
(
&
adapter
->
pdev
->
dev
,
"T
X Rings
Dump
\n
"
);
dev_info
(
&
adapter
->
pdev
->
dev
,
"T
x Ring
Dump
\n
"
);
/* Transmit Descriptor Formats - DEXT[29] is 0 (Legacy) or 1 (Extended)
*
...
...
@@ -263,22 +268,22 @@ static void e1000e_dump(struct e1000_adapter *adapter)
* 63 48 47 40 39 36 35 32 31 24 23 20 19 0
*/
printk
(
KERN_INFO
"Tl[desc] [address 63:0 ] [SpeCssSCmCsLen]"
" [bi->dma ] leng ntw timestamp bi->skb "
"<-- Legacy format
\n
"
);
" [bi->dma ] leng ntw timestamp bi->skb "
"<-- Legacy format
\n
"
);
printk
(
KERN_INFO
"Tc[desc] [Ce CoCsIpceCoS] [MssHlRSCm0Plen]"
" [bi->dma ] leng ntw timestamp bi->skb "
"<-- Ext Context format
\n
"
);
" [bi->dma ] leng ntw timestamp bi->skb "
"<-- Ext Context format
\n
"
);
printk
(
KERN_INFO
"Td[desc] [address 63:0 ] [VlaPoRSCm1Dlen]"
" [bi->dma ] leng ntw timestamp bi->skb "
"<-- Ext Data format
\n
"
);
" [bi->dma ] leng ntw timestamp bi->skb "
"<-- Ext Data format
\n
"
);
for
(
i
=
0
;
tx_ring
->
desc
&&
(
i
<
tx_ring
->
count
);
i
++
)
{
tx_desc
=
E1000_TX_DESC
(
*
tx_ring
,
i
);
buffer_info
=
&
tx_ring
->
buffer_info
[
i
];
u0
=
(
struct
my_u0
*
)
tx_desc
;
printk
(
KERN_INFO
"T%c[0x%03X] %016llX %016llX %016llX "
"%04X %3X %016llX %p"
,
(
!
(
le64_to_cpu
(
u0
->
b
)
&
(
1
<<
29
))
?
'l'
:
((
le64_to_cpu
(
u0
->
b
)
&
(
1
<<
20
))
?
'd'
:
'c'
)),
i
,
"%04X %3X %016llX %p"
,
(
!
(
le64_to_cpu
(
u0
->
b
)
&
(
1
<<
29
))
?
'l'
:
((
le64_to_cpu
(
u0
->
b
)
&
(
1
<<
20
))
?
'd'
:
'c'
)),
i
,
(
unsigned
long
long
)
le64_to_cpu
(
u0
->
a
),
(
unsigned
long
long
)
le64_to_cpu
(
u0
->
b
),
(
unsigned
long
long
)
buffer_info
->
dma
,
...
...
@@ -296,22 +301,22 @@ static void e1000e_dump(struct e1000_adapter *adapter)
if
(
netif_msg_pktdata
(
adapter
)
&&
buffer_info
->
dma
!=
0
)
print_hex_dump
(
KERN_INFO
,
""
,
DUMP_PREFIX_ADDRESS
,
16
,
1
,
phys_to_virt
(
buffer_info
->
dma
),
buffer_info
->
length
,
true
);
16
,
1
,
phys_to_virt
(
buffer_info
->
dma
),
buffer_info
->
length
,
true
);
}
/* Print R
X Rings
Summary */
/* Print R
x Ring
Summary */
rx_ring_summary:
dev_info
(
&
adapter
->
pdev
->
dev
,
"R
X Rings
Summary
\n
"
);
dev_info
(
&
adapter
->
pdev
->
dev
,
"R
x Ring
Summary
\n
"
);
printk
(
KERN_INFO
"Queue [NTU] [NTC]
\n
"
);
printk
(
KERN_INFO
" %5d %5X %5X
\n
"
,
0
,
rx_ring
->
next_to_use
,
rx_ring
->
next_to_clean
);
rx_ring
->
next_to_use
,
rx_ring
->
next_to_clean
);
/* Print R
X Rings
*/
/* Print R
x Ring
*/
if
(
!
netif_msg_rx_status
(
adapter
))
goto
exit
;
dev_info
(
&
adapter
->
pdev
->
dev
,
"R
X Rings
Dump
\n
"
);
dev_info
(
&
adapter
->
pdev
->
dev
,
"R
x Ring
Dump
\n
"
);
switch
(
adapter
->
rx_ps_pages
)
{
case
1
:
case
2
:
...
...
@@ -329,7 +334,7 @@ static void e1000e_dump(struct e1000_adapter *adapter)
* +-----------------------------------------------------+
*/
printk
(
KERN_INFO
"R [desc] [buffer 0 63:0 ] "
"[buffer 1 63:0 ] "
"[buffer 1 63:0 ] "
"[buffer 2 63:0 ] [buffer 3 63:0 ] [bi->dma ] "
"[bi->skb] <-- Ext Pkt Split format
\n
"
);
/* [Extended] Receive Descriptor (Write-Back) Format
...
...
@@ -344,7 +349,7 @@ static void e1000e_dump(struct e1000_adapter *adapter)
* 63 48 47 32 31 20 19 0
*/
printk
(
KERN_INFO
"RWB[desc] [ck ipid mrqhsh] "
"[vl l0 ee es] "
"[vl l0 ee es] "
"[ l3 l2 l1 hs] [reserved ] ---------------- "
"[bi->skb] <-- Ext Rx Write-Back format
\n
"
);
for
(
i
=
0
;
i
<
rx_ring
->
count
;
i
++
)
{
...
...
@@ -352,26 +357,26 @@ static void e1000e_dump(struct e1000_adapter *adapter)
rx_desc_ps
=
E1000_RX_DESC_PS
(
*
rx_ring
,
i
);
u1
=
(
struct
my_u1
*
)
rx_desc_ps
;
staterr
=
le32_to_cpu
(
rx_desc_ps
->
wb
.
middle
.
status_error
);
le32_to_cpu
(
rx_desc_ps
->
wb
.
middle
.
status_error
);
if
(
staterr
&
E1000_RXD_STAT_DD
)
{
/* Descriptor Done */
printk
(
KERN_INFO
"RWB[0x%03X] %016llX "
"%016llX %016llX %016llX "
"---------------- %p"
,
i
,
(
unsigned
long
long
)
le64_to_cpu
(
u1
->
a
),
(
unsigned
long
long
)
le64_to_cpu
(
u1
->
b
),
(
unsigned
long
long
)
le64_to_cpu
(
u1
->
c
),
(
unsigned
long
long
)
le64_to_cpu
(
u1
->
d
),
buffer_info
->
skb
);
"%016llX %016llX %016llX "
"---------------- %p"
,
i
,
(
unsigned
long
long
)
le64_to_cpu
(
u1
->
a
),
(
unsigned
long
long
)
le64_to_cpu
(
u1
->
b
),
(
unsigned
long
long
)
le64_to_cpu
(
u1
->
c
),
(
unsigned
long
long
)
le64_to_cpu
(
u1
->
d
),
buffer_info
->
skb
);
}
else
{
printk
(
KERN_INFO
"R [0x%03X] %016llX "
"%016llX %016llX %016llX %016llX %p"
,
i
,
(
unsigned
long
long
)
le64_to_cpu
(
u1
->
a
),
(
unsigned
long
long
)
le64_to_cpu
(
u1
->
b
),
(
unsigned
long
long
)
le64_to_cpu
(
u1
->
c
),
(
unsigned
long
long
)
le64_to_cpu
(
u1
->
d
),
(
unsigned
long
long
)
buffer_info
->
dma
,
buffer_info
->
skb
);
"%016llX %016llX %016llX %016llX %p"
,
i
,
(
unsigned
long
long
)
le64_to_cpu
(
u1
->
a
),
(
unsigned
long
long
)
le64_to_cpu
(
u1
->
b
),
(
unsigned
long
long
)
le64_to_cpu
(
u1
->
c
),
(
unsigned
long
long
)
le64_to_cpu
(
u1
->
d
),
(
unsigned
long
long
)
buffer_info
->
dma
,
buffer_info
->
skb
);
if
(
netif_msg_pktdata
(
adapter
))
print_hex_dump
(
KERN_INFO
,
""
,
...
...
@@ -400,18 +405,18 @@ static void e1000e_dump(struct e1000_adapter *adapter)
* 63 48 47 40 39 32 31 16 15 0
*/
printk
(
KERN_INFO
"Rl[desc] [address 63:0 ] "
"[vl er S cks ln] [bi->dma ] [bi->skb] "
"<-- Legacy format
\n
"
);
"[vl er S cks ln] [bi->dma ] [bi->skb] "
"<-- Legacy format
\n
"
);
for
(
i
=
0
;
rx_ring
->
desc
&&
(
i
<
rx_ring
->
count
);
i
++
)
{
rx_desc
=
E1000_RX_DESC
(
*
rx_ring
,
i
);
buffer_info
=
&
rx_ring
->
buffer_info
[
i
];
u0
=
(
struct
my_u0
*
)
rx_desc
;
printk
(
KERN_INFO
"Rl[0x%03X] %016llX %016llX "
"%016llX %p"
,
i
,
(
unsigned
long
long
)
le64_to_cpu
(
u0
->
a
),
(
unsigned
long
long
)
le64_to_cpu
(
u0
->
b
),
(
unsigned
long
long
)
buffer_info
->
dma
,
buffer_info
->
skb
);
"%016llX %p"
,
i
,
(
unsigned
long
long
)
le64_to_cpu
(
u0
->
a
),
(
unsigned
long
long
)
le64_to_cpu
(
u0
->
b
),
(
unsigned
long
long
)
buffer_info
->
dma
,
buffer_info
->
skb
);
if
(
i
==
rx_ring
->
next_to_use
)
printk
(
KERN_CONT
" NTU
\n
"
);
else
if
(
i
==
rx_ring
->
next_to_clean
)
...
...
@@ -421,9 +426,10 @@ static void e1000e_dump(struct e1000_adapter *adapter)
if
(
netif_msg_pktdata
(
adapter
))
print_hex_dump
(
KERN_INFO
,
""
,
DUMP_PREFIX_ADDRESS
,
16
,
1
,
phys_to_virt
(
buffer_info
->
dma
),
adapter
->
rx_buffer_len
,
true
);
DUMP_PREFIX_ADDRESS
,
16
,
1
,
phys_to_virt
(
buffer_info
->
dma
),
adapter
->
rx_buffer_len
,
true
);
}
}
...
...
@@ -450,8 +456,7 @@ static int e1000_desc_unused(struct e1000_ring *ring)
* @skb: pointer to sk_buff to be indicated to stack
**/
static
void
e1000_receive_skb
(
struct
e1000_adapter
*
adapter
,
struct
net_device
*
netdev
,
struct
sk_buff
*
skb
,
struct
net_device
*
netdev
,
struct
sk_buff
*
skb
,
u8
status
,
__le16
vlan
)
{
skb
->
protocol
=
eth_type_trans
(
skb
,
netdev
);
...
...
@@ -464,7 +469,7 @@ static void e1000_receive_skb(struct e1000_adapter *adapter,
}
/**
* e1000_rx_checksum - Receive Checksum Offload
for 82543
* e1000_rx_checksum - Receive Checksum Offload
* @adapter: board private structure
* @status_err: receive descriptor status and error fields
* @csum: receive descriptor csum field
...
...
@@ -548,7 +553,7 @@ static void e1000_alloc_rx_buffers(struct e1000_adapter *adapter,
adapter
->
rx_buffer_len
,
DMA_FROM_DEVICE
);
if
(
dma_mapping_error
(
&
pdev
->
dev
,
buffer_info
->
dma
))
{
dev_err
(
&
pdev
->
dev
,
"R
X
DMA map failed
\n
"
);
dev_err
(
&
pdev
->
dev
,
"R
x
DMA map failed
\n
"
);
adapter
->
rx_dma_failed
++
;
break
;
}
...
...
@@ -601,7 +606,8 @@ static void e1000_alloc_rx_buffers_ps(struct e1000_adapter *adapter,
ps_page
=
&
buffer_info
->
ps_pages
[
j
];
if
(
j
>=
adapter
->
rx_ps_pages
)
{
/* all unused desc entries get hw null ptr */
rx_desc
->
read
.
buffer_addr
[
j
+
1
]
=
~
cpu_to_le64
(
0
);
rx_desc
->
read
.
buffer_addr
[
j
+
1
]
=
~
cpu_to_le64
(
0
);
continue
;
}
if
(
!
ps_page
->
page
)
{
...
...
@@ -617,7 +623,7 @@ static void e1000_alloc_rx_buffers_ps(struct e1000_adapter *adapter,
if
(
dma_mapping_error
(
&
pdev
->
dev
,
ps_page
->
dma
))
{
dev_err
(
&
adapter
->
pdev
->
dev
,
"RX
DMA page map failed
\n
"
);
"Rx
DMA page map failed
\n
"
);
adapter
->
rx_dma_failed
++
;
goto
no_buffers
;
}
...
...
@@ -627,8 +633,8 @@ static void e1000_alloc_rx_buffers_ps(struct e1000_adapter *adapter,
* didn't change because each write-back
* erases this info.
*/
rx_desc
->
read
.
buffer_addr
[
j
+
1
]
=
cpu_to_le64
(
ps_page
->
dma
);
rx_desc
->
read
.
buffer_addr
[
j
+
1
]
=
cpu_to_le64
(
ps_page
->
dma
);
}
skb
=
netdev_alloc_skb_ip_align
(
netdev
,
...
...
@@ -644,7 +650,7 @@ static void e1000_alloc_rx_buffers_ps(struct e1000_adapter *adapter,
adapter
->
rx_ps_bsize0
,
DMA_FROM_DEVICE
);
if
(
dma_mapping_error
(
&
pdev
->
dev
,
buffer_info
->
dma
))
{
dev_err
(
&
pdev
->
dev
,
"R
X
DMA map failed
\n
"
);
dev_err
(
&
pdev
->
dev
,
"R
x
DMA map failed
\n
"
);
adapter
->
rx_dma_failed
++
;
/* cleanup skb */
dev_kfree_skb_any
(
skb
);
...
...
@@ -662,7 +668,7 @@ static void e1000_alloc_rx_buffers_ps(struct e1000_adapter *adapter,
* such as IA-64).
*/
wmb
();
writel
(
i
<<
1
,
adapter
->
hw
.
hw_addr
+
rx_ring
->
tail
);
writel
(
i
<<
1
,
adapter
->
hw
.
hw_addr
+
rx_ring
->
tail
);
}
i
++
;
...
...
@@ -1106,11 +1112,10 @@ static bool e1000_clean_rx_irq_ps(struct e1000_adapter *adapter,
cleaned
=
1
;
cleaned_count
++
;
dma_unmap_single
(
&
pdev
->
dev
,
buffer_info
->
dma
,
adapter
->
rx_ps_bsize0
,
DMA_FROM_DEVICE
);
adapter
->
rx_ps_bsize0
,
DMA_FROM_DEVICE
);
buffer_info
->
dma
=
0
;
/* see !EOP comment in other
r
x routine */
/* see !EOP comment in other
R
x routine */
if
(
!
(
staterr
&
E1000_RXD_STAT_EOP
))
adapter
->
flags2
|=
FLAG2_IS_DISCARDING
;
...
...
@@ -2610,7 +2615,7 @@ static void e1000_init_manageability_pt(struct e1000_adapter *adapter)
}
/**
* e1000_configure_tx - Configure
8254x
Transmit Unit after Reset
* e1000_configure_tx - Configure Transmit Unit after Reset
* @adapter: board private structure
*
* Configure the Tx unit of the MAC after a reset.
...
...
@@ -2663,7 +2668,7 @@ static void e1000_configure_tx(struct e1000_adapter *adapter)
* hthresh = 1 ==> prefetch when one or more available
* pthresh = 0x1f ==> prefetch if internal cache 31 or less
* BEWARE: this seems to work but should be considered first if
* there are
tx hangs or other t
x related bugs
* there are
Tx hangs or other T
x related bugs
*/
txdctl
|=
E1000_TXDCTL_DMA_BURST_ENABLE
;
ew32
(
TXDCTL
(
0
),
txdctl
);
...
...
@@ -2877,7 +2882,7 @@ static void e1000_configure_rx(struct e1000_adapter *adapter)
if
(
adapter
->
rx_ps_pages
)
{
/* this is a 32 byte descriptor */
rdlen
=
rx_ring
->
count
*
sizeof
(
union
e1000_rx_desc_packet_split
);
sizeof
(
union
e1000_rx_desc_packet_split
);
adapter
->
clean_rx
=
e1000_clean_rx_irq_ps
;
adapter
->
alloc_rx_buf
=
e1000_alloc_rx_buffers_ps
;
}
else
if
(
adapter
->
netdev
->
mtu
>
ETH_FRAME_LEN
+
ETH_FCS_LEN
)
{
...
...
@@ -2900,7 +2905,7 @@ static void e1000_configure_rx(struct e1000_adapter *adapter)
/*
* set the writeback threshold (only takes effect if the RDTR
* is set). set GRAN=1 and write back up to 0x4 worth, and
* enable prefetching of 0x20
r
x descriptors
* enable prefetching of 0x20
R
x descriptors
* granularity = 01
* wthresh = 04,
* hthresh = 04,
...
...
@@ -2981,12 +2986,10 @@ static void e1000_configure_rx(struct e1000_adapter *adapter)
* excessive C-state transition latencies result in
* dropped transactions.
*/
pm_qos_update_request
(
&
adapter
->
netdev
->
pm_qos_req
,
55
);
pm_qos_update_request
(
&
adapter
->
netdev
->
pm_qos_req
,
55
);
}
else
{
pm_qos_update_request
(
&
adapter
->
netdev
->
pm_qos_req
,
PM_QOS_DEFAULT_VALUE
);
pm_qos_update_request
(
&
adapter
->
netdev
->
pm_qos_req
,
PM_QOS_DEFAULT_VALUE
);
}
}
...
...
@@ -3152,7 +3155,7 @@ void e1000e_reset(struct e1000_adapter *adapter)
/* lower 16 bits has Rx packet buffer allocation size in KB */
pba
&=
0xffff
;
/*
* the Tx fifo also stores 16 bytes of information about the
t
x
* the Tx fifo also stores 16 bytes of information about the
T
x
* but don't include ethernet FCS because hardware appends it
*/
min_tx_space
=
(
adapter
->
max_frame_size
+
...
...
@@ -3175,7 +3178,7 @@ void e1000e_reset(struct e1000_adapter *adapter)
pba
-=
min_tx_space
-
tx_space
;
/*
* if short on Rx space, Rx wins and must trump
t
x
* if short on Rx space, Rx wins and must trump
T
x
* adjustment or use Early Receive if available
*/
if
((
pba
<
min_rx_space
)
&&
...
...
@@ -4039,11 +4042,11 @@ static void e1000_print_link_info(struct e1000_adapter *adapter)
adapter
->
netdev
->
name
,
adapter
->
link_speed
,
(
adapter
->
link_duplex
==
FULL_DUPLEX
)
?
"Full Duplex"
:
"Half Duplex"
,
"Full Duplex"
:
"Half Duplex"
,
((
ctrl
&
E1000_CTRL_TFCE
)
&&
(
ctrl
&
E1000_CTRL_RFCE
))
?
"RX/TX
"
:
((
ctrl
&
E1000_CTRL_RFCE
)
?
"R
X
"
:
((
ctrl
&
E1000_CTRL_TFCE
)
?
"TX"
:
"None"
)));
"Rx/Tx
"
:
((
ctrl
&
E1000_CTRL_RFCE
)
?
"R
x
"
:
((
ctrl
&
E1000_CTRL_TFCE
)
?
"Tx"
:
"None"
)));
}
static
bool
e1000e_has_link
(
struct
e1000_adapter
*
adapter
)
...
...
@@ -4338,7 +4341,7 @@ static void e1000_watchdog_task(struct work_struct *work)
/* Force detection of hung controller every watchdog period */
adapter
->
detect_tx_hung
=
1
;
/* flush partial descriptors to memory before detecting
t
x hang */
/* flush partial descriptors to memory before detecting
T
x hang */
if
(
adapter
->
flags2
&
FLAG2_DMA_BURST
)
{
ew32
(
TIDV
,
adapter
->
tx_int_delay
|
E1000_TIDV_FPD
);
ew32
(
RDTR
,
adapter
->
rx_int_delay
|
E1000_RDTR_FPD
);
...
...
@@ -4529,7 +4532,7 @@ static int e1000_tx_map(struct e1000_adapter *adapter,
buffer_info
->
next_to_watch
=
i
;
buffer_info
->
dma
=
dma_map_single
(
&
pdev
->
dev
,
skb
->
data
+
offset
,
size
,
DMA_TO_DEVICE
);
size
,
DMA_TO_DEVICE
);
buffer_info
->
mapped_as_page
=
false
;
if
(
dma_mapping_error
(
&
pdev
->
dev
,
buffer_info
->
dma
))
goto
dma_error
;
...
...
@@ -4576,7 +4579,7 @@ static int e1000_tx_map(struct e1000_adapter *adapter,
}
}
segs
=
skb_shinfo
(
skb
)
->
gso_segs
?:
1
;
segs
=
skb_shinfo
(
skb
)
->
gso_segs
?
:
1
;
/* multiply data chunks by size of headers */
bytecount
=
((
segs
-
1
)
*
skb_headlen
(
skb
))
+
skb
->
len
;
...
...
@@ -4588,13 +4591,13 @@ static int e1000_tx_map(struct e1000_adapter *adapter,
return
count
;
dma_error:
dev_err
(
&
pdev
->
dev
,
"T
X
DMA map failed
\n
"
);
dev_err
(
&
pdev
->
dev
,
"T
x
DMA map failed
\n
"
);
buffer_info
->
dma
=
0
;
if
(
count
)
count
--
;
while
(
count
--
)
{
if
(
i
==
0
)
if
(
i
==
0
)
i
+=
tx_ring
->
count
;
i
--
;
buffer_info
=
&
tx_ring
->
buffer_info
[
i
];
...
...
@@ -6193,7 +6196,7 @@ static int __init e1000_init_module(void)
int
ret
;
pr_info
(
"Intel(R) PRO/1000 Network Driver - %s
\n
"
,
e1000e_driver_version
);
pr_info
(
"Copyright
(c) 1999 - 2010
Intel Corporation.
\n
"
);
pr_info
(
"Copyright
(c) 1999 - 2011
Intel Corporation.
\n
"
);
ret
=
pci_register_driver
(
&
e1000_driver
);
return
ret
;
...
...
drivers/net/e1000e/param.c
浏览文件 @
3b8f5945
/*******************************************************************************
Intel PRO/1000 Linux driver
Copyright(c) 1999 - 201
0
Intel Corporation.
Copyright(c) 1999 - 201
1
Intel Corporation.
This program is free software; you can redistribute it and/or modify it
under the terms and conditions of the GNU General Public License,
...
...
@@ -62,10 +62,9 @@ MODULE_PARM_DESC(copybreak,
module_param_array_named(X, X, int, &num_##X, 0); \
MODULE_PARM_DESC(X, desc);
/*
* Transmit Interrupt Delay in units of 1.024 microseconds
* Tx interrupt delay needs to typically be set to something non
zero
* Tx interrupt delay needs to typically be set to something non
-
zero
*
* Valid Range: 0-65535
*/
...
...
@@ -112,6 +111,7 @@ E1000_PARAM(InterruptThrottleRate, "Interrupt Throttling Rate");
#define DEFAULT_ITR 3
#define MAX_ITR 100000
#define MIN_ITR 100
/* IntMode (Interrupt Mode)
*
* Valid Range: 0 - 2
...
...
drivers/net/e1000e/phy.c
浏览文件 @
3b8f5945
/*******************************************************************************
Intel PRO/1000 Linux driver
Copyright(c) 1999 - 201
0
Intel Corporation.
Copyright(c) 1999 - 201
1
Intel Corporation.
This program is free software; you can redistribute it and/or modify it
under the terms and conditions of the GNU General Public License,
...
...
@@ -640,7 +640,7 @@ s32 e1000_copper_link_setup_82577(struct e1000_hw *hw)
s32
ret_val
;
u16
phy_data
;
/* Enable CRS on T
X
. This must be set for half-duplex operation. */
/* Enable CRS on T
x
. This must be set for half-duplex operation. */
ret_val
=
e1e_rphy
(
hw
,
I82577_CFG_REG
,
&
phy_data
);
if
(
ret_val
)
goto
out
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录