1.2.5.2.54 TCPIP_MAC_Status Function

C

SYS_STATUS TCPIP_MAC_Status(
    SYS_MODULE_OBJ object
);

Description

This function provides the current status of the MAC driver module.

Precondtions

The TCPIP_MAC_Initialize() function must have been called before calling this function.

Parameters

ParametersDescription
objectDriver object handle, returned from TCPIP_MAC_Initialize().

Returns

  • SYS_STATUS_READY - Indicates that any previous module operation for the specified module has completed.

  • SYS_STATUS_BUSY - Indicates that a previous module operation for the specified module has not yet completed.

  • SYS_STATUS_ERROR - Indicates that the specified module is in an error state.

Remarks

Any value greater than SYS_STATUS_READY is also a normal running state in which the driver is ready to accept new operations.

SYS_STATUS_BUSY - Indicates that the driver is busy with a previous system level operation and cannot start another

SYS_STATUS_ERROR - Indicates that the driver is in an error state Any value less than SYS_STATUS_ERROR is also an error state.

SYS_MODULE_DEINITIALIZED - Indicates that the driver has been deinitialized

This operation can be used to determine when any of the driver's module level operations has completed.

If the status operation returns SYS_STATUS_BUSY, then a previous operation has not yet completed. Once the status operation returns SYS_STATUS_READY, any previous operations have completed.

The value of SYS_STATUS_ERROR is negative (-1). Any value less than that is also an error state.

This function will NEVER block waiting for hardware.

If the Status operation returns an error value, the error may be cleared by calling the reinitialize operation. If that fails, the deinitialize operation will need to be called, followed by the initialize operation to return to normal operations.

Example

SYS_MODULE_OBJ      object;     // Returned from TCPIP_MAC_Initialize
SYS_STATUS          status;

status = TCPIP_MAC_Status(object);
if (SYS_STATUS_ERROR >= status)
{
    // Handle error
}