/* * Ensure that the size of the array matches the number of services, * SVC_COUNT, that is used to size the bitmap.
*/
static_assert(ARRAY_SIZE(adf_cfg_services) == SVC_COUNT);
/* * Ensure that the maximum number of concurrent services that can be * enabled on a device is less than or equal to the number of total * supported services.
*/
static_assert(ARRAY_SIZE(adf_cfg_services) >= MAX_NUM_CONCURR_SVC);
/* * Ensure that the number of services fit a single unsigned long, as each * service is represented by a bit in the mask.
*/
static_assert(BITS_PER_LONG >= SVC_COUNT);
/* * Ensure that size of the concatenation of all service strings is smaller * than the size of the buffer that will contain them.
*/
static_assert(sizeof(ADF_CFG_SYM ADF_SERVICES_DELIMITER
ADF_CFG_ASYM ADF_SERVICES_DELIMITER
ADF_CFG_DC ADF_SERVICES_DELIMITER
ADF_CFG_DECOMP ADF_SERVICES_DELIMITER
ADF_CFG_DCC) < ADF_CFG_MAX_VAL_LEN_IN_BYTES);
int adf_get_service_mask(struct adf_accel_dev *accel_dev, unsignedlong *mask)
{ char services[ADF_CFG_MAX_VAL_LEN_IN_BYTES] = { };
size_t len; int ret;
ret = adf_cfg_get_param_value(accel_dev, ADF_GENERAL_SEC,
ADF_SERVICES_ENABLED, services); if (ret) {
dev_err(&GET_DEV(accel_dev), "%s param not found\n",
ADF_SERVICES_ENABLED); return ret;
}
len = strnlen(services, ADF_CFG_MAX_VAL_LEN_IN_BYTES);
ret = adf_service_string_to_mask(accel_dev, services, len, mask); if (ret)
dev_err(&GET_DEV(accel_dev), "Invalid value of %s param: %s\n",
ADF_SERVICES_ENABLED, services);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.