The Enet LLD provides an IOCTL interface to configure the control related functionality of the Ethernet hardware, via Enet_ioctl() function.
The IOCTLs commands are classified according to the Enet LLD layer they belong: peripheral or module. The module IOCTL commands are further grouped into sets related to hardware modules typically found in Ethernet peripherals.
The Enet_ioctl() function takes the following parameters:
Enet LLD provides helper macros to setup the IOCTL parameters. There are four helper macros available to choose depending on the number of arguments:
The code snippet below shows an example of the Enet LLD IOCTL interface, used for reading the version of an Ethernet peripheral.
The IOCTLs commands can be synchronous or asynchronous in nature. Synchronous IOCTLs execute immediately and return the operation status (see Enet_ErrorCodes). Asynchronous IOCTLs initiate an operation but don't wait for completion, they return ENET_SINPROGRESS code. The application must call Enet_poll() function to poll for the operation completion event.
The synchronous or asynchronous nature of IOCTLs is peripheral dependent, please refer to the peripheral specific documentation for further details.
The sample code in previous section corresponds to a synchronous IOCTL. The code snippet below shows the Enet LLD APIs involved in handling an asynchronous IOCTL.