Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
152cbcf9
cloud-kernel
项目概览
openanolis
/
cloud-kernel
接近 2 年 前同步成功
通知
169
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看板
提交
152cbcf9
编写于
9月 24, 2008
作者:
D
David S. Miller
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'davem-next' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6
上级
96ca4a2c
fa53ebac
变更
77
展开全部
隐藏空白更改
内联
并排
Showing
77 changed file
with
3422 addition
and
2376 deletion
+3422
-2376
MAINTAINERS
MAINTAINERS
+3
-1
drivers/net/3c505.c
drivers/net/3c505.c
+2
-2
drivers/net/8139too.c
drivers/net/8139too.c
+2
-1
drivers/net/Kconfig
drivers/net/Kconfig
+3
-0
drivers/net/arcnet/arcnet.c
drivers/net/arcnet/arcnet.c
+9
-9
drivers/net/arcnet/com20020.c
drivers/net/arcnet/com20020.c
+8
-8
drivers/net/atl1e/atl1e_main.c
drivers/net/atl1e/atl1e_main.c
+0
-2
drivers/net/au1000_eth.c
drivers/net/au1000_eth.c
+2
-1
drivers/net/ax88796.c
drivers/net/ax88796.c
+7
-7
drivers/net/bfin_mac.c
drivers/net/bfin_mac.c
+4
-4
drivers/net/bonding/bond_alb.c
drivers/net/bonding/bond_alb.c
+24
-0
drivers/net/bonding/bond_main.c
drivers/net/bonding/bond_main.c
+6
-0
drivers/net/bonding/bonding.h
drivers/net/bonding/bonding.h
+1
-1
drivers/net/cs89x0.c
drivers/net/cs89x0.c
+0
-2
drivers/net/cxgb3/cxgb3_offload.c
drivers/net/cxgb3/cxgb3_offload.c
+4
-4
drivers/net/cxgb3/sge.c
drivers/net/cxgb3/sge.c
+0
-35
drivers/net/e100.c
drivers/net/e100.c
+1
-1
drivers/net/ehea/ehea.h
drivers/net/ehea/ehea.h
+2
-2
drivers/net/ehea/ehea_main.c
drivers/net/ehea/ehea_main.c
+4
-22
drivers/net/ehea/ehea_phyp.c
drivers/net/ehea/ehea_phyp.c
+1
-1
drivers/net/ehea/ehea_qmr.c
drivers/net/ehea/ehea_qmr.c
+2
-1
drivers/net/enc28j60.c
drivers/net/enc28j60.c
+28
-28
drivers/net/ibm_newemac/phy.c
drivers/net/ibm_newemac/phy.c
+1
-1
drivers/net/ixgb/ixgb.h
drivers/net/ixgb/ixgb.h
+1
-1
drivers/net/ixgbe/ixgbe.h
drivers/net/ixgbe/ixgbe.h
+25
-35
drivers/net/ixgbe/ixgbe_82598.c
drivers/net/ixgbe/ixgbe_82598.c
+519
-109
drivers/net/ixgbe/ixgbe_common.c
drivers/net/ixgbe/ixgbe_common.c
+637
-335
drivers/net/ixgbe/ixgbe_common.h
drivers/net/ixgbe/ixgbe_common.h
+35
-27
drivers/net/ixgbe/ixgbe_ethtool.c
drivers/net/ixgbe/ixgbe_ethtool.c
+154
-144
drivers/net/ixgbe/ixgbe_main.c
drivers/net/ixgbe/ixgbe_main.c
+734
-565
drivers/net/ixgbe/ixgbe_phy.c
drivers/net/ixgbe/ixgbe_phy.c
+89
-155
drivers/net/ixgbe/ixgbe_phy.h
drivers/net/ixgbe/ixgbe_phy.h
+47
-16
drivers/net/ixgbe/ixgbe_type.h
drivers/net/ixgbe/ixgbe_type.h
+340
-188
drivers/net/meth.c
drivers/net/meth.c
+1
-1
drivers/net/mipsnet.c
drivers/net/mipsnet.c
+1
-1
drivers/net/mlx4/alloc.c
drivers/net/mlx4/alloc.c
+1
-0
drivers/net/myri10ge/myri10ge.c
drivers/net/myri10ge/myri10ge.c
+17
-16
drivers/net/ne.c
drivers/net/ne.c
+8
-1
drivers/net/netx-eth.c
drivers/net/netx-eth.c
+1
-1
drivers/net/netxen/netxen_nic.h
drivers/net/netxen/netxen_nic.h
+1
-1
drivers/net/netxen/netxen_nic_main.c
drivers/net/netxen/netxen_nic_main.c
+10
-10
drivers/net/pci-skeleton.c
drivers/net/pci-skeleton.c
+2
-2
drivers/net/r6040.c
drivers/net/r6040.c
+2
-2
drivers/net/r8169.c
drivers/net/r8169.c
+15
-12
drivers/net/s2io.c
drivers/net/s2io.c
+30
-28
drivers/net/s2io.h
drivers/net/s2io.h
+1
-0
drivers/net/sfc/efx.c
drivers/net/sfc/efx.c
+8
-10
drivers/net/sfc/falcon.c
drivers/net/sfc/falcon.c
+138
-122
drivers/net/sfc/falcon.h
drivers/net/sfc/falcon.h
+1
-0
drivers/net/sfc/falcon_hwdefs.h
drivers/net/sfc/falcon_hwdefs.h
+0
-1
drivers/net/sfc/falcon_io.h
drivers/net/sfc/falcon_io.h
+0
-1
drivers/net/sfc/falcon_xmac.c
drivers/net/sfc/falcon_xmac.c
+1
-87
drivers/net/sfc/net_driver.h
drivers/net/sfc/net_driver.h
+5
-3
drivers/net/sfc/sfe4001.c
drivers/net/sfc/sfe4001.c
+0
-12
drivers/net/sfc/tenxpress.c
drivers/net/sfc/tenxpress.c
+11
-58
drivers/net/sfc/tx.c
drivers/net/sfc/tx.c
+1
-1
drivers/net/sfc/workarounds.h
drivers/net/sfc/workarounds.h
+0
-2
drivers/net/sfc/xfp_phy.c
drivers/net/sfc/xfp_phy.c
+0
-1
drivers/net/skfp/pmf.c
drivers/net/skfp/pmf.c
+11
-18
drivers/net/smc911x.c
drivers/net/smc911x.c
+33
-35
drivers/net/smc91x.c
drivers/net/smc91x.c
+22
-21
drivers/net/smc91x.h
drivers/net/smc91x.h
+2
-0
drivers/net/sundance.c
drivers/net/sundance.c
+62
-33
drivers/net/tehuti.h
drivers/net/tehuti.h
+4
-4
drivers/net/tsi108_eth.c
drivers/net/tsi108_eth.c
+3
-3
drivers/net/tulip/de2104x.c
drivers/net/tulip/de2104x.c
+0
-1
drivers/net/ucc_geth.c
drivers/net/ucc_geth.c
+58
-58
drivers/net/usb/hso.c
drivers/net/usb/hso.c
+239
-96
drivers/net/usb/mcs7830.c
drivers/net/usb/mcs7830.c
+1
-1
drivers/net/usb/pegasus.c
drivers/net/usb/pegasus.c
+10
-10
drivers/net/via-velocity.h
drivers/net/via-velocity.h
+1
-1
drivers/net/wan/cycx_drv.c
drivers/net/wan/cycx_drv.c
+3
-3
drivers/net/wan/cycx_x25.c
drivers/net/wan/cycx_x25.c
+6
-6
drivers/net/wan/dscc4.c
drivers/net/wan/dscc4.c
+1
-1
drivers/net/wan/hdlc_x25.c
drivers/net/wan/hdlc_x25.c
+5
-3
drivers/net/wan/pc300_tty.c
drivers/net/wan/pc300_tty.c
+1
-1
include/linux/pci_ids.h
include/linux/pci_ids.h
+10
-0
未找到文件。
MAINTAINERS
浏览文件 @
152cbcf9
...
...
@@ -750,11 +750,13 @@ P: Ville Syrjala
M: syrjala@sci.fi
S: Maintained
ATL
1 ETHERNET DRIVER
ATL
X ETHERNET DRIVERS
P: Jay Cliburn
M: jcliburn@gmail.com
P: Chris Snook
M: csnook@redhat.com
P: Jie Yang
M: jie.yang@atheros.com
L: atl1-devel@lists.sourceforge.net
W: http://sourceforge.net/projects/atl1
W: http://atl1.sourceforge.net
...
...
drivers/net/3c505.c
浏览文件 @
152cbcf9
...
...
@@ -130,12 +130,12 @@ static const char filename[] = __FILE__;
static
const
char
timeout_msg
[]
=
"*** timeout at %s:%s (line %d) ***
\n
"
;
#define TIMEOUT_MSG(lineno) \
printk(timeout_msg, filename,__
FUNCTION
__,(lineno))
printk(timeout_msg, filename,__
func
__,(lineno))
static
const
char
invalid_pcb_msg
[]
=
"*** invalid pcb length %d at %s:%s (line %d) ***
\n
"
;
#define INVALID_PCB_MSG(len) \
printk(invalid_pcb_msg, (len),filename,__
FUNCTION
__,__LINE__)
printk(invalid_pcb_msg, (len),filename,__
func
__,__LINE__)
static
char
search_msg
[]
__initdata
=
KERN_INFO
"%s: Looking for 3c505 adapter at address %#x..."
;
...
...
drivers/net/8139too.c
浏览文件 @
152cbcf9
...
...
@@ -309,7 +309,7 @@ enum RTL8139_registers {
Cfg9346
=
0x50
,
Config0
=
0x51
,
Config1
=
0x52
,
FlashReg
=
0x54
,
TimerInt
=
0x54
,
MediaStatus
=
0x58
,
Config3
=
0x59
,
Config4
=
0x5A
,
/* absent on RTL-8139A */
...
...
@@ -325,6 +325,7 @@ enum RTL8139_registers {
FIFOTMS
=
0x70
,
/* FIFO Control and test. */
CSCR
=
0x74
,
/* Chip Status and Configuration Register. */
PARA78
=
0x78
,
FlashReg
=
0xD4
,
/* Communication with Flash ROM, four bytes. */
PARA7c
=
0x7c
,
/* Magic transceiver parameter register. */
Config5
=
0xD8
,
/* absent on RTL-8139A */
};
...
...
drivers/net/Kconfig
浏览文件 @
152cbcf9
...
...
@@ -2057,6 +2057,7 @@ config R8169
tristate "Realtek 8169 gigabit ethernet support"
depends on PCI
select CRC32
select MII
---help---
Say Y here if you have a Realtek 8169 PCI Gigabit Ethernet adapter.
...
...
@@ -2411,6 +2412,7 @@ config IXGBE
tristate "Intel(R) 10GbE PCI Express adapters support"
depends on PCI && INET
select INET_LRO
select INTEL_IOATDMA
---help---
This driver supports Intel(R) 10GbE PCI Express family of
adapters. For more information on how to identify your adapter, go
...
...
@@ -2462,6 +2464,7 @@ config MYRI10GE
select FW_LOADER
select CRC32
select INET_LRO
select INTEL_IOATDMA
---help---
This driver supports Myricom Myri-10G Dual Protocol interface in
Ethernet mode. If the eeprom on your board is not recent enough,
...
...
drivers/net/arcnet/arcnet.c
浏览文件 @
152cbcf9
...
...
@@ -442,24 +442,24 @@ static int arcnet_open(struct net_device *dev)
BUGMSG
(
D_NORMAL
,
"WARNING! Station address FF may confuse "
"DOS networking programs!
\n
"
);
BUGMSG
(
D_DEBUG
,
"%s: %d: %s
\n
"
,
__FILE__
,
__LINE__
,
__
FUNCTION
__
);
BUGMSG
(
D_DEBUG
,
"%s: %d: %s
\n
"
,
__FILE__
,
__LINE__
,
__
func
__
);
if
(
ASTATUS
()
&
RESETflag
)
{
BUGMSG
(
D_DEBUG
,
"%s: %d: %s
\n
"
,
__FILE__
,
__LINE__
,
__
FUNCTION
__
);
BUGMSG
(
D_DEBUG
,
"%s: %d: %s
\n
"
,
__FILE__
,
__LINE__
,
__
func
__
);
ACOMMAND
(
CFLAGScmd
|
RESETclear
);
}
BUGMSG
(
D_DEBUG
,
"%s: %d: %s
\n
"
,
__FILE__
,
__LINE__
,
__
FUNCTION
__
);
BUGMSG
(
D_DEBUG
,
"%s: %d: %s
\n
"
,
__FILE__
,
__LINE__
,
__
func
__
);
/* make sure we're ready to receive IRQ's. */
AINTMASK
(
0
);
udelay
(
1
);
/* give it time to set the mask before
* we reset it again. (may not even be
* necessary)
*/
BUGMSG
(
D_DEBUG
,
"%s: %d: %s
\n
"
,
__FILE__
,
__LINE__
,
__
FUNCTION
__
);
BUGMSG
(
D_DEBUG
,
"%s: %d: %s
\n
"
,
__FILE__
,
__LINE__
,
__
func
__
);
lp
->
intmask
=
NORXflag
|
RECONflag
;
AINTMASK
(
lp
->
intmask
);
BUGMSG
(
D_DEBUG
,
"%s: %d: %s
\n
"
,
__FILE__
,
__LINE__
,
__
FUNCTION
__
);
BUGMSG
(
D_DEBUG
,
"%s: %d: %s
\n
"
,
__FILE__
,
__LINE__
,
__
func
__
);
netif_start_queue
(
dev
);
...
...
@@ -670,14 +670,14 @@ static int arcnet_send_packet(struct sk_buff *skb, struct net_device *dev)
freeskb
=
0
;
}
BUGMSG
(
D_DEBUG
,
"%s: %d: %s, status: %x
\n
"
,
__FILE__
,
__LINE__
,
__
FUNCTION
__
,
ASTATUS
());
BUGMSG
(
D_DEBUG
,
"%s: %d: %s, status: %x
\n
"
,
__FILE__
,
__LINE__
,
__
func
__
,
ASTATUS
());
/* make sure we didn't ignore a TX IRQ while we were in here */
AINTMASK
(
0
);
BUGMSG
(
D_DEBUG
,
"%s: %d: %s
\n
"
,
__FILE__
,
__LINE__
,
__
FUNCTION
__
);
BUGMSG
(
D_DEBUG
,
"%s: %d: %s
\n
"
,
__FILE__
,
__LINE__
,
__
func
__
);
lp
->
intmask
|=
TXFREEflag
|
EXCNAKflag
;
AINTMASK
(
lp
->
intmask
);
BUGMSG
(
D_DEBUG
,
"%s: %d: %s, status: %x
\n
"
,
__FILE__
,
__LINE__
,
__
FUNCTION
__
,
ASTATUS
());
BUGMSG
(
D_DEBUG
,
"%s: %d: %s, status: %x
\n
"
,
__FILE__
,
__LINE__
,
__
func
__
,
ASTATUS
());
spin_unlock_irqrestore
(
&
lp
->
lock
,
flags
);
if
(
freeskb
)
{
...
...
@@ -798,7 +798,7 @@ irqreturn_t arcnet_interrupt(int irq, void *dev_id)
diagstatus
=
(
status
>>
8
)
&
0xFF
;
BUGMSG
(
D_DEBUG
,
"%s: %d: %s: status=%x
\n
"
,
__FILE__
,
__LINE__
,
__
FUNCTION
__
,
status
);
__FILE__
,
__LINE__
,
__
func
__
,
status
);
didsomething
=
0
;
/*
...
...
drivers/net/arcnet/com20020.c
浏览文件 @
152cbcf9
...
...
@@ -238,15 +238,15 @@ static int com20020_reset(struct net_device *dev, int really_reset)
u_char
inbyte
;
BUGMSG
(
D_DEBUG
,
"%s: %d: %s: dev: %p, lp: %p, dev->name: %s
\n
"
,
__FILE__
,
__LINE__
,
__
FUNCTION
__
,
dev
,
lp
,
dev
->
name
);
__FILE__
,
__LINE__
,
__
func
__
,
dev
,
lp
,
dev
->
name
);
BUGMSG
(
D_INIT
,
"Resetting %s (status=%02Xh)
\n
"
,
dev
->
name
,
ASTATUS
());
BUGMSG
(
D_DEBUG
,
"%s: %d: %s
\n
"
,
__FILE__
,
__LINE__
,
__
FUNCTION
__
);
BUGMSG
(
D_DEBUG
,
"%s: %d: %s
\n
"
,
__FILE__
,
__LINE__
,
__
func
__
);
lp
->
config
=
TXENcfg
|
(
lp
->
timeout
<<
3
)
|
(
lp
->
backplane
<<
2
);
/* power-up defaults */
SETCONF
;
BUGMSG
(
D_DEBUG
,
"%s: %d: %s
\n
"
,
__FILE__
,
__LINE__
,
__
FUNCTION
__
);
BUGMSG
(
D_DEBUG
,
"%s: %d: %s
\n
"
,
__FILE__
,
__LINE__
,
__
func
__
);
if
(
really_reset
)
{
/* reset the card */
...
...
@@ -254,22 +254,22 @@ static int com20020_reset(struct net_device *dev, int really_reset)
mdelay
(
RESETtime
*
2
);
/* COM20020 seems to be slower sometimes */
}
/* clear flags & end reset */
BUGMSG
(
D_DEBUG
,
"%s: %d: %s
\n
"
,
__FILE__
,
__LINE__
,
__
FUNCTION
__
);
BUGMSG
(
D_DEBUG
,
"%s: %d: %s
\n
"
,
__FILE__
,
__LINE__
,
__
func
__
);
ACOMMAND
(
CFLAGScmd
|
RESETclear
|
CONFIGclear
);
/* verify that the ARCnet signature byte is present */
BUGMSG
(
D_DEBUG
,
"%s: %d: %s
\n
"
,
__FILE__
,
__LINE__
,
__
FUNCTION
__
);
BUGMSG
(
D_DEBUG
,
"%s: %d: %s
\n
"
,
__FILE__
,
__LINE__
,
__
func
__
);
com20020_copy_from_card
(
dev
,
0
,
0
,
&
inbyte
,
1
);
BUGMSG
(
D_DEBUG
,
"%s: %d: %s
\n
"
,
__FILE__
,
__LINE__
,
__
FUNCTION
__
);
BUGMSG
(
D_DEBUG
,
"%s: %d: %s
\n
"
,
__FILE__
,
__LINE__
,
__
func
__
);
if
(
inbyte
!=
TESTvalue
)
{
BUGMSG
(
D_DEBUG
,
"%s: %d: %s
\n
"
,
__FILE__
,
__LINE__
,
__
FUNCTION
__
);
BUGMSG
(
D_DEBUG
,
"%s: %d: %s
\n
"
,
__FILE__
,
__LINE__
,
__
func
__
);
BUGMSG
(
D_NORMAL
,
"reset failed: TESTvalue not present.
\n
"
);
return
1
;
}
/* enable extended (512-byte) packets */
ACOMMAND
(
CONFIGcmd
|
EXTconf
);
BUGMSG
(
D_DEBUG
,
"%s: %d: %s
\n
"
,
__FILE__
,
__LINE__
,
__
FUNCTION
__
);
BUGMSG
(
D_DEBUG
,
"%s: %d: %s
\n
"
,
__FILE__
,
__LINE__
,
__
func
__
);
/* done! return success. */
return
0
;
...
...
drivers/net/atl1e/atl1e_main.c
浏览文件 @
152cbcf9
...
...
@@ -2390,9 +2390,7 @@ static int __devinit atl1e_probe(struct pci_dev *pdev,
}
/* Init GPHY as early as possible due to power saving issue */
spin_lock
(
&
adapter
->
mdio_lock
);
atl1e_phy_init
(
&
adapter
->
hw
);
spin_unlock
(
&
adapter
->
mdio_lock
);
/* reset the controller to
* put the device in a known good starting state */
err
=
atl1e_reset_hw
(
&
adapter
->
hw
);
...
...
drivers/net/au1000_eth.c
浏览文件 @
152cbcf9
...
...
@@ -653,6 +653,8 @@ static struct net_device * au1000_probe(int port_num)
aup
=
dev
->
priv
;
spin_lock_init
(
&
aup
->
lock
);
/* Allocate the data buffers */
/* Snooping works fine with eth on all au1xxx */
aup
->
vaddr
=
(
u32
)
dma_alloc_noncoherent
(
NULL
,
MAX_BUF_SIZE
*
...
...
@@ -753,7 +755,6 @@ static struct net_device * au1000_probe(int port_num)
aup
->
tx_db_inuse
[
i
]
=
pDB
;
}
spin_lock_init
(
&
aup
->
lock
);
dev
->
base_addr
=
base
;
dev
->
irq
=
irq
;
dev
->
open
=
au1000_open
;
...
...
drivers/net/ax88796.c
浏览文件 @
152cbcf9
...
...
@@ -153,7 +153,7 @@ static void ax_reset_8390(struct net_device *dev)
while
((
ei_inb
(
addr
+
EN0_ISR
)
&
ENISR_RESET
)
==
0
)
{
if
(
jiffies
-
reset_start_time
>
2
*
HZ
/
100
)
{
dev_warn
(
&
ax
->
dev
->
dev
,
"%s: %s did not complete.
\n
"
,
__
FUNCTION
__
,
dev
->
name
);
__
func
__
,
dev
->
name
);
break
;
}
}
...
...
@@ -173,7 +173,7 @@ static void ax_get_8390_hdr(struct net_device *dev, struct e8390_pkt_hdr *hdr,
if
(
ei_status
.
dmaing
)
{
dev_err
(
&
ax
->
dev
->
dev
,
"%s: DMAing conflict in %s "
"[DMAstat:%d][irqlock:%d].
\n
"
,
dev
->
name
,
__
FUNCTION
__
,
dev
->
name
,
__
func
__
,
ei_status
.
dmaing
,
ei_status
.
irqlock
);
return
;
}
...
...
@@ -215,7 +215,7 @@ static void ax_block_input(struct net_device *dev, int count,
dev_err
(
&
ax
->
dev
->
dev
,
"%s: DMAing conflict in %s "
"[DMAstat:%d][irqlock:%d].
\n
"
,
dev
->
name
,
__
FUNCTION
__
,
dev
->
name
,
__
func
__
,
ei_status
.
dmaing
,
ei_status
.
irqlock
);
return
;
}
...
...
@@ -260,7 +260,7 @@ static void ax_block_output(struct net_device *dev, int count,
if
(
ei_status
.
dmaing
)
{
dev_err
(
&
ax
->
dev
->
dev
,
"%s: DMAing conflict in %s."
"[DMAstat:%d][irqlock:%d]
\n
"
,
dev
->
name
,
__
FUNCTION
__
,
dev
->
name
,
__
func
__
,
ei_status
.
dmaing
,
ei_status
.
irqlock
);
return
;
}
...
...
@@ -396,7 +396,7 @@ ax_phy_issueaddr(struct net_device *dev, int phy_addr, int reg, int opc)
{
if
(
phy_debug
)
pr_debug
(
"%s: dev %p, %04x, %04x, %d
\n
"
,
__
FUNCTION
__
,
dev
,
phy_addr
,
reg
,
opc
);
__
func
__
,
dev
,
phy_addr
,
reg
,
opc
);
ax_mii_ei_outbits
(
dev
,
0x3f
,
6
);
/* pre-amble */
ax_mii_ei_outbits
(
dev
,
1
,
2
);
/* frame-start */
...
...
@@ -422,7 +422,7 @@ ax_phy_read(struct net_device *dev, int phy_addr, int reg)
spin_unlock_irqrestore
(
&
ei_local
->
page_lock
,
flags
);
if
(
phy_debug
)
pr_debug
(
"%s: %04x.%04x => read %04x
\n
"
,
__
FUNCTION
__
,
pr_debug
(
"%s: %04x.%04x => read %04x
\n
"
,
__
func
__
,
phy_addr
,
reg
,
result
);
return
result
;
...
...
@@ -436,7 +436,7 @@ ax_phy_write(struct net_device *dev, int phy_addr, int reg, int value)
unsigned
long
flags
;
dev_dbg
(
&
ax
->
dev
->
dev
,
"%s: %p, %04x, %04x %04x
\n
"
,
__
FUNCTION
__
,
dev
,
phy_addr
,
reg
,
value
);
__
func
__
,
dev
,
phy_addr
,
reg
,
value
);
spin_lock_irqsave
(
&
ei
->
page_lock
,
flags
);
...
...
drivers/net/bfin_mac.c
浏览文件 @
152cbcf9
...
...
@@ -811,7 +811,7 @@ static void bfin_mac_enable(void)
{
u32
opmode
;
pr_debug
(
"%s: %s
\n
"
,
DRV_NAME
,
__
FUNCTION
__
);
pr_debug
(
"%s: %s
\n
"
,
DRV_NAME
,
__
func
__
);
/* Set RX DMA */
bfin_write_DMA1_NEXT_DESC_PTR
(
&
(
rx_list_head
->
desc_a
));
...
...
@@ -847,7 +847,7 @@ static void bfin_mac_enable(void)
/* Our watchdog timed out. Called by the networking layer */
static
void
bfin_mac_timeout
(
struct
net_device
*
dev
)
{
pr_debug
(
"%s: %s
\n
"
,
dev
->
name
,
__
FUNCTION
__
);
pr_debug
(
"%s: %s
\n
"
,
dev
->
name
,
__
func
__
);
bfin_mac_disable
();
...
...
@@ -949,7 +949,7 @@ static int bfin_mac_open(struct net_device *dev)
{
struct
bfin_mac_local
*
lp
=
netdev_priv
(
dev
);
int
retval
;
pr_debug
(
"%s: %s
\n
"
,
dev
->
name
,
__
FUNCTION
__
);
pr_debug
(
"%s: %s
\n
"
,
dev
->
name
,
__
func
__
);
/*
* Check that the address is valid. If its not, refuse
...
...
@@ -989,7 +989,7 @@ static int bfin_mac_open(struct net_device *dev)
static
int
bfin_mac_close
(
struct
net_device
*
dev
)
{
struct
bfin_mac_local
*
lp
=
netdev_priv
(
dev
);
pr_debug
(
"%s: %s
\n
"
,
dev
->
name
,
__
FUNCTION
__
);
pr_debug
(
"%s: %s
\n
"
,
dev
->
name
,
__
func
__
);
netif_stop_queue
(
dev
);
netif_carrier_off
(
dev
);
...
...
drivers/net/bonding/bond_alb.c
浏览文件 @
152cbcf9
...
...
@@ -38,6 +38,7 @@
#include <linux/in.h>
#include <net/ipx.h>
#include <net/arp.h>
#include <net/ipv6.h>
#include <asm/byteorder.h>
#include "bonding.h"
#include "bond_alb.h"
...
...
@@ -81,6 +82,7 @@
#define RLB_PROMISC_TIMEOUT 10*ALB_TIMER_TICKS_PER_SEC
static
const
u8
mac_bcast
[
ETH_ALEN
]
=
{
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
};
static
const
u8
mac_v6_allmcast
[
ETH_ALEN
]
=
{
0x33
,
0x33
,
0x00
,
0x00
,
0x00
,
0x01
};
static
const
int
alb_delta_in_ticks
=
HZ
/
ALB_TIMER_TICKS_PER_SEC
;
#pragma pack(1)
...
...
@@ -1290,6 +1292,7 @@ int bond_alb_xmit(struct sk_buff *skb, struct net_device *bond_dev)
u32
hash_index
=
0
;
const
u8
*
hash_start
=
NULL
;
int
res
=
1
;
struct
ipv6hdr
*
ip6hdr
;
skb_reset_mac_header
(
skb
);
eth_data
=
eth_hdr
(
skb
);
...
...
@@ -1319,11 +1322,32 @@ int bond_alb_xmit(struct sk_buff *skb, struct net_device *bond_dev)
}
break
;
case
ETH_P_IPV6
:
/* IPv6 doesn't really use broadcast mac address, but leave
* that here just in case.
*/
if
(
memcmp
(
eth_data
->
h_dest
,
mac_bcast
,
ETH_ALEN
)
==
0
)
{
do_tx_balance
=
0
;
break
;
}
/* IPv6 uses all-nodes multicast as an equivalent to
* broadcasts in IPv4.
*/
if
(
memcmp
(
eth_data
->
h_dest
,
mac_v6_allmcast
,
ETH_ALEN
)
==
0
)
{
do_tx_balance
=
0
;
break
;
}
/* Additianally, DAD probes should not be tx-balanced as that
* will lead to false positives for duplicate addresses and
* prevent address configuration from working.
*/
ip6hdr
=
ipv6_hdr
(
skb
);
if
(
ipv6_addr_any
(
&
ip6hdr
->
saddr
))
{
do_tx_balance
=
0
;
break
;
}
hash_start
=
(
char
*
)
&
(
ipv6_hdr
(
skb
)
->
daddr
);
hash_size
=
sizeof
(
ipv6_hdr
(
skb
)
->
daddr
);
break
;
...
...
drivers/net/bonding/bond_main.c
浏览文件 @
152cbcf9
...
...
@@ -4493,6 +4493,12 @@ static void bond_ethtool_get_drvinfo(struct net_device *bond_dev,
static
const
struct
ethtool_ops
bond_ethtool_ops
=
{
.
get_drvinfo
=
bond_ethtool_get_drvinfo
,
.
get_link
=
ethtool_op_get_link
,
.
get_tx_csum
=
ethtool_op_get_tx_csum
,
.
get_sg
=
ethtool_op_get_sg
,
.
get_tso
=
ethtool_op_get_tso
,
.
get_ufo
=
ethtool_op_get_ufo
,
.
get_flags
=
ethtool_op_get_flags
,
};
/*
...
...
drivers/net/bonding/bonding.h
浏览文件 @
152cbcf9
...
...
@@ -32,7 +32,7 @@
#ifdef BONDING_DEBUG
#define dprintk(fmt, args...) \
printk(KERN_DEBUG \
DRV_NAME ": %s() %d: " fmt, __
FUNCTION
__, __LINE__ , ## args )
DRV_NAME ": %s() %d: " fmt, __
func
__, __LINE__ , ## args )
#else
#define dprintk(fmt, args...)
#endif
/* BONDING_DEBUG */
...
...
drivers/net/cs89x0.c
浏览文件 @
152cbcf9
...
...
@@ -1397,9 +1397,7 @@ net_open(struct net_device *dev)
release_dma:
#if ALLOW_DMA
free_dma
(
dev
->
dma
);
#endif
release_irq:
#if ALLOW_DMA
release_dma_buff
(
lp
);
#endif
writereg
(
dev
,
PP_LineCTL
,
readreg
(
dev
,
PP_LineCTL
)
&
~
(
SERIAL_TX_ON
|
SERIAL_RX_ON
));
...
...
drivers/net/cxgb3/cxgb3_offload.c
浏览文件 @
152cbcf9
...
...
@@ -1018,7 +1018,7 @@ static void set_l2t_ix(struct t3cdev *tdev, u32 tid, struct l2t_entry *e)
skb
=
alloc_skb
(
sizeof
(
*
req
),
GFP_ATOMIC
);
if
(
!
skb
)
{
printk
(
KERN_ERR
"%s: cannot allocate skb!
\n
"
,
__
FUNCTION
__
);
printk
(
KERN_ERR
"%s: cannot allocate skb!
\n
"
,
__
func
__
);
return
;
}
skb
->
priority
=
CPL_PRIORITY_CONTROL
;
...
...
@@ -1049,14 +1049,14 @@ void cxgb_redirect(struct dst_entry *old, struct dst_entry *new)
return
;
if
(
!
is_offloading
(
newdev
))
{
printk
(
KERN_WARNING
"%s: Redirect to non-offload "
"device ignored.
\n
"
,
__
FUNCTION
__
);
"device ignored.
\n
"
,
__
func
__
);
return
;
}
tdev
=
dev2t3cdev
(
olddev
);
BUG_ON
(
!
tdev
);
if
(
tdev
!=
dev2t3cdev
(
newdev
))
{
printk
(
KERN_WARNING
"%s: Redirect to different "
"offload device ignored.
\n
"
,
__
FUNCTION
__
);
"offload device ignored.
\n
"
,
__
func
__
);
return
;
}
...
...
@@ -1064,7 +1064,7 @@ void cxgb_redirect(struct dst_entry *old, struct dst_entry *new)
e
=
t3_l2t_get
(
tdev
,
new
->
neighbour
,
newdev
);
if
(
!
e
)
{
printk
(
KERN_ERR
"%s: couldn't allocate new l2t entry!
\n
"
,
__
FUNCTION
__
);
__
func
__
);
return
;
}
...
...
drivers/net/cxgb3/sge.c
浏览文件 @
152cbcf9
...
...
@@ -1937,38 +1937,6 @@ static inline int lro_frame_ok(const struct cpl_rx_pkt *p)
eh
->
h_proto
==
htons
(
ETH_P_IP
)
&&
ih
->
ihl
==
(
sizeof
(
*
ih
)
>>
2
);
}
#define TCP_FLAG_MASK (TCP_FLAG_CWR | TCP_FLAG_ECE | TCP_FLAG_URG |\
TCP_FLAG_ACK | TCP_FLAG_PSH | TCP_FLAG_RST |\
TCP_FLAG_SYN | TCP_FLAG_FIN)
#define TSTAMP_WORD ((TCPOPT_NOP << 24) | (TCPOPT_NOP << 16) |\
(TCPOPT_TIMESTAMP << 8) | TCPOLEN_TIMESTAMP)
/**
* lro_segment_ok - check if a TCP segment is eligible for LRO
* @tcph: the TCP header of the packet
*
* Returns true if a TCP packet is eligible for LRO. This requires that
* the packet have only the ACK flag set and no TCP options besides
* time stamps.
*/
static
inline
int
lro_segment_ok
(
const
struct
tcphdr
*
tcph
)
{
int
optlen
;
if
(
unlikely
((
tcp_flag_word
(
tcph
)
&
TCP_FLAG_MASK
)
!=
TCP_FLAG_ACK
))
return
0
;
optlen
=
(
tcph
->
doff
<<
2
)
-
sizeof
(
*
tcph
);
if
(
optlen
)
{
const
u32
*
opt
=
(
const
u32
*
)(
tcph
+
1
);
if
(
optlen
!=
TCPOLEN_TSTAMP_ALIGNED
||
*
opt
!=
htonl
(
TSTAMP_WORD
)
||
!
opt
[
2
])
return
0
;
}
return
1
;
}
static
int
t3_get_lro_header
(
void
**
eh
,
void
**
iph
,
void
**
tcph
,
u64
*
hdr_flags
,
void
*
priv
)
{
...
...
@@ -1981,9 +1949,6 @@ static int t3_get_lro_header(void **eh, void **iph, void **tcph,
*
iph
=
(
struct
iphdr
*
)((
struct
ethhdr
*
)
*
eh
+
1
);
*
tcph
=
(
struct
tcphdr
*
)((
struct
iphdr
*
)
*
iph
+
1
);
if
(
!
lro_segment_ok
(
*
tcph
))
return
-
1
;
*
hdr_flags
=
LRO_IPV4
|
LRO_TCP
;
return
0
;
}
...
...
drivers/net/e100.c
浏览文件 @
152cbcf9
...
...
@@ -191,7 +191,7 @@ MODULE_PARM_DESC(use_io, "Force use of i/o access mode");
#define DPRINTK(nlevel, klevel, fmt, args...) \
(void)((NETIF_MSG_##nlevel & nic->msg_enable) && \
printk(KERN_##klevel PFX "%s: %s: " fmt, nic->netdev->name, \
__
FUNCTION
__ , ## args))
__
func
__ , ## args))
#define INTEL_8255X_ETHERNET_DEVICE(device_id, ich) {\
PCI_VENDOR_ID_INTEL, device_id, PCI_ANY_ID, PCI_ANY_ID, \
...
...
drivers/net/ehea/ehea.h
浏览文件 @
152cbcf9
...
...
@@ -40,13 +40,13 @@
#include <asm/io.h>
#define DRV_NAME "ehea"
#define DRV_VERSION "EHEA_009
2
"
#define DRV_VERSION "EHEA_009
3
"
/* eHEA capability flags */
#define DLPAR_PORT_ADD_REM 1
#define DLPAR_MEM_ADD 2
#define DLPAR_MEM_REM 4
#define EHEA_CAPABILITIES (DLPAR_PORT_ADD_REM | DLPAR_MEM_ADD)
#define EHEA_CAPABILITIES (DLPAR_PORT_ADD_REM | DLPAR_MEM_ADD
| DLPAR_MEM_REM
)
#define EHEA_MSG_DEFAULT (NETIF_MSG_LINK | NETIF_MSG_TIMER \
| NETIF_MSG_RX_ERR | NETIF_MSG_TX_ERR)
...
...
drivers/net/ehea/ehea_main.c
浏览文件 @
152cbcf9
...
...
@@ -219,9 +219,11 @@ static void ehea_update_firmware_handles(void)
}
out_update:
mutex_lock
(
&
ehea_fw_handles
.
lock
);
kfree
(
ehea_fw_handles
.
arr
);
ehea_fw_handles
.
arr
=
arr
;
ehea_fw_handles
.
num_entries
=
i
;
mutex_unlock
(
&
ehea_fw_handles
.
lock
);
}
static
void
ehea_update_bcmc_registrations
(
void
)
...
...
@@ -293,9 +295,11 @@ static void ehea_update_bcmc_registrations(void)
}
out_update:
spin_lock
(
&
ehea_bcmc_regs
.
lock
);
kfree
(
ehea_bcmc_regs
.
arr
);
ehea_bcmc_regs
.
arr
=
arr
;
ehea_bcmc_regs
.
num_entries
=
i
;
spin_unlock
(
&
ehea_bcmc_regs
.
lock
);
}
static
struct
net_device_stats
*
ehea_get_stats
(
struct
net_device
*
dev
)
...
...
@@ -1770,8 +1774,6 @@ static int ehea_set_mac_addr(struct net_device *dev, void *sa)
memcpy
(
dev
->
dev_addr
,
mac_addr
->
sa_data
,
dev
->
addr_len
);
spin_lock
(
&
ehea_bcmc_regs
.
lock
);
/* Deregister old MAC in pHYP */
if
(
port
->
state
==
EHEA_PORT_UP
)
{
ret
=
ehea_broadcast_reg_helper
(
port
,
H_DEREG_BCMC
);
...
...
@@ -1792,7 +1794,6 @@ static int ehea_set_mac_addr(struct net_device *dev, void *sa)
out_upregs:
ehea_update_bcmc_registrations
();
spin_unlock
(
&
ehea_bcmc_regs
.
lock
);
out_free:
kfree
(
cb0
);
out:
...
...
@@ -1954,8 +1955,6 @@ static void ehea_set_multicast_list(struct net_device *dev)
}
ehea_promiscuous
(
dev
,
0
);
spin_lock
(
&
ehea_bcmc_regs
.
lock
);
if
(
dev
->
flags
&
IFF_ALLMULTI
)
{
ehea_allmulti
(
dev
,
1
);
goto
out
;
...
...
@@ -1985,7 +1984,6 @@ static void ehea_set_multicast_list(struct net_device *dev)
}
out:
ehea_update_bcmc_registrations
();
spin_unlock
(
&
ehea_bcmc_regs
.
lock
);
return
;
}
...
...
@@ -2466,8 +2464,6 @@ static int ehea_up(struct net_device *dev)
if
(
port
->
state
==
EHEA_PORT_UP
)
return
0
;
mutex_lock
(
&
ehea_fw_handles
.
lock
);
ret
=
ehea_port_res_setup
(
port
,
port
->
num_def_qps
,
port
->
num_add_tx_qps
);
if
(
ret
)
{
...
...
@@ -2504,8 +2500,6 @@ static int ehea_up(struct net_device *dev)
}
}
spin_lock
(
&
ehea_bcmc_regs
.
lock
);
ret
=
ehea_broadcast_reg_helper
(
port
,
H_REG_BCMC
);
if
(
ret
)
{
ret
=
-
EIO
;
...
...
@@ -2527,10 +2521,8 @@ static int ehea_up(struct net_device *dev)
ehea_info
(
"Failed starting %s. ret=%i"
,
dev
->
name
,
ret
);
ehea_update_bcmc_registrations
();
spin_unlock
(
&
ehea_bcmc_regs
.
lock
);
ehea_update_firmware_handles
();
mutex_unlock
(
&
ehea_fw_handles
.
lock
);
return
ret
;
}
...
...
@@ -2580,9 +2572,6 @@ static int ehea_down(struct net_device *dev)
if
(
port
->
state
==
EHEA_PORT_DOWN
)
return
0
;
mutex_lock
(
&
ehea_fw_handles
.
lock
);
spin_lock
(
&
ehea_bcmc_regs
.
lock
);
ehea_drop_multicast_list
(
dev
);
ehea_broadcast_reg_helper
(
port
,
H_DEREG_BCMC
);
...
...
@@ -2591,7 +2580,6 @@ static int ehea_down(struct net_device *dev)
port
->
state
=
EHEA_PORT_DOWN
;
ehea_update_bcmc_registrations
();
spin_unlock
(
&
ehea_bcmc_regs
.
lock
);
ret
=
ehea_clean_all_portres
(
port
);
if
(
ret
)
...
...
@@ -2599,7 +2587,6 @@ static int ehea_down(struct net_device *dev)
dev
->
name
,
ret
);
ehea_update_firmware_handles
();
mutex_unlock
(
&
ehea_fw_handles
.
lock
);
return
ret
;
}
...
...
@@ -3378,7 +3365,6 @@ static int __devinit ehea_probe_adapter(struct of_device *dev,
ehea_error
(
"Invalid ibmebus device probed"
);
return
-
EINVAL
;
}
mutex_lock
(
&
ehea_fw_handles
.
lock
);
adapter
=
kzalloc
(
sizeof
(
*
adapter
),
GFP_KERNEL
);
if
(
!
adapter
)
{
...
...
@@ -3462,7 +3448,6 @@ static int __devinit ehea_probe_adapter(struct of_device *dev,
out:
ehea_update_firmware_handles
();
mutex_unlock
(
&
ehea_fw_handles
.
lock
);
return
ret
;
}
...
...
@@ -3481,8 +3466,6 @@ static int __devexit ehea_remove(struct of_device *dev)
flush_scheduled_work
();
mutex_lock
(
&
ehea_fw_handles
.
lock
);
ibmebus_free_irq
(
adapter
->
neq
->
attr
.
ist1
,
adapter
);
tasklet_kill
(
&
adapter
->
neq_tasklet
);
...
...
@@ -3492,7 +3475,6 @@ static int __devexit ehea_remove(struct of_device *dev)
kfree
(
adapter
);
ehea_update_firmware_handles
();
mutex_unlock
(
&
ehea_fw_handles
.
lock
);
return
0
;
}
...
...
drivers/net/ehea/ehea_phyp.c
浏览文件 @
152cbcf9
...
...
@@ -535,7 +535,7 @@ u64 ehea_h_query_ehea(const u64 adapter_handle, void *cb_addr)
cb_logaddr
,
/* R5 */
0
,
0
,
0
,
0
,
0
);
/* R6-R10 */
#ifdef DEBUG
ehea_dmp
(
cb_addr
,
sizeof
(
struct
hcp_query_ehea
),
"hcp_query_ehea"
);
ehea_d
u
mp
(
cb_addr
,
sizeof
(
struct
hcp_query_ehea
),
"hcp_query_ehea"
);
#endif
return
hret
;
}
...
...
drivers/net/ehea/ehea_qmr.c
浏览文件 @
152cbcf9
...
...
@@ -595,7 +595,8 @@ static int ehea_create_busmap_callback(unsigned long pfn,
end_section
=
start_section
+
((
nr_pages
*
PAGE_SIZE
)
/
EHEA_SECTSIZE
);
mr_len
=
*
(
unsigned
long
*
)
arg
;
ehea_bmap
=
kzalloc
(
sizeof
(
struct
ehea_bmap
),
GFP_KERNEL
);
if
(
!
ehea_bmap
)
ehea_bmap
=
kzalloc
(
sizeof
(
struct
ehea_bmap
),
GFP_KERNEL
);
if
(
!
ehea_bmap
)
return
-
ENOMEM
;
...
...
drivers/net/enc28j60.c
浏览文件 @
152cbcf9
...
...
@@ -110,7 +110,7 @@ spi_read_buf(struct enc28j60_net *priv, int len, u8 *data)
}
if
(
ret
&&
netif_msg_drv
(
priv
))
printk
(
KERN_DEBUG
DRV_NAME
": %s() failed: ret = %d
\n
"
,
__
FUNCTION
__
,
ret
);
__
func
__
,
ret
);
return
ret
;
}
...
...
@@ -131,7 +131,7 @@ static int spi_write_buf(struct enc28j60_net *priv, int len,
ret
=
spi_write
(
priv
->
spi
,
priv
->
spi_transfer_buf
,
len
+
1
);
if
(
ret
&&
netif_msg_drv
(
priv
))
printk
(
KERN_DEBUG
DRV_NAME
": %s() failed: ret = %d
\n
"
,
__
FUNCTION
__
,
ret
);
__
func
__
,
ret
);
}
return
ret
;
}
...
...
@@ -156,7 +156,7 @@ static u8 spi_read_op(struct enc28j60_net *priv, u8 op,
ret
=
spi_write_then_read
(
priv
->
spi
,
tx_buf
,
1
,
rx_buf
,
slen
);
if
(
ret
)
printk
(
KERN_DEBUG
DRV_NAME
": %s() failed: ret = %d
\n
"
,
__
FUNCTION
__
,
ret
);
__
func
__
,
ret
);
else
val
=
rx_buf
[
slen
-
1
];
...
...
@@ -176,14 +176,14 @@ static int spi_write_op(struct enc28j60_net *priv, u8 op,
ret
=
spi_write
(
priv
->
spi
,
priv
->
spi_transfer_buf
,
2
);
if
(
ret
&&
netif_msg_drv
(
priv
))
printk
(
KERN_DEBUG
DRV_NAME
": %s() failed: ret = %d
\n
"
,
__
FUNCTION
__
,
ret
);
__
func
__
,
ret
);
return
ret
;
}
static
void
enc28j60_soft_reset
(
struct
enc28j60_net
*
priv
)
{
if
(
netif_msg_hw
(
priv
))
printk
(
KERN_DEBUG
DRV_NAME
": %s() enter
\n
"
,
__
FUNCTION
__
);
printk
(
KERN_DEBUG
DRV_NAME
": %s() enter
\n
"
,
__
func
__
);
spi_write_op
(
priv
,
ENC28J60_SOFT_RESET
,
0
,
ENC28J60_SOFT_RESET
);
/* Errata workaround #1, CLKRDY check is unreliable,
...
...
@@ -357,7 +357,7 @@ static void enc28j60_mem_read(struct enc28j60_net *priv,
reg
=
nolock_regw_read
(
priv
,
ERDPTL
);
if
(
reg
!=
addr
)
printk
(
KERN_DEBUG
DRV_NAME
": %s() error writing ERDPT "
"(0x%04x - 0x%04x)
\n
"
,
__
FUNCTION
__
,
reg
,
addr
);
"(0x%04x - 0x%04x)
\n
"
,
__
func
__
,
reg
,
addr
);
}
#endif
spi_read_buf
(
priv
,
len
,
data
);
...
...
@@ -380,7 +380,7 @@ enc28j60_packet_write(struct enc28j60_net *priv, int len, const u8 *data)
if
(
reg
!=
TXSTART_INIT
)
printk
(
KERN_DEBUG
DRV_NAME
": %s() ERWPT:0x%04x != 0x%04x
\n
"
,
__
FUNCTION
__
,
reg
,
TXSTART_INIT
);
__
func
__
,
reg
,
TXSTART_INIT
);
}
#endif
/* Set the TXND pointer to correspond to the packet size given */
...
...
@@ -390,13 +390,13 @@ enc28j60_packet_write(struct enc28j60_net *priv, int len, const u8 *data)
if
(
netif_msg_hw
(
priv
))
printk
(
KERN_DEBUG
DRV_NAME
": %s() after control byte ERWPT:0x%04x
\n
"
,
__
FUNCTION
__
,
nolock_regw_read
(
priv
,
EWRPTL
));
__
func
__
,
nolock_regw_read
(
priv
,
EWRPTL
));
/* copy the packet into the transmit buffer */
spi_write_buf
(
priv
,
len
,
data
);
if
(
netif_msg_hw
(
priv
))
printk
(
KERN_DEBUG
DRV_NAME
": %s() after write packet ERWPT:0x%04x, len=%d
\n
"
,
__
FUNCTION
__
,
nolock_regw_read
(
priv
,
EWRPTL
),
len
);
__
func
__
,
nolock_regw_read
(
priv
,
EWRPTL
),
len
);
mutex_unlock
(
&
priv
->
lock
);
}
...
...
@@ -495,7 +495,7 @@ static int enc28j60_set_hw_macaddr(struct net_device *ndev)
if
(
netif_msg_drv
(
priv
))
printk
(
KERN_DEBUG
DRV_NAME
": %s() Hardware must be disabled to set "
"Mac address
\n
"
,
__
FUNCTION
__
);
"Mac address
\n
"
,
__
func
__
);
ret
=
-
EBUSY
;
}
mutex_unlock
(
&
priv
->
lock
);
...
...
@@ -575,7 +575,7 @@ static void nolock_rxfifo_init(struct enc28j60_net *priv, u16 start, u16 end)
if
(
start
>
0x1FFF
||
end
>
0x1FFF
||
start
>
end
)
{
if
(
netif_msg_drv
(
priv
))
printk
(
KERN_ERR
DRV_NAME
": %s(%d, %d) RXFIFO "
"bad parameters!
\n
"
,
__
FUNCTION
__
,
start
,
end
);
"bad parameters!
\n
"
,
__
func
__
,
start
,
end
);
return
;
}
/* set receive buffer start + end */
...
...
@@ -591,7 +591,7 @@ static void nolock_txfifo_init(struct enc28j60_net *priv, u16 start, u16 end)
if
(
start
>
0x1FFF
||
end
>
0x1FFF
||
start
>
end
)
{
if
(
netif_msg_drv
(
priv
))
printk
(
KERN_ERR
DRV_NAME
": %s(%d, %d) TXFIFO "
"bad parameters!
\n
"
,
__
FUNCTION
__
,
start
,
end
);
"bad parameters!
\n
"
,
__
func
__
,
start
,
end
);
return
;
}
/* set transmit buffer start + end */
...
...
@@ -630,7 +630,7 @@ static int enc28j60_hw_init(struct enc28j60_net *priv)
u8
reg
;
if
(
netif_msg_drv
(
priv
))
printk
(
KERN_DEBUG
DRV_NAME
": %s() - %s
\n
"
,
__
FUNCTION
__
,
printk
(
KERN_DEBUG
DRV_NAME
": %s() - %s
\n
"
,
__
func
__
,
priv
->
full_duplex
?
"FullDuplex"
:
"HalfDuplex"
);
mutex_lock
(
&
priv
->
lock
);
...
...
@@ -661,7 +661,7 @@ static int enc28j60_hw_init(struct enc28j60_net *priv)
if
(
reg
==
0x00
||
reg
==
0xff
)
{
if
(
netif_msg_drv
(
priv
))
printk
(
KERN_DEBUG
DRV_NAME
": %s() Invalid RevId %d
\n
"
,
__
FUNCTION
__
,
reg
);
__
func
__
,
reg
);
return
0
;
}
...
...
@@ -724,7 +724,7 @@ static void enc28j60_hw_enable(struct enc28j60_net *priv)
/* enable interrupts */
if
(
netif_msg_hw
(
priv
))
printk
(
KERN_DEBUG
DRV_NAME
": %s() enabling interrupts.
\n
"
,
__
FUNCTION
__
);
__
func
__
);
enc28j60_phy_write
(
priv
,
PHIE
,
PHIE_PGEIE
|
PHIE_PLNKIE
);
...
...
@@ -888,7 +888,7 @@ static void enc28j60_hw_rx(struct net_device *ndev)
if
(
netif_msg_rx_err
(
priv
))
dev_err
(
&
ndev
->
dev
,
"%s() Invalid packet address!! 0x%04x
\n
"
,
__
FUNCTION
__
,
priv
->
next_pk_ptr
);
__
func
__
,
priv
->
next_pk_ptr
);
/* packet address corrupted: reset RX logic */
mutex_lock
(
&
priv
->
lock
);
nolock_reg_bfclr
(
priv
,
ECON1
,
ECON1_RXEN
);
...
...
@@ -917,7 +917,7 @@ static void enc28j60_hw_rx(struct net_device *ndev)
rxstat
|=
rsv
[
4
];
if
(
netif_msg_rx_status
(
priv
))
enc28j60_dump_rsv
(
priv
,
__
FUNCTION
__
,
next_packet
,
len
,
rxstat
);
enc28j60_dump_rsv
(
priv
,
__
func
__
,
next_packet
,
len
,
rxstat
);
if
(
!
RSV_GETBIT
(
rxstat
,
RSV_RXOK
))
{
if
(
netif_msg_rx_err
(
priv
))
...
...
@@ -941,7 +941,7 @@ static void enc28j60_hw_rx(struct net_device *ndev)
enc28j60_mem_read
(
priv
,
priv
->
next_pk_ptr
+
sizeof
(
rsv
),
len
,
skb_put
(
skb
,
len
));
if
(
netif_msg_pktdata
(
priv
))
dump_packet
(
__
FUNCTION
__
,
skb
->
len
,
skb
->
data
);
dump_packet
(
__
func
__
,
skb
->
len
,
skb
->
data
);
skb
->
protocol
=
eth_type_trans
(
skb
,
ndev
);
/* update statistics */
ndev
->
stats
.
rx_packets
++
;
...
...
@@ -958,7 +958,7 @@ static void enc28j60_hw_rx(struct net_device *ndev)
erxrdpt
=
erxrdpt_workaround
(
next_packet
,
RXSTART_INIT
,
RXEND_INIT
);
if
(
netif_msg_hw
(
priv
))
printk
(
KERN_DEBUG
DRV_NAME
": %s() ERXRDPT:0x%04x
\n
"
,
__
FUNCTION
__
,
erxrdpt
);
__
func
__
,
erxrdpt
);
mutex_lock
(
&
priv
->
lock
);
nolock_regw_write
(
priv
,
ERXRDPTL
,
erxrdpt
);
...
...
@@ -968,7 +968,7 @@ static void enc28j60_hw_rx(struct net_device *ndev)
reg
=
nolock_regw_read
(
priv
,
ERXRDPTL
);
if
(
reg
!=
erxrdpt
)
printk
(
KERN_DEBUG
DRV_NAME
": %s() ERXRDPT verify "
"error (0x%04x - 0x%04x)
\n
"
,
__
FUNCTION
__
,
"error (0x%04x - 0x%04x)
\n
"
,
__
func
__
,
reg
,
erxrdpt
);
}
#endif
...
...
@@ -1006,7 +1006,7 @@ static int enc28j60_get_free_rxfifo(struct enc28j60_net *priv)
mutex_unlock
(
&
priv
->
lock
);
if
(
netif_msg_rx_status
(
priv
))
printk
(
KERN_DEBUG
DRV_NAME
": %s() free_space = %d
\n
"
,
__
FUNCTION
__
,
free_space
);
__
func
__
,
free_space
);
return
free_space
;
}
...
...
@@ -1022,7 +1022,7 @@ static void enc28j60_check_link_status(struct net_device *ndev)
reg
=
enc28j60_phy_read
(
priv
,
PHSTAT2
);
if
(
netif_msg_hw
(
priv
))
printk
(
KERN_DEBUG
DRV_NAME
": %s() PHSTAT1: %04x, "
"PHSTAT2: %04x
\n
"
,
__
FUNCTION
__
,
"PHSTAT2: %04x
\n
"
,
__
func
__
,
enc28j60_phy_read
(
priv
,
PHSTAT1
),
reg
);
duplex
=
reg
&
PHSTAT2_DPXSTAT
;
...
...
@@ -1095,7 +1095,7 @@ static void enc28j60_irq_work_handler(struct work_struct *work)
int
intflags
,
loop
;
if
(
netif_msg_intr
(
priv
))
printk
(
KERN_DEBUG
DRV_NAME
": %s() enter
\n
"
,
__
FUNCTION
__
);
printk
(
KERN_DEBUG
DRV_NAME
": %s() enter
\n
"
,
__
func
__
);
/* disable further interrupts */
locked_reg_bfclr
(
priv
,
EIE
,
EIE_INTIE
);
...
...
@@ -1198,7 +1198,7 @@ static void enc28j60_irq_work_handler(struct work_struct *work)
/* re-enable interrupts */
locked_reg_bfset
(
priv
,
EIE
,
EIE_INTIE
);
if
(
netif_msg_intr
(
priv
))
printk
(
KERN_DEBUG
DRV_NAME
": %s() exit
\n
"
,
__
FUNCTION
__
);
printk
(
KERN_DEBUG
DRV_NAME
": %s() exit
\n
"
,
__
func
__
);
}
/*
...
...
@@ -1213,7 +1213,7 @@ static void enc28j60_hw_tx(struct enc28j60_net *priv)
": Tx Packet Len:%d
\n
"
,
priv
->
tx_skb
->
len
);
if
(
netif_msg_pktdata
(
priv
))
dump_packet
(
__
FUNCTION
__
,
dump_packet
(
__
func
__
,
priv
->
tx_skb
->
len
,
priv
->
tx_skb
->
data
);
enc28j60_packet_write
(
priv
,
priv
->
tx_skb
->
len
,
priv
->
tx_skb
->
data
);
...
...
@@ -1254,7 +1254,7 @@ static int enc28j60_send_packet(struct sk_buff *skb, struct net_device *dev)
struct
enc28j60_net
*
priv
=
netdev_priv
(
dev
);
if
(
netif_msg_tx_queued
(
priv
))
printk
(
KERN_DEBUG
DRV_NAME
": %s() enter
\n
"
,
__
FUNCTION
__
);
printk
(
KERN_DEBUG
DRV_NAME
": %s() enter
\n
"
,
__
func
__
);
/* If some error occurs while trying to transmit this
* packet, you should return '1' from this function.
...
...
@@ -1325,7 +1325,7 @@ static int enc28j60_net_open(struct net_device *dev)
struct
enc28j60_net
*
priv
=
netdev_priv
(
dev
);
if
(
netif_msg_drv
(
priv
))
printk
(
KERN_DEBUG
DRV_NAME
": %s() enter
\n
"
,
__
FUNCTION
__
);
printk
(
KERN_DEBUG
DRV_NAME
": %s() enter
\n
"
,
__
func
__
);
if
(
!
is_valid_ether_addr
(
dev
->
dev_addr
))
{
if
(
netif_msg_ifup
(
priv
))
{
...
...
@@ -1363,7 +1363,7 @@ static int enc28j60_net_close(struct net_device *dev)
struct
enc28j60_net
*
priv
=
netdev_priv
(
dev
);
if
(
netif_msg_drv
(
priv
))
printk
(
KERN_DEBUG
DRV_NAME
": %s() enter
\n
"
,
__
FUNCTION
__
);
printk
(
KERN_DEBUG
DRV_NAME
": %s() enter
\n
"
,
__
func
__
);
enc28j60_hw_disable
(
priv
);
enc28j60_lowpower
(
priv
,
true
);
...
...
drivers/net/ibm_newemac/phy.c
浏览文件 @
152cbcf9
...
...
@@ -321,7 +321,7 @@ static struct mii_phy_def bcm5248_phy_def = {
static
int
m88e1111_init
(
struct
mii_phy
*
phy
)
{
pr_debug
(
"%s: Marvell 88E1111 Ethernet
\n
"
,
__
FUNCTION
__
);
pr_debug
(
"%s: Marvell 88E1111 Ethernet
\n
"
,
__
func
__
);
phy_write
(
phy
,
0x14
,
0x0ce3
);
phy_write
(
phy
,
0x18
,
0x4101
);
phy_write
(
phy
,
0x09
,
0x0e00
);
...
...
drivers/net/ixgb/ixgb.h
浏览文件 @
152cbcf9
...
...
@@ -85,7 +85,7 @@ struct ixgb_adapter;
#define DPRINTK(nlevel, klevel, fmt, args...) \
(void)((NETIF_MSG_##nlevel & adapter->msg_enable) && \
printk(KERN_##klevel PFX "%s: %s: " fmt, adapter->netdev->name, \
__
FUNCTION
__ , ## args))
__
func
__ , ## args))
/* TX/RX descriptor defines */
...
...
drivers/net/ixgbe/ixgbe.h
浏览文件 @
152cbcf9
/*******************************************************************************
Intel 10 Gigabit PCI Express Linux driver
Copyright(c) 1999 - 200
7
Intel Corporation.
Copyright(c) 1999 - 200
8
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,
...
...
@@ -20,7 +20,6 @@
the file called "COPYING".
Contact Information:
Linux NICS <linux.nics@intel.com>
e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
...
...
@@ -41,13 +40,11 @@
#include <linux/dca.h>
#endif
#define IXGBE_ERR(args...) printk(KERN_ERR "ixgbe: " args)
#define PFX "ixgbe: "
#define DPRINTK(nlevel, klevel, fmt, args...) \
((void)((NETIF_MSG_##nlevel & adapter->msg_enable) && \
printk(KERN_##klevel PFX "%s: %s: " fmt, adapter->netdev->name, \
__
FUNCTION
__ , ## args)))
__
func
__ , ## args)))
/* TX/RX descriptor defines */
#define IXGBE_DEFAULT_TXD 1024
...
...
@@ -58,15 +55,6 @@
#define IXGBE_MAX_RXD 4096
#define IXGBE_MIN_RXD 64
#define IXGBE_DEFAULT_RXQ 1
#define IXGBE_MAX_RXQ 1
#define IXGBE_MIN_RXQ 1
#define IXGBE_DEFAULT_ITR_RX_USECS 125
/* 8k irqs/sec */
#define IXGBE_DEFAULT_ITR_TX_USECS 250
/* 4k irqs/sec */
#define IXGBE_MIN_ITR_USECS 100
/* 500k irqs/sec */
#define IXGBE_MAX_ITR_USECS 10000
/* 100 irqs/sec */
/* flow control */
#define IXGBE_DEFAULT_FCRTL 0x10000
#define IXGBE_MIN_FCRTL 0x40
...
...
@@ -88,9 +76,6 @@
#define MAXIMUM_ETHERNET_VLAN_SIZE (ETH_FRAME_LEN + ETH_FCS_LEN + VLAN_HLEN)
/* How many Tx Descriptors do we need to call netif_wake_queue? */
#define IXGBE_TX_QUEUE_WAKE 16
/* How many Rx Buffers do we bundle into one write to the hardware ? */
#define IXGBE_RX_BUFFER_WRITE 16
/* Must be power of 2 */
...
...
@@ -119,6 +104,7 @@ struct ixgbe_rx_buffer {
dma_addr_t
dma
;
struct
page
*
page
;
dma_addr_t
page_dma
;
unsigned
int
page_offset
;
};
struct
ixgbe_queue_stats
{
...
...
@@ -157,14 +143,11 @@ struct ixgbe_ring {
struct
net_lro_mgr
lro_mgr
;
bool
lro_used
;
struct
ixgbe_queue_stats
stats
;
u
8
v_idx
;
/* maps directly to the index for this ring in the hardware
* vector array, can also be used for finding the bit in EICR
* and friends that represents the vector for this ring */
u
16
v_idx
;
/* maps directly to the index for this ring in the hardware
* vector array, can also be used for finding the bit in EICR
* and friends that represents the vector for this ring */
u32
eims_value
;
u16
itr_register
;
char
name
[
IFNAMSIZ
+
5
];
u16
work_limit
;
/* max work per interrupt */
u16
rx_buf_len
;
};
...
...
@@ -191,8 +174,8 @@ struct ixgbe_q_vector {
DECLARE_BITMAP
(
txr_idx
,
MAX_TX_QUEUES
);
/* Tx ring indices */
u8
rxr_count
;
/* Rx ring count assigned to this vector */
u8
txr_count
;
/* Tx ring count assigned to this vector */
u8
tx_
e
itr
;
u8
rx_
e
itr
;
u8
tx_itr
;
u8
rx_itr
;
u32
eitr
;
};
...
...
@@ -240,7 +223,9 @@ struct ixgbe_adapter {
/* TX */
struct
ixgbe_ring
*
tx_ring
;
/* One per active queue */
int
num_tx_queues
;
u64
restart_queue
;
u64
hw_csum_tx_good
;
u64
lsc_int
;
u64
hw_tso_ctxt
;
u64
hw_tso6_ctxt
;
...
...
@@ -249,12 +234,10 @@ struct ixgbe_adapter {
/* RX */
struct
ixgbe_ring
*
rx_ring
;
/* One per active queue */
u64
hw_csum_tx_good
;
int
num_rx_queues
;
u64
hw_csum_rx_error
;
u64
hw_csum_rx_good
;
u64
non_eop_descs
;
int
num_tx_queues
;
int
num_rx_queues
;
int
num_msix_vectors
;
struct
ixgbe_ring_feature
ring_feature
[
3
];
struct
msix_entry
*
msix_entries
;
...
...
@@ -301,14 +284,21 @@ struct ixgbe_adapter {
struct
ixgbe_hw_stats
stats
;
/* Interrupt Throttle Rate */
u32
rx_eitr
;
u32
tx_eitr
;
u32
eitr_param
;
unsigned
long
state
;
u64
tx_busy
;
u64
lro_aggregated
;
u64
lro_flushed
;
u64
lro_no_desc
;
unsigned
int
tx_ring_count
;
unsigned
int
rx_ring_count
;
u32
link_speed
;
bool
link_up
;
unsigned
long
link_check_timeout
;
struct
work_struct
watchdog_task
;
};
enum
ixbge_state_t
{
...
...
@@ -330,11 +320,11 @@ extern int ixgbe_up(struct ixgbe_adapter *adapter);
extern
void
ixgbe_down
(
struct
ixgbe_adapter
*
adapter
);
extern
void
ixgbe_reinit_locked
(
struct
ixgbe_adapter
*
adapter
);
extern
void
ixgbe_reset
(
struct
ixgbe_adapter
*
adapter
);
extern
void
ixgbe_update_stats
(
struct
ixgbe_adapter
*
adapter
);
extern
void
ixgbe_set_ethtool_ops
(
struct
net_device
*
netdev
);
extern
int
ixgbe_setup_rx_resources
(
struct
ixgbe_adapter
*
adapter
,
struct
ixgbe_ring
*
rxdr
);
extern
int
ixgbe_setup_tx_resources
(
struct
ixgbe_adapter
*
adapter
,
struct
ixgbe_ring
*
txdr
);
extern
int
ixgbe_setup_rx_resources
(
struct
ixgbe_adapter
*
,
struct
ixgbe_ring
*
);
extern
int
ixgbe_setup_tx_resources
(
struct
ixgbe_adapter
*
,
struct
ixgbe_ring
*
);
extern
void
ixgbe_free_rx_resources
(
struct
ixgbe_adapter
*
,
struct
ixgbe_ring
*
);
extern
void
ixgbe_free_tx_resources
(
struct
ixgbe_adapter
*
,
struct
ixgbe_ring
*
);
extern
void
ixgbe_update_stats
(
struct
ixgbe_adapter
*
adapter
);
#endif
/* _IXGBE_H_ */
drivers/net/ixgbe/ixgbe_82598.c
浏览文件 @
152cbcf9
此差异已折叠。
点击以展开。
drivers/net/ixgbe/ixgbe_common.c
浏览文件 @
152cbcf9
此差异已折叠。
点击以展开。
drivers/net/ixgbe/ixgbe_common.h
浏览文件 @
152cbcf9
/*******************************************************************************
Intel 10 Gigabit PCI Express Linux driver
Copyright(c) 1999 - 200
7
Intel Corporation.
Copyright(c) 1999 - 200
8
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,
...
...
@@ -20,7 +20,6 @@
the file called "COPYING".
Contact Information:
Linux NICS <linux.nics@intel.com>
e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
...
...
@@ -31,36 +30,45 @@
#include "ixgbe_type.h"
s32
ixgbe_init_hw
(
struct
ixgbe_hw
*
hw
);
s32
ixgbe_start_hw
(
struct
ixgbe_hw
*
hw
);
s32
ixgbe_get_mac_addr
(
struct
ixgbe_hw
*
hw
,
u8
*
mac_addr
);
s32
ixgbe_stop_adapter
(
struct
ixgbe_hw
*
hw
);
s32
ixgbe_read_part_num
(
struct
ixgbe_hw
*
hw
,
u32
*
part_num
);
s32
ixgbe_led_on
(
struct
ixgbe_hw
*
hw
,
u32
index
);
s32
ixgbe_led_off
(
struct
ixgbe_hw
*
hw
,
u32
index
);
s32
ixgbe_init_eeprom
(
struct
ixgbe_hw
*
hw
);
s32
ixgbe_read_eeprom
(
struct
ixgbe_hw
*
hw
,
u16
offset
,
u16
*
data
);
s32
ixgbe_validate_eeprom_checksum
(
struct
ixgbe_hw
*
hw
,
u16
*
checksum_val
);
s32
ixgbe_set_rar
(
struct
ixgbe_hw
*
hw
,
u32
index
,
u8
*
addr
,
u32
vind
,
u32
enable_addr
);
s32
ixgbe_update_mc_addr_list
(
struct
ixgbe_hw
*
hw
,
u8
*
mc_addr_list
,
u32
mc_addr_count
,
ixgbe_mc_addr_itr
next
);
s32
ixgbe_update_uc_addr_list
(
struct
ixgbe_hw
*
hw
,
u8
*
uc_addr_list
,
u32
mc_addr_count
,
ixgbe_mc_addr_itr
next
);
s32
ixgbe_set_vfta
(
struct
ixgbe_hw
*
hw
,
u32
vlan
,
u32
vind
,
bool
vlan_on
);
s32
ixgbe_validate_mac_addr
(
u8
*
mac_addr
);
s32
ixgbe_setup_fc
(
struct
ixgbe_hw
*
hw
,
s32
packtetbuf_num
);
s32
ixgbe_init_ops_generic
(
struct
ixgbe_hw
*
hw
);
s32
ixgbe_init_hw_generic
(
struct
ixgbe_hw
*
hw
);
s32
ixgbe_start_hw_generic
(
struct
ixgbe_hw
*
hw
);
s32
ixgbe_clear_hw_cntrs_generic
(
struct
ixgbe_hw
*
hw
);
s32
ixgbe_read_pba_num_generic
(
struct
ixgbe_hw
*
hw
,
u32
*
pba_num
);
s32
ixgbe_get_mac_addr_generic
(
struct
ixgbe_hw
*
hw
,
u8
*
mac_addr
);
s32
ixgbe_get_bus_info_generic
(
struct
ixgbe_hw
*
hw
);
s32
ixgbe_stop_adapter_generic
(
struct
ixgbe_hw
*
hw
);
s32
ixgbe_led_on_generic
(
struct
ixgbe_hw
*
hw
,
u32
index
);
s32
ixgbe_led_off_generic
(
struct
ixgbe_hw
*
hw
,
u32
index
);
s32
ixgbe_init_eeprom_params_generic
(
struct
ixgbe_hw
*
hw
);
s32
ixgbe_read_eeprom_generic
(
struct
ixgbe_hw
*
hw
,
u16
offset
,
u16
*
data
);
s32
ixgbe_read_eeprom_bit_bang_generic
(
struct
ixgbe_hw
*
hw
,
u16
offset
,
u16
*
data
);
s32
ixgbe_validate_eeprom_checksum_generic
(
struct
ixgbe_hw
*
hw
,
u16
*
checksum_val
);
s32
ixgbe_update_eeprom_checksum_generic
(
struct
ixgbe_hw
*
hw
);
s32
ixgbe_set_rar_generic
(
struct
ixgbe_hw
*
hw
,
u32
index
,
u8
*
addr
,
u32
vmdq
,
u32
enable_addr
);
s32
ixgbe_clear_rar_generic
(
struct
ixgbe_hw
*
hw
,
u32
index
);
s32
ixgbe_init_rx_addrs_generic
(
struct
ixgbe_hw
*
hw
);
s32
ixgbe_update_mc_addr_list_generic
(
struct
ixgbe_hw
*
hw
,
u8
*
mc_addr_list
,
u32
mc_addr_count
,
ixgbe_mc_addr_itr
func
);
s32
ixgbe_update_uc_addr_list_generic
(
struct
ixgbe_hw
*
hw
,
u8
*
addr_list
,
u32
addr_count
,
ixgbe_mc_addr_itr
func
);
s32
ixgbe_enable_mc_generic
(
struct
ixgbe_hw
*
hw
);
s32
ixgbe_disable_mc_generic
(
struct
ixgbe_hw
*
hw
);
s32
ixgbe_validate_mac_addr
(
u8
*
mac_addr
);
s32
ixgbe_acquire_swfw_sync
(
struct
ixgbe_hw
*
hw
,
u16
mask
);
void
ixgbe_release_swfw_sync
(
struct
ixgbe_hw
*
hw
,
u16
mask
);
s32
ixgbe_disable_pcie_master
(
struct
ixgbe_hw
*
hw
);
s32
ixgbe_read_analog_reg8
(
struct
ixgbe_hw
*
hw
,
u32
reg
,
u8
*
val
);
s32
ixgbe_write_analog_reg8
(
struct
ixgbe_hw
*
hw
,
u32
reg
,
u8
val
);
s32
ixgbe_read_analog_reg8
_generic
(
struct
ixgbe_hw
*
hw
,
u32
reg
,
u8
*
val
);
s32
ixgbe_write_analog_reg8
_generic
(
struct
ixgbe_hw
*
hw
,
u32
reg
,
u8
val
);
#define IXGBE_WRITE_REG(a, reg, value) writel((value), ((a)->hw_addr + (reg)))
...
...
drivers/net/ixgbe/ixgbe_ethtool.c
浏览文件 @
152cbcf9
此差异已折叠。
点击以展开。
drivers/net/ixgbe/ixgbe_main.c
浏览文件 @
152cbcf9
此差异已折叠。
点击以展开。
drivers/net/ixgbe/ixgbe_phy.c
浏览文件 @
152cbcf9
/*******************************************************************************
Intel 10 Gigabit PCI Express Linux driver
Copyright(c) 1999 - 200
7
Intel Corporation.
Copyright(c) 1999 - 200
8
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,
...
...
@@ -20,7 +20,6 @@
the file called "COPYING".
Contact Information:
Linux NICS <linux.nics@intel.com>
e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
...
...
@@ -33,32 +32,36 @@
#include "ixgbe_common.h"
#include "ixgbe_phy.h"
static
bool
ixgbe_validate_phy_addr
(
struct
ixgbe_hw
*
hw
,
u32
phy_addr
);
static
enum
ixgbe_phy_type
ixgbe_get_phy_type_from_id
(
u32
phy_id
);
static
s32
ixgbe_get_phy_id
(
struct
ixgbe_hw
*
hw
);
static
bool
ixgbe_validate_phy_addr
(
struct
ixgbe_hw
*
hw
,
u32
phy_addr
);
static
s32
ixgbe_write_phy_reg
(
struct
ixgbe_hw
*
hw
,
u32
reg_addr
,
u32
device_type
,
u16
phy_data
);
/**
* ixgbe_identify_phy - Get physical layer module
* ixgbe_identify_phy
_generic
- Get physical layer module
* @hw: pointer to hardware structure
*
* Determines the physical layer module found on the current adapter.
**/
s32
ixgbe_identify_phy
(
struct
ixgbe_hw
*
hw
)
s32
ixgbe_identify_phy
_generic
(
struct
ixgbe_hw
*
hw
)
{
s32
status
=
IXGBE_ERR_PHY_ADDR_INVALID
;
u32
phy_addr
;
for
(
phy_addr
=
0
;
phy_addr
<
IXGBE_MAX_PHY_ADDR
;
phy_addr
++
)
{
if
(
ixgbe_validate_phy_addr
(
hw
,
phy_addr
))
{
hw
->
phy
.
addr
=
phy_addr
;
ixgbe_get_phy_id
(
hw
);
hw
->
phy
.
type
=
ixgbe_get_phy_type_from_id
(
hw
->
phy
.
id
);
status
=
0
;
break
;
if
(
hw
->
phy
.
type
==
ixgbe_phy_unknown
)
{
for
(
phy_addr
=
0
;
phy_addr
<
IXGBE_MAX_PHY_ADDR
;
phy_addr
++
)
{
if
(
ixgbe_validate_phy_addr
(
hw
,
phy_addr
))
{
hw
->
phy
.
addr
=
phy_addr
;
ixgbe_get_phy_id
(
hw
);
hw
->
phy
.
type
=
ixgbe_get_phy_type_from_id
(
hw
->
phy
.
id
);
status
=
0
;
break
;
}
}
}
else
{
status
=
0
;
}
return
status
;
}
...
...
@@ -73,10 +76,8 @@ static bool ixgbe_validate_phy_addr(struct ixgbe_hw *hw, u32 phy_addr)
bool
valid
=
false
;
hw
->
phy
.
addr
=
phy_addr
;
ixgbe_read_phy_reg
(
hw
,
IXGBE_MDIO_PHY_ID_HIGH
,
IXGBE_MDIO_PMA_PMD_DEV_TYPE
,
&
phy_id
);
hw
->
phy
.
ops
.
read_reg
(
hw
,
IXGBE_MDIO_PHY_ID_HIGH
,
IXGBE_MDIO_PMA_PMD_DEV_TYPE
,
&
phy_id
);
if
(
phy_id
!=
0xFFFF
&&
phy_id
!=
0x0
)
valid
=
true
;
...
...
@@ -95,21 +96,18 @@ static s32 ixgbe_get_phy_id(struct ixgbe_hw *hw)
u16
phy_id_high
=
0
;
u16
phy_id_low
=
0
;
status
=
ixgbe_read_phy_reg
(
hw
,
IXGBE_MDIO_PHY_ID_HIGH
,
IXGBE_MDIO_PMA_PMD_DEV_TYPE
,
&
phy_id_high
);
status
=
hw
->
phy
.
ops
.
read_reg
(
hw
,
IXGBE_MDIO_PHY_ID_HIGH
,
IXGBE_MDIO_PMA_PMD_DEV_TYPE
,
&
phy_id_high
);
if
(
status
==
0
)
{
hw
->
phy
.
id
=
(
u32
)(
phy_id_high
<<
16
);
status
=
ixgbe_read_phy_reg
(
hw
,
IXGBE_MDIO_PHY_ID_LOW
,
IXGBE_MDIO_PMA_PMD_DEV_TYPE
,
&
phy_id_low
);
status
=
hw
->
phy
.
ops
.
read_reg
(
hw
,
IXGBE_MDIO_PHY_ID_LOW
,
IXGBE_MDIO_PMA_PMD_DEV_TYPE
,
&
phy_id_low
);
hw
->
phy
.
id
|=
(
u32
)(
phy_id_low
&
IXGBE_PHY_REVISION_MASK
);
hw
->
phy
.
revision
=
(
u32
)(
phy_id_low
&
~
IXGBE_PHY_REVISION_MASK
);
}
return
status
;
}
...
...
@@ -123,9 +121,6 @@ static enum ixgbe_phy_type ixgbe_get_phy_type_from_id(u32 phy_id)
enum
ixgbe_phy_type
phy_type
;
switch
(
phy_id
)
{
case
TN1010_PHY_ID
:
phy_type
=
ixgbe_phy_tn
;
break
;
case
QT2022_PHY_ID
:
phy_type
=
ixgbe_phy_qt
;
break
;
...
...
@@ -138,32 +133,31 @@ static enum ixgbe_phy_type ixgbe_get_phy_type_from_id(u32 phy_id)
}
/**
* ixgbe_reset_phy - Performs a PHY reset
* ixgbe_reset_phy
_generic
- Performs a PHY reset
* @hw: pointer to hardware structure
**/
s32
ixgbe_reset_phy
(
struct
ixgbe_hw
*
hw
)
s32
ixgbe_reset_phy
_generic
(
struct
ixgbe_hw
*
hw
)
{
/*
* Perform soft PHY reset to the PHY_XS.
* This will cause a soft reset to the PHY
*/
return
ixgbe_write_phy
_reg
(
hw
,
IXGBE_MDIO_PHY_XS_CONTROL
,
IXGBE_MDIO_PHY_XS_DEV_TYPE
,
IXGBE_MDIO_PHY_XS_RESET
);
return
hw
->
phy
.
ops
.
write
_reg
(
hw
,
IXGBE_MDIO_PHY_XS_CONTROL
,
IXGBE_MDIO_PHY_XS_DEV_TYPE
,
IXGBE_MDIO_PHY_XS_RESET
);
}
/**
* ixgbe_read_phy_reg - Reads a value from a specified PHY register
* ixgbe_read_phy_reg
_generic
- Reads a value from a specified PHY register
* @hw: pointer to hardware structure
* @reg_addr: 32 bit address of PHY register to read
* @phy_data: Pointer to read data from PHY register
**/
s32
ixgbe_read_phy_reg
(
struct
ixgbe_hw
*
hw
,
u32
reg_addr
,
u32
device_type
,
u16
*
phy_data
)
s32
ixgbe_read_phy_reg
_generic
(
struct
ixgbe_hw
*
hw
,
u32
reg_addr
,
u32
device_type
,
u16
*
phy_data
)
{
u32
command
;
u32
i
;
u32
timeout
=
10
;
u32
data
;
s32
status
=
0
;
u16
gssr
;
...
...
@@ -179,9 +173,9 @@ s32 ixgbe_read_phy_reg(struct ixgbe_hw *hw, u32 reg_addr,
if
(
status
==
0
)
{
/* Setup and write the address cycle command */
command
=
((
reg_addr
<<
IXGBE_MSCA_NP_ADDR_SHIFT
)
|
(
device_type
<<
IXGBE_MSCA_DEV_TYPE_SHIFT
)
|
(
hw
->
phy
.
addr
<<
IXGBE_MSCA_PHY_ADDR_SHIFT
)
|
(
IXGBE_MSCA_ADDR_CYCLE
|
IXGBE_MSCA_MDI_COMMAND
));
(
device_type
<<
IXGBE_MSCA_DEV_TYPE_SHIFT
)
|
(
hw
->
phy
.
addr
<<
IXGBE_MSCA_PHY_ADDR_SHIFT
)
|
(
IXGBE_MSCA_ADDR_CYCLE
|
IXGBE_MSCA_MDI_COMMAND
));
IXGBE_WRITE_REG
(
hw
,
IXGBE_MSCA
,
command
);
...
...
@@ -190,7 +184,7 @@ s32 ixgbe_read_phy_reg(struct ixgbe_hw *hw, u32 reg_addr,
* The MDI Command bit will clear when the operation is
* complete
*/
for
(
i
=
0
;
i
<
timeout
;
i
++
)
{
for
(
i
=
0
;
i
<
IXGBE_MDIO_COMMAND_TIMEOUT
;
i
++
)
{
udelay
(
10
);
command
=
IXGBE_READ_REG
(
hw
,
IXGBE_MSCA
);
...
...
@@ -210,9 +204,9 @@ s32 ixgbe_read_phy_reg(struct ixgbe_hw *hw, u32 reg_addr,
* command
*/
command
=
((
reg_addr
<<
IXGBE_MSCA_NP_ADDR_SHIFT
)
|
(
device_type
<<
IXGBE_MSCA_DEV_TYPE_SHIFT
)
|
(
hw
->
phy
.
addr
<<
IXGBE_MSCA_PHY_ADDR_SHIFT
)
|
(
IXGBE_MSCA_READ
|
IXGBE_MSCA_MDI_COMMAND
));
(
device_type
<<
IXGBE_MSCA_DEV_TYPE_SHIFT
)
|
(
hw
->
phy
.
addr
<<
IXGBE_MSCA_PHY_ADDR_SHIFT
)
|
(
IXGBE_MSCA_READ
|
IXGBE_MSCA_MDI_COMMAND
));
IXGBE_WRITE_REG
(
hw
,
IXGBE_MSCA
,
command
);
...
...
@@ -221,7 +215,7 @@ s32 ixgbe_read_phy_reg(struct ixgbe_hw *hw, u32 reg_addr,
* completed. The MDI Command bit will clear when the
* operation is complete
*/
for
(
i
=
0
;
i
<
timeout
;
i
++
)
{
for
(
i
=
0
;
i
<
IXGBE_MDIO_COMMAND_TIMEOUT
;
i
++
)
{
udelay
(
10
);
command
=
IXGBE_READ_REG
(
hw
,
IXGBE_MSCA
);
...
...
@@ -231,8 +225,7 @@ s32 ixgbe_read_phy_reg(struct ixgbe_hw *hw, u32 reg_addr,
}
if
((
command
&
IXGBE_MSCA_MDI_COMMAND
)
!=
0
)
{
hw_dbg
(
hw
,
"PHY read command didn't complete
\n
"
);
hw_dbg
(
hw
,
"PHY read command didn't complete
\n
"
);
status
=
IXGBE_ERR_PHY
;
}
else
{
/*
...
...
@@ -247,22 +240,22 @@ s32 ixgbe_read_phy_reg(struct ixgbe_hw *hw, u32 reg_addr,
ixgbe_release_swfw_sync
(
hw
,
gssr
);
}
return
status
;
}
/**
* ixgbe_write_phy_reg - Writes a value to specified PHY register
* ixgbe_write_phy_reg
_generic
- Writes a value to specified PHY register
* @hw: pointer to hardware structure
* @reg_addr: 32 bit PHY register to write
* @device_type: 5 bit device type
* @phy_data: Data to write to the PHY register
**/
s
tatic
s32
ixgbe_write_phy_reg
(
struct
ixgbe_hw
*
hw
,
u32
reg_addr
,
u32
device_type
,
u16
phy_data
)
s
32
ixgbe_write_phy_reg_generic
(
struct
ixgbe_hw
*
hw
,
u32
reg_addr
,
u32
device_type
,
u16
phy_data
)
{
u32
command
;
u32
i
;
u32
timeout
=
10
;
s32
status
=
0
;
u16
gssr
;
...
...
@@ -280,9 +273,9 @@ static s32 ixgbe_write_phy_reg(struct ixgbe_hw *hw, u32 reg_addr,
/* Setup and write the address cycle command */
command
=
((
reg_addr
<<
IXGBE_MSCA_NP_ADDR_SHIFT
)
|
(
device_type
<<
IXGBE_MSCA_DEV_TYPE_SHIFT
)
|
(
hw
->
phy
.
addr
<<
IXGBE_MSCA_PHY_ADDR_SHIFT
)
|
(
IXGBE_MSCA_ADDR_CYCLE
|
IXGBE_MSCA_MDI_COMMAND
));
(
device_type
<<
IXGBE_MSCA_DEV_TYPE_SHIFT
)
|
(
hw
->
phy
.
addr
<<
IXGBE_MSCA_PHY_ADDR_SHIFT
)
|
(
IXGBE_MSCA_ADDR_CYCLE
|
IXGBE_MSCA_MDI_COMMAND
));
IXGBE_WRITE_REG
(
hw
,
IXGBE_MSCA
,
command
);
...
...
@@ -291,19 +284,19 @@ static s32 ixgbe_write_phy_reg(struct ixgbe_hw *hw, u32 reg_addr,
* The MDI Command bit will clear when the operation is
* complete
*/
for
(
i
=
0
;
i
<
timeout
;
i
++
)
{
for
(
i
=
0
;
i
<
IXGBE_MDIO_COMMAND_TIMEOUT
;
i
++
)
{
udelay
(
10
);
command
=
IXGBE_READ_REG
(
hw
,
IXGBE_MSCA
);
if
((
command
&
IXGBE_MSCA_MDI_COMMAND
)
==
0
)
{
hw_dbg
(
hw
,
"PHY address cmd didn't complete
\n
"
);
if
((
command
&
IXGBE_MSCA_MDI_COMMAND
)
==
0
)
break
;
}
}
if
((
command
&
IXGBE_MSCA_MDI_COMMAND
)
!=
0
)
if
((
command
&
IXGBE_MSCA_MDI_COMMAND
)
!=
0
)
{
hw_dbg
(
hw
,
"PHY address cmd didn't complete
\n
"
);
status
=
IXGBE_ERR_PHY
;
}
if
(
status
==
0
)
{
/*
...
...
@@ -311,9 +304,9 @@ static s32 ixgbe_write_phy_reg(struct ixgbe_hw *hw, u32 reg_addr,
* command
*/
command
=
((
reg_addr
<<
IXGBE_MSCA_NP_ADDR_SHIFT
)
|
(
device_type
<<
IXGBE_MSCA_DEV_TYPE_SHIFT
)
|
(
hw
->
phy
.
addr
<<
IXGBE_MSCA_PHY_ADDR_SHIFT
)
|
(
IXGBE_MSCA_WRITE
|
IXGBE_MSCA_MDI_COMMAND
));
(
device_type
<<
IXGBE_MSCA_DEV_TYPE_SHIFT
)
|
(
hw
->
phy
.
addr
<<
IXGBE_MSCA_PHY_ADDR_SHIFT
)
|
(
IXGBE_MSCA_WRITE
|
IXGBE_MSCA_MDI_COMMAND
));
IXGBE_WRITE_REG
(
hw
,
IXGBE_MSCA
,
command
);
...
...
@@ -322,20 +315,19 @@ static s32 ixgbe_write_phy_reg(struct ixgbe_hw *hw, u32 reg_addr,
* completed. The MDI Command bit will clear when the
* operation is complete
*/
for
(
i
=
0
;
i
<
timeout
;
i
++
)
{
for
(
i
=
0
;
i
<
IXGBE_MDIO_COMMAND_TIMEOUT
;
i
++
)
{
udelay
(
10
);
command
=
IXGBE_READ_REG
(
hw
,
IXGBE_MSCA
);
if
((
command
&
IXGBE_MSCA_MDI_COMMAND
)
==
0
)
{
hw_dbg
(
hw
,
"PHY write command did not "
"complete.
\n
"
);
if
((
command
&
IXGBE_MSCA_MDI_COMMAND
)
==
0
)
break
;
}
}
if
((
command
&
IXGBE_MSCA_MDI_COMMAND
)
!=
0
)
if
((
command
&
IXGBE_MSCA_MDI_COMMAND
)
!=
0
)
{
hw_dbg
(
hw
,
"PHY address cmd didn't complete
\n
"
);
status
=
IXGBE_ERR_PHY
;
}
}
ixgbe_release_swfw_sync
(
hw
,
gssr
);
...
...
@@ -345,67 +337,54 @@ static s32 ixgbe_write_phy_reg(struct ixgbe_hw *hw, u32 reg_addr,
}
/**
* ixgbe_setup_
tnx_phy_link
- Set and restart autoneg
* ixgbe_setup_
phy_link_generic
- Set and restart autoneg
* @hw: pointer to hardware structure
*
* Restart autonegotiation and PHY and waits for completion.
**/
s32
ixgbe_setup_
tnx_phy_link
(
struct
ixgbe_hw
*
hw
)
s32
ixgbe_setup_
phy_link_generic
(
struct
ixgbe_hw
*
hw
)
{
s32
status
=
IXGBE_NOT_IMPLEMENTED
;
u32
time_out
;
u32
max_time_out
=
10
;
u16
autoneg_speed_selection_register
=
0x10
;
u16
autoneg_restart_mask
=
0x0200
;
u16
autoneg_complete_mask
=
0x0020
;
u16
autoneg_reg
=
0
;
u16
autoneg_reg
=
IXGBE_MII_AUTONEG_REG
;
/*
* Set advertisement settings in PHY based on autoneg_advertised
* settings. If autoneg_advertised = 0, then advertise default values
* t
xn
devices cannot be "forced" to a autoneg 10G and fail. But can
* t
nx
devices cannot be "forced" to a autoneg 10G and fail. But can
* for a 1G.
*/
ixgbe_read_phy_reg
(
hw
,
autoneg_speed_selection_register
,
IXGBE_MDIO_AUTO_NEG_DEV_TYPE
,
&
autoneg_reg
);
hw
->
phy
.
ops
.
read_reg
(
hw
,
IXGBE_MII_SPEED_SELECTION_REG
,
IXGBE_MDIO_AUTO_NEG_DEV_TYPE
,
&
autoneg_reg
);
if
(
hw
->
phy
.
autoneg_advertised
==
IXGBE_LINK_SPEED_1GB_FULL
)
autoneg_reg
&=
0xEFFF
;
/* 0 in bit 12 is 1G operation */
else
autoneg_reg
|=
0x1000
;
/* 1 in bit 12 is 10G/1G operation */
ixgbe_write_phy_reg
(
hw
,
autoneg_speed_selection_register
,
IXGBE_MDIO_AUTO_NEG_DEV_TYPE
,
autoneg_reg
);
hw
->
phy
.
ops
.
write_reg
(
hw
,
IXGBE_MII_SPEED_SELECTION_REG
,
IXGBE_MDIO_AUTO_NEG_DEV_TYPE
,
autoneg_reg
);
/* Restart PHY autonegotiation and wait for completion */
ixgbe_read_phy_reg
(
hw
,
IXGBE_MDIO_AUTO_NEG_CONTROL
,
IXGBE_MDIO_AUTO_NEG_DEV_TYPE
,
&
autoneg_reg
);
hw
->
phy
.
ops
.
read_reg
(
hw
,
IXGBE_MDIO_AUTO_NEG_CONTROL
,
IXGBE_MDIO_AUTO_NEG_DEV_TYPE
,
&
autoneg_reg
);
autoneg_reg
|=
autoneg_restart_mask
;
autoneg_reg
|=
IXGBE_MII_RESTART
;
ixgbe_write_phy_reg
(
hw
,
IXGBE_MDIO_AUTO_NEG_CONTROL
,
IXGBE_MDIO_AUTO_NEG_DEV_TYPE
,
autoneg_reg
);
hw
->
phy
.
ops
.
write_reg
(
hw
,
IXGBE_MDIO_AUTO_NEG_CONTROL
,
IXGBE_MDIO_AUTO_NEG_DEV_TYPE
,
autoneg_reg
);
/* Wait for autonegotiation to finish */
for
(
time_out
=
0
;
time_out
<
max_time_out
;
time_out
++
)
{
udelay
(
10
);
/* Restart PHY autonegotiation and wait for completion */
status
=
ixgbe_read_phy_reg
(
hw
,
IXGBE_MDIO_AUTO_NEG_STATUS
,
IXGBE_MDIO_AUTO_NEG_DEV_TYPE
,
&
autoneg_reg
);
status
=
hw
->
phy
.
ops
.
read_reg
(
hw
,
IXGBE_MDIO_AUTO_NEG_STATUS
,
IXGBE_MDIO_AUTO_NEG_DEV_TYPE
,
&
autoneg_reg
);
autoneg_reg
&=
autoneg_complete_mask
;
if
(
autoneg_reg
==
autoneg_complete_mask
)
{
autoneg_reg
&=
IXGBE_MII_AUTONEG_COMPLETE
;
if
(
autoneg_reg
==
IXGBE_MII_AUTONEG_COMPLETE
)
{
status
=
0
;
break
;
}
...
...
@@ -418,64 +397,17 @@ s32 ixgbe_setup_tnx_phy_link(struct ixgbe_hw *hw)
}
/**
* ixgbe_check_tnx_phy_link - Determine link and speed status
* @hw: pointer to hardware structure
*
* Reads the VS1 register to determine if link is up and the current speed for
* the PHY.
**/
s32
ixgbe_check_tnx_phy_link
(
struct
ixgbe_hw
*
hw
,
u32
*
speed
,
bool
*
link_up
)
{
s32
status
=
0
;
u32
time_out
;
u32
max_time_out
=
10
;
u16
phy_link
=
0
;
u16
phy_speed
=
0
;
u16
phy_data
=
0
;
/* Initialize speed and link to default case */
*
link_up
=
false
;
*
speed
=
IXGBE_LINK_SPEED_10GB_FULL
;
/*
* Check current speed and link status of the PHY register.
* This is a vendor specific register and may have to
* be changed for other copper PHYs.
*/
for
(
time_out
=
0
;
time_out
<
max_time_out
;
time_out
++
)
{
udelay
(
10
);
if
(
phy_link
==
IXGBE_MDIO_VENDOR_SPECIFIC_1_LINK_STATUS
)
{
*
link_up
=
true
;
if
(
phy_speed
==
IXGBE_MDIO_VENDOR_SPECIFIC_1_SPEED_STATUS
)
*
speed
=
IXGBE_LINK_SPEED_1GB_FULL
;
break
;
}
else
{
status
=
ixgbe_read_phy_reg
(
hw
,
IXGBE_MDIO_VENDOR_SPECIFIC_1_STATUS
,
IXGBE_MDIO_VENDOR_SPECIFIC_1_DEV_TYPE
,
&
phy_data
);
phy_link
=
phy_data
&
IXGBE_MDIO_VENDOR_SPECIFIC_1_LINK_STATUS
;
phy_speed
=
phy_data
&
IXGBE_MDIO_VENDOR_SPECIFIC_1_SPEED_STATUS
;
}
}
return
status
;
}
/**
* ixgbe_setup_tnx_phy_link_speed - Sets the auto advertised capabilities
* ixgbe_setup_phy_link_speed_generic - Sets the auto advertised capabilities
* @hw: pointer to hardware structure
* @speed: new link speed
* @autoneg: true if autonegotiation enabled
**/
s32
ixgbe_setup_tnx_phy_link_speed
(
struct
ixgbe_hw
*
hw
,
u32
speed
,
bool
autoneg
,
bool
autoneg_wait_to_complete
)
s32
ixgbe_setup_phy_link_speed_generic
(
struct
ixgbe_hw
*
hw
,
ixgbe_link_speed
speed
,
bool
autoneg
,
bool
autoneg_wait_to_complete
)
{
/*
* Clear autoneg_advertised and set new values based on input link
* speed.
...
...
@@ -484,11 +416,13 @@ s32 ixgbe_setup_tnx_phy_link_speed(struct ixgbe_hw *hw, u32 speed,
if
(
speed
&
IXGBE_LINK_SPEED_10GB_FULL
)
hw
->
phy
.
autoneg_advertised
|=
IXGBE_LINK_SPEED_10GB_FULL
;
if
(
speed
&
IXGBE_LINK_SPEED_1GB_FULL
)
hw
->
phy
.
autoneg_advertised
|=
IXGBE_LINK_SPEED_1GB_FULL
;
/* Setup link based on the new speed settings */
ixgbe_setup_tnx_phy
_link
(
hw
);
hw
->
phy
.
ops
.
setup
_link
(
hw
);
return
0
;
}
drivers/net/ixgbe/ixgbe_phy.h
浏览文件 @
152cbcf9
/*******************************************************************************
Intel 10 Gigabit PCI Express Linux driver
Copyright(c) 1999 - 200
7
Intel Corporation.
Copyright(c) 1999 - 200
8
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,
...
...
@@ -20,7 +20,6 @@
the file called "COPYING".
Contact Information:
Linux NICS <linux.nics@intel.com>
e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
...
...
@@ -30,20 +29,52 @@
#define _IXGBE_PHY_H_
#include "ixgbe_type.h"
#define IXGBE_I2C_EEPROM_DEV_ADDR 0xA0
s32
ixgbe_setup_phy_link
(
struct
ixgbe_hw
*
hw
);
s32
ixgbe_check_phy_link
(
struct
ixgbe_hw
*
hw
,
u32
*
speed
,
bool
*
link_up
);
s32
ixgbe_setup_phy_link_speed
(
struct
ixgbe_hw
*
hw
,
u32
speed
,
bool
autoneg
,
bool
autoneg_wait_to_complete
);
s32
ixgbe_identify_phy
(
struct
ixgbe_hw
*
hw
);
s32
ixgbe_reset_phy
(
struct
ixgbe_hw
*
hw
);
s32
ixgbe_read_phy_reg
(
struct
ixgbe_hw
*
hw
,
u32
reg_addr
,
u32
device_type
,
u16
*
phy_data
);
/* PHY specific */
s32
ixgbe_setup_tnx_phy_link
(
struct
ixgbe_hw
*
hw
);
s32
ixgbe_check_tnx_phy_link
(
struct
ixgbe_hw
*
hw
,
u32
*
speed
,
bool
*
link_up
);
s32
ixgbe_setup_tnx_phy_link_speed
(
struct
ixgbe_hw
*
hw
,
u32
speed
,
bool
autoneg
,
bool
autoneg_wait_to_complete
);
/* EEPROM byte offsets */
#define IXGBE_SFF_IDENTIFIER 0x0
#define IXGBE_SFF_IDENTIFIER_SFP 0x3
#define IXGBE_SFF_VENDOR_OUI_BYTE0 0x25
#define IXGBE_SFF_VENDOR_OUI_BYTE1 0x26
#define IXGBE_SFF_VENDOR_OUI_BYTE2 0x27
#define IXGBE_SFF_1GBE_COMP_CODES 0x6
#define IXGBE_SFF_10GBE_COMP_CODES 0x3
#define IXGBE_SFF_TRANSMISSION_MEDIA 0x9
/* Bitmasks */
#define IXGBE_SFF_TWIN_AX_CAPABLE 0x80
#define IXGBE_SFF_1GBASESX_CAPABLE 0x1
#define IXGBE_SFF_10GBASESR_CAPABLE 0x10
#define IXGBE_SFF_10GBASELR_CAPABLE 0x20
#define IXGBE_I2C_EEPROM_READ_MASK 0x100
#define IXGBE_I2C_EEPROM_STATUS_MASK 0x3
#define IXGBE_I2C_EEPROM_STATUS_NO_OPERATION 0x0
#define IXGBE_I2C_EEPROM_STATUS_PASS 0x1
#define IXGBE_I2C_EEPROM_STATUS_FAIL 0x2
#define IXGBE_I2C_EEPROM_STATUS_IN_PROGRESS 0x3
/* Bit-shift macros */
#define IXGBE_SFF_VENDOR_OUI_BYTE0_SHIFT 12
#define IXGBE_SFF_VENDOR_OUI_BYTE1_SHIFT 8
#define IXGBE_SFF_VENDOR_OUI_BYTE2_SHIFT 4
/* Vendor OUIs: format of OUI is 0x[byte0][byte1][byte2][00] */
#define IXGBE_SFF_VENDOR_OUI_TYCO 0x00407600
#define IXGBE_SFF_VENDOR_OUI_FTL 0x00906500
#define IXGBE_SFF_VENDOR_OUI_AVAGO 0x00176A00
s32
ixgbe_init_phy_ops_generic
(
struct
ixgbe_hw
*
hw
);
s32
ixgbe_identify_phy_generic
(
struct
ixgbe_hw
*
hw
);
s32
ixgbe_reset_phy_generic
(
struct
ixgbe_hw
*
hw
);
s32
ixgbe_read_phy_reg_generic
(
struct
ixgbe_hw
*
hw
,
u32
reg_addr
,
u32
device_type
,
u16
*
phy_data
);
s32
ixgbe_write_phy_reg_generic
(
struct
ixgbe_hw
*
hw
,
u32
reg_addr
,
u32
device_type
,
u16
phy_data
);
s32
ixgbe_setup_phy_link_generic
(
struct
ixgbe_hw
*
hw
);
s32
ixgbe_setup_phy_link_speed_generic
(
struct
ixgbe_hw
*
hw
,
ixgbe_link_speed
speed
,
bool
autoneg
,
bool
autoneg_wait_to_complete
);
#endif
/* _IXGBE_PHY_H_ */
drivers/net/ixgbe/ixgbe_type.h
浏览文件 @
152cbcf9
此差异已折叠。
点击以展开。
drivers/net/meth.c
浏览文件 @
152cbcf9
...
...
@@ -41,7 +41,7 @@
#endif
#if MFE_DEBUG>=1
#define DPRINTK(str,args...) printk(KERN_DEBUG "meth: %s: " str, __
FUNCTION
__ , ## args)
#define DPRINTK(str,args...) printk(KERN_DEBUG "meth: %s: " str, __
func
__ , ## args)
#define MFE_RX_DEBUG 2
#else
#define DPRINTK(str,args...)
...
...
drivers/net/mipsnet.c
浏览文件 @
152cbcf9
...
...
@@ -203,7 +203,7 @@ static irqreturn_t mipsnet_interrupt(int irq, void *dev_id)
out_badirq:
printk
(
KERN_INFO
"%s: %s(): irq %d for unknown device
\n
"
,
dev
->
name
,
__
FUNCTION
__
,
irq
);
dev
->
name
,
__
func
__
,
irq
);
return
ret
;
}
...
...
drivers/net/mlx4/alloc.c
浏览文件 @
152cbcf9
...
...
@@ -33,6 +33,7 @@
#include <linux/errno.h>
#include <linux/slab.h>
#include <linux/mm.h>
#include <linux/bitmap.h>
#include <linux/dma-mapping.h>
#include <linux/vmalloc.h>
...
...
drivers/net/myri10ge/myri10ge.c
浏览文件 @
152cbcf9
...
...
@@ -183,7 +183,7 @@ struct myri10ge_slice_state {
dma_addr_t
fw_stats_bus
;
int
watchdog_tx_done
;
int
watchdog_tx_req
;
#if
def CONFIG_DCA
#if
(defined CONFIG_DCA) || (defined CONFIG_DCA_MODULE)
int
cached_dca_tag
;
int
cpu
;
__be32
__iomem
*
dca_tag
;
...
...
@@ -215,7 +215,7 @@ struct myri10ge_priv {
int
msi_enabled
;
int
msix_enabled
;
struct
msix_entry
*
msix_vectors
;
#if
def CONFIG_DCA
#if
(defined CONFIG_DCA) || (defined CONFIG_DCA_MODULE)
int
dca_enabled
;
#endif
u32
link_state
;
...
...
@@ -891,7 +891,7 @@ static int myri10ge_reset(struct myri10ge_priv *mgp)
struct
myri10ge_slice_state
*
ss
;
int
i
,
status
;
size_t
bytes
;
#if
def CONFIG_DCA
#if
(defined CONFIG_DCA) || (defined CONFIG_DCA_MODULE)
unsigned
long
dca_tag_off
;
#endif
...
...
@@ -986,7 +986,7 @@ static int myri10ge_reset(struct myri10ge_priv *mgp)
}
put_be32
(
htonl
(
mgp
->
intr_coal_delay
),
mgp
->
intr_coal_delay_ptr
);
#if
def CONFIG_DCA
#if
(defined CONFIG_DCA) || (defined CONFIG_DCA_MODULE)
status
=
myri10ge_send_cmd
(
mgp
,
MXGEFW_CMD_GET_DCA_OFFSET
,
&
cmd
,
0
);
dca_tag_off
=
cmd
.
data0
;
for
(
i
=
0
;
i
<
mgp
->
num_slices
;
i
++
)
{
...
...
@@ -1025,7 +1025,7 @@ static int myri10ge_reset(struct myri10ge_priv *mgp)
return
status
;
}
#if
def CONFIG_DCA
#if
(defined CONFIG_DCA) || (defined CONFIG_DCA_MODULE)
static
void
myri10ge_write_dca
(
struct
myri10ge_slice_state
*
ss
,
int
cpu
,
int
tag
)
{
...
...
@@ -1060,8 +1060,9 @@ static void myri10ge_setup_dca(struct myri10ge_priv *mgp)
}
err
=
dca_add_requester
(
&
pdev
->
dev
);
if
(
err
)
{
dev_err
(
&
pdev
->
dev
,
"dca_add_requester() failed, err=%d
\n
"
,
err
);
if
(
err
!=
-
ENODEV
)
dev_err
(
&
pdev
->
dev
,
"dca_add_requester() failed, err=%d
\n
"
,
err
);
return
;
}
mgp
->
dca_enabled
=
1
;
...
...
@@ -1457,7 +1458,7 @@ static int myri10ge_poll(struct napi_struct *napi, int budget)
struct
net_device
*
netdev
=
ss
->
mgp
->
dev
;
int
work_done
;
#if
def CONFIG_DCA
#if
(defined CONFIG_DCA) || (defined CONFIG_DCA_MODULE)
if
(
ss
->
mgp
->
dca_enabled
)
myri10ge_update_dca
(
ss
);
#endif
...
...
@@ -1686,8 +1687,8 @@ static const char myri10ge_gstrings_main_stats[][ETH_GSTRING_LEN] = {
"tx_boundary"
,
"WC"
,
"irq"
,
"MSI"
,
"MSIX"
,
"read_dma_bw_MBs"
,
"write_dma_bw_MBs"
,
"read_write_dma_bw_MBs"
,
"serial_number"
,
"watchdog_resets"
,
#if
def CONFIG_DCA
"dca_capable
"
,
"dca_enabled
"
,
#if
(defined CONFIG_DCA) || (defined CONFIG_DCA_MODULE)
"dca_capable
_firmware"
,
"dca_device_present
"
,
#endif
"link_changes"
,
"link_up"
,
"dropped_link_overflow"
,
"dropped_link_error_or_filtered"
,
...
...
@@ -1765,7 +1766,7 @@ myri10ge_get_ethtool_stats(struct net_device *netdev,
data
[
i
++
]
=
(
unsigned
int
)
mgp
->
read_write_dma
;
data
[
i
++
]
=
(
unsigned
int
)
mgp
->
serial_number
;
data
[
i
++
]
=
(
unsigned
int
)
mgp
->
watchdog_resets
;
#if
def CONFIG_DCA
#if
(defined CONFIG_DCA) || (defined CONFIG_DCA_MODULE)
data
[
i
++
]
=
(
unsigned
int
)(
mgp
->
ss
[
0
].
dca_tag
!=
NULL
);
data
[
i
++
]
=
(
unsigned
int
)(
mgp
->
dca_enabled
);
#endif
...
...
@@ -3763,7 +3764,7 @@ static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
dev_err
(
&
pdev
->
dev
,
"failed reset
\n
"
);
goto
abort_with_slices
;
}
#if
def CONFIG_DCA
#if
(defined CONFIG_DCA) || (defined CONFIG_DCA_MODULE)
myri10ge_setup_dca
(
mgp
);
#endif
pci_set_drvdata
(
pdev
,
mgp
);
...
...
@@ -3866,7 +3867,7 @@ static void myri10ge_remove(struct pci_dev *pdev)
netdev
=
mgp
->
dev
;
unregister_netdev
(
netdev
);
#if
def CONFIG_DCA
#if
(defined CONFIG_DCA) || (defined CONFIG_DCA_MODULE)
myri10ge_teardown_dca
(
mgp
);
#endif
myri10ge_dummy_rdma
(
mgp
,
0
);
...
...
@@ -3911,7 +3912,7 @@ static struct pci_driver myri10ge_driver = {
#endif
};
#if
def CONFIG_DCA
#if
(defined CONFIG_DCA) || (defined CONFIG_DCA_MODULE)
static
int
myri10ge_notify_dca
(
struct
notifier_block
*
nb
,
unsigned
long
event
,
void
*
p
)
{
...
...
@@ -3943,7 +3944,7 @@ static __init int myri10ge_init_module(void)
myri10ge_driver
.
name
,
myri10ge_rss_hash
);
myri10ge_rss_hash
=
MXGEFW_RSS_HASH_TYPE_SRC_PORT
;
}
#if
def CONFIG_DCA
#if
(defined CONFIG_DCA) || (defined CONFIG_DCA_MODULE)
dca_register_notify
(
&
myri10ge_dca_notifier
);
#endif
...
...
@@ -3954,7 +3955,7 @@ module_init(myri10ge_init_module);
static
__exit
void
myri10ge_cleanup_module
(
void
)
{
#if
def CONFIG_DCA
#if
(defined CONFIG_DCA) || (defined CONFIG_DCA_MODULE)
dca_unregister_notify
(
&
myri10ge_dca_notifier
);
#endif
pci_unregister_driver
(
&
myri10ge_driver
);
...
...
drivers/net/ne.c
浏览文件 @
152cbcf9
...
...
@@ -844,8 +844,12 @@ static int ne_drv_suspend(struct platform_device *pdev, pm_message_t state)
{
struct
net_device
*
dev
=
platform_get_drvdata
(
pdev
);
if
(
netif_running
(
dev
))
if
(
netif_running
(
dev
))
{
struct
pnp_dev
*
idev
=
(
struct
pnp_dev
*
)
ei_status
.
priv
;
netif_device_detach
(
dev
);
if
(
idev
)
pnp_stop_dev
(
idev
);
}
return
0
;
}
...
...
@@ -854,6 +858,9 @@ static int ne_drv_resume(struct platform_device *pdev)
struct
net_device
*
dev
=
platform_get_drvdata
(
pdev
);
if
(
netif_running
(
dev
))
{
struct
pnp_dev
*
idev
=
(
struct
pnp_dev
*
)
ei_status
.
priv
;
if
(
idev
)
pnp_start_dev
(
idev
);
ne_reset_8390
(
dev
);
NS8390p_init
(
dev
,
1
);
netif_device_attach
(
dev
);
...
...
drivers/net/netx-eth.c
浏览文件 @
152cbcf9
...
...
@@ -189,7 +189,7 @@ netx_eth_interrupt(int irq, void *dev_id)
if
((
status
&
ISR_CON_HI
)
||
(
status
&
ISR_IND_HI
))
printk
(
"%s: unexpected status: 0x%08x
\n
"
,
__
FUNCTION
__
,
status
);
__
func
__
,
status
);
fill_level
=
readl
(
NETX_PFIFO_FILL_LEVEL
(
IND_FIFO_PORT_LO
(
priv
->
id
)));
...
...
drivers/net/netxen/netxen_nic.h
浏览文件 @
152cbcf9
...
...
@@ -742,7 +742,7 @@ extern char netxen_nic_driver_name[];
} while (0)
#else
#define DPRINTK(klevel, fmt, args...) do { \
printk(KERN_##klevel PFX "%s: %s: " fmt, __
FUNCTION
__,\
printk(KERN_##klevel PFX "%s: %s: " fmt, __
func
__,\
(adapter != NULL && adapter->netdev != NULL) ? \
adapter->netdev->name : NULL, \
## args); } while(0)
...
...
drivers/net/netxen/netxen_nic_main.c
浏览文件 @
152cbcf9
...
...
@@ -77,18 +77,18 @@ static irqreturn_t netxen_msi_intr(int irq, void *data);
/* PCI Device ID Table */
#define ENTRY(device) \
{PCI_DEVICE(
0x4040
, (device)), \
{PCI_DEVICE(
PCI_VENDOR_ID_NETXEN
, (device)), \
.class = PCI_CLASS_NETWORK_ETHERNET << 8, .class_mask = ~0}
static
struct
pci_device_id
netxen_pci_tbl
[]
__devinitdata
=
{
ENTRY
(
0x0001
),
ENTRY
(
0x0002
),
ENTRY
(
0x0003
),
ENTRY
(
0x0004
),
ENTRY
(
0x0005
),
ENTRY
(
0x0024
),
ENTRY
(
0x0025
),
ENTRY
(
0x0100
),
ENTRY
(
PCI_DEVICE_ID_NX2031_10GXSR
),
ENTRY
(
PCI_DEVICE_ID_NX2031_10GCX4
),
ENTRY
(
PCI_DEVICE_ID_NX2031_4GCU
),
ENTRY
(
PCI_DEVICE_ID_NX2031_IMEZ
),
ENTRY
(
PCI_DEVICE_ID_NX2031_HMEZ
),
ENTRY
(
PCI_DEVICE_ID_NX2031_XG_MGMT
),
ENTRY
(
PCI_DEVICE_ID_NX2031_XG_MGMT2
),
ENTRY
(
PCI_DEVICE_ID_NX3031
),
{
0
,}
};
...
...
@@ -241,7 +241,7 @@ static void netxen_check_options(struct netxen_adapter *adapter)
case
NETXEN_BRDTYPE_P3_REF_QG
:
case
NETXEN_BRDTYPE_P3_4_GB
:
case
NETXEN_BRDTYPE_P3_4_GB_MM
:
adapter
->
msix_supported
=
0
;
adapter
->
msix_supported
=
!!
use_msi_x
;
adapter
->
max_rx_desc_count
=
MAX_RCV_DESCRIPTORS_10G
;
break
;
...
...
drivers/net/pci-skeleton.c
浏览文件 @
152cbcf9
...
...
@@ -119,7 +119,7 @@ KERN_INFO " Support available from http://foo.com/bar/baz.html\n";
#ifdef NETDRV_DEBUG
/* note: prints function name for you */
# define DPRINTK(fmt, args...) printk(KERN_DEBUG "%s: " fmt, __
FUNCTION
__ , ## args)
# define DPRINTK(fmt, args...) printk(KERN_DEBUG "%s: " fmt, __
func
__ , ## args)
#else
# define DPRINTK(fmt, args...)
#endif
...
...
@@ -130,7 +130,7 @@ KERN_INFO " Support available from http://foo.com/bar/baz.html\n";
# define assert(expr) \
if(!(expr)) { \
printk( "Assertion failed! %s,%s,%s,line=%d\n", \
#expr,__FILE__,__
FUNCTION
__,__LINE__); \
#expr,__FILE__,__
func
__,__LINE__); \
}
#endif
...
...
drivers/net/r6040.c
浏览文件 @
152cbcf9
...
...
@@ -370,7 +370,7 @@ static void r6040_init_mac_regs(struct net_device *dev)
/* Reset internal state machine */
iowrite16
(
2
,
ioaddr
+
MAC_SM
);
iowrite16
(
0
,
ioaddr
+
MAC_SM
);
udelay
(
5000
);
mdelay
(
5
);
/* MAC Bus Control Register */
iowrite16
(
MBCR_DEFAULT
,
ioaddr
+
MBCR
);
...
...
@@ -806,7 +806,7 @@ static void r6040_mac_address(struct net_device *dev)
iowrite16
(
0x01
,
ioaddr
+
MCR1
);
/* Reset MAC */
iowrite16
(
2
,
ioaddr
+
MAC_SM
);
/* Reset internal state machine */
iowrite16
(
0
,
ioaddr
+
MAC_SM
);
udelay
(
5000
);
mdelay
(
5
);
/* Restore MAC Address */
adrp
=
(
u16
*
)
dev
->
dev_addr
;
...
...
drivers/net/r8169.c
浏览文件 @
152cbcf9
...
...
@@ -36,7 +36,7 @@
#define assert(expr) \
if (!(expr)) { \
printk( "Assertion failed! %s,%s,%s,line=%d\n", \
#expr,__FILE__,__
FUNCTION
__,__LINE__); \
#expr,__FILE__,__
func
__,__LINE__); \
}
#define dprintk(fmt, args...) \
do { printk(KERN_DEBUG PFX fmt, ## args); } while (0)
...
...
@@ -2286,8 +2286,6 @@ static void rtl_hw_start_8168(struct net_device *dev)
RTL_R8
(
IntrMask
);
RTL_W32
(
RxMissed
,
0
);
rtl_set_rx_mode
(
dev
);
RTL_W8
(
ChipCmd
,
CmdTxEnb
|
CmdRxEnb
);
...
...
@@ -2412,8 +2410,6 @@ static void rtl_hw_start_8101(struct net_device *dev)
RTL_R8
(
IntrMask
);
RTL_W32
(
RxMissed
,
0
);
rtl_set_rx_mode
(
dev
);
RTL_W8
(
ChipCmd
,
CmdTxEnb
|
CmdRxEnb
);
...
...
@@ -3191,6 +3187,17 @@ static int rtl8169_poll(struct napi_struct *napi, int budget)
return
work_done
;
}
static
void
rtl8169_rx_missed
(
struct
net_device
*
dev
,
void
__iomem
*
ioaddr
)
{
struct
rtl8169_private
*
tp
=
netdev_priv
(
dev
);
if
(
tp
->
mac_version
>
RTL_GIGA_MAC_VER_06
)
return
;
dev
->
stats
.
rx_missed_errors
+=
(
RTL_R32
(
RxMissed
)
&
0xffffff
);
RTL_W32
(
RxMissed
,
0
);
}
static
void
rtl8169_down
(
struct
net_device
*
dev
)
{
struct
rtl8169_private
*
tp
=
netdev_priv
(
dev
);
...
...
@@ -3208,9 +3215,7 @@ static void rtl8169_down(struct net_device *dev)
rtl8169_asic_down
(
ioaddr
);
/* Update the error counts. */
dev
->
stats
.
rx_missed_errors
+=
RTL_R32
(
RxMissed
);
RTL_W32
(
RxMissed
,
0
);
rtl8169_rx_missed
(
dev
,
ioaddr
);
spin_unlock_irq
(
&
tp
->
lock
);
...
...
@@ -3332,8 +3337,7 @@ static struct net_device_stats *rtl8169_get_stats(struct net_device *dev)
if
(
netif_running
(
dev
))
{
spin_lock_irqsave
(
&
tp
->
lock
,
flags
);
dev
->
stats
.
rx_missed_errors
+=
RTL_R32
(
RxMissed
);
RTL_W32
(
RxMissed
,
0
);
rtl8169_rx_missed
(
dev
,
ioaddr
);
spin_unlock_irqrestore
(
&
tp
->
lock
,
flags
);
}
...
...
@@ -3358,8 +3362,7 @@ static int rtl8169_suspend(struct pci_dev *pdev, pm_message_t state)
rtl8169_asic_down
(
ioaddr
);
dev
->
stats
.
rx_missed_errors
+=
RTL_R32
(
RxMissed
);
RTL_W32
(
RxMissed
,
0
);
rtl8169_rx_missed
(
dev
,
ioaddr
);
spin_unlock_irq
(
&
tp
->
lock
);
...
...
drivers/net/s2io.c
浏览文件 @
152cbcf9
...
...
@@ -371,9 +371,6 @@ static void s2io_vlan_rx_register(struct net_device *dev,
flags
[
i
]);
}
/* A flag indicating whether 'RX_PA_CFG_STRIP_VLAN_TAG' bit is set or not */
static
int
vlan_strip_flag
;
/* Unregister the vlan */
static
void
s2io_vlan_rx_kill_vid
(
struct
net_device
*
dev
,
unsigned
long
vid
)
{
...
...
@@ -2303,7 +2300,7 @@ static int start_nic(struct s2io_nic *nic)
val64
=
readq
(
&
bar0
->
rx_pa_cfg
);
val64
&=
~
RX_PA_CFG_STRIP_VLAN_TAG
;
writeq
(
val64
,
&
bar0
->
rx_pa_cfg
);
vlan_strip_flag
=
0
;
nic
->
vlan_strip_flag
=
0
;
}
/*
...
...
@@ -3136,7 +3133,7 @@ static void tx_intr_handler(struct fifo_info *fifo_data)
if
(
skb
==
NULL
)
{
spin_unlock_irqrestore
(
&
fifo_data
->
tx_lock
,
flags
);
DBG_PRINT
(
ERR_DBG
,
"%s: Null skb "
,
__
FUNCTION
__
);
__
func
__
);
DBG_PRINT
(
ERR_DBG
,
"in Tx Free Intr
\n
"
);
return
;
}
...
...
@@ -3496,7 +3493,7 @@ static void s2io_reset(struct s2io_nic * sp)
unsigned
long
long
mem_alloc_cnt
,
mem_free_cnt
,
watchdog_cnt
;
DBG_PRINT
(
INIT_DBG
,
"%s - Resetting XFrame card %s
\n
"
,
__
FUNCTION
__
,
sp
->
dev
->
name
);
__
func
__
,
sp
->
dev
->
name
);
/* Back up the PCI-X CMD reg, dont want to lose MMRBC, OST settings */
pci_read_config_word
(
sp
->
pdev
,
PCIX_COMMAND_REGISTER
,
&
(
pci_cmd
));
...
...
@@ -3518,7 +3515,7 @@ static void s2io_reset(struct s2io_nic * sp)
}
if
(
check_pci_device_id
(
val16
)
==
(
u16
)
PCI_ANY_ID
)
{
DBG_PRINT
(
ERR_DBG
,
"%s SW_Reset failed!
\n
"
,
__
FUNCTION
__
);
DBG_PRINT
(
ERR_DBG
,
"%s SW_Reset failed!
\n
"
,
__
func
__
);
}
pci_write_config_word
(
sp
->
pdev
,
PCIX_COMMAND_REGISTER
,
pci_cmd
);
...
...
@@ -3768,7 +3765,7 @@ static void restore_xmsi_data(struct s2io_nic *nic)
val64
=
(
s2BIT
(
7
)
|
s2BIT
(
15
)
|
vBIT
(
msix_index
,
26
,
6
));
writeq
(
val64
,
&
bar0
->
xmsi_access
);
if
(
wait_for_msix_trans
(
nic
,
msix_index
))
{
DBG_PRINT
(
ERR_DBG
,
"failed in %s
\n
"
,
__
FUNCTION
__
);
DBG_PRINT
(
ERR_DBG
,
"failed in %s
\n
"
,
__
func
__
);
continue
;
}
}
...
...
@@ -3789,7 +3786,7 @@ static void store_xmsi_data(struct s2io_nic *nic)
val64
=
(
s2BIT
(
15
)
|
vBIT
(
msix_index
,
26
,
6
));
writeq
(
val64
,
&
bar0
->
xmsi_access
);
if
(
wait_for_msix_trans
(
nic
,
msix_index
))
{
DBG_PRINT
(
ERR_DBG
,
"failed in %s
\n
"
,
__
FUNCTION
__
);
DBG_PRINT
(
ERR_DBG
,
"failed in %s
\n
"
,
__
func
__
);
continue
;
}
addr
=
readq
(
&
bar0
->
xmsi_address
);
...
...
@@ -3812,7 +3809,7 @@ static int s2io_enable_msi_x(struct s2io_nic *nic)
GFP_KERNEL
);
if
(
!
nic
->
entries
)
{
DBG_PRINT
(
INFO_DBG
,
"%s: Memory allocation failed
\n
"
,
\
__
FUNCTION
__
);
__
func
__
);
nic
->
mac_control
.
stats_info
->
sw_stat
.
mem_alloc_fail_cnt
++
;
return
-
ENOMEM
;
}
...
...
@@ -3826,7 +3823,7 @@ static int s2io_enable_msi_x(struct s2io_nic *nic)
GFP_KERNEL
);
if
(
!
nic
->
s2io_entries
)
{
DBG_PRINT
(
INFO_DBG
,
"%s: Memory allocation failed
\n
"
,
__
FUNCTION
__
);
__
func
__
);
nic
->
mac_control
.
stats_info
->
sw_stat
.
mem_alloc_fail_cnt
++
;
kfree
(
nic
->
entries
);
nic
->
mac_control
.
stats_info
->
sw_stat
.
mem_freed
...
...
@@ -5010,7 +5007,7 @@ static void s2io_set_multicast(struct net_device *dev)
val64
=
readq
(
&
bar0
->
rx_pa_cfg
);
val64
&=
~
RX_PA_CFG_STRIP_VLAN_TAG
;
writeq
(
val64
,
&
bar0
->
rx_pa_cfg
);
vlan_strip_flag
=
0
;
sp
->
vlan_strip_flag
=
0
;
}
val64
=
readq
(
&
bar0
->
mac_cfg
);
...
...
@@ -5032,7 +5029,7 @@ static void s2io_set_multicast(struct net_device *dev)
val64
=
readq
(
&
bar0
->
rx_pa_cfg
);
val64
|=
RX_PA_CFG_STRIP_VLAN_TAG
;
writeq
(
val64
,
&
bar0
->
rx_pa_cfg
);
vlan_strip_flag
=
1
;
sp
->
vlan_strip_flag
=
1
;
}
val64
=
readq
(
&
bar0
->
mac_cfg
);
...
...
@@ -6746,7 +6743,7 @@ static int s2io_change_mtu(struct net_device *dev, int new_mtu)
ret
=
s2io_card_up
(
sp
);
if
(
ret
)
{
DBG_PRINT
(
ERR_DBG
,
"%s: Device bring up failed
\n
"
,
__
FUNCTION
__
);
__
func
__
);
return
ret
;
}
s2io_wake_all_tx_queue
(
sp
);
...
...
@@ -7530,7 +7527,7 @@ static int rx_osm_handler(struct ring_info *ring_data, struct RxD_t * rxdp)
default:
DBG_PRINT
(
ERR_DBG
,
"%s: Samadhana!!
\n
"
,
__
FUNCTION
__
);
__
func
__
);
BUG
();
}
}
...
...
@@ -7781,7 +7778,7 @@ s2io_init_nic(struct pci_dev *pdev, const struct pci_device_id *pre)
return
-
ENOMEM
;
}
if
((
ret
=
pci_request_regions
(
pdev
,
s2io_driver_name
)))
{
DBG_PRINT
(
ERR_DBG
,
"%s: Request Regions failed - %x
\n
"
,
__
FUNCTION
__
,
ret
);
DBG_PRINT
(
ERR_DBG
,
"%s: Request Regions failed - %x
\n
"
,
__
func
__
,
ret
);
pci_disable_device
(
pdev
);
return
-
ENODEV
;
}
...
...
@@ -7998,7 +7995,7 @@ s2io_init_nic(struct pci_dev *pdev, const struct pci_device_id *pre)
if
(
sp
->
device_type
&
XFRAME_II_DEVICE
)
{
mode
=
s2io_verify_pci_mode
(
sp
);
if
(
mode
<
0
)
{
DBG_PRINT
(
ERR_DBG
,
"%s: "
,
__
FUNCTION
__
);
DBG_PRINT
(
ERR_DBG
,
"%s: "
,
__
func
__
);
DBG_PRINT
(
ERR_DBG
,
" Unsupported PCI bus mode
\n
"
);
ret
=
-
EBADSLT
;
goto
set_swap_failed
;
...
...
@@ -8206,6 +8203,11 @@ s2io_init_nic(struct pci_dev *pdev, const struct pci_device_id *pre)
/* Initialize device name */
sprintf
(
sp
->
name
,
"%s Neterion %s"
,
dev
->
name
,
sp
->
product_name
);
if
(
vlan_tag_strip
)
sp
->
vlan_strip_flag
=
1
;
else
sp
->
vlan_strip_flag
=
0
;
/*
* Make Link state as off at this point, when the Link change
* interrupt comes the state will be automatically changed to
...
...
@@ -8299,7 +8301,7 @@ static int check_L2_lro_capable(u8 *buffer, struct iphdr **ip,
if
(
!
(
rxdp
->
Control_1
&
RXD_FRAME_PROTO_TCP
))
{
DBG_PRINT
(
INIT_DBG
,
"%s: Non-TCP frames not supported for LRO
\n
"
,
__
FUNCTION
__
);
__
func
__
);
return
-
1
;
}
...
...
@@ -8311,7 +8313,7 @@ static int check_L2_lro_capable(u8 *buffer, struct iphdr **ip,
* If vlan stripping is disabled and the frame is VLAN tagged,
* shift the offset by the VLAN header size bytes.
*/
if
((
!
vlan_strip_flag
)
&&
if
((
!
sp
->
vlan_strip_flag
)
&&
(
rxdp
->
Control_1
&
RXD_FRAME_VLAN_TAG
))
ip_off
+=
HEADER_VLAN_SIZE
;
}
else
{
...
...
@@ -8330,7 +8332,7 @@ static int check_L2_lro_capable(u8 *buffer, struct iphdr **ip,
static
int
check_for_socket_match
(
struct
lro
*
lro
,
struct
iphdr
*
ip
,
struct
tcphdr
*
tcp
)
{
DBG_PRINT
(
INFO_DBG
,
"%s: Been here...
\n
"
,
__
FUNCTION
__
);
DBG_PRINT
(
INFO_DBG
,
"%s: Been here...
\n
"
,
__
func
__
);
if
((
lro
->
iph
->
saddr
!=
ip
->
saddr
)
||
(
lro
->
iph
->
daddr
!=
ip
->
daddr
)
||
(
lro
->
tcph
->
source
!=
tcp
->
source
)
||
(
lro
->
tcph
->
dest
!=
tcp
->
dest
))
return
-
1
;
...
...
@@ -8345,7 +8347,7 @@ static inline int get_l4_pyld_length(struct iphdr *ip, struct tcphdr *tcp)
static
void
initiate_new_session
(
struct
lro
*
lro
,
u8
*
l2h
,
struct
iphdr
*
ip
,
struct
tcphdr
*
tcp
,
u32
tcp_pyld_len
,
u16
vlan_tag
)
{
DBG_PRINT
(
INFO_DBG
,
"%s: Been here...
\n
"
,
__
FUNCTION
__
);
DBG_PRINT
(
INFO_DBG
,
"%s: Been here...
\n
"
,
__
func
__
);
lro
->
l2h
=
l2h
;
lro
->
iph
=
ip
;
lro
->
tcph
=
tcp
;
...
...
@@ -8375,7 +8377,7 @@ static void update_L3L4_header(struct s2io_nic *sp, struct lro *lro)
struct
tcphdr
*
tcp
=
lro
->
tcph
;
__sum16
nchk
;
struct
stat_block
*
statinfo
=
sp
->
mac_control
.
stats_info
;
DBG_PRINT
(
INFO_DBG
,
"%s: Been here...
\n
"
,
__
FUNCTION
__
);
DBG_PRINT
(
INFO_DBG
,
"%s: Been here...
\n
"
,
__
func
__
);
/* Update L3 header */
ip
->
tot_len
=
htons
(
lro
->
total_len
);
...
...
@@ -8403,7 +8405,7 @@ static void update_L3L4_header(struct s2io_nic *sp, struct lro *lro)
static
void
aggregate_new_rx
(
struct
lro
*
lro
,
struct
iphdr
*
ip
,
struct
tcphdr
*
tcp
,
u32
l4_pyld
)
{
DBG_PRINT
(
INFO_DBG
,
"%s: Been here...
\n
"
,
__
FUNCTION
__
);
DBG_PRINT
(
INFO_DBG
,
"%s: Been here...
\n
"
,
__
func
__
);
lro
->
total_len
+=
l4_pyld
;
lro
->
frags_len
+=
l4_pyld
;
lro
->
tcp_next_seq
+=
l4_pyld
;
...
...
@@ -8427,7 +8429,7 @@ static int verify_l3_l4_lro_capable(struct lro *l_lro, struct iphdr *ip,
{
u8
*
ptr
;
DBG_PRINT
(
INFO_DBG
,
"%s: Been here...
\n
"
,
__
FUNCTION
__
);
DBG_PRINT
(
INFO_DBG
,
"%s: Been here...
\n
"
,
__
func
__
);
if
(
!
tcp_pyld_len
)
{
/* Runt frame or a pure ack */
...
...
@@ -8509,7 +8511,7 @@ s2io_club_tcp_session(struct ring_info *ring_data, u8 *buffer, u8 **tcp,
if
((
*
lro
)
->
tcp_next_seq
!=
ntohl
(
tcph
->
seq
))
{
DBG_PRINT
(
INFO_DBG
,
"%s:Out of order. expected "
"0x%x, actual 0x%x
\n
"
,
__
FUNCTION
__
,
"0x%x, actual 0x%x
\n
"
,
__
func
__
,
(
*
lro
)
->
tcp_next_seq
,
ntohl
(
tcph
->
seq
));
...
...
@@ -8549,7 +8551,7 @@ s2io_club_tcp_session(struct ring_info *ring_data, u8 *buffer, u8 **tcp,
if
(
ret
==
0
)
{
/* sessions exceeded */
DBG_PRINT
(
INFO_DBG
,
"%s:All LRO sessions already in use
\n
"
,
__
FUNCTION
__
);
__
func
__
);
*
lro
=
NULL
;
return
ret
;
}
...
...
@@ -8571,7 +8573,7 @@ s2io_club_tcp_session(struct ring_info *ring_data, u8 *buffer, u8 **tcp,
break
;
default:
DBG_PRINT
(
ERR_DBG
,
"%s:Dont know, can't say!!
\n
"
,
__
FUNCTION
__
);
__
func
__
);
break
;
}
...
...
@@ -8592,7 +8594,7 @@ static void queue_rx_frame(struct sk_buff *skb, u16 vlan_tag)
skb
->
protocol
=
eth_type_trans
(
skb
,
dev
);
if
(
sp
->
vlgrp
&&
vlan_tag
&&
(
vlan_strip_flag
))
{
&&
(
sp
->
vlan_strip_flag
))
{
/* Queueing the vlan frame to the upper layer */
if
(
sp
->
config
.
napi
)
vlan_hwaccel_receive_skb
(
skb
,
sp
->
vlgrp
,
vlan_tag
);
...
...
drivers/net/s2io.h
浏览文件 @
152cbcf9
...
...
@@ -962,6 +962,7 @@ struct s2io_nic {
int
task_flag
;
unsigned
long
long
start_time
;
struct
vlan_group
*
vlgrp
;
int
vlan_strip_flag
;
#define MSIX_FLG 0xA5
int
num_entries
;
struct
msix_entry
*
entries
;
...
...
drivers/net/sfc/efx.c
浏览文件 @
152cbcf9
此差异已折叠。
点击以展开。
drivers/net/sfc/falcon.c
浏览文件 @
152cbcf9
此差异已折叠。
点击以展开。
drivers/net/sfc/falcon.h
浏览文件 @
152cbcf9
...
...
@@ -86,6 +86,7 @@ extern void falcon_fini_interrupt(struct efx_nic *efx);
extern
int
falcon_probe_nic
(
struct
efx_nic
*
efx
);
extern
int
falcon_probe_resources
(
struct
efx_nic
*
efx
);
extern
int
falcon_init_nic
(
struct
efx_nic
*
efx
);
extern
int
falcon_flush_queues
(
struct
efx_nic
*
efx
);
extern
int
falcon_reset_hw
(
struct
efx_nic
*
efx
,
enum
reset_type
method
);
extern
void
falcon_remove_resources
(
struct
efx_nic
*
efx
);
extern
void
falcon_remove_nic
(
struct
efx_nic
*
efx
);
...
...
drivers/net/sfc/falcon_hwdefs.h
浏览文件 @
152cbcf9
...
...
@@ -117,7 +117,6 @@
#define SF_PRST_WIDTH 1
#define EE_PRST_LBN 8
#define EE_PRST_WIDTH 1
/* See pic_mode_t for decoding of this field */
/* These bit definitions are extrapolated from the list of numerical
* values for STRAP_PINS.
*/
...
...
drivers/net/sfc/falcon_io.h
浏览文件 @
152cbcf9
...
...
@@ -13,7 +13,6 @@
#include <linux/io.h>
#include <linux/spinlock.h>
#include "net_driver.h"
/**************************************************************************
*
...
...
drivers/net/sfc/falcon_xmac.c
浏览文件 @
152cbcf9
此差异已折叠。
点击以展开。
drivers/net/sfc/net_driver.h
浏览文件 @
152cbcf9
此差异已折叠。
点击以展开。
drivers/net/sfc/sfe4001.c
浏览文件 @
152cbcf9
此差异已折叠。
点击以展开。
drivers/net/sfc/tenxpress.c
浏览文件 @
152cbcf9
此差异已折叠。
点击以展开。
drivers/net/sfc/tx.c
浏览文件 @
152cbcf9
此差异已折叠。
点击以展开。
drivers/net/sfc/workarounds.h
浏览文件 @
152cbcf9
此差异已折叠。
点击以展开。
drivers/net/sfc/xfp_phy.c
浏览文件 @
152cbcf9
此差异已折叠。
点击以展开。
drivers/net/skfp/pmf.c
浏览文件 @
152cbcf9
此差异已折叠。
点击以展开。
drivers/net/smc911x.c
浏览文件 @
152cbcf9
此差异已折叠。
点击以展开。
drivers/net/smc91x.c
浏览文件 @
152cbcf9
此差异已折叠。
点击以展开。
drivers/net/smc91x.h
浏览文件 @
152cbcf9
此差异已折叠。
点击以展开。
drivers/net/sundance.c
浏览文件 @
152cbcf9
此差异已折叠。
点击以展开。
drivers/net/tehuti.h
浏览文件 @
152cbcf9
此差异已折叠。
点击以展开。
drivers/net/tsi108_eth.c
浏览文件 @
152cbcf9
此差异已折叠。
点击以展开。
drivers/net/tulip/de2104x.c
浏览文件 @
152cbcf9
此差异已折叠。
点击以展开。
drivers/net/ucc_geth.c
浏览文件 @
152cbcf9
此差异已折叠。
点击以展开。
drivers/net/usb/hso.c
浏览文件 @
152cbcf9
此差异已折叠。
点击以展开。
drivers/net/usb/mcs7830.c
浏览文件 @
152cbcf9
此差异已折叠。
点击以展开。
drivers/net/usb/pegasus.c
浏览文件 @
152cbcf9
此差异已折叠。
点击以展开。
drivers/net/via-velocity.h
浏览文件 @
152cbcf9
此差异已折叠。
点击以展开。
drivers/net/wan/cycx_drv.c
浏览文件 @
152cbcf9
此差异已折叠。
点击以展开。
drivers/net/wan/cycx_x25.c
浏览文件 @
152cbcf9
此差异已折叠。
点击以展开。
drivers/net/wan/dscc4.c
浏览文件 @
152cbcf9
此差异已折叠。
点击以展开。
drivers/net/wan/hdlc_x25.c
浏览文件 @
152cbcf9
此差异已折叠。
点击以展开。
drivers/net/wan/pc300_tty.c
浏览文件 @
152cbcf9
此差异已折叠。
点击以展开。
include/linux/pci_ids.h
浏览文件 @
152cbcf9
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录