Skip to Content
FreeBSD Device Drivers
book

FreeBSD Device Drivers

by Joseph Kong
April 2012
Intermediate to advanced
352 pages
8h
English
No Starch Press
Content preview from FreeBSD Device Drivers

Action Routines

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.

Note

For the complete list of constants/operations, see the xpt_opcode enumeration defined in the <cam/cam_ccb.h> header.

XPT_PATH_INQ

The XPT_PATH_INQ constant specifies a path inquiry operation, ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Embedded Linux

Embedded Linux

John Lombardo
Essential Linux Device Drivers

Essential Linux Device Drivers

Sreekrishnan Venkateswaran

Publisher Resources

ISBN: 9781457166716Errata