Date: Fri, 13 Nov 2015 19:23:23 +0000 (UTC) From: Alexander Motin <mav@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290775 - in stable/10/sys: cam/ctl cam/scsi dev/isp Message-ID: <201511131923.tADJNNst089018@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mav Date: Fri Nov 13 19:23:22 2015 New Revision: 290775 URL: https://svnweb.freebsd.org/changeset/base/290775 Log: MFC r289843: Add partial support for QUERY TMF to CAM and isp(4). This change allows to decode respective functions in isp(4) in target mode and pass them through CAM to CTL. Unfortunately neither CAM nor isp(4) support returning response info for those task management functions now. On the other side I just have no initiator to test this functionality. Modified: stable/10/sys/cam/ctl/scsi_ctl.c stable/10/sys/cam/scsi/scsi_message.h stable/10/sys/dev/isp/isp_freebsd.c stable/10/sys/dev/isp/isp_stds.h stable/10/sys/dev/isp/isp_target.c stable/10/sys/dev/isp/isp_target.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/scsi_ctl.c ============================================================================== --- stable/10/sys/cam/ctl/scsi_ctl.c Fri Nov 13 19:21:45 2015 (r290774) +++ stable/10/sys/cam/ctl/scsi_ctl.c Fri Nov 13 19:23:22 2015 (r290775) @@ -1459,24 +1459,31 @@ ctlfedone(struct cam_periph *periph, uni CTL_TASK_ABORT_TASK_SET; break; case MSG_TARGET_RESET: - io->taskio.task_action = - CTL_TASK_TARGET_RESET; + io->taskio.task_action = CTL_TASK_TARGET_RESET; break; case MSG_ABORT_TASK: - io->taskio.task_action = - CTL_TASK_ABORT_TASK; + io->taskio.task_action = CTL_TASK_ABORT_TASK; break; case MSG_LOGICAL_UNIT_RESET: - io->taskio.task_action = - CTL_TASK_LUN_RESET; + io->taskio.task_action = CTL_TASK_LUN_RESET; break; case MSG_CLEAR_TASK_SET: io->taskio.task_action = - CTL_TASK_CLEAR_TASK_SET; + CTL_TASK_CLEAR_TASK_SET; break; case MSG_CLEAR_ACA: + io->taskio.task_action = CTL_TASK_CLEAR_ACA; + break; + case MSG_QUERY_TASK: + io->taskio.task_action = CTL_TASK_QUERY_TASK; + break; + case MSG_QUERY_TASK_SET: + io->taskio.task_action = + CTL_TASK_QUERY_TASK_SET; + break; + case MSG_QUERY_ASYNC_EVENT: io->taskio.task_action = - CTL_TASK_CLEAR_ACA; + CTL_TASK_QUERY_ASYNC_EVENT; break; case MSG_NOOP: send_ctl_io = 0; Modified: stable/10/sys/cam/scsi/scsi_message.h ============================================================================== --- stable/10/sys/cam/scsi/scsi_message.h Fri Nov 13 19:21:45 2015 (r290774) +++ stable/10/sys/cam/scsi/scsi_message.h Fri Nov 13 19:23:22 2015 (r290775) @@ -68,3 +68,9 @@ #define MSG_EXT_PPR_QAS_REQ 0x04 #define MSG_EXT_PPR_DT_REQ 0x02 #define MSG_EXT_PPR_IU_REQ 0x01 + +/* Fake messages not defined for SPI, but needed for other transports */ +#define MSG_QUERY_TASK 0x100 +#define MSG_QUERY_TASK_SET 0x101 +#define MSG_QUERY_ASYNC_EVENT 0x102 + Modified: stable/10/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/10/sys/dev/isp/isp_freebsd.c Fri Nov 13 19:21:45 2015 (r290774) +++ stable/10/sys/dev/isp/isp_freebsd.c Fri Nov 13 19:23:22 2015 (r290775) @@ -3479,6 +3479,12 @@ isp_handle_platform_target_tmf(ispsoftc_ case NT_TARGET_RESET: inot->arg = MSG_TARGET_RESET; break; + case NT_QUERY_TASK_SET: + inot->arg = MSG_QUERY_TASK_SET; + break; + case NT_QUERY_ASYNC_EVENT: + inot->arg = MSG_QUERY_ASYNC_EVENT; + break; default: isp_prt(isp, ISP_LOGWARN, "%s: unknown TMF code 0x%x for chan %d lun 0x%x", __func__, notify->nt_ncode, notify->nt_channel, lun); goto bad; @@ -5883,6 +5889,8 @@ changed: case NT_CLEAR_TASK_SET: case NT_LUN_RESET: case NT_TARGET_RESET: + case NT_QUERY_TASK_SET: + case NT_QUERY_ASYNC_EVENT: /* * These are task management functions. */ Modified: stable/10/sys/dev/isp/isp_stds.h ============================================================================== --- stable/10/sys/dev/isp/isp_stds.h Fri Nov 13 19:21:45 2015 (r290774) +++ stable/10/sys/dev/isp/isp_stds.h Fri Nov 13 19:23:22 2015 (r290775) @@ -97,8 +97,10 @@ typedef struct { #define FCP_CMND_TMF_CLEAR_ACA 0x40 #define FCP_CMND_TMF_TGT_RESET 0x20 #define FCP_CMND_TMF_LUN_RESET 0x10 +#define FCP_CMND_TMF_QUERY_ASYNC_EVENT 0x08 #define FCP_CMND_TMF_CLEAR_TASK_SET 0x04 #define FCP_CMND_TMF_ABORT_TASK_SET 0x02 +#define FCP_CMND_TMF_QUERY_TASK_SET 0x01 /* * Basic CT IU Header Modified: stable/10/sys/dev/isp/isp_target.c ============================================================================== --- stable/10/sys/dev/isp/isp_target.c Fri Nov 13 19:21:45 2015 (r290774) +++ stable/10/sys/dev/isp/isp_target.c Fri Nov 13 19:23:22 2015 (r290775) @@ -1024,12 +1024,18 @@ isp_got_tmf_24xx(ispsoftc_t *isp, at7_en notify.nt_sid = sid; notify.nt_did = did; notify.nt_channel = chan; - if (aep->at_cmnd.fcp_cmnd_task_management & FCP_CMND_TMF_ABORT_TASK_SET) { + if (aep->at_cmnd.fcp_cmnd_task_management & FCP_CMND_TMF_QUERY_TASK_SET) { + isp_prt(isp, ISP_LOGINFO, f1, "QUERY TASK SET", sid, notify.nt_lun, aep->at_rxid); + notify.nt_ncode = NT_QUERY_TASK_SET; + } else if (aep->at_cmnd.fcp_cmnd_task_management & FCP_CMND_TMF_ABORT_TASK_SET) { isp_prt(isp, ISP_LOGINFO, f1, "ABORT TASK SET", sid, notify.nt_lun, aep->at_rxid); notify.nt_ncode = NT_ABORT_TASK_SET; } else if (aep->at_cmnd.fcp_cmnd_task_management & FCP_CMND_TMF_CLEAR_TASK_SET) { isp_prt(isp, ISP_LOGINFO, f1, "CLEAR TASK SET", sid, notify.nt_lun, aep->at_rxid); notify.nt_ncode = NT_CLEAR_TASK_SET; + } else if (aep->at_cmnd.fcp_cmnd_task_management & FCP_CMND_TMF_QUERY_ASYNC_EVENT) { + isp_prt(isp, ISP_LOGINFO, f1, "QUERY ASYNC EVENT", sid, notify.nt_lun, aep->at_rxid); + notify.nt_ncode = NT_QUERY_ASYNC_EVENT; } else if (aep->at_cmnd.fcp_cmnd_task_management & FCP_CMND_TMF_LUN_RESET) { isp_prt(isp, ISP_LOGINFO, f1, "LUN RESET", sid, notify.nt_lun, aep->at_rxid); notify.nt_ncode = NT_LUN_RESET; Modified: stable/10/sys/dev/isp/isp_target.h ============================================================================== --- stable/10/sys/dev/isp/isp_target.h Fri Nov 13 19:21:45 2015 (r290774) +++ stable/10/sys/dev/isp/isp_target.h Fri Nov 13 19:23:22 2015 (r290775) @@ -51,7 +51,9 @@ typedef enum { NT_LOGOUT, NT_GLOBAL_LOGOUT, NT_CHANGED, - NT_HBA_RESET + NT_HBA_RESET, + NT_QUERY_TASK_SET, + NT_QUERY_ASYNC_EVENT } isp_ncode_t; typedef struct isp_notify {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201511131923.tADJNNst089018>