FreeBSD kernel CAM code
|
#include <sys/cdefs.h>
#include "opt_cd.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/bio.h>
#include <sys/conf.h>
#include <sys/disk.h>
#include <sys/malloc.h>
#include <sys/cdio.h>
#include <sys/cdrio.h>
#include <sys/dvdio.h>
#include <sys/devicestat.h>
#include <sys/proc.h>
#include <sys/sbuf.h>
#include <sys/sysctl.h>
#include <sys/sysent.h>
#include <sys/taskqueue.h>
#include <geom/geom_disk.h>
#include <cam/cam.h>
#include <cam/cam_ccb.h>
#include <cam/cam_periph.h>
#include <cam/cam_xpt_periph.h>
#include <cam/cam_queue.h>
#include <cam/cam_sim.h>
#include <cam/scsi/scsi_message.h>
#include <cam/scsi/scsi_da.h>
#include <cam/scsi/scsi_cd.h>
Go to the source code of this file.
Data Structures | |
struct | cd_params |
struct | cd_tocdata |
struct | cd_toc_single |
struct | cd_softc |
struct | cd_page_sizes |
struct | cd_quirk_entry |
Macros | |
#define | LEADOUT 0xaa /* leadout toc entry */ |
#define | CD_Q_BIT_STRING |
#define | ccb_state ppriv_field0 |
#define | ccb_bp ppriv_ptr1 |
#define | CD_ANNOUNCETMP_SZ 120 |
#define | CD_ANNOUNCE_SZ 400 |
#define | CD_DEFAULT_POLL_PERIOD 3 |
#define | CD_DEFAULT_RETRY 4 |
#define | CD_DEFAULT_TIMEOUT 30000 |
Functions | |
__FBSDID ("$FreeBSD$") | |
static void | cdasync (void *callback_arg, u_int32_t code, struct cam_path *path, void *arg) |
static int | cdcmdsizesysctl (SYSCTL_HANDLER_ARGS) |
static int | cdrunccb (union ccb *ccb, int(*error_routine)(union ccb *ccb, u_int32_t cam_flags, u_int32_t sense_flags), u_int32_t cam_flags, u_int32_t sense_flags) |
static void | cddone (struct cam_periph *periph, union ccb *start_ccb) |
static union cd_pages * | cdgetpage (struct cd_mode_params *mode_params) |
static int | cdgetpagesize (int page_num) |
static void | cdprevent (struct cam_periph *periph, int action) |
static void | cdmediaprobedone (struct cam_periph *periph) |
static int | cdcheckmedia (struct cam_periph *periph, int do_wait) |
static int | cd6byteworkaround (union ccb *ccb) |
static int | cderror (union ccb *ccb, u_int32_t cam_flags, u_int32_t sense_flags) |
static int | cdreadtoc (struct cam_periph *periph, u_int32_t mode, u_int32_t start, u_int8_t *data, u_int32_t len, u_int32_t sense_flags) |
static int | cdgetmode (struct cam_periph *periph, struct cd_mode_params *data, u_int32_t page) |
static int | cdsetmode (struct cam_periph *periph, struct cd_mode_params *data) |
static int | cdplay (struct cam_periph *periph, u_int32_t blk, u_int32_t len) |
static int | cdreadsubchannel (struct cam_periph *periph, u_int32_t mode, u_int32_t format, int track, struct cd_sub_channel_info *data, u_int32_t len) |
static int | cdplaymsf (struct cam_periph *periph, u_int32_t startm, u_int32_t starts, u_int32_t startf, u_int32_t endm, u_int32_t ends, u_int32_t endf) |
static int | cdplaytracks (struct cam_periph *periph, u_int32_t strack, u_int32_t sindex, u_int32_t etrack, u_int32_t eindex) |
static int | cdpause (struct cam_periph *periph, u_int32_t go) |
static int | cdstopunit (struct cam_periph *periph, u_int32_t eject) |
static int | cdstartunit (struct cam_periph *periph, int load) |
static int | cdsetspeed (struct cam_periph *periph, u_int32_t rdspeed, u_int32_t wrspeed) |
static int | cdreportkey (struct cam_periph *periph, struct dvd_authinfo *authinfo) |
static int | cdsendkey (struct cam_periph *periph, struct dvd_authinfo *authinfo) |
static int | cdreaddvdstructure (struct cam_periph *periph, struct dvd_struct *dvdstruct) |
PERIPHDRIVER_DECLARE (cd, cddriver) | |
static | SYSCTL_NODE (_kern_cam, OID_AUTO, cd, CTLFLAG_RD|CTLFLAG_MPSAFE, 0, "CAM CDROM driver") |
SYSCTL_INT (_kern_cam_cd, OID_AUTO, poll_period, CTLFLAG_RWTUN, &cd_poll_period, 0, "Media polling period in seconds") | |
SYSCTL_INT (_kern_cam_cd, OID_AUTO, retry_count, CTLFLAG_RWTUN, &cd_retry_count, 0, "Normal I/O retry count") | |
SYSCTL_INT (_kern_cam_cd, OID_AUTO, timeout, CTLFLAG_RWTUN, &cd_timeout, 0, "Timeout, in us, for read operations") | |
static | MALLOC_DEFINE (M_SCSICD, "scsi_cd", "scsi_cd buffers") |
static void | cddiskgonecb (struct disk *dp) |
static void | cdoninvalidate (struct cam_periph *periph) |
static void | cdcleanup (struct cam_periph *periph) |
static void | cdsysctlinit (void *context, int pending) |
static cam_status | cdregister (struct cam_periph *periph, void *arg) |
static int | cdopen (struct disk *dp) |
static int | cdclose (struct disk *dp) |
static void | cdstrategy (struct bio *bp) |
static void | cdstart (struct cam_periph *periph, union ccb *start_ccb) |
static struct cd_toc_entry * | te_data_get_ptr (void *irtep, u_long cmd) |
static int | cdioctl (struct disk *dp, u_long cmd, void *addr, int flag, struct thread *td) |
static void | cdmediapoll (void *arg) |
void | scsi_report_key (struct ccb_scsiio *csio, u_int32_t retries, void(*cbfcnp)(struct cam_periph *, union ccb *), u_int8_t tag_action, u_int32_t lba, u_int8_t agid, u_int8_t key_format, u_int8_t *data_ptr, u_int32_t dxfer_len, u_int8_t sense_len, u_int32_t timeout) |
void | scsi_send_key (struct ccb_scsiio *csio, u_int32_t retries, void(*cbfcnp)(struct cam_periph *, union ccb *), u_int8_t tag_action, u_int8_t agid, u_int8_t key_format, u_int8_t *data_ptr, u_int32_t dxfer_len, u_int8_t sense_len, u_int32_t timeout) |
void | scsi_read_dvd_structure (struct ccb_scsiio *csio, u_int32_t retries, void(*cbfcnp)(struct cam_periph *, union ccb *), u_int8_t tag_action, u_int32_t address, u_int8_t layer_number, u_int8_t format, u_int8_t agid, u_int8_t *data_ptr, u_int32_t dxfer_len, u_int8_t sense_len, u_int32_t timeout) |
void | scsi_read_toc (struct ccb_scsiio *csio, uint32_t retries, void(*cbfcnp)(struct cam_periph *, union ccb *), uint8_t tag_action, uint8_t byte1_flags, uint8_t format, uint8_t track, uint8_t *data_ptr, uint32_t dxfer_len, int sense_len, int timeout) |
Variables | |
static struct cd_page_sizes | cd_page_size_table [] |
static struct cd_quirk_entry | cd_quirk_table [] |
static disk_open_t | cdopen |
static disk_close_t | cdclose |
static disk_ioctl_t | cdioctl |
static disk_strategy_t | cdstrategy |
static periph_init_t | cdinit |
static periph_ctor_t | cdregister |
static periph_dtor_t | cdcleanup |
static periph_start_t | cdstart |
static periph_oninv_t | cdoninvalidate |
static callout_func_t | cdmediapoll |
static struct periph_driver | cddriver |
static int | cd_poll_period = CD_DEFAULT_POLL_PERIOD |
static int | cd_retry_count = CD_DEFAULT_RETRY |
static int | cd_timeout = CD_DEFAULT_TIMEOUT |
#define ccb_bp ppriv_ptr1 |
#define ccb_state ppriv_field0 |
#define CD_ANNOUNCE_SZ 400 |
#define CD_ANNOUNCETMP_SZ 120 |
#define CD_Q_BIT_STRING |
enum cd_ccb_state |
enum cd_flags |
enum cd_quirks |
enum cd_state |
__FBSDID | ( | "$FreeBSD$" | ) |
|
static |
Definition at line 2928 of file scsi_cd.c.
References cd_mode_params::alloc_len, scsi_mode_header_6::blk_desc_len, scsi_mode_header_10::blk_desc_len, scsi_mode_sense_6::byte2, scsi_mode_sense_10::byte2, scsi_mode_select_6::byte2, scsi_mode_select_10::byte2, CAM_CDB_POINTER, CAM_DEV_QFRZN, cam_release_devq(), CAM_REQUEUE_REQ, ccb::ccb_h, cdb_t::cdb_bytes, ccb_scsiio::cdb_io, ccb_scsiio::cdb_len, cd_mode_params::cdb_size, cdgetpagesize(), scsi_mode_sense_6::control, scsi_mode_sense_10::control, scsi_mode_select_6::control, scsi_mode_select_10::control, ccb::csio, scsi_mode_header_10::data_length, ccb_scsiio::data_ptr, ccb_scsiio::dxfer_len, find_mode_page_6(), ccb_hdr::flags, scsi_mode_sense_10::length, scsi_mode_select_10::length, scsi_mode_header_10::medium_type, cd_mode_params::mode_buf, MODE_SELECT_10, MODE_SELECT_6, MODE_SENSE_10, MODE_SENSE_6, scsi_mode_sense_10::opcode, scsi_mode_select_10::opcode, scsi_mode_sense_6::page, scsi_mode_sense_10::page, scsi_mode_page_header::page_code, scsi_mode_page_header::page_length, ccb_hdr::path, cam_periph::path, scsi_ulto2b(), cam_periph::softc, ccb_hdr::status, xpt_action(), xpt_path_periph(), and xpt_print().
Referenced by cderror().
|
static |
Definition at line 418 of file scsi_cd.c.
References AC_BUS_RESET, AC_FOUND_DEVICE, AC_SCSI_AEN, AC_SENT_BDR, AC_UNIT_ATTENTION, cam_periph_acquire(), cam_periph_alloc(), cam_periph_assert, cam_periph_async(), CAM_PERIPH_BIO, CAM_PRIORITY_NORMAL, CAM_REQ_CMP, CAM_REQ_INPROG, ccb, ccb::ccb_h, CD_CCB_RETRY_UA, CD_FLAG_RETRY_UA, CD_STATE_NORMAL, cdasync(), cdcleanup, cdoninvalidate, cdregister, cdstart, cd_softc::flags, ccb_getdev::inq_data, ccb_hdr::path, PROTO_SCSI, ccb_getdev::protocol, scsi_extract_sense_ccb(), SID_QUAL, SID_QUAL_LU_CONNECTED, SID_TYPE, cam_periph::softc, cd_softc::state, T_CDROM, T_WORM, xpt_path_periph(), and xpt_schedule().
Referenced by cdasync(), cdoninvalidate(), and cdregister().
|
static |
Definition at line 2691 of file scsi_cd.c.
References cam_periph_assert, cam_periph_mtx(), CAM_PRIORITY_NORMAL, CD_FLAG_MEDIA_SCAN_ACT, CD_FLAG_MEDIA_WAIT, CD_FLAG_VALID_MEDIA, CD_STATE_MEDIA_PREVENT, cd_softc::flags, cam_periph::softc, cd_softc::state, and xpt_schedule().
Referenced by cdioctl(), cdopen(), and cdstrategy().
|
static |
Definition at line 399 of file scsi_cd.c.
References cam_periph_lock, cam_periph_unlock, CD_FLAG_SCTX_INIT, cd_softc::flags, cam_periph::path, cam_periph::softc, and xpt_print().
|
static |
Definition at line 802 of file scsi_cd.c.
References CAM_DEBUG, CAM_DEBUG_PERIPH, CAM_DEBUG_TRACE, cam_periph_hold(), cam_periph_lock, cam_periph_release(), cam_periph_release_locked(), cam_periph_unhold(), cam_periph_unlock, CD_FLAG_DISC_REMOVABLE, CD_FLAG_VALID_MEDIA, CD_FLAG_VALID_TOC, cdprevent(), cam_periph::path, PR_ALLOW, and cam_periph::softc.
|
static |
Definition at line 562 of file scsi_cd.c.
Referenced by cdsysctlinit().
|
static |
Definition at line 365 of file scsi_cd.c.
References cam_periph_release().
Referenced by cdregister().
|
static |
Definition at line 1150 of file scsi_cd.c.
References scsi_read_capacity_data::addr, cd_softc::bio_queue, cd_params::blksize, CAM_DEBUG, CAM_DEBUG_TRACE, CAM_DEV_QFRZN, cam_periph_assert, cam_periph_invalidate(), cam_periph_release_locked(), cam_periph_unhold(), CAM_PRIORITY_NORMAL, cam_release_devq(), CAM_REQ_CMP, CAM_RETRY_SELTO, CAM_SCSI_STATUS_ERROR, CAM_STATUS_MASK, ccb_getdev::ccb_h, ccb_scsiio::ccb_h, ccb::ccb_h, CD_ANNOUNCE_SZ, CD_ANNOUNCETMP_SZ, CD_CCB_BUFFER_IO, CD_CCB_MEDIA_ALLOW, CD_CCB_MEDIA_PREVENT, CD_CCB_MEDIA_SIZE, CD_CCB_MEDIA_TOC_FULL, CD_CCB_MEDIA_TOC_HDR, CD_CCB_MEDIA_TOC_LEAD, CD_CCB_PROBE, CD_CCB_RETRY_UA, CD_CCB_TUR, CD_CCB_TYPE_MASK, CD_FLAG_DISC_LOCKED, CD_FLAG_SAW_MEDIA, CD_FLAG_VALID_MEDIA, CD_FLAG_VALID_TOC, CD_Q_BCD_TRACKS, CD_Q_BIT_STRING, CD_STATE_MEDIA_ALLOW, CD_STATE_MEDIA_SIZE, CD_STATE_MEDIA_TOC_FULL, CD_STATE_MEDIA_TOC_HDR, CD_STATE_MEDIA_TOC_LEAD, CD_STATE_NORMAL, cderror(), cdmediaprobedone(), ccb::csio, ccb_scsiio::data_ptr, cd_params::disksize, ccb_scsiio::dxfer_len, cd_toc_single::entry, cd_softc::flags, ccb_hdr::func_code, ccb_getdev::inq_data, scsi_read_capacity_data::length, ccb_hdr::path, cam_periph::path, ccb_scsiio::resid, scsi_4btoul(), scsi_extract_sense_ccb(), scsi_sense_desc(), scsi_sense_print(), ccb_scsiio::scsi_status, SCSI_STATUS_BUSY, scsi_status_string(), SF_NO_PRINT, SF_NO_RECOVERY, SF_RETRY_UA, SID_TYPE, cam_periph::softc, SSD_CURRENT_ERROR, SSD_DESC_CURRENT_ERROR, cd_softc::state, ccb_hdr::status, T_CDROM, xpt_action(), xpt_announce_periph_sbuf(), xpt_announce_quirks_sbuf(), XPT_GDEV_TYPE, xpt_print(), xpt_release_ccb(), xpt_schedule(), and xpt_setup_ccb().
Referenced by cdstart().
|
static |
Definition at line 3077 of file scsi_cd.c.
References cam_periph_assert, cam_periph_error(), CAM_REQ_INVALID, CAM_STATUS_MASK, ccb::ccb_h, cd6byteworkaround(), CD_FLAG_SAW_MEDIA, CD_Q_RETRY_BUSY, cd_softc::flags, ccb_hdr::path, scsi_extract_sense_ccb(), SF_RETRY_BUSY, SF_RETRY_UA, cam_periph::softc, SSD_KEY_ILLEGAL_REQUEST, SSD_KEY_NOT_READY, SSD_KEY_UNIT_ATTENTION, ccb_hdr::status, and xpt_path_periph().
Referenced by cddone(), cdgetmode(), cdioctl(), cdpause(), cdplay(), cdplaymsf(), cdplaytracks(), cdprevent(), cdreaddvdstructure(), cdreadsubchannel(), cdreadtoc(), cdreportkey(), cdsendkey(), cdsetmode(), cdsetspeed(), cdstartunit(), and cdstopunit().
|
static |
Definition at line 3235 of file scsi_cd.c.
References cd_mode_params::alloc_len, cam_periph_getccb(), CAM_PRIORITY_NORMAL, CAM_RETRY_SELTO, ccb, cd_retry_count, cd_mode_params::cdb_size, cderror(), cdrunccb(), ccb::csio, scsi_mode_header_6::data_length, scsi_mode_header_10::data_length, cd_mode_params::mode_buf, MSG_SIMPLE_Q_TAG, cd_mode_data_10::page, cam_periph::path, scsi_2btoul(), scsi_mode_sense_len(), SF_RETRY_UA, SMS_PAGE_CTRL_CURRENT, cam_periph::softc, SSD_FULL_SIZE, xpt_print(), and xpt_release_ccb().
Referenced by cdioctl().
|
static |
Definition at line 1705 of file scsi_cd.c.
References cd_mode_params::cdb_size, find_mode_page_10(), find_mode_page_6(), and cd_mode_params::mode_buf.
Referenced by cdioctl().
|
static |
Definition at line 1720 of file scsi_cd.c.
References cd_page_size_table.
Referenced by cd6byteworkaround().
|
static |
Definition at line 1756 of file scsi_cd.c.
References cd_mode_params::alloc_len, cd_pages::audio, AUDIO_PAGE, CAM_DEBUG, CAM_DEBUG_SUBTRACE, CAM_DEBUG_TRACE, cam_periph_hold(), cam_periph_ioctl(), cam_periph_lock, cam_periph_release(), cam_periph_unhold(), cam_periph_unlock, CD_FLAG_VALID_MEDIA, CD_FLAG_VALID_TOC, CD_PA_IMMED, CD_Q_BCD_TRACKS, cdcheckmedia(), cderror(), cdgetmode(), cdgetpage(), cdpause(), cdplay(), cdplaymsf(), cdplaytracks(), cdprevent(), cdreaddvdstructure(), cdreadsubchannel(), cdreadtoc(), cdreportkey(), cdsendkey(), cdsetmode(), cdsetspeed(), cdstartunit(), cdstopunit(), CHANNEL_0, CHANNEL_1, cd_audio_page::port_control::channels, cd_tocdata::entries, cd_toc_single::entry, cd_softc::flags, cd_audio_page::flags, cd_tocdata::header, cd_toc_single::header, LEADOUT, LEFT_CHANNEL, LEFT_PORT, cd_mode_params::mode_buf, cam_periph::path, cd_audio_page::port, PR_ALLOW, PR_PREVENT, RIGHT_CHANNEL, RIGHT_PORT, SF_NO_PRINT, cam_periph::softc, te_data_get_ptr(), and cd_audio_page::port_control::volume.
|
static |
Definition at line 3126 of file scsi_cd.c.
References cam_periph_acquire(), CAM_PRIORITY_NORMAL, cd_poll_period, CD_STATE_NORMAL, cam_periph::softc, cd_softc::state, and xpt_schedule().
|
static |
Definition at line 2670 of file scsi_cd.c.
References cam_periph_assert, CD_FLAG_MEDIA_SCAN_ACT, CD_FLAG_MEDIA_WAIT, cd_softc::flags, and cam_periph::softc.
Referenced by cddone().
|
static |
Definition at line 374 of file scsi_cd.c.
References cd_softc::bio_queue, cam_periph_assert, CD_FLAG_INVALID, cdasync(), cd_softc::flags, cam_periph::path, cam_periph::softc, and xpt_register_async().
|
static |
Definition at line 757 of file scsi_cd.c.
References CAM_DEBUG, CAM_DEBUG_PERIPH, CAM_DEBUG_TRACE, cam_periph_acquire(), cam_periph_hold(), cam_periph_lock, cam_periph_release_locked(), cam_periph_unhold(), cam_periph_unlock, CD_FLAG_INVALID, cdcheckmedia(), cam_periph::path, and cam_periph::softc.
|
static |
Definition at line 3571 of file scsi_cd.c.
References CAM_DIR_NONE, cam_fill_csio(), cam_periph_getccb(), CAM_PRIORITY_NORMAL, CAM_RETRY_SELTO, ccb, cd_retry_count, cdb_t::cdb_bytes, ccb_scsiio::cdb_io, cderror(), cdrunccb(), ccb::csio, MSG_SIMPLE_Q_TAG, scsi_pause::op_code, PAUSE, scsi_pause::resume, SF_RETRY_UA, SSD_FULL_SIZE, and xpt_release_ccb().
Referenced by cdioctl().
|
static |
Definition at line 3428 of file scsi_cd.c.
References scsi_play_10::blk_addr, scsi_play_12::blk_addr, CAM_DIR_NONE, cam_fill_csio(), cam_periph_getccb(), CAM_PRIORITY_NORMAL, CAM_RETRY_SELTO, ccb, cd_retry_count, cdb_t::cdb_bytes, ccb_scsiio::cdb_io, cderror(), cdrunccb(), ccb::csio, MSG_SIMPLE_Q_TAG, scsi_play_10::op_code, scsi_play_12::op_code, PLAY_10, PLAY_12, scsi_ulto2b(), scsi_ulto4b(), SF_RETRY_UA, SSD_FULL_SIZE, scsi_play_10::xfer_len, scsi_play_12::xfer_len, and xpt_release_ccb().
Referenced by cdioctl().
|
static |
Definition at line 3483 of file scsi_cd.c.
References CAM_DIR_NONE, cam_fill_csio(), cam_periph_getccb(), CAM_PRIORITY_NORMAL, CAM_RETRY_SELTO, ccb, cd_retry_count, cdb_t::cdb_bytes, ccb_scsiio::cdb_io, cderror(), cdrunccb(), ccb::csio, scsi_play_msf::end_f, scsi_play_msf::end_m, scsi_play_msf::end_s, MSG_SIMPLE_Q_TAG, scsi_play_msf::op_code, PLAY_MSF, SF_RETRY_UA, SSD_FULL_SIZE, scsi_play_msf::start_f, scsi_play_msf::start_m, scsi_play_msf::start_s, and xpt_release_ccb().
Referenced by cdioctl().
|
static |
Definition at line 3528 of file scsi_cd.c.
References CAM_DIR_NONE, cam_fill_csio(), cam_periph_getccb(), CAM_PRIORITY_NORMAL, CAM_RETRY_SELTO, ccb, cd_retry_count, cdb_t::cdb_bytes, ccb_scsiio::cdb_io, cderror(), cdrunccb(), ccb::csio, scsi_play_track::end_index, scsi_play_track::end_track, MSG_SIMPLE_Q_TAG, scsi_play_track::op_code, PLAY_TRACK, SF_RETRY_UA, SSD_FULL_SIZE, scsi_play_track::start_index, scsi_play_track::start_track, and xpt_release_ccb().
Referenced by cdioctl().
|
static |
Definition at line 2628 of file scsi_cd.c.
References CAM_DEBUG, CAM_DEBUG_TRACE, cam_periph_assert, cam_periph_getccb(), CAM_PRIORITY_NORMAL, CAM_RETRY_SELTO, ccb, CD_FLAG_DISC_LOCKED, cd_retry_count, cderror(), cdrunccb(), ccb::csio, cd_softc::flags, MSG_SIMPLE_Q_TAG, cam_periph::path, PR_ALLOW, PR_PREVENT, scsi_prevent(), SF_NO_PRINT, SF_RETRY_UA, cam_periph::softc, SSD_FULL_SIZE, and xpt_release_ccb().
Referenced by cdclose(), and cdioctl().
|
static |
Definition at line 3960 of file scsi_cd.c.
References scsi_read_dvd_struct_data_layer_desc::bca, scsi_read_dvd_struct_data_layer_desc::book_type_version, cam_periph_getccb(), cam_periph_lock, cam_periph_unlock, CAM_PRIORITY_NORMAL, CAM_RETRY_SELTO, ccb, cd_retry_count, cderror(), cdrunccb(), scsi_read_dvd_struct_data_copyright::cps_type, ccb::csio, scsi_read_dvd_struct_data_layer_desc::density, scsi_read_dvd_struct_data_layer_desc::disc_size_max_rate, scsi_read_dvd_struct_data_layer_desc::end_sector_layer0, scsi_read_dvd_struct_data_physical::layer_desc, scsi_read_dvd_struct_data_layer_desc::layer_info, scsi_read_dvd_struct_data_layer_desc::main_data_end, scsi_read_dvd_struct_data_layer_desc::main_data_start, MSG_SIMPLE_Q_TAG, RDSD_BCA_MASK, RDSD_BCA_SHIFT, RDSD_BOOK_TYPE_MASK, RDSD_BOOK_TYPE_SHIFT, RDSD_BOOK_VERSION_MASK, RDSD_DISC_SIZE_MASK, RDSD_DISC_SIZE_SHIFT, RDSD_LAYER_TYPE_MASK, RDSD_LIN_DENSITY_MASK, RDSD_LIN_DENSITY_SHIFT, RDSD_MAX_RATE_MASK, RDSD_NUM_LAYERS_MASK, RDSD_NUM_LAYERS_SHIFT, RDSD_TRACK_DENSITY_MASK, RDSD_TRACK_PATH_MASK, RDSD_TRACK_PATH_SHIFT, scsi_read_dvd_struct_data_copyright::region_info, ccb_scsiio::resid, scsi_3btoul(), scsi_read_dvd_structure(), SF_RETRY_UA, SSD_FULL_SIZE, and xpt_release_ccb().
Referenced by cdioctl().
|
static |
Definition at line 3184 of file scsi_cd.c.
References scsi_read_subchannel::byte1, scsi_read_subchannel::byte2, CAM_DIR_IN, cam_fill_csio(), cam_periph_getccb(), CAM_PRIORITY_NORMAL, CAM_RETRY_SELTO, ccb, CD_MSF, cd_retry_count, cdb_t::cdb_bytes, ccb_scsiio::cdb_io, cderror(), cdrunccb(), scsi_read_subchannel::control, ccb::csio, scsi_read_subchannel::data_len, MSG_SIMPLE_Q_TAG, scsi_read_subchannel::op_code, READ_SUBCHANNEL, scsi_ulto2b(), SF_RETRY_UA, SRS_SUBQ, SSD_FULL_SIZE, scsi_read_subchannel::subchan_format, scsi_read_subchannel::track, and xpt_release_ccb().
Referenced by cdioctl().
|
static |
Definition at line 3150 of file scsi_cd.c.
References cam_periph_getccb(), CAM_PRIORITY_NORMAL, CAM_RETRY_SELTO, ccb, CD_MSF, cd_retry_count, cderror(), cdrunccb(), ccb::csio, MSG_SIMPLE_Q_TAG, scsi_read_toc(), SF_RETRY_UA, SRTOC_FORMAT_TOC, SSD_FULL_SIZE, and xpt_release_ccb().
Referenced by cdioctl().
|
static |
Definition at line 595 of file scsi_cd.c.
References AC_BUS_RESET, AC_LOST_DEVICE, AC_SCSI_AEN, AC_SENT_BDR, AC_UNIT_ATTENTION, cd_softc::bio_queue, cam_periph_acquire(), cam_periph_hold(), cam_periph_lock, cam_periph_mtx(), cam_periph_unlock, CAM_PRIORITY_DEV, cam_quirkmatch(), CAM_REQ_CMP, CAM_REQ_CMP_ERR, cam_strvis(), ccb_pathinq::ccb_h, CD_FLAG_DISC_REMOVABLE, cd_poll_period, CD_Q_10_BYTE_ONLY, CD_Q_NONE, cd_quirk_table, CD_STATE_PROBE, cdasync(), cdclose, cddiskgonecb(), cdioctl, cdmediapoll, cdopen, cdstrategy, cdsysctlinit(), ccb_pathinq::dev_name, cd_softc::flags, ccb_pathinq::hba_device, ccb_pathinq::hba_misc, ccb_pathinq::hba_subdevice, ccb_pathinq::hba_subvendor, ccb_pathinq::hba_vendor, ccb_getdev::inq_data, ccb_getdev::inq_flags, ccb_pathinq::maxio, cam_periph::path, PIM_NO_6_BYTE, scsi_inquiry_data::product, scsi_inquiry_match(), SID_AEN, SID_IS_REMOVABLE, cam_periph::softc, cd_softc::state, ccb_hdr::status, ccb_pathinq::transport, ccb_pathinq::unit_number, cam_periph::unit_number, scsi_inquiry_data::vendor, XPORT_DEVSTAT_TYPE, xpt_path_inq(), xpt_print(), xpt_register_async(), and xpt_schedule().
|
static |
Definition at line 3710 of file scsi_cd.c.
References scsi_report_key_data_agid::agid, scsi_report_key_data_title::byte0, scsi_report_key_data_rpc::byte4, cam_periph_getccb(), cam_periph_lock, cam_periph_unlock, CAM_PRIORITY_NORMAL, CAM_RETRY_SELTO, ccb, cd_retry_count, cderror(), cdrunccb(), scsi_report_key_data_challenge::challenge_key, ccb::csio, scsi_report_key_data_key1_key2::key1, MSG_SIMPLE_Q_TAG, cam_periph::path, scsi_report_key_data_rpc::region_mask, ccb_scsiio::resid, RKD_AGID_MASK, RKD_AGID_SHIFT, RKD_ASF_SUCCESS, RKD_RPC_TYPE_MASK, RKD_RPC_TYPE_SHIFT, RKD_RPC_USER_RESET_MASK, RKD_RPC_VENDOR_RESET_MASK, RKD_RPC_VENDOR_RESET_SHIFT, RKD_TITLE_CMGS_MASK, RKD_TITLE_CMGS_SHIFT, RKD_TITLE_CP_SEC, RKD_TITLE_CP_SEC_SHIFT, RKD_TITLE_CPM, RKD_TITLE_CPM_SHIFT, scsi_report_key_data_rpc::rpc_scheme1, scsi_report_key(), SF_RETRY_UA, SSD_FULL_SIZE, scsi_report_key_data_asf::success, scsi_report_key_data_title::title_key, xpt_print(), and xpt_release_ccb().
Referenced by cdioctl().
|
static |
Definition at line 842 of file scsi_cd.c.
References cam_periph_runccb(), ccb::ccb_h, ccb_hdr::path, cam_periph::softc, and xpt_path_periph().
Referenced by cdgetmode(), cdpause(), cdplay(), cdplaymsf(), cdplaytracks(), cdprevent(), cdreaddvdstructure(), cdreadsubchannel(), cdreadtoc(), cdreportkey(), cdsendkey(), cdsetmode(), cdsetspeed(), cdstartunit(), and cdstopunit().
|
static |
Definition at line 3869 of file scsi_cd.c.
References cam_periph_getccb(), cam_periph_lock, cam_periph_unlock, CAM_PRIORITY_NORMAL, CAM_RETRY_SELTO, ccb, cd_retry_count, cderror(), cdrunccb(), scsi_report_key_data_challenge::challenge_key, ccb::csio, scsi_report_key_data_challenge::data_len, scsi_report_key_data_key1_key2::data_len, scsi_send_key_data_rpc::data_len, scsi_report_key_data_key1_key2::key1, MSG_SIMPLE_Q_TAG, scsi_send_key_data_rpc::region_code, scsi_send_key(), scsi_ulto2b(), SF_RETRY_UA, SSD_FULL_SIZE, and xpt_release_ccb().
Referenced by cdioctl().
|
static |
Definition at line 3335 of file scsi_cd.c.
References cd_mode_params::alloc_len, cam_periph_getccb(), CAM_PRIORITY_NORMAL, CAM_RETRY_SELTO, ccb, cd_retry_count, cd_mode_params::cdb_size, cderror(), cdrunccb(), ccb::csio, scsi_mode_header_6::data_length, scsi_mode_header_10::data_length, scsi_mode_header_6::medium_type, scsi_mode_header_10::medium_type, cd_mode_params::mode_buf, MSG_SIMPLE_Q_TAG, scsi_2btoul(), scsi_mode_select_len(), scsi_ulto2b(), SF_RETRY_UA, cam_periph::softc, SSD_FULL_SIZE, and xpt_release_ccb().
Referenced by cdioctl().
|
static |
Definition at line 3666 of file scsi_cd.c.
References CAM_DIR_NONE, cam_fill_csio(), cam_periph_getccb(), CAM_PRIORITY_NORMAL, CAM_RETRY_SELTO, ccb, cd_retry_count, cdb_t::cdb_bytes, ccb_scsiio::cdb_io, cderror(), cdrunccb(), ccb::csio, MSG_SIMPLE_Q_TAG, scsi_set_speed::opcode, scsi_set_speed::readspeed, scsi_ulto2b(), SET_CD_SPEED, SF_RETRY_UA, SSD_FULL_SIZE, scsi_set_speed::writespeed, and xpt_release_ccb().
Referenced by cdioctl().
|
static |
Definition at line 906 of file scsi_cd.c.
References cd_softc::bio_queue, CAM_DEBUG, CAM_DEBUG_TRACE, cam_periph_assert, cam_periph_invalidate(), cam_periph_release_locked(), CAM_PRIORITY_NORMAL, ccb::ccb_h, CD_CCB_BUFFER_IO, CD_CCB_MEDIA_ALLOW, CD_CCB_MEDIA_PREVENT, CD_CCB_MEDIA_SIZE, CD_CCB_MEDIA_TOC_FULL, CD_CCB_MEDIA_TOC_HDR, CD_CCB_MEDIA_TOC_LEAD, CD_CCB_PROBE, CD_CCB_RETRY_UA, CD_CCB_TUR, CD_FLAG_DISC_LOCKED, CD_FLAG_RETRY_UA, CD_MSF, cd_retry_count, CD_STATE_MEDIA_ALLOW, CD_STATE_MEDIA_PREVENT, CD_STATE_MEDIA_SIZE, CD_STATE_MEDIA_TOC_FULL, CD_STATE_MEDIA_TOC_HDR, CD_STATE_MEDIA_TOC_LEAD, CD_STATE_NORMAL, CD_STATE_PROBE, cd_timeout, cdb_t::cdb_bytes, ccb_scsiio::cdb_io, ccb_scsiio::cdb_len, cddone(), ccb::csio, cd_softc::flags, LEADOUT, MSG_SIMPLE_Q_TAG, cam_periph::path, PR_ALLOW, PR_PREVENT, READ_CD, scsi_prevent(), scsi_read_capacity(), scsi_read_toc(), scsi_read_write(), SCSI_RW_READ, SCSI_RW_WRITE, scsi_test_unit_ready(), SF_NO_PRINT, cam_periph::softc, SRTOC_FORMAT_TOC, SSD_FULL_SIZE, cd_softc::state, xpt_action(), xpt_print(), xpt_release_ccb(), and xpt_schedule().
|
static |
Definition at line 3610 of file scsi_cd.c.
References cam_periph_getccb(), CAM_PRIORITY_NORMAL, CAM_RETRY_SELTO, ccb, cd_retry_count, cderror(), cdrunccb(), ccb::csio, MSG_SIMPLE_Q_TAG, scsi_start_stop(), SF_RETRY_UA, SSD_FULL_SIZE, and xpt_release_ccb().
Referenced by cdioctl().
|
static |
Definition at line 3638 of file scsi_cd.c.
References cam_periph_getccb(), CAM_PRIORITY_NORMAL, CAM_RETRY_SELTO, ccb, cd_retry_count, cderror(), cdrunccb(), ccb::csio, MSG_SIMPLE_Q_TAG, scsi_start_stop(), SF_RETRY_UA, SSD_FULL_SIZE, and xpt_release_ccb().
Referenced by cdioctl().
|
static |
Definition at line 866 of file scsi_cd.c.
References cd_softc::bio_queue, CAM_DEBUG, CAM_DEBUG_TRACE, cam_periph_lock, cam_periph_unlock, CAM_PRIORITY_NORMAL, CD_FLAG_INVALID, CD_FLAG_VALID_MEDIA, cdcheckmedia(), cd_softc::flags, cam_periph::path, cam_periph::softc, and xpt_schedule().
|
static |
Definition at line 515 of file scsi_cd.c.
References cam_periph_acquire(), cam_periph_lock, cam_periph_release(), cam_periph_unlock, CD_FLAG_SCTX_INIT, cdcmdsizesysctl(), cd_softc::flags, cam_periph::softc, and cam_periph::unit_number.
Referenced by cdregister().
|
static |
PERIPHDRIVER_DECLARE | ( | cd | , |
cddriver | |||
) |
void scsi_read_dvd_structure | ( | struct ccb_scsiio * | csio, |
u_int32_t | retries, | ||
void(*)(struct cam_periph *, union ccb *) | cbfcnp, | ||
u_int8_t | tag_action, | ||
u_int32_t | address, | ||
u_int8_t | layer_number, | ||
u_int8_t | format, | ||
u_int8_t | agid, | ||
u_int8_t * | data_ptr, | ||
u_int32_t | dxfer_len, | ||
u_int8_t | sense_len, | ||
u_int32_t | timeout | ||
) |
Definition at line 4197 of file scsi_cd.c.
References scsi_read_dvd_structure::address, scsi_read_dvd_structure::agid, scsi_read_dvd_structure::alloc_len, CAM_DIR_IN, cam_fill_csio(), cdb_t::cdb_bytes, ccb_scsiio::cdb_io, scsi_read_dvd_structure::format, scsi_read_dvd_structure::layer_number, scsi_read_dvd_structure::opcode, READ_DVD_STRUCTURE, scsi_ulto2b(), and scsi_ulto4b().
Referenced by cdreaddvdstructure().
void scsi_read_toc | ( | struct ccb_scsiio * | csio, |
uint32_t | retries, | ||
void(*)(struct cam_periph *, union ccb *) | cbfcnp, | ||
uint8_t | tag_action, | ||
uint8_t | byte1_flags, | ||
uint8_t | format, | ||
uint8_t | track, | ||
uint8_t * | data_ptr, | ||
uint32_t | dxfer_len, | ||
int | sense_len, | ||
int | timeout | ||
) |
Definition at line 4230 of file scsi_cd.c.
References scsi_read_toc::byte2, CAM_DIR_IN, cam_fill_csio(), cdb_t::cdb_bytes, ccb_scsiio::cdb_io, scsi_read_toc::data_len, scsi_read_toc::format, scsi_read_toc::from_track, scsi_read_toc::op_code, READ_TOC, and scsi_ulto2b().
Referenced by cdreadtoc(), and cdstart().
void scsi_report_key | ( | struct ccb_scsiio * | csio, |
u_int32_t | retries, | ||
void(*)(struct cam_periph *, union ccb *) | cbfcnp, | ||
u_int8_t | tag_action, | ||
u_int32_t | lba, | ||
u_int8_t | agid, | ||
u_int8_t | key_format, | ||
u_int8_t * | data_ptr, | ||
u_int32_t | dxfer_len, | ||
u_int8_t | sense_len, | ||
u_int32_t | timeout | ||
) |
Definition at line 4139 of file scsi_cd.c.
References scsi_report_key::agid_keyformat, scsi_report_key::alloc_len, CAM_DIR_IN, CAM_DIR_NONE, cam_fill_csio(), cdb_t::cdb_bytes, ccb_scsiio::cdb_io, scsi_report_key::lba, scsi_report_key::opcode, REPORT_KEY, RK_KF_AGID_SHIFT, RK_KF_KEYFORMAT_MASK, scsi_ulto2b(), and scsi_ulto4b().
Referenced by cdreportkey().
void scsi_send_key | ( | struct ccb_scsiio * | csio, |
u_int32_t | retries, | ||
void(*)(struct cam_periph *, union ccb *) | cbfcnp, | ||
u_int8_t | tag_action, | ||
u_int8_t | agid, | ||
u_int8_t | key_format, | ||
u_int8_t * | data_ptr, | ||
u_int32_t | dxfer_len, | ||
u_int8_t | sense_len, | ||
u_int32_t | timeout | ||
) |
Definition at line 4168 of file scsi_cd.c.
References scsi_send_key::agid_keyformat, CAM_DIR_OUT, cam_fill_csio(), cdb_t::cdb_bytes, ccb_scsiio::cdb_io, scsi_send_key::opcode, scsi_send_key::param_len, RK_KF_AGID_SHIFT, RK_KF_KEYFORMAT_MASK, scsi_ulto2b(), and SEND_KEY.
Referenced by cdsendkey().
SYSCTL_INT | ( | _kern_cam_cd | , |
OID_AUTO | , | ||
poll_period | , | ||
CTLFLAG_RWTUN | , | ||
& | cd_poll_period, | ||
0 | , | ||
"Media polling period in seconds" | |||
) |
SYSCTL_INT | ( | _kern_cam_cd | , |
OID_AUTO | , | ||
retry_count | , | ||
CTLFLAG_RWTUN | , | ||
& | cd_retry_count, | ||
0 | , | ||
"Normal I/O retry count" | |||
) |
SYSCTL_INT | ( | _kern_cam_cd | , |
OID_AUTO | , | ||
timeout | , | ||
CTLFLAG_RWTUN | , | ||
& | cd_timeout, | ||
0 | , | ||
" | Timeout, | ||
in | us, | ||
for read operations" | |||
) |
|
static |
|
static |
|
static |
Definition at line 197 of file scsi_cd.c.
Referenced by cdgetpagesize().
|
static |
Definition at line 328 of file scsi_cd.c.
Referenced by cdmediapoll(), and cdregister().
|
static |
|
static |
Definition at line 329 of file scsi_cd.c.
Referenced by cdgetmode(), cdpause(), cdplay(), cdplaymsf(), cdplaytracks(), cdprevent(), cdreaddvdstructure(), cdreadsubchannel(), cdreadtoc(), cdreportkey(), cdsendkey(), cdsetmode(), cdsetspeed(), cdstart(), cdstartunit(), and cdstopunit().
|
static |
|
static |
|
static |
Definition at line 246 of file scsi_cd.c.
Referenced by cdregister().
|
static |
|
static |
Definition at line 247 of file scsi_cd.c.
Referenced by cdregister().
|
static |
Definition at line 308 of file scsi_cd.c.
Referenced by cdregister().
|
static |
|
static |
Definition at line 245 of file scsi_cd.c.
Referenced by cdregister().
|
static |
|
static |
|
static |
Definition at line 248 of file scsi_cd.c.
Referenced by cdregister().