Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
f327220b
R
raspberrypi-kernel
项目概览
openeuler
/
raspberrypi-kernel
通知
13
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
raspberrypi-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
f327220b
编写于
12月 01, 2005
作者:
L
Linus Torvalds
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'upstream-fixes' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6
上级
31b3c31b
ea182d4a
变更
15
展开全部
隐藏空白更改
内联
并排
Showing
15 changed file
with
108 addition
and
1092 deletion
+108
-1092
drivers/net/b44.c
drivers/net/b44.c
+9
-4
drivers/net/e1000/e1000_main.c
drivers/net/e1000/e1000_main.c
+1
-13
drivers/net/ibm_emac/ibm_emac_core.c
drivers/net/ibm_emac/ibm_emac_core.c
+29
-9
drivers/net/ibm_emac/ibm_emac_core.h
drivers/net/ibm_emac/ibm_emac_core.h
+2
-0
drivers/net/jazzsonic.c
drivers/net/jazzsonic.c
+2
-2
drivers/net/mipsnet.h
drivers/net/mipsnet.h
+5
-25
drivers/net/pcmcia/fmvj18x_cs.c
drivers/net/pcmcia/fmvj18x_cs.c
+11
-21
drivers/net/sk98lin/Makefile
drivers/net/sk98lin/Makefile
+2
-3
drivers/net/sk98lin/h/skdrv2nd.h
drivers/net/sk98lin/h/skdrv2nd.h
+0
-4
drivers/net/sk98lin/skcsum.c
drivers/net/sk98lin/skcsum.c
+0
-871
drivers/net/sk98lin/skethtool.c
drivers/net/sk98lin/skethtool.c
+2
-0
drivers/net/sk98lin/skge.c
drivers/net/sk98lin/skge.c
+41
-133
drivers/net/skge.c
drivers/net/skge.c
+1
-3
drivers/net/wireless/airo.c
drivers/net/wireless/airo.c
+2
-2
drivers/net/wireless/orinoco.c
drivers/net/wireless/orinoco.c
+1
-2
未找到文件。
drivers/net/b44.c
浏览文件 @
f327220b
...
...
@@ -28,8 +28,8 @@
#define DRV_MODULE_NAME "b44"
#define PFX DRV_MODULE_NAME ": "
#define DRV_MODULE_VERSION "0.9
6
"
#define DRV_MODULE_RELDATE "Nov
8
, 2005"
#define DRV_MODULE_VERSION "0.9
7
"
#define DRV_MODULE_RELDATE "Nov
30
, 2005"
#define B44_DEF_MSG_ENABLE \
(NETIF_MSG_DRV | \
...
...
@@ -1417,6 +1417,7 @@ static int b44_open(struct net_device *dev)
add_timer
(
&
bp
->
timer
);
b44_enable_ints
(
bp
);
netif_start_queue
(
dev
);
out:
return
err
;
}
...
...
@@ -1837,12 +1838,15 @@ static int b44_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
{
struct
mii_ioctl_data
*
data
=
if_mii
(
ifr
);
struct
b44
*
bp
=
netdev_priv
(
dev
);
int
err
;
int
err
=
-
EINVAL
;
if
(
!
netif_running
(
dev
))
goto
out
;
spin_lock_irq
(
&
bp
->
lock
);
err
=
generic_mii_ioctl
(
&
bp
->
mii_if
,
data
,
cmd
,
NULL
);
spin_unlock_irq
(
&
bp
->
lock
);
out:
return
err
;
}
...
...
@@ -2113,6 +2117,7 @@ static int b44_resume(struct pci_dev *pdev)
add_timer
(
&
bp
->
timer
);
b44_enable_ints
(
bp
);
netif_wake_queue
(
dev
);
return
0
;
}
...
...
drivers/net/e1000/e1000_main.c
浏览文件 @
f327220b
...
...
@@ -2621,19 +2621,7 @@ e1000_transfer_dhcp_info(struct e1000_adapter *adapter, struct sk_buff *skb)
E1000_MNG_DHCP_COOKIE_STATUS_VLAN_SUPPORT
))
)
return
0
;
}
if
(
htons
(
ETH_P_IP
)
==
skb
->
protocol
)
{
const
struct
iphdr
*
ip
=
skb
->
nh
.
iph
;
if
(
IPPROTO_UDP
==
ip
->
protocol
)
{
struct
udphdr
*
udp
=
(
struct
udphdr
*
)(
skb
->
h
.
uh
);
if
(
ntohs
(
udp
->
dest
)
==
67
)
{
offset
=
(
uint8_t
*
)
udp
+
8
-
skb
->
data
;
length
=
skb
->
len
-
offset
;
return
e1000_mng_write_dhcp_info
(
hw
,
(
uint8_t
*
)
udp
+
8
,
length
);
}
}
}
else
if
((
skb
->
len
>
MINIMUM_DHCP_PACKET_SIZE
)
&&
(
!
skb
->
protocol
))
{
if
((
skb
->
len
>
MINIMUM_DHCP_PACKET_SIZE
)
&&
(
!
skb
->
protocol
))
{
struct
ethhdr
*
eth
=
(
struct
ethhdr
*
)
skb
->
data
;
if
((
htons
(
ETH_P_IP
)
==
eth
->
h_proto
))
{
const
struct
iphdr
*
ip
=
...
...
drivers/net/ibm_emac/ibm_emac_core.c
浏览文件 @
f327220b
...
...
@@ -65,7 +65,7 @@
*/
#define DRV_NAME "emac"
#define DRV_VERSION "3.5
3
"
#define DRV_VERSION "3.5
4
"
#define DRV_DESC "PPC 4xx OCP EMAC driver"
MODULE_DESCRIPTION
(
DRV_DESC
);
...
...
@@ -158,6 +158,14 @@ static inline void emac_report_timeout_error(struct ocp_enet_private *dev,
#define PHY_POLL_LINK_ON HZ
#define PHY_POLL_LINK_OFF (HZ / 5)
/* Graceful stop timeouts in us.
* We should allow up to 1 frame time (full-duplex, ignoring collisions)
*/
#define STOP_TIMEOUT_10 1230
#define STOP_TIMEOUT_100 124
#define STOP_TIMEOUT_1000 13
#define STOP_TIMEOUT_1000_JUMBO 73
/* Please, keep in sync with struct ibm_emac_stats/ibm_emac_error_stats */
static
const
char
emac_stats_keys
[
EMAC_ETHTOOL_STATS_COUNT
][
ETH_GSTRING_LEN
]
=
{
"rx_packets"
,
"rx_bytes"
,
"tx_packets"
,
"tx_bytes"
,
"rx_packets_csum"
,
...
...
@@ -222,10 +230,12 @@ static void emac_tx_disable(struct ocp_enet_private *dev)
r
=
in_be32
(
&
p
->
mr0
);
if
(
r
&
EMAC_MR0_TXE
)
{
int
n
=
300
;
int
n
=
dev
->
stop_timeout
;
out_be32
(
&
p
->
mr0
,
r
&
~
EMAC_MR0_TXE
);
while
(
!
(
in_be32
(
&
p
->
mr0
)
&
EMAC_MR0_TXI
)
&&
n
)
while
(
!
(
in_be32
(
&
p
->
mr0
)
&
EMAC_MR0_TXI
)
&&
n
)
{
udelay
(
1
);
--
n
;
}
if
(
unlikely
(
!
n
))
emac_report_timeout_error
(
dev
,
"TX disable timeout"
);
}
...
...
@@ -248,9 +258,11 @@ static void emac_rx_enable(struct ocp_enet_private *dev)
if
(
!
(
r
&
EMAC_MR0_RXE
))
{
if
(
unlikely
(
!
(
r
&
EMAC_MR0_RXI
)))
{
/* Wait if previous async disable is still in progress */
int
n
=
100
;
while
(
!
(
r
=
in_be32
(
&
p
->
mr0
)
&
EMAC_MR0_RXI
)
&&
n
)
int
n
=
dev
->
stop_timeout
;
while
(
!
(
r
=
in_be32
(
&
p
->
mr0
)
&
EMAC_MR0_RXI
)
&&
n
)
{
udelay
(
1
);
--
n
;
}
if
(
unlikely
(
!
n
))
emac_report_timeout_error
(
dev
,
"RX disable timeout"
);
...
...
@@ -273,10 +285,12 @@ static void emac_rx_disable(struct ocp_enet_private *dev)
r
=
in_be32
(
&
p
->
mr0
);
if
(
r
&
EMAC_MR0_RXE
)
{
int
n
=
300
;
int
n
=
dev
->
stop_timeout
;
out_be32
(
&
p
->
mr0
,
r
&
~
EMAC_MR0_RXE
);
while
(
!
(
in_be32
(
&
p
->
mr0
)
&
EMAC_MR0_RXI
)
&&
n
)
while
(
!
(
in_be32
(
&
p
->
mr0
)
&
EMAC_MR0_RXI
)
&&
n
)
{
udelay
(
1
);
--
n
;
}
if
(
unlikely
(
!
n
))
emac_report_timeout_error
(
dev
,
"RX disable timeout"
);
}
...
...
@@ -395,6 +409,7 @@ static int emac_configure(struct ocp_enet_private *dev)
r
=
EMAC_MR1_BASE
(
emac_opb_mhz
())
|
EMAC_MR1_VLE
|
EMAC_MR1_IST
;
if
(
dev
->
phy
.
duplex
==
DUPLEX_FULL
)
r
|=
EMAC_MR1_FDE
;
dev
->
stop_timeout
=
STOP_TIMEOUT_10
;
switch
(
dev
->
phy
.
speed
)
{
case
SPEED_1000
:
if
(
emac_phy_gpcs
(
dev
->
phy
.
mode
))
{
...
...
@@ -409,12 +424,16 @@ static int emac_configure(struct ocp_enet_private *dev)
r
|=
EMAC_MR1_MF_1000
;
r
|=
EMAC_MR1_RFS_16K
;
gige
=
1
;
if
(
dev
->
ndev
->
mtu
>
ETH_DATA_LEN
)
if
(
dev
->
ndev
->
mtu
>
ETH_DATA_LEN
)
{
r
|=
EMAC_MR1_JPSM
;
dev
->
stop_timeout
=
STOP_TIMEOUT_1000_JUMBO
;
}
else
dev
->
stop_timeout
=
STOP_TIMEOUT_1000
;
break
;
case
SPEED_100
:
r
|=
EMAC_MR1_MF_100
;
dev
->
stop_timeout
=
STOP_TIMEOUT_100
;
/* Fall through */
default:
r
|=
EMAC_MR1_RFS_4K
;
...
...
@@ -2048,6 +2067,7 @@ static int __init emac_probe(struct ocp_device *ocpdev)
dev
->
phy
.
duplex
=
DUPLEX_FULL
;
dev
->
phy
.
autoneg
=
AUTONEG_DISABLE
;
dev
->
phy
.
pause
=
dev
->
phy
.
asym_pause
=
0
;
dev
->
stop_timeout
=
STOP_TIMEOUT_100
;
init_timer
(
&
dev
->
link_timer
);
dev
->
link_timer
.
function
=
emac_link_timer
;
dev
->
link_timer
.
data
=
(
unsigned
long
)
dev
;
...
...
drivers/net/ibm_emac/ibm_emac_core.h
浏览文件 @
f327220b
...
...
@@ -189,6 +189,8 @@ struct ocp_enet_private {
struct
timer_list
link_timer
;
int
reset_failed
;
int
stop_timeout
;
/* in us */
struct
ibm_emac_error_stats
estats
;
struct
net_device_stats
nstats
;
...
...
drivers/net/jazzsonic.c
浏览文件 @
f327220b
...
...
@@ -296,7 +296,7 @@ static int __init jazz_sonic_init_module(void)
}
jazz_sonic_device
=
platform_device_alloc
(
jazz_sonic_string
,
0
);
if
(
!
jazz_son
n
ic_device
)
if
(
!
jazz_sonic_device
)
goto
out_unregister
;
if
(
platform_device_add
(
jazz_sonic_device
))
{
...
...
@@ -307,7 +307,7 @@ static int __init jazz_sonic_init_module(void)
return
0
;
out_unregister:
driver_unregister
(
&
jazz_sonic_driver
);
platform_
driver_unregister
(
&
jazz_sonic_driver
);
return
-
ENOMEM
;
}
...
...
drivers/net/mipsnet.h
浏览文件 @
f327220b
//
// <COPYRIGHT CLASS="1B" YEAR="2005">
// Unpublished work (c) MIPS Technologies, Inc. All rights reserved.
// Unpublished rights reserved under the copyright laws of the U.S.A. and
// other countries.
//
// PROPRIETARY / SECRET CONFIDENTIAL INFORMATION OF MIPS TECHNOLOGIES, INC.
// FOR INTERNAL USE ONLY.
//
// Under no circumstances (contract or otherwise) may this information be
// disclosed to, or copied, modified or used by anyone other than employees
// or contractors of MIPS Technologies having a need to know.
// </COPYRIGHT>
//
//++
// File: MIPS_Net.h
//
// Description:
// The definition of the emulated MIPSNET device's interface.
//
// Notes: This include file needs to work from a Linux device drivers.
//
//--
//
/*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*/
#ifndef __MIPSNET_H
#define __MIPSNET_H
...
...
drivers/net/pcmcia/fmvj18x_cs.c
浏览文件 @
f327220b
...
...
@@ -131,10 +131,9 @@ typedef struct local_info_t {
u_short
tx_queue_len
;
cardtype_t
cardtype
;
u_short
sent
;
u_char
mc_filter
[
8
];
}
local_info_t
;
#define MC_FILTERBREAK
8
#define MC_FILTERBREAK
64
/*====================================================================*/
/*
...
...
@@ -1005,15 +1004,8 @@ static void fjn_reset(struct net_device *dev)
for
(
i
=
0
;
i
<
6
;
i
++
)
outb
(
dev
->
dev_addr
[
i
],
ioaddr
+
NODE_ID
+
i
);
/* Switch to bank 1 */
if
(
lp
->
cardtype
==
MBH10302
)
outb
(
BANK_1
,
ioaddr
+
CONFIG_1
);
else
outb
(
BANK_1U
,
ioaddr
+
CONFIG_1
);
/* set the multicast table to accept none. */
for
(
i
=
0
;
i
<
8
;
i
++
)
outb
(
0x00
,
ioaddr
+
MAR_ADR
+
i
);
/* (re)initialize the multicast table */
set_rx_mode
(
dev
);
/* Switch to bank 2 (runtime mode) */
if
(
lp
->
cardtype
==
MBH10302
)
...
...
@@ -1264,11 +1256,11 @@ static struct net_device_stats *fjn_get_stats(struct net_device *dev)
static
void
set_rx_mode
(
struct
net_device
*
dev
)
{
kio_addr_t
ioaddr
=
dev
->
base_addr
;
struct
local_info_t
*
lp
=
netdev_priv
(
dev
);
u_char
mc_filter
[
8
];
/* Multicast hash filter */
u_long
flags
;
int
i
;
int
saved_bank
;
int
saved_config_0
=
inb
(
ioaddr
+
CONFIG_0
);
local_irq_save
(
flags
);
...
...
@@ -1306,15 +1298,13 @@ static void set_rx_mode(struct net_device *dev)
outb
(
2
,
ioaddr
+
RX_MODE
);
/* Use normal mode. */
}
if
(
memcmp
(
mc_filter
,
lp
->
mc_filter
,
sizeof
(
mc_filter
)))
{
int
saved_bank
=
inb
(
ioaddr
+
CONFIG_1
);
/* Switch to bank 1 and set the multicast table. */
outb
(
0xe4
,
ioaddr
+
CONFIG_1
);
for
(
i
=
0
;
i
<
8
;
i
++
)
outb
(
mc_filter
[
i
],
ioaddr
+
MAR_ADR
+
i
);
memcpy
(
lp
->
mc_filter
,
mc_filter
,
sizeof
(
mc_filter
));
outb
(
saved_bank
,
ioaddr
+
CONFIG_1
);
}
/* Switch to bank 1 and set the multicast table. */
saved_bank
=
inb
(
ioaddr
+
CONFIG_1
);
outb
(
0xe4
,
ioaddr
+
CONFIG_1
);
for
(
i
=
0
;
i
<
8
;
i
++
)
outb
(
mc_filter
[
i
],
ioaddr
+
MAR_ADR
+
i
);
outb
(
saved_bank
,
ioaddr
+
CONFIG_1
);
outb
(
saved_config_0
,
ioaddr
+
CONFIG_0
);
...
...
drivers/net/sk98lin/Makefile
浏览文件 @
f327220b
...
...
@@ -27,8 +27,7 @@ sk98lin-objs := \
sktimer.o
\
skvpd.o
\
skxmac2.o
\
skproc.o
\
skcsum.o
skproc.o
# DBGDEF = \
# -DDEBUG
...
...
@@ -77,7 +76,7 @@ endif
# SK_DBGCAT_DRV_INT_SRC 0x04000000 interrupts sources
# SK_DBGCAT_DRV_EVENT 0x08000000 driver events
EXTRA_CFLAGS
+=
-Idrivers
/net/sk98lin
-DSK_DIAG_SUPPORT
-D
SK_USE_CSUM
-D
GENESIS
-DYUKON
$(DBGDEF)
$(SKPARAM)
EXTRA_CFLAGS
+=
-Idrivers
/net/sk98lin
-DSK_DIAG_SUPPORT
-DGENESIS
-DYUKON
$(DBGDEF)
$(SKPARAM)
clean
:
rm
-f
core
*
.o
*
.a
*
.s
...
...
drivers/net/sk98lin/h/skdrv2nd.h
浏览文件 @
f327220b
...
...
@@ -425,10 +425,6 @@ struct s_AC {
TX_PORT
TxPort
[
SK_MAX_MACS
][
2
];
RX_PORT
RxPort
[
SK_MAX_MACS
];
unsigned
int
CsOfs1
;
/* for checksum calculation */
unsigned
int
CsOfs2
;
/* for checksum calculation */
SK_U32
CsOfs
;
/* for checksum calculation */
SK_BOOL
CheckQueue
;
/* check event queue soon */
SK_TIMER
DrvCleanupTimer
;
/* to check for pending descriptors */
DIM_INFO
DynIrqModInfo
;
/* all data related to DIM */
...
...
drivers/net/sk98lin/skcsum.c
已删除
100644 → 0
浏览文件 @
31b3c31b
此差异已折叠。
点击以展开。
drivers/net/sk98lin/skethtool.c
浏览文件 @
f327220b
...
...
@@ -549,4 +549,6 @@ struct ethtool_ops SkGeEthtoolOps = {
.
phys_id
=
locateDevice
,
.
get_pauseparam
=
getPauseParams
,
.
set_pauseparam
=
setPauseParams
,
.
get_link
=
ethtool_op_get_link
,
.
get_perm_addr
=
ethtool_op_get_perm_addr
,
};
drivers/net/sk98lin/skge.c
浏览文件 @
f327220b
...
...
@@ -101,7 +101,6 @@
* "h/skgeinit.h"
* "h/skaddr.h"
* "h/skgesirq.h"
* "h/skcsum.h"
* "h/skrlmt.h"
*
******************************************************************************/
...
...
@@ -113,6 +112,7 @@
#include <linux/init.h>
#include <linux/proc_fs.h>
#include <linux/dma-mapping.h>
#include <linux/ip.h>
#include "h/skdrv1st.h"
#include "h/skdrv2nd.h"
...
...
@@ -601,11 +601,6 @@ SK_BOOL DualNet;
return
(
-
EAGAIN
);
}
SkCsSetReceiveFlags
(
pAC
,
SKCS_PROTO_IP
|
SKCS_PROTO_TCP
|
SKCS_PROTO_UDP
,
&
pAC
->
CsOfs1
,
&
pAC
->
CsOfs2
,
0
);
pAC
->
CsOfs
=
(
pAC
->
CsOfs2
<<
16
)
|
pAC
->
CsOfs1
;
BoardInitMem
(
pAC
);
/* tschilling: New common function with minimum size check. */
DualNet
=
SK_FALSE
;
...
...
@@ -823,7 +818,7 @@ uintptr_t VNextDescr; /* the virtual bus address of the next descriptor */
/* set the pointers right */
pDescr
->
VNextRxd
=
VNextDescr
&
0xffffffffULL
;
pDescr
->
pNextRxd
=
pNextDescr
;
pDescr
->
TcpSumStarts
=
pAC
->
CsOfs
;
pDescr
->
TcpSumStarts
=
0
;
/* advance one step */
pPrevDescr
=
pDescr
;
...
...
@@ -1505,8 +1500,6 @@ struct sk_buff *pMessage) /* pointer to send-message */
TXD
*
pOldTxd
;
unsigned
long
Flags
;
SK_U64
PhysAddr
;
int
Protocol
;
int
IpHeaderLength
;
int
BytesSend
=
pMessage
->
len
;
SK_DBG_MSG
(
NULL
,
SK_DBGMOD_DRV
,
SK_DBGCAT_DRV_TX_PROGRESS
,
(
"X"
));
...
...
@@ -1579,8 +1572,10 @@ struct sk_buff *pMessage) /* pointer to send-message */
pTxd
->
pMBuf
=
pMessage
;
if
(
pMessage
->
ip_summed
==
CHECKSUM_HW
)
{
Protocol
=
((
SK_U8
)
pMessage
->
data
[
C_OFFSET_IPPROTO
]
&
0xff
);
if
((
Protocol
==
C_PROTO_ID_UDP
)
&&
u16
hdrlen
=
pMessage
->
h
.
raw
-
pMessage
->
data
;
u16
offset
=
hdrlen
+
pMessage
->
csum
;
if
((
pMessage
->
h
.
ipiph
->
protocol
==
IPPROTO_UDP
)
&&
(
pAC
->
GIni
.
GIChipRev
==
0
)
&&
(
pAC
->
GIni
.
GIChipId
==
CHIP_ID_YUKON
))
{
pTxd
->
TBControl
=
BMU_TCP_CHECK
;
...
...
@@ -1588,14 +1583,9 @@ struct sk_buff *pMessage) /* pointer to send-message */
pTxd
->
TBControl
=
BMU_UDP_CHECK
;
}
IpHeaderLength
=
(
SK_U8
)
pMessage
->
data
[
C_OFFSET_IPHEADER
];
IpHeaderLength
=
(
IpHeaderLength
&
0xf
)
*
4
;
pTxd
->
TcpSumOfs
=
0
;
/* PH-Checksum already calculated */
pTxd
->
TcpSumSt
=
C_LEN_ETHERMAC_HEADER
+
IpHeaderLength
+
(
Protocol
==
C_PROTO_ID_UDP
?
C_OFFSET_UDPHEADER_UDPCS
:
C_OFFSET_TCPHEADER_TCPCS
);
pTxd
->
TcpSumWr
=
C_LEN_ETHERMAC_HEADER
+
IpHeaderLength
;
pTxd
->
TcpSumOfs
=
0
;
pTxd
->
TcpSumSt
=
hdrlen
;
pTxd
->
TcpSumWr
=
offset
;
pTxd
->
TBControl
|=
BMU_OWN
|
BMU_STF
|
BMU_SW
|
BMU_EOF
|
...
...
@@ -1658,11 +1648,10 @@ struct sk_buff *pMessage) /* pointer to send-message */
TXD
*
pTxdLst
;
int
CurrFrag
;
int
BytesSend
;
int
IpHeaderLength
;
int
Protocol
;
skb_frag_t
*
sk_frag
;
SK_U64
PhysAddr
;
unsigned
long
Flags
;
SK_U32
Control
;
spin_lock_irqsave
(
&
pTxPort
->
TxDesRingLock
,
Flags
);
#ifndef USE_TX_COMPLETE
...
...
@@ -1685,7 +1674,6 @@ struct sk_buff *pMessage) /* pointer to send-message */
pTxdFst
=
pTxd
;
pTxdLst
=
pTxd
;
BytesSend
=
0
;
Protocol
=
0
;
/*
** Map the first fragment (header) into the DMA-space
...
...
@@ -1703,32 +1691,31 @@ struct sk_buff *pMessage) /* pointer to send-message */
** Does the HW need to evaluate checksum for TCP or UDP packets?
*/
if
(
pMessage
->
ip_summed
==
CHECKSUM_HW
)
{
pTxd
->
TBControl
=
BMU_STF
|
BMU_STFWD
|
skb_headlen
(
pMessage
);
u16
hdrlen
=
pMessage
->
h
.
raw
-
pMessage
->
data
;
u16
offset
=
hdrlen
+
pMessage
->
csum
;
Control
=
BMU_STFWD
;
/*
** We have to use the opcode for tcp here, because the
** opcode for udp is not working in the hardware yet
** (Revision 2.0)
*/
Protocol
=
((
SK_U8
)
pMessage
->
data
[
C_OFFSET_IPPROTO
]
&
0xff
);
if
((
Protocol
==
C_PROTO_ID_UDP
)
&&
if
((
pMessage
->
h
.
ipiph
->
protocol
==
IPPROTO_UDP
)
&&
(
pAC
->
GIni
.
GIChipRev
==
0
)
&&
(
pAC
->
GIni
.
GIChipId
==
CHIP_ID_YUKON
))
{
pTxd
->
TB
Control
|=
BMU_TCP_CHECK
;
Control
|=
BMU_TCP_CHECK
;
}
else
{
pTxd
->
TB
Control
|=
BMU_UDP_CHECK
;
Control
|=
BMU_UDP_CHECK
;
}
IpHeaderLength
=
((
SK_U8
)
pMessage
->
data
[
C_OFFSET_IPHEADER
]
&
0xf
)
*
4
;
pTxd
->
TcpSumOfs
=
0
;
/* PH-Checksum already claculated */
pTxd
->
TcpSumSt
=
C_LEN_ETHERMAC_HEADER
+
IpHeaderLength
+
(
Protocol
==
C_PROTO_ID_UDP
?
C_OFFSET_UDPHEADER_UDPCS
:
C_OFFSET_TCPHEADER_TCPCS
);
pTxd
->
TcpSumWr
=
C_LEN_ETHERMAC_HEADER
+
IpHeaderLength
;
}
else
{
pTxd
->
TBControl
=
BMU_CHECK
|
BMU_SW
|
BMU_STF
|
skb_headlen
(
pMessage
);
}
pTxd
->
TcpSumOfs
=
0
;
pTxd
->
TcpSumSt
=
hdrlen
;
pTxd
->
TcpSumWr
=
offset
;
}
else
Control
=
BMU_CHECK
|
BMU_SW
;
pTxd
->
TBControl
=
BMU_STF
|
Control
|
skb_headlen
(
pMessage
);
pTxd
=
pTxd
->
pNextTxd
;
pTxPort
->
TxdRingFree
--
;
...
...
@@ -1752,40 +1739,18 @@ struct sk_buff *pMessage) /* pointer to send-message */
pTxd
->
VDataHigh
=
(
SK_U32
)
(
PhysAddr
>>
32
);
pTxd
->
pMBuf
=
pMessage
;
/*
** Does the HW need to evaluate checksum for TCP or UDP packets?
*/
if
(
pMessage
->
ip_summed
==
CHECKSUM_HW
)
{
pTxd
->
TBControl
=
BMU_OWN
|
BMU_SW
|
BMU_STFWD
;
/*
** We have to use the opcode for tcp here because the
** opcode for udp is not working in the hardware yet
** (revision 2.0)
*/
if
((
Protocol
==
C_PROTO_ID_UDP
)
&&
(
pAC
->
GIni
.
GIChipRev
==
0
)
&&
(
pAC
->
GIni
.
GIChipId
==
CHIP_ID_YUKON
))
{
pTxd
->
TBControl
|=
BMU_TCP_CHECK
;
}
else
{
pTxd
->
TBControl
|=
BMU_UDP_CHECK
;
}
}
else
{
pTxd
->
TBControl
=
BMU_CHECK
|
BMU_SW
|
BMU_OWN
;
}
pTxd
->
TBControl
=
Control
|
BMU_OWN
|
sk_frag
->
size
;;
/*
** Do we have the last fragment?
*/
if
(
(
CurrFrag
+
1
)
==
skb_shinfo
(
pMessage
)
->
nr_frags
)
{
#ifdef USE_TX_COMPLETE
pTxd
->
TBControl
|=
BMU_EOF
|
BMU_IRQ_EOF
|
sk_frag
->
size
;
pTxd
->
TBControl
|=
BMU_EOF
|
BMU_IRQ_EOF
;
#else
pTxd
->
TBControl
|=
BMU_EOF
|
sk_frag
->
size
;
pTxd
->
TBControl
|=
BMU_EOF
;
#endif
pTxdFst
->
TBControl
|=
BMU_OWN
|
BMU_SW
;
}
else
{
pTxd
->
TBControl
|=
sk_frag
->
size
;
}
pTxdLst
=
pTxd
;
pTxd
=
pTxd
->
pNextTxd
;
...
...
@@ -2032,7 +1997,6 @@ SK_U32 Control; /* control field of descriptor */
struct
sk_buff
*
pMsg
;
/* pointer to message holding frame */
struct
sk_buff
*
pNewMsg
;
/* pointer to a new message for copying frame */
int
FrameLength
;
/* total length of received frame */
int
IpFrameLength
;
SK_MBUF
*
pRlmtMbuf
;
/* ptr to a buffer for giving a frame to rlmt */
SK_EVPARA
EvPara
;
/* an event parameter union */
unsigned
long
Flags
;
/* for spin lock */
...
...
@@ -2045,10 +2009,6 @@ SK_BOOL IsMc;
SK_BOOL
IsBadFrame
;
/* Bad frame */
SK_U32
FrameStat
;
unsigned
short
Csum1
;
unsigned
short
Csum2
;
unsigned
short
Type
;
int
Result
;
SK_U64
PhysAddr
;
rx_start:
...
...
@@ -2177,8 +2137,8 @@ SK_U64 PhysAddr;
(
dma_addr_t
)
PhysAddr
,
FrameLength
,
PCI_DMA_FROMDEVICE
);
eth_copy_and_sum
(
pNewMsg
,
pMsg
->
data
,
FrameLength
,
0
);
memcpy
(
pNewMsg
->
data
,
pMsg
,
FrameLength
);
pci_dma_sync_single_for_device
(
pAC
->
PciDev
,
(
dma_addr_t
)
PhysAddr
,
FrameLength
,
...
...
@@ -2206,69 +2166,16 @@ SK_U64 PhysAddr;
/* set length in message */
skb_put
(
pMsg
,
FrameLength
);
/* hardware checksum */
Type
=
ntohs
(
*
((
short
*
)
&
pMsg
->
data
[
12
]));
}
/* frame > SK_COPY_TRESHOLD */
#ifdef USE_SK_RX_CHECKSUM
if
(
Type
==
0x800
)
{
Csum1
=
le16_to_cpu
(
pRxd
->
TcpSums
&
0xffff
);
Csum2
=
le16_to_cpu
((
pRxd
->
TcpSums
>>
16
)
&
0xffff
);
IpFrameLength
=
(
int
)
ntohs
((
unsigned
short
)
((
unsigned
short
*
)
pMsg
->
data
)[
8
]);
/*
* Test: If frame is padded, a check is not possible!
* Frame not padded? Length difference must be 14 (0xe)!
*/
if
((
FrameLength
-
IpFrameLength
)
!=
0xe
)
{
/* Frame padded => TCP offload not possible! */
pMsg
->
ip_summed
=
CHECKSUM_NONE
;
}
else
{
/* Frame not padded => TCP offload! */
if
((((
Csum1
&
0xfffe
)
&&
(
Csum2
&
0xfffe
))
&&
(
pAC
->
GIni
.
GIChipId
==
CHIP_ID_GENESIS
))
||
(
pAC
->
ChipsetType
))
{
Result
=
SkCsGetReceiveInfo
(
pAC
,
&
pMsg
->
data
[
14
],
Csum1
,
Csum2
,
pRxPort
->
PortIndex
);
if
(
Result
==
SKCS_STATUS_IP_FRAGMENT
||
Result
==
SKCS_STATUS_IP_CSUM_OK
||
Result
==
SKCS_STATUS_TCP_CSUM_OK
||
Result
==
SKCS_STATUS_UDP_CSUM_OK
)
{
pMsg
->
ip_summed
=
CHECKSUM_UNNECESSARY
;
}
else
if
(
Result
==
SKCS_STATUS_TCP_CSUM_ERROR
||
Result
==
SKCS_STATUS_UDP_CSUM_ERROR
||
Result
==
SKCS_STATUS_IP_CSUM_ERROR_UDP
||
Result
==
SKCS_STATUS_IP_CSUM_ERROR_TCP
||
Result
==
SKCS_STATUS_IP_CSUM_ERROR
)
{
/* HW Checksum error */
SK_DBG_MSG
(
NULL
,
SK_DBGMOD_DRV
,
SK_DBGCAT_DRV_RX_PROGRESS
,
(
"skge: CRC error. Frame dropped!
\n
"
));
goto
rx_failed
;
}
else
{
pMsg
->
ip_summed
=
CHECKSUM_NONE
;
}
}
/* checksumControl calculation valid */
}
/* Frame length check */
}
/* IP frame */
pMsg
->
csum
=
pRxd
->
TcpSums
;
pMsg
->
ip_summed
=
CHECKSUM_HW
;
#else
pMsg
->
ip_summed
=
CHECKSUM_NONE
;
pMsg
->
ip_summed
=
CHECKSUM_NONE
;
#endif
}
/* frame > SK_COPY_TRESHOLD */
SK_DBG_MSG
(
NULL
,
SK_DBGMOD_DRV
,
1
,(
"V"
));
ForRlmt
=
SK_RLMT_RX_PROTOCOL
;
#if 0
...
...
@@ -4946,7 +4853,7 @@ static int __devinit skge_probe_one(struct pci_dev *pdev,
dev
->
irq
=
pdev
->
irq
;
error
=
SkGeInitPCI
(
pAC
);
if
(
error
)
{
printk
(
"SKGE
: PCI setup failed: %i
\n
"
,
error
);
printk
(
KERN_ERR
"sk98lin
: PCI setup failed: %i
\n
"
,
error
);
goto
out_free_netdev
;
}
...
...
@@ -4982,7 +4889,7 @@ static int __devinit skge_probe_one(struct pci_dev *pdev,
/* Register net device */
if
(
register_netdev
(
dev
))
{
printk
(
KERN_ERR
"
SKGE
: Could not register device.
\n
"
);
printk
(
KERN_ERR
"
sk98lin
: Could not register device.
\n
"
);
goto
out_free_resources
;
}
...
...
@@ -5001,8 +4908,8 @@ static int __devinit skge_probe_one(struct pci_dev *pdev,
SkGeYellowLED
(
pAC
,
pAC
->
IoBase
,
1
);
memcpy
(
&
dev
->
dev_addr
,
&
pAC
->
Addr
.
Net
[
0
].
CurrentMacAddress
,
6
);
memcpy
(
dev
->
perm_addr
,
dev
->
dev_addr
,
dev
->
addr_len
);
SkGeProcCreate
(
dev
);
...
...
@@ -5048,13 +4955,14 @@ static int __devinit skge_probe_one(struct pci_dev *pdev,
#endif
if
(
register_netdev
(
dev
))
{
printk
(
KERN_ERR
"
SKGE: Could not register device
.
\n
"
);
printk
(
KERN_ERR
"
sk98lin: Could not register device for seconf port
.
\n
"
);
free_netdev
(
dev
);
pAC
->
dev
[
1
]
=
pAC
->
dev
[
0
];
}
else
{
SkGeProcCreate
(
dev
);
memcpy
(
&
dev
->
dev_addr
,
&
pAC
->
Addr
.
Net
[
1
].
CurrentMacAddress
,
6
);
memcpy
(
dev
->
perm_addr
,
dev
->
dev_addr
,
dev
->
addr_len
);
printk
(
"%s: %s
\n
"
,
dev
->
name
,
pAC
->
DeviceStr
);
printk
(
" PrefPort:B RlmtMode:Dual Check Link State
\n
"
);
...
...
drivers/net/skge.c
浏览文件 @
f327220b
...
...
@@ -2300,14 +2300,12 @@ static int skge_xmit_frame(struct sk_buff *skb, struct net_device *dev)
td
->
dma_hi
=
map
>>
32
;
if
(
skb
->
ip_summed
==
CHECKSUM_HW
)
{
const
struct
iphdr
*
ip
=
(
const
struct
iphdr
*
)
(
skb
->
data
+
ETH_HLEN
);
int
offset
=
skb
->
h
.
raw
-
skb
->
data
;
/* This seems backwards, but it is what the sk98lin
* does. Looks like hardware is wrong?
*/
if
(
ip
->
protocol
==
IPPROTO_UDP
if
(
skb
->
h
.
ipiph
->
protocol
==
IPPROTO_UDP
&&
hw
->
chip_rev
==
0
&&
hw
->
chip_id
==
CHIP_ID_YUKON
)
control
=
BMU_TCP_CHECK
;
else
...
...
drivers/net/wireless/airo.c
浏览文件 @
f327220b
...
...
@@ -2755,8 +2755,8 @@ static struct net_device *_init_airo_card( unsigned short irq, int port,
SET_NETDEV_DEV
(
dev
,
dmdev
);
if
(
test_bit
(
FLAG_MPI
,
&
ai
->
flags
))
reset_card
(
dev
,
1
);
reset_card
(
dev
,
1
);
msleep
(
400
);
rc
=
request_irq
(
dev
->
irq
,
airo_interrupt
,
SA_SHIRQ
,
dev
->
name
,
dev
);
if
(
rc
)
{
...
...
drivers/net/wireless/orinoco.c
浏览文件 @
f327220b
...
...
@@ -3512,9 +3512,8 @@ static int orinoco_ioctl_setpower(struct net_device *dev,
break
;
default:
err
=
-
EINVAL
;
}
if
(
err
)
goto
out
;
}
if
(
prq
->
flags
&
IW_POWER_TIMEOUT
)
{
priv
->
pm_on
=
1
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录