tfUseInterfaceXmitQueue

Jump to: navigation, search

Table of Contents >> Programmer's Reference


#include <trsocket.h>


int tfUseInterfaceXmitQueue (
ttUserInterface interfaceHandle,
short numberXmitDesc
);


Function Description

Enable/Disable the use of an interface transmit queue. If specified depth (numberXmitDescriptors parameter) is zero, this option is turned off. Otherwise this function allocate an empty transmit ring of numberXmitDescriptors elements.

When an interface transmit queue is used, if the device driver send function returns an error, because the chip is not ready to transmit, a pointer to the buffer that could not be transmitted (along with its length, and flag) is stored in an empty slot, in the Treck device transmit queue. The device transmit queue should be big enough to hold pointers to all the buffers that will be sent by the application.

The size of the data sent by an application is limited by the socket send queue size. So, an interface transmit queue should be big enough to hold pointers to buffers sent from all the application sockets through that particular interface. The space allocation overhead for an 'x' entries device transmit queue is (12 + x * 8) bytes. So for a device transmit queue containing 1000 slots, the overhead is 8012 bytes.


Note Note: This function can only be called when the device is not configured. Cannot be called for a point to point interface. Cannot be called if a transmit task is used.


If the interface transmit queue is enabled, the user should call the following periodically to try and empty the device transmit queue (which contains all the buffers that the device driver could not send right away).

errorCode=tfIoctlInterface(interfaceHandle,
                           TM_DEV_IOCTL_EMPTY_XMIT_FLAG,
                           (void *)0,
                           0);


Parameters

  • interfaceHandle
    The interface handle of the device we are waiting to become ready.
  • numberXmitDesc
    Length of the transmit queue. If positive, the interface transmit queue is enabled. If zero, it is disabled.


Returns

  • TM_ENOERROR
    Success.
  • TM_ENOBUFS
    Not enough memory to allocate the empty transmit ring.
  • TM_EPERM
    The device/interface is already configured/opened; the user already uses a transmit task; or the device/interface is a Point-to-Point interface (SLIP or PPP).


Table of Contents >> Programmer's Reference