module ti.sdo.io.drivers.IomAdapter

Module through which legacy iom drivers can plug into BIOS 6.x

The IomAdapter module maps iom.h to IDriver.xdc. A legacy iom driver has to hook into BIOS 6.x using this module. This module handles ALL legacy drivers in the system. This single module takes care of several legacy driver modules. [ more ... ]
C synopsis target-domain sourced in ti/sdo/io/drivers/IomAdapter.xdc
#include <ti/sdo/io/drivers/IomAdapter.h>
Functions
Void
Void
Void
Void
Functions common to all IDriver modules
Void 
Void 
Ptr 
IomAdapter_open// Open a channel(IomAdapter_Handle handle, String name, UInt mode, UArg chanParams, DriverTypes_DoneFxn cbFxn, UArg cbArg, Error_Block *eb);
UInt 
Functions common to all target instances
Functions common to all target modules
Typedefs
typedef Void 
typedef struct
typedef struct
typedef struct
 
DETAILS
The IomAdapter module maps iom.h to IDriver.xdc. A legacy iom driver has to hook into BIOS 6.x using this module. This module handles ALL legacy drivers in the system. This single module takes care of several legacy driver modules.
As part of its create the IomAdapter module will call mbBindDev for each of the legacy drivers. open will call mdCreateChan. close will call mdDeleteChan. submit will call mdSubmitChan. control will call mdControlChan. A delete call will call mdUnbindDev.
 
typedef IomAdapter_InitFunc

Iom init function type definition

C synopsis target-domain
typedef Void (*IomAdapter_InitFunc)();
 
Module-Wide Built-Ins

C synopsis target-domain
Types_ModuleId IomAdapter_Module_id();
// Get this module's unique id
 
Bool IomAdapter_Module_startupDone();
// Test if this module has completed startup
 
IHeap_Handle IomAdapter_Module_heap();
// The heap from which this module allocates memory
 
Bool IomAdapter_Module_hasMask();
// Test whether this module has a diagnostics mask
 
Bits16 IomAdapter_Module_getMask();
// Returns the diagnostics mask for this module
 
Void IomAdapter_Module_setMask(Bits16 mask);
// Set the diagnostics mask for this module
Instance Object Types

C synopsis target-domain
typedef struct IomAdapter_Object IomAdapter_Object;
// Opaque internal representation of an instance object
 
typedef IomAdapter_Object *IomAdapter_Handle;
// Client reference to an instance object
 
typedef struct IomAdapter_Struct IomAdapter_Struct;
// Opaque client structure large enough to hold an instance object
 
IomAdapter_Handle IomAdapter_handle(IomAdapter_Struct *structP);
// Convert this instance structure pointer into an instance handle
 
IomAdapter_Struct *IomAdapter_struct(IomAdapter_Handle handle);
// Convert this instance handle into an instance structure pointer
Instance Config Parameters

C synopsis target-domain
typedef struct IomAdapter_Params {
// Instance config-params structure
    IInstance_Params *instance;
    // Common per-instance configs
    UInt deviceId;
    // deviceId for iom driver
    Ptr deviceParams;
    // Legacy deviceParams
    IomAdapter_InitFunc initFxn;
    // Legacy iom init function
    Ptr iomFxns;
    // Pointer to legacy iom function table
} IomAdapter_Params;
 
Void IomAdapter_Params_init(IomAdapter_Params *params);
// Initialize this config-params structure with supplier-specified defaults before instance creation
 
config IomAdapter_deviceId  // instance

deviceId for iom driver

C synopsis target-domain
      ...
    UInt deviceId;
 
 
config IomAdapter_deviceParams  // instance

Legacy deviceParams

C synopsis target-domain
      ...
    Ptr deviceParams;
 
 
config IomAdapter_initFxn  // instance

Legacy iom init function

C synopsis target-domain
      ...
    IomAdapter_InitFunc initFxn;
 
 
config IomAdapter_iomFxns  // instance

Pointer to legacy iom function table

C synopsis target-domain
      ...
    Ptr iomFxns;
 
