aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/ray
diff options
context:
space:
mode:
authorDuncan Barclay <dmlb@FreeBSD.org>2000-06-10 13:52:06 +0000
committerDuncan Barclay <dmlb@FreeBSD.org>2000-06-10 13:52:06 +0000
commit332e85b29d5a52d94553ae8637e8bfe4946b42b4 (patch)
treeef1c9e0b50e50a6700b9c6e8a61a953a679c1524 /sys/dev/ray
parent8204ff610238015a7468bbb71398c39b189a7019 (diff)
Notes
Diffstat (limited to 'sys/dev/ray')
-rw-r--r--sys/dev/ray/if_rayvar.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/sys/dev/ray/if_rayvar.h b/sys/dev/ray/if_rayvar.h
index 818ef1f9e24d2..d44a83c237a3b 100644
--- a/sys/dev/ray/if_rayvar.h
+++ b/sys/dev/ray/if_rayvar.h
@@ -202,6 +202,7 @@ static int mib_info[RAY_MIB_MAX+1][3] = RAY_MIB_INFO;
#define RAY_COM_FWAIT 0x0008 /* Do not run the queue */
#define RAY_COM_FCHKRUNNING 0x0010 /* Check IFF_RUNNING */
#define RAY_COM_FDETACHED 0x0020 /* Card is gone */
+#define RAY_COM_FWOKEN 0x0040 /* Woken by detach */
#define RAY_COM_FLAGS_PRINTFB \
"\020" \
"\001WOK" \
@@ -254,6 +255,27 @@ static int mib_info[RAY_MIB_MAX+1][3] = RAY_MIB_INFO;
#define RAY_COM_MALLOC(function, flags) \
ray_com_malloc((function), (flags), __STRING(function));
+#define RAY_COM_FREE(com, ncom) do { \
+ int i; \
+ for (i = 0; i < ncom; i++) \
+ FREE(com[i], M_RAYCOM); \
+} while (0)
+
+/*
+ * This macro handles adding commands to the runq and quickly
+ * getting away when the card is detached. The macro returns
+ * from the current function with ENXIO.
+ */
+#define RAY_COM_RUNQ(sc, com, ncom, mesg, error) do { \
+ (error) = ray_com_runq_add((sc), (com), (ncom), (mesg)); \
+ if ((error) == ENXIO) { \
+ RAY_COM_FREE((com), (ncom)); \
+ return (error); \
+ } else if ((error) && ((error) != ENXIO)) \
+ RAY_PRINTF(sc, "got error from runq 0x%x", (error)); \
+} while (0)
+
+
#define RAY_COM_INIT(com, function, flags) \
ray_com_init((com), (function), (flags), __STRING(function));