/** * FC transport template entry, get SCSI host port type. */ static void bfad_im_get_host_fabric_name(struct Scsi_Host *shost) { struct bfad_im_port_s *im_port = (struct bfad_im_port_s *) shost->hostdata[0]; struct bfad_port_s *port = im_port->port; wwn_t fabric_nwwn = 0; fabric_nwwn = bfa_fcs_port_get_fabric_name(port->fcs_port); fc_host_fabric_name(shost) = bfa_os_htonll(fabric_nwwn); }
static void bfa_fcs_port_ms_gfn_response(void *fcsarg, struct bfa_fcxp_s *fcxp, void *cbarg, bfa_status_t req_status, u32 rsp_len, u32 resid_len, struct fchs_s *rsp_fchs) { struct bfa_fcs_port_ms_s *ms = (struct bfa_fcs_port_ms_s *)cbarg; struct bfa_fcs_port_s *port = ms->port; struct ct_hdr_s *cthdr = NULL; wwn_t *gfn_resp; bfa_trc(port->fcs, req_status); bfa_trc(port->fcs, port->port_cfg.pwwn); /* * Sanity Checks */ if (req_status != BFA_STATUS_OK) { bfa_trc(port->fcs, req_status); bfa_sm_send_event(ms, MSSM_EVENT_RSP_ERROR); return; } cthdr = (struct ct_hdr_s *) BFA_FCXP_RSP_PLD(fcxp); cthdr->cmd_rsp_code = bfa_os_ntohs(cthdr->cmd_rsp_code); if (cthdr->cmd_rsp_code == CT_RSP_ACCEPT) { gfn_resp = (wwn_t *) (cthdr + 1); /* * check if it has actually changed */ if ((memcmp ((void *)&bfa_fcs_port_get_fabric_name(port), gfn_resp, sizeof(wwn_t)) != 0)) bfa_fcs_fabric_set_fabric_name(port->fabric, *gfn_resp); bfa_sm_send_event(ms, MSSM_EVENT_RSP_OK); return; } bfa_trc(port->fcs, cthdr->reason_code); bfa_trc(port->fcs, cthdr->exp_code); bfa_sm_send_event(ms, MSSM_EVENT_RSP_ERROR); }