Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
db553508
Commit
db553508
authored
Aug 30, 2003
by
Jeff Garzik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[netdrvr 8139cp] build TX checksumming code, but default OFF
(previously it was ifdef'd) Also, bump version to 1.0.
parent
cacde53e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
16 deletions
+8
-16
drivers/net/8139cp.c
drivers/net/8139cp.c
+8
-16
No files found.
drivers/net/8139cp.c
View file @
db553508
...
@@ -41,11 +41,15 @@
...
@@ -41,11 +41,15 @@
for this to be supported, one must(?) turn on packet padding.
for this to be supported, one must(?) turn on packet padding.
* Support external MII transceivers
* Support external MII transceivers
NOTES:
* TX checksumming is considered experimental. It is off by
default, use ethtool to turn it on.
*/
*/
#define DRV_NAME "8139cp"
#define DRV_NAME "8139cp"
#define DRV_VERSION "
0.5
"
#define DRV_VERSION "
1.0
"
#define DRV_RELDATE "Aug
26
, 2003"
#define DRV_RELDATE "Aug
30
, 2003"
#include <linux/config.h>
#include <linux/config.h>
...
@@ -68,9 +72,6 @@
...
@@ -68,9 +72,6 @@
#include <asm/io.h>
#include <asm/io.h>
#include <asm/uaccess.h>
#include <asm/uaccess.h>
/* experimental TX checksumming feature enable/disable */
#undef CP_TX_CHECKSUM
/* VLAN tagging feature enable/disable */
/* VLAN tagging feature enable/disable */
#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
#define CP_VLAN_TAG_USED 1
#define CP_VLAN_TAG_USED 1
...
@@ -789,7 +790,6 @@ static int cp_start_xmit (struct sk_buff *skb, struct net_device *dev)
...
@@ -789,7 +790,6 @@ static int cp_start_xmit (struct sk_buff *skb, struct net_device *dev)
txd
->
addr
=
cpu_to_le64
(
mapping
);
txd
->
addr
=
cpu_to_le64
(
mapping
);
wmb
();
wmb
();
#ifdef CP_TX_CHECKSUM
if
(
skb
->
ip_summed
==
CHECKSUM_HW
)
{
if
(
skb
->
ip_summed
==
CHECKSUM_HW
)
{
const
struct
iphdr
*
ip
=
skb
->
nh
.
iph
;
const
struct
iphdr
*
ip
=
skb
->
nh
.
iph
;
if
(
ip
->
protocol
==
IPPROTO_TCP
)
if
(
ip
->
protocol
==
IPPROTO_TCP
)
...
@@ -803,7 +803,6 @@ static int cp_start_xmit (struct sk_buff *skb, struct net_device *dev)
...
@@ -803,7 +803,6 @@ static int cp_start_xmit (struct sk_buff *skb, struct net_device *dev)
else
else
BUG
();
BUG
();
}
else
}
else
#endif
txd
->
opts1
=
cpu_to_le32
(
eor
|
len
|
DescOwn
|
txd
->
opts1
=
cpu_to_le32
(
eor
|
len
|
DescOwn
|
FirstFrag
|
LastFrag
);
FirstFrag
|
LastFrag
);
wmb
();
wmb
();
...
@@ -817,9 +816,7 @@ static int cp_start_xmit (struct sk_buff *skb, struct net_device *dev)
...
@@ -817,9 +816,7 @@ static int cp_start_xmit (struct sk_buff *skb, struct net_device *dev)
u32
first_len
,
first_eor
;
u32
first_len
,
first_eor
;
dma_addr_t
first_mapping
;
dma_addr_t
first_mapping
;
int
frag
,
first_entry
=
entry
;
int
frag
,
first_entry
=
entry
;
#ifdef CP_TX_CHECKSUM
const
struct
iphdr
*
ip
=
skb
->
nh
.
iph
;
const
struct
iphdr
*
ip
=
skb
->
nh
.
iph
;
#endif
/* We must give this initial chunk to the device last.
/* We must give this initial chunk to the device last.
* Otherwise we could race with the device.
* Otherwise we could race with the device.
...
@@ -845,7 +842,7 @@ static int cp_start_xmit (struct sk_buff *skb, struct net_device *dev)
...
@@ -845,7 +842,7 @@ static int cp_start_xmit (struct sk_buff *skb, struct net_device *dev)
this_frag
->
page_offset
),
this_frag
->
page_offset
),
len
,
PCI_DMA_TODEVICE
);
len
,
PCI_DMA_TODEVICE
);
eor
=
(
entry
==
(
CP_TX_RING_SIZE
-
1
))
?
RingEnd
:
0
;
eor
=
(
entry
==
(
CP_TX_RING_SIZE
-
1
))
?
RingEnd
:
0
;
#ifdef CP_TX_CHECKSUM
if
(
skb
->
ip_summed
==
CHECKSUM_HW
)
{
if
(
skb
->
ip_summed
==
CHECKSUM_HW
)
{
ctrl
=
eor
|
len
|
DescOwn
|
IPCS
;
ctrl
=
eor
|
len
|
DescOwn
|
IPCS
;
if
(
ip
->
protocol
==
IPPROTO_TCP
)
if
(
ip
->
protocol
==
IPPROTO_TCP
)
...
@@ -855,7 +852,6 @@ static int cp_start_xmit (struct sk_buff *skb, struct net_device *dev)
...
@@ -855,7 +852,6 @@ static int cp_start_xmit (struct sk_buff *skb, struct net_device *dev)
else
else
BUG
();
BUG
();
}
else
}
else
#endif
ctrl
=
eor
|
len
|
DescOwn
;
ctrl
=
eor
|
len
|
DescOwn
;
if
(
frag
==
skb_shinfo
(
skb
)
->
nr_frags
-
1
)
if
(
frag
==
skb_shinfo
(
skb
)
->
nr_frags
-
1
)
...
@@ -880,7 +876,6 @@ static int cp_start_xmit (struct sk_buff *skb, struct net_device *dev)
...
@@ -880,7 +876,6 @@ static int cp_start_xmit (struct sk_buff *skb, struct net_device *dev)
txd
->
addr
=
cpu_to_le64
(
first_mapping
);
txd
->
addr
=
cpu_to_le64
(
first_mapping
);
wmb
();
wmb
();
#ifdef CP_TX_CHECKSUM
if
(
skb
->
ip_summed
==
CHECKSUM_HW
)
{
if
(
skb
->
ip_summed
==
CHECKSUM_HW
)
{
if
(
ip
->
protocol
==
IPPROTO_TCP
)
if
(
ip
->
protocol
==
IPPROTO_TCP
)
txd
->
opts1
=
cpu_to_le32
(
first_eor
|
first_len
|
txd
->
opts1
=
cpu_to_le32
(
first_eor
|
first_len
|
...
@@ -893,7 +888,6 @@ static int cp_start_xmit (struct sk_buff *skb, struct net_device *dev)
...
@@ -893,7 +888,6 @@ static int cp_start_xmit (struct sk_buff *skb, struct net_device *dev)
else
else
BUG
();
BUG
();
}
else
}
else
#endif
txd
->
opts1
=
cpu_to_le32
(
first_eor
|
first_len
|
txd
->
opts1
=
cpu_to_le32
(
first_eor
|
first_len
|
FirstFrag
|
DescOwn
);
FirstFrag
|
DescOwn
);
wmb
();
wmb
();
...
@@ -1793,9 +1787,7 @@ static int __devinit cp_init_one (struct pci_dev *pdev,
...
@@ -1793,9 +1787,7 @@ static int __devinit cp_init_one (struct pci_dev *pdev,
dev->tx_timeout = cp_tx_timeout;
dev->tx_timeout = cp_tx_timeout;
dev->watchdog_timeo = TX_TIMEOUT;
dev->watchdog_timeo = TX_TIMEOUT;
#endif
#endif
#ifdef CP_TX_CHECKSUM
dev
->
features
|=
NETIF_F_SG
|
NETIF_F_IP_CSUM
;
#endif
#if CP_VLAN_TAG_USED
#if CP_VLAN_TAG_USED
dev
->
features
|=
NETIF_F_HW_VLAN_TX
|
NETIF_F_HW_VLAN_RX
;
dev
->
features
|=
NETIF_F_HW_VLAN_TX
|
NETIF_F_HW_VLAN_RX
;
dev
->
vlan_rx_register
=
cp_vlan_rx_register
;
dev
->
vlan_rx_register
=
cp_vlan_rx_register
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment