From 8878a3acac1e35c0a6a9af00389bd2c1325f6984 Mon Sep 17 00:00:00 2001 From: Petr Sabata Date: Thu, 2 Jun 2011 16:09:20 +0200 Subject: [PATCH] 1.0.19 bump --- .gitignore | 1 + fcoe-utils-1.0.17-make.patch | 22 - fcoe-utils-1.0.17-manpages.patch | 59 - fcoe-utils-1.0.17-no-vconfig.patch | 14 - ...dd-SUPPORTED_DRIVERS-field-to-config.patch | 76 - ...ibnl-build-dependency-for-fcoe-utils.patch | 30 - ...-freeing-uninitialized-pointer-in-fc.patch | 49 - ...entation-for-the-fcoeadm-Scan-option.patch | 54 - ...-fip-socket-during-creation-to-disca.patch | 71 - ...e-more-than-128-adapters-in-fcoeadm-.patch | 463 ----- ...utils-Include-current-lldpad-headers.patch | 29 - ...lude-fcoe_utils.h-before-scsi-scsi.h.patch | 39 - ...ve-unused-variable-symbolic_name_len.patch | 27 - ...proute2-instead-of-deprecated-vconfi.patch | 33 - ...18-fcoemon-Correct-wrong-error-check.patch | 32 - ...reate-a-world-and-group-writable-PID.patch | 29 - ...-fcoemon-Fix-2-file-descriptor-leaks.patch | 42 - ...ed-FLOGI-after-fcoe-port-is-destroye.patch | 39 - ...libfcoe.ko-interfaces-create-destroy.patch | 33 - ...-vlan-discovery-timer-only-when-vali.patch | 78 - ...vlan-discovery-forever-if-AUTO_VLAN-.patch | 40 - fcoe-utils-1.0.18-kernel-headers.patch | 1494 ----------------- fcoe-utils.spec | 57 +- sources | 2 +- 24 files changed, 13 insertions(+), 2800 deletions(-) delete mode 100644 fcoe-utils-1.0.17-make.patch delete mode 100644 fcoe-utils-1.0.17-manpages.patch delete mode 100644 fcoe-utils-1.0.17-no-vconfig.patch delete mode 100644 fcoe-utils-1.0.18-fcoe-utils-Add-SUPPORTED_DRIVERS-field-to-config.patch delete mode 100644 fcoe-utils-1.0.18-fcoe-utils-Add-libnl-build-dependency-for-fcoe-utils.patch delete mode 100644 fcoe-utils-1.0.18-fcoe-utils-Avoid-freeing-uninitialized-pointer-in-fc.patch delete mode 100644 fcoe-utils-1.0.18-fcoe-utils-Documentation-for-the-fcoeadm-Scan-option.patch delete mode 100644 fcoe-utils-1.0.18-fcoe-utils-Drain-fip-socket-during-creation-to-disca.patch delete mode 100644 fcoe-utils-1.0.18-fcoe-utils-Handle-more-than-128-adapters-in-fcoeadm-.patch delete mode 100644 fcoe-utils-1.0.18-fcoe-utils-Include-current-lldpad-headers.patch delete mode 100644 fcoe-utils-1.0.18-fcoe-utils-Include-fcoe_utils.h-before-scsi-scsi.h.patch delete mode 100644 fcoe-utils-1.0.18-fcoe-utils-Remove-unused-variable-symbolic_name_len.patch delete mode 100644 fcoe-utils-1.0.18-fcoe-utils-Use-iproute2-instead-of-deprecated-vconfi.patch delete mode 100644 fcoe-utils-1.0.18-fcoemon-Correct-wrong-error-check.patch delete mode 100644 fcoe-utils-1.0.18-fcoemon-Do-not-create-a-world-and-group-writable-PID.patch delete mode 100644 fcoe-utils-1.0.18-fcoemon-Fix-2-file-descriptor-leaks.patch delete mode 100644 fcoe-utils-1.0.18-fcoemon-Unexpected-FLOGI-after-fcoe-port-is-destroye.patch delete mode 100644 fcoe-utils-1.0.18-fcoemon-Use-new-libfcoe.ko-interfaces-create-destroy.patch delete mode 100644 fcoe-utils-1.0.18-fcoeutils-Cancel-vlan-discovery-timer-only-when-vali.patch delete mode 100644 fcoe-utils-1.0.18-fcoeutils-Retry-vlan-discovery-forever-if-AUTO_VLAN-.patch delete mode 100644 fcoe-utils-1.0.18-kernel-headers.patch diff --git a/.gitignore b/.gitignore index 424588c..f24c07e 100644 --- a/.gitignore +++ b/.gitignore @@ -31,3 +31,4 @@ etc/initd/fcoe fcoe-utils-*.tar.gz fcoe-utils-*.rpm /fcoe-utils-1.0.18.tar.bz2 +/fcoe-utils-1.0.19.tar.bz2 diff --git a/fcoe-utils-1.0.17-make.patch b/fcoe-utils-1.0.17-make.patch deleted file mode 100644 index 9c82334..0000000 --- a/fcoe-utils-1.0.17-make.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- fcoe-utils-1.0.17/Makefile.am 2011-01-15 01:28:10.000000000 +0100 -+++ fcoe-utils-1.0.17/Makefile.am.new 2011-02-04 10:59:25.579483545 +0100 -@@ -2,7 +2,7 @@ - sbin_PROGRAMS = fcoeadm fcoemon fcping fipvlan fcnsq fcrls - - ## all targets should look for headers in the include directory --AM_CPPFLAGS = -I${srcdir}/include -I${builddir}/include -+AM_CPPFLAGS = -I${srcdir}/include -I${builddir}/include -I/lib/modules/`rpm -q --list kernel | grep "^/lib/modules/.*/build$$" | cut -f4 -d"/" | sort -r | head -1`/build/include - ## pass the sysconfdir into the C proprocessor - AM_CPPFLAGS += -DSYSCONFDIR="\"${sysconfdir}\"" - AM_CFLAGS = -Wall ---- fcoe-utils-1.0.17/Makefile.am 2011-02-04 11:06:42.253483139 +0100 -+++ fcoe-utils-1.0.17/Makefile.am.new 2011-02-04 11:06:59.956483271 +0100 -@@ -65,8 +65,3 @@ - init_d_SCRIPTS = etc/initd/fcoe - - dist_noinst_DATA = README COPYING INSTALL fcoe-utils.spec etc/config -- --install-data-hook: -- if [ ! -f ${DESTDIR}${fcoe_configdir}/config ] ; then \ -- cp ${srcdir}/etc/config ${DESTDIR}${fcoe_configdir}/config; \ -- fi diff --git a/fcoe-utils-1.0.17-manpages.patch b/fcoe-utils-1.0.17-manpages.patch deleted file mode 100644 index 9c60b19..0000000 --- a/fcoe-utils-1.0.17-manpages.patch +++ /dev/null @@ -1,59 +0,0 @@ ---- fcoe-utils-1.0.17/doc/fcoeadm.txt 2011-01-15 01:28:10.000000000 +0100 -+++ fcoe-utils-1.0.17/doc/fcoeadm.txt.new 2011-02-04 11:46:24.217483236 +0100 -@@ -25,6 +25,8 @@ - - *fcoeadm* -r|--reset _ethX_ - -+*fcoeadm* -S|--Scan _ethX_ -+ - *fcoeadm* -i|--interface [_ethX_] - - *fcoeadm* -t|--target [_ethX_] -@@ -64,6 +66,9 @@ - *-r*, *--reset* _ethX_:: - Resets the FCoE instance on the specified network interface. - -+*-S*, *--Scan* _ethX_:: -+ Validates that the interface name has an active FCoE session. -+ - *-i*, *--interface* [_ethX_]:: - Show information about the FCoE instance on the specified network - interface, or all FCoE instances if no network interface is specified. ---- fcoe-utils-1.0.17/doc/fcoeadm.8 2011-01-15 01:28:10.000000000 +0100 -+++ fcoe-utils-1.0.17/doc/fcoeadm.8.new 2011-02-04 11:50:48.400482913 +0100 -@@ -2,12 +2,12 @@ - .\" Title: fcoeadm - .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] - .\" Generator: DocBook XSL Stylesheets v1.75.2 --.\" Date: 04/29/2010 -+.\" Date: 02/04/2011 - .\" Manual: Open-FCoE Tools - .\" Source: Open-FCoE - .\" Language: English - .\" --.TH "FCOEADM" "8" "04/29/2010" "Open\-FCoE" "Open\-FCoE Tools" -+.TH "FCOEADM" "8" "02/04/2011" "Open\-FCoE" "Open\-FCoE Tools" - .\" ----------------------------------------------------------------- - .\" * set default formatting - .\" ----------------------------------------------------------------- -@@ -26,6 +26,8 @@ - .sp - \fBfcoeadm\fR \-r|\-\-reset \fIethX\fR - .sp -+\fBfcoeadm\fR \-S|\-\-Scan \fIethX\fR -+.sp - \fBfcoeadm\fR \-i|\-\-interface [\fIethX\fR] - .sp - \fBfcoeadm\fR \-t|\-\-target [\fIethX\fR] -@@ -60,6 +62,11 @@ - Resets the FCoE instance on the specified network interface\&. - .RE - .PP -+\fB\-S\fR, \fB\-\-Scan\fR \fIethX\fR -+.RS 4 -+Validates that the interface name has an active FCoE session\&. -+.RE -+.PP - \fB\-i\fR, \fB\-\-interface\fR [\fIethX\fR] - .RS 4 - Show information about the FCoE instance on the specified network interface, or all FCoE instances if no network interface is specified\&. diff --git a/fcoe-utils-1.0.17-no-vconfig.patch b/fcoe-utils-1.0.17-no-vconfig.patch deleted file mode 100644 index 6973da5..0000000 --- a/fcoe-utils-1.0.17-no-vconfig.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- fcoe-utils-1.0.17/contrib/fcoe-setup.sh 2011-01-15 01:28:10.000000000 +0100 -+++ fcoe-utils-1.0.17/contrib/fcoe-setup.sh.new 2011-02-04 12:52:13.873482656 +0100 -@@ -24,9 +24,8 @@ - vif=$(scan_vlan $ifname $vlan) - - if [ -z "$vif" ] ; then -- vconfig set_name_type DEV_PLUS_VID_NO_PAD -- vconfig add $ifname $vlan > /dev/null -- vif="$ifname.$vlan" -+ vif="$ifname.$vlan" -+ ip link add dev $vif link $ifname type vlan id $vlan - fi - ip link set $vif up - echo "$vif" diff --git a/fcoe-utils-1.0.18-fcoe-utils-Add-SUPPORTED_DRIVERS-field-to-config.patch b/fcoe-utils-1.0.18-fcoe-utils-Add-SUPPORTED_DRIVERS-field-to-config.patch deleted file mode 100644 index 799ed0e..0000000 --- a/fcoe-utils-1.0.18-fcoe-utils-Add-SUPPORTED_DRIVERS-field-to-config.patch +++ /dev/null @@ -1,76 +0,0 @@ -From fabcf9389e79c3535a58b5dc30632d444cb513f6 Mon Sep 17 00:00:00 2001 -From: Nithin Sujir -Date: Thu, 27 Jan 2011 04:12:08 +0000 -Subject: [PATCH 02/16] fcoe-utils: Add SUPPORTED_DRIVERS field to config - -SUPPORTED_DRIVERS is a space separated string field added to the config -file. The fcoe service will use this field instead of the previous -hardcoded "fcoe" to modprobe during startup. - -Signed-off-by: Nithin Nayak Sujir -Signed-off-by: Robert Love -Signed-off-by: Petr Sabata ---- - doc/fcoemon.txt | 5 +++-- - etc/config | 4 ++++ - etc/initd/initd.fedora | 2 +- - etc/initd/initd.suse | 2 +- - 4 files changed, 9 insertions(+), 4 deletions(-) - -diff --git a/doc/fcoemon.txt b/doc/fcoemon.txt -index f42c8c0..117b2d0 100644 ---- a/doc/fcoemon.txt -+++ b/doc/fcoemon.txt -@@ -159,8 +159,9 @@ default options in this file are: *DEBUG="no"* and *USE_SYSLOG="yes"*. The - former is used to enable debugging messages from the fcoe service script - and *fcoemon* (via the *--debug* option). The latter is to indicate if the - log messages are to be output to the system log (via the *--syslog* --option). Any changes to this file will require a restart of the *fcoe* --service. -+option). *SUPPORTED_DRIVERS* is the list of drivers to automatically load -+during fcoe service start. Any changes to this file will require a restart -+of the *fcoe* service. - - /etc/fcoe/cfg- - ~~~~~~~~~~~~~~~~~~~~~~ -diff --git a/etc/config b/etc/config -index 2d08c9e..c993f35 100644 ---- a/etc/config -+++ b/etc/config -@@ -8,3 +8,7 @@ DEBUG="no" - # All the messages go to syslog and stderr (script & C code) - USE_SYSLOG="yes" - -+## Type: string. Driver names separated by space -+## Default: list of default drivers -+# All supported drivers listed here are loaded when service starts -+SUPPORTED_DRIVERS="fcoe bnx2fc" -diff --git a/etc/initd/initd.fedora b/etc/initd/initd.fedora -index 3888dda..6a791cd 100755 ---- a/etc/initd/initd.fedora -+++ b/etc/initd/initd.fedora -@@ -68,7 +68,7 @@ start() - echo -n $"Starting FCoE initiator service: " - - modprobe -q libfc -- modprobe -q fcoe -+ modprobe -q -a $SUPPORTED_DRIVERS - - daemon --pidfile ${PID_FILE} ${FCOEMON} ${FCOEMON_OPTS} - -diff --git a/etc/initd/initd.suse b/etc/initd/initd.suse -index 139de2d..638eae5 100755 ---- a/etc/initd/initd.suse -+++ b/etc/initd/initd.suse -@@ -82,7 +82,7 @@ test -x $FCOEMON || { - - startup_fcoe_modules() - { -- modprobe fcoe > /dev/null 2>&1 -+ modprobe -a $SUPPORTED_DRIVERS > /dev/null 2>&1 - } - - start() --- -1.7.4.4 - diff --git a/fcoe-utils-1.0.18-fcoe-utils-Add-libnl-build-dependency-for-fcoe-utils.patch b/fcoe-utils-1.0.18-fcoe-utils-Add-libnl-build-dependency-for-fcoe-utils.patch deleted file mode 100644 index 8768d7f..0000000 --- a/fcoe-utils-1.0.18-fcoe-utils-Add-libnl-build-dependency-for-fcoe-utils.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 12acb3a16b13e96b0ac604540aaf0148dffceb74 Mon Sep 17 00:00:00 2001 -From: Ross Brattain -Date: Wed, 13 Apr 2011 03:51:59 +0000 -Subject: [PATCH 07/16] fcoe-utils: Add libnl build dependency for fcoe-utils - to QUICKSTART document. - -fcoemon uses the header from libnl. - -Signed-off-by: Ross Brattain -Signed-off-by: Robert Love -Signed-off-by: Petr Sabata ---- - QUICKSTART | 1 + - 1 files changed, 1 insertions(+), 0 deletions(-) - -diff --git a/QUICKSTART b/QUICKSTART -index 5183803..abe6cf2 100644 ---- a/QUICKSTART -+++ b/QUICKSTART -@@ -176,6 +176,7 @@ PROCESS - - DEPENDENCIES - -+* libnl (see DCB section) - * libhbalinux - * lldpad v0.9.26 or greater (optional configure flag to build without) - --- -1.7.4.4 - diff --git a/fcoe-utils-1.0.18-fcoe-utils-Avoid-freeing-uninitialized-pointer-in-fc.patch b/fcoe-utils-1.0.18-fcoe-utils-Avoid-freeing-uninitialized-pointer-in-fc.patch deleted file mode 100644 index b1fea6a..0000000 --- a/fcoe-utils-1.0.18-fcoe-utils-Avoid-freeing-uninitialized-pointer-in-fc.patch +++ /dev/null @@ -1,49 +0,0 @@ -From 8f4092733b9b3ba815597e67fc20c9e1897803e5 Mon Sep 17 00:00:00 2001 -From: Petr Sabata -Date: Fri, 1 Apr 2011 00:21:34 +0000 -Subject: [PATCH 16/16] fcoe-utils: Avoid freeing uninitialized pointer in - fcoe_find_fchost() - -Currently, running fcoeadm -i when SYSFS_FCHOST path isn't available results -in fcoeadm crash. This patch checks for this and frees namelist only if it's -been initialized. - -Signed-off-by: Petr Sabata -Signed-off-by: Robert Love ---- - lib/fcoe_utils.c | 8 ++++---- - 1 files changed, 4 insertions(+), 4 deletions(-) - -diff --git a/lib/fcoe_utils.c b/lib/fcoe_utils.c -index 142b045..d54cd4d 100644 ---- a/lib/fcoe_utils.c -+++ b/lib/fcoe_utils.c -@@ -67,11 +67,11 @@ static int fcoe_check_fchost(const char *ifname, const char *dname) - - enum fcoe_status fcoe_find_fchost(char *ifname, char *fchost, int len) - { -- int n, dname_len; -+ int n, dname_len, status; - struct dirent **namelist; - int rc = ENOFCOECONN; - -- n = scandir(SYSFS_FCHOST, &namelist, 0, alphasort); -+ status = n = scandir(SYSFS_FCHOST, &namelist, 0, alphasort); - - for (n-- ; n >= 0 ; n--) { - if (rc) { -@@ -94,9 +94,9 @@ enum fcoe_status fcoe_find_fchost(char *ifname, char *fchost, int len) - } - } - free(namelist[n]); -- - } -- free(namelist); -+ if (status >= 0) -+ free(namelist); - - return rc; - } --- -1.7.4.4 - diff --git a/fcoe-utils-1.0.18-fcoe-utils-Documentation-for-the-fcoeadm-Scan-option.patch b/fcoe-utils-1.0.18-fcoe-utils-Documentation-for-the-fcoeadm-Scan-option.patch deleted file mode 100644 index 9056204..0000000 --- a/fcoe-utils-1.0.18-fcoe-utils-Documentation-for-the-fcoeadm-Scan-option.patch +++ /dev/null @@ -1,54 +0,0 @@ -From 04943a7ed51fe27fb064990c6d1496c3267eedd3 Mon Sep 17 00:00:00 2001 -From: Petr Sabata -Date: Fri, 1 Apr 2011 00:06:11 +0000 -Subject: [PATCH 13/16] fcoe-utils: Documentation for the fcoeadm -Scan option - and correct long option parsing - -This patch adds a simple description for the fcoeadm -Scan along with the -long option fix. - -Signed-off-by: Petr Sabata -Signed-off-by: Robert Love ---- - doc/fcoeadm.txt | 5 +++++ - fcoeadm.c | 1 + - 2 files changed, 6 insertions(+), 0 deletions(-) - -diff --git a/doc/fcoeadm.txt b/doc/fcoeadm.txt -index 2b1cf0a..2552d4d 100644 ---- a/doc/fcoeadm.txt -+++ b/doc/fcoeadm.txt -@@ -27,6 +27,8 @@ SYNOPSIS - - *fcoeadm* -i|--interface [_ethX_] - -+*fcoeadm* -S|--Scan [_ethX_] -+ - *fcoeadm* -t|--target [_ethX_] - - *fcoeadm* -l|--lun [_ethX_] -@@ -68,6 +70,9 @@ OPTIONS - Show information about the FCoE instance on the specified network - interface, or all FCoE instances if no network interface is specified. - -+*-S*, *--Scan* _ethX_:: -+ Validates that the interface name has an active FCoE session. -+ - *-t*, *--target* [_ethX_]:: - Show information about the discovered targets associated with the - FCoE instance on the specified network interface. -diff --git a/fcoeadm.c b/fcoeadm.c -index 0573d91..3cbff71 100644 ---- a/fcoeadm.c -+++ b/fcoeadm.c -@@ -39,6 +39,7 @@ static struct option fcoeadm_opts[] = { - {"destroy", required_argument, 0, 'd'}, - {"reset", required_argument, 0, 'r'}, - {"interface", no_argument, 0, 'i'}, -+ {"Scan", required_argument, 0, 'S'}, - {"target", no_argument, 0, 't'}, - {"lun", no_argument, 0, 'l'}, - {"stats", no_argument, 0, 's'}, --- -1.7.4.4 - diff --git a/fcoe-utils-1.0.18-fcoe-utils-Drain-fip-socket-during-creation-to-disca.patch b/fcoe-utils-1.0.18-fcoe-utils-Drain-fip-socket-during-creation-to-disca.patch deleted file mode 100644 index ee5e586..0000000 --- a/fcoe-utils-1.0.18-fcoe-utils-Drain-fip-socket-during-creation-to-disca.patch +++ /dev/null @@ -1,71 +0,0 @@ -From d880216b9882eb601e60d2111a97ac1405f3529f Mon Sep 17 00:00:00 2001 -From: Nithin Sujir -Date: Tue, 12 Apr 2011 05:33:05 +0000 -Subject: [PATCH 09/16] fcoe-utils: Drain fip socket during creation to - discard unintended rx packets. - -During fcoe start, fcoemon creates a PF_PACKET,ETH_P_FIP raw socket for -vlan discovery. After the socket() call and before binding to the -desired device interface, the socket receives FIP packets from all -interfaces. This can interfere with VLAN discovery if a discovery packet -on one interface is received on the wrong socket. This patch drains the -socket after binding it to an interface and before adding the fd to -select monitoring. - -Signed-off-by: Nithin Nayak Sujir -Signed-off-by: Robert Love -Signed-off-by: Petr Sabata ---- - lib/fip.c | 29 +++++++++++++++++++++++++++++ - 1 files changed, 29 insertions(+), 0 deletions(-) - -diff --git a/lib/fip.c b/lib/fip.c -index f8c8014..20c1082 100644 ---- a/lib/fip.c -+++ b/lib/fip.c -@@ -136,6 +136,28 @@ static void fip_ethhdr(int ifindex, unsigned char *mac, struct ethhdr *eh) - } - - /** -+ * drain_socket - Discard receive packets on a socket -+ */ -+static void drain_socket(int s) -+{ -+ char buf[4096]; -+ struct sockaddr_ll sa; -+ struct iovec iov[] = { -+ { .iov_base = buf, .iov_len = sizeof(buf), }, -+ }; -+ struct msghdr msg = { -+ .msg_name = &sa, -+ .msg_namelen = sizeof(sa), -+ .msg_iov = iov, -+ .msg_iovlen = ARRAY_SIZE(iov), -+ }; -+ -+ while (recvmsg(s, &msg, MSG_DONTWAIT) > 0) { -+ /* Drop the packet */ -+ } -+} -+ -+/** - * fip_socket - create and bind a packet socket for FIP - */ - int fip_socket(int ifindex) -@@ -160,6 +182,13 @@ int fip_socket(int ifindex) - return rc; - } - -+ /* -+ * Drain the packets that were received between socket and bind. We -+ * could've received packets not meant for our interface. This can -+ * interfere with vlan discovery -+ */ -+ drain_socket(s); -+ - return s; - } - --- -1.7.4.4 - diff --git a/fcoe-utils-1.0.18-fcoe-utils-Handle-more-than-128-adapters-in-fcoeadm-.patch b/fcoe-utils-1.0.18-fcoe-utils-Handle-more-than-128-adapters-in-fcoeadm-.patch deleted file mode 100644 index a202e94..0000000 --- a/fcoe-utils-1.0.18-fcoe-utils-Handle-more-than-128-adapters-in-fcoeadm-.patch +++ /dev/null @@ -1,463 +0,0 @@ -From 48677372717fcbfcff17dbcd13441d9049f027e8 Mon Sep 17 00:00:00 2001 -From: Parikh, Neerav -Date: Wed, 9 Mar 2011 08:16:46 +0000 -Subject: [PATCH 03/16] fcoe-utils: Handle more than 128 adapters in fcoeadm - display commands - -Currently fcoeadm only supports 128 adapters for display routines. -It does not handle scenario if there are more than 128 adapters -available on the system. - -This patch removes that limitation and would allow display of more -than 128 adapters using fcoeadm display commands. - -Signed-off-by: Neerav Parikh -Tested-by: Ross Brattain -Signed-off-by: Robert Love -Signed-off-by: Petr Sabata ---- - fcoeadm_display.c | 211 ++++++++++++++++++++++++++++++++++------------------- - 1 files changed, 136 insertions(+), 75 deletions(-) - -diff --git a/fcoeadm_display.c b/fcoeadm_display.c -index 6b69148..8f95530 100644 ---- a/fcoeadm_display.c -+++ b/fcoeadm_display.c -@@ -53,9 +53,6 @@ - /* #define TEST_READ_CAP_V1 */ - /* #define TEST_DEV_SERIAL_NO */ - --/* Maximum number of HBA the display routines support */ --#define MAX_HBA_COUNT 128 -- - /* Define FC4 Type */ - #define FC_TYPE_FCP 0x08 /* SCSI FCP */ - -@@ -84,6 +81,14 @@ struct hba_name_table { - int displayed; - }; - -+/* -+ * List of HBA objects. -+ */ -+struct hba_name_table_list { -+ int hba_count; -+ struct hba_name_table hba_table[1]; -+}; -+ - struct sa_nameval port_states[] = { - { "Not Present", HBA_PORTSTATE_UNKNOWN }, - { "Online", HBA_PORTSTATE_ONLINE }, -@@ -1040,17 +1045,18 @@ show_port_stats_in_row(HBA_INT64 start_time, - printf("\n"); - } - --static void hba_table_destroy(struct hba_name_table *hba_table) -+static void hba_table_list_destroy(struct hba_name_table_list *hba_table_list) - { - int i; - -- /* -- * This is inefficiant as is closes adapter handles -- * (presumedly 0) that weren't open. However, it allows -- * us to avoid maintaining a count. -- */ -- for (i = 0 ; i < MAX_HBA_COUNT ; i++) -- HBA_CloseAdapter(hba_table[i].hba_handle); -+ if (!hba_table_list) -+ return; -+ -+ for (i = 0 ; i < hba_table_list->hba_count ; i++) -+ HBA_CloseAdapter(hba_table_list->hba_table[i].hba_handle); -+ -+ free(hba_table_list); -+ hba_table_list = NULL; - } - - static enum fcoe_status fcoeadm_loadhba() -@@ -1064,19 +1070,14 @@ static enum fcoe_status fcoeadm_loadhba() - /* - * This routine leaves all adapters fd's open. - */ --static int hba_table_init(struct hba_name_table *hba_table) -+static int hba_table_list_init(struct hba_name_table_list **hba_table_list) - { - HBA_STATUS retval; - char namebuf[1024]; - int i, num_hbas = 0; -- -- /* -- * Initialize the table. -- */ -- for (i = 0 ; i < MAX_HBA_COUNT ; i++) { -- memset(&hba_table[i], 0, -- sizeof(struct hba_name_table)); -- } -+ struct hba_name_table_list *hba_table_list_temp = NULL; -+ struct hba_name_table *hba_table = NULL; -+ int size = 0; - - num_hbas = HBA_GetNumberOfAdapters(); - if (!num_hbas) { -@@ -1084,6 +1085,18 @@ static int hba_table_init(struct hba_name_table *hba_table) - return num_hbas; - } - -+ size = sizeof(struct hba_name_table_list) + \ -+ (num_hbas - 1)*sizeof(struct hba_name_table); -+ -+ hba_table_list_temp = (struct hba_name_table_list *)calloc(1, size); -+ if (!hba_table_list_temp) { -+ fprintf(stderr, -+ "Failure allocating memory.\n"); -+ return -1; -+ } -+ -+ hba_table_list_temp->hba_count = num_hbas; -+ - /* - * Fill out the HBA table. - */ -@@ -1095,19 +1108,20 @@ static int hba_table_init(struct hba_name_table *hba_table) - continue; - } - -- hba_table[i].hba_handle = HBA_OpenAdapter(namebuf); -- if (!hba_table[i].hba_handle) { -- hba_table[i].failed = 1; -+ hba_table = &hba_table_list_temp->hba_table[i]; -+ hba_table->hba_handle = HBA_OpenAdapter(namebuf); -+ if (!hba_table->hba_handle) { -+ hba_table->failed = 1; - fprintf(stderr, "HBA_OpenAdapter failed\n"); - perror("HBA_OpenAdapter"); - continue; - } - -- retval = HBA_GetAdapterAttributes(hba_table[i].hba_handle, -- &hba_table[i].hba_attrs); -+ retval = HBA_GetAdapterAttributes(hba_table->hba_handle, -+ &hba_table->hba_attrs); - if (retval != HBA_STATUS_OK) { -- HBA_CloseAdapter(hba_table[i].hba_handle); -- hba_table[i].failed = 1; -+ HBA_CloseAdapter(hba_table->hba_handle); -+ hba_table->failed = 1; - fprintf(stderr, - "HBA_GetAdapterAttributes failed, retval=%d\n", - retval); -@@ -1115,12 +1129,12 @@ static int hba_table_init(struct hba_name_table *hba_table) - continue; - } - -- retval = HBA_GetAdapterPortAttributes(hba_table[i].hba_handle, -+ retval = HBA_GetAdapterPortAttributes(hba_table->hba_handle, - 0, -- &hba_table[i].port_attrs); -+ &hba_table->port_attrs); - if (retval != HBA_STATUS_OK) { -- HBA_CloseAdapter(hba_table[i].hba_handle); -- hba_table[i].failed = 1; -+ HBA_CloseAdapter(hba_table->hba_handle); -+ hba_table->failed = 1; - fprintf(stderr, - "HBA_GetAdapterPortAttributes failed, " - "retval=%d\n", retval); -@@ -1128,20 +1142,26 @@ static int hba_table_init(struct hba_name_table *hba_table) - } - } - -+ *hba_table_list = hba_table_list_temp; -+ - return num_hbas; - } - - /* - * This routine expects a valid interface name. - */ --static int get_index_for_ifname(struct hba_name_table *hba_table, -- int num_hbas, const char *ifname) -+static int get_index_for_ifname(struct hba_name_table_list *hba_table_list, -+ const char *ifname) - { -+ HBA_PORTATTRIBUTES *port_attrs; - int i; - -- for (i = 0 ; i < num_hbas ; i++) { -+ for (i = 0 ; i < hba_table_list->hba_count ; i++) { -+ -+ port_attrs = &hba_table_list->hba_table[i].port_attrs; -+ - if (!check_symbolic_name_for_interface( -- hba_table[i].port_attrs.PortSymbolicName, -+ port_attrs->PortSymbolicName, - ifname)) - return i; - } -@@ -1157,28 +1177,35 @@ enum fcoe_status display_port_stats(const char *ifname, int interval) - HBA_PORTSTATISTICS port_stats; - HBA_FC4STATISTICS port_fc4stats; - HBA_INT64 start_time = 0; -- struct hba_name_table hba_table[MAX_HBA_COUNT]; -+ struct hba_name_table_list *hba_table_list = NULL; - enum fcoe_status rc = SUCCESS; - int i, num_hbas; - - if (fcoeadm_loadhba()) - return EHBAAPIERR; - -- num_hbas = hba_table_init(hba_table); -+ num_hbas = hba_table_list_init(&hba_table_list); -+ if (!num_hbas) -+ goto out; -+ -+ if (num_hbas < 0) { -+ rc = EINTERR; -+ goto out; -+ } - -- i = get_index_for_ifname(hba_table, num_hbas, ifname); -+ i = get_index_for_ifname(hba_table_list, ifname); - - /* - * Return error code if a valid index wasn't returned. - */ - if (i < 0) { -- hba_table_destroy(hba_table); -+ hba_table_list_destroy(hba_table_list); - HBA_FreeLibrary(); - return EHBAAPIERR; - } - -- hba_handle = hba_table[i].hba_handle; -- port_attrs = &hba_table[i].port_attrs; -+ hba_handle = hba_table_list->hba_table[i].hba_handle; -+ port_attrs = &hba_table_list->hba_table[i].port_attrs; - - i = 0; - while (1) { -@@ -1231,21 +1258,34 @@ enum fcoe_status display_port_stats(const char *ifname, int interval) - } while (secs_left); - } - -- hba_table_destroy(hba_table); -+ hba_table_list_destroy(hba_table_list); -+out: - HBA_FreeLibrary(); - return rc; - } - - enum fcoe_status display_adapter_info(const char *ifname) - { -- struct hba_name_table hba_table[MAX_HBA_COUNT]; -+ struct hba_name_table_list *hba_table_list = NULL; - enum fcoe_status rc = SUCCESS; - int i, j, num_hbas = 0; -+ HBA_HANDLE hba_handle; -+ HBA_PORTATTRIBUTES *port_attrs; -+ HBA_PORTATTRIBUTES *sport_attrs; -+ HBA_ADAPTERATTRIBUTES *hba_attrs; -+ HBA_ADAPTERATTRIBUTES *shba_attrs; - - if (fcoeadm_loadhba()) - return EHBAAPIERR; - -- num_hbas = hba_table_init(hba_table); -+ num_hbas = hba_table_list_init(&hba_table_list); -+ if (!num_hbas) -+ goto out; -+ -+ if (num_hbas < 0) { -+ rc = EINTERR; -+ goto out; -+ } - - /* - * Loop through each HBA entry and for each serial number -@@ -1253,52 +1293,59 @@ enum fcoe_status display_adapter_info(const char *ifname) - * on that adapter. - */ - for (i = 0 ; i < num_hbas ; i++) { -- if (hba_table[i].failed || -- hba_table[i].displayed) -+ if (hba_table_list->hba_table[i].failed || -+ hba_table_list->hba_table[i].displayed) - continue; - -+ hba_handle = hba_table_list->hba_table[i].hba_handle; -+ port_attrs = &hba_table_list->hba_table[i].port_attrs; -+ hba_attrs = &hba_table_list->hba_table[i].hba_attrs; -+ - if (ifname && check_symbolic_name_for_interface( -- hba_table[i].port_attrs.PortSymbolicName, -+ port_attrs->PortSymbolicName, - ifname)) { - /* - * Overloading 'displayed' to indicate - * that the HBA/Port should be skipped. - */ -- hba_table[i].displayed = 1; -+ hba_table_list->hba_table[i].displayed = 1; - continue; - } - - /* - * Display the adapter header. - */ -- show_hba_info(&hba_table[i].hba_attrs); -+ show_hba_info(hba_attrs); - - /* - * Loop through HBAs again to print sub-ports. - */ - for (j = 0; j < num_hbas ; j++) { -+ sport_attrs = &hba_table_list->hba_table[j].port_attrs; -+ shba_attrs = &hba_table_list->hba_table[j].hba_attrs; - if (ifname && check_symbolic_name_for_interface( -- hba_table[j].port_attrs.PortSymbolicName, -+ sport_attrs->PortSymbolicName, - ifname)) { - /* - * Overloading 'displayed' to indicate - * that the HBA/Port should be skipped. - */ -- hba_table[i].displayed = 1; -+ hba_table_list->hba_table[i].displayed = 1; - continue; - } - -- if (!strncmp(hba_table[i].hba_attrs.SerialNumber, -- hba_table[j].hba_attrs.SerialNumber, -- strlen(hba_table[i].hba_attrs.SerialNumber))) { -- show_port_info(&hba_table[j].hba_attrs, -- &hba_table[j].port_attrs); -- hba_table[j].displayed = 1; -+ if (!strncmp(hba_attrs->SerialNumber, -+ shba_attrs->SerialNumber, -+ strlen(hba_attrs->SerialNumber))) { -+ show_port_info(shba_attrs, -+ sport_attrs); -+ hba_table_list->hba_table[j].displayed = 1; - } - } - } - -- hba_table_destroy(hba_table); -+ hba_table_list_destroy(hba_table_list); -+out: - HBA_FreeLibrary(); - - return rc; -@@ -1309,14 +1356,24 @@ enum fcoe_status display_target_info(const char *ifname, - { - HBA_STATUS retval; - HBA_PORTATTRIBUTES rport_attrs; -- struct hba_name_table hba_table[MAX_HBA_COUNT]; -+ struct hba_name_table_list *hba_table_list = NULL; - int i, target_index, num_hbas = 0; - enum fcoe_status rc = SUCCESS; -+ HBA_HANDLE hba_handle; -+ HBA_PORTATTRIBUTES *port_attrs; -+ HBA_ADAPTERATTRIBUTES *hba_attrs; - - if (fcoeadm_loadhba()) - return EHBAAPIERR; - -- num_hbas = hba_table_init(hba_table); -+ num_hbas = hba_table_list_init(&hba_table_list); -+ if (!num_hbas) -+ goto out; -+ -+ if (num_hbas < 0) { -+ rc = EINTERR; -+ goto out; -+ } - - /* - * Loop through each HBA entry and for each serial number -@@ -1324,28 +1381,32 @@ enum fcoe_status display_target_info(const char *ifname, - * on that adapter. - */ - for (i = 0 ; i < num_hbas ; i++) { -- if (hba_table[i].failed || -- hba_table[i].displayed) -+ if (hba_table_list->hba_table[i].failed || -+ hba_table_list->hba_table[i].displayed) - continue; - -+ hba_handle = hba_table_list->hba_table[i].hba_handle; -+ port_attrs = &hba_table_list->hba_table[i].port_attrs; -+ hba_attrs = &hba_table_list->hba_table[i].hba_attrs; -+ - if (ifname && check_symbolic_name_for_interface( -- hba_table[i].port_attrs.PortSymbolicName, -+ port_attrs->PortSymbolicName, - ifname)) { - /* - * Overloading 'displayed' to indicate - * that the HBA/Port should be skipped. - */ -- hba_table[i].displayed = 1; -+ hba_table_list->hba_table[i].displayed = 1; - continue; - } - - for (target_index = 0; -- target_index < hba_table[i].port_attrs.NumberofDiscoveredPorts; -+ target_index < port_attrs->NumberofDiscoveredPorts; - target_index++) { - - /* TODO: Second arg might be incorrect */ - retval = HBA_GetDiscoveredPortAttributes( -- hba_table[i].hba_handle, -+ hba_handle, - 0, target_index, - &rport_attrs); - -@@ -1354,7 +1415,7 @@ enum fcoe_status display_target_info(const char *ifname, - "HBA_GetDiscoveredPortAttributes " - "failed for target_index=%d, " - "status=%d\n", target_index, retval); -- hba_table[i].failed = 1; -+ hba_table_list->hba_table[i].failed = 1; - continue; - } - -@@ -1365,26 +1426,26 @@ enum fcoe_status display_target_info(const char *ifname, - continue; - - show_target_info( -- hba_table[i].port_attrs.PortSymbolicName, -- &hba_table[i].hba_attrs, -+ port_attrs->PortSymbolicName, -+ hba_attrs, - &rport_attrs); - -- if (hba_table[i].port_attrs.PortState != -- HBA_PORTSTATE_ONLINE) -+ if (port_attrs->PortState != HBA_PORTSTATE_ONLINE) - continue; - - /* - * This will print the LUN table - * under the target. - */ -- scan_device_map(hba_table[i].hba_handle, -- &hba_table[i].hba_attrs, -- &hba_table[i].port_attrs, -+ scan_device_map(hba_handle, -+ hba_attrs, -+ port_attrs, - &rport_attrs, ifname, style); - } - } - -- hba_table_destroy(hba_table); -+ hba_table_list_destroy(hba_table_list); -+out: - HBA_FreeLibrary(); - - return rc; --- -1.7.4.4 - diff --git a/fcoe-utils-1.0.18-fcoe-utils-Include-current-lldpad-headers.patch b/fcoe-utils-1.0.18-fcoe-utils-Include-current-lldpad-headers.patch deleted file mode 100644 index d4fb5f2..0000000 --- a/fcoe-utils-1.0.18-fcoe-utils-Include-current-lldpad-headers.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 6394a804ef09b83b78348c189dc4b99b440e0f6b Mon Sep 17 00:00:00 2001 -From: Petr Sabata -Date: Thu, 24 Mar 2011 00:39:30 +0000 -Subject: [PATCH 06/16] fcoe-utils: Include current lldpad headers - -Include current header files provided by open-lldp. - -Signed-off-by: Petr Sabata -Signed-off-by: Robert Love ---- - fcoemon.c | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) - -diff --git a/fcoemon.c b/fcoemon.c -index 9df473a..74795e4 100644 ---- a/fcoemon.c -+++ b/fcoemon.c -@@ -46,7 +46,7 @@ - - #include - #include --#include -+#include - - #include "fcoe_utils_version.h" - #include "fcoemon_utils.h" --- -1.7.4.4 - diff --git a/fcoe-utils-1.0.18-fcoe-utils-Include-fcoe_utils.h-before-scsi-scsi.h.patch b/fcoe-utils-1.0.18-fcoe-utils-Include-fcoe_utils.h-before-scsi-scsi.h.patch deleted file mode 100644 index 1ba706d..0000000 --- a/fcoe-utils-1.0.18-fcoe-utils-Include-fcoe_utils.h-before-scsi-scsi.h.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 5aaaef140bf87138bca14a088a83a70b19fe4f23 Mon Sep 17 00:00:00 2001 -From: Petr Sabata -Date: Tue, 12 Apr 2011 15:38:04 +0000 -Subject: [PATCH 10/16] fcoe-utils: Include fcoe_utils.h before scsi/scsi.h - -The scsi/scsi.h header file defines 'SUCCESS' as 0x2002 which couses the -'SUCCESS' identifier in fcoe_status to get expanded, resulting in fcping -build failure. This patch prevents it by including fcoe_utils.h first. - -Signed-off-by: Petr Sabata -Signed-off-by: Robert Love ---- - fcping.c | 3 +-- - 1 files changed, 1 insertions(+), 2 deletions(-) - -diff --git a/fcping.c b/fcping.c -index 76ce7e2..a68883d 100644 ---- a/fcping.c -+++ b/fcping.c -@@ -47,6 +47,7 @@ - #include - #include "net_types.h" - #include "fc_types.h" -+#include "fcoe_utils.h" - typedef uint8_t u8; - #include - #include -@@ -54,8 +55,6 @@ typedef uint8_t u8; - #include - #include - --#include "fcoe_utils.h" -- - static const char *cmdname; - - #define FC_MAX_PAYLOAD (2112UL - sizeof(net32_t)) --- -1.7.4.4 - diff --git a/fcoe-utils-1.0.18-fcoe-utils-Remove-unused-variable-symbolic_name_len.patch b/fcoe-utils-1.0.18-fcoe-utils-Remove-unused-variable-symbolic_name_len.patch deleted file mode 100644 index ef0b6a0..0000000 --- a/fcoe-utils-1.0.18-fcoe-utils-Remove-unused-variable-symbolic_name_len.patch +++ /dev/null @@ -1,27 +0,0 @@ -From b8d63420e5c33391ff4ba300df862f599cd2a76b Mon Sep 17 00:00:00 2001 -From: Nithin Sujir -Date: Tue, 12 Apr 2011 05:33:06 +0000 -Subject: [PATCH 11/16] fcoe-utils: Remove unused variable symbolic_name_len - -Signed-off-by: Nithin Nayak Sujir -Signed-off-by: Robert Love -Signed-off-by: Petr Sabata ---- - lib/fcoe_utils.c | 1 - - 1 files changed, 0 insertions(+), 1 deletions(-) - -diff --git a/lib/fcoe_utils.c b/lib/fcoe_utils.c -index 0ebdf9b..142b045 100644 ---- a/lib/fcoe_utils.c -+++ b/lib/fcoe_utils.c -@@ -161,7 +161,6 @@ int fcoe_checkdir(char *dir) - */ - char *get_ifname_from_symbolic_name(const char *symbolic_name) - { -- int symbolic_name_len = strlen(symbolic_name); - char *last_space = strrchr(symbolic_name, ' '); - - if (!last_space || strlen(last_space) == 1) --- -1.7.4.4 - diff --git a/fcoe-utils-1.0.18-fcoe-utils-Use-iproute2-instead-of-deprecated-vconfi.patch b/fcoe-utils-1.0.18-fcoe-utils-Use-iproute2-instead-of-deprecated-vconfi.patch deleted file mode 100644 index 033845c..0000000 --- a/fcoe-utils-1.0.18-fcoe-utils-Use-iproute2-instead-of-deprecated-vconfi.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 5300772f83c8f3eeb1dbb972d36b4112ec01a51f Mon Sep 17 00:00:00 2001 -From: Petr Sabata -Date: Fri, 1 Apr 2011 00:00:28 +0000 -Subject: [PATCH 12/16] fcoe-utils: Use iproute2 instead of deprecated vconfig - -vconfig has been considered generally deprecated in favor of iproute2 for -some time now. This patch utilizes `ip link' and removes vconfig dependency. - -Signed-off-by: Petr Sabata -Signed-off-by: Robert Love ---- - contrib/fcoe-setup.sh | 5 ++--- - 1 files changed, 2 insertions(+), 3 deletions(-) - -diff --git a/contrib/fcoe-setup.sh b/contrib/fcoe-setup.sh -index ab23400..2142c42 100755 ---- a/contrib/fcoe-setup.sh -+++ b/contrib/fcoe-setup.sh -@@ -24,9 +24,8 @@ create_vlan () { - vif=$(scan_vlan $ifname $vlan) - - if [ -z "$vif" ] ; then -- vconfig set_name_type DEV_PLUS_VID_NO_PAD -- vconfig add $ifname $vlan > /dev/null -- vif="$ifname.$vlan" -+ vif="$ifname.$vlan" -+ ip link add dev $vif link $ifname type vlan id $vlan - fi - ip link set $vif up - echo "$vif" --- -1.7.4.4 - diff --git a/fcoe-utils-1.0.18-fcoemon-Correct-wrong-error-check.patch b/fcoe-utils-1.0.18-fcoemon-Correct-wrong-error-check.patch deleted file mode 100644 index d8e69b4..0000000 --- a/fcoe-utils-1.0.18-fcoemon-Correct-wrong-error-check.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 1511aba0a6586ccd285c0c326f6f9c1a266c6a10 Mon Sep 17 00:00:00 2001 -From: Mark Rustad -Date: Fri, 8 Apr 2011 00:30:04 +0000 -Subject: [PATCH 14/16] fcoemon: Correct wrong error check. - -Correct wrong error check on return value from a socket() call. 0 is a -valid return, and treating it as an error could result in trouble. - -Signed-off-by: Mark Rustad -Tested-by: Ross Brattain -Signed-off-by: Robert Love -Signed-off-by: Petr Sabata ---- - fcoemon.c | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) - -diff --git a/fcoemon.c b/fcoemon.c -index 77b3fd5..5449ae6 100644 ---- a/fcoemon.c -+++ b/fcoemon.c -@@ -607,7 +607,7 @@ static void fcm_vlan_dev_real_dev(char *vlan_ifname, char *real_ifname) - - fd = socket(PF_INET, SOCK_DGRAM, 0); - -- if (fd <= 0) { -+ if (fd < 0) { - FCM_LOG_ERR(errno, "open vlan query socket error"); - return; - } --- -1.7.4.4 - diff --git a/fcoe-utils-1.0.18-fcoemon-Do-not-create-a-world-and-group-writable-PID.patch b/fcoe-utils-1.0.18-fcoemon-Do-not-create-a-world-and-group-writable-PID.patch deleted file mode 100644 index 3d2f17d..0000000 --- a/fcoe-utils-1.0.18-fcoemon-Do-not-create-a-world-and-group-writable-PID.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 964c51aee4a5007cffed59b40aab5dc2c1861f00 Mon Sep 17 00:00:00 2001 -From: Petr Sabata -Date: Mon, 2 May 2011 20:30:51 +0000 -Subject: [PATCH] fcoemon: Do not create a world and group writable PID file - -Currently fcoemon creates a world and group writable PID file which could be -locally exploited. This patch sets umask to 177 before the PID file creation. - -Signed-off-by: Petr Sabata -Signed-off-by: Robert Love ---- - fcoemon.c | 1 + - 1 files changed, 1 insertions(+), 0 deletions(-) - -diff --git a/fcoemon.c b/fcoemon.c -index f2f3b86..4ee18f3 100644 ---- a/fcoemon.c -+++ b/fcoemon.c -@@ -2320,6 +2320,7 @@ static void fcm_pidfile_create(void) - } - fclose(fp); - } -+ umask(~(S_IRUSR | S_IWUSR)); - fp = fopen(fcm_pidfile, "w+"); - if (fp) { - fprintf(fp, "%d\n", getpid()); --- -1.7.4.4 - diff --git a/fcoe-utils-1.0.18-fcoemon-Fix-2-file-descriptor-leaks.patch b/fcoe-utils-1.0.18-fcoemon-Fix-2-file-descriptor-leaks.patch deleted file mode 100644 index 0d2d33b..0000000 --- a/fcoe-utils-1.0.18-fcoemon-Fix-2-file-descriptor-leaks.patch +++ /dev/null @@ -1,42 +0,0 @@ -From adbae9962146896a90546ef2cd61abc938c7c2f7 Mon Sep 17 00:00:00 2001 -From: Mark Rustad -Date: Fri, 8 Apr 2011 00:24:04 +0000 -Subject: [PATCH 15/16] fcoemon: Fix 2 file descriptor leaks - -Fix 2 file descriptor leaks, one of which can occur repeatedly. - -Signed-off-by: Mark Rustad -Tested-by: Ross Brattain -Signed-off-by: Robert Love -Signed-off-by: Petr Sabata ---- - fcoemon.c | 5 ++++- - 1 files changed, 4 insertions(+), 1 deletions(-) - -diff --git a/fcoemon.c b/fcoemon.c -index 5449ae6..f2f3b86 100644 ---- a/fcoemon.c -+++ b/fcoemon.c -@@ -472,6 +472,7 @@ static int fcm_link_init(void) - rc = bind(fd, (struct sockaddr *)&l_local, sizeof(l_local)); - if (rc == -1) { - FCM_LOG_ERR(errno, "bind error"); -+ close(fd); - return rc; - } - fcm_link_socket = fd; -@@ -1255,8 +1256,10 @@ static void fcm_dcbd_retry_timeout(void *arg) - static void fcm_dcbd_disconnect(void) - { - if (fcm_clif != NULL && fcm_clif->cl_local.sun_path[0] != '\0') { -- if (fcm_clif->cl_fd >= 0) -+ if (fcm_clif->cl_fd >= 0) { - sa_select_rem_fd(fcm_clif->cl_fd); -+ close(fcm_clif->cl_fd); -+ } - unlink(fcm_clif->cl_local.sun_path); - fcm_clif->cl_local.sun_path[0] = '\0'; - fcm_clif->cl_fd = -1; /* mark as disconnected */ --- -1.7.4.4 - diff --git a/fcoe-utils-1.0.18-fcoemon-Unexpected-FLOGI-after-fcoe-port-is-destroye.patch b/fcoe-utils-1.0.18-fcoemon-Unexpected-FLOGI-after-fcoe-port-is-destroye.patch deleted file mode 100644 index f3f6918..0000000 --- a/fcoe-utils-1.0.18-fcoemon-Unexpected-FLOGI-after-fcoe-port-is-destroye.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 16b009e33b6fecab11a856428ada98288724fcbb Mon Sep 17 00:00:00 2001 -From: Nithin Sujir -Date: Wed, 30 Mar 2011 08:56:59 +0000 -Subject: [PATCH 08/16] fcoemon: Unexpected FLOGI after fcoe port is destroyed - -When fcoeadm -d is performed, fcoemon sets fcoe_enable=0 on the -physical port being destroyed but not on the vlan port. If a link toggle -occurs at this time, two link events are received, one each for physical -and vlan interfaces. The physical interface event is ignored due to -fcoe_enable=0 but the vlan event is processed and CREATE is called -resulting in unexpected FLOGI. This also puts the physical and vlan -ports out of sync and a subsequent fcoeadm -d is not processed. - -Signed-off-by: Nithin Nayak Sujir -Signed-off-by: Robert Love -Signed-off-by: Petr Sabata ---- - fcoemon.c | 4 +++- - 1 files changed, 3 insertions(+), 1 deletions(-) - -diff --git a/fcoemon.c b/fcoemon.c -index 74795e4..77b3fd5 100644 ---- a/fcoemon.c -+++ b/fcoemon.c -@@ -2049,8 +2049,10 @@ static void fcm_fcoe_action(struct fcm_netif *ff, struct fcoe_port *p) - /* destroy all the VLANs */ - vp = fcm_find_fcoe_port(p->ifname, FCP_REAL_IFNAME); - while (vp) { -- if (vp->auto_created) -+ if (vp->auto_created) { -+ vp->fcoe_enable = 0; - fcp_set_next_action(vp, FCP_DESTROY_IF); -+ } - vp = fcm_find_next_fcoe_port(vp, p->ifname); - } - rc = SUCCESS; --- -1.7.4.4 - diff --git a/fcoe-utils-1.0.18-fcoemon-Use-new-libfcoe.ko-interfaces-create-destroy.patch b/fcoe-utils-1.0.18-fcoemon-Use-new-libfcoe.ko-interfaces-create-destroy.patch deleted file mode 100644 index d86c49d..0000000 --- a/fcoe-utils-1.0.18-fcoemon-Use-new-libfcoe.ko-interfaces-create-destroy.patch +++ /dev/null @@ -1,33 +0,0 @@ -From dbe527951f6f0836ba8d31ad77d09e8870dfb987 Mon Sep 17 00:00:00 2001 -From: Robert Love -Date: Tue, 25 Jan 2011 04:43:48 +0000 -Subject: [PATCH 01/16] fcoemon: Use new libfcoe.ko interfaces (create, - destroy, ...) - -The create, destroy, enable and disable interfaces have -all moved from fcoe.ko to libfcoe.ko with the kernel -fcoe transport changes. fcoemon needs to use the new kernel -interfaces since the old ones do not exist anymore. - -Signed-off-by: Robert Love -Signed-off-by: Petr Sabata ---- - include/fcoe_utils.h | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) - -diff --git a/include/fcoe_utils.h b/include/fcoe_utils.h -index 48019b5..46085be 100644 ---- a/include/fcoe_utils.h -+++ b/include/fcoe_utils.h -@@ -38,7 +38,7 @@ - #define SYSFS_MOUNT "/sys" - #define SYSFS_NET SYSFS_MOUNT "/class/net" - #define SYSFS_FCHOST SYSFS_MOUNT "/class/fc_host" --#define SYSFS_FCOE SYSFS_MOUNT "/module/fcoe/parameters" -+#define SYSFS_FCOE SYSFS_MOUNT "/module/libfcoe/parameters" - - #define FCHOSTBUFLEN 64 - --- -1.7.4.4 - diff --git a/fcoe-utils-1.0.18-fcoeutils-Cancel-vlan-discovery-timer-only-when-vali.patch b/fcoe-utils-1.0.18-fcoeutils-Cancel-vlan-discovery-timer-only-when-vali.patch deleted file mode 100644 index 247a22a..0000000 --- a/fcoe-utils-1.0.18-fcoeutils-Cancel-vlan-discovery-timer-only-when-vali.patch +++ /dev/null @@ -1,78 +0,0 @@ -From c76c44392b52e58cab9212eb94c19f59835240c7 Mon Sep 17 00:00:00 2001 -From: Nithin Sujir -Date: Wed, 23 Mar 2011 01:38:25 +0000 -Subject: [PATCH 04/16] fcoeutils: Cancel vlan discovery timer only when valid - response is received - -Currently fcoemon cancels the timer as soon as a response is received -whether all the critical descriptors are present or not. This patch -verifies the critical descriptors are present in the vlan response -before cancelling the timer. - -Signed-off-by: Nithin Nayak Sujir -Signed-off-by: Robert Love -Signed-off-by: Petr Sabata ---- - fcoemon.c | 20 ++++++++++++++++---- - 1 files changed, 16 insertions(+), 4 deletions(-) - -diff --git a/fcoemon.c b/fcoemon.c -index cd0916b..042d1c8 100644 ---- a/fcoemon.c -+++ b/fcoemon.c -@@ -517,6 +517,12 @@ int fcm_vlan_disc_handler(struct fiphdr *fh, struct sockaddr_ll *sa, void *arg) - struct fip_tlv_hdr *tlv = (struct fip_tlv_hdr *)(fh + 1); - struct fcoe_port *p = arg; - struct fcoe_port *vp; -+ int desc_mask = 0; -+ -+ enum { -+ VALID_MAC = 1, -+ VALID_VLAN = 2, -+ }; - - if (ntohs(fh->fip_proto) != FIP_PROTO_VLAN) - return -1; -@@ -524,14 +530,12 @@ int fcm_vlan_disc_handler(struct fiphdr *fh, struct sockaddr_ll *sa, void *arg) - if (fh->fip_subcode != FIP_VLAN_NOTE) - return -1; - -- /* cancel the retry timer, response received */ -- sa_timer_cancel(&p->vlan_disc_timer); -- - while (len > 0) { - switch (tlv->tlv_type) { - case FIP_TLV_MAC_ADDR: - memcpy(mac, ((struct fip_tlv_mac_addr *)tlv)->mac_addr, - ETHER_ADDR_LEN); -+ desc_mask |= VALID_MAC; - break; - /* - * this expects to see the MAC_ADDR TLV first, -@@ -545,6 +549,7 @@ int fcm_vlan_disc_handler(struct fiphdr *fh, struct sockaddr_ll *sa, void *arg) - vid = ntohs(((struct fip_tlv_vlan *)tlv)->vlan); - vp = fcm_new_vlan(sa->sll_ifindex, vid); - vp->dcb_required = p->dcb_required; -+ desc_mask |= VALID_VLAN; - break; - default: - /* unexpected or unrecognized descriptor */ -@@ -554,7 +559,14 @@ int fcm_vlan_disc_handler(struct fiphdr *fh, struct sockaddr_ll *sa, void *arg) - len -= tlv->tlv_len; - tlv = ((void *) tlv) + (tlv->tlv_len << 2); - }; -- return 0; -+ -+ if (desc_mask == (VALID_MAC | VALID_VLAN)) { -+ /* cancel the retry timer, valid response received */ -+ sa_timer_cancel(&p->vlan_disc_timer); -+ return 0; -+ } else { -+ return -1; -+ } - } - - static void fcm_fip_recv(void *arg) --- -1.7.4.4 - diff --git a/fcoe-utils-1.0.18-fcoeutils-Retry-vlan-discovery-forever-if-AUTO_VLAN-.patch b/fcoe-utils-1.0.18-fcoeutils-Retry-vlan-discovery-forever-if-AUTO_VLAN-.patch deleted file mode 100644 index 06baddd..0000000 --- a/fcoe-utils-1.0.18-fcoeutils-Retry-vlan-discovery-forever-if-AUTO_VLAN-.patch +++ /dev/null @@ -1,40 +0,0 @@ -From b4e06e408639fa29e3fac5a2235b46a4e1b4a3a0 Mon Sep 17 00:00:00 2001 -From: Nithin Sujir -Date: Wed, 23 Mar 2011 09:36:08 +0000 -Subject: [PATCH 05/16] fcoeutils: Retry vlan discovery forever if AUTO_VLAN - and FCOE_ENABLE are set - -This is a modified patch as per Robert Love's comments - -https://lists.open-fcoe.org/pipermail/devel/2011-March/011272.html - -After trying vlan discovery 10 times fcoemon disables auto_vlan on the -port and falls back to the physical interface. bnx2fc does not support -this. This patch checks for FCOE_ENABLE and AUTO_VLAN and if both are -set for the interface, the vlan discovery will continue until a vlan is -discovered. - -Signed-off-by: Nithin Nayak Sujir -Signed-off-by: Robert Love -Signed-off-by: Petr Sabata ---- - fcoemon.c | 4 +++- - 1 files changed, 3 insertions(+), 1 deletions(-) - -diff --git a/fcoemon.c b/fcoemon.c -index 042d1c8..9df473a 100644 ---- a/fcoemon.c -+++ b/fcoemon.c -@@ -1994,7 +1994,9 @@ void fcm_vlan_disc_timeout(void *arg) - struct fcoe_port *p = arg; - FCM_LOG_DBG("%s: VLAN discovery TIMEOUT [%d]", - p->ifname, p->vlan_disc_count); -- if (++(p->vlan_disc_count) > FCM_VLAN_DISC_MAX) { -+ p->vlan_disc_count++; -+ if (!(p->fcoe_enable && p->auto_vlan) && -+ (p->vlan_disc_count > FCM_VLAN_DISC_MAX)) { - FCM_LOG("%s: VLAN discovery failed after %d attempts", - p->ifname, FCM_VLAN_DISC_MAX); - FCM_LOG("%s: disabling VLAN discovery, trying FCoE on %s", --- -1.7.4.4 - diff --git a/fcoe-utils-1.0.18-kernel-headers.patch b/fcoe-utils-1.0.18-kernel-headers.patch deleted file mode 100644 index eafc0a2..0000000 --- a/fcoe-utils-1.0.18-kernel-headers.patch +++ /dev/null @@ -1,1494 +0,0 @@ -diff -Naurd fcoe-utils-1.0.14.orig/fcnsq.c fcoe-utils-1.0.14/fcnsq.c ---- fcoe-utils-1.0.14.orig/fcnsq.c 2010-05-18 23:50:48.000000000 +0200 -+++ fcoe-utils-1.0.14/fcnsq.c 2011-02-23 15:05:18.289429317 +0100 -@@ -39,9 +39,9 @@ - typedef __u64 u64; - #include - #include --#include --#include --#include -+#include "fc_gs.h" -+#include "fc_ns.h" -+#include "scsi_bsg_fc.h" - - static bool quiet = false; - -diff -Naurd fcoe-utils-1.0.14.orig/fcping.c fcoe-utils-1.0.14/fcping.c ---- fcoe-utils-1.0.14.orig/fcping.c 2010-05-18 23:50:48.000000000 +0200 -+++ fcoe-utils-1.0.14/fcping.c 2011-02-23 15:05:18.289429317 +0100 -@@ -49,10 +49,10 @@ - #include "fc_types.h" - typedef uint8_t u8; - #include --#include --#include --#include --#include -+#include "fc_ns.h" -+#include "fc_gs.h" -+#include "fc_els.h" -+#include "scsi_bsg_fc.h" - - #include "fcoe_utils.h" - -diff -Naurd fcoe-utils-1.0.14.orig/fcrls.c fcoe-utils-1.0.14/fcrls.c ---- fcoe-utils-1.0.14.orig/fcrls.c 2010-05-18 23:50:48.000000000 +0200 -+++ fcoe-utils-1.0.14/fcrls.c 2011-02-23 15:05:34.781471067 +0100 -@@ -40,8 +40,8 @@ - typedef __u64 u64; - #include - #include --#include --#include -+#include "fc_els.h" -+#include "scsi_bsg_fc.h" - - #define ntoh24(n) (u32) ((n)[0] << 16 | (n)[1] << 8 | (n)[2]) - #define hton24(h) { (h) >> 16 & 0xff, (h) >> 8 & 0xff, (h) & 0xff } -diff -Naurd fcoe-utils-1.0.14.orig/include/fc_els.h fcoe-utils-1.0.14/include/fc_els.h ---- fcoe-utils-1.0.14.orig/include/fc_els.h 1970-01-01 01:00:00.000000000 +0100 -+++ fcoe-utils-1.0.14/include/fc_els.h 2011-02-23 15:05:18.302052163 +0100 -@@ -0,0 +1,820 @@ -+/* -+ * 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 _FC_ELS_H_ -+#define _FC_ELS_H_ -+ -+#include -+ -+/* -+ * Fibre Channel Switch - Enhanced Link Services definitions. -+ * From T11 FC-LS Rev 1.2 June 7, 2005. -+ */ -+ -+/* -+ * ELS Command codes - byte 0 of the frame payload -+ */ -+enum fc_els_cmd { -+ ELS_LS_RJT = 0x01, /* ESL reject */ -+ ELS_LS_ACC = 0x02, /* ESL Accept */ -+ ELS_PLOGI = 0x03, /* N_Port login */ -+ ELS_FLOGI = 0x04, /* F_Port login */ -+ ELS_LOGO = 0x05, /* Logout */ -+ ELS_ABTX = 0x06, /* Abort exchange - obsolete */ -+ ELS_RCS = 0x07, /* read connection status */ -+ ELS_RES = 0x08, /* read exchange status block */ -+ ELS_RSS = 0x09, /* read sequence status block */ -+ ELS_RSI = 0x0a, /* read sequence initiative */ -+ ELS_ESTS = 0x0b, /* establish streaming */ -+ ELS_ESTC = 0x0c, /* estimate credit */ -+ ELS_ADVC = 0x0d, /* advise credit */ -+ ELS_RTV = 0x0e, /* read timeout value */ -+ ELS_RLS = 0x0f, /* read link error status block */ -+ ELS_ECHO = 0x10, /* echo */ -+ ELS_TEST = 0x11, /* test */ -+ ELS_RRQ = 0x12, /* reinstate recovery qualifier */ -+ ELS_REC = 0x13, /* read exchange concise */ -+ ELS_SRR = 0x14, /* sequence retransmission request */ -+ ELS_PRLI = 0x20, /* process login */ -+ ELS_PRLO = 0x21, /* process logout */ -+ ELS_SCN = 0x22, /* state change notification */ -+ ELS_TPLS = 0x23, /* test process login state */ -+ ELS_TPRLO = 0x24, /* third party process logout */ -+ ELS_LCLM = 0x25, /* login control list mgmt (obs) */ -+ ELS_GAID = 0x30, /* get alias_ID */ -+ ELS_FACT = 0x31, /* fabric activate alias_id */ -+ ELS_FDACDT = 0x32, /* fabric deactivate alias_id */ -+ ELS_NACT = 0x33, /* N-port activate alias_id */ -+ ELS_NDACT = 0x34, /* N-port deactivate alias_id */ -+ ELS_QOSR = 0x40, /* quality of service request */ -+ ELS_RVCS = 0x41, /* read virtual circuit status */ -+ ELS_PDISC = 0x50, /* discover N_port service params */ -+ ELS_FDISC = 0x51, /* discover F_port service params */ -+ ELS_ADISC = 0x52, /* discover address */ -+ ELS_RNC = 0x53, /* report node cap (obs) */ -+ ELS_FARP_REQ = 0x54, /* FC ARP request */ -+ ELS_FARP_REPL = 0x55, /* FC ARP reply */ -+ ELS_RPS = 0x56, /* read port status block */ -+ ELS_RPL = 0x57, /* read port list */ -+ ELS_RPBC = 0x58, /* read port buffer condition */ -+ ELS_FAN = 0x60, /* fabric address notification */ -+ ELS_RSCN = 0x61, /* registered state change notification */ -+ ELS_SCR = 0x62, /* state change registration */ -+ ELS_RNFT = 0x63, /* report node FC-4 types */ -+ ELS_CSR = 0x68, /* clock synch. request */ -+ ELS_CSU = 0x69, /* clock synch. update */ -+ ELS_LINIT = 0x70, /* loop initialize */ -+ ELS_LSTS = 0x72, /* loop status */ -+ ELS_RNID = 0x78, /* request node ID data */ -+ ELS_RLIR = 0x79, /* registered link incident report */ -+ ELS_LIRR = 0x7a, /* link incident record registration */ -+ ELS_SRL = 0x7b, /* scan remote loop */ -+ ELS_SBRP = 0x7c, /* set bit-error reporting params */ -+ ELS_RPSC = 0x7d, /* report speed capabilities */ -+ ELS_QSA = 0x7e, /* query security attributes */ -+ ELS_EVFP = 0x7f, /* exchange virt. fabrics params */ -+ ELS_LKA = 0x80, /* link keep-alive */ -+ ELS_AUTH_ELS = 0x90, /* authentication ELS */ -+}; -+ -+/* -+ * Initializer useful for decoding table. -+ * Please keep this in sync with the above definitions. -+ */ -+#define FC_ELS_CMDS_INIT { \ -+ [ELS_LS_RJT] = "LS_RJT", \ -+ [ELS_LS_ACC] = "LS_ACC", \ -+ [ELS_PLOGI] = "PLOGI", \ -+ [ELS_FLOGI] = "FLOGI", \ -+ [ELS_LOGO] = "LOGO", \ -+ [ELS_ABTX] = "ABTX", \ -+ [ELS_RCS] = "RCS", \ -+ [ELS_RES] = "RES", \ -+ [ELS_RSS] = "RSS", \ -+ [ELS_RSI] = "RSI", \ -+ [ELS_ESTS] = "ESTS", \ -+ [ELS_ESTC] = "ESTC", \ -+ [ELS_ADVC] = "ADVC", \ -+ [ELS_RTV] = "RTV", \ -+ [ELS_RLS] = "RLS", \ -+ [ELS_ECHO] = "ECHO", \ -+ [ELS_TEST] = "TEST", \ -+ [ELS_RRQ] = "RRQ", \ -+ [ELS_REC] = "REC", \ -+ [ELS_SRR] = "SRR", \ -+ [ELS_PRLI] = "PRLI", \ -+ [ELS_PRLO] = "PRLO", \ -+ [ELS_SCN] = "SCN", \ -+ [ELS_TPLS] = "TPLS", \ -+ [ELS_TPRLO] = "TPRLO", \ -+ [ELS_LCLM] = "LCLM", \ -+ [ELS_GAID] = "GAID", \ -+ [ELS_FACT] = "FACT", \ -+ [ELS_FDACDT] = "FDACDT", \ -+ [ELS_NACT] = "NACT", \ -+ [ELS_NDACT] = "NDACT", \ -+ [ELS_QOSR] = "QOSR", \ -+ [ELS_RVCS] = "RVCS", \ -+ [ELS_PDISC] = "PDISC", \ -+ [ELS_FDISC] = "FDISC", \ -+ [ELS_ADISC] = "ADISC", \ -+ [ELS_RNC] = "RNC", \ -+ [ELS_FARP_REQ] = "FARP_REQ", \ -+ [ELS_FARP_REPL] = "FARP_REPL", \ -+ [ELS_RPS] = "RPS", \ -+ [ELS_RPL] = "RPL", \ -+ [ELS_RPBC] = "RPBC", \ -+ [ELS_FAN] = "FAN", \ -+ [ELS_RSCN] = "RSCN", \ -+ [ELS_SCR] = "SCR", \ -+ [ELS_RNFT] = "RNFT", \ -+ [ELS_CSR] = "CSR", \ -+ [ELS_CSU] = "CSU", \ -+ [ELS_LINIT] = "LINIT", \ -+ [ELS_LSTS] = "LSTS", \ -+ [ELS_RNID] = "RNID", \ -+ [ELS_RLIR] = "RLIR", \ -+ [ELS_LIRR] = "LIRR", \ -+ [ELS_SRL] = "SRL", \ -+ [ELS_SBRP] = "SBRP", \ -+ [ELS_RPSC] = "RPSC", \ -+ [ELS_QSA] = "QSA", \ -+ [ELS_EVFP] = "EVFP", \ -+ [ELS_LKA] = "LKA", \ -+ [ELS_AUTH_ELS] = "AUTH_ELS", \ -+} -+ -+/* -+ * LS_ACC payload. -+ */ -+struct fc_els_ls_acc { -+ __u8 la_cmd; /* command code ELS_LS_ACC */ -+ __u8 la_resv[3]; /* reserved */ -+}; -+ -+/* -+ * ELS reject payload. -+ */ -+struct fc_els_ls_rjt { -+ __u8 er_cmd; /* command code ELS_LS_RJT */ -+ __u8 er_resv[4]; /* reserved must be zero */ -+ __u8 er_reason; /* reason (enum fc_els_rjt_reason below) */ -+ __u8 er_explan; /* explanation (enum fc_els_rjt_explan below) */ -+ __u8 er_vendor; /* vendor specific code */ -+}; -+ -+/* -+ * ELS reject reason codes (er_reason). -+ */ -+enum fc_els_rjt_reason { -+ ELS_RJT_NONE = 0, /* no reject - not to be sent */ -+ ELS_RJT_INVAL = 0x01, /* invalid ELS command code */ -+ ELS_RJT_LOGIC = 0x03, /* logical error */ -+ ELS_RJT_BUSY = 0x05, /* logical busy */ -+ ELS_RJT_PROT = 0x07, /* protocol error */ -+ ELS_RJT_UNAB = 0x09, /* unable to perform command request */ -+ ELS_RJT_UNSUP = 0x0b, /* command not supported */ -+ ELS_RJT_INPROG = 0x0e, /* command already in progress */ -+ ELS_RJT_VENDOR = 0xff, /* vendor specific error */ -+}; -+ -+ -+/* -+ * reason code explanation (er_explan). -+ */ -+enum fc_els_rjt_explan { -+ ELS_EXPL_NONE = 0x00, /* No additional explanation */ -+ ELS_EXPL_SPP_OPT_ERR = 0x01, /* service parameter error - options */ -+ ELS_EXPL_SPP_ICTL_ERR = 0x03, /* service parm error - initiator ctl */ -+ ELS_EXPL_AH = 0x11, /* invalid association header */ -+ ELS_EXPL_AH_REQ = 0x13, /* association_header required */ -+ ELS_EXPL_SID = 0x15, /* invalid originator S_ID */ -+ ELS_EXPL_OXID_RXID = 0x17, /* invalid OX_ID-RX_ID combination */ -+ ELS_EXPL_INPROG = 0x19, /* Request already in progress */ -+ ELS_EXPL_PLOGI_REQD = 0x1e, /* N_Port login required */ -+ ELS_EXPL_INSUF_RES = 0x29, /* insufficient resources */ -+ ELS_EXPL_UNAB_DATA = 0x2a, /* unable to supply requested data */ -+ ELS_EXPL_UNSUPR = 0x2c, /* Request not supported */ -+ ELS_EXPL_INV_LEN = 0x2d, /* Invalid payload length */ -+ /* TBD - above definitions incomplete */ -+}; -+ -+/* -+ * Common service parameters (N ports). -+ */ -+struct fc_els_csp { -+ __u8 sp_hi_ver; /* highest version supported (obs.) */ -+ __u8 sp_lo_ver; /* highest version supported (obs.) */ -+ __be16 sp_bb_cred; /* buffer-to-buffer credits */ -+ __be16 sp_features; /* common feature flags */ -+ __be16 sp_bb_data; /* b-b state number and data field sz */ -+ union { -+ struct { -+ __be16 _sp_tot_seq; /* total concurrent sequences */ -+ __be16 _sp_rel_off; /* rel. offset by info cat */ -+ } sp_plogi; -+ struct { -+ __be32 _sp_r_a_tov; /* resource alloc. timeout msec */ -+ } sp_flogi_acc; -+ } sp_u; -+ __be32 sp_e_d_tov; /* error detect timeout value */ -+}; -+#define sp_tot_seq sp_u.sp_plogi._sp_tot_seq -+#define sp_rel_off sp_u.sp_plogi._sp_rel_off -+#define sp_r_a_tov sp_u.sp_flogi_acc._sp_r_a_tov -+ -+#define FC_SP_BB_DATA_MASK 0xfff /* mask for data field size in sp_bb_data */ -+ -+/* -+ * Minimum and maximum values for max data field size in service parameters. -+ */ -+#define FC_SP_MIN_MAX_PAYLOAD FC_MIN_MAX_PAYLOAD -+#define FC_SP_MAX_MAX_PAYLOAD FC_MAX_PAYLOAD -+ -+/* -+ * sp_features -+ */ -+#define FC_SP_FT_NPIV 0x8000 /* multiple N_Port_ID support (FLOGI) */ -+#define FC_SP_FT_CIRO 0x8000 /* continuously increasing rel off (PLOGI) */ -+#define FC_SP_FT_CLAD 0x8000 /* clean address (in FLOGI LS_ACC) */ -+#define FC_SP_FT_RAND 0x4000 /* random relative offset */ -+#define FC_SP_FT_VAL 0x2000 /* valid vendor version level */ -+#define FC_SP_FT_NPIV_ACC 0x2000 /* NPIV assignment (FLOGI LS_ACC) */ -+#define FC_SP_FT_FPORT 0x1000 /* F port (1) vs. N port (0) */ -+#define FC_SP_FT_ABB 0x0800 /* alternate BB_credit management */ -+#define FC_SP_FT_EDTR 0x0400 /* E_D_TOV Resolution is nanoseconds */ -+#define FC_SP_FT_MCAST 0x0200 /* multicast */ -+#define FC_SP_FT_BCAST 0x0100 /* broadcast */ -+#define FC_SP_FT_HUNT 0x0080 /* hunt group */ -+#define FC_SP_FT_SIMP 0x0040 /* dedicated simplex */ -+#define FC_SP_FT_SEC 0x0020 /* reserved for security */ -+#define FC_SP_FT_CSYN 0x0010 /* clock synch. supported */ -+#define FC_SP_FT_RTTOV 0x0008 /* R_T_TOV value 100 uS, else 100 mS */ -+#define FC_SP_FT_HALF 0x0004 /* dynamic half duplex */ -+#define FC_SP_FT_SEQC 0x0002 /* SEQ_CNT */ -+#define FC_SP_FT_PAYL 0x0001 /* FLOGI payload length 256, else 116 */ -+ -+/* -+ * Class-specific service parameters. -+ */ -+struct fc_els_cssp { -+ __be16 cp_class; /* class flags */ -+ __be16 cp_init; /* initiator flags */ -+ __be16 cp_recip; /* recipient flags */ -+ __be16 cp_rdfs; /* receive data field size */ -+ __be16 cp_con_seq; /* concurrent sequences */ -+ __be16 cp_ee_cred; /* N-port end-to-end credit */ -+ __u8 cp_resv1; /* reserved */ -+ __u8 cp_open_seq; /* open sequences per exchange */ -+ __u8 _cp_resv2[2]; /* reserved */ -+}; -+ -+/* -+ * cp_class flags. -+ */ -+#define FC_CPC_VALID 0x8000 /* class valid */ -+#define FC_CPC_IMIX 0x4000 /* intermix mode */ -+#define FC_CPC_SEQ 0x0800 /* sequential delivery */ -+#define FC_CPC_CAMP 0x0200 /* camp-on */ -+#define FC_CPC_PRI 0x0080 /* priority */ -+ -+/* -+ * cp_init flags. -+ * (TBD: not all flags defined here). -+ */ -+#define FC_CPI_CSYN 0x0010 /* clock synch. capable */ -+ -+/* -+ * cp_recip flags. -+ */ -+#define FC_CPR_CSYN 0x0008 /* clock synch. capable */ -+ -+/* -+ * NFC_ELS_FLOGI: Fabric login request. -+ * NFC_ELS_PLOGI: Port login request (same format). -+ */ -+struct fc_els_flogi { -+ __u8 fl_cmd; /* command */ -+ __u8 _fl_resvd[3]; /* must be zero */ -+ struct fc_els_csp fl_csp; /* common service parameters */ -+ __be64 fl_wwpn; /* port name */ -+ __be64 fl_wwnn; /* node name */ -+ struct fc_els_cssp fl_cssp[4]; /* class 1-4 service parameters */ -+ __u8 fl_vend[16]; /* vendor version level */ -+} __attribute__((__packed__)); -+ -+/* -+ * Process login service parameter page. -+ */ -+struct fc_els_spp { -+ __u8 spp_type; /* type code or common service params */ -+ __u8 spp_type_ext; /* type code extension */ -+ __u8 spp_flags; -+ __u8 _spp_resvd; -+ __be32 spp_orig_pa; /* originator process associator */ -+ __be32 spp_resp_pa; /* responder process associator */ -+ __be32 spp_params; /* service parameters */ -+}; -+ -+/* -+ * spp_flags. -+ */ -+#define FC_SPP_OPA_VAL 0x80 /* originator proc. assoc. valid */ -+#define FC_SPP_RPA_VAL 0x40 /* responder proc. assoc. valid */ -+#define FC_SPP_EST_IMG_PAIR 0x20 /* establish image pair */ -+#define FC_SPP_RESP_MASK 0x0f /* mask for response code (below) */ -+ -+/* -+ * SPP response code in spp_flags - lower 4 bits. -+ */ -+enum fc_els_spp_resp { -+ FC_SPP_RESP_ACK = 1, /* request executed */ -+ FC_SPP_RESP_RES = 2, /* unable due to lack of resources */ -+ FC_SPP_RESP_INIT = 3, /* initialization not complete */ -+ FC_SPP_RESP_NO_PA = 4, /* unknown process associator */ -+ FC_SPP_RESP_CONF = 5, /* configuration precludes image pair */ -+ FC_SPP_RESP_COND = 6, /* request completed conditionally */ -+ FC_SPP_RESP_MULT = 7, /* unable to handle multiple SPPs */ -+ FC_SPP_RESP_INVL = 8, /* SPP is invalid */ -+}; -+ -+/* -+ * ELS_RRQ - Reinstate Recovery Qualifier -+ */ -+struct fc_els_rrq { -+ __u8 rrq_cmd; /* command (0x12) */ -+ __u8 rrq_zero[3]; /* specified as zero - part of cmd */ -+ __u8 rrq_resvd; /* reserved */ -+ __u8 rrq_s_id[3]; /* originator FID */ -+ __be16 rrq_ox_id; /* originator exchange ID */ -+ __be16 rrq_rx_id; /* responders exchange ID */ -+}; -+ -+/* -+ * ELS_REC - Read exchange concise. -+ */ -+struct fc_els_rec { -+ __u8 rec_cmd; /* command (0x13) */ -+ __u8 rec_zero[3]; /* specified as zero - part of cmd */ -+ __u8 rec_resvd; /* reserved */ -+ __u8 rec_s_id[3]; /* originator FID */ -+ __be16 rec_ox_id; /* originator exchange ID */ -+ __be16 rec_rx_id; /* responders exchange ID */ -+}; -+ -+/* -+ * ELS_REC LS_ACC payload. -+ */ -+struct fc_els_rec_acc { -+ __u8 reca_cmd; /* accept (0x02) */ -+ __u8 reca_zero[3]; /* specified as zero - part of cmd */ -+ __be16 reca_ox_id; /* originator exchange ID */ -+ __be16 reca_rx_id; /* responders exchange ID */ -+ __u8 reca_resvd1; /* reserved */ -+ __u8 reca_ofid[3]; /* originator FID */ -+ __u8 reca_resvd2; /* reserved */ -+ __u8 reca_rfid[3]; /* responder FID */ -+ __be32 reca_fc4value; /* FC4 value */ -+ __be32 reca_e_stat; /* ESB (exchange status block) status */ -+}; -+ -+/* -+ * ELS_PRLI - Process login request and response. -+ */ -+struct fc_els_prli { -+ __u8 prli_cmd; /* command */ -+ __u8 prli_spp_len; /* length of each serv. parm. page */ -+ __be16 prli_len; /* length of entire payload */ -+ /* service parameter pages follow */ -+}; -+ -+/* -+ * ELS_ADISC payload -+ */ -+struct fc_els_adisc { -+ __u8 adisc_cmd; -+ __u8 adisc_resv[3]; -+ __u8 adisc_resv1; -+ __u8 adisc_hard_addr[3]; -+ __be64 adisc_wwpn; -+ __be64 adisc_wwnn; -+ __u8 adisc_resv2; -+ __u8 adisc_port_id[3]; -+} __attribute__((__packed__)); -+ -+/* -+ * ELS_LOGO - process or fabric logout. -+ */ -+struct fc_els_logo { -+ __u8 fl_cmd; /* command code */ -+ __u8 fl_zero[3]; /* specified as zero - part of cmd */ -+ __u8 fl_resvd; /* reserved */ -+ __u8 fl_n_port_id[3];/* N port ID */ -+ __be64 fl_n_port_wwn; /* port name */ -+}; -+ -+/* -+ * ELS_RTV - read timeout value. -+ */ -+struct fc_els_rtv { -+ __u8 rtv_cmd; /* command code 0x0e */ -+ __u8 rtv_zero[3]; /* specified as zero - part of cmd */ -+}; -+ -+/* -+ * LS_ACC for ELS_RTV - read timeout value. -+ */ -+struct fc_els_rtv_acc { -+ __u8 rtv_cmd; /* command code 0x02 */ -+ __u8 rtv_zero[3]; /* specified as zero - part of cmd */ -+ __be32 rtv_r_a_tov; /* resource allocation timeout value */ -+ __be32 rtv_e_d_tov; /* error detection timeout value */ -+ __be32 rtv_toq; /* timeout qualifier (see below) */ -+}; -+ -+/* -+ * rtv_toq bits. -+ */ -+#define FC_ELS_RTV_EDRES (1 << 26) /* E_D_TOV resolution is nS else mS */ -+#define FC_ELS_RTV_RTTOV (1 << 19) /* R_T_TOV is 100 uS else 100 mS */ -+ -+/* -+ * ELS_SCR - state change registration payload. -+ */ -+struct fc_els_scr { -+ __u8 scr_cmd; /* command code */ -+ __u8 scr_resv[6]; /* reserved */ -+ __u8 scr_reg_func; /* registration function (see below) */ -+}; -+ -+enum fc_els_scr_func { -+ ELS_SCRF_FAB = 1, /* fabric-detected registration */ -+ ELS_SCRF_NPORT = 2, /* Nx_Port-detected registration */ -+ ELS_SCRF_FULL = 3, /* full registration */ -+ ELS_SCRF_CLEAR = 255, /* remove any current registrations */ -+}; -+ -+/* -+ * ELS_RSCN - registered state change notification payload. -+ */ -+struct fc_els_rscn { -+ __u8 rscn_cmd; /* RSCN opcode (0x61) */ -+ __u8 rscn_page_len; /* page length (4) */ -+ __be16 rscn_plen; /* payload length including this word */ -+ -+ /* followed by 4-byte generic affected Port_ID pages */ -+}; -+ -+struct fc_els_rscn_page { -+ __u8 rscn_page_flags; /* event and address format */ -+ __u8 rscn_fid[3]; /* fabric ID */ -+}; -+ -+#define ELS_RSCN_EV_QUAL_BIT 2 /* shift count for event qualifier */ -+#define ELS_RSCN_EV_QUAL_MASK 0xf /* mask for event qualifier */ -+#define ELS_RSCN_ADDR_FMT_BIT 0 /* shift count for address format */ -+#define ELS_RSCN_ADDR_FMT_MASK 0x3 /* mask for address format */ -+ -+enum fc_els_rscn_ev_qual { -+ ELS_EV_QUAL_NONE = 0, /* unspecified */ -+ ELS_EV_QUAL_NS_OBJ = 1, /* changed name server object */ -+ ELS_EV_QUAL_PORT_ATTR = 2, /* changed port attribute */ -+ ELS_EV_QUAL_SERV_OBJ = 3, /* changed service object */ -+ ELS_EV_QUAL_SW_CONFIG = 4, /* changed switch configuration */ -+ ELS_EV_QUAL_REM_OBJ = 5, /* removed object */ -+}; -+ -+enum fc_els_rscn_addr_fmt { -+ ELS_ADDR_FMT_PORT = 0, /* rscn_fid is a port address */ -+ ELS_ADDR_FMT_AREA = 1, /* rscn_fid is a area address */ -+ ELS_ADDR_FMT_DOM = 2, /* rscn_fid is a domain address */ -+ ELS_ADDR_FMT_FAB = 3, /* anything on fabric may have changed */ -+}; -+ -+/* -+ * ELS_RNID - request Node ID. -+ */ -+struct fc_els_rnid { -+ __u8 rnid_cmd; /* RNID opcode (0x78) */ -+ __u8 rnid_resv[3]; /* reserved */ -+ __u8 rnid_fmt; /* data format */ -+ __u8 rnid_resv2[3]; /* reserved */ -+}; -+ -+/* -+ * Node Identification Data formats (rnid_fmt) -+ */ -+enum fc_els_rnid_fmt { -+ ELS_RNIDF_NONE = 0, /* no specific identification data */ -+ ELS_RNIDF_GEN = 0xdf, /* general topology discovery format */ -+}; -+ -+/* -+ * ELS_RNID response. -+ */ -+struct fc_els_rnid_resp { -+ __u8 rnid_cmd; /* response code (LS_ACC) */ -+ __u8 rnid_resv[3]; /* reserved */ -+ __u8 rnid_fmt; /* data format */ -+ __u8 rnid_cid_len; /* common ID data length */ -+ __u8 rnid_resv2; /* reserved */ -+ __u8 rnid_sid_len; /* specific ID data length */ -+}; -+ -+struct fc_els_rnid_cid { -+ __be64 rnid_wwpn; /* N port name */ -+ __be64 rnid_wwnn; /* node name */ -+}; -+ -+struct fc_els_rnid_gen { -+ __u8 rnid_vend_id[16]; /* vendor-unique ID */ -+ __be32 rnid_atype; /* associated type (see below) */ -+ __be32 rnid_phys_port; /* physical port number */ -+ __be32 rnid_att_nodes; /* number of attached nodes */ -+ __u8 rnid_node_mgmt; /* node management (see below) */ -+ __u8 rnid_ip_ver; /* IP version (see below) */ -+ __be16 rnid_prot_port; /* UDP / TCP port number */ -+ __be32 rnid_ip_addr[4]; /* IP address */ -+ __u8 rnid_resvd[2]; /* reserved */ -+ __be16 rnid_vend_spec; /* vendor-specific field */ -+}; -+ -+enum fc_els_rnid_atype { -+ ELS_RNIDA_UNK = 0x01, /* unknown */ -+ ELS_RNIDA_OTHER = 0x02, /* none of the following */ -+ ELS_RNIDA_HUB = 0x03, -+ ELS_RNIDA_SWITCH = 0x04, -+ ELS_RNIDA_GATEWAY = 0x05, -+ ELS_RNIDA_CONV = 0x06, /* Obsolete, do not use this value */ -+ ELS_RNIDA_HBA = 0x07, /* Obsolete, do not use this value */ -+ ELS_RNIDA_PROXY = 0x08, /* Obsolete, do not use this value */ -+ ELS_RNIDA_STORAGE = 0x09, -+ ELS_RNIDA_HOST = 0x0a, -+ ELS_RNIDA_SUBSYS = 0x0b, /* storage subsystem (e.g., RAID) */ -+ ELS_RNIDA_ACCESS = 0x0e, /* access device (e.g. media changer) */ -+ ELS_RNIDA_NAS = 0x11, /* NAS server */ -+ ELS_RNIDA_BRIDGE = 0x12, /* bridge */ -+ ELS_RNIDA_VIRT = 0x13, /* virtualization device */ -+ ELS_RNIDA_MF = 0xff, /* multifunction device (bits below) */ -+ ELS_RNIDA_MF_HUB = 1UL << 31, /* hub */ -+ ELS_RNIDA_MF_SW = 1UL << 30, /* switch */ -+ ELS_RNIDA_MF_GW = 1UL << 29, /* gateway */ -+ ELS_RNIDA_MF_ST = 1UL << 28, /* storage */ -+ ELS_RNIDA_MF_HOST = 1UL << 27, /* host */ -+ ELS_RNIDA_MF_SUB = 1UL << 26, /* storage subsystem */ -+ ELS_RNIDA_MF_ACC = 1UL << 25, /* storage access dev */ -+ ELS_RNIDA_MF_WDM = 1UL << 24, /* wavelength division mux */ -+ ELS_RNIDA_MF_NAS = 1UL << 23, /* NAS server */ -+ ELS_RNIDA_MF_BR = 1UL << 22, /* bridge */ -+ ELS_RNIDA_MF_VIRT = 1UL << 21, /* virtualization device */ -+}; -+ -+enum fc_els_rnid_mgmt { -+ ELS_RNIDM_SNMP = 0, -+ ELS_RNIDM_TELNET = 1, -+ ELS_RNIDM_HTTP = 2, -+ ELS_RNIDM_HTTPS = 3, -+ ELS_RNIDM_XML = 4, /* HTTP + XML */ -+}; -+ -+enum fc_els_rnid_ipver { -+ ELS_RNIDIP_NONE = 0, /* no IP support or node mgmt. */ -+ ELS_RNIDIP_V4 = 1, /* IPv4 */ -+ ELS_RNIDIP_V6 = 2, /* IPv6 */ -+}; -+ -+/* -+ * ELS RPL - Read Port List. -+ */ -+struct fc_els_rpl { -+ __u8 rpl_cmd; /* command */ -+ __u8 rpl_resv[5]; /* reserved - must be zero */ -+ __be16 rpl_max_size; /* maximum response size or zero */ -+ __u8 rpl_resv1; /* reserved - must be zero */ -+ __u8 rpl_index[3]; /* starting index */ -+}; -+ -+/* -+ * Port number block in RPL response. -+ */ -+struct fc_els_pnb { -+ __be32 pnb_phys_pn; /* physical port number */ -+ __u8 pnb_resv; /* reserved */ -+ __u8 pnb_port_id[3]; /* port ID */ -+ __be64 pnb_wwpn; /* port name */ -+}; -+ -+/* -+ * RPL LS_ACC response. -+ */ -+struct fc_els_rpl_resp { -+ __u8 rpl_cmd; /* ELS_LS_ACC */ -+ __u8 rpl_resv1; /* reserved - must be zero */ -+ __be16 rpl_plen; /* payload length */ -+ __u8 rpl_resv2; /* reserved - must be zero */ -+ __u8 rpl_llen[3]; /* list length */ -+ __u8 rpl_resv3; /* reserved - must be zero */ -+ __u8 rpl_index[3]; /* starting index */ -+ struct fc_els_pnb rpl_pnb[1]; /* variable number of PNBs */ -+}; -+ -+/* -+ * Link Error Status Block. -+ */ -+struct fc_els_lesb { -+ __be32 lesb_link_fail; /* link failure count */ -+ __be32 lesb_sync_loss; /* loss of synchronization count */ -+ __be32 lesb_sig_loss; /* loss of signal count */ -+ __be32 lesb_prim_err; /* primitive sequence error count */ -+ __be32 lesb_inv_word; /* invalid transmission word count */ -+ __be32 lesb_inv_crc; /* invalid CRC count */ -+}; -+ -+/* -+ * ELS RPS - Read Port Status Block request. -+ */ -+struct fc_els_rps { -+ __u8 rps_cmd; /* command */ -+ __u8 rps_resv[2]; /* reserved - must be zero */ -+ __u8 rps_flag; /* flag - see below */ -+ __be64 rps_port_spec; /* port selection */ -+}; -+ -+enum fc_els_rps_flag { -+ FC_ELS_RPS_DID = 0x00, /* port identified by D_ID of req. */ -+ FC_ELS_RPS_PPN = 0x01, /* port_spec is physical port number */ -+ FC_ELS_RPS_WWPN = 0x02, /* port_spec is port WWN */ -+}; -+ -+/* -+ * ELS RPS LS_ACC response. -+ */ -+struct fc_els_rps_resp { -+ __u8 rps_cmd; /* command - LS_ACC */ -+ __u8 rps_resv[2]; /* reserved - must be zero */ -+ __u8 rps_flag; /* flag - see below */ -+ __u8 rps_resv2[2]; /* reserved */ -+ __be16 rps_status; /* port status - see below */ -+ struct fc_els_lesb rps_lesb; /* link error status block */ -+}; -+ -+enum fc_els_rps_resp_flag { -+ FC_ELS_RPS_LPEV = 0x01, /* L_port extension valid */ -+}; -+ -+enum fc_els_rps_resp_status { -+ FC_ELS_RPS_PTP = 1 << 5, /* point-to-point connection */ -+ FC_ELS_RPS_LOOP = 1 << 4, /* loop mode */ -+ FC_ELS_RPS_FAB = 1 << 3, /* fabric present */ -+ FC_ELS_RPS_NO_SIG = 1 << 2, /* loss of signal */ -+ FC_ELS_RPS_NO_SYNC = 1 << 1, /* loss of synchronization */ -+ FC_ELS_RPS_RESET = 1 << 0, /* in link reset protocol */ -+}; -+ -+/* -+ * ELS LIRR - Link Incident Record Registration request. -+ */ -+struct fc_els_lirr { -+ __u8 lirr_cmd; /* command */ -+ __u8 lirr_resv[3]; /* reserved - must be zero */ -+ __u8 lirr_func; /* registration function */ -+ __u8 lirr_fmt; /* FC-4 type of RLIR requested */ -+ __u8 lirr_resv2[2]; /* reserved - must be zero */ -+}; -+ -+enum fc_els_lirr_func { -+ ELS_LIRR_SET_COND = 0x01, /* set - conditionally receive */ -+ ELS_LIRR_SET_UNCOND = 0x02, /* set - unconditionally receive */ -+ ELS_LIRR_CLEAR = 0xff /* clear registration */ -+}; -+ -+/* -+ * ELS SRL - Scan Remote Loop request. -+ */ -+struct fc_els_srl { -+ __u8 srl_cmd; /* command */ -+ __u8 srl_resv[3]; /* reserved - must be zero */ -+ __u8 srl_flag; /* flag - see below */ -+ __u8 srl_flag_param[3]; /* flag parameter */ -+}; -+ -+enum fc_els_srl_flag { -+ FC_ELS_SRL_ALL = 0x00, /* scan all FL ports */ -+ FC_ELS_SRL_ONE = 0x01, /* scan specified loop */ -+ FC_ELS_SRL_EN_PER = 0x02, /* enable periodic scanning (param) */ -+ FC_ELS_SRL_DIS_PER = 0x03, /* disable periodic scanning */ -+}; -+ -+/* -+ * ELS RLS - Read Link Error Status Block request. -+ */ -+struct fc_els_rls { -+ __u8 rls_cmd; /* command */ -+ __u8 rls_resv[4]; /* reserved - must be zero */ -+ __u8 rls_port_id[3]; /* port ID */ -+}; -+ -+/* -+ * ELS RLS LS_ACC Response. -+ */ -+struct fc_els_rls_resp { -+ __u8 rls_cmd; /* ELS_LS_ACC */ -+ __u8 rls_resv[3]; /* reserved - must be zero */ -+ struct fc_els_lesb rls_lesb; /* link error status block */ -+}; -+ -+/* -+ * ELS RLIR - Registered Link Incident Report. -+ * This is followed by the CLIR and the CLID, described below. -+ */ -+struct fc_els_rlir { -+ __u8 rlir_cmd; /* command */ -+ __u8 rlir_resv[3]; /* reserved - must be zero */ -+ __u8 rlir_fmt; /* format (FC4-type if type specific) */ -+ __u8 rlir_clr_len; /* common link incident record length */ -+ __u8 rlir_cld_len; /* common link incident desc. length */ -+ __u8 rlir_slr_len; /* spec. link incident record length */ -+}; -+ -+/* -+ * CLIR - Common Link Incident Record Data. - Sent via RLIR. -+ */ -+struct fc_els_clir { -+ __be64 clir_wwpn; /* incident port name */ -+ __be64 clir_wwnn; /* incident port node name */ -+ __u8 clir_port_type; /* incident port type */ -+ __u8 clir_port_id[3]; /* incident port ID */ -+ -+ __be64 clir_conn_wwpn; /* connected port name */ -+ __be64 clir_conn_wwnn; /* connected node name */ -+ __be64 clir_fab_name; /* fabric name */ -+ __be32 clir_phys_port; /* physical port number */ -+ __be32 clir_trans_id; /* transaction ID */ -+ __u8 clir_resv[3]; /* reserved */ -+ __u8 clir_ts_fmt; /* time stamp format */ -+ __be64 clir_timestamp; /* time stamp */ -+}; -+ -+/* -+ * CLIR clir_ts_fmt - time stamp format values. -+ */ -+enum fc_els_clir_ts_fmt { -+ ELS_CLIR_TS_UNKNOWN = 0, /* time stamp field unknown */ -+ ELS_CLIR_TS_SEC_FRAC = 1, /* time in seconds and fractions */ -+ ELS_CLIR_TS_CSU = 2, /* time in clock synch update format */ -+}; -+ -+/* -+ * Common Link Incident Descriptor - sent via RLIR. -+ */ -+struct fc_els_clid { -+ __u8 clid_iq; /* incident qualifier flags */ -+ __u8 clid_ic; /* incident code */ -+ __be16 clid_epai; /* domain/area of ISL */ -+}; -+ -+/* -+ * CLID incident qualifier flags. -+ */ -+enum fc_els_clid_iq { -+ ELS_CLID_SWITCH = 0x20, /* incident port is a switch node */ -+ ELS_CLID_E_PORT = 0x10, /* incident is an ISL (E) port */ -+ ELS_CLID_SEV_MASK = 0x0c, /* severity 2-bit field mask */ -+ ELS_CLID_SEV_INFO = 0x00, /* report is informational */ -+ ELS_CLID_SEV_INOP = 0x08, /* link not operational */ -+ ELS_CLID_SEV_DEG = 0x04, /* link degraded but operational */ -+ ELS_CLID_LASER = 0x02, /* subassembly is a laser */ -+ ELS_CLID_FRU = 0x01, /* format can identify a FRU */ -+}; -+ -+/* -+ * CLID incident code. -+ */ -+enum fc_els_clid_ic { -+ ELS_CLID_IC_IMPL = 1, /* implicit incident */ -+ ELS_CLID_IC_BER = 2, /* bit-error-rate threshold exceeded */ -+ ELS_CLID_IC_LOS = 3, /* loss of synch or signal */ -+ ELS_CLID_IC_NOS = 4, /* non-operational primitive sequence */ -+ ELS_CLID_IC_PST = 5, /* primitive sequence timeout */ -+ ELS_CLID_IC_INVAL = 6, /* invalid primitive sequence */ -+ ELS_CLID_IC_LOOP_TO = 7, /* loop initialization time out */ -+ ELS_CLID_IC_LIP = 8, /* receiving LIP */ -+}; -+ -+#endif /* _FC_ELS_H_ */ -diff -Naurd fcoe-utils-1.0.14.orig/include/fc_gs.h fcoe-utils-1.0.14/include/fc_gs.h ---- fcoe-utils-1.0.14.orig/include/fc_gs.h 1970-01-01 01:00:00.000000000 +0100 -+++ fcoe-utils-1.0.14/include/fc_gs.h 2011-02-23 15:05:18.302052163 +0100 -@@ -0,0 +1,96 @@ -+/* -+ * 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 _FC_GS_H_ -+#define _FC_GS_H_ -+ -+#include -+ -+/* -+ * Fibre Channel Services - Common Transport. -+ * From T11.org FC-GS-2 Rev 5.3 November 1998. -+ */ -+ -+struct fc_ct_hdr { -+ __u8 ct_rev; /* revision */ -+ __u8 ct_in_id[3]; /* N_Port ID of original requestor */ -+ __u8 ct_fs_type; /* type of fibre channel service */ -+ __u8 ct_fs_subtype; /* subtype */ -+ __u8 ct_options; -+ __u8 _ct_resvd1; -+ __be16 ct_cmd; /* command / response code */ -+ __be16 ct_mr_size; /* maximum / residual size */ -+ __u8 _ct_resvd2; -+ __u8 ct_reason; /* reject reason */ -+ __u8 ct_explan; /* reason code explanation */ -+ __u8 ct_vendor; /* vendor unique data */ -+}; -+ -+#define FC_CT_HDR_LEN 16 /* expected sizeof (struct fc_ct_hdr) */ -+ -+enum fc_ct_rev { -+ FC_CT_REV = 1 /* common transport revision */ -+}; -+ -+/* -+ * ct_fs_type values. -+ */ -+enum fc_ct_fs_type { -+ FC_FST_ALIAS = 0xf8, /* alias service */ -+ FC_FST_MGMT = 0xfa, /* management service */ -+ FC_FST_TIME = 0xfb, /* time service */ -+ FC_FST_DIR = 0xfc, /* directory service */ -+}; -+ -+/* -+ * ct_cmd: Command / response codes -+ */ -+enum fc_ct_cmd { -+ FC_FS_RJT = 0x8001, /* reject */ -+ FC_FS_ACC = 0x8002, /* accept */ -+}; -+ -+/* -+ * FS_RJT reason codes. -+ */ -+enum fc_ct_reason { -+ FC_FS_RJT_CMD = 0x01, /* invalid command code */ -+ FC_FS_RJT_VER = 0x02, /* invalid version level */ -+ FC_FS_RJT_LOG = 0x03, /* logical error */ -+ FC_FS_RJT_IUSIZ = 0x04, /* invalid IU size */ -+ FC_FS_RJT_BSY = 0x05, /* logical busy */ -+ FC_FS_RJT_PROTO = 0x07, /* protocol error */ -+ FC_FS_RJT_UNABL = 0x09, /* unable to perform command request */ -+ FC_FS_RJT_UNSUP = 0x0b, /* command not supported */ -+}; -+ -+/* -+ * FS_RJT reason code explanations. -+ */ -+enum fc_ct_explan { -+ FC_FS_EXP_NONE = 0x00, /* no additional explanation */ -+ FC_FS_EXP_PID = 0x01, /* port ID not registered */ -+ FC_FS_EXP_PNAM = 0x02, /* port name not registered */ -+ FC_FS_EXP_NNAM = 0x03, /* node name not registered */ -+ FC_FS_EXP_COS = 0x04, /* class of service not registered */ -+ FC_FS_EXP_FTNR = 0x07, /* FC-4 types not registered */ -+ /* definitions not complete */ -+}; -+ -+#endif /* _FC_GS_H_ */ -diff -Naurd fcoe-utils-1.0.14.orig/include/fc_ns.h fcoe-utils-1.0.14/include/fc_ns.h ---- fcoe-utils-1.0.14.orig/include/fc_ns.h 1970-01-01 01:00:00.000000000 +0100 -+++ fcoe-utils-1.0.14/include/fc_ns.h 2011-02-23 15:05:18.305426345 +0100 -@@ -0,0 +1,192 @@ -+/* -+ * 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 _FC_NS_H_ -+#define _FC_NS_H_ -+ -+#include -+ -+/* -+ * Fibre Channel Services - Name Service (dNS) -+ * From T11.org FC-GS-2 Rev 5.3 November 1998. -+ */ -+ -+/* -+ * Common-transport sub-type for Name Server. -+ */ -+#define FC_NS_SUBTYPE 2 /* fs_ct_hdr.ct_fs_subtype */ -+ -+/* -+ * Name server Requests. -+ * Note: this is an incomplete list, some unused requests are omitted. -+ */ -+enum fc_ns_req { -+ FC_NS_GA_NXT = 0x0100, /* get all next */ -+ FC_NS_GI_A = 0x0101, /* get identifiers - scope */ -+ FC_NS_GPN_ID = 0x0112, /* get port name by ID */ -+ FC_NS_GNN_ID = 0x0113, /* get node name by ID */ -+ FC_NS_GID_PN = 0x0121, /* get ID for port name */ -+ FC_NS_GID_NN = 0x0131, /* get IDs for node name */ -+ FC_NS_GID_FT = 0x0171, /* get IDs by FC4 type */ -+ FC_NS_GPN_FT = 0x0172, /* get port names by FC4 type */ -+ FC_NS_GID_PT = 0x01a1, /* get IDs by port type */ -+ FC_NS_RPN_ID = 0x0212, /* reg port name for ID */ -+ FC_NS_RNN_ID = 0x0213, /* reg node name for ID */ -+ FC_NS_RFT_ID = 0x0217, /* reg FC4 type for ID */ -+ FC_NS_RSPN_ID = 0x0218, /* reg symbolic port name */ -+ FC_NS_RFF_ID = 0x021f, /* reg FC4 Features for ID */ -+ FC_NS_RSNN_NN = 0x0239, /* reg symbolic node name */ -+}; -+ -+/* -+ * Port type values. -+ */ -+enum fc_ns_pt { -+ FC_NS_UNID_PORT = 0x00, /* unidentified */ -+ FC_NS_N_PORT = 0x01, /* N port */ -+ FC_NS_NL_PORT = 0x02, /* NL port */ -+ FC_NS_FNL_PORT = 0x03, /* F/NL port */ -+ FC_NS_NX_PORT = 0x7f, /* Nx port */ -+ FC_NS_F_PORT = 0x81, /* F port */ -+ FC_NS_FL_PORT = 0x82, /* FL port */ -+ FC_NS_E_PORT = 0x84, /* E port */ -+ FC_NS_B_PORT = 0x85, /* B port */ -+}; -+ -+/* -+ * Port type object. -+ */ -+struct fc_ns_pt_obj { -+ __u8 pt_type; -+}; -+ -+/* -+ * Port ID object -+ */ -+struct fc_ns_fid { -+ __u8 fp_flags; /* flags for responses only */ -+ __u8 fp_fid[3]; -+}; -+ -+/* -+ * fp_flags in port ID object, for responses only. -+ */ -+#define FC_NS_FID_LAST 0x80 /* last object */ -+ -+/* -+ * FC4-types object. -+ */ -+#define FC_NS_TYPES 256 /* number of possible FC-4 types */ -+#define FC_NS_BPW 32 /* bits per word in bitmap */ -+ -+struct fc_ns_fts { -+ __be32 ff_type_map[FC_NS_TYPES / FC_NS_BPW]; /* bitmap of FC-4 types */ -+}; -+ -+/* -+ * GID_PT request. -+ */ -+struct fc_ns_gid_pt { -+ __u8 fn_pt_type; -+ __u8 fn_domain_id_scope; -+ __u8 fn_area_id_scope; -+ __u8 fn_resvd; -+}; -+ -+/* -+ * GID_FT or GPN_FT request. -+ */ -+struct fc_ns_gid_ft { -+ __u8 fn_resvd; -+ __u8 fn_domain_id_scope; -+ __u8 fn_area_id_scope; -+ __u8 fn_fc4_type; -+}; -+ -+/* -+ * GPN_FT response. -+ */ -+struct fc_gpn_ft_resp { -+ __u8 fp_flags; /* see fp_flags definitions above */ -+ __u8 fp_fid[3]; /* port ID */ -+ __be32 fp_resvd; -+ __be64 fp_wwpn; /* port name */ -+}; -+ -+/* -+ * GID_PN request -+ */ -+struct fc_ns_gid_pn { -+ __be64 fn_wwpn; /* port name */ -+}; -+ -+/* -+ * GID_PN response -+ */ -+struct fc_gid_pn_resp { -+ __u8 fp_resvd; -+ __u8 fp_fid[3]; /* port ID */ -+}; -+ -+/* -+ * RFT_ID request - register FC-4 types for ID. -+ */ -+struct fc_ns_rft_id { -+ struct fc_ns_fid fr_fid; /* port ID object */ -+ struct fc_ns_fts fr_fts; /* FC-4 types object */ -+}; -+ -+/* -+ * RPN_ID request - register port name for ID. -+ * RNN_ID request - register node name for ID. -+ */ -+struct fc_ns_rn_id { -+ struct fc_ns_fid fr_fid; /* port ID object */ -+ __be64 fr_wwn; /* node name or port name */ -+} __attribute__((__packed__)); -+ -+/* -+ * RSNN_NN request - register symbolic node name -+ */ -+struct fc_ns_rsnn { -+ __be64 fr_wwn; /* node name */ -+ __u8 fr_name_len; -+ char fr_name[]; -+} __attribute__((__packed__)); -+ -+/* -+ * RSPN_ID request - register symbolic port name -+ */ -+struct fc_ns_rspn { -+ struct fc_ns_fid fr_fid; /* port ID object */ -+ __u8 fr_name_len; -+ char fr_name[]; -+} __attribute__((__packed__)); -+ -+/* -+ * RFF_ID request - register FC-4 Features for ID. -+ */ -+struct fc_ns_rff_id { -+ struct fc_ns_fid fr_fid; /* port ID object */ -+ __u8 fr_resvd[2]; -+ __u8 fr_feat; /* FC-4 Feature bits */ -+ __u8 fr_type; /* FC-4 type */ -+} __attribute__((__packed__)); -+ -+#endif /* _FC_NS_H_ */ -diff -Naurd fcoe-utils-1.0.14.orig/include/scsi_bsg_fc.h fcoe-utils-1.0.14/include/scsi_bsg_fc.h ---- fcoe-utils-1.0.14.orig/include/scsi_bsg_fc.h 1970-01-01 01:00:00.000000000 +0100 -+++ fcoe-utils-1.0.14/include/scsi_bsg_fc.h 2011-02-23 15:05:18.310052287 +0100 -@@ -0,0 +1,322 @@ -+/* -+ * FC Transport BSG Interface -+ * -+ * Copyright (C) 2008 James Smart, Emulex Corporation -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * This program is distributed in the hope that 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -+ * -+ */ -+ -+#ifndef SCSI_BSG_FC_H -+#define SCSI_BSG_FC_H -+ -+/* -+ * This file intended to be included by both kernel and user space -+ */ -+ -+#include -+ -+/* -+ * FC Transport SGIO v4 BSG Message Support -+ */ -+ -+/* Default BSG request timeout (in seconds) */ -+#define FC_DEFAULT_BSG_TIMEOUT (10 * HZ) -+ -+ -+/* -+ * Request Message Codes supported by the FC Transport -+ */ -+ -+/* define the class masks for the message codes */ -+#define FC_BSG_CLS_MASK 0xF0000000 /* find object class */ -+#define FC_BSG_HST_MASK 0x80000000 /* fc host class */ -+#define FC_BSG_RPT_MASK 0x40000000 /* fc rport class */ -+ -+ /* fc_host Message Codes */ -+#define FC_BSG_HST_ADD_RPORT (FC_BSG_HST_MASK | 0x00000001) -+#define FC_BSG_HST_DEL_RPORT (FC_BSG_HST_MASK | 0x00000002) -+#define FC_BSG_HST_ELS_NOLOGIN (FC_BSG_HST_MASK | 0x00000003) -+#define FC_BSG_HST_CT (FC_BSG_HST_MASK | 0x00000004) -+#define FC_BSG_HST_VENDOR (FC_BSG_HST_MASK | 0x000000FF) -+ -+ /* fc_rport Message Codes */ -+#define FC_BSG_RPT_ELS (FC_BSG_RPT_MASK | 0x00000001) -+#define FC_BSG_RPT_CT (FC_BSG_RPT_MASK | 0x00000002) -+ -+ -+ -+/* -+ * FC Address Identifiers in Message Structures : -+ * -+ * Whenever a command payload contains a FC Address Identifier -+ * (aka port_id), the value is effectively in big-endian -+ * order, thus the array elements are decoded as follows: -+ * element [0] is bits 23:16 of the FC Address Identifier -+ * element [1] is bits 15:8 of the FC Address Identifier -+ * element [2] is bits 7:0 of the FC Address Identifier -+ */ -+ -+ -+/* -+ * FC Host Messages -+ */ -+ -+/* FC_BSG_HST_ADDR_PORT : */ -+ -+/* Request: -+ * This message requests the FC host to login to the remote port -+ * at the specified N_Port_Id. The remote port is to be enumerated -+ * with the transport upon completion of the login. -+ */ -+struct fc_bsg_host_add_rport { -+ uint8_t reserved; -+ -+ /* FC Address Identier of the remote port to login to */ -+ uint8_t port_id[3]; -+}; -+ -+/* Response: -+ * There is no additional response data - fc_bsg_reply->result is sufficient -+ */ -+ -+ -+/* FC_BSG_HST_DEL_RPORT : */ -+ -+/* Request: -+ * This message requests the FC host to remove an enumerated -+ * remote port and to terminate the login to it. -+ * -+ * Note: The driver is free to reject this request if it desires to -+ * remain logged in with the remote port. -+ */ -+struct fc_bsg_host_del_rport { -+ uint8_t reserved; -+ -+ /* FC Address Identier of the remote port to logout of */ -+ uint8_t port_id[3]; -+}; -+ -+/* Response: -+ * There is no additional response data - fc_bsg_reply->result is sufficient -+ */ -+ -+ -+/* FC_BSG_HST_ELS_NOLOGIN : */ -+ -+/* Request: -+ * This message requests the FC_Host to send an ELS to a specific -+ * N_Port_ID. The host does not need to log into the remote port, -+ * nor does it need to enumerate the rport for further traffic -+ * (although, the FC host is free to do so if it desires). -+ */ -+struct fc_bsg_host_els { -+ /* -+ * ELS Command Code being sent (must be the same as byte 0 -+ * of the payload) -+ */ -+ uint8_t command_code; -+ -+ /* FC Address Identier of the remote port to send the ELS to */ -+ uint8_t port_id[3]; -+}; -+ -+/* Response: -+ */ -+/* fc_bsg_ctels_reply->status values */ -+#define FC_CTELS_STATUS_OK 0x00000000 -+#define FC_CTELS_STATUS_REJECT 0x00000001 -+#define FC_CTELS_STATUS_P_RJT 0x00000002 -+#define FC_CTELS_STATUS_F_RJT 0x00000003 -+#define FC_CTELS_STATUS_P_BSY 0x00000004 -+#define FC_CTELS_STATUS_F_BSY 0x00000006 -+struct fc_bsg_ctels_reply { -+ /* -+ * Note: An ELS LS_RJT may be reported in 2 ways: -+ * a) A status of FC_CTELS_STATUS_OK is returned. The caller -+ * is to look into the ELS receive payload to determine -+ * LS_ACC or LS_RJT (by contents of word 0). The reject -+ * data will be in word 1. -+ * b) A status of FC_CTELS_STATUS_REJECT is returned, The -+ * rjt_data field will contain valid data. -+ * -+ * Note: ELS LS_ACC is determined by an FC_CTELS_STATUS_OK, and -+ * the receive payload word 0 indicates LS_ACC -+ * (e.g. value is 0x02xxxxxx). -+ * -+ * Note: Similarly, a CT Reject may be reported in 2 ways: -+ * a) A status of FC_CTELS_STATUS_OK is returned. The caller -+ * is to look into the CT receive payload to determine -+ * Accept or Reject (by contents of word 2). The reject -+ * data will be in word 3. -+ * b) A status of FC_CTELS_STATUS_REJECT is returned, The -+ * rjt_data field will contain valid data. -+ * -+ * Note: x_RJT/BSY status will indicae that the rjt_data field -+ * is valid and contains the reason/explanation values. -+ */ -+ uint32_t status; /* See FC_CTELS_STATUS_xxx */ -+ -+ /* valid if status is not FC_CTELS_STATUS_OK */ -+ struct { -+ uint8_t action; /* fragment_id for CT REJECT */ -+ uint8_t reason_code; -+ uint8_t reason_explanation; -+ uint8_t vendor_unique; -+ } rjt_data; -+}; -+ -+ -+/* FC_BSG_HST_CT : */ -+ -+/* Request: -+ * This message requests that a CT Request be performed with the -+ * indicated N_Port_ID. The driver is responsible for logging in with -+ * the fabric and/or N_Port_ID, etc as per FC rules. This request does -+ * not mandate that the driver must enumerate the destination in the -+ * transport. The driver is allowed to decide whether to enumerate it, -+ * and whether to tear it down after the request. -+ */ -+struct fc_bsg_host_ct { -+ uint8_t reserved; -+ -+ /* FC Address Identier of the remote port to send the ELS to */ -+ uint8_t port_id[3]; -+ -+ /* -+ * We need words 0-2 of the generic preamble for the LLD's -+ */ -+ uint32_t preamble_word0; /* revision & IN_ID */ -+ uint32_t preamble_word1; /* GS_Type, GS_SubType, Options, Rsvd */ -+ uint32_t preamble_word2; /* Cmd Code, Max Size */ -+ -+}; -+/* Response: -+ * -+ * The reply structure is an fc_bsg_ctels_reply structure -+ */ -+ -+ -+/* FC_BSG_HST_VENDOR : */ -+ -+/* Request: -+ * Note: When specifying vendor_id, be sure to read the Vendor Type and ID -+ * formatting requirements specified in scsi_netlink.h -+ */ -+struct fc_bsg_host_vendor { -+ /* -+ * Identifies the vendor that the message is formatted for. This -+ * should be the recipient of the message. -+ */ -+ uint64_t vendor_id; -+ -+ /* start of vendor command area */ -+ uint32_t vendor_cmd[0]; -+}; -+ -+/* Response: -+ */ -+struct fc_bsg_host_vendor_reply { -+ /* start of vendor response area */ -+ uint32_t vendor_rsp[0]; -+}; -+ -+ -+ -+/* -+ * FC Remote Port Messages -+ */ -+ -+/* FC_BSG_RPT_ELS : */ -+ -+/* Request: -+ * This message requests that an ELS be performed with the rport. -+ */ -+struct fc_bsg_rport_els { -+ /* -+ * ELS Command Code being sent (must be the same as -+ * byte 0 of the payload) -+ */ -+ uint8_t els_code; -+}; -+ -+/* Response: -+ * -+ * The reply structure is an fc_bsg_ctels_reply structure -+ */ -+ -+ -+/* FC_BSG_RPT_CT : */ -+ -+/* Request: -+ * This message requests that a CT Request be performed with the rport. -+ */ -+struct fc_bsg_rport_ct { -+ /* -+ * We need words 0-2 of the generic preamble for the LLD's -+ */ -+ uint32_t preamble_word0; /* revision & IN_ID */ -+ uint32_t preamble_word1; /* GS_Type, GS_SubType, Options, Rsvd */ -+ uint32_t preamble_word2; /* Cmd Code, Max Size */ -+}; -+/* Response: -+ * -+ * The reply structure is an fc_bsg_ctels_reply structure -+ */ -+ -+ -+ -+ -+/* request (CDB) structure of the sg_io_v4 */ -+struct fc_bsg_request { -+ uint32_t msgcode; -+ union { -+ struct fc_bsg_host_add_rport h_addrport; -+ struct fc_bsg_host_del_rport h_delrport; -+ struct fc_bsg_host_els h_els; -+ struct fc_bsg_host_ct h_ct; -+ struct fc_bsg_host_vendor h_vendor; -+ -+ struct fc_bsg_rport_els r_els; -+ struct fc_bsg_rport_ct r_ct; -+ } rqst_data; -+} __attribute__((packed)); -+ -+ -+/* response (request sense data) structure of the sg_io_v4 */ -+struct fc_bsg_reply { -+ /* -+ * The completion result. Result exists in two forms: -+ * if negative, it is an -Exxx system errno value. There will -+ * be no further reply information supplied. -+ * else, it's the 4-byte scsi error result, with driver, host, -+ * msg and status fields. The per-msgcode reply structure -+ * will contain valid data. -+ */ -+ uint32_t result; -+ -+ /* If there was reply_payload, how much was recevied ? */ -+ uint32_t reply_payload_rcv_len; -+ -+ union { -+ struct fc_bsg_host_vendor_reply vendor_reply; -+ -+ struct fc_bsg_ctels_reply ctels_reply; -+ } reply_data; -+}; -+ -+ -+#endif /* SCSI_BSG_FC_H */ -+ diff --git a/fcoe-utils.spec b/fcoe-utils.spec index 19907df..80578e1 100644 --- a/fcoe-utils.spec +++ b/fcoe-utils.spec @@ -1,6 +1,6 @@ Name: fcoe-utils -Version: 1.0.18 -Release: 2%{?dist} +Version: 1.0.19 +Release: 1%{?dist} Summary: Fibre Channel over Ethernet utilities Group: Applications/System License: GPLv2 @@ -10,29 +10,9 @@ Source0: %{name}-%{version}.tar.bz2 Source1: quickstart.txt # Generic Fedora patches Patch0: fcoe-utils-1.0.17-init.patch -Patch1: fcoe-utils-1.0.17-make.patch +Patch1: fcoe-utils-1.0.19-make.patch Patch2: fcoe-utils-1.0.18-help.patch -#Patch3: fcoe-utils-1.0.17-manpages.patch -Patch4: fcoe-utils-1.0.18-config.patch -Patch5: fcoe-utils-1.0.18-kernel-headers.patch -# Upstream patches -Patch10: fcoe-utils-1.0.18-fcoemon-Use-new-libfcoe.ko-interfaces-create-destroy.patch -Patch11: fcoe-utils-1.0.18-fcoe-utils-Add-SUPPORTED_DRIVERS-field-to-config.patch -Patch12: fcoe-utils-1.0.18-fcoe-utils-Handle-more-than-128-adapters-in-fcoeadm-.patch -Patch13: fcoe-utils-1.0.18-fcoeutils-Cancel-vlan-discovery-timer-only-when-vali.patch -Patch14: fcoe-utils-1.0.18-fcoeutils-Retry-vlan-discovery-forever-if-AUTO_VLAN-.patch -Patch15: fcoe-utils-1.0.18-fcoe-utils-Include-current-lldpad-headers.patch -Patch16: fcoe-utils-1.0.18-fcoe-utils-Add-libnl-build-dependency-for-fcoe-utils.patch -Patch17: fcoe-utils-1.0.18-fcoemon-Unexpected-FLOGI-after-fcoe-port-is-destroye.patch -Patch18: fcoe-utils-1.0.18-fcoe-utils-Drain-fip-socket-during-creation-to-disca.patch -Patch19: fcoe-utils-1.0.18-fcoe-utils-Include-fcoe_utils.h-before-scsi-scsi.h.patch -Patch20: fcoe-utils-1.0.18-fcoe-utils-Remove-unused-variable-symbolic_name_len.patch -Patch21: fcoe-utils-1.0.18-fcoe-utils-Use-iproute2-instead-of-deprecated-vconfi.patch -Patch22: fcoe-utils-1.0.18-fcoe-utils-Documentation-for-the-fcoeadm-Scan-option.patch -Patch23: fcoe-utils-1.0.18-fcoemon-Correct-wrong-error-check.patch -Patch24: fcoe-utils-1.0.18-fcoemon-Fix-2-file-descriptor-leaks.patch -Patch25: fcoe-utils-1.0.18-fcoe-utils-Avoid-freeing-uninitialized-pointer-in-fc.patch -Patch26: fcoe-utils-1.0.18-fcoemon-Do-not-create-a-world-and-group-writable-PID.patch +Patch3: fcoe-utils-1.0.18-config.patch BuildRequires: libhbaapi-devel lldpad-devel libnl-devel BuildRequires: libtool automake autoconf @@ -47,32 +27,12 @@ fcoeadm - command line tool for configuring FCoE interfaces fcoemon - service to configure DCB Ethernet QOS filters, works with dcbd or lldpad %prep -%setup -q -c -n %{name}-%{version} -# Upstream first -%patch10 -p1 -%patch11 -p1 -%patch12 -p1 -%patch13 -p1 -%patch14 -p1 -%patch15 -p1 -%patch16 -p1 -%patch17 -p1 -%patch18 -p1 -%patch19 -p1 -%patch20 -p1 -%patch21 -p1 -%patch22 -p1 -%patch23 -p1 -%patch24 -p1 -%patch25 -p1 -%patch26 -p1 +%setup -q # Fedora patches on top of that... %patch0 -p1 -b .init %patch1 -p1 -b .make %patch2 -p1 -b .help -#%patch3 -p1 -b .manpages -%patch4 -p1 -b .config -%patch5 -p1 -F 2 -b .kernel-headers +%patch3 -p1 -b .config %build ./bootstrap.sh @@ -130,6 +90,8 @@ fi %dir %{_sysconfdir}/fcoe/ %config(noreplace) %{_sysconfdir}/fcoe/config %config(noreplace) %{_sysconfdir}/fcoe/cfg-ethx +%dir %{_sysconfdir}/bash_completion.d/ +%{_sysconfdir}/bash_completion.d/* %{_initrddir}/fcoe %attr(0755,root,root) %{_libexecdir}/fcoe/fcoe_edd.sh %attr(0755,root,root) %{_libexecdir}/fcoe/fcoe-setup.sh @@ -139,6 +101,9 @@ fi %changelog +* Thu Jun 02 2011 Petr Sabata - 1.0.19-1 +- 1.0.19 bump + * Wed May 3 2011 Petr Sabata - 1.0.18-2 - fcoemon: Do not create a world and group writable PID file diff --git a/sources b/sources index 25a46cf..fdd42ba 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -a6b3bb359aa59e0ec7eac2764aec5ba7 fcoe-utils-1.0.18.tar.bz2 +bc1cf6400e442cc906026e4dffa39e55 fcoe-utils-1.0.19.tar.bz2