FreeBSD/sys/cam/scsi/scsi_target.c
/* Send the HBA the enable/disable message */
Send the HBA the enable/disable message
Send the HBA the enable / disable message
static cam_status
targendislun(struct cam_path *path, int enable, int grp6_len, int grp7_len)
{
	struct ccb_en_lun en_ccb;
	cam_status	  status;
	xpt_setup_ccb(&en_ccb.ccb_h, path, CAM_PRIORITY_NORMAL);
	en_ccb.ccb_h.func_code = XPT_EN_LUN;
	en_ccb.grp6_len = grp6_len;
	en_ccb.grp7_len = grp7_len;
	en_ccb.enable = enable ? 1 : 0;
	xpt_action((union ccb *)&en_ccb);
	status = en_ccb.ccb_h.status & CAM_STATUS_MASK;
	if (status != CAM_REQ_CMP) {
		xpt_print(path, "%sable lun CCB rejected, status %#x\n",
		    enable ? "en" : "dis", status);
	}
	return (status);
}
static cam_status targendislun ( struct cam_path * path , int enable , int grp6_len , int grp7_len ) { struct ccb_en_lun en_ccb ; cam_status status ; xpt_setup_ccb ( & en_ccb . ccb_h , path , CAM_PRIORITY_NORMAL ) ; en_ccb . ccb_h . func_code = XPT_EN_LUN ; en_ccb . grp6_len = grp6_len ; en_ccb . grp7_len = grp7_len ; en_ccb . enable = enable ? 1 : 0 ; xpt_action ( ( union ccb * ) & en_ccb ) ; status = en_ccb . ccb_h . status & CAM_STATUS_MASK ; if ( status != CAM_REQ_CMP ) { xpt_print ( path , " \n " , enable ? " " : " " , status ) ; } return ( status ) ; }
Send the HBA the enable/disable message
Send the HBA the enable / disable message
/* Tell the lun to begin answering selects */ /* Don't need support for any vendor specific commands */