[Open-FCoE] [RFC PATCH 3/4] bnx2fc: use fcoe_port structure instead of bnx2fc_port

Bhanu Gollapudi bprakash at broadcom.com
Fri Jan 21 02:56:30 UTC 2011


Use fcoe_port that was moved to libfcoe instead of defining driver specific
port structure.

Signed-off-by: Nithin Nayak Sujir <nsujir at broadcom.com>
Signed-off-by: Bhanu Prakash Gollapudi <bprakash at broadcom.com>
---
 drivers/scsi/bnx2fc/bnx2fc.h      |   20 +++--------
 drivers/scsi/bnx2fc/bnx2fc_els.c  |    8 ++--
 drivers/scsi/bnx2fc/bnx2fc_fcoe.c |   66 ++++++++++++++++++------------------
 drivers/scsi/bnx2fc/bnx2fc_hwi.c  |   33 +++++++++---------
 drivers/scsi/bnx2fc/bnx2fc_io.c   |   30 ++++++++--------
 drivers/scsi/bnx2fc/bnx2fc_tgt.c  |   24 +++++++-------
 6 files changed, 86 insertions(+), 95 deletions(-)

diff --git a/drivers/scsi/bnx2fc/bnx2fc.h b/drivers/scsi/bnx2fc/bnx2fc.h
index d96acb6..95f9a5c 100644
--- a/drivers/scsi/bnx2fc/bnx2fc.h
+++ b/drivers/scsi/bnx2fc/bnx2fc.h
@@ -226,16 +226,6 @@ struct bnx2fc_hba {
 	struct completion stat_req_done;
 };
 
