aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wan/hd64572.c
diff options
context:
space:
mode:
authorKrzysztof Hałasa <khc@pm.waw.pl>2008-07-09 13:28:45 -0400
committerKrzysztof Hałasa <khc@pm.waw.pl>2008-11-21 20:49:47 -0500
commit0446c3b1e6208c6563ff9a0b22fb3b5e5e3e775c (patch)
treedcfaa55de43edf03a5f3fbf5a8fb080693229eaa /drivers/net/wan/hd64572.c
parentb0942f78dd6493c5590cc80fedd5e3b357a15334 (diff)
WAN: rework HD64572 interrupts a bit.
Signed-off-by: Krzysztof Hałasa <khc@pm.waw.pl>
Diffstat (limited to 'drivers/net/wan/hd64572.c')
-rw-r--r--drivers/net/wan/hd64572.c36
1 files changed, 13 insertions, 23 deletions
diff --git a/drivers/net/wan/hd64572.c b/drivers/net/wan/hd64572.c
index bdb625080a16..0952e228c2c3 100644
--- a/drivers/net/wan/hd64572.c
+++ b/drivers/net/wan/hd64572.c
@@ -67,19 +67,12 @@ static inline int sca_intr_status(card_t *card)
67 u8 result = 0; 67 u8 result = 0;
68 u32 isr0 = sca_inl(ISR0, card); 68 u32 isr0 = sca_inl(ISR0, card);
69 69
70 if (isr0 & 0x0000000F) result |= SCA_INTR_DMAC_RX(0); 70 if (isr0 & 0x00000002) result |= SCA_INTR_DMAC_RX(0);
71 if (isr0 & 0x000000F0) result |= SCA_INTR_DMAC_TX(0); 71 if (isr0 & 0x00000020) result |= SCA_INTR_DMAC_TX(0);
72 if (isr0 & 0x00000F00) result |= SCA_INTR_DMAC_RX(1); 72 if (isr0 & 0x00000200) result |= SCA_INTR_DMAC_RX(1);
73 if (isr0 & 0x0000F000) result |= SCA_INTR_DMAC_TX(1); 73 if (isr0 & 0x00002000) result |= SCA_INTR_DMAC_TX(1);
74 if (isr0 & 0x003E0000) result |= SCA_INTR_MSCI(0); 74 if (isr0 & 0x00080000) result |= SCA_INTR_MSCI(0);
75 if (isr0 & 0x3E000000) result |= SCA_INTR_MSCI(1); 75 if (isr0 & 0x08000000) result |= SCA_INTR_MSCI(1);
76
77 if (!(result & SCA_INTR_DMAC_TX(0)))
78 if (sca_in(DSR_TX(0), card) & DSR_EOM)
79 result |= SCA_INTR_DMAC_TX(0);
80 if (!(result & SCA_INTR_DMAC_TX(1)))
81 if (sca_in(DSR_TX(1), card) & DSR_EOM)
82 result |= SCA_INTR_DMAC_TX(1);
83 76
84 return result; 77 return result;
85} 78}
@@ -91,10 +84,9 @@ static inline port_t* dev_to_port(struct net_device *dev)
91 84
92static inline void enable_intr(port_t *port) 85static inline void enable_intr(port_t *port)
93{ 86{
94 /* DMA & MSCI IRQ enable */ 87 /* enable DMIB and MSCI RXINTA interrupts */
95 /* IR0_TXINT | IR0_RXINTA | IR0_DMIB* | IR0_DMIA* */
96 sca_outl(sca_inl(IER0, port->card) | 88 sca_outl(sca_inl(IER0, port->card) |
97 (phy_node(port) ? 0x0A006600 : 0x000A0066), IER0, port->card); 89 (phy_node(port) ? 0x08002200 : 0x00080022), IER0, port->card);
98} 90}
99 91
100static inline void disable_intr(port_t *port) 92static inline void disable_intr(port_t *port)
@@ -211,15 +203,14 @@ static void sca_init_port(port_t *port)
211 sca_outw(HDLC_MAX_MRU, dmac + BFLL, card); 203 sca_outw(HDLC_MAX_MRU, dmac + BFLL, card);
212 /* Chain mode, Multi-frame */ 204 /* Chain mode, Multi-frame */
213 sca_out(0x14, DMR_RX(phy_node(port)), card); 205 sca_out(0x14, DMR_RX(phy_node(port)), card);
214 sca_out(DIR_EOME | DIR_BOFE, DIR_RX(phy_node(port)), 206 sca_out(DIR_EOME, DIR_RX(phy_node(port)), card);
215 card);
216 /* DMA enable */ 207 /* DMA enable */
217 sca_out(DSR_DE, DSR_RX(phy_node(port)), card); 208 sca_out(DSR_DE, DSR_RX(phy_node(port)), card);
218 } else { /* Transmit */ 209 } else { /* Transmit */
219 /* Chain mode, Multi-frame */ 210 /* Chain mode, Multi-frame */
220 sca_out(0x14, DMR_TX(phy_node(port)), card); 211 sca_out(0x14, DMR_TX(phy_node(port)), card);
221 /* enable underflow interrupts */ 212 /* enable underflow interrupts */
222 sca_out(DIR_BOFE, DIR_TX(phy_node(port)), card); 213 sca_out(DIR_EOME, DIR_TX(phy_node(port)), card);
223 } 214 }
224 } 215 }
225 sca_set_carrier(port); 216 sca_set_carrier(port);
@@ -502,11 +493,10 @@ static void sca_open(struct net_device *dev)
502 sca_out(0x3F, msci + TNR1, card); /* +1=TX DMA deactivation condition*/ 493 sca_out(0x3F, msci + TNR1, card); /* +1=TX DMA deactivation condition*/
503 494
504/* We're using the following interrupts: 495/* We're using the following interrupts:
505 - TXINT (DMAC completed all transmissions and DCD changes) 496 - RXINTA (DCD changes only)
506 - all DMA interrupts 497 - DMIB (EOM - single frame transfer complete)
507*/ 498*/
508 /* MSCI TXINT and RXINTA interrupt enable */ 499 sca_outl(IE0_RXINTA | IE0_CDCD, msci + IE0, card);
509 sca_outl(IE0_TXINT | IE0_RXINTA | IE0_CDCD, msci + IE0, card);
510 500
511 sca_out(port->tmc, msci + TMCR, card); 501 sca_out(port->tmc, msci + TMCR, card);
512 sca_out(port->tmc, msci + TMCT, card); 502 sca_out(port->tmc, msci + TMCT, card);