Revision: 406
http://svn.sourceforge.net/cadcdev/?rev=406&view=rev
Author: ljsebald
Date: 2007-05-24 18:16:24 -0700 (Thu, 24 May 2007)
Log Message:
-----------
Added in code to support polling receives on the BBA. Also, made it so that this new functionality works in an irq.
Modified Paths:
--------------
kos/kernel/arch/dreamcast/hardware/network/broadband_adapter.c
Modified: kos/kernel/arch/dreamcast/hardware/network/broadband_adapter.c
===================================================================
--- kos/kernel/arch/dreamcast/hardware/network/broadband_adapter.c 2007-05-25 01:10:09 UTC (rev 405)
+++ kos/kernel/arch/dreamcast/hardware/network/broadband_adapter.c 2007-05-25 01:16:24 UTC (rev 406)
@@ -4,6 +4,7 @@
Copyright (C)2001,2003,2005 Dan Potter
Copyright (C)2004 Vincent Penne
+ Copyright (C)2007 Lawrence Sebald
*/
@@ -517,7 +518,7 @@
if (len <= 0)
return 1;
- if (len > DMA_THRESHOLD) {
+ if (len > DMA_THRESHOLD && !irq_inside_int()) {
uint32 add;
/*
@@ -952,9 +953,26 @@
return 0;
}
-/* All RX is done via the interrupt */
static int bba_if_rx_poll(netif_t *self) {
- return -1;
+ int intr;
+
+ intr = g2_read_16(NIC(RT_INTRSTATUS));
+
+ if (intr & RT_INT_RX_ACK) {
+ bba_rx();
+
+ /* so that the irq is not called */
+ g2_write_16(NIC(RT_INTRSTATUS), RT_INT_RX_ACK);
+ }
+
+ if (rxout != rxin) {
+ /* Call the callback to process it */
+ eth_rx_callback(rx_pkt[rxout].rxbuff, rx_pkt[rxout].pkt_size);
+
+ rxout = (rxout + 1) % MAX_PKTS;
+ }
+
+ return 0;
}
/* Don't need to hook anything here yet */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|