diff --git a/lib/include/maca.h b/lib/include/maca.h index a63caa6ed..65ee3605d 100644 --- a/lib/include/maca.h +++ b/lib/include/maca.h @@ -128,6 +128,8 @@ volatile packet_t* get_free_packet(void); void free_packet(volatile packet_t *p); void free_all_packets(void); +extern volatile packet_t *rx_head; + /* set_fcs_mode(NO_FCS) to disable checksum filtering */ extern volatile uint8_t fcs_mode; #define set_fcs_mode(x) fcs_mode = (x) diff --git a/lib/maca.c b/lib/maca.c index 090f4e6c7..918d717c3 100644 --- a/lib/maca.c +++ b/lib/maca.c @@ -29,7 +29,12 @@ #define reg(x) (*(volatile uint32_t *)(x)) static volatile packet_t packet_pool[NUM_PACKETS]; -static volatile packet_t *free_head, *rx_head, *rx_end, *tx_head, *tx_end, *dma_tx, *dma_rx = 0; +static volatile packet_t *free_head, *rx_end, *tx_head, *tx_end, *dma_tx, *dma_rx = 0; + +/* rx_head is visible to the outside */ +/* so you can peek at it and see if there is data */ +/* waiting for you */ +volatile packet_t *rx_head; /* used for ack recpetion if the packet_pool goes empty */ /* doesn't go back into the pool when freed */