diff options
author | Krzysztof Hałasa <khc@pm.waw.pl> | 2008-07-09 14:01:23 -0400 |
---|---|---|
committer | Krzysztof Hałasa <khc@pm.waw.pl> | 2008-11-21 20:49:47 -0500 |
commit | b0942f78dd6493c5590cc80fedd5e3b357a15334 (patch) | |
tree | 386dfc7475e33452a145ea0567dc344c27e8b860 /drivers/net/wan | |
parent | 09fd65aa8ac934ea4ce7e55945a687292731e9c9 (diff) |
WAN: HD64572 already handles TX underruns with DMAC.
Signed-off-by: Krzysztof Hałasa <khc@pm.waw.pl>
Diffstat (limited to 'drivers/net/wan')
-rw-r--r-- | drivers/net/wan/hd64572.c | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/drivers/net/wan/hd64572.c b/drivers/net/wan/hd64572.c index e332fe906aba..bdb625080a16 100644 --- a/drivers/net/wan/hd64572.c +++ b/drivers/net/wan/hd64572.c | |||
@@ -232,19 +232,12 @@ static inline void sca_msci_intr(port_t *port) | |||
232 | { | 232 | { |
233 | u16 msci = get_msci(port); | 233 | u16 msci = get_msci(port); |
234 | card_t* card = port_to_card(port); | 234 | card_t* card = port_to_card(port); |
235 | u8 stat = sca_in(msci + ST1, card); /* read MSCI ST1 status */ | ||
236 | 235 | ||
237 | /* Reset MSCI TX underrun and CDCD status bit */ | 236 | if (sca_in(msci + ST1, card) & ST1_CDCD) { |
238 | sca_out(stat & (ST1_UDRN | ST1_CDCD), msci + ST1, card); | 237 | /* Reset MSCI CDCD status bit */ |
239 | 238 | sca_out(ST1_CDCD, msci + ST1, card); | |
240 | if (stat & ST1_UDRN) { | ||
241 | /* TX Underrun error detected */ | ||
242 | port_to_dev(port)->stats.tx_errors++; | ||
243 | port_to_dev(port)->stats.tx_fifo_errors++; | ||
244 | } | ||
245 | |||
246 | if (stat & ST1_CDCD) | ||
247 | sca_set_carrier(port); | 239 | sca_set_carrier(port); |
240 | } | ||
248 | } | 241 | } |
249 | 242 | ||
250 | 243 | ||
@@ -351,11 +344,17 @@ static inline void sca_tx_done(port_t *port) | |||
351 | 344 | ||
352 | while (1) { | 345 | while (1) { |
353 | pkt_desc __iomem *desc = desc_address(port, port->txlast, 1); | 346 | pkt_desc __iomem *desc = desc_address(port, port->txlast, 1); |
347 | u8 stat = readb(&desc->stat); | ||
354 | 348 | ||
355 | if (!(readb(&desc->stat) & ST_TX_OWNRSHP)) | 349 | if (!(stat & ST_TX_OWNRSHP)) |
356 | break; /* not yet transmitted */ | 350 | break; /* not yet transmitted */ |
357 | dev->stats.tx_packets++; | 351 | if (stat & ST_TX_UNDRRUN) { |
358 | dev->stats.tx_bytes += readw(&desc->len); | 352 | dev->stats.tx_errors++; |
353 | dev->stats.tx_fifo_errors++; | ||
354 | } else { | ||
355 | dev->stats.tx_packets++; | ||
356 | dev->stats.tx_bytes += readw(&desc->len); | ||
357 | } | ||
359 | writeb(0, &desc->stat); /* Free descriptor */ | 358 | writeb(0, &desc->stat); /* Free descriptor */ |
360 | port->txlast = next_desc(port, port->txlast, 1); | 359 | port->txlast = next_desc(port, port->txlast, 1); |
361 | } | 360 | } |
@@ -503,12 +502,11 @@ static void sca_open(struct net_device *dev) | |||
503 | sca_out(0x3F, msci + TNR1, card); /* +1=TX DMA deactivation condition*/ | 502 | sca_out(0x3F, msci + TNR1, card); /* +1=TX DMA deactivation condition*/ |
504 | 503 | ||
505 | /* We're using the following interrupts: | 504 | /* We're using the following interrupts: |
506 | - TXINT (DMAC completed all transmissions, underrun or DCD change) | 505 | - TXINT (DMAC completed all transmissions and DCD changes) |
507 | - all DMA interrupts | 506 | - all DMA interrupts |
508 | */ | 507 | */ |
509 | /* MSCI TXINT and RXINTA interrupt enable */ | 508 | /* MSCI TXINT and RXINTA interrupt enable */ |
510 | sca_outl(IE0_TXINT | IE0_RXINTA | IE0_UDRN | IE0_CDCD, msci + IE0, | 509 | sca_outl(IE0_TXINT | IE0_RXINTA | IE0_CDCD, msci + IE0, card); |
511 | card); | ||
512 | 510 | ||
513 | sca_out(port->tmc, msci + TMCR, card); | 511 | sca_out(port->tmc, msci + TMCR, card); |
514 | sca_out(port->tmc, msci + TMCT, card); | 512 | sca_out(port->tmc, msci + TMCT, card); |