FreeBSD/sys/cam/ctl/ctl.c
/*
 * SCSI VPD page 0x00, the Supported VPD Pages page.
 */
SCSI VPD page 0x00, the Supported VPD Pages page.
SCSI VPD page 0x00 the Supported VPD Pages page .
static int
ctl_inquiry_evpd_supported(struct ctl_scsiio *ctsio, int alloc_len)
{
	struct scsi_vpd_supported_pages *pages;
	int sup_page_size;
	struct ctl_lun *lun;
	int p;
	lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr;
	sup_page_size = sizeof(struct scsi_vpd_supported_pages) *
	    SCSI_EVPD_NUM_SUPPORTED_PAGES;
	ctsio->kern_data_ptr = malloc(sup_page_size, M_CTL, M_WAITOK | M_ZERO);
	pages = (struct scsi_vpd_supported_pages *)ctsio->kern_data_ptr;
	ctsio->kern_sg_entries = 0;
	if (sup_page_size < alloc_len) {
		ctsio->residual = alloc_len - sup_page_size;
		ctsio->kern_data_len = sup_page_size;
		ctsio->kern_total_len = sup_page_size;
	} 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)
		pages->device = (SID_QUAL_LU_CONNECTED << 5) |
				lun->be_lun->lun_type;
	else
		pages->device = (SID_QUAL_LU_OFFLINE << 5) | T_DIRECT;
	p = 0;
	pages->page_list[p++] = SVPD_SUPPORTED_PAGES;
	pages->page_list[p++] = SVPD_UNIT_SERIAL_NUMBER;
	pages->page_list[p++] = SVPD_DEVICE_ID;
	pages->page_list[p++] = SVPD_EXTENDED_INQUIRY_DATA;
	pages->page_list[p++] = SVPD_MODE_PAGE_POLICY;
	pages->page_list[p++] = SVPD_SCSI_PORTS;
	pages->page_list[p++] = SVPD_SCSI_TPC;
	if (lun != NULL && lun->be_lun->lun_type == T_DIRECT) {
		pages->page_list[p++] = SVPD_BLOCK_LIMITS;
		pages->page_list[p++] = SVPD_BDC;
		pages->page_list[p++] = SVPD_LBP;
	}
	pages->length = p;
	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_supported ( struct ctl_scsiio * ctsio , int alloc_len ) { struct scsi_vpd_supported_pages * pages ; int sup_page_size ; struct ctl_lun * lun ; int p ; lun = ( struct ctl_lun * ) ctsio -> io_hdr . ctl_private [ CTL_PRIV_LUN ] . ptr ; sup_page_size = sizeof ( struct scsi_vpd_supported_pages ) * SCSI_EVPD_NUM_SUPPORTED_PAGES ; ctsio -> kern_data_ptr = malloc ( sup_page_size , M_CTL , M_WAITOK | M_ZERO ) ; pages = ( struct scsi_vpd_supported_pages * ) ctsio -> kern_data_ptr ; ctsio -> kern_sg_entries = 0 ; if ( sup_page_size < alloc_len ) { ctsio -> residual = alloc_len - sup_page_size ; ctsio -> kern_data_len = sup_page_size ; ctsio -> kern_total_len = sup_page_size ; } 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 ) pages -> device = ( SID_QUAL_LU_CONNECTED << 5 ) | lun -> be_lun -> lun_type ; else pages -> device = ( SID_QUAL_LU_OFFLINE << 5 ) | T_DIRECT ; p = 0 ; pages -> page_list [ p ++ ] = SVPD_SUPPORTED_PAGES ; pages -> page_list [ p ++ ] = SVPD_UNIT_SERIAL_NUMBER ; pages -> page_list [ p ++ ] = SVPD_DEVICE_ID ; pages -> page_list [ p ++ ] = SVPD_EXTENDED_INQUIRY_DATA ; pages -> page_list [ p ++ ] = SVPD_MODE_PAGE_POLICY ; pages -> page_list [ p ++ ] = SVPD_SCSI_PORTS ; pages -> page_list [ p ++ ] = SVPD_SCSI_TPC ; if ( lun != NULL && lun -> be_lun -> lun_type == T_DIRECT ) { pages -> page_list [ p ++ ] = SVPD_BLOCK_LIMITS ; pages -> page_list [ p ++ ] = SVPD_BDC ; pages -> page_list [ p ++ ] = SVPD_LBP ; } pages -> length = p ; 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 0x00, the Supported VPD Pages page.
SCSI VPD page 0x00 the Supported VPD Pages page .
/*
	 * The control device is always connected.  The disk device, on the
	 * other hand, may not be online all the time.  Need to change this
	 * to figure out whether the disk device is actually online or not.
	 */ /* Supported VPD pages */ /* Serial Number */ /* Device Identification */ /* Extended INQUIRY Data */ /* Mode Page Policy */ /* SCSI Ports */ /* Third-party Copy */ /* Block limits */ /* Block Device Characteristics */ /* Logical Block Provisioning */