[Open-FCoE] [PATCH 7/7] Removed fc_port code

Vasu Dev vasu.dev at intel.com
Tue Apr 1 15:26:14 UTC 2008


Removed fc_port.[ch] files and all include of fc_port.h

Signed-off-by: Vasu Dev <vasu.dev at intel.com>
---

 drivers/scsi/ofc/include/fc_frame.h     |    1 
 drivers/scsi/ofc/include/fc_port.h      |  165 ---------------------
 drivers/scsi/ofc/openfc/Makefile        |    1 
 drivers/scsi/ofc/openfc/fc_disc_targ.c  |    1 
 drivers/scsi/ofc/openfc/fc_exch.c       |    1 
 drivers/scsi/ofc/openfc/fc_local_port.c |    1 
 drivers/scsi/ofc/openfc/fc_port.c       |  248 -------------------------------
 drivers/scsi/ofc/openfc/fc_sess.c       |    1 
 drivers/scsi/ofc/openfc/fcs_cmd.c       |    1 
 drivers/scsi/ofc/openfc/fcs_event.c     |    1 
 drivers/scsi/ofc/openfc/fcs_state.c     |    1 
 drivers/scsi/ofc/openfc/openfc_attr.c   |    1 
 drivers/scsi/ofc/openfc/openfc_if.c     |    1 
 drivers/scsi/ofc/openfc/openfc_pkt.c    |    1 
 drivers/scsi/ofc/openfc/openfc_scsi.c   |    1 
 15 files changed, 0 insertions(+), 426 deletions(-)

diff --git a/drivers/scsi/ofc/include/fc_frame.h b/drivers/scsi/ofc/include/fc_frame.h
index c0b3867..07c857e 100644
--- a/drivers/scsi/ofc/include/fc_frame.h
+++ b/drivers/scsi/ofc/include/fc_frame.h
@@ -28,7 +28,6 @@
 
 #include "fc_fs.h"
 #include "fc_encaps.h"
-#include "fc_port.h"
 #include "fcdev.h"
 
 #include <linux/scatterlist.h>
