summaryrefslogtreecommitdiff
blob: 68b1bca7c7cd0a3c2a950c0cacb53bb0acaf69fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
--- a/usr/idbm.c
+++ b/usr/idbm.c
@@ -27,2 +27,3 @@
 #include <errno.h>
+#include <fcntl.h>
 #include <dirent.h>
--- a/usr/iscsiadm.c
+++ b/usr/iscsiadm.c
@@ -3269,2 +3269,3 @@
 	int do_discover = 0, sub_mode = -1;
+	int argerror = 0;
 	int portal_type = -1;
@@ -3458,2 +3459,5 @@
 			usage(0);
+		case '?':
+			log_error("unrecognized character '%c'", optopt);
+			argerror = 1;
 		}
@@ -3473,4 +3477,3 @@
 
-	if (optopt) {
-		log_error("unrecognized character '%c'", optopt);
+	if (argerror) {
 		rc = ISCSI_ERR_INVAL;
--- a/iscsiuio/src/unix/libs/bnx2x.c
+++ b/iscsiuio/src/unix/libs/bnx2x.c
@@ -44,3 +44,3 @@
 #include <linux/sockios.h>
-#include <linux/ethtool.h>
+#include "ethtool-compat.h"
 #include <sys/mman.h>
--- /dev/null
+++ b/iscsiuio/src/unix/libs/ethtool-compat.h
@@ -0,0 +1,51 @@
+/*
+ * ethtool-compat.h: adopted from
+ # ethtool.h: Defines for Linux ethtool.
+ *
+ * Copyright (C) 1998 David S. Miller (davem@redhat.com)
+ * Copyright 2001 Jeff Garzik <jgarzik@pobox.com>
+ * Portions Copyright 2001 Sun Microsystems (thockin@sun.com)
+ * Portions Copyright 2002 Intel (eli.kupermann@intel.com,
+ *                                christopher.leech@intel.com,
+ *                                scott.feldman@intel.com)
+ * Portions Copyright (C) Sun Microsystems 2008
+ */
+
+#include <linux/types.h>
+#include <netinet/if_ether.h>
+
+#define ETHTOOL_FWVERS_LEN	32
+#define ETHTOOL_BUSINFO_LEN	32
+#define ETHTOOL_EROMVERS_LEN	32
+
+struct ethtool_drvinfo {
+	__u32	cmd;
+	char	driver[32];
+	char	version[32];
+	char	fw_version[ETHTOOL_FWVERS_LEN];
+	char	bus_info[ETHTOOL_BUSINFO_LEN];
+	char	erom_version[ETHTOOL_EROMVERS_LEN];
+	char	reserved2[12];
+	__u32	n_priv_flags;
+	__u32	n_stats;
+	__u32	testinfo_len;
+	__u32	eedump_len;
+	__u32	regdump_len;
+};
+
+struct ethtool_tcpip4_spec {
+	__be32	ip4src;
+	__be32	ip4dst;
+	__be16	psrc;
+	__be16	pdst;
+	__u8    tos;
+};
+
+struct ethtool_ah_espip4_spec {
+	__be32	ip4src;
+	__be32	ip4dst;
+	__be32	spi;
+	__u8    tos;
+};
+
+#define ETHTOOL_GDRVINFO	0x00000003 /* Get driver info. */