--- /dev/null	Thu Dec 10 09:27:28 2015
+++ new/usr/src/uts/common/io/i40e/i40e_buf.c	Thu Dec 10 09:27:28 2015
@@ -0,0 +1,199 @@
+/*
+ * This file and its contents are supplied under the terms of the
+ * Common Development and Distribution License ("CDDL"), version 1.0.
+ * You may only use this file in accordance with the terms of version
+ * 1.0 of the CDDL.
+ *
+ * A full copy of the text of the CDDL should have accompanied this
+ * source.  A copy of the CDDL is also available via the Internet at
+ * http://www.illumos.org/license/CDDL.
+ */
+
+/*
+ * Copyright 2015 OmniTI Computer Consulting, Inc. All rights reserved.
+ */
+
+#include "i40e_sw.h"
+
+/* NOTE - this may need to be double on SPARC... */
+#define	I40E_DMA_ALIGNMENT 0x0000000000001000ull
+
+/*
+ * DMA attributes for tx/rx descriptors.
+ */
+#if 0	/* NOT YET */
+static ddi_dma_attr_t i40e_desc_dma_attr = {
+	DMA_ATTR_V0,			/* version number */
+	0x0000000000000000ull,		/* low address */
+	0xFFFFFFFFFFFFFFFFull,		/* high address */
+	0x00000000FFFFFFFFull,		/* dma counter max */
+	I40E_DMA_ALIGNMENT,		/* alignment */
+	0x00000FFF,			/* burst sizes */
+	0x00000001,			/* minimum transfer size */
+	0x00000000FFFFFFFFull,		/* maximum transfer size */
+	0xFFFFFFFFFFFFFFFFull,		/* maximum segment size */
+	1,				/* scatter/gather list length */
+	0x00000001,			/* granularity */
+	DDI_DMA_FLAGERR			/* DMA flags */
+};
+
+/*
+ * DMA attributes for tx/rx buffers.
+ */
+/*
+ * DMA attributes for transmit.
+ */
+static ddi_dma_attr_t i40e_tx_dma_attr = {
+	DMA_ATTR_V0,			/* version number */
+	0x0000000000000000ull,		/* low address */
+	0xFFFFFFFFFFFFFFFFull,		/* high address */
+	0x00000000FFFFFFFFull,		/* dma counter max */
+	1,				/* alignment */
+	0x00000FFF,			/* burst sizes */
+	0x00000001,			/* minimum transfer size */
+	0x00000000FFFFFFFFull,		/* maximum transfer size */
+	0xFFFFFFFFFFFFFFFFull,		/* maximum segment size	 */
+	MAX_COOKIE,			/* scatter/gather list length */
+	0x00000001,			/* granularity */
+	DDI_DMA_FLAGERR			/* DMA flags */
+};
+
+/*
+ * DMA access attributes for descriptors.
+ */
+static ddi_device_acc_attr_t i40e_desc_acc_attr = {
+	DDI_DEVICE_ATTR_V0,
+	DDI_STRUCTURE_LE_ACC,
+	DDI_STRICTORDER_ACC
+};
+
+/*
+ * DMA access attributes for buffers.
+ */
+static ddi_device_acc_attr_t i40e_buf_acc_attr = {
+	DDI_DEVICE_ATTR_V0,
+	DDI_NEVERSWAP_ACC,
+	DDI_STRICTORDER_ACC
+};
+#endif	/* NOT YET */
+
+boolean_t
+i40e_alloc_rx_data(i40e_t *i40e)
+{
+	/* XXX KEBE SAYS FILL ME IN */
+	return (B_TRUE);
+}
+
+boolean_t
+i40e_alloc_dma(i40e_t *i40e)
+{
+#if 0	/* NOT YET */
+	i40e_rx_ring_t *rxr;
+	i40e_rx_data_t *rxd;
+	i40e_tx_data_t *txr;
+	int i;
+
+	for (i = 0; i < i40e->i40e_num_rx_rings; i++) {
+		/* Allocate receive descriptor ring and control block lists. */
+		rxr = &i40e->i40e_rx_rings[i];
+		rxd = rxr->rxr_data;
+
+		if (!i40e_alloc_rbd_ring(rxd) || !i40e_alloc_rcb_lists(rxd)) {
+			i40e_free_dma(i40e);
+			return (B_FALSE);
+		}
+	}
+
+	for (i = 0; i < i40e->i40e_num_tx_rings; i++) {
+		/* Allocate transmit descriptor ring and control block lists. */
+		txr = &i40e->i40e_tx_rings[i];
+
+		if (!i40e_alloc_tbd_ring(txr) || i40e_alloc_tcb_lists(txr)) {
+			i40e_free_dma(i40e);
+			return (B_FALSE);
+		}
+	}
+#endif	/* NOT YET */
+
+	return (B_TRUE);
+}
+
+/*
+ * DMA freeing functions.
+ */
+
+#if 0
+static void
+i40e_free_rbd_ring(i40e_rx_data_t *rxd)
+{
+}
+
+static void
+i40e_free_rcb_lists(i40e_rx_data_t *rxd)
+{
+}
+
+static void
+i40e_free_tbd_ring(i40e_trqpair_t *txr)
+{
+}
+
+static void
+i40e_free_tcb_lists(i40e_trqpair_t *txr)
+{
+}
+#endif
+
+void
+i40e_free_dma(i40e_t *i40e)
+{
+#if 0
+	i40e_rx_ring_t *rxr;
+	i40e_rx_data_t *rxd;
+	i40e_tx_ring_t *txr;
+	int i;
+
+	for (i = 0; i < i40e->i40e_num_rx_rings; i++) {
+		/* Free receive descriptor ring and control block lists. */
+		rxr = &i40e->i40e_rx_rings[i];
+		rxd = rxr->rxr_data;
+
+		i40e_free_rbd_ring(rxd);
+		i40e_free_rcb_lists(rxd);
+	}
+
+	for (i = 0; i < i40e->i40e_num_tx_rings; i++) {
+		/* Free transmit descriptor ring and control block lists. */
+		txr = &i40e->i40e_tx_rings[i];
+
+		i40e_free_tbd_ring(txr);
+		i40e_free_tcb_lists(txr);
+	}
+#endif
+}
+
+void
+i40e_free_rx_data(i40e_t *i40e)
+{
+	/* XXX KEBE SAYS FILL ME IN */
+}
+
+void
+i40e_set_fma_flags(boolean_t dma_flag)
+{
+	extern ddi_dma_attr_t i40e_buf_dma_attr; /* i40e_osdep.c */
+
+	if (dma_flag) {
+#if 0
+		i40e_desc_dma_attr.dma_attr_flags = DDI_DMA_FLAGERR;
+		i40e_tx_dma_attr.dma_attr_flags = DDI_DMA_FLAGERR;
+#endif
+		i40e_buf_dma_attr.dma_attr_flags = DDI_DMA_FLAGERR;
+	} else {
+#if 0
+		i40e_desc_dma_attr.dma_attr_flags = 0;
+		i40e_tx_dma_attr.dma_attr_flags = 0;
+#endif
+		i40e_buf_dma_attr.dma_attr_flags = 0;
+	}
+}
