svn commit: r294734 - head/sys/dev/ixgbe

Steven Hartland smh at FreeBSD.org
Mon Jan 25 16:18:55 UTC 2016


Author: smh
Date: Mon Jan 25 16:18:53 2016
New Revision: 294734
URL: https://svnweb.freebsd.org/changeset/base/294734

Log:
  Fix ixgbe compliation with DBG 1
  
  Fixed ERROR_REPORTXX macros so that ixgbe compiles with #define DBG 1
  
  MFC after:	1 week
  Sponsored by:	Multiplay
  Differential Revision:	https://reviews.freebsd.org/D5061

Modified:
  head/sys/dev/ixgbe/ixgbe_osdep.h

Modified: head/sys/dev/ixgbe/ixgbe_osdep.h
==============================================================================
--- head/sys/dev/ixgbe/ixgbe_osdep.h	Mon Jan 25 16:18:08 2016	(r294733)
+++ head/sys/dev/ixgbe/ixgbe_osdep.h	Mon Jan 25 16:18:53 2016	(r294734)
@@ -57,6 +57,15 @@
 #define ASSERT(x) if(!(x)) panic("IXGBE: x")
 #define EWARN(H, W, S) printf(W)
 
+enum {
+	IXGBE_ERROR_SOFTWARE,
+	IXGBE_ERROR_POLLING,
+	IXGBE_ERROR_INVALID_STATE,
+	IXGBE_ERROR_UNSUPPORTED,
+	IXGBE_ERROR_ARGUMENT,
+	IXGBE_ERROR_CAUTION,
+};
+
 /* The happy-fun DELAY macro is defined in /usr/src/sys/i386/include/clock.h */
 #define usec_delay(x) DELAY(x)
 #define msec_delay(x) DELAY(1000*(x))
@@ -73,9 +82,23 @@
 	#define DEBUGOUT5(S,A,B,C,D,E)  printf(S "\n",A,B,C,D,E)
 	#define DEBUGOUT6(S,A,B,C,D,E,F)  printf(S "\n",A,B,C,D,E,F)
 	#define DEBUGOUT7(S,A,B,C,D,E,F,G)  printf(S "\n",A,B,C,D,E,F,G)
-	#define ERROR_REPORT1(S,A)      printf(S "\n",A)
-	#define ERROR_REPORT2(S,A,B)    printf(S "\n",A,B)
-	#define ERROR_REPORT3(S,A,B,C)  printf(S "\n",A,B,C)
+	#define ERROR_REPORT1 ERROR_REPORT
+	#define ERROR_REPORT2 ERROR_REPORT
+	#define ERROR_REPORT3 ERROR_REPORT
+	#define ERROR_REPORT(level, format, arg...) do { \
+		switch (level) { \
+		case IXGBE_ERROR_SOFTWARE: \
+		case IXGBE_ERROR_CAUTION: \
+		case IXGBE_ERROR_POLLING: \
+		case IXGBE_ERROR_INVALID_STATE: \
+		case IXGBE_ERROR_UNSUPPORTED: \
+		case IXGBE_ERROR_ARGUMENT: \
+			device_printf(ixgbe_dev_from_hw(hw), format, ## arg); \
+			break; \
+		default: \
+			break; \
+		} \
+	} while (0)
 #else
 	#define DEBUGOUT(S)
 	#define DEBUGOUT1(S,A)


More information about the svn-src-all mailing list