diff --git a/drivers/scsi/ofc/include/fc_port.h b/drivers/scsi/ofc/include/fc_port.h
deleted file mode 100644
index 9213687..0000000
--- a/drivers/scsi/ofc/include/fc_port.h
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * Copyright(c) 2007 Intel Corporation. All rights reserved.
- * 
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- * 
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
- * Maintained at www.Open-FCoE.org
- */
-
-#ifndef _LIBFC_PORT_H_
-#define _LIBFC_PORT_H_
-
-/*
- * Fibre Channel virtual switch ports.
- */
-#include "sa_event.h"
-#include "fc_event.h"
-
-struct fc_frame;
-
-/*
- * Port control functions.
- */
-enum fc_port_ctl {
-	FC_PCTL_NONE = 0,	/* unused */
-	FC_PCTL_GET_WWNN,	/* get node world wide name */
-	FC_PCTL_GET_WWPN,	/* get port world wide name */
-	FC_PCTL_GET_BBC,	/* get buffer-to-buffer credits */
-	FC_PCTL_SET_BBC,	/* set buffer-to-buffer credits */
-};
-
-/*
- * Port - egress and event handlers for packets using specific connection.
- *   Handle used by frames, sequences, and exchanges indicating where
- *   the sequence was received and where replies should be sent.
- */
-struct fc_port {
-	/*
-	 * Handler for packets received by this port from the transport below.
-	 */
-	void		(*np_ingress)(void *arg, struct fc_frame *);
-	void		*np_ingress_arg;	/* ingress argument */
-
-	/*
-	 * Handler for packets to be sent out of this port, e.g. from switch
-	 * or HBA driver.
-	 */
-	int		(*np_egress)(void *arg, struct fc_frame *);
-	void		*np_egress_arg;	/* egress argument */
-	int		(*np_egress_ctl)(void *arg, enum fc_port_ctl,
-					void *, size_t);
-
-	struct sa_event_list *np_events;
-	u_int32_t	np_max_frame;	/* max sending frame size for port */
-	int		np_ready;	/* port is usable */
-
-	struct fc_frame *(*np_frame_alloc)(size_t payload_len);
-};
-
-/*
- * methods.
- */
-struct fc_port *fc_port_alloc(void);
-
-void fc_port_free(struct fc_port *);
-
-/*
- * Set or get the max frame size for port.
- */
-void fc_port_set_max_frame_size(struct fc_port *, u_int);
-u_int fc_port_get_max_frame_size(struct fc_port *);
-
-/*
- * Send a frame out of the switch or end-point from the given port.
- * Returns non-zero if frame cannot be sent.
- * Always consumes the frame, regardless of error.
- */
-int fc_port_egress(struct fc_port *, struct fc_frame *);
-
-/*
- * Set egress handler - handles frames arriving at the port from inside switch.
- */
-void fc_port_set_egress(struct fc_port *,
-			int (*egress_func) (void *arg, struct fc_frame *),
-			void *arg);
-
-/*
- * Set ingress handler - handles frames arriving at the port from the wire.
- */
-void fc_port_set_ingress(struct fc_port *,
-			 void (*ingress_func) (void *arg, struct fc_frame *),
-			 void *arg);
-
-/*
- * Set event handler.
- */
-struct sa_event *fc_port_enq_handler(struct fc_port *,
-					sa_event_handler_t *, void *arg);
-
-/*
- * Unset event handler.
- */
-void fc_port_deq_handler(struct fc_port *, sa_event_handler_t *, void *arg);
-
-/*
- * Send event to a port's event handlers.
- */
-void fc_port_send_event(struct fc_port *, enum fc_event);
-
-/*
- * Send a Fibre Channel frame into a port.
- */
-void fc_port_ingress(struct fc_port *, struct fc_frame *);
-
-/*
- * Close port from ingress or egress side.
- */
-void fc_port_close_ingress(struct fc_port *);
-void fc_port_close_egress(struct fc_port *);
-
-/*
- * Get ingress or egress argument.
- */
-void *fc_port_get_ingress_arg(struct fc_port *);
-void *fc_port_get_egress_arg(struct fc_port *);
-
-/*
- * Return non-zero if port is usable for I/O.
- */
-int fc_port_ready(struct fc_port *);
-
-/*
- * Issue port control function.
- * Returns the number of bytes copied to buffer, or a negative error number.
- */
-int fc_port_egress_control(struct fc_port *,
-			   enum fc_port_ctl, void *buf, size_t len);
-
-/*
- * Setup port control handler.
- */
-void fc_port_set_egress_control(struct fc_port *,
-				int (*)(void *arg, enum fc_port_ctl,
-					void *, size_t));
-
-/*
- * Set frame allocation function for port.
- */
-static inline void fc_port_set_frame_alloc(struct fc_port *port,
-	struct fc_frame *(*fcn)(size_t))
-{
-	port->np_frame_alloc = fcn;
-}
-
-#endif /* _LIBFC_PORT_H_ */
diff --git a/drivers/scsi/ofc/openfc/Makefile b/drivers/scsi/ofc/openfc/Makefile
index 72d4786..88a7ead 100644
--- a/drivers/scsi/ofc/openfc/Makefile
+++ b/drivers/scsi/ofc/openfc/Makefile
@@ -11,7 +11,6 @@ openfc-objs := \
 	fc_exch.o \
 	fc_frame.o \
 	fc_local_port.o \
-	fc_port.o \
 	fc_print.o \
 	fc_remote_port.o \
 	fc_sess.o \
diff --git a/drivers/scsi/ofc/openfc/fc_disc_targ.c b/drivers/scsi/ofc/openfc/fc_disc_targ.c
index 532919b..7c3f635 100644
--- a/drivers/scsi/ofc/openfc/fc_disc_targ.c
+++ b/drivers/scsi/ofc/openfc/fc_disc_targ.c
@@ -45,7 +45,6 @@
 #include "fc_local_port.h"
 #include "fc_remote_port.h"
 #include "fc_sess.h"
-#include "fc_port.h"
 #include "fc_exch.h"
 #include "fc_disc_targ.h"
 #include "fc_frame.h"
