Forum Discussion
Altera_Forum
Honored Contributor
15 years agoI don't remember how the interniche drivers are made, but basically the free and lock process are very simple:
[list][*]whenever you touch to the packet queues or allocation/deallocation, you must lock the stack first[*]when sending in sync mode, the send function only returns once the packet has been sent. The packet therefore can (and must!) be deallocated after the send call [*]when sending in async mode, the send function returns once it has set up the DMA, and probably before the packet has actually been sent. In that case you musn't deallocate the packet, because if it is allocated again before it has been sent, it's contents could be overwritten. The deallocation must be done from the ISR that is triggered by the DMA after the transfer has been complete.[/list] I'm guessing that the difference between pkt_send and raw_send is that one is synchronous and the other isn't, but they really didn't choose descriptive names for them. As far as I know the TSE driver doesn't use interrupts on the transmit DMA and only does synchronous transfers.