aboutsummaryrefslogtreecommitdiff
path: root/include/scsi
diff options
context:
space:
mode:
authorJoe Eykholt <jeykholt@cisco.com>2009-08-25 14:00:50 -0700
committerJames Bottomley <James.Bottomley@suse.de>2009-09-10 12:07:41 -0500
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 a0ff61c3e93..3ede1abad4b 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)
/**
* fc_els_fill - Fill in an ELS request frame
*/
-static inline int fc_els_fill(struct fc_lport *lport, struct fc_rport *rport,
+static inline int fc_els_fill(struct fc_lport *lport,
+ struct fc_rport_priv *rdata,
struct fc_frame *fp, unsigned int op,
enum fc_rctl *r_ctl, u32 *did, enum fc_fh_type *fh_type)
{
+ struct fc_rport *rport = PRIV_TO_RPORT(rdata);
+
switch (op) {
case ELS_PLOGI:
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,
* is port logo, therefore
* set did to rport id.
*/
- if (rport)
+ if (rdata)
*did = rport->port_id;
break;
diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h
index 2fdd8ac12b8..df57cb762dc 100644
--- a/include/scsi/libfc.h
+++ b/include/scsi/libfc.h
@@ -75,10 +75,10 @@ do { \
(lport)->host->host_no, \
(port_id), ##args))
-#define FC_RPORT_DBG(rport, fmt, args...) \
+#define FC_RPORT_DBG(rdata, fmt, args...) \
do { \
- struct fc_rport_priv *rdata = rport->dd_data; \
struct fc_lport *lport = rdata->local_port; \
+ struct fc_rport *rport = PRIV_TO_RPORT(rdata); \
FC_RPORT_ID_DBG(lport, rport->port_id, fmt, ##args); \
} while (0)
@@ -185,8 +185,10 @@ enum fc_rport_event {
*/
#define fc_rport_priv fc_rport_libfc_priv
+struct fc_rport_priv;
+
struct fc_rport_operations {
- void (*event_callback)(struct fc_lport *, struct fc_rport *,
+ void (*event_callback)(struct fc_lport *, struct fc_rport_priv *,
enum fc_rport_event);
};
@@ -422,7 +424,7 @@ struct libfc_function_template {
* STATUS: OPTIONAL
*/
struct fc_seq *(*elsct_send)(struct fc_lport *lport,
- struct fc_rport *rport,
+ struct fc_rport_priv *,
struct fc_frame *fp,
unsigned int op,
void (*resp)(struct fc_seq *,
@@ -567,8 +569,8 @@ struct libfc_function_template {
/*
* Create a remote port
*/
- struct fc_rport *(*rport_create)(struct fc_lport *,
- struct fc_rport_identifiers *);
+ struct fc_rport_priv *(*rport_create)(struct fc_lport *,
+ struct fc_rport_identifiers *);
/*
* Initiates the RP state machine. It is called from the LP module.
@@ -581,7 +583,7 @@ struct libfc_function_template {
*
* STATUS: OPTIONAL
*/
- int (*rport_login)(struct fc_rport *rport);
+ int (*rport_login)(struct fc_rport_priv *);
/*
* Logoff, and remove the rport from the transport if
@@ -589,7 +591,7 @@ struct libfc_function_template {
*
* STATUS: OPTIONAL
*/
- int (*rport_logoff)(struct fc_rport *rport);
+ int (*rport_logoff)(struct fc_rport_priv *);
/*
* Recieve a request from a remote port.
@@ -597,14 +599,14 @@ struct libfc_function_template {
* STATUS: OPTIONAL
*/
void (*rport_recv_req)(struct fc_seq *, struct fc_frame *,
- struct fc_rport *);
+ struct fc_rport_priv *);
/*
* lookup an rport by it's port ID.
*
* STATUS: OPTIONAL
*/
- struct fc_rport *(*rport_lookup)(const struct fc_lport *, u32);
+ struct fc_rport_priv *(*rport_lookup)(const struct fc_lport *, u32);
/*
* Send a fcp cmd from fsp pkt.
@@ -694,8 +696,8 @@ struct fc_lport {
/* Associations */
struct Scsi_Host *host;
struct list_head ema_list;
- struct fc_rport *dns_rp;
- struct fc_rport *ptp_rp;
+ struct fc_rport_priv *dns_rp;
+ struct fc_rport_priv *ptp_rp;
void *scsi_priv;
struct fc_disc disc;