File 0013-fcoeadm-Get-rid-of-some-includes.patch of Package fcoe-utils

From 9941ed7af391c2174f1141f64248e7edd0cc67db Mon Sep 17 00:00:00 2001
Message-Id: <9941ed7af391c2174f1141f64248e7edd0cc67db.1439372158.git.jthumshirn@suse.de>
In-Reply-To: <cover.1439372158.git.jthumshirn@suse.de>
References: <cover.1439372158.git.jthumshirn@suse.de>
From: Johannes Thumshirn <jthumshirn@suse.de>
Date: Thu, 6 Aug 2015 11:33:29 +0200
Subject: [PATCH 5/9] fcoeadm: Get rid of some includes

Now that all consumers of libHBAAPI2 are gone in fcoeadm_display.c, get rid of
unsused #includes, #defines and types.

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
---
 fcoeadm_display.c   | 45 ---------------------------------------------
 include/sysfs_hba.h | 13 +++++++++++++
 2 files changed, 13 insertions(+), 45 deletions(-)

diff --git a/fcoeadm_display.c b/fcoeadm_display.c
index 831a73e..be76373 100644
--- a/fcoeadm_display.c
+++ b/fcoeadm_display.c
@@ -20,7 +20,6 @@
 #define _GNU_SOURCE
 
 #include <sys/param.h>
-#include <sys/ioctl.h>
 #include <linux/types.h>
 #include <ctype.h>
 #include <stddef.h>
@@ -32,9 +31,6 @@
 #include <malloc.h>
 #include <pthread.h>
 #include <limits.h>
-#include <scsi/sg.h>
-#include <byteswap.h>
-#include <net/if.h>
 #include <unistd.h>
 #include <inttypes.h>
 #include <dirent.h>
@@ -42,25 +38,12 @@
 #include "net_types.h"
 #include "fc_types.h"
 #include "fc_scsi.h"
-#include "hbaapi.h"
 #include "fcoeadm_display.h"
 #include "fcoe_utils.h"
 #include "fcoemon_utils.h"
 #include "libopenfcoe.h"
 #include "sysfs_hba.h"
 
-/* #define TEST_HBAAPI_V1 */
-#ifdef TEST_HBAAPI_V1
-#define HBA_FCP_SCSI_ENTRY	 HBA_FCPSCSIENTRY
-#define HBA_FCP_TARGET_MAPPING HBA_FCPTARGETMAPPING
-#else
-#define HBA_FCP_SCSI_ENTRY	 HBA_FCPSCSIENTRYV2
-#define HBA_FCP_TARGET_MAPPING HBA_FCPTARGETMAPPINGV2
-#endif
-/* #define TEST_REPORT_LUNS */
-/* #define TEST_READ_CAP_V1 */
-/* #define TEST_DEV_SERIAL_NO */
-
 /* Define FC4 Type */
 #define FC_TYPE_FCP        0x08 /* SCSI FCP */
 
@@ -75,26 +58,6 @@
 #define SYSFS_HOST_DIR     "/sys/class/fc_host"
 
 /*
- * HBA and port objects are one-to-one since there
- * is one host created per Ethernet port (vlan).
- */
-struct hba_name_table {
-	HBA_HANDLE            hba_handle;
-	HBA_ADAPTERATTRIBUTES hba_attrs;
-	HBA_PORTATTRIBUTES    port_attrs;
-	int                   failed;
-	int                   displayed;
-};
-
-/*
- * List of HBA objects.
- */
-struct hba_name_table_list {
-	int			hba_count;
-	struct hba_name_table	hba_table[1];
-};
-
-/*
  * Options for displaying target/LUN info.
  */
 struct target_info_arguments {
@@ -116,14 +79,6 @@ struct sa_nameval port_states[] = {
 	{ NULL, 0 }
 };
 
-#define HBA_PORTSPEED_4GBIT		0x0008  /* 4 GBit/sec */
-#define HBA_PORTSPEED_8GBIT		0x0010  /* 8 GBit/sec */
-#define HBA_PORTSPEED_16GBIT		0x0020  /* 16 GBit/sec */
-#define HBA_PORTSPEED_32GBIT		0x0040  /* 32 GBit/sec */
-#define HBA_PORTSPEED_20GBIT		0x0080  /* 20 GBit/sec */
-#define HBA_PORTSPEED_40GBIT		0x0100  /* 40 GBit/sec */
-#define HBA_PORTSPEED_NOT_NEGOTIATED	(1 << 15) /* Speed not established */
-
 
 /*
  * table of /sys port speed strings to HBA-API values.
diff --git a/include/sysfs_hba.h b/include/sysfs_hba.h
index 6cb926a..32657e7 100644
--- a/include/sysfs_hba.h
+++ b/include/sysfs_hba.h
@@ -22,7 +22,20 @@
 
 #include <stdint.h>
 
+#define HBA_PORTSTATE_UNKNOWN		1   /* Unknown */
+#define HBA_PORTSTATE_ONLINE		2   /* Operational */
+#define HBA_PORTSTATE_OFFLINE		3   /* User Offline */
+#define HBA_PORTSTATE_BYPASSED		4   /* Bypassed */
+#define HBA_PORTSTATE_DIAGNOSTICS	5   /* In diagnostics mode */
+#define HBA_PORTSTATE_LINKDOWN		6   /* Link Down */
+#define HBA_PORTSTATE_ERROR		7   /* Port Error */
+#define HBA_PORTSTATE_LOOPBACK		8   /* Loopback */
 
+#define HBA_PORTSPEED_UNKNOWN		0x0000  /* Unknown - transceiver incable
+					         * of reporting */
+#define HBA_PORTSPEED_1GBIT		0x0001  /* 1 GBit/sec */
+#define HBA_PORTSPEED_2GBIT		0x0002  /* 2 GBit/sec */
+#define HBA_PORTSPEED_10GBIT		0x0004  /* 10 GBit/sec */
 #define HBA_PORTSPEED_4GBIT		0x0008  /* 4 GBit/sec */
 #define HBA_PORTSPEED_8GBIT		0x0010  /* 8 GBit/sec */
 #define HBA_PORTSPEED_16GBIT		0x0020  /* 16 GBit/sec */
-- 
2.4.6

openSUSE Build Service is sponsored by