Instance Creation

C synopsis target-domain
IomAdapter_Handle IomAdapter_create(const IomAdapter_Params *params, Error_Block *eb);
// Allocate and initialize a new instance object and return its handle
 
Void IomAdapter_construct(IomAdapter_Struct *structP, const IomAdapter_Params *params);
// Initialize a new instance object inside the provided structure
ARGUMENTS
params — per-instance config params, or NULL to select default values (target-domain only)
eb — active error-handling block, or NULL to select default policy (target-domain only)
Instance Deletion

C synopsis target-domain
Void IomAdapter_delete(IomAdapter_Handle *handleP);
// Finalize and free this previously allocated instance object, setting the referenced handle to NULL
 
Void IomAdapter_destruct(IomAdapter_Struct *structP);
// Finalize the instance object inside the provided structure
 
IomAdapter_close()  // instance

Close a channel. Raises an error upon failure

C synopsis target-domain
Void IomAdapter_close(IomAdapter_Handle handle, Ptr chanHandle, Error_Block *eb);
 
ARGUMENTS
handle — handle of a previously-created IomAdapter instance object
chanHandle — opaque channel handle
eb — error block
DETAILS
For example, trying to close a channel which is NOT in use could raise an error. The error could be driver specific or generic errors defined by ti.sdo.io.DriverTypes
 
IomAdapter_control()  // instance

Send driver specific command to channel or associated device

C synopsis target-domain
Void IomAdapter_control(IomAdapter_Handle handle, Ptr chanHandle, DriverTypes_ControlCmd cmd, UArg cmdArgs, Error_Block *eb);
 
ARGUMENTS
handle — handle of a previously-created IomAdapter instance object
chanHandle — opaque channel handle
cmd — control command
cmdArgs — command argument
eb — error block
 
IomAdapter_open()  // instance

Open a channel

C synopsis target-domain
Ptr IomAdapter_open(IomAdapter_Handle handle, String name, UInt mode, UArg chanParams, DriverTypes_DoneFxn cbFxn, UArg cbArg, Error_Block *eb);
 
ARGUMENTS
handle — handle of a previously-created IomAdapter instance object
name — name string
mode — open mode for channel
chanParams — driver specific channel parameters
cbFxn — callback function
cbArg — callback function arg
eb — error block
RETURNS
opaque channel handle
DETAILS
Use this function to open a channel. The name parameter allows for driver specific configuration. e.g when a channel id is required. The name will be null for most drivers. The mode is either ti.sdo.io.DriverTypes.INPUT or ti.sdo.io.DriverTypes.OUTPUT. chanParams are driver specific. When chanparams is null driver will use default params which were statically configured. The callback function and arg are used to indicate completion of IO after an async submit call. The driver will raise an error when open fails and the error block will contain a driver specific error or a generic error defined by ti.sdo.io.DriverTypes. open returns a driver specific opaque channel handle. Note that open() can be called at Startup time and the driver has to ensure that open() returns the channel pointer even though the driver startup has not been called.
 
IomAdapter_submit()  // instance

Submit io packet to a channel. This may result in a callback

C synopsis target-domain
UInt IomAdapter_submit(IomAdapter_Handle handle, Ptr chanHandle, DriverTypes_Packet *packet, Error_Block *eb);
 
ARGUMENTS
handle — handle of a previously-created IomAdapter instance object
chanHandle — opaque channel handle
packet — io packet
eb — error block
RETURNS
status (DriverTypes_COMPLETED/PENDING/ERROR)
DETAILS
The driver may be able to complete the IO immediately and will return ti.sdo.io.DriverTypes.COMPLETED status. If the driver requires an async callback then, it will return ti.sdo.io.DriverTypes.PENDING. When the driver raises an error, it will return ti.sdo.io.DriverTypes.ERROR and the caller need to check the error block. In case the return value is ti.sdo.io.DriverTypes.PENDING, the driver will call the function specified during open with the IO packet.
Instance Convertors

