/*
* Copyright (C) 2007 VMware, Inc. All rights reserved.
*
* The contents of this file are subject to the terms of the Common
* Development and Distribution License (the "License") version 1.0
* and no later version. You may not use this file except in
* compliance with the License.
*
* You can obtain a copy of the License at
*
* See the License for the specific language governing permissions
* and limitations under the License.
*/
/*
* Copyright (c) 2016 by Delphix. All rights reserved.
*/
#include <vmxnet3.h>
/* Used by ddi_regs_map_setup() and ddi_dma_mem_alloc() */
};
/* Buffers with no alignment constraint DMA description */
.dma_attr_addr_lo = 0x0000000000000000ull,
.dma_attr_addr_hi = 0xFFFFFFFFFFFFFFFFull,
.dma_attr_count_max = 0xFFFFFFFFFFFFFFFFull,
.dma_attr_align = 0x0000000000000001ull,
.dma_attr_burstsizes = 0x0000000000000001ull,
.dma_attr_minxfer = 0x00000001,
.dma_attr_maxxfer = 0xFFFFFFFFFFFFFFFFull,
.dma_attr_seg = 0xFFFFFFFFFFFFFFFFull,
.dma_attr_sgllen = 1,
.dma_attr_granular = 0x00000001,
.dma_attr_flags = 0
};
/* Buffers with a 128-bytes alignment constraint DMA description */
.dma_attr_addr_lo = 0x0000000000000000ull,
.dma_attr_addr_hi = 0xFFFFFFFFFFFFFFFFull,
.dma_attr_count_max = 0xFFFFFFFFFFFFFFFFull,
.dma_attr_align = 0x0000000000000080ull,
.dma_attr_burstsizes = 0x0000000000000001ull,
.dma_attr_minxfer = 0x00000001,
.dma_attr_maxxfer = 0xFFFFFFFFFFFFFFFFull,
.dma_attr_seg = 0xFFFFFFFFFFFFFFFFull,
.dma_attr_sgllen = 1,
.dma_attr_granular = 0x00000001,
.dma_attr_flags = 0
};
/* Buffers with a 512-bytes alignment constraint DMA description */
.dma_attr_addr_lo = 0x0000000000000000ull,
.dma_attr_addr_hi = 0xFFFFFFFFFFFFFFFFull,
.dma_attr_count_max = 0xFFFFFFFFFFFFFFFFull,
.dma_attr_align = 0x0000000000000200ull,
.dma_attr_burstsizes = 0x0000000000000001ull,
.dma_attr_minxfer = 0x00000001,
.dma_attr_maxxfer = 0xFFFFFFFFFFFFFFFFull,
.dma_attr_seg = 0xFFFFFFFFFFFFFFFFull,
.dma_attr_sgllen = 1,
.dma_attr_granular = 0x00000001,
.dma_attr_flags = 0
};
int
{
int err;
switch (dmaerr) {
case DDI_DMA_NORESOURCES:
case DDI_DMA_TOOBIG:
break;
case DDI_DMA_INUSE:
break;
case DDI_DMA_BADATTR:
case DDI_DMA_NOMAPPING:
default:
}
return (err);
}
/*
* Allocate /size/ bytes of contiguous DMA-ble memory.
*
* Returns:
* 0 on success, non-zero on failure.
*/
static int
{
/*
* Allocate a DMA handle
*/
goto error;
}
/*
* Allocate memory
*/
goto error_dma_handle;
}
/*
* Map the memory
*/
&cookieCount)) != DDI_DMA_MAPPED) {
dmaerr);
goto error_dma_mem;
}
return (0);
return (err);
}
int
{
}
int
{
}
int
{
}
/*
* Free DMA-ble memory.
*/
void
{
}
/*
* Get the numeric value of the property "name" in vmxnet3s.conf for
* the corresponding device instance.
* If the property isn't found or if it doesn't satisfy the conditions,
* "def" is returned.
*
* Returns:
* The value of the property or "def".
*/
int
{
int *props;
} else {
"device\n", name);
}
}
}
return (ret);
}