FreeBSD/sys/cam/ctl/ctl.c
/*
 * INQUIRY with the EVPD bit set.
 */
INQUIRY with the EVPD bit set.
INQUIRY with the EVPD bit set .
static int
ctl_inquiry_evpd(struct ctl_scsiio *ctsio)
{
	struct ctl_lun *lun;
	struct scsi_inquiry *cdb;
	int alloc_len, retval;
	lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr;
	cdb = (struct scsi_inquiry *)ctsio->cdb;
	alloc_len = scsi_2btoul(cdb->length);
	switch (cdb->page_code) {
	case SVPD_SUPPORTED_PAGES:
		retval = ctl_inquiry_evpd_supported(ctsio, alloc_len);
		break;
	case SVPD_UNIT_SERIAL_NUMBER:
		retval = ctl_inquiry_evpd_serial(ctsio, alloc_len);
		break;
	case SVPD_DEVICE_ID:
		retval = ctl_inquiry_evpd_devid(ctsio, alloc_len);
		break;
	case SVPD_EXTENDED_INQUIRY_DATA:
		retval = ctl_inquiry_evpd_eid(ctsio, alloc_len);
		break;
	case SVPD_MODE_PAGE_POLICY:
		retval = ctl_inquiry_evpd_mpp(ctsio, alloc_len);
		break;
	case SVPD_SCSI_PORTS:
		retval = ctl_inquiry_evpd_scsi_ports(ctsio, alloc_len);
		break;
	case SVPD_SCSI_TPC:
		retval = ctl_inquiry_evpd_tpc(ctsio, alloc_len);
		break;
	case SVPD_BLOCK_LIMITS:
		if (lun == NULL || lun->be_lun->lun_type != T_DIRECT)
			goto err;
		retval = ctl_inquiry_evpd_block_limits(ctsio, alloc_len);
		break;
	case SVPD_BDC:
		if (lun == NULL || lun->be_lun->lun_type != T_DIRECT)
			goto err;
		retval = ctl_inquiry_evpd_bdc(ctsio, alloc_len);
		break;
	case SVPD_LBP:
		if (lun == NULL || lun->be_lun->lun_type != T_DIRECT)
			goto err;
		retval = ctl_inquiry_evpd_lbp(ctsio, alloc_len);
		break;
	default:
err:
		ctl_set_invalid_field(ctsio,
				       1,
				       1,
				       2,
				       0,
				       0);
		ctl_done((union ctl_io *)ctsio);
		retval = CTL_RETVAL_COMPLETE;
		break;
	}
	return (retval);
}
static int ctl_inquiry_evpd ( struct ctl_scsiio * ctsio ) { struct ctl_lun * lun ; struct scsi_inquiry * cdb ; int alloc_len , retval ; lun = ( struct ctl_lun * ) ctsio -> io_hdr . ctl_private [ CTL_PRIV_LUN ] . ptr ; cdb = ( struct scsi_inquiry * ) ctsio -> cdb ; alloc_len = scsi_2btoul ( cdb -> length ) ; switch ( cdb -> page_code ) { case SVPD_SUPPORTED_PAGES : retval = ctl_inquiry_evpd_supported ( ctsio , alloc_len ) ; break ; case SVPD_UNIT_SERIAL_NUMBER : retval = ctl_inquiry_evpd_serial ( ctsio , alloc_len ) ; break ; case SVPD_DEVICE_ID : retval = ctl_inquiry_evpd_devid ( ctsio , alloc_len ) ; break ; case SVPD_EXTENDED_INQUIRY_DATA : retval = ctl_inquiry_evpd_eid ( ctsio , alloc_len ) ; break ; case SVPD_MODE_PAGE_POLICY : retval = ctl_inquiry_evpd_mpp ( ctsio , alloc_len ) ; break ; case SVPD_SCSI_PORTS : retval = ctl_inquiry_evpd_scsi_ports ( ctsio , alloc_len ) ; break ; case SVPD_SCSI_TPC : retval = ctl_inquiry_evpd_tpc ( ctsio , alloc_len ) ; break ; case SVPD_BLOCK_LIMITS : if ( lun == NULL || lun -> be_lun -> lun_type != T_DIRECT ) goto err ; retval = ctl_inquiry_evpd_block_limits ( ctsio , alloc_len ) ; break ; case SVPD_BDC : if ( lun == NULL || lun -> be_lun -> lun_type != T_DIRECT ) goto err ; retval = ctl_inquiry_evpd_bdc ( ctsio , alloc_len ) ; break ; case SVPD_LBP : if ( lun == NULL || lun -> be_lun -> lun_type != T_DIRECT ) goto err ; retval = ctl_inquiry_evpd_lbp ( ctsio , alloc_len ) ; break ; default : err : ctl_set_invalid_field ( ctsio , 1 , 1 , 2 , 0 , 0 ) ; ctl_done ( ( union ctl_io * ) ctsio ) ; retval = CTL_RETVAL_COMPLETE ; break ; } return ( retval ) ; }
INQUIRY with the EVPD bit set.
INQUIRY with the EVPD bit set .
/*sks_valid*/ /*command*/ /*field*/ /*bit_valid*/ /*bit*/