drvIoctlFunc

Jump to: navigation, search

Table of Contents >> Optional Protocols >> IGMP

Table of Contents >> Checksum and TCP Segmentation Offloading

Table of Contents >> Integrating Treck >> Adding a Device Driver


#include <trsocket.h>


void drvIoctlFunc (
ttUserInterface interfaceHandle,
int flag,
void * optionPtr,
int optionLen
);


Function Description

This function is a pointer to a function provided by the user and given to the Treck stack with the 'ttDevIoctlFuncPtr' parameter of the tfAddInterface() function. The Treck TCP/IP stack will call the driver ioctl function with either TM_DEV_SET_MCAST_LIST or TM_DEV_SET_ALL_MCAST as described below. The driver does not have to maintain a list of currently enabled multicast addresses (since the stack will do that) and passes the complete list every time a new multicast address needs to be added or deleted.


Parameters

  • interfaceHandle
    The interface of the driver's ioctl routine to call.
  • flag
    See below.
  • optionPtr
    A pointer to a flag-specific parameter.
  • optionLen
    The length of the parameter pointed to by optionPtr.


Possible 'flag' Values

  • TM_DEV_SET_MCAST_LIST
    Enable the reception of the Ethernet multicast addresses pointed to by optionPtr. optionPtr points to a list of 48-bit multicast Ethernet addresses, and optionLen contains the number of multicast Ethernet addresses optionPtr points to. If optionLen is non-zero, The driver will enable reception of the optionLen multicast addresses in the list pointed to by optionPtr. If optionLen is zero, the driver will disable all multicast reception.
  • TM_DEV_SET_ALL_MCAST
    The driver will enable reception of all multicast addresses and should ignore the optionPtr and optionLen arguments.
  • TM_DEV_IOCTL_OFFLOAD_GET
    When the user opens the interface, and if one of the 2 offload macros has been defined, then the stack will call the driver IOCTL function with the TM_DEV_IOCTL_OFFLOAD_GET flag to get the offload capabilities of the device driver. A pointer to an offload structure is passed as 3rd parameter. The offload structure is initialized by the driver.
  • TM_DEV_IOCTL_OFFLOAD_SET
    After having called the device driver IOCTL with the TM_DEV_IOCTL_OFFLOAD_GET flag, and if that function returns TM_ENOERROR, then the stack will immediately call the device driver IOCTL function with the TM_DEV_IOCTL_OFFLOAD_SET flag passing the pointer to the offload structure with its fields as set by the device driver. When this function is called, the driver and the stack have both agreed on what offload capabilities they both support.


Returns

  • TM_ENOERROR
    Success.
  • (Other)
    As returned from the device driver.


Table of Contents >> Optional Protocols >> IGMP

Table of Contents >> Checksum and TCP Segmentation Offloading

Table of Contents >> Integrating Treck >> Adding a Device Driver