/** * qla2x00_ga_nxt() - SNS scan for fabric devices via GA_NXT command. * @ha: HA context * @fcport: fcport entry to updated * * Returns 0 on success. */ int qla2x00_ga_nxt(scsi_qla_host_t *vha, fc_port_t *fcport) { int rval; ms_iocb_entry_t *ms_pkt; struct ct_sns_req *ct_req; struct ct_sns_rsp *ct_rsp; struct qla_hw_data *ha = vha->hw; if (IS_QLA2100(ha) || IS_QLA2200(ha)) return qla2x00_sns_ga_nxt(vha, fcport); /* Issue GA_NXT */ /* Prepare common MS IOCB */ ms_pkt = ha->isp_ops->prep_ms_iocb(vha, GA_NXT_REQ_SIZE, GA_NXT_RSP_SIZE); /* Prepare CT request */ ct_req = qla2x00_prep_ct_req(&ha->ct_sns->p.req, GA_NXT_CMD, GA_NXT_RSP_SIZE); ct_rsp = &ha->ct_sns->p.rsp; /* Prepare CT arguments -- port_id */ ct_req->req.port_id.port_id[0] = fcport->d_id.b.domain; ct_req->req.port_id.port_id[1] = fcport->d_id.b.area; ct_req->req.port_id.port_id[2] = fcport->d_id.b.al_pa; /* Execute MS IOCB */ rval = qla2x00_issue_iocb(vha, ha->ms_iocb, ha->ms_iocb_dma, sizeof(ms_iocb_entry_t)); if (rval != QLA_SUCCESS) { /*EMPTY*/ ql_dbg(ql_dbg_disc, vha, 0x2062, "GA_NXT issue IOCB failed (%d).\n", rval); } else if (qla2x00_chk_ms_status(vha, ms_pkt, ct_rsp, "GA_NXT") != QLA_SUCCESS) { rval = QLA_FUNCTION_FAILED; } else { /* Populate fc_port_t entry. */ fcport->d_id.b.domain = ct_rsp->rsp.ga_nxt.port_id[0]; fcport->d_id.b.area = ct_rsp->rsp.ga_nxt.port_id[1]; fcport->d_id.b.al_pa = ct_rsp->rsp.ga_nxt.port_id[2]; memcpy(fcport->node_name, ct_rsp->rsp.ga_nxt.node_name, WWN_SIZE); memcpy(fcport->port_name, ct_rsp->rsp.ga_nxt.port_name, WWN_SIZE); if (ct_rsp->rsp.ga_nxt.port_type != NS_N_PORT_TYPE && ct_rsp->rsp.ga_nxt.port_type != NS_NL_PORT_TYPE) fcport->d_id.b.domain = 0xf0; ql_dbg(ql_dbg_disc, vha, 0x2063, "GA_NXT entry - nn %02x%02x%02x%02x%02x%02x%02x%02x " "pn %02x%02x%02x%02x%02x%02x%02x%02x " "port_id=%02x%02x%02x.\n", fcport->node_name[0], fcport->node_name[1], fcport->node_name[2], fcport->node_name[3], fcport->node_name[4], fcport->node_name[5], fcport->node_name[6], fcport->node_name[7], fcport->port_name[0], fcport->port_name[1], fcport->port_name[2], fcport->port_name[3], fcport->port_name[4], fcport->port_name[5], fcport->port_name[6], fcport->port_name[7], fcport->d_id.b.domain, fcport->d_id.b.area, fcport->d_id.b.al_pa); } return (rval); }
/** * qla2x00_ga_nxt() - SNS scan for fabric devices via GA_NXT command. * @ha: HA context * @fcport: fcport entry to updated * * Returns 0 on success. */ int qla2x00_ga_nxt(scsi_qla_host_t *ha, fc_port_t *fcport) { int rval; ms_iocb_entry_t *ms_pkt; struct ct_sns_req *ct_req; struct ct_sns_rsp *ct_rsp; if (IS_QLA2100(ha) || IS_QLA2200(ha)) { return (qla2x00_sns_ga_nxt(ha, fcport)); } /* Issue GA_NXT */ /* Prepare common MS IOCB */ ms_pkt = qla2x00_prep_ms_iocb(ha, GA_NXT_REQ_SIZE, GA_NXT_RSP_SIZE); /* Prepare CT request */ ct_req = qla2x00_prep_ct_req(&ha->ct_sns->p.req, GA_NXT_CMD, GA_NXT_RSP_SIZE); ct_rsp = &ha->ct_sns->p.rsp; /* Prepare CT arguments -- port_id */ ct_req->req.port_id.port_id[0] = fcport->d_id.b.domain; ct_req->req.port_id.port_id[1] = fcport->d_id.b.area; ct_req->req.port_id.port_id[2] = fcport->d_id.b.al_pa; /* Execute MS IOCB */ rval = qla2x00_issue_iocb(ha, ha->ms_iocb, ha->ms_iocb_dma, sizeof(ms_iocb_entry_t)); if (rval != QLA_SUCCESS) { /*EMPTY*/ DEBUG2_3(printk("scsi(%ld): GA_NXT issue IOCB failed (%d).\n", ha->host_no, rval)); } else if (ct_rsp->header.response != __constant_cpu_to_be16(CT_ACCEPT_RESPONSE)) { DEBUG2_3(printk("scsi(%ld): GA_NXT failed, rejected request, " "ga_nxt_rsp:\n", ha->host_no)); DEBUG2_3(qla2x00_dump_buffer((uint8_t *)&ct_rsp->header, sizeof(struct ct_rsp_hdr))); rval = QLA_FUNCTION_FAILED; } else { /* Populate fc_port_t entry. */ fcport->d_id.b.domain = ct_rsp->rsp.ga_nxt.port_id[0]; fcport->d_id.b.area = ct_rsp->rsp.ga_nxt.port_id[1]; fcport->d_id.b.al_pa = ct_rsp->rsp.ga_nxt.port_id[2]; memcpy(fcport->node_name, ct_rsp->rsp.ga_nxt.node_name, WWN_SIZE); memcpy(fcport->port_name, ct_rsp->rsp.ga_nxt.port_name, WWN_SIZE); if (ct_rsp->rsp.ga_nxt.port_type != NS_N_PORT_TYPE && ct_rsp->rsp.ga_nxt.port_type != NS_NL_PORT_TYPE) fcport->d_id.b.domain = 0xf0; DEBUG2_3(printk("scsi(%ld): GA_NXT entry - " "nn %02x%02x%02x%02x%02x%02x%02x%02x " "pn %02x%02x%02x%02x%02x%02x%02x%02x " "portid=%02x%02x%02x.\n", ha->host_no, fcport->node_name[0], fcport->node_name[1], fcport->node_name[2], fcport->node_name[3], fcport->node_name[4], fcport->node_name[5], fcport->node_name[6], fcport->node_name[7], fcport->port_name[0], fcport->port_name[1], fcport->port_name[2], fcport->port_name[3], fcport->port_name[4], fcport->port_name[5], fcport->port_name[6], fcport->port_name[7], fcport->d_id.b.domain, fcport->d_id.b.area, fcport->d_id.b.al_pa)); } return (rval); }