C synopsis target-domain
IDriver_Handle IomAdapter_Handle_upCast(IomAdapter_Handle handle);
// unconditionally move one level up the inheritance hierarchy
 
IomAdapter_Handle IomAdapter_Handle_downCast(IDriver_Handle handle);
// conditionally move one level down the inheritance hierarchy; NULL upon failure
Instance Built-Ins

C synopsis target-domain
Int IomAdapter_Object_count();
// The number of statically-created instance objects
 
IomAdapter_Handle IomAdapter_Object_get(IomAdapter_Object *array, Int i);
// The handle of the i-th statically-created instance object (array == NULL)
 
IomAdapter_Handle IomAdapter_Object_first();
// The handle of the first dynamically-created instance object, or NULL
 
IomAdapter_Handle IomAdapter_Object_next(IomAdapter_Handle handle);
// The handle of the next dynamically-created instance object, or NULL
 
IHeap_Handle IomAdapter_Object_heap();
// The heap used to allocate dynamically-created instance objects
 
Types_Label *IomAdapter_Handle_label(IomAdapter_Handle handle, Types_Label *buf);
// The label associated with this instance object
 
String IomAdapter_Handle_name(IomAdapter_Handle handle);
// The name of this instance object
 
XDCscript usage meta-domain sourced in ti/sdo/io/drivers/IomAdapter.xdc
var IomAdapter = xdc.useModule('ti.sdo.io.drivers.IomAdapter');
module-wide config parameters
per-instance config parameters
    var params = new IomAdapter.Params// Instance config-params object;
        params.deviceId// deviceId for iom driver = UInt 0;
        params.deviceParams// Legacy deviceParams = Ptr null;
        params.initFxn// Legacy iom init function = Void(*)() null;
        params.iomFxns// Pointer to legacy iom function table = Ptr null;
per-instance creation
    var inst = IomAdapter.create// Create an instance-object(params);
 
 
metaonly config IomAdapter.common$  // module-wide

Common module configuration parameters

XDCscript usage meta-domain
IomAdapter.common$ = Types.Common$ undefined;
 
DETAILS
All modules have this configuration parameter. Its name contains the '$' character to ensure it does not conflict with configuration parameters declared by the module. This allows new configuration parameters to be added in the future without any chance of breaking existing modules.
Instance Config Parameters

XDCscript usage meta-domain
var params = new IomAdapter.Params;
// Instance config-params object
    params.deviceId = UInt 0;
    // deviceId for iom driver
    params.deviceParams = Ptr null;
    // Legacy deviceParams
    params.initFxn = Void(*)() null;
    // Legacy iom init function
    params.iomFxns = Ptr null;
    // Pointer to legacy iom function table
 
config IomAdapter.deviceId  // instance

deviceId for iom driver

XDCscript usage meta-domain
var params = new IomAdapter.Params;
  ...
params.deviceId = UInt 0;
 
C SYNOPSIS
 
config IomAdapter.deviceParams  // instance

Legacy deviceParams

XDCscript usage meta-domain
var params = new IomAdapter.Params;
  ...
params.deviceParams = Ptr null;
 
C SYNOPSIS
 
config IomAdapter.initFxn  // instance

Legacy iom init function

XDCscript usage meta-domain
var params = new IomAdapter.Params;
  ...
params.initFxn = Void(*)() null;
 
C SYNOPSIS
 
config IomAdapter.iomFxns  // instance

Pointer to legacy iom function table

XDCscript usage meta-domain
var params = new IomAdapter.Params;
  ...
params.iomFxns = Ptr null;
 
C SYNOPSIS
Instance Creation

XDCscript usage meta-domain
var params = new IomAdapter.Params;
// Allocate instance config-params
params.config =   ...
// Assign individual configs
 
var inst = IomAdapter.create(params);
// Create an instance-object
ARGUMENTS
params — per-instance config params, or NULL to select default values (target-domain only)
eb — active error-handling block, or NULL to select default policy (target-domain only)
generated on Sat, 11 Feb 2012 00:37:43 GMT