FreeBSD/sys/cam/ctl/ctl.c
/*
 * SCSI VPD page 0x86, the Extended INQUIRY Data page.
 */
SCSI VPD page 0x86, the Extended INQUIRY Data page.
SCSI VPD page 0x86 the Extended INQUIRY Data page .
static int
ctl_inquiry_evpd_eid(struct ctl_scsiio *ctsio, int alloc_len)
{
	struct scsi_vpd_extended_inquiry_data *eid_ptr;
	struct ctl_lun *lun;
	int data_len;
	lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr;
	data_len = sizeof(struct scsi_vpd_extended_inquiry_data);
	ctsio->kern_data_ptr = malloc(data_len, M_CTL, M_WAITOK | M_ZERO);
	eid_ptr = (struct scsi_vpd_extended_inquiry_data *)ctsio->kern_data_ptr;
	ctsio->kern_sg_entries = 0;
	if (data_len < alloc_len) {
		ctsio->residual = alloc_len - data_len;
		ctsio->kern_data_len = data_len;
		ctsio->kern_total_len = data_len;
	} else {
		ctsio->residual = 0;
		ctsio->kern_data_len = alloc_len;
		ctsio->kern_total_len = alloc_len;
	}
	ctsio->kern_data_resid = 0;
	ctsio->kern_rel_offset = 0;
	ctsio->kern_sg_entries = 0;
	if (lun != NULL)
		eid_ptr->device = (SID_QUAL_LU_CONNECTED << 5) |
				     lun->be_lun->lun_type;
	else
		eid_ptr->device = (SID_QUAL_LU_OFFLINE << 5) | T_DIRECT;
	eid_ptr->page_code = SVPD_EXTENDED_INQUIRY_DATA;
	scsi_ulto2b(data_len - 4, eid_ptr->page_length);
	eid_ptr->flags2 = SVPD_EID_HEADSUP | SVPD_EID_ORDSUP | SVPD_EID_SIMPSUP;
	eid_ptr->flags3 = SVPD_EID_V_SUP;
	eid_ptr->flags4 = SVPD_EID_LUICLT;
	eid_ptr->max_sense_length = 0;
	ctl_set_success(ctsio);
	ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED;
	ctsio->be_move_done = ctl_config_move_done;
	ctl_datamove((union ctl_io *)ctsio);
	return (CTL_RETVAL_COMPLETE);
}
static int ctl_inquiry_evpd_eid ( struct ctl_scsiio * ctsio , int alloc_len ) { struct scsi_vpd_extended_inquiry_data * eid_ptr ; struct ctl_lun * lun ; int data_len ; lun = ( struct ctl_lun * ) ctsio -> io_hdr . ctl_private [ CTL_PRIV_LUN ] . ptr ; data_len = sizeof ( struct scsi_vpd_extended_inquiry_data ) ; ctsio -> kern_data_ptr = malloc ( data_len , M_CTL , M_WAITOK | M_ZERO ) ; eid_ptr = ( struct scsi_vpd_extended_inquiry_data * ) ctsio -> kern_data_ptr ; ctsio -> kern_sg_entries = 0 ; if ( data_len < alloc_len ) { ctsio -> residual = alloc_len - data_len ; ctsio -> kern_data_len = data_len ; ctsio -> kern_total_len = data_len ; } else { ctsio -> residual = 0 ; ctsio -> kern_data_len = alloc_len ; ctsio -> kern_total_len = alloc_len ; } ctsio -> kern_data_resid = 0 ; ctsio -> kern_rel_offset = 0 ; ctsio -> kern_sg_entries = 0 ; if ( lun != NULL ) eid_ptr -> device = ( SID_QUAL_LU_CONNECTED << 5 ) | lun -> be_lun -> lun_type ; else eid_ptr -> device = ( SID_QUAL_LU_OFFLINE << 5 ) | T_DIRECT ; eid_ptr -> page_code = SVPD_EXTENDED_INQUIRY_DATA ; scsi_ulto2b ( data_len - 4 , eid_ptr -> page_length ) ; eid_ptr -> flags2 = SVPD_EID_HEADSUP | SVPD_EID_ORDSUP | SVPD_EID_SIMPSUP ; eid_ptr -> flags3 = SVPD_EID_V_SUP ; eid_ptr -> flags4 = SVPD_EID_LUICLT ; eid_ptr -> max_sense_length = 0 ; ctl_set_success ( ctsio ) ; ctsio -> io_hdr . flags |= CTL_FLAG_ALLOCATED ; ctsio -> be_move_done = ctl_config_move_done ; ctl_datamove ( ( union ctl_io * ) ctsio ) ; return ( CTL_RETVAL_COMPLETE ) ; }
SCSI VPD page 0x86, the Extended INQUIRY Data page.
SCSI VPD page 0x86 the Extended INQUIRY Data page .
/*
	 * The control device is always connected.  The disk device, on the
	 * other hand, may not be online all the time.
	 */ /*
	 * We support head of queue, ordered and simple tags.
	 */ /*
	 * Volatile cache supported.
	 */ /*
	 * This means that we clear the REPORTED LUNS DATA HAS CHANGED unit
	 * attention for a particular IT nexus on all LUNs once we report
	 * it to that nexus once.  This bit is required as of SPC-4.
	 */ /*
	 * XXX KDM in order to correctly answer this, we would need
	 * information from the SIM to determine how much sense data it
	 * can send.  So this would really be a path inquiry field, most
	 * likely.  This can be set to a maximum of 252 according to SPC-4,
	 * but the hardware may or may not be able to support that much.
	 * 0 just means that the maximum sense data length is not reported.
	 */