diff --git a/drivers/scsi/ofc/openfc/fc_exch.c b/drivers/scsi/ofc/openfc/fc_exch.c
index b30c737..16a52ec 100644
--- a/drivers/scsi/ofc/openfc/fc_exch.c
+++ b/drivers/scsi/ofc/openfc/fc_exch.c
@@ -38,7 +38,6 @@
 #include "fc_event.h"
 #include "fc_frame.h"
 #include "fc_exch.h"
-#include "fc_port.h"
 #include "fc_print.h"
 
 #include "fc_exch_impl.h"
diff --git a/drivers/scsi/ofc/openfc/fc_local_port.c b/drivers/scsi/ofc/openfc/fc_local_port.c
index 2fb28d9..1e2876f 100644
--- a/drivers/scsi/ofc/openfc/fc_local_port.c
+++ b/drivers/scsi/ofc/openfc/fc_local_port.c
@@ -45,7 +45,6 @@
 #include "fc_remote_port.h"
 #include "fc_disc_targ.h"
 #include "fc_sess.h"
-#include "fc_port.h"
 #include "fc_frame.h"
 #include "fc_exch.h"
 
diff --git a/drivers/scsi/ofc/openfc/fc_port.c b/drivers/scsi/ofc/openfc/fc_port.c
deleted file mode 100644
index 480b1cc..0000000
--- a/drivers/scsi/ofc/openfc/fc_port.c
+++ /dev/null
@@ -1,248 +0,0 @@
-/*
- * Copyright(c) 2007 Intel Corporation. All rights reserved.
- * 
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- * 
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
- * Maintained at www.Open-FCoE.org
- */
-
-#include <linux/types.h>
-
-#include "sa_kernel.h"
-#include "sa_error_inject.h"
-#include "ofc_dbg.h"
-#include "sa_event.h"
-#include "fc_types.h"
-#include "fc_port.h"
-#include "fc_frame.h"
-#include "fc_exch.h"
-#include "fc_fs.h"
-#include "fc_encaps.h"
-
-/*
- * Null ingress handler.
- */
-static void fc_port_null_ingress(void *arg, struct fc_frame *fp)
-{
-	fc_frame_free(fp);
-}
-
-/*
- * Null egress handler.
- */
-static int fc_port_null_egress(void *arg, struct fc_frame *fp)
-{
-	fc_frame_free(fp);
-	return 0;
-}
-
-/*
- * Create a new fibre-channel port.
- */
-struct fc_port *fc_port_alloc(void)
-{
-	struct fc_port *port;
-
-	port = sa_malloc(sizeof(*port));
-	if (port) {
-		memset(port, 0, sizeof(*port));
-		port->np_ingress = fc_port_null_ingress;
-		port->np_egress = fc_port_null_egress;
-		port->np_max_frame =
-		    FC_MAX_PAYLOAD + sizeof(struct fc_frame_header);
-		port->np_ready = 1;
-		port->np_events = sa_event_list_alloc();
-
-		port->np_frame_alloc = fc_frame_alloc_int;
-		if (!port->np_events) {
-			sa_free(port);
-			port = NULL;
-		}
-	}
-	return port;
-}
-
-/*
- * Free fibre-channel port.
- */
-void fc_port_free(struct fc_port *port)
-{
-
-	sa_event_list_free(port->np_events);
-	sa_free(port);
-}
-
-/*
- * Set max frame size for port.
- */
-void fc_port_set_max_frame_size(struct fc_port *port, u_int mfs)
-{
-	mfs &= ~3;
-	WARN_ON((size_t) mfs < FC_MIN_MAX_FRAME);
-	if (mfs > FC_MAX_FRAME)
-		mfs = FC_MAX_FRAME;
-	port->np_max_frame = mfs;
-}
-
-/*
- * Get max frame size for port.
- */
-u_int fc_port_get_max_frame_size(struct fc_port *port)
-{
-	return port->np_max_frame;
-}
-
-/*
- * Set egress handler for port.
- */
-void
-fc_port_set_egress(struct fc_port *port,
-		   int (*egress) (void *arg, struct fc_frame *), void *arg)
-{
-	port->np_egress = egress;
-	port->np_egress_arg = arg;
-}
-
-/*
- * Set ingress handler for port.
- */
-void
-fc_port_set_ingress(struct fc_port *port,
-		    void (*ingress) (void *arg, struct fc_frame *), void *arg)
-{
-	port->np_ingress = ingress;
-	port->np_ingress_arg = arg;
-}
-
-/*
- * Close egress side of port.
- */
-void fc_port_close_egress(struct fc_port *port)
-{
-	port->np_egress = fc_port_null_egress;
-	port->np_egress_arg = NULL;
-	if (port->np_ingress == fc_port_null_ingress)
-		fc_port_free(port);
-	else
-		sa_event_call(port->np_events, FC_EV_CLOSED);
-}
-
-/*
- * Close ingress side of port.
- */
-void fc_port_close_ingress(struct fc_port *port)
-{
-	port->np_ingress = fc_port_null_ingress;
-	port->np_ingress_arg = NULL;
-	if (port->np_egress == fc_port_null_egress)
-		fc_port_free(port);
-	else
-		sa_event_call(port->np_events, FC_EV_CLOSED);
-}
-
-/*
- * Send a frame out of the switch or end-point from the given port.
- * E.g., called by an internal fabric controller communicating on an ISL port.
- * Ends up using the port's egress handler.
- */
-int fc_port_egress(struct fc_port *port, struct fc_frame *fp)
-{
-	WARN_ON(!port->np_egress);
-	if (SA_ERROR_INJECT) {
-		fc_frame_free(fp);
-		return EBUSY;
-	}
-	return (*port->np_egress) (port->np_egress_arg, fp);
-}
-
-/*
- * Send a frame into a port.
- */
-void fc_port_ingress(struct fc_port *port, struct fc_frame *fp)
-{
-	WARN_ON(!port);
-	WARN_ON(!(port->np_ingress));
-	(*port->np_ingress) (port->np_ingress_arg, fp);
-}
-
-/*
- * Set event handler.
- */
-struct sa_event *fc_port_enq_handler(struct fc_port *port,
-				     sa_event_handler_t *handler, void *arg)
-{
-	return sa_event_enq(port->np_events, handler, arg);
-}
-
-/*
- * Set event handler.
- */
-void
-fc_port_deq_handler(struct fc_port *port, sa_event_handler_t *handler,
-		    void *arg)
-{
-	sa_event_deq(port->np_events, handler, arg);
-}
-
-/*
- * Invoke event on port.
- */
-void fc_port_send_event(struct fc_port *port, enum fc_event event)
-{
-	if (event == FC_EV_READY)
-		port->np_ready = 1;
-	else if (event == FC_EV_CLOSED || event == FC_EV_DOWN)
-		port->np_ready = 0;
-	sa_event_call(port->np_events, event);
-}
-
-void *fc_port_get_ingress_arg(struct fc_port *port)
-{
-	return port->np_ingress_arg;
-}
-
-void *fc_port_get_egress_arg(struct fc_port *port)
-{
-	return port->np_egress_arg;
-}
-
-int fc_port_ready(struct fc_port *port)
-{
-	return port->np_ready;
-}
-
-/*
- * Port control handler.
- */
-int
-fc_port_egress_control(struct fc_port *port, enum fc_port_ctl op,
-		       void *buf, size_t len)
-{
-	int rc = -EINVAL;
-
-	if (port->np_egress_ctl != NULL)
-		rc = (*port->np_egress_ctl) (port->np_egress_arg, op, buf, len);
-	return rc;
-}
-
-/*
- * Set port control handler.
- */
-void
-fc_port_set_egress_control(struct fc_port *port,
-			   int (*handler) (void *, enum fc_port_ctl,
-					   void *, size_t))
-{
-	port->np_egress_ctl = handler;
-}
diff --git a/drivers/scsi/ofc/openfc/fc_sess.c b/drivers/scsi/ofc/openfc/fc_sess.c
index 33a778a..42923e6 100644
--- a/drivers/scsi/ofc/openfc/fc_sess.c
+++ b/drivers/scsi/ofc/openfc/fc_sess.c
@@ -44,7 +44,6 @@
 #include "fc_types.h"
 #include "fc_event.h"
 #include "fc_sess.h"
