632 SCSI_READ64(&fp->sadfi_ports[i].sapdi_n_port_name))) != 0)
633 goto fail;
634 }
635
636 if ((nverr = nvlist_add_nvlist_array(nvl, SES_FC_PROP_PORTS,
637 nva, nports)) != 0)
638 goto fail;
639
640 for (i = 0; i < nports && nva[i] != NULL; i++)
641 nvlist_free(nva[i]);
642 ses_free(nva);
643 return (0);
644
645 fail:
646 for (i = 0; i < nports && nva[i] != NULL; i++)
647 nvlist_free(nva[i]);
648 ses_free(nva);
649 return (ses_set_nverrno(nverr, NULL));
650 }
651
652 static int
653 elem_parse_aes_device(const ses2_aes_descr_eip_impl_t *dep, nvlist_t *nvl,
654 size_t len)
655 {
656 ses2_aes_descr_fc_eip_impl_t *fp;
657 ses2_aes_descr_sas0_eip_impl_t *s0ep;
658 ses2_aes_descr_sas0_impl_t *s0p;
659 ses2_aes_descr_impl_t *dip;
660 nvlist_t **nva;
661 int nverr, i;
662 size_t nphy;
663
664 if (dep->sadei_eip) {
665 s0ep = (ses2_aes_descr_sas0_eip_impl_t *)
666 dep->sadei_protocol_specific;
667 s0p = (ses2_aes_descr_sas0_impl_t *)
668 dep->sadei_protocol_specific;
669 } else {
670 dip = (ses2_aes_descr_impl_t *)dep;
671 s0ep = NULL;
|
632 SCSI_READ64(&fp->sadfi_ports[i].sapdi_n_port_name))) != 0)
633 goto fail;
634 }
635
636 if ((nverr = nvlist_add_nvlist_array(nvl, SES_FC_PROP_PORTS,
637 nva, nports)) != 0)
638 goto fail;
639
640 for (i = 0; i < nports && nva[i] != NULL; i++)
641 nvlist_free(nva[i]);
642 ses_free(nva);
643 return (0);
644
645 fail:
646 for (i = 0; i < nports && nva[i] != NULL; i++)
647 nvlist_free(nva[i]);
648 ses_free(nva);
649 return (ses_set_nverrno(nverr, NULL));
650 }
651
652 /*
653 * Parse the AES (0xa) SES diagnostic page.
654 *
655 * When making changes here, keep in mind that AES (re)parsing may be done by
656 * libses plugin(s) so it may need to be updated as well.
657 */
658 static int
659 elem_parse_aes_device(const ses2_aes_descr_eip_impl_t *dep, nvlist_t *nvl,
660 size_t len)
661 {
662 ses2_aes_descr_fc_eip_impl_t *fp;
663 ses2_aes_descr_sas0_eip_impl_t *s0ep;
664 ses2_aes_descr_sas0_impl_t *s0p;
665 ses2_aes_descr_impl_t *dip;
666 nvlist_t **nva;
667 int nverr, i;
668 size_t nphy;
669
670 if (dep->sadei_eip) {
671 s0ep = (ses2_aes_descr_sas0_eip_impl_t *)
672 dep->sadei_protocol_specific;
673 s0p = (ses2_aes_descr_sas0_impl_t *)
674 dep->sadei_protocol_specific;
675 } else {
676 dip = (ses2_aes_descr_impl_t *)dep;
677 s0ep = NULL;
|