summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--openpcd/firmware/src/ssc.c12
-rw-r--r--openpcd/firmware/src/ssc.h2
2 files changed, 13 insertions, 1 deletions
diff --git a/openpcd/firmware/src/ssc.c b/openpcd/firmware/src/ssc.c
index 4c840b6..c9deb79 100644
--- a/openpcd/firmware/src/ssc.c
+++ b/openpcd/firmware/src/ssc.c
@@ -88,13 +88,23 @@ static void ssc_irq(void)
req_ctx_set_state(ssc_state.rx_ctx[0],
RCTX_STATE_UDP_EP2_PENDING);
}
- ssc_rx_refill();
+ if (ssc_rx_refill() == -1)
+ AT91F_AIC_DisableIt(ssc, AT91C_SSC_ENDRX |
+ AT91C_SSC_TXBUFE |
+ AT91C_SSC_OVRUN);
}
if (ssc_sr & AT91C_SSC_OVRUN)
DEBUGPCRF("Rx Overrun, shouldn't happen!");
}
+
+void ssc_rx_unthrottle(void)
+{
+ AT91F_AIC_EnableIt(ssc, AT91C_SSC_ENDRX |
+ AT91C_SSC_TXBUFE | AT91C_SSC_OVRUN);
+}
+
void ssc_rx_start(void)
{
DEBUGPCRF("starting SSC RX\n");
diff --git a/openpcd/firmware/src/ssc.h b/openpcd/firmware/src/ssc.h
index 73450ab..710ee45 100644
--- a/openpcd/firmware/src/ssc.h
+++ b/openpcd/firmware/src/ssc.h
@@ -10,4 +10,6 @@ extern void ssc_rx_init(void);
extern void ssc_fini(void);
+extern void ssc_rx_unthrottle(void);
+
#endif
personal git repositories of Harald Welte. Your mileage may vary