Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 204268
b: refs/heads/master
c: 079ecd8
h: refs/heads/master
v: v3
  • Loading branch information
Joe Eykholt authored and James Bottomley committed Jul 28, 2010
1 parent 7ff3e2f commit 422d377
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 69 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1dd454d9e5205f9a61d51fb97159afeffa0a506c
refs/heads/master: 079ecd8cfe95dfd28b74f3a00d66fdbcdfc8c611
88 changes: 22 additions & 66 deletions trunk/drivers/scsi/libfc/fc_rport.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ static const char *fc_rport_state_names[] = {
[RPORT_ST_PRLI] = "PRLI",
[RPORT_ST_RTV] = "RTV",
[RPORT_ST_READY] = "Ready",
[RPORT_ST_LOGO] = "LOGO",
[RPORT_ST_ADISC] = "ADISC",
[RPORT_ST_DELETE] = "Delete",
};
Expand Down Expand Up @@ -514,9 +513,6 @@ static void fc_rport_timeout(struct work_struct *work)
case RPORT_ST_RTV:
fc_rport_enter_rtv(rdata);
break;
case RPORT_ST_LOGO:
fc_rport_enter_logo(rdata);
break;
case RPORT_ST_ADISC:
fc_rport_enter_adisc(rdata);
break;
Expand Down Expand Up @@ -547,7 +543,6 @@ static void fc_rport_error(struct fc_rport_priv *rdata, struct fc_frame *fp)
switch (rdata->rp_state) {
case RPORT_ST_FLOGI:
case RPORT_ST_PLOGI:
case RPORT_ST_LOGO:
rdata->flags &= ~FC_RP_STARTED;
fc_rport_enter_delete(rdata, RPORT_EV_FAILED);
break;
Expand Down Expand Up @@ -791,7 +786,6 @@ static void fc_rport_recv_flogi_req(struct fc_lport *lport,

switch (rdata->rp_state) {
case RPORT_ST_INIT:
case RPORT_ST_LOGO:
case RPORT_ST_DELETE:
mutex_unlock(&rdata->rp_mutex);
rjt_data.reason = ELS_RJT_FIP;
Expand Down Expand Up @@ -1036,52 +1030,6 @@ static void fc_rport_prli_resp(struct fc_seq *sp, struct fc_frame *fp,
kref_put(&rdata->kref, rdata->local_port->tt.rport_destroy);
}

/**
* fc_rport_logo_resp() - Handler for logout (LOGO) responses
* @sp: The sequence the LOGO was on
* @fp: The LOGO response frame
* @rdata_arg: The remote port that sent the LOGO response
*
* Locking Note: This function will be called without the rport lock
* held, but it will lock, call an _enter_* function or fc_rport_error
* and then unlock the rport.
*/
static void fc_rport_logo_resp(struct fc_seq *sp, struct fc_frame *fp,
void *rdata_arg)
{
struct fc_rport_priv *rdata = rdata_arg;
u8 op;

mutex_lock(&rdata->rp_mutex);

FC_RPORT_DBG(rdata, "Received a LOGO %s\n", fc_els_resp_type(fp));

if (rdata->rp_state != RPORT_ST_LOGO) {
FC_RPORT_DBG(rdata, "Received a LOGO response, but in state "
"%s\n", fc_rport_state(rdata));
if (IS_ERR(fp))
goto err;
goto out;
}

if (IS_ERR(fp)) {
fc_rport_error_retry(rdata, fp);
goto err;
}

op = fc_frame_payload_op(fp);
if (op != ELS_LS_ACC)
FC_RPORT_DBG(rdata, "Bad ELS response op %x for LOGO command\n",
op);
fc_rport_enter_delete(rdata, RPORT_EV_LOGO);

out:
fc_frame_free(fp);
err:
mutex_unlock(&rdata->rp_mutex);
kref_put(&rdata->kref, rdata->local_port->tt.rport_destroy);
}

/**
* fc_rport_enter_prli() - Send Process Login (PRLI) request
* @rdata: The remote port to send the PRLI request to
Expand Down Expand Up @@ -1223,6 +1171,24 @@ static void fc_rport_enter_rtv(struct fc_rport_priv *rdata)
kref_get(&rdata->kref);
}

/**
* fc_rport_logo_resp() - Handler for logout (LOGO) responses
* @sp: The sequence the LOGO was on
* @fp: The LOGO response frame
* @lport_arg: The local port
*/
static void fc_rport_logo_resp(struct fc_seq *sp, struct fc_frame *fp,
void *lport_arg)
{
struct fc_lport *lport = lport_arg;

FC_RPORT_ID_DBG(lport, fc_seq_exch(sp)->did,
"Received a LOGO %s\n", fc_els_resp_type(fp));
if (IS_ERR(fp))
return;
fc_frame_free(fp);
}

/**
* fc_rport_enter_logo() - Send a logout (LOGO) request
* @rdata: The remote port to send the LOGO request to
Expand All @@ -1235,23 +1201,14 @@ static void fc_rport_enter_logo(struct fc_rport_priv *rdata)
struct fc_lport *lport = rdata->local_port;
struct fc_frame *fp;

FC_RPORT_DBG(rdata, "Port entered LOGO state from %s state\n",
FC_RPORT_DBG(rdata, "Port sending LOGO from %s state\n",
fc_rport_state(rdata));

fc_rport_state_enter(rdata, RPORT_ST_LOGO);

fp = fc_frame_alloc(lport, sizeof(struct fc_els_logo));
if (!fp) {
fc_rport_error_retry(rdata, fp);
if (!fp)
return;
}

if (!lport->tt.elsct_send(lport, rdata->ids.port_id, fp, ELS_LOGO,
fc_rport_logo_resp, rdata,
2 * lport->r_a_tov))
fc_rport_error_retry(rdata, NULL);
else
kref_get(&rdata->kref);
(void)lport->tt.elsct_send(lport, rdata->ids.port_id, fp, ELS_LOGO,
fc_rport_logo_resp, lport, 0);
}

/**
Expand Down Expand Up @@ -1670,7 +1627,6 @@ static void fc_rport_recv_plogi_req(struct fc_lport *lport,
break;
case RPORT_ST_FLOGI:
case RPORT_ST_DELETE:
case RPORT_ST_LOGO:
FC_RPORT_DBG(rdata, "Received PLOGI in state %s - send busy\n",
fc_rport_state(rdata));
mutex_unlock(&rdata->rp_mutex);
Expand Down
2 changes: 0 additions & 2 deletions trunk/include/scsi/libfc.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ enum fc_disc_event {
* @RPORT_ST_PRLI: Waiting for PRLI completion
* @RPORT_ST_RTV: Waiting for RTV completion
* @RPORT_ST_READY: Ready for use
* @RPORT_ST_LOGO: Remote port logout (LOGO) sent
* @RPORT_ST_ADISC: Discover Address sent
* @RPORT_ST_DELETE: Remote port being deleted
*/
Expand All @@ -115,7 +114,6 @@ enum fc_rport_state {
RPORT_ST_PRLI,
RPORT_ST_RTV,
RPORT_ST_READY,
RPORT_ST_LOGO,
RPORT_ST_ADISC,
RPORT_ST_DELETE,
};
Expand Down

0 comments on commit 422d377

Please sign in to comment.