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
680639f4
Commit
680639f4
authored
Mar 06, 2002
by
Jeff Garzik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
s/foo/DE4X5_foo/ in de4x5 net driver, to fix conflict
with public namespace.
parent
4df7c015
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
17 deletions
+17
-17
drivers/net/de4x5.c
drivers/net/de4x5.c
+17
-17
No files found.
drivers/net/de4x5.c
View file @
680639f4
...
@@ -657,15 +657,15 @@ struct parameters {
...
@@ -657,15 +657,15 @@ struct parameters {
** DESC_ALIGN. ALIGN aligns the start address of the private memory area
** DESC_ALIGN. ALIGN aligns the start address of the private memory area
** and hence the RX descriptor ring's first entry.
** and hence the RX descriptor ring's first entry.
*/
*/
#define ALIGN4 ((u_long)4 - 1)
/* 1 longword align */
#define
DE4X5_
ALIGN4 ((u_long)4 - 1)
/* 1 longword align */
#define ALIGN8 ((u_long)8 - 1)
/* 2 longword align */
#define
DE4X5_
ALIGN8 ((u_long)8 - 1)
/* 2 longword align */
#define ALIGN16 ((u_long)16 - 1)
/* 4 longword align */
#define
DE4X5_
ALIGN16 ((u_long)16 - 1)
/* 4 longword align */
#define ALIGN32 ((u_long)32 - 1)
/* 8 longword align */
#define
DE4X5_
ALIGN32 ((u_long)32 - 1)
/* 8 longword align */
#define ALIGN64 ((u_long)64 - 1)
/* 16 longword align */
#define
DE4X5_
ALIGN64 ((u_long)64 - 1)
/* 16 longword align */
#define ALIGN128 ((u_long)128 - 1)
/* 32 longword align */
#define
DE4X5_
ALIGN128 ((u_long)128 - 1)
/* 32 longword align */
#define
ALIGN
ALIGN32
/* Keep the DC21040 happy... */
#define
DE4X5_ALIGN DE4X5_
ALIGN32
/* Keep the DC21040 happy... */
#define CACHE_ALIGN CAL_16LONG
#define
DE4X5_
CACHE_ALIGN CAL_16LONG
#define DESC_SKIP_LEN DSL_0
/* Must agree with DESC_ALIGN */
#define DESC_SKIP_LEN DSL_0
/* Must agree with DESC_ALIGN */
/*#define DESC_ALIGN u32 dummy[4]; / * Must agree with DESC_SKIP_LEN */
/*#define DESC_ALIGN u32 dummy[4]; / * Must agree with DESC_SKIP_LEN */
#define DESC_ALIGN
#define DESC_ALIGN
...
@@ -1202,7 +1202,7 @@ de4x5_hw_init(struct net_device *dev, u_long iobase, struct pci_dev *pdev)
...
@@ -1202,7 +1202,7 @@ de4x5_hw_init(struct net_device *dev, u_long iobase, struct pci_dev *pdev)
** Reserve a section of kernel memory for the adapter
** Reserve a section of kernel memory for the adapter
** private area and the TX/RX descriptor rings.
** private area and the TX/RX descriptor rings.
*/
*/
dev
->
priv
=
(
void
*
)
kmalloc
(
sizeof
(
struct
de4x5_private
)
+
ALIGN
,
dev
->
priv
=
(
void
*
)
kmalloc
(
sizeof
(
struct
de4x5_private
)
+
DE4X5_
ALIGN
,
GFP_KERNEL
);
GFP_KERNEL
);
if
(
dev
->
priv
==
NULL
)
{
if
(
dev
->
priv
==
NULL
)
{
return
-
ENOMEM
;
return
-
ENOMEM
;
...
@@ -1212,7 +1212,7 @@ de4x5_hw_init(struct net_device *dev, u_long iobase, struct pci_dev *pdev)
...
@@ -1212,7 +1212,7 @@ de4x5_hw_init(struct net_device *dev, u_long iobase, struct pci_dev *pdev)
** Align to a longword boundary
** Align to a longword boundary
*/
*/
tmp
=
dev
->
priv
;
tmp
=
dev
->
priv
;
dev
->
priv
=
(
void
*
)(((
u_long
)
dev
->
priv
+
ALIGN
)
&
~
ALIGN
);
dev
->
priv
=
(
void
*
)(((
u_long
)
dev
->
priv
+
DE4X5_ALIGN
)
&
~
DE4X5_
ALIGN
);
lp
=
(
struct
de4x5_private
*
)
dev
->
priv
;
lp
=
(
struct
de4x5_private
*
)
dev
->
priv
;
memset
(
dev
->
priv
,
0
,
sizeof
(
struct
de4x5_private
));
memset
(
dev
->
priv
,
0
,
sizeof
(
struct
de4x5_private
));
lp
->
bus
=
bus
.
bus
;
lp
->
bus
=
bus
.
bus
;
...
@@ -1248,7 +1248,7 @@ de4x5_hw_init(struct net_device *dev, u_long iobase, struct pci_dev *pdev)
...
@@ -1248,7 +1248,7 @@ de4x5_hw_init(struct net_device *dev, u_long iobase, struct pci_dev *pdev)
lp
->
dma_size
=
(
NUM_RX_DESC
+
NUM_TX_DESC
)
*
sizeof
(
struct
de4x5_desc
);
lp
->
dma_size
=
(
NUM_RX_DESC
+
NUM_TX_DESC
)
*
sizeof
(
struct
de4x5_desc
);
#if defined(__alpha__) || defined(__powerpc__) || defined(__sparc_v9__) || defined(DE4X5_DO_MEMCPY)
#if defined(__alpha__) || defined(__powerpc__) || defined(__sparc_v9__) || defined(DE4X5_DO_MEMCPY)
lp
->
dma_size
+=
RX_BUFF_SZ
*
NUM_RX_DESC
+
ALIGN
;
lp
->
dma_size
+=
RX_BUFF_SZ
*
NUM_RX_DESC
+
DE4X5_
ALIGN
;
#endif
#endif
lp
->
rx_ring
=
pci_alloc_consistent
(
pdev
,
lp
->
dma_size
,
&
lp
->
dma_rings
);
lp
->
rx_ring
=
pci_alloc_consistent
(
pdev
,
lp
->
dma_size
,
&
lp
->
dma_rings
);
if
(
lp
->
rx_ring
==
NULL
)
{
if
(
lp
->
rx_ring
==
NULL
)
{
...
@@ -1278,9 +1278,9 @@ de4x5_hw_init(struct net_device *dev, u_long iobase, struct pci_dev *pdev)
...
@@ -1278,9 +1278,9 @@ de4x5_hw_init(struct net_device *dev, u_long iobase, struct pci_dev *pdev)
dma_rx_bufs
=
lp
->
dma_rings
+
(
NUM_RX_DESC
+
NUM_TX_DESC
)
dma_rx_bufs
=
lp
->
dma_rings
+
(
NUM_RX_DESC
+
NUM_TX_DESC
)
*
sizeof
(
struct
de4x5_desc
);
*
sizeof
(
struct
de4x5_desc
);
dma_rx_bufs
=
(
dma_rx_bufs
+
ALIGN
)
&
~
ALIGN
;
dma_rx_bufs
=
(
dma_rx_bufs
+
DE4X5_ALIGN
)
&
~
DE4X5_
ALIGN
;
lp
->
rx_bufs
=
(
char
*
)(((
long
)(
lp
->
rx_ring
+
NUM_RX_DESC
lp
->
rx_bufs
=
(
char
*
)(((
long
)(
lp
->
rx_ring
+
NUM_RX_DESC
+
NUM_TX_DESC
)
+
ALIGN
)
&
~
ALIGN
);
+
NUM_TX_DESC
)
+
DE4X5_ALIGN
)
&
~
DE4X5_
ALIGN
);
for
(
i
=
0
;
i
<
NUM_RX_DESC
;
i
++
)
{
for
(
i
=
0
;
i
<
NUM_RX_DESC
;
i
++
)
{
lp
->
rx_ring
[
i
].
status
=
0
;
lp
->
rx_ring
[
i
].
status
=
0
;
lp
->
rx_ring
[
i
].
des1
=
cpu_to_le32
(
RX_BUFF_SZ
);
lp
->
rx_ring
[
i
].
des1
=
cpu_to_le32
(
RX_BUFF_SZ
);
...
@@ -1489,7 +1489,7 @@ de4x5_sw_reset(struct net_device *dev)
...
@@ -1489,7 +1489,7 @@ de4x5_sw_reset(struct net_device *dev)
** Fasternet chips and 4 longwords for all others: DMA errors result
** Fasternet chips and 4 longwords for all others: DMA errors result
** without these values. Cache align 16 long.
** without these values. Cache align 16 long.
*/
*/
bmr
=
(
lp
->
chipset
==
DC21140
?
PBL_8
:
PBL_4
)
|
DESC_SKIP_LEN
|
CACHE_ALIGN
;
bmr
=
(
lp
->
chipset
==
DC21140
?
PBL_8
:
PBL_4
)
|
DESC_SKIP_LEN
|
DE4X5_
CACHE_ALIGN
;
bmr
|=
((
lp
->
chipset
&
~
0x00ff
)
==
DC2114x
?
BMR_RML
:
0
);
bmr
|=
((
lp
->
chipset
&
~
0x00ff
)
==
DC2114x
?
BMR_RML
:
0
);
outl
(
bmr
,
DE4X5_BMR
);
outl
(
bmr
,
DE4X5_BMR
);
...
@@ -3638,12 +3638,12 @@ de4x5_alloc_rx_buff(struct net_device *dev, int index, int len)
...
@@ -3638,12 +3638,12 @@ de4x5_alloc_rx_buff(struct net_device *dev, int index, int len)
struct
sk_buff
*
ret
;
struct
sk_buff
*
ret
;
u_long
i
=
0
,
tmp
;
u_long
i
=
0
,
tmp
;
p
=
dev_alloc_skb
(
IEEE802_3_SZ
+
ALIGN
+
2
);
p
=
dev_alloc_skb
(
IEEE802_3_SZ
+
DE4X5_
ALIGN
+
2
);
if
(
!
p
)
return
NULL
;
if
(
!
p
)
return
NULL
;
p
->
dev
=
dev
;
p
->
dev
=
dev
;
tmp
=
virt_to_bus
(
p
->
data
);
tmp
=
virt_to_bus
(
p
->
data
);
i
=
((
tmp
+
ALIGN
)
&
~
ALIGN
)
-
tmp
;
i
=
((
tmp
+
DE4X5_ALIGN
)
&
~
DE4X5_
ALIGN
)
-
tmp
;
skb_reserve
(
p
,
i
);
skb_reserve
(
p
,
i
);
lp
->
rx_ring
[
index
].
buf
=
cpu_to_le32
(
tmp
+
i
);
lp
->
rx_ring
[
index
].
buf
=
cpu_to_le32
(
tmp
+
i
);
...
...
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