From c6d3073b9cc4303536415e45762cc91f99301fdd Mon Sep 17 00:00:00 2001 From: Mariano Alvira Date: Mon, 29 Mar 2010 19:28:01 -0400 Subject: [PATCH] make tx_head also visible --- lib/include/maca.h | 3 ++- lib/maca.c | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/include/maca.h b/lib/include/maca.h index 5eda1d44a..5f3cdb788 100644 --- a/lib/include/maca.h +++ b/lib/include/maca.h @@ -29,7 +29,7 @@ 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; +extern volatile packet_t *rx_head, *tx_head; extern void maca_rx_callback(volatile packet_t *p) __attribute__((weak)); extern void maca_tx_callback(volatile packet_t *p) __attribute__((weak)); @@ -152,6 +152,7 @@ enum { #define MACA_KEY0 ((volatile uint32_t *) (MACA_BASE+0x164)) #define MACA_OPTIONS ((volatile uint32_t *) (MACA_BASE+0x180)) + /******************************************************************************/ /* everything under this comment is messy, needs cleaning, and will */ /* probably change in the future */ diff --git a/lib/maca.c b/lib/maca.c index 8efc89538..58724bac6 100644 --- a/lib/maca.c +++ b/lib/maca.c @@ -27,12 +27,12 @@ #define reg(x) (*(volatile uint32_t *)(x)) static volatile packet_t packet_pool[NUM_PACKETS]; -static volatile packet_t *free_head, *rx_end, *tx_head, *tx_end, *dma_tx, *dma_rx = 0; +static volatile packet_t *free_head, *rx_end, *tx_end, *dma_tx, *dma_rx = 0; -/* rx_head is visible to the outside */ +/* rx_head and tx_head are visible to the outside */ /* so you can peek at it and see if there is data */ -/* waiting for you */ -volatile packet_t *rx_head; +/* waiting for you, or data still to be sent */ +volatile packet_t *rx_head, *tx_head; /* used for ack recpetion if the packet_pool goes empty */ /* doesn't go back into the pool when freed */