예제 #1
0
static void
bfa_fcs_port_ns_send_plogi(void *ns_cbarg, struct bfa_fcxp_s *fcxp_alloced)
{
	struct bfa_fcs_port_ns_s *ns = ns_cbarg;
	struct bfa_fcs_port_s *port = ns->port;
	struct fchs_s          fchs;
	int             len;
	struct bfa_fcxp_s *fcxp;

	bfa_trc(port->fcs, port->pid);

	fcxp = fcxp_alloced ? fcxp_alloced : bfa_fcs_fcxp_alloc(port->fcs);
	if (!fcxp) {
		port->stats.ns_plogi_alloc_wait++;
		bfa_fcxp_alloc_wait(port->fcs->bfa, &ns->fcxp_wqe,
				    bfa_fcs_port_ns_send_plogi, ns);
		return;
	}
	ns->fcxp = fcxp;

	len = fc_plogi_build(&fchs, bfa_fcxp_get_reqbuf(fcxp),
			     bfa_os_hton3b(FC_NAME_SERVER),
			     bfa_fcs_port_get_fcid(port), 0,
			     port->port_cfg.pwwn, port->port_cfg.nwwn,
			     bfa_pport_get_maxfrsize(port->fcs->bfa));

	bfa_fcxp_send(fcxp, NULL, port->fabric->vf_id, port->lp_tag, BFA_FALSE,
		      FC_CLASS_3, len, &fchs, bfa_fcs_port_ns_plogi_response,
		      (void *)ns, FC_MAX_PDUSZ, FC_RA_TOV);
	port->stats.ns_plogi_sent++;

	bfa_sm_send_event(ns, NSSM_EVENT_PLOGI_SENT);
}
예제 #2
0
파일: loop.c 프로젝트: asdlei00/Ace-i
/**
 * Local Functions.
 */
static bfa_status_t
bfa_fcs_port_loop_send_plogi(struct bfa_fcs_port_s *port, u8 alpa)
{
    struct fchs_s          fchs;
    struct bfa_fcxp_s *fcxp = NULL;
    int             len;

    bfa_trc(port->fcs, alpa);

    fcxp = bfa_fcxp_alloc(NULL, port->fcs->bfa, 0, 0, NULL, NULL, NULL,
                          NULL);
    bfa_assert(fcxp);

    len = fc_plogi_build(&fchs, bfa_fcxp_get_reqbuf(fcxp), alpa,
                         bfa_fcs_port_get_fcid(port), 0,
                         port->port_cfg.pwwn, port->port_cfg.nwwn,
                         bfa_fcport_get_maxfrsize(port->fcs->bfa));

    bfa_fcxp_send(fcxp, NULL, port->fabric->vf_id, port->lp_tag, BFA_FALSE,
                  FC_CLASS_3, len, &fchs,
                  bfa_fcs_port_loop_plogi_response, (void *)port,
                  FC_MAX_PDUSZ, FC_RA_TOV);

    return BFA_STATUS_OK;
}