FreeBSD kernel CAM code
|
#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>
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_entry * | cam_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 |
__FBSDID | ( | "$FreeBSD$" | ) |
void cam_calc_geometry | ( | struct ccb_calc_geometry * | ccg, |
int | extended | ||
) |
Definition at line 545 of file cam.c.
References ccb_calc_geometry::block_size, CAM_REQ_CMP, CAM_REQ_CMP_ERR, ccb_calc_geometry::ccb_h, ccb_calc_geometry::cylinders, ccb_calc_geometry::heads, ccb_calc_geometry::secs_per_track, ccb_hdr::status, and ccb_calc_geometry::volume_size.
Referenced by cfcs_action().
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().
char * cam_error_string | ( | union ccb * | ccb, |
char * | str, | ||
int | str_len, | ||
cam_error_string_flags | flags, | ||
cam_error_proto_flags | proto_flags | ||
) |
Definition at line 315 of file cam.c.
References ata_command_sbuf(), ata_res_sbuf(), ata_status_sbuf(), ccb::ataio, CAM_ATA_STATUS_ERROR, CAM_AUTOSNS_VALID, CAM_EAF_PRINT_RESULT, CAM_EAF_PRINT_STATUS, CAM_EPF_ALL, CAM_EPF_LEVEL_MASK, CAM_EPF_MINIMAL, CAM_EPF_NONE, CAM_EPF_NORMAL, CAM_ESF_CAM_STATUS, CAM_ESF_COMMAND, CAM_ESF_NONE, CAM_ESF_PRINT_SENSE, CAM_ESF_PRINT_STATUS, CAM_ESF_PROTO_STATUS, CAM_ESMF_PRINT_FULL_CMD, CAM_ESMF_PRINT_STATUS, cam_fetch_status_entry(), CAM_SCSI_STATUS_ERROR, CAM_SMP_STATUS_ERROR, CAM_STATUS_MASK, ccb_scsiio::ccb_h, ccb::ccb_h, ccb::csio, ccb_hdr::func_code, nvme_command_sbuf(), ccb::nvmeio, ccb_hdr::path, ccb_ataio::res, scsi_command_string(), scsi_sense_sbuf(), ccb_scsiio::scsi_status, SCSI_STATUS_CHECK_COND, scsi_status_string(), smp_command_sbuf(), smp_error_desc(), ccb_smpio::smp_response, ccb::smpio, SSS_FLAG_NONE, ccb_hdr::status, cam_status_entry::status_text, XPT_ATA_IO, XPT_NVME_ADMIN, XPT_NVME_IO, xpt_path_string(), XPT_SCSI_IO, and XPT_SMP_IO.
Referenced by cam_error_print().
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().
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().
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().
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().
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().
void cam_strvis_sbuf | ( | struct sbuf * | sb, |
const u_int8_t * | src, | ||
int | srclen, | ||
uint32_t | flags | ||
) |
Definition at line 142 of file cam.c.
References CAM_STRVIS_FLAG_NONASCII_ESC, CAM_STRVIS_FLAG_NONASCII_MASK, CAM_STRVIS_FLAG_NONASCII_RAW, CAM_STRVIS_FLAG_NONASCII_SPC, and CAM_STRVIS_FLAG_NONASCII_TRIM.
Referenced by ata_print_ident_short_sbuf(), cam_strvis_flag(), nvme_print_ident(), scsi_attrib_ascii_sbuf(), scsi_attrib_vendser_sbuf(), scsi_print_inquiry_short_sbuf(), semb_print_ident_sbuf(), and semb_print_ident_short_sbuf().
|
static |
Definition at line 302 of file cam.c.
References cam_status_entry::status_code.
Referenced by cam_fetch_status_entry().
FEATURE | ( | scbus | , |
"SCSI devices support" | |||
) |
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" | |||
) |
SYSCTL_NODE | ( | _kern | , |
OID_AUTO | , | ||
cam | , | ||
CTLFLAG_RD| | CTLFLAG_MPSAFE, | ||
0 | , | ||
"CAM Subsystem" | |||
) |
int cam_sort_io_queues = CAM_DEFAULT_SORT_IO_QUEUES |
const struct cam_status_entry cam_status_table[] |
Definition at line 63 of file cam.c.
Referenced by cam_fetch_status_entry().