+/*
+ * Copyright (c) 2013 Qualcomm Atheros, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted (subject to the limitations in the
+ * disclaimer below) provided that the following conditions are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the
+ * distribution.
+ *
+ * * Neither the name of Qualcomm Atheros nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
+ * GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
+ * HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
/**
* @ingroup adf_os_public
* @file adf_os_types.h
#define ADF_OS_MAX_SCATTER __ADF_OS_MAX_SCATTER
/**
* @brief Max number of scatter-gather segments.
- */
+ */
#define ADF_OS_MAX_SGLIST 4
/**
* @brief denotes structure is packed.
- */
+ */
#define adf_os_packed __adf_os_packed
/**
/**
* @brief DMA mapping object.
- */
+ */
typedef __adf_os_dma_map_t adf_os_dma_map_t;
/**
* @brief DMA address.
- */
+ */
typedef __adf_os_dma_addr_t adf_os_dma_addr_t;
/**
* @brief DMA size.
- */
+ */
typedef __adf_os_dma_size_t adf_os_dma_size_t;
/**
* @brief Information inside a DMA map.
- */
+ */
typedef struct adf_os_dmamap_info{
a_uint32_t nsegs; /**< total number mapped segments*/
struct __dma_segs{
adf_os_dma_addr_t paddr; /**< physical(dma'able) address of the segment*/
adf_os_dma_size_t len; /**< length of the segment*/
- } dma_segs[ADF_OS_MAX_SCATTER];
+ } dma_segs[ADF_OS_MAX_SCATTER];
}adf_os_dmamap_info_t;
/**
* @brief Representation of a scatter-gather list.
- */
+ */
typedef struct adf_os_sglist{
a_uint32_t nsegs; /**< total number of segments*/
struct __sg_segs{
* operations, where reading a network packet or
* storage sector corresponds to a read operation in
* bus_dma.
- *
+ *
* ADF_SYNC_PREREAD Perform any synchronization
* required prior to an update
* of host memory by the DMA
} a_status_t;
/**
- * @brief An ecore needs to provide a table of all pci device/vendor id's it
+ * @brief An ecore needs to provide a table of all pci device/vendor id's it
* supports
*
* This table should be terminated by a NULL entry , i.e. {0}
/**
* @brief Representation of a h/w resource.
- */
+ */
typedef struct {
a_uint64_t start;
a_uint64_t end;
/**
* @brief Representation of bus registration data.
- */
+ */
typedef union {
adf_os_pci_dev_id_t *pci;
void *raw;
/**
* @brief Representation of data required for attach.
- */
+ */
typedef union {
adf_os_pci_dev_id_t pci;
void *raw;
/**
* @brief Types of buses.
- */
+ */
typedef enum {
ADF_OS_BUS_TYPE_PCI = 1,
ADF_OS_BUS_TYPE_GENERIC,
/**
* @brief IRQ handler response codes.
- */
+ */
typedef enum {
ADF_OS_IRQ_NONE,
ADF_OS_IRQ_HANDLED,
/**
* @brief DMA mask types.
- */
+ */
typedef enum {
ADF_OS_DMA_MASK_32BIT,
ADF_OS_DMA_MASK_64BIT,
* ADF_OS_DMA_FROM_DEVICE (data going from memory to device)
*/
typedef enum {
- ADF_OS_DMA_TO_DEVICE = __ADF_OS_DMA_TO_DEVICE,
- ADF_OS_DMA_FROM_DEVICE = __ADF_OS_DMA_FROM_DEVICE,
+ ADF_OS_DMA_TO_DEVICE = __ADF_OS_DMA_TO_DEVICE,
+ ADF_OS_DMA_FROM_DEVICE = __ADF_OS_DMA_FROM_DEVICE,
} adf_os_dma_dir_t;
/*
/**
* @brief Prototype of IRQ function.
- */
-typedef adf_os_irq_resp_t (*adf_os_drv_intr)(adf_drv_handle_t hdl);
+ */
+typedef adf_os_irq_resp_t (*adf_os_drv_intr)(adf_drv_handle_t hdl);
/**
* @brief The OS print routine.
- */
+ */
#define adf_os_print __adf_os_print
/**
/**
* @brief driver specific functions
*/
- adf_drv_handle_t (*drv_attach) (adf_os_resource_t *res, int count,
- adf_os_attach_data_t *data,
+ adf_drv_handle_t (*drv_attach) (adf_os_resource_t *res, int count,
+ adf_os_attach_data_t *data,
adf_os_device_t osdev);
void (*drv_detach) (adf_drv_handle_t hdl);
void (*drv_suspend) (adf_drv_handle_t hdl, adf_os_pm_t pm);