Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
_Walt
cloud-kernel
提交
513fd370
cloud-kernel
项目概览
_Walt
/
cloud-kernel
与 Fork 源项目一致
Fork自
openanolis / cloud-kernel
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
513fd370
编写于
6月 10, 2008
作者:
D
David S. Miller
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'davem-fixes' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6
上级
709772e6
68c28898
变更
16
隐藏空白更改
内联
并排
Showing
16 changed file
with
151 addition
and
189 deletion
+151
-189
drivers/net/7990.c
drivers/net/7990.c
+5
-1
drivers/net/atlx/atl1.c
drivers/net/atlx/atl1.c
+0
-17
drivers/net/ehea/ehea_main.c
drivers/net/ehea/ehea_main.c
+10
-6
drivers/net/forcedeth.c
drivers/net/forcedeth.c
+20
-0
drivers/net/ixgbe/ixgbe_82598.c
drivers/net/ixgbe/ixgbe_82598.c
+2
-2
drivers/net/s2io.c
drivers/net/s2io.c
+6
-4
drivers/net/sfc/falcon.c
drivers/net/sfc/falcon.c
+3
-1
drivers/net/sky2.c
drivers/net/sky2.c
+2
-0
drivers/net/virtio_net.c
drivers/net/virtio_net.c
+45
-7
drivers/s390/net/qeth_core_main.c
drivers/s390/net/qeth_core_main.c
+15
-34
drivers/s390/net/qeth_core_offl.c
drivers/s390/net/qeth_core_offl.c
+2
-4
drivers/s390/net/qeth_core_sys.c
drivers/s390/net/qeth_core_sys.c
+0
-12
drivers/s390/net/qeth_l2_main.c
drivers/s390/net/qeth_l2_main.c
+16
-25
drivers/s390/net/qeth_l3_main.c
drivers/s390/net/qeth_l3_main.c
+24
-51
drivers/s390/net/qeth_l3_sys.c
drivers/s390/net/qeth_l3_sys.c
+0
-24
include/linux/virtio_net.h
include/linux/virtio_net.h
+1
-1
未找到文件。
drivers/net/7990.c
浏览文件 @
513fd370
...
@@ -506,6 +506,7 @@ int lance_open (struct net_device *dev)
...
@@ -506,6 +506,7 @@ int lance_open (struct net_device *dev)
return
res
;
return
res
;
}
}
EXPORT_SYMBOL_GPL
(
lance_open
);
int
lance_close
(
struct
net_device
*
dev
)
int
lance_close
(
struct
net_device
*
dev
)
{
{
...
@@ -521,6 +522,7 @@ int lance_close (struct net_device *dev)
...
@@ -521,6 +522,7 @@ int lance_close (struct net_device *dev)
return
0
;
return
0
;
}
}
EXPORT_SYMBOL_GPL
(
lance_close
);
void
lance_tx_timeout
(
struct
net_device
*
dev
)
void
lance_tx_timeout
(
struct
net_device
*
dev
)
{
{
...
@@ -529,7 +531,7 @@ void lance_tx_timeout(struct net_device *dev)
...
@@ -529,7 +531,7 @@ void lance_tx_timeout(struct net_device *dev)
dev
->
trans_start
=
jiffies
;
dev
->
trans_start
=
jiffies
;
netif_wake_queue
(
dev
);
netif_wake_queue
(
dev
);
}
}
EXPORT_SYMBOL_GPL
(
lance_tx_timeout
);
int
lance_start_xmit
(
struct
sk_buff
*
skb
,
struct
net_device
*
dev
)
int
lance_start_xmit
(
struct
sk_buff
*
skb
,
struct
net_device
*
dev
)
{
{
...
@@ -586,6 +588,7 @@ int lance_start_xmit (struct sk_buff *skb, struct net_device *dev)
...
@@ -586,6 +588,7 @@ int lance_start_xmit (struct sk_buff *skb, struct net_device *dev)
return
0
;
return
0
;
}
}
EXPORT_SYMBOL_GPL
(
lance_start_xmit
);
/* taken from the depca driver via a2065.c */
/* taken from the depca driver via a2065.c */
static
void
lance_load_multicast
(
struct
net_device
*
dev
)
static
void
lance_load_multicast
(
struct
net_device
*
dev
)
...
@@ -654,6 +657,7 @@ void lance_set_multicast (struct net_device *dev)
...
@@ -654,6 +657,7 @@ void lance_set_multicast (struct net_device *dev)
if
(
!
stopped
)
if
(
!
stopped
)
netif_start_queue
(
dev
);
netif_start_queue
(
dev
);
}
}
EXPORT_SYMBOL_GPL
(
lance_set_multicast
);
#ifdef CONFIG_NET_POLL_CONTROLLER
#ifdef CONFIG_NET_POLL_CONTROLLER
void
lance_poll
(
struct
net_device
*
dev
)
void
lance_poll
(
struct
net_device
*
dev
)
...
...
drivers/net/atlx/atl1.c
浏览文件 @
513fd370
...
@@ -636,22 +636,6 @@ static s32 atl1_phy_leave_power_saving(struct atl1_hw *hw)
...
@@ -636,22 +636,6 @@ static s32 atl1_phy_leave_power_saving(struct atl1_hw *hw)
return
atl1_write_phy_reg
(
hw
,
30
,
0
);
return
atl1_write_phy_reg
(
hw
,
30
,
0
);
}
}
/*
* Force the PHY into power saving mode using vendor magic.
*/
#ifdef CONFIG_PM
static
void
atl1_phy_enter_power_saving
(
struct
atl1_hw
*
hw
)
{
atl1_write_phy_reg
(
hw
,
MII_DBG_ADDR
,
0
);
atl1_write_phy_reg
(
hw
,
MII_DBG_DATA
,
0x124E
);
atl1_write_phy_reg
(
hw
,
MII_DBG_ADDR
,
2
);
atl1_write_phy_reg
(
hw
,
MII_DBG_DATA
,
0x3000
);
atl1_write_phy_reg
(
hw
,
MII_DBG_ADDR
,
3
);
atl1_write_phy_reg
(
hw
,
MII_DBG_DATA
,
0
);
}
#endif
/*
/*
* Resets the PHY and make all config validate
* Resets the PHY and make all config validate
* hw - Struct containing variables accessed by shared code
* hw - Struct containing variables accessed by shared code
...
@@ -2860,7 +2844,6 @@ static int atl1_suspend(struct pci_dev *pdev, pm_message_t state)
...
@@ -2860,7 +2844,6 @@ static int atl1_suspend(struct pci_dev *pdev, pm_message_t state)
ctrl
|=
PCIE_PHYMISC_FORCE_RCV_DET
;
ctrl
|=
PCIE_PHYMISC_FORCE_RCV_DET
;
iowrite32
(
ctrl
,
hw
->
hw_addr
+
REG_PCIE_PHYMISC
);
iowrite32
(
ctrl
,
hw
->
hw_addr
+
REG_PCIE_PHYMISC
);
ioread32
(
hw
->
hw_addr
+
REG_PCIE_PHYMISC
);
ioread32
(
hw
->
hw_addr
+
REG_PCIE_PHYMISC
);
atl1_phy_enter_power_saving
(
hw
);
hw
->
phy_configured
=
false
;
hw
->
phy_configured
=
false
;
pci_enable_wake
(
pdev
,
pci_choose_state
(
pdev
,
state
),
0
);
pci_enable_wake
(
pdev
,
pci_choose_state
(
pdev
,
state
),
0
);
exit:
exit:
...
...
drivers/net/ehea/ehea_main.c
浏览文件 @
513fd370
...
@@ -1766,16 +1766,20 @@ static int ehea_set_mac_addr(struct net_device *dev, void *sa)
...
@@ -1766,16 +1766,20 @@ static int ehea_set_mac_addr(struct net_device *dev, void *sa)
mutex_lock
(
&
ehea_bcmc_regs
.
lock
);
mutex_lock
(
&
ehea_bcmc_regs
.
lock
);
/* Deregister old MAC in pHYP */
/* Deregister old MAC in pHYP */
ret
=
ehea_broadcast_reg_helper
(
port
,
H_DEREG_BCMC
);
if
(
port
->
state
==
EHEA_PORT_UP
)
{
if
(
ret
)
ret
=
ehea_broadcast_reg_helper
(
port
,
H_DEREG_BCMC
);
goto
out_upregs
;
if
(
ret
)
goto
out_upregs
;
}
port
->
mac_addr
=
cb0
->
port_mac_addr
<<
16
;
port
->
mac_addr
=
cb0
->
port_mac_addr
<<
16
;
/* Register new MAC in pHYP */
/* Register new MAC in pHYP */
ret
=
ehea_broadcast_reg_helper
(
port
,
H_REG_BCMC
);
if
(
port
->
state
==
EHEA_PORT_UP
)
{
if
(
ret
)
ret
=
ehea_broadcast_reg_helper
(
port
,
H_REG_BCMC
);
goto
out_upregs
;
if
(
ret
)
goto
out_upregs
;
}
ret
=
0
;
ret
=
0
;
...
...
drivers/net/forcedeth.c
浏览文件 @
513fd370
...
@@ -3273,6 +3273,20 @@ static void nv_link_irq(struct net_device *dev)
...
@@ -3273,6 +3273,20 @@ static void nv_link_irq(struct net_device *dev)
dprintk
(
KERN_DEBUG
"%s: link change notification done.
\n
"
,
dev
->
name
);
dprintk
(
KERN_DEBUG
"%s: link change notification done.
\n
"
,
dev
->
name
);
}
}
static
void
nv_msi_workaround
(
struct
fe_priv
*
np
)
{
/* Need to toggle the msi irq mask within the ethernet device,
* otherwise, future interrupts will not be detected.
*/
if
(
np
->
msi_flags
&
NV_MSI_ENABLED
)
{
u8
__iomem
*
base
=
np
->
base
;
writel
(
0
,
base
+
NvRegMSIIrqMask
);
writel
(
NVREG_MSI_VECTOR_0_ENABLED
,
base
+
NvRegMSIIrqMask
);
}
}
static
irqreturn_t
nv_nic_irq
(
int
foo
,
void
*
data
)
static
irqreturn_t
nv_nic_irq
(
int
foo
,
void
*
data
)
{
{
struct
net_device
*
dev
=
(
struct
net_device
*
)
data
;
struct
net_device
*
dev
=
(
struct
net_device
*
)
data
;
...
@@ -3295,6 +3309,8 @@ static irqreturn_t nv_nic_irq(int foo, void *data)
...
@@ -3295,6 +3309,8 @@ static irqreturn_t nv_nic_irq(int foo, void *data)
if
(
!
(
events
&
np
->
irqmask
))
if
(
!
(
events
&
np
->
irqmask
))
break
;
break
;
nv_msi_workaround
(
np
);
spin_lock
(
&
np
->
lock
);
spin_lock
(
&
np
->
lock
);
nv_tx_done
(
dev
);
nv_tx_done
(
dev
);
spin_unlock
(
&
np
->
lock
);
spin_unlock
(
&
np
->
lock
);
...
@@ -3410,6 +3426,8 @@ static irqreturn_t nv_nic_irq_optimized(int foo, void *data)
...
@@ -3410,6 +3426,8 @@ static irqreturn_t nv_nic_irq_optimized(int foo, void *data)
if
(
!
(
events
&
np
->
irqmask
))
if
(
!
(
events
&
np
->
irqmask
))
break
;
break
;
nv_msi_workaround
(
np
);
spin_lock
(
&
np
->
lock
);
spin_lock
(
&
np
->
lock
);
nv_tx_done_optimized
(
dev
,
TX_WORK_PER_LOOP
);
nv_tx_done_optimized
(
dev
,
TX_WORK_PER_LOOP
);
spin_unlock
(
&
np
->
lock
);
spin_unlock
(
&
np
->
lock
);
...
@@ -3750,6 +3768,8 @@ static irqreturn_t nv_nic_irq_test(int foo, void *data)
...
@@ -3750,6 +3768,8 @@ static irqreturn_t nv_nic_irq_test(int foo, void *data)
if
(
!
(
events
&
NVREG_IRQ_TIMER
))
if
(
!
(
events
&
NVREG_IRQ_TIMER
))
return
IRQ_RETVAL
(
0
);
return
IRQ_RETVAL
(
0
);
nv_msi_workaround
(
np
);
spin_lock
(
&
np
->
lock
);
spin_lock
(
&
np
->
lock
);
np
->
intr_test
=
1
;
np
->
intr_test
=
1
;
spin_unlock
(
&
np
->
lock
);
spin_unlock
(
&
np
->
lock
);
...
...
drivers/net/ixgbe/ixgbe_82598.c
浏览文件 @
513fd370
...
@@ -58,8 +58,8 @@ static s32 ixgbe_reset_hw_82598(struct ixgbe_hw *hw);
...
@@ -58,8 +58,8 @@ static s32 ixgbe_reset_hw_82598(struct ixgbe_hw *hw);
static
s32
ixgbe_get_invariants_82598
(
struct
ixgbe_hw
*
hw
)
static
s32
ixgbe_get_invariants_82598
(
struct
ixgbe_hw
*
hw
)
{
{
hw
->
mac
.
num_rx_queues
=
IXGBE_82598_MAX_
T
X_QUEUES
;
hw
->
mac
.
num_rx_queues
=
IXGBE_82598_MAX_
R
X_QUEUES
;
hw
->
mac
.
num_tx_queues
=
IXGBE_82598_MAX_
R
X_QUEUES
;
hw
->
mac
.
num_tx_queues
=
IXGBE_82598_MAX_
T
X_QUEUES
;
hw
->
mac
.
num_rx_addrs
=
IXGBE_82598_RAR_ENTRIES
;
hw
->
mac
.
num_rx_addrs
=
IXGBE_82598_RAR_ENTRIES
;
/* PHY ops are filled in by default properly for Fiber only */
/* PHY ops are filled in by default properly for Fiber only */
...
...
drivers/net/s2io.c
浏览文件 @
513fd370
...
@@ -2861,7 +2861,8 @@ static int s2io_poll_msix(struct napi_struct *napi, int budget)
...
@@ -2861,7 +2861,8 @@ static int s2io_poll_msix(struct napi_struct *napi, int budget)
struct
config_param
*
config
;
struct
config_param
*
config
;
struct
mac_info
*
mac_control
;
struct
mac_info
*
mac_control
;
int
pkts_processed
=
0
;
int
pkts_processed
=
0
;
u8
*
addr
=
NULL
,
val8
=
0
;
u8
__iomem
*
addr
=
NULL
;
u8
val8
=
0
;
struct
s2io_nic
*
nic
=
dev
->
priv
;
struct
s2io_nic
*
nic
=
dev
->
priv
;
struct
XENA_dev_config
__iomem
*
bar0
=
nic
->
bar0
;
struct
XENA_dev_config
__iomem
*
bar0
=
nic
->
bar0
;
int
budget_org
=
budget
;
int
budget_org
=
budget
;
...
@@ -2878,7 +2879,7 @@ static int s2io_poll_msix(struct napi_struct *napi, int budget)
...
@@ -2878,7 +2879,7 @@ static int s2io_poll_msix(struct napi_struct *napi, int budget)
if
(
pkts_processed
<
budget_org
)
{
if
(
pkts_processed
<
budget_org
)
{
netif_rx_complete
(
dev
,
napi
);
netif_rx_complete
(
dev
,
napi
);
/*Re Enable MSI-Rx Vector*/
/*Re Enable MSI-Rx Vector*/
addr
=
(
u8
*
)
&
bar0
->
xmsi_mask_reg
;
addr
=
(
u8
__iomem
*
)
&
bar0
->
xmsi_mask_reg
;
addr
+=
7
-
ring
->
ring_no
;
addr
+=
7
-
ring
->
ring_no
;
val8
=
(
ring
->
ring_no
==
0
)
?
0x3f
:
0xbf
;
val8
=
(
ring
->
ring_no
==
0
)
?
0x3f
:
0xbf
;
writeb
(
val8
,
addr
);
writeb
(
val8
,
addr
);
...
@@ -4364,9 +4365,10 @@ static irqreturn_t s2io_msix_ring_handle(int irq, void *dev_id)
...
@@ -4364,9 +4365,10 @@ static irqreturn_t s2io_msix_ring_handle(int irq, void *dev_id)
return
IRQ_HANDLED
;
return
IRQ_HANDLED
;
if
(
sp
->
config
.
napi
)
{
if
(
sp
->
config
.
napi
)
{
u8
*
addr
=
NULL
,
val8
=
0
;
u8
__iomem
*
addr
=
NULL
;
u8
val8
=
0
;
addr
=
(
u8
*
)
&
bar0
->
xmsi_mask_reg
;
addr
=
(
u8
__iomem
*
)
&
bar0
->
xmsi_mask_reg
;
addr
+=
(
7
-
ring
->
ring_no
);
addr
+=
(
7
-
ring
->
ring_no
);
val8
=
(
ring
->
ring_no
==
0
)
?
0x7f
:
0xff
;
val8
=
(
ring
->
ring_no
==
0
)
?
0x7f
:
0xff
;
writeb
(
val8
,
addr
);
writeb
(
val8
,
addr
);
...
...
drivers/net/sfc/falcon.c
浏览文件 @
513fd370
...
@@ -733,8 +733,10 @@ void falcon_fini_rx(struct efx_rx_queue *rx_queue)
...
@@ -733,8 +733,10 @@ void falcon_fini_rx(struct efx_rx_queue *rx_queue)
continue
;
continue
;
break
;
break
;
}
}
if
(
rc
)
if
(
rc
)
{
EFX_ERR
(
efx
,
"failed to flush rx queue %d
\n
"
,
rx_queue
->
queue
);
EFX_ERR
(
efx
,
"failed to flush rx queue %d
\n
"
,
rx_queue
->
queue
);
efx_schedule_reset
(
efx
,
RESET_TYPE_INVISIBLE
);
}
/* Remove RX descriptor ring from card */
/* Remove RX descriptor ring from card */
EFX_ZERO_OWORD
(
rx_desc_ptr
);
EFX_ZERO_OWORD
(
rx_desc_ptr
);
...
...
drivers/net/sky2.c
浏览文件 @
513fd370
...
@@ -4404,7 +4404,9 @@ static int sky2_resume(struct pci_dev *pdev)
...
@@ -4404,7 +4404,9 @@ static int sky2_resume(struct pci_dev *pdev)
if
(
err
)
{
if
(
err
)
{
printk
(
KERN_ERR
PFX
"%s: could not up: %d
\n
"
,
printk
(
KERN_ERR
PFX
"%s: could not up: %d
\n
"
,
dev
->
name
,
err
);
dev
->
name
,
err
);
rtnl_lock
();
dev_close
(
dev
);
dev_close
(
dev
);
rtnl_unlock
();
goto
out
;
goto
out
;
}
}
}
}
...
...
drivers/net/virtio_net.c
浏览文件 @
513fd370
...
@@ -44,11 +44,15 @@ struct virtnet_info
...
@@ -44,11 +44,15 @@ struct virtnet_info
/* The skb we couldn't send because buffers were full. */
/* The skb we couldn't send because buffers were full. */
struct
sk_buff
*
last_xmit_skb
;
struct
sk_buff
*
last_xmit_skb
;
/* If we need to free in a timer, this is it. */
struct
timer_list
xmit_free_timer
;
/* Number of input buffers, and max we've ever had. */
/* Number of input buffers, and max we've ever had. */
unsigned
int
num
,
max
;
unsigned
int
num
,
max
;
/* For cleaning up after transmission. */
/* For cleaning up after transmission. */
struct
tasklet_struct
tasklet
;
struct
tasklet_struct
tasklet
;
bool
free_in_tasklet
;
/* Receive & send queues. */
/* Receive & send queues. */
struct
sk_buff_head
recv
;
struct
sk_buff_head
recv
;
...
@@ -72,7 +76,7 @@ static void skb_xmit_done(struct virtqueue *svq)
...
@@ -72,7 +76,7 @@ static void skb_xmit_done(struct virtqueue *svq)
/* Suppress further interrupts. */
/* Suppress further interrupts. */
svq
->
vq_ops
->
disable_cb
(
svq
);
svq
->
vq_ops
->
disable_cb
(
svq
);
/* We were waiting for more output buffers. */
/* We were
probably
waiting for more output buffers. */
netif_wake_queue
(
vi
->
dev
);
netif_wake_queue
(
vi
->
dev
);
/* Make sure we re-xmit last_xmit_skb: if there are no more packets
/* Make sure we re-xmit last_xmit_skb: if there are no more packets
...
@@ -94,9 +98,7 @@ static void receive_skb(struct net_device *dev, struct sk_buff *skb,
...
@@ -94,9 +98,7 @@ static void receive_skb(struct net_device *dev, struct sk_buff *skb,
BUG_ON
(
len
>
MAX_PACKET_LEN
);
BUG_ON
(
len
>
MAX_PACKET_LEN
);
skb_trim
(
skb
,
len
);
skb_trim
(
skb
,
len
);
skb
->
protocol
=
eth_type_trans
(
skb
,
dev
);
pr_debug
(
"Receiving skb proto 0x%04x len %i type %i
\n
"
,
ntohs
(
skb
->
protocol
),
skb
->
len
,
skb
->
pkt_type
);
dev
->
stats
.
rx_bytes
+=
skb
->
len
;
dev
->
stats
.
rx_bytes
+=
skb
->
len
;
dev
->
stats
.
rx_packets
++
;
dev
->
stats
.
rx_packets
++
;
...
@@ -106,6 +108,10 @@ static void receive_skb(struct net_device *dev, struct sk_buff *skb,
...
@@ -106,6 +108,10 @@ static void receive_skb(struct net_device *dev, struct sk_buff *skb,
goto
frame_err
;
goto
frame_err
;
}
}
skb
->
protocol
=
eth_type_trans
(
skb
,
dev
);
pr_debug
(
"Receiving skb proto 0x%04x len %i type %i
\n
"
,
ntohs
(
skb
->
protocol
),
skb
->
len
,
skb
->
pkt_type
);
if
(
hdr
->
gso_type
!=
VIRTIO_NET_HDR_GSO_NONE
)
{
if
(
hdr
->
gso_type
!=
VIRTIO_NET_HDR_GSO_NONE
)
{
pr_debug
(
"GSO!
\n
"
);
pr_debug
(
"GSO!
\n
"
);
switch
(
hdr
->
gso_type
&
~
VIRTIO_NET_HDR_GSO_ECN
)
{
switch
(
hdr
->
gso_type
&
~
VIRTIO_NET_HDR_GSO_ECN
)
{
...
@@ -238,9 +244,25 @@ static void free_old_xmit_skbs(struct virtnet_info *vi)
...
@@ -238,9 +244,25 @@ static void free_old_xmit_skbs(struct virtnet_info *vi)
}
}
}
}
/* If the virtio transport doesn't always notify us when all in-flight packets
* are consumed, we fall back to using this function on a timer to free them. */
static
void
xmit_free
(
unsigned
long
data
)
{
struct
virtnet_info
*
vi
=
(
void
*
)
data
;
netif_tx_lock
(
vi
->
dev
);
free_old_xmit_skbs
(
vi
);
if
(
!
skb_queue_empty
(
&
vi
->
send
))
mod_timer
(
&
vi
->
xmit_free_timer
,
jiffies
+
(
HZ
/
10
));
netif_tx_unlock
(
vi
->
dev
);
}
static
int
xmit_skb
(
struct
virtnet_info
*
vi
,
struct
sk_buff
*
skb
)
static
int
xmit_skb
(
struct
virtnet_info
*
vi
,
struct
sk_buff
*
skb
)
{
{
int
num
;
int
num
,
err
;
struct
scatterlist
sg
[
2
+
MAX_SKB_FRAGS
];
struct
scatterlist
sg
[
2
+
MAX_SKB_FRAGS
];
struct
virtio_net_hdr
*
hdr
;
struct
virtio_net_hdr
*
hdr
;
const
unsigned
char
*
dest
=
((
struct
ethhdr
*
)
skb
->
data
)
->
h_dest
;
const
unsigned
char
*
dest
=
((
struct
ethhdr
*
)
skb
->
data
)
->
h_dest
;
...
@@ -283,7 +305,11 @@ static int xmit_skb(struct virtnet_info *vi, struct sk_buff *skb)
...
@@ -283,7 +305,11 @@ static int xmit_skb(struct virtnet_info *vi, struct sk_buff *skb)
vnet_hdr_to_sg
(
sg
,
skb
);
vnet_hdr_to_sg
(
sg
,
skb
);
num
=
skb_to_sgvec
(
skb
,
sg
+
1
,
0
,
skb
->
len
)
+
1
;
num
=
skb_to_sgvec
(
skb
,
sg
+
1
,
0
,
skb
->
len
)
+
1
;
return
vi
->
svq
->
vq_ops
->
add_buf
(
vi
->
svq
,
sg
,
num
,
0
,
skb
);
err
=
vi
->
svq
->
vq_ops
->
add_buf
(
vi
->
svq
,
sg
,
num
,
0
,
skb
);
if
(
!
err
&&
!
vi
->
free_in_tasklet
)
mod_timer
(
&
vi
->
xmit_free_timer
,
jiffies
+
(
HZ
/
10
));
return
err
;
}
}
static
void
xmit_tasklet
(
unsigned
long
data
)
static
void
xmit_tasklet
(
unsigned
long
data
)
...
@@ -295,6 +321,8 @@ static void xmit_tasklet(unsigned long data)
...
@@ -295,6 +321,8 @@ static void xmit_tasklet(unsigned long data)
vi
->
svq
->
vq_ops
->
kick
(
vi
->
svq
);
vi
->
svq
->
vq_ops
->
kick
(
vi
->
svq
);
vi
->
last_xmit_skb
=
NULL
;
vi
->
last_xmit_skb
=
NULL
;
}
}
if
(
vi
->
free_in_tasklet
)
free_old_xmit_skbs
(
vi
);
netif_tx_unlock_bh
(
vi
->
dev
);
netif_tx_unlock_bh
(
vi
->
dev
);
}
}
...
@@ -435,6 +463,10 @@ static int virtnet_probe(struct virtio_device *vdev)
...
@@ -435,6 +463,10 @@ static int virtnet_probe(struct virtio_device *vdev)
vi
->
vdev
=
vdev
;
vi
->
vdev
=
vdev
;
vdev
->
priv
=
vi
;
vdev
->
priv
=
vi
;
/* If they give us a callback when all buffers are done, we don't need
* the timer. */
vi
->
free_in_tasklet
=
virtio_has_feature
(
vdev
,
VIRTIO_F_NOTIFY_ON_EMPTY
);
/* We expect two virtqueues, receive then send. */
/* We expect two virtqueues, receive then send. */
vi
->
rvq
=
vdev
->
config
->
find_vq
(
vdev
,
0
,
skb_recv_done
);
vi
->
rvq
=
vdev
->
config
->
find_vq
(
vdev
,
0
,
skb_recv_done
);
if
(
IS_ERR
(
vi
->
rvq
))
{
if
(
IS_ERR
(
vi
->
rvq
))
{
...
@@ -454,6 +486,9 @@ static int virtnet_probe(struct virtio_device *vdev)
...
@@ -454,6 +486,9 @@ static int virtnet_probe(struct virtio_device *vdev)
tasklet_init
(
&
vi
->
tasklet
,
xmit_tasklet
,
(
unsigned
long
)
vi
);
tasklet_init
(
&
vi
->
tasklet
,
xmit_tasklet
,
(
unsigned
long
)
vi
);
if
(
!
vi
->
free_in_tasklet
)
setup_timer
(
&
vi
->
xmit_free_timer
,
xmit_free
,
(
unsigned
long
)
vi
);
err
=
register_netdev
(
dev
);
err
=
register_netdev
(
dev
);
if
(
err
)
{
if
(
err
)
{
pr_debug
(
"virtio_net: registering device failed
\n
"
);
pr_debug
(
"virtio_net: registering device failed
\n
"
);
...
@@ -491,6 +526,9 @@ static void virtnet_remove(struct virtio_device *vdev)
...
@@ -491,6 +526,9 @@ static void virtnet_remove(struct virtio_device *vdev)
/* Stop all the virtqueues. */
/* Stop all the virtqueues. */
vdev
->
config
->
reset
(
vdev
);
vdev
->
config
->
reset
(
vdev
);
if
(
!
vi
->
free_in_tasklet
)
del_timer_sync
(
&
vi
->
xmit_free_timer
);
/* Free our skbs in send and recv queues, if any. */
/* Free our skbs in send and recv queues, if any. */
while
((
skb
=
__skb_dequeue
(
&
vi
->
recv
))
!=
NULL
)
{
while
((
skb
=
__skb_dequeue
(
&
vi
->
recv
))
!=
NULL
)
{
kfree_skb
(
skb
);
kfree_skb
(
skb
);
...
@@ -514,7 +552,7 @@ static struct virtio_device_id id_table[] = {
...
@@ -514,7 +552,7 @@ static struct virtio_device_id id_table[] = {
static
unsigned
int
features
[]
=
{
static
unsigned
int
features
[]
=
{
VIRTIO_NET_F_CSUM
,
VIRTIO_NET_F_GSO
,
VIRTIO_NET_F_MAC
,
VIRTIO_NET_F_CSUM
,
VIRTIO_NET_F_GSO
,
VIRTIO_NET_F_MAC
,
VIRTIO_NET_F_HOST_TSO4
,
VIRTIO_NET_F_HOST_UFO
,
VIRTIO_NET_F_HOST_TSO6
,
VIRTIO_NET_F_HOST_TSO4
,
VIRTIO_NET_F_HOST_UFO
,
VIRTIO_NET_F_HOST_TSO6
,
VIRTIO_NET_F_HOST_ECN
,
VIRTIO_NET_F_HOST_ECN
,
VIRTIO_F_NOTIFY_ON_EMPTY
,
};
};
static
struct
virtio_driver
virtio_net
=
{
static
struct
virtio_driver
virtio_net
=
{
...
...
drivers/s390/net/qeth_core_main.c
浏览文件 @
513fd370
...
@@ -290,9 +290,6 @@ int qeth_set_large_send(struct qeth_card *card,
...
@@ -290,9 +290,6 @@ int qeth_set_large_send(struct qeth_card *card,
card
->
dev
->
features
|=
NETIF_F_TSO
|
NETIF_F_SG
|
card
->
dev
->
features
|=
NETIF_F_TSO
|
NETIF_F_SG
|
NETIF_F_HW_CSUM
;
NETIF_F_HW_CSUM
;
}
else
{
}
else
{
PRINT_WARN
(
"TSO not supported on %s. "
"large_send set to 'no'.
\n
"
,
card
->
dev
->
name
);
card
->
dev
->
features
&=
~
(
NETIF_F_TSO
|
NETIF_F_SG
|
card
->
dev
->
features
&=
~
(
NETIF_F_TSO
|
NETIF_F_SG
|
NETIF_F_HW_CSUM
);
NETIF_F_HW_CSUM
);
card
->
options
.
large_send
=
QETH_LARGE_SEND_NO
;
card
->
options
.
large_send
=
QETH_LARGE_SEND_NO
;
...
@@ -1407,12 +1404,6 @@ static void qeth_init_func_level(struct qeth_card *card)
...
@@ -1407,12 +1404,6 @@ static void qeth_init_func_level(struct qeth_card *card)
}
}
}
}
static
inline
__u16
qeth_raw_devno_from_bus_id
(
char
*
id
)
{
id
+=
(
strlen
(
id
)
-
4
);
return
(
__u16
)
simple_strtoul
(
id
,
&
id
,
16
);
}
static
int
qeth_idx_activate_get_answer
(
struct
qeth_channel
*
channel
,
static
int
qeth_idx_activate_get_answer
(
struct
qeth_channel
*
channel
,
void
(
*
idx_reply_cb
)(
struct
qeth_channel
*
,
void
(
*
idx_reply_cb
)(
struct
qeth_channel
*
,
struct
qeth_cmd_buffer
*
))
struct
qeth_cmd_buffer
*
))
...
@@ -1439,7 +1430,7 @@ static int qeth_idx_activate_get_answer(struct qeth_channel *channel,
...
@@ -1439,7 +1430,7 @@ static int qeth_idx_activate_get_answer(struct qeth_channel *channel,
spin_unlock_irqrestore
(
get_ccwdev_lock
(
channel
->
ccwdev
),
flags
);
spin_unlock_irqrestore
(
get_ccwdev_lock
(
channel
->
ccwdev
),
flags
);
if
(
rc
)
{
if
(
rc
)
{
PRINT_ERR
(
"Error2 in activating channel rc=%d
\n
"
,
rc
);
QETH_DBF_MESSAGE
(
2
,
"Error2 in activating channel rc=%d
\n
"
,
rc
);
QETH_DBF_TEXT_
(
SETUP
,
2
,
"2err%d"
,
rc
);
QETH_DBF_TEXT_
(
SETUP
,
2
,
"2err%d"
,
rc
);
atomic_set
(
&
channel
->
irq_pending
,
0
);
atomic_set
(
&
channel
->
irq_pending
,
0
);
wake_up
(
&
card
->
wait_q
);
wake_up
(
&
card
->
wait_q
);
...
@@ -1468,6 +1459,7 @@ static int qeth_idx_activate_channel(struct qeth_channel *channel,
...
@@ -1468,6 +1459,7 @@ static int qeth_idx_activate_channel(struct qeth_channel *channel,
__u16
temp
;
__u16
temp
;
__u8
tmp
;
__u8
tmp
;
int
rc
;
int
rc
;
struct
ccw_dev_id
temp_devid
;
card
=
CARD_FROM_CDEV
(
channel
->
ccwdev
);
card
=
CARD_FROM_CDEV
(
channel
->
ccwdev
);
...
@@ -1494,8 +1486,8 @@ static int qeth_idx_activate_channel(struct qeth_channel *channel,
...
@@ -1494,8 +1486,8 @@ static int qeth_idx_activate_channel(struct qeth_channel *channel,
&
card
->
token
.
issuer_rm_w
,
QETH_MPC_TOKEN_LENGTH
);
&
card
->
token
.
issuer_rm_w
,
QETH_MPC_TOKEN_LENGTH
);
memcpy
(
QETH_IDX_ACT_FUNC_LEVEL
(
iob
->
data
),
memcpy
(
QETH_IDX_ACT_FUNC_LEVEL
(
iob
->
data
),
&
card
->
info
.
func_level
,
sizeof
(
__u16
));
&
card
->
info
.
func_level
,
sizeof
(
__u16
));
temp
=
qeth_raw_devno_from_bus_id
(
CARD_DDEV_ID
(
card
)
);
ccw_device_get_id
(
CARD_DDEV
(
card
),
&
temp_devid
);
memcpy
(
QETH_IDX_ACT_QDIO_DEV_CUA
(
iob
->
data
),
&
temp
,
2
);
memcpy
(
QETH_IDX_ACT_QDIO_DEV_CUA
(
iob
->
data
),
&
temp
_devid
.
devno
,
2
);
temp
=
(
card
->
info
.
cula
<<
8
)
+
card
->
info
.
unit_addr2
;
temp
=
(
card
->
info
.
cula
<<
8
)
+
card
->
info
.
unit_addr2
;
memcpy
(
QETH_IDX_ACT_QDIO_DEV_REALADDR
(
iob
->
data
),
&
temp
,
2
);
memcpy
(
QETH_IDX_ACT_QDIO_DEV_REALADDR
(
iob
->
data
),
&
temp
,
2
);
...
@@ -1508,7 +1500,8 @@ static int qeth_idx_activate_channel(struct qeth_channel *channel,
...
@@ -1508,7 +1500,8 @@ static int qeth_idx_activate_channel(struct qeth_channel *channel,
spin_unlock_irqrestore
(
get_ccwdev_lock
(
channel
->
ccwdev
),
flags
);
spin_unlock_irqrestore
(
get_ccwdev_lock
(
channel
->
ccwdev
),
flags
);
if
(
rc
)
{
if
(
rc
)
{
PRINT_ERR
(
"Error1 in activating channel. rc=%d
\n
"
,
rc
);
QETH_DBF_MESSAGE
(
2
,
"Error1 in activating channel. rc=%d
\n
"
,
rc
);
QETH_DBF_TEXT_
(
SETUP
,
2
,
"1err%d"
,
rc
);
QETH_DBF_TEXT_
(
SETUP
,
2
,
"1err%d"
,
rc
);
atomic_set
(
&
channel
->
irq_pending
,
0
);
atomic_set
(
&
channel
->
irq_pending
,
0
);
wake_up
(
&
card
->
wait_q
);
wake_up
(
&
card
->
wait_q
);
...
@@ -1658,7 +1651,6 @@ int qeth_send_control_data(struct qeth_card *card, int len,
...
@@ -1658,7 +1651,6 @@ int qeth_send_control_data(struct qeth_card *card, int len,
reply
=
qeth_alloc_reply
(
card
);
reply
=
qeth_alloc_reply
(
card
);
if
(
!
reply
)
{
if
(
!
reply
)
{
PRINT_WARN
(
"Could not alloc qeth_reply!
\n
"
);
return
-
ENOMEM
;
return
-
ENOMEM
;
}
}
reply
->
callback
=
reply_cb
;
reply
->
callback
=
reply_cb
;
...
@@ -2612,15 +2604,9 @@ void qeth_queue_input_buffer(struct qeth_card *card, int index)
...
@@ -2612,15 +2604,9 @@ void qeth_queue_input_buffer(struct qeth_card *card, int index)
if
(
newcount
<
count
)
{
if
(
newcount
<
count
)
{
/* we are in memory shortage so we switch back to
/* we are in memory shortage so we switch back to
traditional skb allocation and drop packages */
traditional skb allocation and drop packages */
if
(
!
atomic_read
(
&
card
->
force_alloc_skb
)
&&
net_ratelimit
())
PRINT_WARN
(
"Switch to alloc skb
\n
"
);
atomic_set
(
&
card
->
force_alloc_skb
,
3
);
atomic_set
(
&
card
->
force_alloc_skb
,
3
);
count
=
newcount
;
count
=
newcount
;
}
else
{
}
else
{
if
((
atomic_read
(
&
card
->
force_alloc_skb
)
==
1
)
&&
net_ratelimit
())
PRINT_WARN
(
"Switch to sg
\n
"
);
atomic_add_unless
(
&
card
->
force_alloc_skb
,
-
1
,
0
);
atomic_add_unless
(
&
card
->
force_alloc_skb
,
-
1
,
0
);
}
}
...
@@ -3034,7 +3020,7 @@ int qeth_get_elements_no(struct qeth_card *card, void *hdr,
...
@@ -3034,7 +3020,7 @@ int qeth_get_elements_no(struct qeth_card *card, void *hdr,
elements_needed
=
1
+
(((((
unsigned
long
)
hdr
)
%
PAGE_SIZE
)
elements_needed
=
1
+
(((((
unsigned
long
)
hdr
)
%
PAGE_SIZE
)
+
skb
->
len
)
>>
PAGE_SHIFT
);
+
skb
->
len
)
>>
PAGE_SHIFT
);
if
((
elements_needed
+
elems
)
>
QETH_MAX_BUFFER_ELEMENTS
(
card
))
{
if
((
elements_needed
+
elems
)
>
QETH_MAX_BUFFER_ELEMENTS
(
card
))
{
PRINT_ERR
(
"Invalid size of IP packet "
QETH_DBF_MESSAGE
(
2
,
"Invalid size of IP packet "
"(Number=%d / Length=%d). Discarded.
\n
"
,
"(Number=%d / Length=%d). Discarded.
\n
"
,
(
elements_needed
+
elems
),
skb
->
len
);
(
elements_needed
+
elems
),
skb
->
len
);
return
0
;
return
0
;
...
@@ -3247,8 +3233,6 @@ int qeth_do_send_packet(struct qeth_card *card, struct qeth_qdio_out_q *queue,
...
@@ -3247,8 +3233,6 @@ int qeth_do_send_packet(struct qeth_card *card, struct qeth_qdio_out_q *queue,
* free buffers) to handle eddp context */
* free buffers) to handle eddp context */
if
(
qeth_eddp_check_buffers_for_context
(
queue
,
ctx
)
if
(
qeth_eddp_check_buffers_for_context
(
queue
,
ctx
)
<
0
)
{
<
0
)
{
if
(
net_ratelimit
())
PRINT_WARN
(
"eddp tx_dropped 1
\n
"
);
rc
=
-
EBUSY
;
rc
=
-
EBUSY
;
goto
out
;
goto
out
;
}
}
...
@@ -3260,7 +3244,6 @@ int qeth_do_send_packet(struct qeth_card *card, struct qeth_qdio_out_q *queue,
...
@@ -3260,7 +3244,6 @@ int qeth_do_send_packet(struct qeth_card *card, struct qeth_qdio_out_q *queue,
tmp
=
qeth_eddp_fill_buffer
(
queue
,
ctx
,
tmp
=
qeth_eddp_fill_buffer
(
queue
,
ctx
,
queue
->
next_buf_to_fill
);
queue
->
next_buf_to_fill
);
if
(
tmp
<
0
)
{
if
(
tmp
<
0
)
{
PRINT_ERR
(
"eddp tx_dropped 2
\n
"
);
rc
=
-
EBUSY
;
rc
=
-
EBUSY
;
goto
out
;
goto
out
;
}
}
...
@@ -3602,8 +3585,6 @@ int qeth_snmp_command(struct qeth_card *card, char __user *udata)
...
@@ -3602,8 +3585,6 @@ int qeth_snmp_command(struct qeth_card *card, char __user *udata)
if
((
!
qeth_adp_supported
(
card
,
IPA_SETADP_SET_SNMP_CONTROL
))
&&
if
((
!
qeth_adp_supported
(
card
,
IPA_SETADP_SET_SNMP_CONTROL
))
&&
(
!
card
->
options
.
layer2
))
{
(
!
card
->
options
.
layer2
))
{
PRINT_WARN
(
"SNMP Query MIBS not supported "
"on %s!
\n
"
,
QETH_CARD_IFNAME
(
card
));
return
-
EOPNOTSUPP
;
return
-
EOPNOTSUPP
;
}
}
/* skip 4 bytes (data_len struct member) to get req_len */
/* skip 4 bytes (data_len struct member) to get req_len */
...
@@ -3634,7 +3615,7 @@ int qeth_snmp_command(struct qeth_card *card, char __user *udata)
...
@@ -3634,7 +3615,7 @@ int qeth_snmp_command(struct qeth_card *card, char __user *udata)
rc
=
qeth_send_ipa_snmp_cmd
(
card
,
iob
,
QETH_SETADP_BASE_LEN
+
req_len
,
rc
=
qeth_send_ipa_snmp_cmd
(
card
,
iob
,
QETH_SETADP_BASE_LEN
+
req_len
,
qeth_snmp_command_cb
,
(
void
*
)
&
qinfo
);
qeth_snmp_command_cb
,
(
void
*
)
&
qinfo
);
if
(
rc
)
if
(
rc
)
PRINT_WARN
(
"SNMP command failed on %s: (0x%x)
\n
"
,
QETH_DBF_MESSAGE
(
2
,
"SNMP command failed on %s: (0x%x)
\n
"
,
QETH_CARD_IFNAME
(
card
),
rc
);
QETH_CARD_IFNAME
(
card
),
rc
);
else
{
else
{
if
(
copy_to_user
(
udata
,
qinfo
.
udata
,
qinfo
.
udata_len
))
if
(
copy_to_user
(
udata
,
qinfo
.
udata
,
qinfo
.
udata_len
))
...
@@ -3807,8 +3788,8 @@ int qeth_core_hardsetup_card(struct qeth_card *card)
...
@@ -3807,8 +3788,8 @@ int qeth_core_hardsetup_card(struct qeth_card *card)
if
(
mpno
)
if
(
mpno
)
mpno
=
min
(
mpno
-
1
,
QETH_MAX_PORTNO
);
mpno
=
min
(
mpno
-
1
,
QETH_MAX_PORTNO
);
if
(
card
->
info
.
portno
>
mpno
)
{
if
(
card
->
info
.
portno
>
mpno
)
{
PRINT_ERR
(
"Device %s does not offer port number %d
\n
."
,
QETH_DBF_MESSAGE
(
2
,
"Device %s does not offer port number %d"
CARD_BUS_ID
(
card
),
card
->
info
.
portno
);
"
\n
."
,
CARD_BUS_ID
(
card
),
card
->
info
.
portno
);
rc
=
-
ENODEV
;
rc
=
-
ENODEV
;
goto
out
;
goto
out
;
}
}
...
@@ -3985,8 +3966,6 @@ struct sk_buff *qeth_core_get_next_skb(struct qeth_card *card,
...
@@ -3985,8 +3966,6 @@ struct sk_buff *qeth_core_get_next_skb(struct qeth_card *card,
return
skb
;
return
skb
;
no_mem:
no_mem:
if
(
net_ratelimit
())
{
if
(
net_ratelimit
())
{
PRINT_WARN
(
"No memory for packet received on %s.
\n
"
,
QETH_CARD_IFNAME
(
card
));
QETH_DBF_TEXT
(
TRACE
,
2
,
"noskbmem"
);
QETH_DBF_TEXT
(
TRACE
,
2
,
"noskbmem"
);
QETH_DBF_TEXT_
(
TRACE
,
2
,
"%s"
,
CARD_BUS_ID
(
card
));
QETH_DBF_TEXT_
(
TRACE
,
2
,
"%s"
,
CARD_BUS_ID
(
card
));
}
}
...
@@ -4004,15 +3983,17 @@ static void qeth_unregister_dbf_views(void)
...
@@ -4004,15 +3983,17 @@ static void qeth_unregister_dbf_views(void)
}
}
}
}
void
qeth_dbf_longtext
(
enum
qeth_dbf_names
dbf_nix
,
int
level
,
char
*
tex
t
,
...)
void
qeth_dbf_longtext
(
enum
qeth_dbf_names
dbf_nix
,
int
level
,
char
*
fm
t
,
...)
{
{
char
dbf_txt_buf
[
32
];
char
dbf_txt_buf
[
32
];
va_list
args
;
if
(
level
>
(
qeth_dbf
[
dbf_nix
].
id
)
->
level
)
if
(
level
>
(
qeth_dbf
[
dbf_nix
].
id
)
->
level
)
return
;
return
;
snprintf
(
dbf_txt_buf
,
sizeof
(
dbf_txt_buf
),
text
);
va_start
(
args
,
fmt
);
vsnprintf
(
dbf_txt_buf
,
sizeof
(
dbf_txt_buf
),
fmt
,
args
);
va_end
(
args
);
debug_text_event
(
qeth_dbf
[
dbf_nix
].
id
,
level
,
dbf_txt_buf
);
debug_text_event
(
qeth_dbf
[
dbf_nix
].
id
,
level
,
dbf_txt_buf
);
}
}
EXPORT_SYMBOL_GPL
(
qeth_dbf_longtext
);
EXPORT_SYMBOL_GPL
(
qeth_dbf_longtext
);
...
...
drivers/s390/net/qeth_core_offl.c
浏览文件 @
513fd370
...
@@ -122,8 +122,8 @@ int qeth_eddp_fill_buffer(struct qeth_qdio_out_q *queue,
...
@@ -122,8 +122,8 @@ int qeth_eddp_fill_buffer(struct qeth_qdio_out_q *queue,
if
(
element
==
0
)
if
(
element
==
0
)
return
-
EBUSY
;
return
-
EBUSY
;
else
{
else
{
PRINT_WARN
(
"could only partially fill eddp
"
QETH_DBF_MESSAGE
(
2
,
"could only partially fill
"
"
buffer!
\n
"
);
"eddp
buffer!
\n
"
);
goto
out
;
goto
out
;
}
}
}
}
...
@@ -143,8 +143,6 @@ int qeth_eddp_fill_buffer(struct qeth_qdio_out_q *queue,
...
@@ -143,8 +143,6 @@ int qeth_eddp_fill_buffer(struct qeth_qdio_out_q *queue,
if
(
must_refcnt
)
{
if
(
must_refcnt
)
{
must_refcnt
=
0
;
must_refcnt
=
0
;
if
(
qeth_eddp_buf_ref_context
(
buf
,
ctx
))
{
if
(
qeth_eddp_buf_ref_context
(
buf
,
ctx
))
{
PRINT_WARN
(
"no memory to create eddp context "
"reference
\n
"
);
goto
out_check
;
goto
out_check
;
}
}
}
}
...
...
drivers/s390/net/qeth_core_sys.c
浏览文件 @
513fd370
...
@@ -129,7 +129,6 @@ static ssize_t qeth_dev_portno_store(struct device *dev,
...
@@ -129,7 +129,6 @@ static ssize_t qeth_dev_portno_store(struct device *dev,
portno
=
simple_strtoul
(
buf
,
&
tmp
,
16
);
portno
=
simple_strtoul
(
buf
,
&
tmp
,
16
);
if
(
portno
>
QETH_MAX_PORTNO
)
{
if
(
portno
>
QETH_MAX_PORTNO
)
{
PRINT_WARN
(
"portno 0x%X is out of range
\n
"
,
portno
);
return
-
EINVAL
;
return
-
EINVAL
;
}
}
...
@@ -223,8 +222,6 @@ static ssize_t qeth_dev_prioqing_store(struct device *dev,
...
@@ -223,8 +222,6 @@ static ssize_t qeth_dev_prioqing_store(struct device *dev,
* if though we have to permit priority queueing
* if though we have to permit priority queueing
*/
*/
if
(
card
->
qdio
.
no_out_queues
==
1
)
{
if
(
card
->
qdio
.
no_out_queues
==
1
)
{
PRINT_WARN
(
"Priority queueing disabled due "
"to hardware limitations!
\n
"
);
card
->
qdio
.
do_prio_queueing
=
QETH_PRIOQ_DEFAULT
;
card
->
qdio
.
do_prio_queueing
=
QETH_PRIOQ_DEFAULT
;
return
-
EPERM
;
return
-
EPERM
;
}
}
...
@@ -250,7 +247,6 @@ static ssize_t qeth_dev_prioqing_store(struct device *dev,
...
@@ -250,7 +247,6 @@ static ssize_t qeth_dev_prioqing_store(struct device *dev,
card
->
qdio
.
do_prio_queueing
=
QETH_NO_PRIO_QUEUEING
;
card
->
qdio
.
do_prio_queueing
=
QETH_NO_PRIO_QUEUEING
;
card
->
qdio
.
default_out_queue
=
QETH_DEFAULT_QUEUE
;
card
->
qdio
.
default_out_queue
=
QETH_DEFAULT_QUEUE
;
}
else
{
}
else
{
PRINT_WARN
(
"Unknown queueing type '%s'
\n
"
,
tmp
);
return
-
EINVAL
;
return
-
EINVAL
;
}
}
return
count
;
return
count
;
...
@@ -291,9 +287,6 @@ static ssize_t qeth_dev_bufcnt_store(struct device *dev,
...
@@ -291,9 +287,6 @@ static ssize_t qeth_dev_bufcnt_store(struct device *dev,
((
cnt
>
QETH_IN_BUF_COUNT_MAX
)
?
QETH_IN_BUF_COUNT_MAX
:
cnt
);
((
cnt
>
QETH_IN_BUF_COUNT_MAX
)
?
QETH_IN_BUF_COUNT_MAX
:
cnt
);
if
(
old_cnt
!=
cnt
)
{
if
(
old_cnt
!=
cnt
)
{
rc
=
qeth_realloc_buffer_pool
(
card
,
cnt
);
rc
=
qeth_realloc_buffer_pool
(
card
,
cnt
);
if
(
rc
)
PRINT_WARN
(
"Error (%d) while setting "
"buffer count.
\n
"
,
rc
);
}
}
return
count
;
return
count
;
}
}
...
@@ -355,7 +348,6 @@ static ssize_t qeth_dev_performance_stats_store(struct device *dev,
...
@@ -355,7 +348,6 @@ static ssize_t qeth_dev_performance_stats_store(struct device *dev,
card
->
perf_stats
.
initial_rx_packets
=
card
->
stats
.
rx_packets
;
card
->
perf_stats
.
initial_rx_packets
=
card
->
stats
.
rx_packets
;
card
->
perf_stats
.
initial_tx_packets
=
card
->
stats
.
tx_packets
;
card
->
perf_stats
.
initial_tx_packets
=
card
->
stats
.
tx_packets
;
}
else
{
}
else
{
PRINT_WARN
(
"performance_stats: write 0 or 1 to this file!
\n
"
);
return
-
EINVAL
;
return
-
EINVAL
;
}
}
return
count
;
return
count
;
...
@@ -399,7 +391,6 @@ static ssize_t qeth_dev_layer2_store(struct device *dev,
...
@@ -399,7 +391,6 @@ static ssize_t qeth_dev_layer2_store(struct device *dev,
newdis
=
QETH_DISCIPLINE_LAYER2
;
newdis
=
QETH_DISCIPLINE_LAYER2
;
break
;
break
;
default:
default:
PRINT_WARN
(
"layer2: write 0 or 1 to this file!
\n
"
);
return
-
EINVAL
;
return
-
EINVAL
;
}
}
...
@@ -463,7 +454,6 @@ static ssize_t qeth_dev_large_send_store(struct device *dev,
...
@@ -463,7 +454,6 @@ static ssize_t qeth_dev_large_send_store(struct device *dev,
}
else
if
(
!
strcmp
(
tmp
,
"TSO"
))
{
}
else
if
(
!
strcmp
(
tmp
,
"TSO"
))
{
type
=
QETH_LARGE_SEND_TSO
;
type
=
QETH_LARGE_SEND_TSO
;
}
else
{
}
else
{
PRINT_WARN
(
"large_send: invalid mode %s!
\n
"
,
tmp
);
return
-
EINVAL
;
return
-
EINVAL
;
}
}
if
(
card
->
options
.
large_send
==
type
)
if
(
card
->
options
.
large_send
==
type
)
...
@@ -503,8 +493,6 @@ static ssize_t qeth_dev_blkt_store(struct qeth_card *card,
...
@@ -503,8 +493,6 @@ static ssize_t qeth_dev_blkt_store(struct qeth_card *card,
if
(
i
<=
max_value
)
{
if
(
i
<=
max_value
)
{
*
value
=
i
;
*
value
=
i
;
}
else
{
}
else
{
PRINT_WARN
(
"blkt total time: write values between"
" 0 and %d to this file!
\n
"
,
max_value
);
return
-
EINVAL
;
return
-
EINVAL
;
}
}
return
count
;
return
count
;
...
...
drivers/s390/net/qeth_l2_main.c
浏览文件 @
513fd370
...
@@ -101,19 +101,16 @@ static struct net_device *qeth_l2_netdev_by_devno(unsigned char *read_dev_no)
...
@@ -101,19 +101,16 @@ static struct net_device *qeth_l2_netdev_by_devno(unsigned char *read_dev_no)
{
{
struct
qeth_card
*
card
;
struct
qeth_card
*
card
;
struct
net_device
*
ndev
;
struct
net_device
*
ndev
;
unsigned
char
*
readno
;
__u16
temp_dev_no
;
__u16
temp_dev_no
,
card_dev_no
;
char
*
endp
;
unsigned
long
flags
;
unsigned
long
flags
;
struct
ccw_dev_id
read_devid
;
ndev
=
NULL
;
ndev
=
NULL
;
memcpy
(
&
temp_dev_no
,
read_dev_no
,
2
);
memcpy
(
&
temp_dev_no
,
read_dev_no
,
2
);
read_lock_irqsave
(
&
qeth_core_card_list
.
rwlock
,
flags
);
read_lock_irqsave
(
&
qeth_core_card_list
.
rwlock
,
flags
);
list_for_each_entry
(
card
,
&
qeth_core_card_list
.
list
,
list
)
{
list_for_each_entry
(
card
,
&
qeth_core_card_list
.
list
,
list
)
{
readno
=
CARD_RDEV_ID
(
card
);
ccw_device_get_id
(
CARD_RDEV
(
card
),
&
read_devid
);
readno
+=
(
strlen
(
readno
)
-
4
);
if
(
read_devid
.
devno
==
temp_dev_no
)
{
card_dev_no
=
simple_strtoul
(
readno
,
&
endp
,
16
);
if
(
card_dev_no
==
temp_dev_no
)
{
ndev
=
card
->
dev
;
ndev
=
card
->
dev
;
break
;
break
;
}
}
...
@@ -134,14 +131,14 @@ static int qeth_l2_send_setgroupmac_cb(struct qeth_card *card,
...
@@ -134,14 +131,14 @@ static int qeth_l2_send_setgroupmac_cb(struct qeth_card *card,
mac
=
&
cmd
->
data
.
setdelmac
.
mac
[
0
];
mac
=
&
cmd
->
data
.
setdelmac
.
mac
[
0
];
/* MAC already registered, needed in couple/uncouple case */
/* MAC already registered, needed in couple/uncouple case */
if
(
cmd
->
hdr
.
return_code
==
0x2005
)
{
if
(
cmd
->
hdr
.
return_code
==
0x2005
)
{
PRINT_WARN
(
"Group MAC %02x:%02x:%02x:%02x:%02x:%02x "
\
QETH_DBF_MESSAGE
(
2
,
"Group MAC %02x:%02x:%02x:%02x:%02x:%02x "
"already existing on %s
\n
"
,
"already existing on %s
\n
"
,
mac
[
0
],
mac
[
1
],
mac
[
2
],
mac
[
3
],
mac
[
4
],
mac
[
5
],
mac
[
0
],
mac
[
1
],
mac
[
2
],
mac
[
3
],
mac
[
4
],
mac
[
5
],
QETH_CARD_IFNAME
(
card
));
QETH_CARD_IFNAME
(
card
));
cmd
->
hdr
.
return_code
=
0
;
cmd
->
hdr
.
return_code
=
0
;
}
}
if
(
cmd
->
hdr
.
return_code
)
if
(
cmd
->
hdr
.
return_code
)
PRINT_ERR
(
"Could not set group MAC "
\
QETH_DBF_MESSAGE
(
2
,
"Could not set group MAC "
"%02x:%02x:%02x:%02x:%02x:%02x on %s: %x
\n
"
,
"%02x:%02x:%02x:%02x:%02x:%02x on %s: %x
\n
"
,
mac
[
0
],
mac
[
1
],
mac
[
2
],
mac
[
3
],
mac
[
4
],
mac
[
5
],
mac
[
0
],
mac
[
1
],
mac
[
2
],
mac
[
3
],
mac
[
4
],
mac
[
5
],
QETH_CARD_IFNAME
(
card
),
cmd
->
hdr
.
return_code
);
QETH_CARD_IFNAME
(
card
),
cmd
->
hdr
.
return_code
);
...
@@ -166,7 +163,7 @@ static int qeth_l2_send_delgroupmac_cb(struct qeth_card *card,
...
@@ -166,7 +163,7 @@ static int qeth_l2_send_delgroupmac_cb(struct qeth_card *card,
cmd
=
(
struct
qeth_ipa_cmd
*
)
data
;
cmd
=
(
struct
qeth_ipa_cmd
*
)
data
;
mac
=
&
cmd
->
data
.
setdelmac
.
mac
[
0
];
mac
=
&
cmd
->
data
.
setdelmac
.
mac
[
0
];
if
(
cmd
->
hdr
.
return_code
)
if
(
cmd
->
hdr
.
return_code
)
PRINT_ERR
(
"Could not delete group MAC "
\
QETH_DBF_MESSAGE
(
2
,
"Could not delete group MAC "
"%02x:%02x:%02x:%02x:%02x:%02x on %s: %x
\n
"
,
"%02x:%02x:%02x:%02x:%02x:%02x on %s: %x
\n
"
,
mac
[
0
],
mac
[
1
],
mac
[
2
],
mac
[
3
],
mac
[
4
],
mac
[
5
],
mac
[
0
],
mac
[
1
],
mac
[
2
],
mac
[
3
],
mac
[
4
],
mac
[
5
],
QETH_CARD_IFNAME
(
card
),
cmd
->
hdr
.
return_code
);
QETH_CARD_IFNAME
(
card
),
cmd
->
hdr
.
return_code
);
...
@@ -186,10 +183,8 @@ static void qeth_l2_add_mc(struct qeth_card *card, __u8 *mac)
...
@@ -186,10 +183,8 @@ static void qeth_l2_add_mc(struct qeth_card *card, __u8 *mac)
mc
=
kmalloc
(
sizeof
(
struct
qeth_mc_mac
),
GFP_ATOMIC
);
mc
=
kmalloc
(
sizeof
(
struct
qeth_mc_mac
),
GFP_ATOMIC
);
if
(
!
mc
)
{
if
(
!
mc
)
PRINT_ERR
(
"no mem vor mc mac address
\n
"
);
return
;
return
;
}
memcpy
(
mc
->
mc_addr
,
mac
,
OSA_ADDR_LEN
);
memcpy
(
mc
->
mc_addr
,
mac
,
OSA_ADDR_LEN
);
mc
->
mc_addrlen
=
OSA_ADDR_LEN
;
mc
->
mc_addrlen
=
OSA_ADDR_LEN
;
...
@@ -280,7 +275,7 @@ static int qeth_l2_send_setdelvlan_cb(struct qeth_card *card,
...
@@ -280,7 +275,7 @@ static int qeth_l2_send_setdelvlan_cb(struct qeth_card *card,
QETH_DBF_TEXT
(
TRACE
,
2
,
"L2sdvcb"
);
QETH_DBF_TEXT
(
TRACE
,
2
,
"L2sdvcb"
);
cmd
=
(
struct
qeth_ipa_cmd
*
)
data
;
cmd
=
(
struct
qeth_ipa_cmd
*
)
data
;
if
(
cmd
->
hdr
.
return_code
)
{
if
(
cmd
->
hdr
.
return_code
)
{
PRINT_ERR
(
"Error in processing VLAN %i on %s: 0x%x. "
QETH_DBF_MESSAGE
(
2
,
"Error in processing VLAN %i on %s: 0x%x. "
"Continuing
\n
"
,
cmd
->
data
.
setdelvlan
.
vlan_id
,
"Continuing
\n
"
,
cmd
->
data
.
setdelvlan
.
vlan_id
,
QETH_CARD_IFNAME
(
card
),
cmd
->
hdr
.
return_code
);
QETH_CARD_IFNAME
(
card
),
cmd
->
hdr
.
return_code
);
QETH_DBF_TEXT_
(
TRACE
,
2
,
"L2VL%4x"
,
cmd
->
hdr
.
command
);
QETH_DBF_TEXT_
(
TRACE
,
2
,
"L2VL%4x"
,
cmd
->
hdr
.
command
);
...
@@ -333,8 +328,6 @@ static void qeth_l2_vlan_rx_add_vid(struct net_device *dev, unsigned short vid)
...
@@ -333,8 +328,6 @@ static void qeth_l2_vlan_rx_add_vid(struct net_device *dev, unsigned short vid)
spin_lock_bh
(
&
card
->
vlanlock
);
spin_lock_bh
(
&
card
->
vlanlock
);
list_add_tail
(
&
id
->
list
,
&
card
->
vid_list
);
list_add_tail
(
&
id
->
list
,
&
card
->
vid_list
);
spin_unlock_bh
(
&
card
->
vlanlock
);
spin_unlock_bh
(
&
card
->
vlanlock
);
}
else
{
PRINT_ERR
(
"no memory for vid
\n
"
);
}
}
}
}
...
@@ -550,16 +543,15 @@ static int qeth_l2_request_initial_mac(struct qeth_card *card)
...
@@ -550,16 +543,15 @@ static int qeth_l2_request_initial_mac(struct qeth_card *card)
rc
=
qeth_query_setadapterparms
(
card
);
rc
=
qeth_query_setadapterparms
(
card
);
if
(
rc
)
{
if
(
rc
)
{
PRINT_WARN
(
"could not query adapter parameters on device %s:
"
QETH_DBF_MESSAGE
(
2
,
"could not query adapter parameters on
"
"
x%x
\n
"
,
CARD_BUS_ID
(
card
),
rc
);
"device %s:
x%x
\n
"
,
CARD_BUS_ID
(
card
),
rc
);
}
}
if
(
card
->
info
.
guestlan
)
{
if
(
card
->
info
.
guestlan
)
{
rc
=
qeth_setadpparms_change_macaddr
(
card
);
rc
=
qeth_setadpparms_change_macaddr
(
card
);
if
(
rc
)
{
if
(
rc
)
{
PRINT_WARN
(
"couldn't get MAC address on "
QETH_DBF_MESSAGE
(
2
,
"couldn't get MAC address on "
"device %s: x%x
\n
"
,
"device %s: x%x
\n
"
,
CARD_BUS_ID
(
card
),
rc
);
CARD_BUS_ID
(
card
),
rc
);
QETH_DBF_TEXT_
(
SETUP
,
2
,
"1err%d"
,
rc
);
QETH_DBF_TEXT_
(
SETUP
,
2
,
"1err%d"
,
rc
);
return
rc
;
return
rc
;
}
}
...
@@ -585,8 +577,6 @@ static int qeth_l2_set_mac_address(struct net_device *dev, void *p)
...
@@ -585,8 +577,6 @@ static int qeth_l2_set_mac_address(struct net_device *dev, void *p)
}
}
if
(
card
->
info
.
type
==
QETH_CARD_TYPE_OSN
)
{
if
(
card
->
info
.
type
==
QETH_CARD_TYPE_OSN
)
{
PRINT_WARN
(
"Setting MAC address on %s is not supported.
\n
"
,
dev
->
name
);
QETH_DBF_TEXT
(
TRACE
,
3
,
"setmcOSN"
);
QETH_DBF_TEXT
(
TRACE
,
3
,
"setmcOSN"
);
return
-
EOPNOTSUPP
;
return
-
EOPNOTSUPP
;
}
}
...
@@ -666,7 +656,7 @@ static int qeth_l2_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
...
@@ -666,7 +656,7 @@ static int qeth_l2_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
ctx
=
qeth_eddp_create_context
(
card
,
new_skb
,
hdr
,
ctx
=
qeth_eddp_create_context
(
card
,
new_skb
,
hdr
,
skb
->
sk
->
sk_protocol
);
skb
->
sk
->
sk_protocol
);
if
(
ctx
==
NULL
)
{
if
(
ctx
==
NULL
)
{
PRINT_WARN
(
"could not create eddp context
\n
"
);
QETH_DBF_MESSAGE
(
2
,
"could not create eddp context
\n
"
);
goto
tx_drop
;
goto
tx_drop
;
}
}
}
else
{
}
else
{
...
@@ -731,6 +721,7 @@ static int qeth_l2_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
...
@@ -731,6 +721,7 @@ static int qeth_l2_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
if
((
new_skb
!=
skb
)
&&
new_skb
)
if
((
new_skb
!=
skb
)
&&
new_skb
)
dev_kfree_skb_any
(
new_skb
);
dev_kfree_skb_any
(
new_skb
);
dev_kfree_skb_any
(
skb
);
dev_kfree_skb_any
(
skb
);
netif_wake_queue
(
dev
);
return
NETDEV_TX_OK
;
return
NETDEV_TX_OK
;
}
}
...
@@ -1155,7 +1146,7 @@ static int qeth_osn_send_control_data(struct qeth_card *card, int len,
...
@@ -1155,7 +1146,7 @@ static int qeth_osn_send_control_data(struct qeth_card *card, int len,
(
addr_t
)
iob
,
0
,
0
);
(
addr_t
)
iob
,
0
,
0
);
spin_unlock_irqrestore
(
get_ccwdev_lock
(
card
->
write
.
ccwdev
),
flags
);
spin_unlock_irqrestore
(
get_ccwdev_lock
(
card
->
write
.
ccwdev
),
flags
);
if
(
rc
)
{
if
(
rc
)
{
PRINT_WARN
(
"qeth_osn_send_control_data: "
QETH_DBF_MESSAGE
(
2
,
"qeth_osn_send_control_data: "
"ccw_device_start rc = %i
\n
"
,
rc
);
"ccw_device_start rc = %i
\n
"
,
rc
);
QETH_DBF_TEXT_
(
TRACE
,
2
,
" err%d"
,
rc
);
QETH_DBF_TEXT_
(
TRACE
,
2
,
" err%d"
,
rc
);
qeth_release_buffer
(
iob
->
channel
,
iob
);
qeth_release_buffer
(
iob
->
channel
,
iob
);
...
...
drivers/s390/net/qeth_l3_main.c
浏览文件 @
513fd370
...
@@ -311,7 +311,6 @@ static struct qeth_ipaddr *qeth_l3_get_addr_buffer(
...
@@ -311,7 +311,6 @@ static struct qeth_ipaddr *qeth_l3_get_addr_buffer(
addr
=
kzalloc
(
sizeof
(
struct
qeth_ipaddr
),
GFP_ATOMIC
);
addr
=
kzalloc
(
sizeof
(
struct
qeth_ipaddr
),
GFP_ATOMIC
);
if
(
addr
==
NULL
)
{
if
(
addr
==
NULL
)
{
PRINT_WARN
(
"Not enough memory to add address
\n
"
);
return
NULL
;
return
NULL
;
}
}
addr
->
type
=
QETH_IP_TYPE_NORMAL
;
addr
->
type
=
QETH_IP_TYPE_NORMAL
;
...
@@ -649,15 +648,6 @@ static void qeth_l3_correct_routing_type(struct qeth_card *card,
...
@@ -649,15 +648,6 @@ static void qeth_l3_correct_routing_type(struct qeth_card *card,
}
}
}
}
out_inval:
out_inval:
PRINT_WARN
(
"Routing type '%s' not supported for interface %s.
\n
"
"Router status set to 'no router'.
\n
"
,
((
*
type
==
PRIMARY_ROUTER
)
?
"primary router"
:
(
*
type
==
SECONDARY_ROUTER
)
?
"secondary router"
:
(
*
type
==
PRIMARY_CONNECTOR
)
?
"primary connector"
:
(
*
type
==
SECONDARY_CONNECTOR
)
?
"secondary connector"
:
(
*
type
==
MULTICAST_ROUTER
)
?
"multicast router"
:
"unknown"
),
card
->
dev
->
name
);
*
type
=
NO_ROUTER
;
*
type
=
NO_ROUTER
;
}
}
...
@@ -674,9 +664,9 @@ int qeth_l3_setrouting_v4(struct qeth_card *card)
...
@@ -674,9 +664,9 @@ int qeth_l3_setrouting_v4(struct qeth_card *card)
QETH_PROT_IPV4
);
QETH_PROT_IPV4
);
if
(
rc
)
{
if
(
rc
)
{
card
->
options
.
route4
.
type
=
NO_ROUTER
;
card
->
options
.
route4
.
type
=
NO_ROUTER
;
PRINT_WARN
(
"Error (0x%04x) while setting routing type on %s.
"
QETH_DBF_MESSAGE
(
2
,
"Error (0x%04x) while setting routing type
"
"Type set to 'no router'.
\n
"
,
" on %s. Type set to 'no router'.
\n
"
,
rc
,
rc
,
QETH_CARD_IFNAME
(
card
));
QETH_CARD_IFNAME
(
card
));
}
}
return
rc
;
return
rc
;
}
}
...
@@ -697,9 +687,9 @@ int qeth_l3_setrouting_v6(struct qeth_card *card)
...
@@ -697,9 +687,9 @@ int qeth_l3_setrouting_v6(struct qeth_card *card)
QETH_PROT_IPV6
);
QETH_PROT_IPV6
);
if
(
rc
)
{
if
(
rc
)
{
card
->
options
.
route6
.
type
=
NO_ROUTER
;
card
->
options
.
route6
.
type
=
NO_ROUTER
;
PRINT_WARN
(
"Error (0x%04x) while setting routing type on %s.
"
QETH_DBF_MESSAGE
(
2
,
"Error (0x%04x) while setting routing type
"
"Type set to 'no router'.
\n
"
,
" on %s. Type set to 'no router'.
\n
"
,
rc
,
rc
,
QETH_CARD_IFNAME
(
card
));
QETH_CARD_IFNAME
(
card
));
}
}
#endif
#endif
return
rc
;
return
rc
;
...
@@ -737,7 +727,6 @@ int qeth_l3_add_ipato_entry(struct qeth_card *card,
...
@@ -737,7 +727,6 @@ int qeth_l3_add_ipato_entry(struct qeth_card *card,
if
(
!
memcmp
(
ipatoe
->
addr
,
new
->
addr
,
if
(
!
memcmp
(
ipatoe
->
addr
,
new
->
addr
,
(
ipatoe
->
proto
==
QETH_PROT_IPV4
)
?
4
:
16
)
&&
(
ipatoe
->
proto
==
QETH_PROT_IPV4
)
?
4
:
16
)
&&
(
ipatoe
->
mask_bits
==
new
->
mask_bits
))
{
(
ipatoe
->
mask_bits
==
new
->
mask_bits
))
{
PRINT_WARN
(
"ipato entry already exists!
\n
"
);
rc
=
-
EEXIST
;
rc
=
-
EEXIST
;
break
;
break
;
}
}
...
@@ -802,7 +791,6 @@ int qeth_l3_add_vipa(struct qeth_card *card, enum qeth_prot_versions proto,
...
@@ -802,7 +791,6 @@ int qeth_l3_add_vipa(struct qeth_card *card, enum qeth_prot_versions proto,
rc
=
-
EEXIST
;
rc
=
-
EEXIST
;
spin_unlock_irqrestore
(
&
card
->
ip_lock
,
flags
);
spin_unlock_irqrestore
(
&
card
->
ip_lock
,
flags
);
if
(
rc
)
{
if
(
rc
)
{
PRINT_WARN
(
"Cannot add VIPA. Address already exists!
\n
"
);
return
rc
;
return
rc
;
}
}
if
(
!
qeth_l3_add_ip
(
card
,
ipaddr
))
if
(
!
qeth_l3_add_ip
(
card
,
ipaddr
))
...
@@ -867,7 +855,6 @@ int qeth_l3_add_rxip(struct qeth_card *card, enum qeth_prot_versions proto,
...
@@ -867,7 +855,6 @@ int qeth_l3_add_rxip(struct qeth_card *card, enum qeth_prot_versions proto,
rc
=
-
EEXIST
;
rc
=
-
EEXIST
;
spin_unlock_irqrestore
(
&
card
->
ip_lock
,
flags
);
spin_unlock_irqrestore
(
&
card
->
ip_lock
,
flags
);
if
(
rc
)
{
if
(
rc
)
{
PRINT_WARN
(
"Cannot add RXIP. Address already exists!
\n
"
);
return
rc
;
return
rc
;
}
}
if
(
!
qeth_l3_add_ip
(
card
,
ipaddr
))
if
(
!
qeth_l3_add_ip
(
card
,
ipaddr
))
...
@@ -1020,23 +1007,23 @@ static int qeth_l3_setadapter_hstr(struct qeth_card *card)
...
@@ -1020,23 +1007,23 @@ static int qeth_l3_setadapter_hstr(struct qeth_card *card)
IPA_SETADP_SET_BROADCAST_MODE
,
IPA_SETADP_SET_BROADCAST_MODE
,
card
->
options
.
broadcast_mode
);
card
->
options
.
broadcast_mode
);
if
(
rc
)
if
(
rc
)
PRINT_WARN
(
"couldn't set broadcast mode on "
QETH_DBF_MESSAGE
(
2
,
"couldn't set broadcast mode on "
"device %s: x%x
\n
"
,
"device %s: x%x
\n
"
,
CARD_BUS_ID
(
card
),
rc
);
CARD_BUS_ID
(
card
),
rc
);
rc
=
qeth_l3_send_setadp_mode
(
card
,
rc
=
qeth_l3_send_setadp_mode
(
card
,
IPA_SETADP_ALTER_MAC_ADDRESS
,
IPA_SETADP_ALTER_MAC_ADDRESS
,
card
->
options
.
macaddr_mode
);
card
->
options
.
macaddr_mode
);
if
(
rc
)
if
(
rc
)
PRINT_WARN
(
"couldn't set macaddr mode on "
QETH_DBF_MESSAGE
(
2
,
"couldn't set macaddr mode on "
"device %s: x%x
\n
"
,
CARD_BUS_ID
(
card
),
rc
);
"device %s: x%x
\n
"
,
CARD_BUS_ID
(
card
),
rc
);
return
rc
;
return
rc
;
}
}
if
(
card
->
options
.
broadcast_mode
==
QETH_TR_BROADCAST_LOCAL
)
if
(
card
->
options
.
broadcast_mode
==
QETH_TR_BROADCAST_LOCAL
)
PRINT_WARN
(
"set adapter parameters not available "
QETH_DBF_MESSAGE
(
2
,
"set adapter parameters not available "
"to set broadcast mode, using ALLRINGS "
"to set broadcast mode, using ALLRINGS "
"on device %s:
\n
"
,
CARD_BUS_ID
(
card
));
"on device %s:
\n
"
,
CARD_BUS_ID
(
card
));
if
(
card
->
options
.
macaddr_mode
==
QETH_TR_MACADDR_CANONICAL
)
if
(
card
->
options
.
macaddr_mode
==
QETH_TR_MACADDR_CANONICAL
)
PRINT_WARN
(
"set adapter parameters not available "
QETH_DBF_MESSAGE
(
2
,
"set adapter parameters not available "
"to set macaddr mode, using NONCANONICAL "
"to set macaddr mode, using NONCANONICAL "
"on device %s:
\n
"
,
CARD_BUS_ID
(
card
));
"on device %s:
\n
"
,
CARD_BUS_ID
(
card
));
return
0
;
return
0
;
...
@@ -2070,7 +2057,7 @@ static struct qeth_card *qeth_l3_get_card_from_dev(struct net_device *dev)
...
@@ -2070,7 +2057,7 @@ static struct qeth_card *qeth_l3_get_card_from_dev(struct net_device *dev)
card
=
netdev_priv
(
dev
);
card
=
netdev_priv
(
dev
);
else
if
(
rc
==
QETH_VLAN_CARD
)
else
if
(
rc
==
QETH_VLAN_CARD
)
card
=
netdev_priv
(
vlan_dev_info
(
dev
)
->
real_dev
);
card
=
netdev_priv
(
vlan_dev_info
(
dev
)
->
real_dev
);
if
(
card
->
options
.
layer2
)
if
(
card
&&
card
->
options
.
layer2
)
card
=
NULL
;
card
=
NULL
;
QETH_DBF_TEXT_
(
TRACE
,
4
,
"%d"
,
rc
);
QETH_DBF_TEXT_
(
TRACE
,
4
,
"%d"
,
rc
);
return
card
;
return
card
;
...
@@ -2182,8 +2169,6 @@ static int qeth_l3_arp_set_no_entries(struct qeth_card *card, int no_entries)
...
@@ -2182,8 +2169,6 @@ static int qeth_l3_arp_set_no_entries(struct qeth_card *card, int no_entries)
if
(
card
->
info
.
guestlan
)
if
(
card
->
info
.
guestlan
)
return
-
EOPNOTSUPP
;
return
-
EOPNOTSUPP
;
if
(
!
qeth_is_supported
(
card
,
IPA_ARP_PROCESSING
))
{
if
(
!
qeth_is_supported
(
card
,
IPA_ARP_PROCESSING
))
{
PRINT_WARN
(
"ARP processing not supported "
"on %s!
\n
"
,
QETH_CARD_IFNAME
(
card
));
return
-
EOPNOTSUPP
;
return
-
EOPNOTSUPP
;
}
}
rc
=
qeth_l3_send_simple_setassparms
(
card
,
IPA_ARP_PROCESSING
,
rc
=
qeth_l3_send_simple_setassparms
(
card
,
IPA_ARP_PROCESSING
,
...
@@ -2191,8 +2176,8 @@ static int qeth_l3_arp_set_no_entries(struct qeth_card *card, int no_entries)
...
@@ -2191,8 +2176,8 @@ static int qeth_l3_arp_set_no_entries(struct qeth_card *card, int no_entries)
no_entries
);
no_entries
);
if
(
rc
)
{
if
(
rc
)
{
tmp
=
rc
;
tmp
=
rc
;
PRINT_WARN
(
"Could not set number of ARP entries on %s:
"
QETH_DBF_MESSAGE
(
2
,
"Could not set number of ARP entries on
"
"%s (0x%x/%d)
\n
"
,
QETH_CARD_IFNAME
(
card
),
"%s
: %s
(0x%x/%d)
\n
"
,
QETH_CARD_IFNAME
(
card
),
qeth_l3_arp_get_error_cause
(
&
rc
),
tmp
,
tmp
);
qeth_l3_arp_get_error_cause
(
&
rc
),
tmp
,
tmp
);
}
}
return
rc
;
return
rc
;
...
@@ -2260,9 +2245,6 @@ static int qeth_l3_arp_query_cb(struct qeth_card *card,
...
@@ -2260,9 +2245,6 @@ static int qeth_l3_arp_query_cb(struct qeth_card *card,
qdata
->
no_entries
*
uentry_size
){
qdata
->
no_entries
*
uentry_size
){
QETH_DBF_TEXT_
(
TRACE
,
4
,
"qaer3%i"
,
-
ENOMEM
);
QETH_DBF_TEXT_
(
TRACE
,
4
,
"qaer3%i"
,
-
ENOMEM
);
cmd
->
hdr
.
return_code
=
-
ENOMEM
;
cmd
->
hdr
.
return_code
=
-
ENOMEM
;
PRINT_WARN
(
"query ARP user space buffer is too small for "
"the returned number of ARP entries. "
"Aborting query!
\n
"
);
goto
out_error
;
goto
out_error
;
}
}
QETH_DBF_TEXT_
(
TRACE
,
4
,
"anore%i"
,
QETH_DBF_TEXT_
(
TRACE
,
4
,
"anore%i"
,
...
@@ -2324,8 +2306,6 @@ static int qeth_l3_arp_query(struct qeth_card *card, char __user *udata)
...
@@ -2324,8 +2306,6 @@ static int qeth_l3_arp_query(struct qeth_card *card, char __user *udata)
if
(
!
qeth_is_supported
(
card
,
/*IPA_QUERY_ARP_ADDR_INFO*/
if
(
!
qeth_is_supported
(
card
,
/*IPA_QUERY_ARP_ADDR_INFO*/
IPA_ARP_PROCESSING
))
{
IPA_ARP_PROCESSING
))
{
PRINT_WARN
(
"ARP processing not supported "
"on %s!
\n
"
,
QETH_CARD_IFNAME
(
card
));
return
-
EOPNOTSUPP
;
return
-
EOPNOTSUPP
;
}
}
/* get size of userspace buffer and mask_bits -> 6 bytes */
/* get size of userspace buffer and mask_bits -> 6 bytes */
...
@@ -2344,7 +2324,7 @@ static int qeth_l3_arp_query(struct qeth_card *card, char __user *udata)
...
@@ -2344,7 +2324,7 @@ static int qeth_l3_arp_query(struct qeth_card *card, char __user *udata)
qeth_l3_arp_query_cb
,
(
void
*
)
&
qinfo
);
qeth_l3_arp_query_cb
,
(
void
*
)
&
qinfo
);
if
(
rc
)
{
if
(
rc
)
{
tmp
=
rc
;
tmp
=
rc
;
PRINT_WARN
(
"Error while querying ARP cache on %s: %s "
QETH_DBF_MESSAGE
(
2
,
"Error while querying ARP cache on %s: %s "
"(0x%x/%d)
\n
"
,
QETH_CARD_IFNAME
(
card
),
"(0x%x/%d)
\n
"
,
QETH_CARD_IFNAME
(
card
),
qeth_l3_arp_get_error_cause
(
&
rc
),
tmp
,
tmp
);
qeth_l3_arp_get_error_cause
(
&
rc
),
tmp
,
tmp
);
if
(
copy_to_user
(
udata
,
qinfo
.
udata
,
4
))
if
(
copy_to_user
(
udata
,
qinfo
.
udata
,
4
))
...
@@ -2375,8 +2355,6 @@ static int qeth_l3_arp_add_entry(struct qeth_card *card,
...
@@ -2375,8 +2355,6 @@ static int qeth_l3_arp_add_entry(struct qeth_card *card,
if
(
card
->
info
.
guestlan
)
if
(
card
->
info
.
guestlan
)
return
-
EOPNOTSUPP
;
return
-
EOPNOTSUPP
;
if
(
!
qeth_is_supported
(
card
,
IPA_ARP_PROCESSING
))
{
if
(
!
qeth_is_supported
(
card
,
IPA_ARP_PROCESSING
))
{
PRINT_WARN
(
"ARP processing not supported "
"on %s!
\n
"
,
QETH_CARD_IFNAME
(
card
));
return
-
EOPNOTSUPP
;
return
-
EOPNOTSUPP
;
}
}
...
@@ -2391,10 +2369,9 @@ static int qeth_l3_arp_add_entry(struct qeth_card *card,
...
@@ -2391,10 +2369,9 @@ static int qeth_l3_arp_add_entry(struct qeth_card *card,
if
(
rc
)
{
if
(
rc
)
{
tmp
=
rc
;
tmp
=
rc
;
qeth_l3_ipaddr4_to_string
((
u8
*
)
entry
->
ipaddr
,
buf
);
qeth_l3_ipaddr4_to_string
((
u8
*
)
entry
->
ipaddr
,
buf
);
PRINT_WARN
(
"Could not add ARP entry for address %s on %s: "
QETH_DBF_MESSAGE
(
2
,
"Could not add ARP entry for address %s "
"%s (0x%x/%d)
\n
"
,
"on %s: %s (0x%x/%d)
\n
"
,
buf
,
QETH_CARD_IFNAME
(
card
),
buf
,
QETH_CARD_IFNAME
(
card
),
qeth_l3_arp_get_error_cause
(
&
rc
),
tmp
,
tmp
);
qeth_l3_arp_get_error_cause
(
&
rc
),
tmp
,
tmp
);
}
}
return
rc
;
return
rc
;
}
}
...
@@ -2417,8 +2394,6 @@ static int qeth_l3_arp_remove_entry(struct qeth_card *card,
...
@@ -2417,8 +2394,6 @@ static int qeth_l3_arp_remove_entry(struct qeth_card *card,
if
(
card
->
info
.
guestlan
)
if
(
card
->
info
.
guestlan
)
return
-
EOPNOTSUPP
;
return
-
EOPNOTSUPP
;
if
(
!
qeth_is_supported
(
card
,
IPA_ARP_PROCESSING
))
{
if
(
!
qeth_is_supported
(
card
,
IPA_ARP_PROCESSING
))
{
PRINT_WARN
(
"ARP processing not supported "
"on %s!
\n
"
,
QETH_CARD_IFNAME
(
card
));
return
-
EOPNOTSUPP
;
return
-
EOPNOTSUPP
;
}
}
memcpy
(
buf
,
entry
,
12
);
memcpy
(
buf
,
entry
,
12
);
...
@@ -2433,10 +2408,9 @@ static int qeth_l3_arp_remove_entry(struct qeth_card *card,
...
@@ -2433,10 +2408,9 @@ static int qeth_l3_arp_remove_entry(struct qeth_card *card,
tmp
=
rc
;
tmp
=
rc
;
memset
(
buf
,
0
,
16
);
memset
(
buf
,
0
,
16
);
qeth_l3_ipaddr4_to_string
((
u8
*
)
entry
->
ipaddr
,
buf
);
qeth_l3_ipaddr4_to_string
((
u8
*
)
entry
->
ipaddr
,
buf
);
PRINT_WARN
(
"Could not delete ARP entry for address %s on %s: "
QETH_DBF_MESSAGE
(
2
,
"Could not delete ARP entry for address %s"
"%s (0x%x/%d)
\n
"
,
" on %s: %s (0x%x/%d)
\n
"
,
buf
,
QETH_CARD_IFNAME
(
card
),
buf
,
QETH_CARD_IFNAME
(
card
),
qeth_l3_arp_get_error_cause
(
&
rc
),
tmp
,
tmp
);
qeth_l3_arp_get_error_cause
(
&
rc
),
tmp
,
tmp
);
}
}
return
rc
;
return
rc
;
}
}
...
@@ -2456,16 +2430,14 @@ static int qeth_l3_arp_flush_cache(struct qeth_card *card)
...
@@ -2456,16 +2430,14 @@ static int qeth_l3_arp_flush_cache(struct qeth_card *card)
if
(
card
->
info
.
guestlan
||
(
card
->
info
.
type
==
QETH_CARD_TYPE_IQD
))
if
(
card
->
info
.
guestlan
||
(
card
->
info
.
type
==
QETH_CARD_TYPE_IQD
))
return
-
EOPNOTSUPP
;
return
-
EOPNOTSUPP
;
if
(
!
qeth_is_supported
(
card
,
IPA_ARP_PROCESSING
))
{
if
(
!
qeth_is_supported
(
card
,
IPA_ARP_PROCESSING
))
{
PRINT_WARN
(
"ARP processing not supported "
"on %s!
\n
"
,
QETH_CARD_IFNAME
(
card
));
return
-
EOPNOTSUPP
;
return
-
EOPNOTSUPP
;
}
}
rc
=
qeth_l3_send_simple_setassparms
(
card
,
IPA_ARP_PROCESSING
,
rc
=
qeth_l3_send_simple_setassparms
(
card
,
IPA_ARP_PROCESSING
,
IPA_CMD_ASS_ARP_FLUSH_CACHE
,
0
);
IPA_CMD_ASS_ARP_FLUSH_CACHE
,
0
);
if
(
rc
)
{
if
(
rc
)
{
tmp
=
rc
;
tmp
=
rc
;
PRINT_WARN
(
"Could not flush ARP cache on %s: %s (0x%x/%d)
\n
"
,
QETH_DBF_MESSAGE
(
2
,
"Could not flush ARP cache on %s: %s "
QETH_CARD_IFNAME
(
card
),
"(0x%x/%d)
\n
"
,
QETH_CARD_IFNAME
(
card
),
qeth_l3_arp_get_error_cause
(
&
rc
),
tmp
,
tmp
);
qeth_l3_arp_get_error_cause
(
&
rc
),
tmp
,
tmp
);
}
}
return
rc
;
return
rc
;
...
@@ -2724,7 +2696,7 @@ static int qeth_l3_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
...
@@ -2724,7 +2696,7 @@ static int qeth_l3_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
ctx
=
qeth_eddp_create_context
(
card
,
new_skb
,
hdr
,
ctx
=
qeth_eddp_create_context
(
card
,
new_skb
,
hdr
,
skb
->
sk
->
sk_protocol
);
skb
->
sk
->
sk_protocol
);
if
(
ctx
==
NULL
)
{
if
(
ctx
==
NULL
)
{
PRINT_WARN
(
"could not create eddp context
\n
"
);
QETH_DBF_MESSAGE
(
2
,
"could not create eddp context
\n
"
);
goto
tx_drop
;
goto
tx_drop
;
}
}
}
else
{
}
else
{
...
@@ -2792,6 +2764,7 @@ static int qeth_l3_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
...
@@ -2792,6 +2764,7 @@ static int qeth_l3_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
if
((
new_skb
!=
skb
)
&&
new_skb
)
if
((
new_skb
!=
skb
)
&&
new_skb
)
dev_kfree_skb_any
(
new_skb
);
dev_kfree_skb_any
(
new_skb
);
dev_kfree_skb_any
(
skb
);
dev_kfree_skb_any
(
skb
);
netif_wake_queue
(
dev
);
return
NETDEV_TX_OK
;
return
NETDEV_TX_OK
;
}
}
...
...
drivers/s390/net/qeth_l3_sys.c
浏览文件 @
513fd370
...
@@ -85,7 +85,6 @@ static ssize_t qeth_l3_dev_route_store(struct qeth_card *card,
...
@@ -85,7 +85,6 @@ static ssize_t qeth_l3_dev_route_store(struct qeth_card *card,
}
else
if
(
!
strcmp
(
tmp
,
"multicast_router"
))
{
}
else
if
(
!
strcmp
(
tmp
,
"multicast_router"
))
{
route
->
type
=
MULTICAST_ROUTER
;
route
->
type
=
MULTICAST_ROUTER
;
}
else
{
}
else
{
PRINT_WARN
(
"Invalid routing type '%s'.
\n
"
,
tmp
);
return
-
EINVAL
;
return
-
EINVAL
;
}
}
if
(((
card
->
state
==
CARD_STATE_SOFTSETUP
)
||
if
(((
card
->
state
==
CARD_STATE_SOFTSETUP
)
||
...
@@ -137,9 +136,6 @@ static ssize_t qeth_l3_dev_route6_store(struct device *dev,
...
@@ -137,9 +136,6 @@ static ssize_t qeth_l3_dev_route6_store(struct device *dev,
return
-
EINVAL
;
return
-
EINVAL
;
if
(
!
qeth_is_supported
(
card
,
IPA_IPV6
))
{
if
(
!
qeth_is_supported
(
card
,
IPA_IPV6
))
{
PRINT_WARN
(
"IPv6 not supported for interface %s.
\n
"
"Routing status no changed.
\n
"
,
QETH_CARD_IFNAME
(
card
));
return
-
ENOTSUPP
;
return
-
ENOTSUPP
;
}
}
...
@@ -179,7 +175,6 @@ static ssize_t qeth_l3_dev_fake_broadcast_store(struct device *dev,
...
@@ -179,7 +175,6 @@ static ssize_t qeth_l3_dev_fake_broadcast_store(struct device *dev,
if
((
i
==
0
)
||
(
i
==
1
))
if
((
i
==
0
)
||
(
i
==
1
))
card
->
options
.
fake_broadcast
=
i
;
card
->
options
.
fake_broadcast
=
i
;
else
{
else
{
PRINT_WARN
(
"fake_broadcast: write 0 or 1 to this file!
\n
"
);
return
-
EINVAL
;
return
-
EINVAL
;
}
}
return
count
;
return
count
;
...
@@ -220,7 +215,6 @@ static ssize_t qeth_l3_dev_broadcast_mode_store(struct device *dev,
...
@@ -220,7 +215,6 @@ static ssize_t qeth_l3_dev_broadcast_mode_store(struct device *dev,
if
(
!
((
card
->
info
.
link_type
==
QETH_LINK_TYPE_HSTR
)
||
if
(
!
((
card
->
info
.
link_type
==
QETH_LINK_TYPE_HSTR
)
||
(
card
->
info
.
link_type
==
QETH_LINK_TYPE_LANE_TR
)))
{
(
card
->
info
.
link_type
==
QETH_LINK_TYPE_LANE_TR
)))
{
PRINT_WARN
(
"Device is not a tokenring device!
\n
"
);
return
-
EINVAL
;
return
-
EINVAL
;
}
}
...
@@ -233,8 +227,6 @@ static ssize_t qeth_l3_dev_broadcast_mode_store(struct device *dev,
...
@@ -233,8 +227,6 @@ static ssize_t qeth_l3_dev_broadcast_mode_store(struct device *dev,
card
->
options
.
broadcast_mode
=
QETH_TR_BROADCAST_ALLRINGS
;
card
->
options
.
broadcast_mode
=
QETH_TR_BROADCAST_ALLRINGS
;
return
count
;
return
count
;
}
else
{
}
else
{
PRINT_WARN
(
"broadcast_mode: invalid mode %s!
\n
"
,
tmp
);
return
-
EINVAL
;
return
-
EINVAL
;
}
}
return
count
;
return
count
;
...
@@ -275,7 +267,6 @@ static ssize_t qeth_l3_dev_canonical_macaddr_store(struct device *dev,
...
@@ -275,7 +267,6 @@ static ssize_t qeth_l3_dev_canonical_macaddr_store(struct device *dev,
if
(
!
((
card
->
info
.
link_type
==
QETH_LINK_TYPE_HSTR
)
||
if
(
!
((
card
->
info
.
link_type
==
QETH_LINK_TYPE_HSTR
)
||
(
card
->
info
.
link_type
==
QETH_LINK_TYPE_LANE_TR
)))
{
(
card
->
info
.
link_type
==
QETH_LINK_TYPE_LANE_TR
)))
{
PRINT_WARN
(
"Device is not a tokenring device!
\n
"
);
return
-
EINVAL
;
return
-
EINVAL
;
}
}
...
@@ -285,7 +276,6 @@ static ssize_t qeth_l3_dev_canonical_macaddr_store(struct device *dev,
...
@@ -285,7 +276,6 @@ static ssize_t qeth_l3_dev_canonical_macaddr_store(struct device *dev,
QETH_TR_MACADDR_CANONICAL
:
QETH_TR_MACADDR_CANONICAL
:
QETH_TR_MACADDR_NONCANONICAL
;
QETH_TR_MACADDR_NONCANONICAL
;
else
{
else
{
PRINT_WARN
(
"canonical_macaddr: write 0 or 1 to this file!
\n
"
);
return
-
EINVAL
;
return
-
EINVAL
;
}
}
return
count
;
return
count
;
...
@@ -327,7 +317,6 @@ static ssize_t qeth_l3_dev_checksum_store(struct device *dev,
...
@@ -327,7 +317,6 @@ static ssize_t qeth_l3_dev_checksum_store(struct device *dev,
else
if
(
!
strcmp
(
tmp
,
"no_checksumming"
))
else
if
(
!
strcmp
(
tmp
,
"no_checksumming"
))
card
->
options
.
checksum_type
=
NO_CHECKSUMMING
;
card
->
options
.
checksum_type
=
NO_CHECKSUMMING
;
else
{
else
{
PRINT_WARN
(
"Unknown checksumming type '%s'
\n
"
,
tmp
);
return
-
EINVAL
;
return
-
EINVAL
;
}
}
return
count
;
return
count
;
...
@@ -382,8 +371,6 @@ static ssize_t qeth_l3_dev_ipato_enable_store(struct device *dev,
...
@@ -382,8 +371,6 @@ static ssize_t qeth_l3_dev_ipato_enable_store(struct device *dev,
}
else
if
(
!
strcmp
(
tmp
,
"0"
))
{
}
else
if
(
!
strcmp
(
tmp
,
"0"
))
{
card
->
ipato
.
enabled
=
0
;
card
->
ipato
.
enabled
=
0
;
}
else
{
}
else
{
PRINT_WARN
(
"ipato_enable: write 0, 1 or 'toggle' to "
"this file
\n
"
);
return
-
EINVAL
;
return
-
EINVAL
;
}
}
return
count
;
return
count
;
...
@@ -422,8 +409,6 @@ static ssize_t qeth_l3_dev_ipato_invert4_store(struct device *dev,
...
@@ -422,8 +409,6 @@ static ssize_t qeth_l3_dev_ipato_invert4_store(struct device *dev,
}
else
if
(
!
strcmp
(
tmp
,
"0"
))
{
}
else
if
(
!
strcmp
(
tmp
,
"0"
))
{
card
->
ipato
.
invert4
=
0
;
card
->
ipato
.
invert4
=
0
;
}
else
{
}
else
{
PRINT_WARN
(
"ipato_invert4: write 0, 1 or 'toggle' to "
"this file
\n
"
);
return
-
EINVAL
;
return
-
EINVAL
;
}
}
return
count
;
return
count
;
...
@@ -486,13 +471,10 @@ static int qeth_l3_parse_ipatoe(const char *buf, enum qeth_prot_versions proto,
...
@@ -486,13 +471,10 @@ static int qeth_l3_parse_ipatoe(const char *buf, enum qeth_prot_versions proto,
/* get address string */
/* get address string */
end
=
strchr
(
start
,
'/'
);
end
=
strchr
(
start
,
'/'
);
if
(
!
end
||
(
end
-
start
>=
40
))
{
if
(
!
end
||
(
end
-
start
>=
40
))
{
PRINT_WARN
(
"Invalid format for ipato_addx/delx. "
"Use <ip addr>/<mask bits>
\n
"
);
return
-
EINVAL
;
return
-
EINVAL
;
}
}
strncpy
(
buffer
,
start
,
end
-
start
);
strncpy
(
buffer
,
start
,
end
-
start
);
if
(
qeth_l3_string_to_ipaddr
(
buffer
,
proto
,
addr
))
{
if
(
qeth_l3_string_to_ipaddr
(
buffer
,
proto
,
addr
))
{
PRINT_WARN
(
"Invalid IP address format!
\n
"
);
return
-
EINVAL
;
return
-
EINVAL
;
}
}
start
=
end
+
1
;
start
=
end
+
1
;
...
@@ -500,7 +482,6 @@ static int qeth_l3_parse_ipatoe(const char *buf, enum qeth_prot_versions proto,
...
@@ -500,7 +482,6 @@ static int qeth_l3_parse_ipatoe(const char *buf, enum qeth_prot_versions proto,
if
(
!
strlen
(
start
)
||
if
(
!
strlen
(
start
)
||
(
tmp
==
start
)
||
(
tmp
==
start
)
||
(
*
mask_bits
>
((
proto
==
QETH_PROT_IPV4
)
?
32
:
128
)))
{
(
*
mask_bits
>
((
proto
==
QETH_PROT_IPV4
)
?
32
:
128
)))
{
PRINT_WARN
(
"Invalid mask bits for ipato_addx/delx !
\n
"
);
return
-
EINVAL
;
return
-
EINVAL
;
}
}
return
0
;
return
0
;
...
@@ -520,7 +501,6 @@ static ssize_t qeth_l3_dev_ipato_add_store(const char *buf, size_t count,
...
@@ -520,7 +501,6 @@ static ssize_t qeth_l3_dev_ipato_add_store(const char *buf, size_t count,
ipatoe
=
kzalloc
(
sizeof
(
struct
qeth_ipato_entry
),
GFP_KERNEL
);
ipatoe
=
kzalloc
(
sizeof
(
struct
qeth_ipato_entry
),
GFP_KERNEL
);
if
(
!
ipatoe
)
{
if
(
!
ipatoe
)
{
PRINT_WARN
(
"No memory to allocate ipato entry
\n
"
);
return
-
ENOMEM
;
return
-
ENOMEM
;
}
}
ipatoe
->
proto
=
proto
;
ipatoe
->
proto
=
proto
;
...
@@ -609,8 +589,6 @@ static ssize_t qeth_l3_dev_ipato_invert6_store(struct device *dev,
...
@@ -609,8 +589,6 @@ static ssize_t qeth_l3_dev_ipato_invert6_store(struct device *dev,
}
else
if
(
!
strcmp
(
tmp
,
"0"
))
{
}
else
if
(
!
strcmp
(
tmp
,
"0"
))
{
card
->
ipato
.
invert6
=
0
;
card
->
ipato
.
invert6
=
0
;
}
else
{
}
else
{
PRINT_WARN
(
"ipato_invert6: write 0, 1 or 'toggle' to "
"this file
\n
"
);
return
-
EINVAL
;
return
-
EINVAL
;
}
}
return
count
;
return
count
;
...
@@ -724,7 +702,6 @@ static int qeth_l3_parse_vipae(const char *buf, enum qeth_prot_versions proto,
...
@@ -724,7 +702,6 @@ static int qeth_l3_parse_vipae(const char *buf, enum qeth_prot_versions proto,
u8
*
addr
)
u8
*
addr
)
{
{
if
(
qeth_l3_string_to_ipaddr
(
buf
,
proto
,
addr
))
{
if
(
qeth_l3_string_to_ipaddr
(
buf
,
proto
,
addr
))
{
PRINT_WARN
(
"Invalid IP address format!
\n
"
);
return
-
EINVAL
;
return
-
EINVAL
;
}
}
return
0
;
return
0
;
...
@@ -891,7 +868,6 @@ static int qeth_l3_parse_rxipe(const char *buf, enum qeth_prot_versions proto,
...
@@ -891,7 +868,6 @@ static int qeth_l3_parse_rxipe(const char *buf, enum qeth_prot_versions proto,
u8
*
addr
)
u8
*
addr
)
{
{
if
(
qeth_l3_string_to_ipaddr
(
buf
,
proto
,
addr
))
{
if
(
qeth_l3_string_to_ipaddr
(
buf
,
proto
,
addr
))
{
PRINT_WARN
(
"Invalid IP address format!
\n
"
);
return
-
EINVAL
;
return
-
EINVAL
;
}
}
return
0
;
return
0
;
...
...
include/linux/virtio_net.h
浏览文件 @
513fd370
...
@@ -38,7 +38,7 @@ struct virtio_net_hdr
...
@@ -38,7 +38,7 @@ struct virtio_net_hdr
#define VIRTIO_NET_HDR_GSO_ECN 0x80 // TCP has ECN set
#define VIRTIO_NET_HDR_GSO_ECN 0x80 // TCP has ECN set
__u8
gso_type
;
__u8
gso_type
;
__u16
hdr_len
;
/* Ethernet + IP + tcp/udp hdrs */
__u16
hdr_len
;
/* Ethernet + IP + tcp/udp hdrs */
__u16
gso_size
;
/* Bytes to append to
gso_
hdr_len per frame */
__u16
gso_size
;
/* Bytes to append to hdr_len per frame */
__u16
csum_start
;
/* Position to start checksumming from */
__u16
csum_start
;
/* Position to start checksumming from */
__u16
csum_offset
;
/* Offset after that to place checksum */
__u16
csum_offset
;
/* Offset after that to place checksum */
};
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录