FreeBSD kernel CAM code
cam.c File Reference
#include <sys/cdefs.h>
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/sysctl.h>
#include <cam/cam.h>
#include <cam/cam_ccb.h>
#include <cam/scsi/scsi_all.h>
#include <cam/scsi/smp_all.h>
#include <sys/sbuf.h>
#include <sys/libkern.h>
#include <cam/cam_queue.h>
#include <cam/cam_xpt.h>
Include dependency graph for cam.c:

Go to the source code of this file.

Macros

#define CAM_DEFAULT_SORT_IO_QUEUES   1
 

Functions

 __FBSDID ("$FreeBSD$")
 
 FEATURE (scbus, "SCSI devices support")
 
static int camstatusentrycomp (const void *key, const void *member)
 
 SYSCTL_NODE (_kern, OID_AUTO, cam, CTLFLAG_RD|CTLFLAG_MPSAFE, 0, "CAM Subsystem")
 
 SYSCTL_INT (_kern_cam, OID_AUTO, sort_io_queues, CTLFLAG_RWTUN, &cam_sort_io_queues, 0, "Sort IO queues to try and optimise disk access patterns")
 
void cam_strvis (u_int8_t *dst, const u_int8_t *src, int srclen, int dstlen)
 
void cam_strvis_flag (u_int8_t *dst, const u_int8_t *src, int srclen, int dstlen, uint32_t flags)
 
void cam_strvis_sbuf (struct sbuf *sb, const u_int8_t *src, int srclen, uint32_t flags)
 
int cam_strmatch (const u_int8_t *str, const u_int8_t *pattern, int str_len)
 
caddr_t cam_quirkmatch (caddr_t target, caddr_t quirk_table, int num_entries, int entry_size, cam_quirkmatch_t *comp_func)
 
const struct cam_status_entrycam_fetch_status_entry (cam_status status)
 
char * cam_error_string (union ccb *ccb, char *str, int str_len, cam_error_string_flags flags, cam_error_proto_flags proto_flags)
 
void cam_error_print (union ccb *ccb, cam_error_string_flags flags, cam_error_proto_flags proto_flags)
 
void cam_calc_geometry (struct ccb_calc_geometry *ccg, int extended)
 

Variables

const struct cam_status_entry cam_status_table []
 
int cam_sort_io_queues = CAM_DEFAULT_SORT_IO_QUEUES
 

Macro Definition Documentation

◆ CAM_DEFAULT_SORT_IO_QUEUES

#define CAM_DEFAULT_SORT_IO_QUEUES   1

Definition at line 115 of file cam.c.

Function Documentation

◆ __FBSDID()

__FBSDID ( "$FreeBSD$"  )

◆ cam_calc_geometry()

void cam_calc_geometry ( struct ccb_calc_geometry ccg,
int  extended 
)

◆ cam_error_print()

void cam_error_print ( union ccb ccb,
cam_error_string_flags  flags,
cam_error_proto_flags  proto_flags 
)

Definition at line 510 of file cam.c.

References cam_error_string().

Referenced by cam_periph_error(), and dasetgeom().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cam_error_string()

◆ cam_fetch_status_entry()

const struct cam_status_entry * cam_fetch_status_entry ( cam_status  status)

Definition at line 292 of file cam.c.

References CAM_STATUS_MASK, cam_status_table, and camstatusentrycomp().

Referenced by cam_error_string(), ctlfe_lun_enable(), ctlfe_online(), passasync(), and sgasync().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cam_quirkmatch()

caddr_t cam_quirkmatch ( caddr_t  target,
caddr_t  quirk_table,
int  num_entries,
int  entry_size,
cam_quirkmatch_t comp_func 
)

Definition at line 281 of file cam.c.

Referenced by adaregister(), ata_find_quirk(), cdregister(), daregister(), fetchtableentries(), saregister(), scsi_find_quirk(), scsi_op_desc(), and xptdevicematch().

Here is the caller graph for this function:

◆ cam_strmatch()

int cam_strmatch ( const u_int8_t *  str,
const u_int8_t *  pattern,
int  str_len 
)

Definition at line 204 of file cam.c.

References cam_strmatch().

Referenced by ata_identify_match(), ata_static_identify_match(), cam_strmatch(), scsi_inquiry_match(), and scsi_static_inquiry_match().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cam_strvis()

void cam_strvis ( u_int8_t *  dst,
const u_int8_t *  src,
int  srclen,
int  dstlen 
)

Definition at line 124 of file cam.c.

References cam_strvis_flag(), and CAM_STRVIS_FLAG_NONASCII_ESC.

Referenced by ata_print_ident_short(), cdregister(), daregister(), saextget(), semb_print_ident(), semb_print_ident_short(), ses_handle_string(), and smp_report_manuf_info_sbuf().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cam_strvis_flag()

void cam_strvis_flag ( u_int8_t *  dst,
const u_int8_t *  src,
int  srclen,
int  dstlen,
uint32_t  flags 
)

Definition at line 131 of file cam.c.

References cam_strvis_sbuf().

Referenced by cam_strvis(), ndaregister(), and nvme_probe_done().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cam_strvis_sbuf()

void cam_strvis_sbuf ( struct sbuf *  sb,
const u_int8_t *  src,
int  srclen,
uint32_t  flags 
)

◆ camstatusentrycomp()

static int camstatusentrycomp ( const void *  key,
const void *  member 
)
static

Definition at line 302 of file cam.c.

References cam_status_entry::status_code.

Referenced by cam_fetch_status_entry().

Here is the caller graph for this function:

◆ FEATURE()

FEATURE ( scbus  ,
"SCSI devices support"   
)

◆ SYSCTL_INT()

SYSCTL_INT ( _kern_cam  ,
OID_AUTO  ,
sort_io_queues  ,
CTLFLAG_RWTUN  ,
cam_sort_io_queues,
,
"Sort IO queues to try and optimise disk access patterns"   
)

◆ SYSCTL_NODE()

SYSCTL_NODE ( _kern  ,
OID_AUTO  ,
cam  ,
CTLFLAG_RD|  CTLFLAG_MPSAFE,
,
"CAM Subsystem"   
)

Variable Documentation

◆ cam_sort_io_queues

int cam_sort_io_queues = CAM_DEFAULT_SORT_IO_QUEUES

Definition at line 118 of file cam.c.

◆ cam_status_table

const struct cam_status_entry cam_status_table[]

Definition at line 63 of file cam.c.

Referenced by cam_fetch_status_entry().