aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/libfc/fc_lport.c
diff options
context:
space:
mode:
authorJoe Eykholt <jeykholt@cisco.com>2009-08-25 17:00:50 -0400
committerJames Bottomley <James.Bottomley@suse.de>2009-09-10 13:07:41 -0400
commit9fb9d32831fd687e427ec5b147bb690f468b99a0 (patch)
treec3b6c29cb94040718ea2fe00daac05abf10db714 /drivers/scsi/libfc/fc_lport.c
parent922aa210bcad4b34a7bb98ec9d318b7e59e7a5ca (diff)
[SCSI] libfc: make fc_rport_priv the primary rport interface.
The rport and discovery modules deal with remote ports before fc_remote_port_add() can be done, because the full set of rport identifiers is not known at early stages. In preparation for splitting the fc_rport/fc_rport_priv allocation, make fc_rport_priv the primary interface for the remote port and discovery engines. The FCP / SCSI layers still deal with fc_rport and fc_rport_libfc_priv, however. Signed-off-by: Joe Eykholt <jeykholt@cisco.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/libfc/fc_lport.c')
-rw-r--r--drivers/scsi/libfc/fc_lport.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/drivers/scsi/libfc/fc_lport.c b/drivers/scsi/libfc/fc_lport.c
index a78161cf1811..3c15abd35ffa 100644
--- a/drivers/scsi/libfc/fc_lport.c
+++ b/drivers/scsi/libfc/fc_lport.c
@@ -133,16 +133,18 @@ static int fc_frame_drop(struct fc_lport *lport, struct fc_frame *fp)
133/** 133/**
134 * fc_lport_rport_callback() - Event handler for rport events 134 * fc_lport_rport_callback() - Event handler for rport events
135 * @lport: The lport which is receiving the event 135 * @lport: The lport which is receiving the event
136 * @rport: The rport which the event has occured on 136 * @rdata: private remote port data
137 * @event: The event that occured 137 * @event: The event that occured
138 * 138 *
139 * Locking Note: The rport lock should not be held when calling 139 * Locking Note: The rport lock should not be held when calling
140 * this function. 140 * this function.
141 */ 141 */
142static void fc_lport_rport_callback(struct fc_lport *lport, 142static void fc_lport_rport_callback(struct fc_lport *lport,
143 struct fc_rport *rport, 143 struct fc_rport_priv *rdata,
144 enum fc_rport_event event) 144 enum fc_rport_event event)
145{ 145{
146 struct fc_rport *rport = PRIV_TO_RPORT(rdata);
147
146 FC_LPORT_DBG(lport, "Received a %d event for port (%6x)\n", event, 148 FC_LPORT_DBG(lport, "Received a %d event for port (%6x)\n", event,
147 rport->port_id); 149 rport->port_id);
148 150
@@ -151,7 +153,7 @@ static void fc_lport_rport_callback(struct fc_lport *lport,
151 if (rport->port_id == FC_FID_DIR_SERV) { 153 if (rport->port_id == FC_FID_DIR_SERV) {
152 mutex_lock(&lport->lp_mutex); 154 mutex_lock(&lport->lp_mutex);
153 if (lport->state == LPORT_ST_DNS) { 155 if (lport->state == LPORT_ST_DNS) {
154 lport->dns_rp = rport; 156 lport->dns_rp = rdata;
155 fc_lport_enter_rpn_id(lport); 157 fc_lport_enter_rpn_id(lport);
156 } else { 158 } else {
157 FC_LPORT_DBG(lport, "Received an CREATED event " 159 FC_LPORT_DBG(lport, "Received an CREATED event "
@@ -160,7 +162,7 @@ static void fc_lport_rport_callback(struct fc_lport *lport,
160 "in the DNS state, it's in the " 162 "in the DNS state, it's in the "
161 "%d state", rport->port_id, 163 "%d state", rport->port_id,
162 lport->state); 164 lport->state);
163 lport->tt.rport_logoff(rport); 165 lport->tt.rport_logoff(rdata);
164 } 166 }
165 mutex_unlock(&lport->lp_mutex); 167 mutex_unlock(&lport->lp_mutex);
166 } else 168 } else
@@ -832,7 +834,7 @@ static void fc_lport_recv_req(struct fc_lport *lport, struct fc_seq *sp,
832{ 834{
833 struct fc_frame_header *fh = fc_frame_header_get(fp); 835 struct fc_frame_header *fh = fc_frame_header_get(fp);
834 void (*recv) (struct fc_seq *, struct fc_frame *, struct fc_lport *); 836 void (*recv) (struct fc_seq *, struct fc_frame *, struct fc_lport *);
835 struct fc_rport *rport; 837 struct fc_rport_priv *rdata;
836 u32 s_id; 838 u32 s_id;
837 u32 d_id; 839 u32 d_id;
838 struct fc_seq_els_data rjt_data; 840 struct fc_seq_els_data rjt_data;
@@ -888,9 +890,9 @@ static void fc_lport_recv_req(struct fc_lport *lport, struct fc_seq *sp,
888 s_id = ntoh24(fh->fh_s_id); 890 s_id = ntoh24(fh->fh_s_id);
889 d_id = ntoh24(fh->fh_d_id); 891 d_id = ntoh24(fh->fh_d_id);
890 892
891 rport = lport->tt.rport_lookup(lport, s_id); 893 rdata = lport->tt.rport_lookup(lport, s_id);
892 if (rport) 894 if (rdata)
893 lport->tt.rport_recv_req(sp, fp, rport); 895 lport->tt.rport_recv_req(sp, fp, rdata);
894 else { 896 else {
895 rjt_data.fp = NULL; 897 rjt_data.fp = NULL;
896 rjt_data.reason = ELS_RJT_UNAB; 898 rjt_data.reason = ELS_RJT_UNAB;
@@ -1304,7 +1306,6 @@ static struct fc_rport_operations fc_lport_rport_ops = {
1304 */ 1306 */
1305static void fc_lport_enter_dns(struct fc_lport *lport) 1307static void fc_lport_enter_dns(struct fc_lport *lport)
1306{ 1308{
1307 struct fc_rport *rport;
1308 struct fc_rport_priv *rdata; 1309 struct fc_rport_priv *rdata;
1309 struct fc_rport_identifiers ids; 1310 struct fc_rport_identifiers ids;
1310 1311
@@ -1318,13 +1319,12 @@ static void fc_lport_enter_dns(struct fc_lport *lport)
1318 1319
1319 fc_lport_state_enter(lport, LPORT_ST_DNS); 1320 fc_lport_state_enter(lport, LPORT_ST_DNS);
1320 1321
1321 rport = lport->tt.rport_create(lport, &ids); 1322 rdata = lport->tt.rport_create(lport, &ids);
1322 if (!rport) 1323 if (!rdata)
1323 goto err; 1324 goto err;
1324 1325
1325 rdata = rport->dd_data;
1326 rdata->ops = &fc_lport_rport_ops; 1326 rdata->ops = &fc_lport_rport_ops;
1327 lport->tt.rport_login(rport); 1327 lport->tt.rport_login(rdata);
1328 return; 1328 return;
1329 1329
1330err: 1330err: