Commit a7b12a27 authored by Joe Eykholt's avatar Joe Eykholt Committed by James Bottomley

[SCSI] libfc: add FLOGI state to rport for VN2VN

The FIP proposal for VN_port to VN_port point-to-multipoint
operation requires a FLOGI be sent to each remote port.
The FLOGI is sent with the assigned S_ID and D_IDs of the
local and remote ports.  This and the response get
FIP-encapsulated for Ethernet.

Add FLOGI state to the remote port state machine.
This will be skipped if not in point-to-multipoint mode.

To reduce a little duplication between PLOGI and FLOGI
response handling, added fc_rport_login_complete(), which
handles the parameters for the rdata struct.
Signed-off-by: default avatarJoe Eykholt <jeykholt@cisco.com>
Signed-off-by: default avatarRobert Love <robert.w.love@intel.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
parent 3726f358
...@@ -906,10 +906,10 @@ static void fc_lport_recv_req(struct fc_lport *lport, struct fc_seq *sp, ...@@ -906,10 +906,10 @@ static void fc_lport_recv_req(struct fc_lport *lport, struct fc_seq *sp,
recv = lport->tt.rport_recv_req; recv = lport->tt.rport_recv_req;
switch (fc_frame_payload_op(fp)) { switch (fc_frame_payload_op(fp)) {
case ELS_FLOGI: case ELS_FLOGI:
if (!lport->point_to_multipoint)
recv = fc_lport_recv_flogi_req; recv = fc_lport_recv_flogi_req;
break; break;
case ELS_LOGO: case ELS_LOGO:
fh = fc_frame_header_get(fp);
if (ntoh24(fh->fh_s_id) == FC_FID_FLOGI) if (ntoh24(fh->fh_s_id) == FC_FID_FLOGI)
recv = fc_lport_recv_logo_req; recv = fc_lport_recv_logo_req;
break; break;
......
This diff is collapsed.
...@@ -191,6 +191,7 @@ enum fc_els_rjt_reason { ...@@ -191,6 +191,7 @@ enum fc_els_rjt_reason {
ELS_RJT_UNAB = 0x09, /* unable to perform command request */ ELS_RJT_UNAB = 0x09, /* unable to perform command request */
ELS_RJT_UNSUP = 0x0b, /* command not supported */ ELS_RJT_UNSUP = 0x0b, /* command not supported */
ELS_RJT_INPROG = 0x0e, /* command already in progress */ ELS_RJT_INPROG = 0x0e, /* command already in progress */
ELS_RJT_FIP = 0x20, /* FIP error */
ELS_RJT_VENDOR = 0xff, /* vendor specific error */ ELS_RJT_VENDOR = 0xff, /* vendor specific error */
}; };
...@@ -212,6 +213,7 @@ enum fc_els_rjt_explan { ...@@ -212,6 +213,7 @@ enum fc_els_rjt_explan {
ELS_EXPL_UNAB_DATA = 0x2a, /* unable to supply requested data */ ELS_EXPL_UNAB_DATA = 0x2a, /* unable to supply requested data */
ELS_EXPL_UNSUPR = 0x2c, /* Request not supported */ ELS_EXPL_UNSUPR = 0x2c, /* Request not supported */
ELS_EXPL_INV_LEN = 0x2d, /* Invalid payload length */ ELS_EXPL_INV_LEN = 0x2d, /* Invalid payload length */
ELS_EXPL_NOT_NEIGHBOR = 0x62, /* VN2VN_Port not in neighbor set */
/* TBD - above definitions incomplete */ /* TBD - above definitions incomplete */
}; };
......
...@@ -97,6 +97,8 @@ enum fc_disc_event { ...@@ -97,6 +97,8 @@ enum fc_disc_event {
/** /**
* enum fc_rport_state - Remote port states * enum fc_rport_state - Remote port states
* @RPORT_ST_INIT: Initialized * @RPORT_ST_INIT: Initialized
* @RPORT_ST_FLOGI: Waiting for FLOGI completion for point-to-multipoint
* @RPORT_ST_PLOGI_WAIT: Waiting for peer to login for point-to-multipoint
* @RPORT_ST_PLOGI: Waiting for PLOGI completion * @RPORT_ST_PLOGI: Waiting for PLOGI completion
* @RPORT_ST_PRLI: Waiting for PRLI completion * @RPORT_ST_PRLI: Waiting for PRLI completion
* @RPORT_ST_RTV: Waiting for RTV completion * @RPORT_ST_RTV: Waiting for RTV completion
...@@ -107,6 +109,8 @@ enum fc_disc_event { ...@@ -107,6 +109,8 @@ enum fc_disc_event {
*/ */
enum fc_rport_state { enum fc_rport_state {
RPORT_ST_INIT, RPORT_ST_INIT,
RPORT_ST_FLOGI,
RPORT_ST_PLOGI_WAIT,
RPORT_ST_PLOGI, RPORT_ST_PLOGI,
RPORT_ST_PRLI, RPORT_ST_PRLI,
RPORT_ST_RTV, RPORT_ST_RTV,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment