1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116
|
/****************************************************************************
*
* SPDX-License-Identifier: BSD-3-Clause
* Copyright(c) 2007-2026 Intel Corporation
*
* These contents may have been developed with support from one or more
* Intel-operated generative artificial intelligence solutions.
*
***************************************************************************/
/*
*****************************************************************************
* Doxygen group definitions
****************************************************************************/
/**
*****************************************************************************
* @file cpa_dev.h
*
* @defgroup cpaDev Device API
*
* @ingroup cpa
*
* @description
* These functions specify the API for device level operation.
*
* @remarks
*
*
*****************************************************************************/
#ifndef CPA_DEV_H
#define CPA_DEV_H
#ifdef __cplusplus
extern "C" {
#endif
#ifndef CPA_H
#include "cpa.h"
#endif
/*****************************************************************************
* @ingroup cpaDev
* Returns device information
*
* @description
* This data structure contains the device information. The device
* information are available to both Physical and Virtual Functions.
* Depending on the resource partitioning configuration, the services
* available may changes. This configuration will impact the size of the
* Security Association Database (SADB). Other properties such device SKU
* and device ID are also reported.
*
*****************************************************************************/
typedef struct
{
Cpa32U sku;
/**< Identifies the SKU of the device. */
Cpa16U bdf;
/**< Identifies the Bus Device Function of the device.
* Format is reported as follow:
* - bits<2:0> represent the function number.
* - bits<7:3> represent the device
* - bits<15:8> represent the bus
*/
Cpa32U deviceId;
/**< Returns the device ID. */
Cpa32U numaNode;
/**< Return the local NUMA node mapped to the device. */
CpaBoolean isVf;
/**< Return whether the device is currently used in a virtual function
* or not. */
CpaBoolean dcEnabled;
/**< Compression service enabled */
CpaBoolean cySymEnabled;
/**< Symmetric crypto service enabled */
CpaBoolean cyAsymEnabled;
/**< Asymmetric crypto service enabled */
CpaBoolean inlineEnabled;
/**< Inline service enabled */
Cpa32U deviceMemorySizeAvailable;
/**< Return the size of the device memory available. This device memory
* section could be used for the intermediate buffers in the
* compression service.
*/
} CpaDeviceInfo;
/*****************************************************************************
* @ingroup cpaDev
* Returns number devices.
*
* @description
* This API returns the number of devices available to the application.
* If used on the host, it will return the number of physical devices.
* If used on the guest, it will return the number of function mapped
* to the virtual machine.
*
*****************************************************************************/
CpaStatus cpaGetNumDevices(Cpa16U *numDevices);
/*****************************************************************************
* @ingroup cpaDev
* Returns device information for a given device index.
*
* @description
* Returns device information for a given device index. This API must
* be used with cpaGetNumDevices().
*****************************************************************************/
CpaStatus cpaGetDeviceInfo(Cpa16U device, CpaDeviceInfo *deviceInfo);
#ifdef __cplusplus
} /* close the extern "C" { */
#endif
#endif /* CPA_DEV_H */
|