1 2 3 4 5 6 7 8 9
10 11 12 13 14 15 16 17 18 19 20 21 22 23
24
25 import xdc.runtime.Error;
26 import ti.sdo.io.DriverTypes;
27
28 /*!
29 * Module through which legacy iom drivers can plug into BIOS 6.x
30 *
31 * The IomAdapter module maps iom.h to IDriver.xdc. A legacy iom
32 * driver has to hook into BIOS 6.x using this module. This module
33 * handles ALL legacy drivers in the system. This single module
34 * takes care of several legacy driver modules.
35 *
36 * As part of its create the IomAdapter module will call mbBindDev for
37 * each of the legacy drivers. {@link #open} will call mdCreateChan.
38 * {@link #close} will call mdDeleteChan. {@link #submit} will call
39 * mdSubmitChan. {@link #control} will call mdControlChan. A delete call will
40 * call mdUnbindDev.
41 *
42 */
43 @ModuleStartup
44 @InstanceFinalize
45
46 module IomAdapter inherits ti.sdo.io.IDriver {
47
48 /*! Iom init function type definition. */
49 typedef Void (*InitFunc)();
50
51 instance:
52
53 /*! Pointer to legacy iom function table */
54 config Ptr iomFxns = null;
55
56 /*! Legacy iom init function */
57 config InitFunc initFxn = null;
58
59 /*! Legacy deviceParams */
60 config Ptr deviceParams = null;
61
62 /*! deviceId for iom driver */
63 config UInt deviceId = 0;
64
65 /*!
66 * ======== create ========
67 * Create an IomAdapter instance
68 */
69 create();
70
71 internal:
72
73 Void driverCallback(Ptr cbArg, DriverTypes.Packet *packet);
74
75 Void postInit(Object *obj);
76
77 Error.Id mapStatus(Int status);
78
79 struct ChanObj {
80 Ptr iomChanHdl;
81 DriverTypes.DoneFxn cbFxn;
82 UArg cbArg;
83 DriverTypes.Packet abortPkt;
84 };
85
86 struct Instance_State {
87 Int deviceId;
88 Ptr deviceParams;
89 Ptr deviceHandle;
90 Ptr iomFxns;
91 InitFunc initFxn;
92 };
93 }