• Aucun résultat trouvé

TRANSMISSION OF A FRAME

Dans le document II II II (Page 81-85)

The following paragraphs present the actions required from the host to transmit a frame, and the feedback from the TBC upon completion of frame transmission.

MOTOROLA 4-8

MC68824 USER'S MANUAL

4.2.1 Initialization Performed by Host

In order to transmit a frame, the host must prepare the frame descriptors and buffer descriptors as required for the frame. The following data structures must be initialized by the host:

1. A frame descriptor must be created for each frame as shown below:

• Zero the confirmation/indication word (offset 0)

• Zero the receive status word (offset 2)

• Initialize the control word for next FD pointer (offset 4) with NPV (next pointer valid bit) set to one or zero depending on whether or not another frame has to be transmitted.

Also, W-FD (warning FD pool low bit) must be set to zero.

• Initialize the next frame descriptor pointer (offset 6) if another frame has to be trans-mitted, i.e., NPV= 1.

• Initialize the pointer for the first buffer descriptor (offset C)

• Update the frame data length (offset 10) per the actual frame length to be transmitted.

Note that the TBC does not check for this value to be <8K bytes. The TBC can transmit frames up to 32K -1 bytes.

• Update the frame control (offset 1 B). Note that the TBC does not check for the validity of this value.

• Initialize the MAC destination and source address. Note that the TBC does not check for the validity of these values.

2. Buffer descriptor(s) must be created, the host has to decide how many are required for each frame:

• Initialize the data buffer pointer (offset 2).

• Set LABD (last buffer descriptor bit), located in the control and offset word (offset 6), to one or zero depending on whether or not this is the last linked buffer for this frame.

Also, the offset in bytes from the head of the data buffer to where actual data begins must be entered.

• Load the data buffer length (offset 8) in bytes in bits 0 through 14. Bit 15 which is the warning for buffer descriptor pool low must be set to zero.

• Initialize the next buffer descriptor pointer (offset OE) if the next BD is valid.

3. The data must be loaded in data buffer(s) as necessary. Note, that only one data buffer may be associated with a buffer descriptor.

4.2.2 Management of Transmission Queues

The TBC gets frames for transmission from four queues, one for each priority class. The following is a description of the possible queue conditions.

EMPTY QUEUE

A transmission queue which the host is certain is empty, that is the queue is either uninitialized or the last frame was confirmed. A queue is not empty if for all FDs in the queue, either CFD is zero or CFD is one and NPV is one.

ACTIVE QUEUE

A transmission queue for which the host is certain that the TBC did not read the control word of its last frame's FD. That is, no confirmation was given by the TBC in the frame preceding the final frame in the queue.

MC68824 USER'S MANUAL MOTOROLA

II

II

NOT SURE QUEUE

A transmission queue for which the host cannot determine which of the two previous cat-egories the queue belongs to. This occurs when confirmation was given to the frame pre-ceding the final frame, but not the last frame in the queue, so the user is not sure whether the last frame in the queue will be determined to be empty before the next frame is linked onto it.

4.2.3 Examples of TBC Transmission Queues NPV - Next Pointer Valid

This bit resides in the control word for the next FD.

a

Next pointer is not valid 1 Next pointer is valid

The NPV bit is set and cleared by the host.

CFD - Confirm Frame Descriptor

This bit resides in the confirmation/indication word of the FD

a

TBC did not complete this frame's transmission 1 TBC completed this frame's transmission EMP- Empty

This bit resides in the confirmation/indication word of the FD

a

This queue is not empty 1 This queue is empty

EMP reflects the value of NPV as read by the TBC. EMP is not valid if CFD

= a

because the host clears it when preparing the frame.

The CFD and EMP bits are set and cleared by the TBC in a single memory access after sampling

Figure 4-5. Examples of Queues Status

NPV = 0

4.2.4 Adding a Frame to a Transmission Queue

To cause the TBC to transmit a frame, four cases have to be examined.

In the first case, let's assume that no frames have been previously sent; i.e., the host is ready to send the first frame after initialization. The head of queue pointer for the desired TX access class which resides in the private area must be initialized to point to the first frame descriptor and the queue's status must be updated. This initialization is accomplished using the START command (see 3.4.3 START Command). The START command must be issued to start transmission for each queue.

In the second case, frames could have been previously sent by the TBC but the last frame has already been confirmed by the TBC. In this case, as in the previous case, this amounts to adding a frame to an empty queue (see Figure 4-5); therefore, the START command must be issued.

In the third case, the queue to which the frame belongs is active; that is, the next to last frame has not been confirmed. This is equivalent to adding a frame to an active queue as shown in Figure 4-5. To cause the TBC to transmit the newly added frame, the host has to update the pointer to the new frame in the next FD pointer field and set the NPV bit in the last FD of this active queue.

Finally, in the fourth case a frame could be added to a 'not sure' queue. This is accomplished by adding a frame as if to an active queue as above, then waiting for the CFD bit on the previous FD to be updated. The EMP bit is then checked to see if the queue was an active queue or an empty queue. If it was active, then nothing more needs to be done. If it was empty, then a START command must be issued to the TBC as in adding a frame to an empty queue. A 'not sure' queue that turns out to be an empty queue can be detected if there is a confirmed frame with the EMP bit in the confirmation word set and the NPV bit in the control word also set. This event can be detected by an interrupt routine which could be run upon servicing a TBC interrupt triggered by the perceived end of the queue (TXQE, bit 3 of interrupt status word 0).

The host should keep two pointers for each transmit access class queue: one for the head of the queue where the host checks for TBC confirmation of sending frames, and one to the end of the queue where the host links new frames. The TBC, on the other hand, keeps one pointer to the head of each transmission queue located in the private area so it knows where to start transmitting from.

4.2.5 TBC'S Actions Upon Transmission

Upon completion of frame transmission, the TBC will update the confirmation word located in the FD as follows:

• The CFD bit is set.

• The NIP bit is set if the transmission failed and cleared if the transmission succeeded.

• The EMP bit is set if this was the last frame in this transmit queue.

• If the actual frame length, calculated from the sum of the data in the frame's data buffers, is greater than the frame length (offset 10 in FD), then the negative confirmation bit will be set along with the FTL bit.

• The UR bit (underrun) wiil be set if the TBC attempted to transmit from an empty FIFO. The underrun bit in interrupt status 0 will also be set and an interrupt will be generated if enabled.

The frame will be retransmitted if the non-RWR max retry limit parameter located in the private area has not been exceeded. The non-RWR max retry limit is not an IEEE 802.4 parameter, its maximum value is 255 and a retry will be performed only if an underrun has occurred.

MC68824 USER'S MANUAL MOTOROLA

II

II

Lastly, the TBC will set the TXDF bit in interrupt status word 0 (transmitted data frame), and generate an interrupt if enabled.

Once the host has checked that the frame has been processed (the CFD bit is set), it clears the confirmation indication word and either links this FD to the end of the free frame descriptors pool, uses it in the next transmit frame, or frees up memory space.

Dans le document II II II (Page 81-85)