April 2012
Intermediate to advanced
352 pages
8h
English
As mentioned previously, action routines are executed every time a SIM receives a CCB. You can think of action routines like the “main function” for a SIM.
Here is the function prototype for an action routine (taken from the <cam/cam_sim.h> header):
typedef void (*sim_action_func)(struct cam_sim *sim, union ccb *ccb);
Recall that action routines switch according to the ccb->ccb_h.func_code variable, which contains a constant that symbolizes the I/O operation to perform. For the rest of this chapter, I’ll detail the most common constants/operations.
For the complete list of constants/operations, see the xpt_opcode enumeration defined in the <cam/cam_ccb.h> header.
The XPT_PATH_INQ constant specifies a path inquiry operation, ...