-struct bnx2fc_port {
-	struct bnx2fc_hba *hba;
-	struct fc_lport *lport;
-	struct timer_list timer;
-	struct work_struct destroy_work;
-	struct sk_buff_head fcoe_pending_queue;
-	u8 fcoe_pending_queue_active;
-	u8 data_src_addr[ETH_ALEN];
-};
-
 #define bnx2fc_from_ctlr(fip) container_of(fip, struct bnx2fc_hba, ctlr)
 
 struct bnx2fc_cmd_mgr {
@@ -248,7 +238,7 @@ struct bnx2fc_cmd_mgr {
 };
 
 struct bnx2fc_rport {
-	struct bnx2fc_port *port;
+	struct fcoe_port *port;
 	struct fc_rport *rport;
 	struct fc_rport_priv *rdata;
 	void __iomem *ctx_base;
@@ -378,7 +368,7 @@ struct bnx2fc_cmd {
 #define BNX2FC_CLEANUP			5
 	u8 io_req_flags;
 	struct kref refcount;
-	struct bnx2fc_port *port;
+	struct fcoe_port *port;
 	struct bnx2fc_rport *tgt;
 	struct scsi_cmnd *sc_cmd;
 	struct bnx2fc_cmd_mgr *cmd_mgr;
@@ -434,9 +424,9 @@ void bnx2fc_cmd_release(struct kref *ref);
 int bnx2fc_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *sc_cmd);
 int bnx2fc_send_fw_fcoe_init_msg(struct bnx2fc_hba *hba);
 int bnx2fc_send_fw_fcoe_destroy_msg(struct bnx2fc_hba *hba);
-int bnx2fc_send_session_ofld_req(struct bnx2fc_port *port,
+int bnx2fc_send_session_ofld_req(struct fcoe_port *port,
 					struct bnx2fc_rport *tgt);
-int bnx2fc_send_session_disable_req(struct bnx2fc_port *port,
+int bnx2fc_send_session_disable_req(struct fcoe_port *port,
 				    struct bnx2fc_rport *tgt);
 int bnx2fc_send_session_destroy_req(struct bnx2fc_hba *hba,
 					struct bnx2fc_rport *tgt);
@@ -510,7 +500,7 @@ struct fc_seq *bnx2fc_elsct_send(struct fc_lport *lport, u32 did,
 				      void *arg, u32 timeout);
 int bnx2fc_process_new_cqes(struct bnx2fc_rport *tgt);
 void bnx2fc_process_cq_compl(struct bnx2fc_rport *tgt, u16 wqe);
-struct bnx2fc_rport *bnx2fc_tgt_lookup(struct bnx2fc_port *port,
+struct bnx2fc_rport *bnx2fc_tgt_lookup(struct fcoe_port *port,
 					     u32 port_id);
 void bnx2fc_process_l2_frame_compl(struct bnx2fc_rport *tgt,
 				   unsigned char *buf,
diff --git a/drivers/scsi/bnx2fc/bnx2fc_els.c b/drivers/scsi/bnx2fc/bnx2fc_els.c
index 208f929..de54cbf 100644
--- a/drivers/scsi/bnx2fc/bnx2fc_els.c
+++ b/drivers/scsi/bnx2fc/bnx2fc_els.c
@@ -245,8 +245,8 @@ static int bnx2fc_initiate_els(struct bnx2fc_rport *tgt, unsigned int op,
 			void (*cb_func)(struct bnx2fc_els_cb_arg *cb_arg),
 			struct bnx2fc_els_cb_arg *cb_arg, u32 timer_msec)
 {
-	struct bnx2fc_port *port = tgt->port;
-	struct bnx2fc_hba *hba = port->hba;
+	struct fcoe_port *port = tgt->port;
+	struct bnx2fc_hba *hba = port->priv;
 	struct fc_rport *rport = tgt->rport;
 	struct fc_lport *lport = port->lport;
 	struct bnx2fc_cmd *els_req;
@@ -476,8 +476,8 @@ struct fc_seq *bnx2fc_elsct_send(struct fc_lport *lport, u32 did,
 						   void *),
 				      void *arg, u32 timeout)
 {
-	struct bnx2fc_port *port = lport_priv(lport);
-	struct bnx2fc_hba *hba = port->hba;
+	struct fcoe_port *port = lport_priv(lport);
+	struct bnx2fc_hba *hba = port->priv;
 	struct fcoe_ctlr *fip = &hba->ctlr;
 	struct fc_frame_header *fh = fc_frame_header_get(fp);
 
diff --git a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
index f52efea..e9af99b 100644
--- a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
+++ b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
@@ -122,7 +122,7 @@ static void bnx2fc_queue_timer(ulong lport)
 
 static void bnx2fc_clean_pending_queue(struct fc_lport *lp)
 {
-	struct bnx2fc_port *port;
+	struct fcoe_port *port;
 	struct sk_buff *skb;
 	port = lport_priv(lp);
 
@@ -137,7 +137,7 @@ static void bnx2fc_clean_pending_queue(struct fc_lport *lp)
 
 static void bnx2fc_check_wait_queue(struct fc_lport *lp, struct sk_buff *skb)
 {
-	struct bnx2fc_port *port = lport_priv(lp);
+	struct fcoe_port *port = lport_priv(lp);
 	int rc = 0;
 
 	spin_lock_bh(&port->fcoe_pending_queue.lock);
@@ -222,8 +222,8 @@ static void bnx2fc_abort_io(struct fc_lport *lport)
 
 static void bnx2fc_cleanup(struct fc_lport *lport)
 {
-	struct bnx2fc_port *port = lport_priv(lport);
-	struct bnx2fc_hba *hba = port->hba;
+	struct fcoe_port *port = lport_priv(lport);
+	struct bnx2fc_hba *hba = port->priv;
 	struct bnx2fc_rport *tgt;
 	int i;
 
@@ -298,7 +298,7 @@ static int bnx2fc_xmit(struct fc_lport *lport, struct fc_frame *fp)
 	struct sk_buff		*skb;
 	struct fc_frame_header	*fh;
 	struct bnx2fc_hba	*hba;
-	struct bnx2fc_port	*port;
+	struct fcoe_port	*port;
 	struct fcoe_hdr		*hp;
 	struct bnx2fc_rport	*tgt;
 	struct fcoe_dev_stats	*stats;
@@ -307,8 +307,8 @@ static int bnx2fc_xmit(struct fc_lport *lport, struct fc_frame *fp)
 	unsigned int		hlen, tlen, elen;
 	int			wlen, rc = 0;
 
-	port = (struct bnx2fc_port *)lport_priv(lport);
-	hba = port->hba;
+	port = (struct fcoe_port *)lport_priv(lport);
+	hba = port->priv;
 
 	fh = fc_frame_header_get(fp);
 
@@ -539,7 +539,7 @@ static void bnx2fc_recv_frame(struct sk_buff *skb)
 	struct fcoe_crc_eof crc_eof;
 	struct fc_frame *fp;
 	struct fc_lport *vn_port;
-	struct bnx2fc_port *port;
+	struct fcoe_port *port;
 	u8 *mac = NULL;
 	u8 *dest_mac = NULL;
 	struct fcoe_hdr *hp;
@@ -661,8 +661,8 @@ static struct fc_host_statistics *bnx2fc_get_host_stats(struct Scsi_Host *shost)
 {
 	struct fc_host_statistics *bnx2fc_stats;
 	struct fc_lport *lport = shost_priv(shost);
-	struct bnx2fc_port *port = lport_priv(lport);
-	struct bnx2fc_hba *hba = port->hba;
+	struct fcoe_port *port = lport_priv(lport);
+	struct bnx2fc_hba *hba = port->priv;
 	struct fcoe_statistics_params *fw_stats;
 	int rc = 0;
 
@@ -694,8 +694,8 @@ static struct fc_host_statistics *bnx2fc_get_host_stats(struct Scsi_Host *shost)
 
 static int bnx2fc_shost_config(struct fc_lport *lport, struct device *dev)
 {
-	struct bnx2fc_port *port = lport_priv(lport);
-	struct bnx2fc_hba *hba = port->hba;
+	struct fcoe_port *port = lport_priv(lport);
+	struct bnx2fc_hba *hba = port->priv;
 	struct Scsi_Host *shost = lport->host;
 	int rc = 0;
 
@@ -725,8 +725,8 @@ static int bnx2fc_shost_config(struct fc_lport *lport, struct device *dev)
 
 static int bnx2fc_link_ok(struct fc_lport *lport)
 {
-	struct bnx2fc_port *port = lport_priv(lport);
-	struct bnx2fc_hba *hba = port->hba;
+	struct fcoe_port *port = lport_priv(lport);
+	struct bnx2fc_hba *hba = port->priv;
 	struct net_device *dev = hba->phys_dev;
 	struct ethtool_cmd ecmd = { ETHTOOL_GSET };
 	int rc = 0;
@@ -776,13 +776,13 @@ static int bnx2fc_net_config(struct fc_lport *lport)
 {
 	struct bnx2fc_hba *hba;
 	struct net_device *netdev;
-	struct bnx2fc_port *port;
+	struct fcoe_port *port;
 	u32 mfs;
 	u32 max_mfs;
 	u64 wwnn, wwpn;
 
 	port = lport_priv(lport);
-	hba = port->hba;
+	hba = port->priv;
 	netdev = hba->netdev;
 
 	/* require support for get_pauseparam ethtool op. */
@@ -962,8 +962,8 @@ static int bnx2fc_libfc_config(struct fc_lport *lport)
 
 static int bnx2fc_em_config(struct fc_lport *lport)
 {
-	struct bnx2fc_port *port = lport_priv(lport);
-	struct bnx2fc_hba *hba = port->hba;
+	struct fcoe_port *port = lport_priv(lport);
+	struct bnx2fc_hba *hba = port->priv;
 
 	if (!fc_exch_mgr_alloc(lport, FC_CLASS_3, FCOE_MIN_XID,
 				FCOE_MAX_XID, NULL)) {
@@ -1043,7 +1043,7 @@ static int bnx2fc_fip_recv(struct sk_buff *skb, struct net_device *dev,
  */
 static void bnx2fc_update_src_mac(struct fc_lport *lport, u8 *addr)
 {
-	struct bnx2fc_port *port = lport_priv(lport);
+	struct fcoe_port *port = lport_priv(lport);
 
 	memcpy(port->data_src_addr, addr, ETH_ALEN);
 }
@@ -1055,9 +1055,9 @@ static void bnx2fc_update_src_mac(struct fc_lport *lport, u8 *addr)
  */
 static u8 *bnx2fc_get_src_mac(struct fc_lport *lport)
 {
-	struct bnx2fc_port *port;
+	struct fcoe_port *port;
 
-	port = (struct bnx2fc_port *)lport_priv(lport);
+	port = (struct fcoe_port *)lport_priv(lport);
 	return port->data_src_addr;
 }
 
@@ -1077,8 +1077,8 @@ static int bnx2fc_vport_create(struct fc_vport *vport, bool disabled)
 {
 	struct Scsi_Host *shost = vport_to_shost(vport);
 	struct fc_lport *n_port = shost_priv(shost);
-	struct bnx2fc_port *port = lport_priv(n_port);
-	struct bnx2fc_hba *hba = port->hba;
+	struct fcoe_port *port = lport_priv(n_port);
+	struct bnx2fc_hba *hba = port->priv;
 	struct net_device *netdev = hba->netdev;
 	struct fc_lport *vn_port;
 
@@ -1112,7 +1112,7 @@ static int bnx2fc_vport_destroy(struct fc_vport *vport)
 	struct Scsi_Host *shost = vport_to_shost(vport);
 	struct fc_lport *n_port = shost_priv(shost);
 	struct fc_lport *vn_port = vport->dd_data;
-	struct bnx2fc_port *port = lport_priv(vn_port);
+	struct fcoe_port *port = lport_priv(vn_port);
 
 	mutex_lock(&n_port->lp_mutex);
 	list_del(&vn_port->list);
@@ -1346,7 +1346,7 @@ static struct fc_lport *bnx2fc_if_create(struct bnx2fc_hba *hba,
 				  struct device *parent, int npiv)
 {
 	struct fc_lport		*lport = NULL;
-	struct bnx2fc_port	*port;
+	struct fcoe_port	*port;
 	struct Scsi_Host	*shost;
 	struct fc_vport		*vport = dev_to_vport(parent);
 	int			rc = 0;
@@ -1354,10 +1354,10 @@ static struct fc_lport *bnx2fc_if_create(struct bnx2fc_hba *hba,
 	/* Allocate Scsi_Host structure */
 	if (!npiv) {
 		lport = libfc_host_alloc(&bnx2fc_shost_template,
-					  sizeof(struct bnx2fc_port));
+					  sizeof(struct fcoe_port));
 	} else {
 		lport = libfc_vport_create(vport,
-					   sizeof(struct bnx2fc_port));
+					   sizeof(struct fcoe_port));
 	}
 
 	if (!lport) {
@@ -1367,10 +1367,10 @@ static struct fc_lport *bnx2fc_if_create(struct bnx2fc_hba *hba,
 	shost = lport->host;
 	port = lport_priv(lport);
 	port->lport = lport;
-	port->hba = hba;
+	port->priv = hba;
 	INIT_WORK(&port->destroy_work, bnx2fc_destroy_work);
 
-	/* Configure bnx2fc_port */
+	/* Configure fcoe_port */
 	rc = bnx2fc_lport_config(lport);
 	if (rc)
 		goto lp_config_err;
@@ -1433,8 +1433,8 @@ static void bnx2fc_netdev_cleanup(struct bnx2fc_hba *hba)
 
 static void bnx2fc_if_destroy(struct fc_lport *lport)
 {
-	struct bnx2fc_port *port = lport_priv(lport);
-	struct bnx2fc_hba *hba = port->hba;
+	struct fcoe_port *port = lport_priv(lport);
+	struct bnx2fc_hba *hba = port->priv;
 
 	BNX2FC_HBA_DBG(hba->ctlr.lp, "ENTERED bnx2fc_if_destroy\n");
 	/* Stop the transmit retry timer */
@@ -1532,10 +1532,10 @@ netdev_err:
 
 static void bnx2fc_destroy_work(struct work_struct *work)
 {
-	struct bnx2fc_port *port;
+	struct fcoe_port *port;
 	struct fc_lport *lport;
 
-	port = container_of(work, struct bnx2fc_port, destroy_work);
+	port = container_of(work, struct fcoe_port, destroy_work);
 	lport = port->lport;
 
 	BNX2FC_HBA_DBG(lport, "Entered bnx2fc_destroy_work\n");
diff --git a/drivers/scsi/bnx2fc/bnx2fc_hwi.c b/drivers/scsi/bnx2fc/bnx2fc_hwi.c
index 6030114..cf56e44 100644
--- a/drivers/scsi/bnx2fc/bnx2fc_hwi.c
+++ b/drivers/scsi/bnx2fc/bnx2fc_hwi.c
@@ -157,11 +157,11 @@ int bnx2fc_send_fw_fcoe_destroy_msg(struct bnx2fc_hba *hba)
  * @port:		port structure pointer
  * @tgt:		bnx2fc_rport structure pointer
  */
-int bnx2fc_send_session_ofld_req(struct bnx2fc_port *port,
+int bnx2fc_send_session_ofld_req(struct fcoe_port *port,
 					struct bnx2fc_rport *tgt)
 {
 	struct fc_lport *lport = port->lport;
-	struct bnx2fc_hba *hba = port->hba;
+	struct bnx2fc_hba *hba = port->priv;
 	struct kwqe *kwqe_arr[4];
 	struct fcoe_kwqe_conn_offload1 ofld_req1;
 	struct fcoe_kwqe_conn_offload2 ofld_req2;
@@ -327,11 +327,11 @@ int bnx2fc_send_session_ofld_req(struct bnx2fc_port *port,
  * @port:		port structure pointer
  * @tgt:		bnx2fc_rport structure pointer
  */
-static int bnx2fc_send_session_enable_req(struct bnx2fc_port *port,
+static int bnx2fc_send_session_enable_req(struct fcoe_port *port,
 					struct bnx2fc_rport *tgt)
 {
 	struct kwqe *kwqe_arr[2];
-	struct bnx2fc_hba *hba = port->hba;
+	struct bnx2fc_hba *hba = port->priv;
 	struct fcoe_kwqe_conn_enable_disable enbl_req;
 	struct fc_lport *lport = port->lport;
 	struct fc_rport *rport = tgt->rport;
@@ -394,10 +394,10 @@ static int bnx2fc_send_session_enable_req(struct bnx2fc_port *port,
  * @port:		port structure pointer
  * @tgt:		bnx2fc_rport structure pointer
  */
-int bnx2fc_send_session_disable_req(struct bnx2fc_port *port,
+int bnx2fc_send_session_disable_req(struct fcoe_port *port,
 				    struct bnx2fc_rport *tgt)
 {
-	struct bnx2fc_hba *hba = port->hba;
+	struct bnx2fc_hba *hba = port->priv;
 	struct fcoe_kwqe_conn_enable_disable disable_req;
 	struct kwqe *kwqe_arr[2];
 	struct fc_rport *rport = tgt->rport;
@@ -484,8 +484,8 @@ void bnx2fc_process_l2_frame_compl(struct bnx2fc_rport *tgt,
 				   unsigned char *buf,
 				   u32 frame_len, u16 l2_oxid)
 {
-	struct bnx2fc_port *port = tgt->port;
-	struct bnx2fc_hba *hba = port->hba;
+	struct fcoe_port *port = tgt->port;
+	struct bnx2fc_hba *hba = port->priv;
 	struct fc_lport *lport = port->lport;
 	struct fc_frame *fp;
 	struct fc_frame_header *fh;
@@ -637,7 +637,7 @@ static void bnx2fc_process_unsol_compl(struct bnx2fc_rport *tgt, u16 wqe)
 	u32 frame_len, len;
 	struct bnx2fc_cmd *io_req = NULL;
 	struct fcoe_task_ctx_entry *task, *task_page;
-	struct bnx2fc_hba *hba = tgt->port->hba;
+	struct bnx2fc_hba *hba = tgt->port->priv;
 	int task_idx, index;
 	int rc = 0;
 
@@ -773,8 +773,8 @@ void bnx2fc_process_cq_compl(struct bnx2fc_rport *tgt, u16 wqe)
 {
 	struct fcoe_task_ctx_entry *task;
 	struct fcoe_task_ctx_entry *task_page;
-	struct bnx2fc_port *port = tgt->port;
-	struct bnx2fc_hba *hba = port->hba;
+	struct fcoe_port *port = tgt->port;
+	struct bnx2fc_hba *hba = port->priv;
 	struct bnx2fc_cmd *io_req;
 	int task_idx, index;
 	u16 xid;
@@ -1000,7 +1000,7 @@ static void bnx2fc_process_ofld_cmpl(struct bnx2fc_hba *hba,
 					struct fcoe_kcqe *ofld_kcqe)
 {
 	struct bnx2fc_rport		*tgt;
-	struct bnx2fc_port		*port;
+	struct fcoe_port		*port;
 	u32				conn_id;
 	u32				context_id;
 	int				rc;
@@ -1015,7 +1015,7 @@ static void bnx2fc_process_ofld_cmpl(struct bnx2fc_hba *hba,
 	BNX2FC_TGT_DBG(tgt, "Entered ofld compl - context_id = 0x%x\n",
 		ofld_kcqe->fcoe_conn_context_id);
 	port = tgt->port;
-	if (hba != tgt->port->hba) {
+	if (hba != tgt->port->priv) {
 		printk(KERN_ALERT PFX "ERROR:ofld_cmpl: HBA mis-match\n");
 		goto ofld_cmpl_err;
 	}
@@ -1082,7 +1082,7 @@ static void bnx2fc_process_enable_conn_cmpl(struct bnx2fc_hba *hba,
 		printk(KERN_ALERT PFX "context id mis-match\n");
 		return;
 	}
-	if (hba != tgt->port->hba) {
+	if (hba != tgt->port->priv) {
 		printk(KERN_ALERT PFX "bnx2fc-enbl_cmpl: HBA mis-match\n");
 		goto enbl_cmpl_err;
 	}
@@ -1302,11 +1302,12 @@ void bnx2fc_ring_doorbell(struct bnx2fc_rport *tgt)
 void bnx2fc_map_doorbell(struct bnx2fc_rport *tgt)
 {
 	u32 context_id = tgt->context_id;
-	struct bnx2fc_port *port = tgt->port;
+	struct fcoe_port *port = tgt->port;
 	u32 reg_off;
 	resource_size_t reg_base;
+	struct bnx2fc_hba *hba = port->priv;
 
-	reg_base = pci_resource_start(port->hba->pcidev,
+	reg_base = pci_resource_start(hba->pcidev,
 					BNX2X_DOORBELL_PCI_BAR);
 	reg_off = BNX2FC_5771X_DB_PAGE_SIZE *
 			(context_id & 0x1FFFF) + DPM_TRIGER_TYPE;
diff --git a/drivers/scsi/bnx2fc/bnx2fc_io.c b/drivers/scsi/bnx2fc/bnx2fc_io.c
index 6e354c3..c5ac442 100644
--- a/drivers/scsi/bnx2fc/bnx2fc_io.c
+++ b/drivers/scsi/bnx2fc/bnx2fc_io.c
@@ -26,7 +26,7 @@ static void bnx2fc_parse_fcp_rsp(struct bnx2fc_cmd *io_req,
 void bnx2fc_cmd_timer_set(struct bnx2fc_cmd *io_req,
 			  unsigned int timer_msec)
 {
-	struct bnx2fc_hba *hba = io_req->port->hba;
+	struct bnx2fc_hba *hba = io_req->port->priv;
 
 	if (queue_delayed_work(hba->timer_work_queue, &io_req->timeout_work,
 				  msecs_to_jiffies(timer_msec)))
@@ -400,8 +400,8 @@ void bnx2fc_cmd_mgr_free(struct bnx2fc_cmd_mgr *cmgr)
 
 struct bnx2fc_cmd *bnx2fc_elstm_alloc(struct bnx2fc_rport *tgt, int type)
 {
-	struct bnx2fc_port *port = tgt->port;
-	struct bnx2fc_hba *hba = port->hba;
+	struct fcoe_port *port = tgt->port;
+	struct bnx2fc_hba *hba = port->priv;
 	struct bnx2fc_cmd_mgr *cmd_mgr = hba->cmd_mgr;
 	struct bnx2fc_cmd *io_req;
 	struct list_head *listp;
@@ -464,8 +464,8 @@ struct bnx2fc_cmd *bnx2fc_elstm_alloc(struct bnx2fc_rport *tgt, int type)
 }
 static struct bnx2fc_cmd *bnx2fc_cmd_alloc(struct bnx2fc_rport *tgt)
 {
-	struct bnx2fc_port *port = tgt->port;
-	struct bnx2fc_hba *hba = port->hba;
+	struct fcoe_port *port = tgt->port;
+	struct bnx2fc_hba *hba = port->priv;
 	struct bnx2fc_cmd_mgr *cmd_mgr = hba->cmd_mgr;
 	struct bnx2fc_cmd *io_req;
 	struct list_head *listp;
@@ -532,7 +532,7 @@ void bnx2fc_cmd_release(struct kref *ref)
 static void bnx2fc_free_mp_resc(struct bnx2fc_cmd *io_req)
 {
 	struct bnx2fc_mp_req *mp_req = &(io_req->mp_req);
-	struct bnx2fc_hba *hba = io_req->port->hba;
+	struct bnx2fc_hba *hba = io_req->port->priv;
 	size_t sz = sizeof(struct fcoe_bd_ctx);
 
 	/* clear tm flags */
@@ -568,7 +568,7 @@ int bnx2fc_init_mp_req(struct bnx2fc_cmd *io_req)
 	struct bnx2fc_mp_req *mp_req;
 	struct fcoe_bd_ctx *mp_req_bd;
 	struct fcoe_bd_ctx *mp_resp_bd;
-	struct bnx2fc_hba *hba = io_req->port->hba;
+	struct bnx2fc_hba *hba = io_req->port->priv;
 	dma_addr_t addr;
 	size_t sz;
 
@@ -643,7 +643,7 @@ static int bnx2fc_initiate_tmf(struct scsi_cmnd *sc_cmd, u8 tm_flags)
 	struct fc_lport *lport;
 	struct fc_rport *rport = starget_to_rport(scsi_target(sc_cmd->device));
 	struct fc_rport_libfc_priv *rp = rport->dd_data;
-	struct bnx2fc_port *port;
+	struct fcoe_port *port;
 	struct bnx2fc_hba *hba;
 	struct bnx2fc_rport *tgt;
 	struct bnx2fc_cmd *io_req;
@@ -661,7 +661,7 @@ static int bnx2fc_initiate_tmf(struct scsi_cmnd *sc_cmd, u8 tm_flags)
 
 	lport = shost_priv(host);
 	port = lport_priv(lport);
-	hba = port->hba;
+	hba = port->priv;
 
 	if (rport == NULL) {
 		printk(KERN_ALERT PFX "device_reset: rport is NULL\n");
@@ -787,7 +787,7 @@ int bnx2fc_initiate_abts(struct bnx2fc_cmd *io_req)
 	struct fc_rport *rport = tgt->rport;
 	struct fc_rport_priv *rdata = tgt->rdata;
 	struct bnx2fc_hba *hba;
-	struct bnx2fc_port *port;
+	struct fcoe_port *port;
 	struct bnx2fc_cmd *abts_io_req;
 	struct fcoe_task_ctx_entry *task;
 	struct fcoe_task_ctx_entry *task_page;
@@ -803,7 +803,7 @@ int bnx2fc_initiate_abts(struct bnx2fc_cmd *io_req)
 	BNX2FC_IO_DBG(io_req, "Entered bnx2fc_initiate_abts\n");
 
 	port = io_req->port;
-	hba = port->hba;
+	hba = port->priv;
 	lport = port->lport;
 
 	if (!test_bit(BNX2FC_FLAG_SESSION_READY, &tgt->flags)) {
@@ -893,7 +893,7 @@ int bnx2fc_initiate_cleanup(struct bnx2fc_cmd *io_req)
 	struct fc_lport *lport;
 	struct bnx2fc_rport *tgt = io_req->tgt;
 	struct bnx2fc_hba *hba;
-	struct bnx2fc_port *port;
+	struct fcoe_port *port;
 	struct bnx2fc_cmd *cleanup_io_req;
 	struct fcoe_task_ctx_entry *task;
 	struct fcoe_task_ctx_entry *task_page;
@@ -905,7 +905,7 @@ int bnx2fc_initiate_cleanup(struct bnx2fc_cmd *io_req)
 	BNX2FC_IO_DBG(io_req, "Entered bnx2fc_initiate_cleanup\n");
 
 	port = io_req->port;
-	hba = port->hba;
+	hba = port->priv;
 	lport = port->lport;
 
 	cleanup_io_req = bnx2fc_elstm_alloc(tgt, BNX2FC_CLEANUP);
@@ -1748,8 +1748,8 @@ static int bnx2fc_post_io_req(struct bnx2fc_rport *tgt,
 	struct fcoe_task_ctx_entry *task;
 	struct fcoe_task_ctx_entry *task_page;
 	struct scsi_cmnd *sc_cmd = io_req->sc_cmd;
-	struct bnx2fc_port *port = tgt->port;
-	struct bnx2fc_hba *hba = port->hba;
+	struct fcoe_port *port = tgt->port;
+	struct bnx2fc_hba *hba = port->priv;
 	int task_idx, index;
 	u16 xid;
 
diff --git a/drivers/scsi/bnx2fc/bnx2fc_tgt.c b/drivers/scsi/bnx2fc/bnx2fc_tgt.c
index f4c65b9..42b86f7 100644
--- a/drivers/scsi/bnx2fc/bnx2fc_tgt.c
+++ b/drivers/scsi/bnx2fc/bnx2fc_tgt.c
@@ -15,7 +15,7 @@
 static void bnx2fc_upld_timer(unsigned long data);
 static void bnx2fc_ofld_timer(unsigned long data);
 static int bnx2fc_init_tgt(struct bnx2fc_rport *tgt,
-			   struct bnx2fc_port *port,
+			   struct fcoe_port *port,
 			   struct fc_rport_priv *rdata);
 static u32 bnx2fc_alloc_conn_id(struct bnx2fc_hba *hba,
 				struct bnx2fc_rport *tgt);
@@ -59,13 +59,13 @@ static void bnx2fc_ofld_timer(unsigned long data)
 	wake_up_interruptible(&tgt->ofld_wait);
 }
 
-static void bnx2fc_offload_session(struct bnx2fc_port *port,
+static void bnx2fc_offload_session(struct fcoe_port *port,
 					struct bnx2fc_rport *tgt,
 					struct fc_rport_priv *rdata)
 {
 	struct fc_lport *lport = rdata->local_port;
 	struct fc_rport *rport = rdata->rport;
-	struct bnx2fc_hba *hba = port->hba;
+	struct bnx2fc_hba *hba = port->priv;
 	int rval;
 	int i = 0;
 
@@ -233,10 +233,10 @@ void bnx2fc_flush_active_ios(struct bnx2fc_rport *tgt)
 	spin_unlock_bh(&tgt->tgt_lock);
 }
 
-static void bnx2fc_upload_session(struct bnx2fc_port *port,
+static void bnx2fc_upload_session(struct fcoe_port *port,
 					struct bnx2fc_rport *tgt)
 {
-	struct bnx2fc_hba *hba = port->hba;
+	struct bnx2fc_hba *hba = port->priv;
 
 	BNX2FC_TGT_DBG(tgt, "upload_session: active_ios = %d\n",
 		tgt->num_active_ios.counter);
@@ -312,12 +312,12 @@ static void bnx2fc_upload_session(struct bnx2fc_port *port,
 }
 
 static int bnx2fc_init_tgt(struct bnx2fc_rport *tgt,
-			   struct bnx2fc_port *port,
+			   struct fcoe_port *port,
 			   struct fc_rport_priv *rdata)
 {
 
 	struct fc_rport *rport = rdata->rport;
-	struct bnx2fc_hba *hba = port->hba;
+	struct bnx2fc_hba *hba = port->priv;
 
 	tgt->rport = rport;
 	tgt->rdata = rdata;
@@ -372,8 +372,8 @@ void bnx2fc_rport_event_handler(struct fc_lport *lport,
 				struct fc_rport_priv *rdata,
 				enum fc_rport_event event)
 {
-	struct bnx2fc_port *port = lport_priv(lport);
-	struct bnx2fc_hba *hba = port->hba;
+	struct fcoe_port *port = lport_priv(lport);
+	struct bnx2fc_hba *hba = port->priv;
 	struct fc_rport *rport = rdata->rport;
 	struct fc_rport_libfc_priv *rp;
 	struct bnx2fc_rport *tgt;
@@ -513,13 +513,13 @@ void bnx2fc_rport_event_handler(struct fc_lport *lport,
 /**
  * bnx2fc_tgt_lookup() - Lookup a bnx2fc_rport by port_id
  *
- * @port:  bnx2fc_port struct to lookup the target port on
+ * @port:  fcoe_port struct to lookup the target port on
  * @port_id: The remote port ID to look up
  */
-struct bnx2fc_rport *bnx2fc_tgt_lookup(struct bnx2fc_port *port,
+struct bnx2fc_rport *bnx2fc_tgt_lookup(struct fcoe_port *port,
 					     u32 port_id)
 {
-	struct bnx2fc_hba *hba = port->hba;
+	struct bnx2fc_hba *hba = port->priv;
 	struct bnx2fc_rport *tgt;
 	struct fc_rport_priv *rdata;
 	int i;
-- 
1.7.0.6







More information about the devel mailing list