aboutsummaryrefslogtreecommitdiffstats
path: root/include/scsi
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 /include/scsi
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 'include/scsi')
-rw-r--r--include/scsi/fc_encode.h7
-rw-r--r--include/scsi/libfc.h26
2 files changed, 19 insertions, 14 deletions
diff --git a/include/scsi/fc_encode.h b/include/scsi/fc_encode.h
index a0ff61c3e935..3ede1abad4b7 100644
--- a/include/scsi/fc_encode.h
+++ b/include/scsi/fc_encode.h
@@ -249,10 +249,13 @@ static inline void fc_scr_fill(struct fc_lport *lport, struct fc_frame *fp)
249/** 249/**
250 * fc_els_fill - Fill in an ELS request frame 250 * fc_els_fill - Fill in an ELS request frame
251 */ 251 */
252static inline int fc_els_fill(struct fc_lport *lport, struct fc_rport *rport, 252static inline int fc_els_fill(struct fc_lport *lport,
253 struct fc_rport_priv *rdata,
253 struct fc_frame *fp, unsigned int op, 254 struct fc_frame *fp, unsigned int op,
254 enum fc_rctl *r_ctl, u32 *did, enum fc_fh_type *fh_type) 255 enum fc_rctl *r_ctl, u32 *did, enum fc_fh_type *fh_type)
255{ 256{
257 struct fc_rport *rport = PRIV_TO_RPORT(rdata);
258
256 switch (op) { 259 switch (op) {
257 case ELS_PLOGI: 260 case ELS_PLOGI:
258 fc_plogi_fill(lport, fp, ELS_PLOGI); 261 fc_plogi_fill(lport, fp, ELS_PLOGI);
@@ -272,7 +275,7 @@ static inline int fc_els_fill(struct fc_lport *lport, struct fc_rport *rport,
272 * is port logo, therefore 275 * is port logo, therefore
273 * set did to rport id. 276 * set did to rport id.
274 */ 277 */
275 if (rport) 278 if (rdata)
276 *did = rport->port_id; 279 *did = rport->port_id;
277 break; 280 break;
278 281
diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h
index 2fdd8ac12b89..df57cb762dc2 100644
--- a/include/scsi/libfc.h
+++ b/include/scsi/libfc.h
@@ -75,10 +75,10 @@ do { \
75 (lport)->host->host_no, \ 75 (lport)->host->host_no, \
76 (port_id), ##args)) 76 (port_id), ##args))
77 77
78#define FC_RPORT_DBG(rport, fmt, args...) \ 78#define FC_RPORT_DBG(rdata, fmt, args...) \
79do { \ 79do { \
80 struct fc_rport_priv *rdata = rport->dd_data; \
81 struct fc_lport *lport = rdata->local_port; \ 80 struct fc_lport *lport = rdata->local_port; \
81 struct fc_rport *rport = PRIV_TO_RPORT(rdata); \
82 FC_RPORT_ID_DBG(lport, rport->port_id, fmt, ##args); \ 82 FC_RPORT_ID_DBG(lport, rport->port_id, fmt, ##args); \
83} while (0) 83} while (0)
84 84
@@ -185,8 +185,10 @@ enum fc_rport_event {
185 */ 185 */
186#define fc_rport_priv fc_rport_libfc_priv 186#define fc_rport_priv fc_rport_libfc_priv
187 187
188struct fc_rport_priv;
189
188struct fc_rport_operations { 190struct fc_rport_operations {
189 void (*event_callback)(struct fc_lport *, struct fc_rport *, 191 void (*event_callback)(struct fc_lport *, struct fc_rport_priv *,
190 enum fc_rport_event); 192 enum fc_rport_event);
191}; 193};
192 194
@@ -422,7 +424,7 @@ struct libfc_function_template {
422 * STATUS: OPTIONAL 424 * STATUS: OPTIONAL
423 */ 425 */
424 struct fc_seq *(*elsct_send)(struct fc_lport *lport, 426 struct fc_seq *(*elsct_send)(struct fc_lport *lport,
425 struct fc_rport *rport, 427 struct fc_rport_priv *,
426 struct fc_frame *fp, 428 struct fc_frame *fp,
427 unsigned int op, 429 unsigned int op,
428 void (*resp)(struct fc_seq *, 430 void (*resp)(struct fc_seq *,
@@ -567,8 +569,8 @@ struct libfc_function_template {
567 /* 569 /*
568 * Create a remote port 570 * Create a remote port
569 */ 571 */
570 struct fc_rport *(*rport_create)(struct fc_lport *, 572 struct fc_rport_priv *(*rport_create)(struct fc_lport *,
571 struct fc_rport_identifiers *); 573 struct fc_rport_identifiers *);
572 574
573 /* 575 /*
574 * Initiates the RP state machine. It is called from the LP module. 576 * Initiates the RP state machine. It is called from the LP module.
@@ -581,7 +583,7 @@ struct libfc_function_template {
581 * 583 *
582 * STATUS: OPTIONAL 584 * STATUS: OPTIONAL
583 */ 585 */
584 int (*rport_login)(struct fc_rport *rport); 586 int (*rport_login)(struct fc_rport_priv *);
585 587
586 /* 588 /*
587 * Logoff, and remove the rport from the transport if 589 * Logoff, and remove the rport from the transport if
@@ -589,7 +591,7 @@ struct libfc_function_template {
589 * 591 *
590 * STATUS: OPTIONAL 592 * STATUS: OPTIONAL
591 */ 593 */
592 int (*rport_logoff)(struct fc_rport *rport); 594 int (*rport_logoff)(struct fc_rport_priv *);
593 595
594 /* 596 /*
595 * Recieve a request from a remote port. 597 * Recieve a request from a remote port.
@@ -597,14 +599,14 @@ struct libfc_function_template {
597 * STATUS: OPTIONAL 599 * STATUS: OPTIONAL
598 */ 600 */
599 void (*rport_recv_req)(struct fc_seq *, struct fc_frame *, 601 void (*rport_recv_req)(struct fc_seq *, struct fc_frame *,
600 struct fc_rport *); 602 struct fc_rport_priv *);
601 603
602 /* 604 /*
603 * lookup an rport by it's port ID. 605 * lookup an rport by it's port ID.
604 * 606 *
605 * STATUS: OPTIONAL 607 * STATUS: OPTIONAL
606 */ 608 */
607 struct fc_rport *(*rport_lookup)(const struct fc_lport *, u32); 609 struct fc_rport_priv *(*rport_lookup)(const struct fc_lport *, u32);
608 610
609 /* 611 /*
610 * Send a fcp cmd from fsp pkt. 612 * Send a fcp cmd from fsp pkt.
@@ -694,8 +696,8 @@ struct fc_lport {
694 /* Associations */ 696 /* Associations */
695 struct Scsi_Host *host; 697 struct Scsi_Host *host;
696 struct list_head ema_list; 698 struct list_head ema_list;
697 struct fc_rport *dns_rp; 699 struct fc_rport_priv *dns_rp;
698 struct fc_rport *ptp_rp; 700 struct fc_rport_priv *ptp_rp;
699 void *scsi_priv; 701 void *scsi_priv;
700 struct fc_disc disc; 702 struct fc_disc disc;
701 703