SIM Registration Routines

As alluded to previously, registering a SIM with the CAM subsystem involves three functions:

  • cam_simq_alloc

  • cam_sim_alloc

  • xpt_bus_register

cam_simq_alloc Function

The cam_simq_alloc function allocates a SIM queue.

#include <cam/cam_sim.h>
#include <cam/cam_queue.h>

struct cam_devq *
cam_simq_alloc(u_int32_t max_sim_transactions);

Here, max_sim_transactions denotes the size of the SIM queue. Normally, it is calculated like so:

max_sim_transactions = number_of_supported_devices *
    number_of_commands_that_can_be_concurrently_processed_per_device;

cam_sim_alloc Function

The cam_sim_alloc function allocates a SIM (or bus) descriptor.

Note

If an HBA implements multiple buses (or channels), each bus requires its own descriptor.

#include <sys/param.h> ...

Get FreeBSD Device Drivers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.