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
2aad7c8e
Commit
2aad7c8e
authored
Sep 23, 2008
by
David S. Miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
de4x5: Use skb_queue_head instead of by-hand implementation.
Signed-off-by:
David S. Miller
<
davem@davemloft.net
>
parent
ebf05982
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
30 deletions
+8
-30
drivers/net/tulip/de4x5.c
drivers/net/tulip/de4x5.c
+8
-30
No files found.
drivers/net/tulip/de4x5.c
View file @
2aad7c8e
...
@@ -832,7 +832,7 @@ struct de4x5_private {
...
@@ -832,7 +832,7 @@ struct de4x5_private {
s32
csr14
;
/* Saved SIA TX/RX Register */
s32
csr14
;
/* Saved SIA TX/RX Register */
s32
csr15
;
/* Saved SIA General Register */
s32
csr15
;
/* Saved SIA General Register */
int
save_cnt
;
/* Flag if state already saved */
int
save_cnt
;
/* Flag if state already saved */
struct
sk_buff
*
skb
;
/* Save the (re-ordered) skb's */
struct
sk_buff
_head
queue
;
/* Save the (re-ordered) skb's */
}
cache
;
}
cache
;
struct
de4x5_srom
srom
;
/* A copy of the SROM */
struct
de4x5_srom
srom
;
/* A copy of the SROM */
int
cfrv
;
/* Card CFRV copy */
int
cfrv
;
/* Card CFRV copy */
...
@@ -1128,6 +1128,7 @@ de4x5_hw_init(struct net_device *dev, u_long iobase, struct device *gendev)
...
@@ -1128,6 +1128,7 @@ de4x5_hw_init(struct net_device *dev, u_long iobase, struct device *gendev)
printk
(
" which has an Ethernet PROM CRC error.
\n
"
);
printk
(
" which has an Ethernet PROM CRC error.
\n
"
);
return
-
ENXIO
;
return
-
ENXIO
;
}
else
{
}
else
{
skb_queue_head_init
(
&
lp
->
cache
.
queue
);
lp
->
cache
.
gepc
=
GEP_INIT
;
lp
->
cache
.
gepc
=
GEP_INIT
;
lp
->
asBit
=
GEP_SLNK
;
lp
->
asBit
=
GEP_SLNK
;
lp
->
asPolarity
=
GEP_SLNK
;
lp
->
asPolarity
=
GEP_SLNK
;
...
@@ -1487,7 +1488,7 @@ de4x5_queue_pkt(struct sk_buff *skb, struct net_device *dev)
...
@@ -1487,7 +1488,7 @@ de4x5_queue_pkt(struct sk_buff *skb, struct net_device *dev)
}
}
}
else
if
(
skb
->
len
>
0
)
{
}
else
if
(
skb
->
len
>
0
)
{
/* If we already have stuff queued locally, use that first */
/* If we already have stuff queued locally, use that first */
if
(
lp
->
cache
.
skb
&&
!
lp
->
interrupt
)
{
if
(
!
skb_queue_empty
(
&
lp
->
cache
.
queue
)
&&
!
lp
->
interrupt
)
{
de4x5_put_cache
(
dev
,
skb
);
de4x5_put_cache
(
dev
,
skb
);
skb
=
de4x5_get_cache
(
dev
);
skb
=
de4x5_get_cache
(
dev
);
}
}
...
@@ -1580,7 +1581,7 @@ de4x5_interrupt(int irq, void *dev_id)
...
@@ -1580,7 +1581,7 @@ de4x5_interrupt(int irq, void *dev_id)
/* Load the TX ring with any locally stored packets */
/* Load the TX ring with any locally stored packets */
if
(
!
test_and_set_bit
(
0
,
(
void
*
)
&
lp
->
cache
.
lock
))
{
if
(
!
test_and_set_bit
(
0
,
(
void
*
)
&
lp
->
cache
.
lock
))
{
while
(
lp
->
cache
.
skb
&&
!
netif_queue_stopped
(
dev
)
&&
lp
->
tx_enable
)
{
while
(
!
skb_queue_empty
(
&
lp
->
cache
.
queue
)
&&
!
netif_queue_stopped
(
dev
)
&&
lp
->
tx_enable
)
{
de4x5_queue_pkt
(
de4x5_get_cache
(
dev
),
dev
);
de4x5_queue_pkt
(
de4x5_get_cache
(
dev
),
dev
);
}
}
lp
->
cache
.
lock
=
0
;
lp
->
cache
.
lock
=
0
;
...
@@ -3679,11 +3680,7 @@ de4x5_free_tx_buffs(struct net_device *dev)
...
@@ -3679,11 +3680,7 @@ de4x5_free_tx_buffs(struct net_device *dev)
}
}
/* Unload the locally queued packets */
/* Unload the locally queued packets */
while
(
lp
->
cache
.
skb
)
{
__skb_queue_purge
(
&
lp
->
cache
.
queue
);
dev_kfree_skb
(
de4x5_get_cache
(
dev
));
}
return
;
}
}
/*
/*
...
@@ -3781,43 +3778,24 @@ static void
...
@@ -3781,43 +3778,24 @@ static void
de4x5_put_cache
(
struct
net_device
*
dev
,
struct
sk_buff
*
skb
)
de4x5_put_cache
(
struct
net_device
*
dev
,
struct
sk_buff
*
skb
)
{
{
struct
de4x5_private
*
lp
=
netdev_priv
(
dev
);
struct
de4x5_private
*
lp
=
netdev_priv
(
dev
);
struct
sk_buff
*
p
;
if
(
lp
->
cache
.
skb
)
{
for
(
p
=
lp
->
cache
.
skb
;
p
->
next
;
p
=
p
->
next
);
p
->
next
=
skb
;
}
else
{
lp
->
cache
.
skb
=
skb
;
}
skb
->
next
=
NULL
;
return
;
__skb_queue_tail
(
&
lp
->
cache
.
queue
,
skb
)
;
}
}
static
void
static
void
de4x5_putb_cache
(
struct
net_device
*
dev
,
struct
sk_buff
*
skb
)
de4x5_putb_cache
(
struct
net_device
*
dev
,
struct
sk_buff
*
skb
)
{
{
struct
de4x5_private
*
lp
=
netdev_priv
(
dev
);
struct
de4x5_private
*
lp
=
netdev_priv
(
dev
);
struct
sk_buff
*
p
=
lp
->
cache
.
skb
;
lp
->
cache
.
skb
=
skb
;
skb
->
next
=
p
;
return
;
__skb_queue_head
(
&
lp
->
cache
.
queue
,
skb
)
;
}
}
static
struct
sk_buff
*
static
struct
sk_buff
*
de4x5_get_cache
(
struct
net_device
*
dev
)
de4x5_get_cache
(
struct
net_device
*
dev
)
{
{
struct
de4x5_private
*
lp
=
netdev_priv
(
dev
);
struct
de4x5_private
*
lp
=
netdev_priv
(
dev
);
struct
sk_buff
*
p
=
lp
->
cache
.
skb
;
if
(
p
)
{
return
__skb_dequeue
(
&
lp
->
cache
.
queue
);
lp
->
cache
.
skb
=
p
->
next
;
p
->
next
=
NULL
;
}
return
p
;
}
}
/*
/*
...
...
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