+static inline void kqswnal_rx_decref (kqswnal_rx_t *krx)
+{
+ LASSERT (atomic_read (&krx->krx_refcount) > 0);
+ if (atomic_dec_and_test (&krx->krx_refcount))
+ kqswnal_rx_done(krx);
+}
+
+#if MULTIRAIL_EKC
+# ifndef EP_RAILMASK_ALL
+# error "old (unsupported) version of EKC headers"
+# endif
+#else
+/* multirail defines these in <elan/epcomms.h> */
+#define EP_MSG_SVC_PORTALS_SMALL (0x10) /* Portals over elan port number (large payloads) */
+#define EP_MSG_SVC_PORTALS_LARGE (0x11) /* Portals over elan port number (small payloads) */
+/* NB small/large message sizes are GLOBAL constants */
+
+/* A minimal attempt to minimise inline #ifdeffing */
+
+#define EP_SUCCESS ESUCCESS
+#define EP_ENOMEM ENOMEM
+
+static inline EP_XMTR *
+ep_alloc_xmtr(EP_DEV *e)
+{
+ return (ep_alloc_large_xmtr(e));
+}
+
+static inline EP_RCVR *
+ep_alloc_rcvr(EP_DEV *e, int svc, int nenv)
+{
+ return (ep_install_large_rcvr(e, svc, nenv));
+}
+
+static inline void
+ep_free_xmtr(EP_XMTR *x)
+{
+ ep_free_large_xmtr(x);
+}
+
+static inline void
+ep_free_rcvr(EP_RCVR *r)
+{
+ ep_remove_large_rcvr(r);
+}
+#endif
+