-#include "fc_port.h"
 #include "fc_frame.h"
 #include "fc_local_port.h"
 #include "fc_remote_port.h"
diff --git a/drivers/scsi/ofc/openfc/fcs_cmd.c b/drivers/scsi/ofc/openfc/fcs_cmd.c
index 50fd824..5492dcf 100644
--- a/drivers/scsi/ofc/openfc/fcs_cmd.c
+++ b/drivers/scsi/ofc/openfc/fcs_cmd.c
@@ -24,7 +24,6 @@
 #include "fc_types.h"
 #include "fc_event.h"
 #include "fc_frame.h"
-#include "fc_port.h"
 #include "fc_virt_fab.h"
 #include "fc_virt_fab_impl.h"
 #include "fc_local_port.h"
diff --git a/drivers/scsi/ofc/openfc/fcs_event.c b/drivers/scsi/ofc/openfc/fcs_event.c
index 5d5cfa6..5d80799 100644
--- a/drivers/scsi/ofc/openfc/fcs_event.c
+++ b/drivers/scsi/ofc/openfc/fcs_event.c
@@ -36,7 +36,6 @@
 #include "ofc_dbg.h"
 #include "fc_types.h"
 #include "fc_frame.h"
-#include "fc_port.h"
 #include "fc_virt_fab.h"
 #include "fc_local_port.h"
 #include "fc_remote_port.h"
