/* The HIL has a complicated state engine. *Wedefinethestructureofnodesinthestateenginehere.
*/ enum hilse_act { /* HILSE_OUT prepares to receive input if the next node *isanINorEXPECT,andthensendsthegivenpacket.
*/
HILSE_OUT = 0,
/* HILSE_CTS checks if the loop is busy. */
HILSE_CTS,
/* HILSE_OUT_LAST sends the given command packet to *thelastconfigured/runningdeviceontheloop.
*/
HILSE_OUT_LAST,
/* HILSE_OUT_DISC sends the given command packet to *thenextdevicepastthelastconfigured/runningone.
*/
HILSE_OUT_DISC,
/* HILSE_FUNC runs a callback function with given arguments. *apositivereturnvaluecausesthe"ugly"branchtobetaken.
*/
HILSE_FUNC,
/* HILSE_IN simply expects any non-errored packet to arrive *withinargusecs.
*/
HILSE_IN = 0x100,
/* HILSE_EXPECT expects a particular packet to arrive *withinargusecs,anyotherpacketisconsideredanerror.
*/
HILSE_EXPECT,
/* HILSE_EXPECT_LAST as above but dev field should be last *discovered/operationaldevice.
*/
HILSE_EXPECT_LAST,
/* HILSE_EXPECT_LAST as above but dev field should be first *undiscovered/inoperationaldevice.
*/
HILSE_EXPECT_DISC
};
typedefint (hilse_func) (hil_mlc *mlc, int arg); struct hilse_node { enum hilse_act act; /* How to process this node */ union {
hilse_func *func; /* Function to call if HILSE_FUNC */
hil_packet packet; /* Packet to send or to compare */
} object; int arg; /* Timeout in usec or parm for func */ int good; /* Node to jump to on success */ int bad; /* Node to jump to on error */ int ugly; /* Node to jump to on timeout */
};
struct hil_mlc_devinfo {
uint8_t idd[16]; /* Device ID Byte and Describe Record */
uint8_t rsc[16]; /* Security Code Header and Record */
uint8_t exd[16]; /* Extended Describe Record */
uint8_t rnm[16]; /* Device name as returned by RNM command */
};
struct hil_mlc_serio_map {
hil_mlc *mlc; int di_revmap; int didx;
};
/* How many (possibly old/detached) devices the we try to keep track of */ #define HIL_MLC_DEVMEM 16
struct hil_mlc { struct list_head list; /* hil_mlc is organized as linked list */
rwlock_t lock;
void *priv; /* Data specific to a particular type of MLC */
int seidx; /* Current node in state engine */ int istarted, ostarted;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.