SMSC LAN1198 Manual De Usuario

Descargar
Página de 45
LAN9118 Family Programmer Reference Guide
SMSC AN 12.12
35
Revision 1.0 (12-14-09)
APPLICATION NOTE
 
Figure 6.2 Packet Transmission
Once the device is initialized, the application can continue sending packets until the first indication
appears that the device can no longer accept packets (since we cannot know the size of the next
transmit packet a priori, we want to ensure that we can send the largest packet possible, 1518 bytes
in size).  At that point we tell the network operating system (NOS) to stop sending the driver any more
transmit packets.  When the device has freed up enough buffer space, due to the transmitting of
packets internally queued, it interrupts the application, which disables the interrupt and calls into the
NOS telling it that we can now resume accepting packets for transmit.
For simplicity and completeness, this example shows the TX status results processing handled as a
thread scheduled directly at the entry of the packet transmit function.  In truth this thread of execution
could be scheduled from its own TX Status FIFO Level Interrupt (TSFL),  which signals that a
threshold number of packets have completed the transmit process (successful or not).
Can the FIFO accept the
next packet?
(TX_FIFO_INF:TDFREE )
Block NOS queuing
mechanism which
otherwise calls Hard
Transmit Packet
Set FIFO_INT:TX
Data Available Level
to largest possible
sized packet (0x18),
Enable TDFA_INT_EN
interrupt
return OK;
Hard Transmit
Packet
Interrupt Service Routine
Disable TDFA_INT_EN interrupt on
FIFO_INT:TX Data Available Level
exceeding marker
Un-block NOS queuing mechanism
which would call Hard Transmit Packet
ISR Complete
TDFA Interrupt: TDFREE threshold
reached
Transfer TX Cmd Words, Data Memory Buffer
to TX Data FIFO
Free up NOS Data Memory Buffer
N
Y
Accumulated TX stats
to process?
Schedule NOS thread to evaluate  TX Status
for each packet sent, accumulate common
driver statistics and clear TX Status  FIFO
Y
N