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
Kirill Smelkov
linux
Commits
2fb65448
Commit
2fb65448
authored
Aug 27, 2002
by
Jeff Garzik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix 8139cp net driver 64-bit PCI DMA support
(thanks for DaveM for advice and help)
parent
26394310
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
19 deletions
+11
-19
drivers/net/8139cp.c
drivers/net/8139cp.c
+11
-19
No files found.
drivers/net/8139cp.c
View file @
2fb65448
...
...
@@ -303,13 +303,12 @@ static const unsigned int cp_rx_config =
struct
cp_desc
{
u32
opts1
;
u32
opts2
;
u32
addr_lo
;
u32
addr_hi
;
u64
addr
;
};
struct
ring_info
{
struct
sk_buff
*
skb
;
dma
64
_addr_t
mapping
;
dma_addr_t
mapping
;
unsigned
frag
;
};
...
...
@@ -579,7 +578,7 @@ static void cp_rx (struct cp_private *cp)
while
(
rx_work
--
)
{
u32
status
,
len
;
dma
64
_addr_t
mapping
;
dma_addr_t
mapping
;
struct
sk_buff
*
skb
,
*
new_skb
;
struct
cp_desc
*
desc
;
unsigned
buflen
;
...
...
@@ -646,8 +645,7 @@ static void cp_rx (struct cp_private *cp)
else
desc
->
opts1
=
cpu_to_le32
(
DescOwn
|
cp
->
rx_buf_sz
);
cp
->
rx_ring
[
rx_tail
].
opts2
=
0
;
cp
->
rx_ring
[
rx_tail
].
addr_lo
=
cpu_to_le32
(
mapping
&
0xffffffff
);
cp
->
rx_ring
[
rx_tail
].
addr_hi
=
cpu_to_le32
(
mapping
>>
32
);
cp
->
rx_ring
[
rx_tail
].
addr
=
cpu_to_le64
(
mapping
);
rx_tail
=
NEXT_RX
(
rx_tail
);
}
...
...
@@ -779,14 +777,13 @@ static int cp_start_xmit (struct sk_buff *skb, struct net_device *dev)
if
(
skb_shinfo
(
skb
)
->
nr_frags
==
0
)
{
struct
cp_desc
*
txd
=
&
cp
->
tx_ring
[
entry
];
u32
len
;
dma
64
_addr_t
mapping
;
dma_addr_t
mapping
;
len
=
skb
->
len
;
mapping
=
pci_map_single
(
cp
->
pdev
,
skb
->
data
,
len
,
PCI_DMA_TODEVICE
);
eor
=
(
entry
==
(
CP_TX_RING_SIZE
-
1
))
?
RingEnd
:
0
;
CP_VLAN_TX_TAG
(
txd
,
vlan_tag
);
txd
->
addr_lo
=
cpu_to_le32
(
mapping
&
0xffffffff
);
txd
->
addr_hi
=
cpu_to_le32
(
mapping
>>
32
);
txd
->
addr
=
cpu_to_le64
(
mapping
);
wmb
();
#ifdef CP_TX_CHECKSUM
...
...
@@ -815,7 +812,7 @@ static int cp_start_xmit (struct sk_buff *skb, struct net_device *dev)
}
else
{
struct
cp_desc
*
txd
;
u32
first_len
;
dma
64
_addr_t
first_mapping
;
dma_addr_t
first_mapping
;
int
frag
,
first_entry
=
entry
;
#ifdef CP_TX_CHECKSUM
const
struct
iphdr
*
ip
=
skb
->
nh
.
iph
;
...
...
@@ -836,7 +833,7 @@ static int cp_start_xmit (struct sk_buff *skb, struct net_device *dev)
skb_frag_t
*
this_frag
=
&
skb_shinfo
(
skb
)
->
frags
[
frag
];
u32
len
;
u32
ctrl
;
dma
64
_addr_t
mapping
;
dma_addr_t
mapping
;
len
=
this_frag
->
size
;
mapping
=
pci_map_single
(
cp
->
pdev
,
...
...
@@ -862,8 +859,7 @@ static int cp_start_xmit (struct sk_buff *skb, struct net_device *dev)
txd
=
&
cp
->
tx_ring
[
entry
];
CP_VLAN_TX_TAG
(
txd
,
vlan_tag
);
txd
->
addr_lo
=
cpu_to_le32
(
mapping
&
0xffffffff
);
txd
->
addr_hi
=
cpu_to_le32
(
mapping
>>
32
);
txd
->
addr
=
cpu_to_le64
(
mapping
);
wmb
();
txd
->
opts1
=
cpu_to_le32
(
ctrl
);
...
...
@@ -877,8 +873,7 @@ static int cp_start_xmit (struct sk_buff *skb, struct net_device *dev)
txd
=
&
cp
->
tx_ring
[
first_entry
];
CP_VLAN_TX_TAG
(
txd
,
vlan_tag
);
txd
->
addr_lo
=
cpu_to_le32
(
first_mapping
&
0xffffffff
);
txd
->
addr_hi
=
cpu_to_le32
(
first_mapping
>>
32
);
txd
->
addr
=
cpu_to_le64
(
first_mapping
);
wmb
();
#ifdef CP_TX_CHECKSUM
...
...
@@ -1100,10 +1095,7 @@ static int cp_refill_rx (struct cp_private *cp)
cp
->
rx_ring
[
i
].
opts1
=
cpu_to_le32
(
DescOwn
|
cp
->
rx_buf_sz
);
cp
->
rx_ring
[
i
].
opts2
=
0
;
cp
->
rx_ring
[
i
].
addr_lo
=
cpu_to_le32
(
cp
->
rx_skb
[
i
].
mapping
&
0xffffffff
);
cp
->
rx_ring
[
i
].
addr_hi
=
cpu_to_le32
(
cp
->
rx_skb
[
i
].
mapping
>>
32
);
cp
->
rx_ring
[
i
].
addr
=
cpu_to_le64
(
cp
->
rx_skb
[
i
].
mapping
);
}
return
0
;
...
...
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