diff --git a/drivers/scsi/ofc/openfc/fcs_state.c b/drivers/scsi/ofc/openfc/fcs_state.c
index 50119d5..2a87b35 100644
--- a/drivers/scsi/ofc/openfc/fcs_state.c
+++ b/drivers/scsi/ofc/openfc/fcs_state.c
@@ -23,7 +23,6 @@
 #include "ofc_dbg.h"
 #include "fc_types.h"
 #include "fc_frame.h"
-#include "fc_port.h"
 #include "fc_virt_fab.h"
 #include "fc_local_port.h"
 #include "fc_remote_port.h"
diff --git a/drivers/scsi/ofc/openfc/openfc_attr.c b/drivers/scsi/ofc/openfc/openfc_attr.c
index d2a3b17..6001c7d 100644
--- a/drivers/scsi/ofc/openfc/openfc_attr.c
+++ b/drivers/scsi/ofc/openfc/openfc_attr.c
@@ -33,7 +33,6 @@
 #include <scsi/scsi_transport_fc.h>
 
 #include "fc_types.h"
-#include "fc_port.h"
 #include "fc_remote_port.h"
 #include "fcdev.h"
 #include "fcoeioctl.h"
diff --git a/drivers/scsi/ofc/openfc/openfc_if.c b/drivers/scsi/ofc/openfc/openfc_if.c
index e882844..52aac8c 100644
--- a/drivers/scsi/ofc/openfc/openfc_if.c
+++ b/drivers/scsi/ofc/openfc/openfc_if.c
@@ -34,7 +34,6 @@
 #include <scsi/scsi_tcq.h>
 
 #include "fc_types.h"
-#include "fc_port.h"
 #include "fc_event.h"
 #include "fc_remote_port.h"
 #include "fcdev.h"
diff --git a/drivers/scsi/ofc/openfc/openfc_pkt.c b/drivers/scsi/ofc/openfc/openfc_pkt.c
index ecb1aae..16ab762 100644
--- a/drivers/scsi/ofc/openfc/openfc_pkt.c
+++ b/drivers/scsi/ofc/openfc/openfc_pkt.c
@@ -33,7 +33,6 @@
 #include "sa_kernel.h"
 #include "fc_types.h"
 #include "fc_event.h"
-#include "fc_port.h"
 #include "fc_remote_port.h"
 #include "fcdev.h"
 #include "fc_fc2.h"
diff --git a/drivers/scsi/ofc/openfc/openfc_scsi.c b/drivers/scsi/ofc/openfc/openfc_scsi.c
index 7b6e8b7..bfd68d9 100644
--- a/drivers/scsi/ofc/openfc/openfc_scsi.c
+++ b/drivers/scsi/ofc/openfc/openfc_scsi.c
@@ -35,7 +35,6 @@
  */
 #include "fc_types.h"
 #include "fc_event.h"
-#include "fc_port.h"
 #include "fc_remote_port.h"
 #include "fcoeioctl.h"
 #include "fcdev.h"




More information about the devel mailing list