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
a81f805c
Commit
a81f805c
authored
Mar 22, 2004
by
François Romieu
Committed by
Jeff Garzik
Mar 22, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[netdrvr epic100] napi 3/3 - transmit path
parent
27863cec
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
11 deletions
+9
-11
drivers/net/epic100.c
drivers/net/epic100.c
+9
-11
No files found.
drivers/net/epic100.c
View file @
a81f805c
...
@@ -96,8 +96,8 @@ static int rx_copybreak;
...
@@ -96,8 +96,8 @@ static int rx_copybreak;
Making the Tx ring too large decreases the effectiveness of channel
Making the Tx ring too large decreases the effectiveness of channel
bonding and packet priority.
bonding and packet priority.
There are no ill effects from too-large receive rings. */
There are no ill effects from too-large receive rings. */
#define TX_RING_SIZE
1
6
#define TX_RING_SIZE
25
6
#define TX_QUEUE_LEN
1
0
/* Limit ring entries actually used. */
#define TX_QUEUE_LEN
24
0
/* Limit ring entries actually used. */
#define RX_RING_SIZE 256
#define RX_RING_SIZE 256
#define TX_TOTAL_SIZE TX_RING_SIZE*sizeof(struct epic_tx_desc)
#define TX_TOTAL_SIZE TX_RING_SIZE*sizeof(struct epic_tx_desc)
#define RX_TOTAL_SIZE RX_RING_SIZE*sizeof(struct epic_rx_desc)
#define RX_TOTAL_SIZE RX_RING_SIZE*sizeof(struct epic_rx_desc)
...
@@ -294,7 +294,8 @@ enum CommandBits {
...
@@ -294,7 +294,8 @@ enum CommandBits {
#define EpicRemoved 0xffffffff
/* Chip failed or removed (CardBus) */
#define EpicRemoved 0xffffffff
/* Chip failed or removed (CardBus) */
#define EpicNapiEvent (RxDone | RxStarted | RxEarlyWarn | RxOverflow | RxFull)
#define EpicNapiEvent (TxEmpty | TxDone | \
RxDone | RxStarted | RxEarlyWarn | RxOverflow | RxFull)
#define EpicNormalEvent (0x0000ffff & ~EpicNapiEvent)
#define EpicNormalEvent (0x0000ffff & ~EpicNapiEvent)
static
u16
media2miictl
[
16
]
=
{
static
u16
media2miictl
[
16
]
=
{
...
@@ -503,7 +504,7 @@ static int __devinit epic_init_one (struct pci_dev *pdev,
...
@@ -503,7 +504,7 @@ static int __devinit epic_init_one (struct pci_dev *pdev,
ep
->
chip_flags
=
pci_id_tbl
[
chip_idx
].
drv_flags
;
ep
->
chip_flags
=
pci_id_tbl
[
chip_idx
].
drv_flags
;
ep
->
irq_mask
=
ep
->
irq_mask
=
(
ep
->
chip_flags
&
TYPE2_INTR
?
PCIBusErr175
:
PCIBusErr170
)
(
ep
->
chip_flags
&
TYPE2_INTR
?
PCIBusErr175
:
PCIBusErr170
)
|
CntFull
|
TxUnderrun
|
TxDone
|
TxEmpty
|
EpicNapiEvent
;
|
CntFull
|
TxUnderrun
|
EpicNapiEvent
;
/* Find the connected MII xcvrs.
/* Find the connected MII xcvrs.
Doing this in open() would allow detecting external xcvrs later, but
Doing this in open() would allow detecting external xcvrs later, but
...
@@ -804,7 +805,7 @@ static int epic_open(struct net_device *dev)
...
@@ -804,7 +805,7 @@ static int epic_open(struct net_device *dev)
/* Enable interrupts by setting the interrupt mask. */
/* Enable interrupts by setting the interrupt mask. */
outl
((
ep
->
chip_flags
&
TYPE2_INTR
?
PCIBusErr175
:
PCIBusErr170
)
outl
((
ep
->
chip_flags
&
TYPE2_INTR
?
PCIBusErr175
:
PCIBusErr170
)
|
CntFull
|
TxUnderrun
|
TxDone
|
TxEmpty
|
CntFull
|
TxUnderrun
|
RxError
|
RxHeader
|
EpicNapiEvent
,
ioaddr
+
INTMASK
);
|
RxError
|
RxHeader
|
EpicNapiEvent
,
ioaddr
+
INTMASK
);
if
(
debug
>
1
)
if
(
debug
>
1
)
...
@@ -892,7 +893,7 @@ static void epic_restart(struct net_device *dev)
...
@@ -892,7 +893,7 @@ static void epic_restart(struct net_device *dev)
/* Enable interrupts by setting the interrupt mask. */
/* Enable interrupts by setting the interrupt mask. */
outl
((
ep
->
chip_flags
&
TYPE2_INTR
?
PCIBusErr175
:
PCIBusErr170
)
outl
((
ep
->
chip_flags
&
TYPE2_INTR
?
PCIBusErr175
:
PCIBusErr170
)
|
CntFull
|
TxUnderrun
|
TxDone
|
TxEmpty
|
CntFull
|
TxUnderrun
|
RxError
|
RxHeader
|
EpicNapiEvent
,
ioaddr
+
INTMASK
);
|
RxError
|
RxHeader
|
EpicNapiEvent
,
ioaddr
+
INTMASK
);
printk
(
KERN_DEBUG
"%s: epic_restart() done, cmd status %4.4x, ctl %4.4x"
printk
(
KERN_DEBUG
"%s: epic_restart() done, cmd status %4.4x, ctl %4.4x"
...
@@ -1111,7 +1112,6 @@ static void epic_tx(struct net_device *dev, struct epic_private *ep)
...
@@ -1111,7 +1112,6 @@ static void epic_tx(struct net_device *dev, struct epic_private *ep)
* Note: if this lock becomes a problem we can narrow the locked
* Note: if this lock becomes a problem we can narrow the locked
* region at the cost of occasionally grabbing the lock more times.
* region at the cost of occasionally grabbing the lock more times.
*/
*/
spin_lock
(
&
ep
->
lock
);
cur_tx
=
ep
->
cur_tx
;
cur_tx
=
ep
->
cur_tx
;
for
(
dirty_tx
=
ep
->
dirty_tx
;
cur_tx
-
dirty_tx
>
0
;
dirty_tx
++
)
{
for
(
dirty_tx
=
ep
->
dirty_tx
;
cur_tx
-
dirty_tx
>
0
;
dirty_tx
++
)
{
struct
sk_buff
*
skb
;
struct
sk_buff
*
skb
;
...
@@ -1150,7 +1150,6 @@ static void epic_tx(struct net_device *dev, struct epic_private *ep)
...
@@ -1150,7 +1150,6 @@ static void epic_tx(struct net_device *dev, struct epic_private *ep)
ep
->
tx_full
=
0
;
ep
->
tx_full
=
0
;
netif_wake_queue
(
dev
);
netif_wake_queue
(
dev
);
}
}
spin_unlock
(
&
ep
->
lock
);
}
}
...
@@ -1187,9 +1186,6 @@ static irqreturn_t epic_interrupt(int irq, void *dev_instance, struct pt_regs *r
...
@@ -1187,9 +1186,6 @@ static irqreturn_t epic_interrupt(int irq, void *dev_instance, struct pt_regs *r
spin_unlock
(
&
ep
->
napi_lock
);
spin_unlock
(
&
ep
->
napi_lock
);
}
}
if
(
status
&
(
TxEmpty
|
TxDone
))
epic_tx
(
dev
,
ep
);
/* Check uncommon events all at once. */
/* Check uncommon events all at once. */
if
(
status
&
if
(
status
&
(
CntFull
|
TxUnderrun
|
PCIBusErr170
|
PCIBusErr175
))
{
(
CntFull
|
TxUnderrun
|
PCIBusErr170
|
PCIBusErr175
))
{
...
@@ -1362,6 +1358,8 @@ static int epic_poll(struct net_device *dev, int *budget)
...
@@ -1362,6 +1358,8 @@ static int epic_poll(struct net_device *dev, int *budget)
rx_action:
rx_action:
outl
(
EpicNapiEvent
,
ioaddr
+
INTSTAT
);
outl
(
EpicNapiEvent
,
ioaddr
+
INTSTAT
);
epic_tx
(
dev
,
ep
);
work_done
=
epic_rx
(
dev
,
*
budget
);
work_done
=
epic_rx
(
dev
,
*
budget
);
epic_rx_err
(
dev
,
ep
);
epic_rx_err
(
dev
,
ep
);
...
...
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