Date: Wed, 23 Nov 2016 09:10:45 +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: r309042 - stable/10/sys/cam/scsi Message-ID: <201611230910.uAN9Aj59039257@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mav Date: Wed Nov 23 09:10:45 2016 New Revision: 309042 URL: https://svnweb.freebsd.org/changeset/base/309042 Log: MFC r308425: Add support for EIIOE flag in Additional Element Status. It was added in SES-3 spec, and its support required to properly link the Additional Element Status page data to the original elements. Modified: stable/10/sys/cam/scsi/scsi_enc_ses.c stable/10/sys/cam/scsi/scsi_ses.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/scsi/scsi_enc_ses.c ============================================================================== --- stable/10/sys/cam/scsi/scsi_enc_ses.c Wed Nov 23 09:10:11 2016 (r309041) +++ stable/10/sys/cam/scsi/scsi_enc_ses.c Wed Nov 23 09:10:45 2016 (r309042) @@ -1759,14 +1759,20 @@ ses_process_elm_addlstatus(enc_softc_t * eip = ses_elm_addlstatus_eip(elm_hdr); if (eip && !ignore_index) { struct ses_elm_addlstatus_eip_hdr *eip_hdr; - int expected_index; + int expected_index, index; + ses_elem_index_type_t index_type; eip_hdr = (struct ses_elm_addlstatus_eip_hdr *)elm_hdr; - expected_index = iter.individual_element_index; + if (eip_hdr->byte2 & SES_ADDL_EIP_EIIOE) { + index_type = SES_ELEM_INDEX_GLOBAL; + expected_index = iter.global_element_index; + } else { + index_type = SES_ELEM_INDEX_INDIVIDUAL; + expected_index = iter.individual_element_index; + } titer = iter; telement = ses_iter_seek_to(&titer, - eip_hdr->element_index, - SES_ELEM_INDEX_INDIVIDUAL); + eip_hdr->element_index, index_type); if (telement != NULL && (ses_typehasaddlstatus(enc, titer.type_index) != TYPE_ADDLSTATUS_NONE || @@ -1776,13 +1782,18 @@ ses_process_elm_addlstatus(enc_softc_t * } else ignore_index = 1; - if (iter.individual_element_index > expected_index + if (eip_hdr->byte2 & SES_ADDL_EIP_EIIOE) + index = iter.global_element_index; + else + index = iter.individual_element_index; + if (index > expected_index && status_type == TYPE_ADDLSTATUS_MANDATORY) { - ENC_VLOG(enc, "%s: provided element " + ENC_VLOG(enc, "%s: provided %s element" "index %d skips mandatory status " " element at index %d\n", - __func__, eip_hdr->element_index, - expected_index); + __func__, (eip_hdr->byte2 & + SES_ADDL_EIP_EIIOE) ? "global " : "", + index, expected_index); } } elmpriv = element->elm_private; Modified: stable/10/sys/cam/scsi/scsi_ses.h ============================================================================== --- stable/10/sys/cam/scsi/scsi_ses.h Wed Nov 23 09:10:11 2016 (r309041) +++ stable/10/sys/cam/scsi/scsi_ses.h Wed Nov 23 09:10:45 2016 (r309042) @@ -2413,7 +2413,8 @@ int ses_elm_addlstatus_invalid(struct se struct ses_elm_addlstatus_eip_hdr { struct ses_elm_addlstatus_base_hdr base; - uint8_t reserved; + uint8_t byte2; +#define SES_ADDL_EIP_EIIOE 1 uint8_t element_index; /* NB: This define (currently) applies to all eip=1 headers */ #define SES_EIP_HDR_EXTRA_LEN 2
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201611230910.uAN9Aj59039257>