This also adds a roles member to the rport private data
so that we can store the role and then later in enter_ready
we change the role.
Signed-off-by: Robert Love <[EMAIL PROTECTED]>
---
drivers/scsi/libfc/fc_rport.c | 7 +++++--
include/scsi/libfc/libfc.h | 1 +
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/scsi/libfc/fc_rport.c b/drivers/scsi/libfc/fc_rport.c
index d21261d..b8a9ab0 100644
--- a/drivers/scsi/libfc/fc_rport.c
+++ b/drivers/scsi/libfc/fc_rport.c
@@ -340,6 +340,8 @@ static void fc_rport_enter_ready(struct fc_rport *rport)
if (fc_rp_debug)
FC_DBG("remote %6x ready\n", rport->port_id);
+ fc_remote_port_rolechg(rport, rdata->roles);
+
if (rdata->event_callback)
rdata->event_callback(lport, rport, LPORT_EV_RPORT_CREATED);
}
@@ -611,9 +613,9 @@ static void fc_rport_prli_resp(struct fc_seq *sp, struct
fc_frame *fp,
if (fcp_parm & FCP_SPPF_TARG_FCN)
roles |= FC_RPORT_ROLE_FCP_TARGET;
+ rp->roles = roles;
fc_rport_enter_rtv(rport);
fc_rport_unlock(rport);
- fc_remote_port_rolechg(rport, roles);
} else {
FC_DBG("bad ELS response\n");
fc_rport_state_enter(rport, RPORT_ST_ERROR);
@@ -1121,7 +1123,8 @@ static void fc_rport_recv_prli_req(struct fc_rport *rport,
roles |= FC_RPORT_ROLE_FCP_INITIATOR;
if (fcp_parm & FCP_SPPF_TARG_FCN)
roles |= FC_RPORT_ROLE_FCP_TARGET;
- fc_remote_port_rolechg(rport, roles);
+ rp->roles = roles;
+
spp->spp_params =
htonl(rp->local_port->service_params);
break;
diff --git a/include/scsi/libfc/libfc.h b/include/scsi/libfc/libfc.h
index 03e4e0a..4ae64ea 100644
--- a/include/scsi/libfc/libfc.h
+++ b/include/scsi/libfc/libfc.h
@@ -160,6 +160,7 @@ struct fc_rport_libfc_priv {
void (*event_callback)(struct fc_lport *,
struct fc_rport *,
enum fc_lport_event);
+ u32 roles;
};
struct fc_rport *fc_ns_create_dummy_rport(struct fc_ns_port *);
_______________________________________________
devel mailing list
[email protected]
http://www.open-fcoe.org/mailman/listinfo/devel