98d9b01322
Via coccinelle: @r_device_driver_api_and_data_1@ struct device *D; @@ ( D-> - driver_api + api | D-> - driver_data + data ) @r_device_driver_api_and_data_2@ expression E; @@ ( net_if_get_device(E)-> - driver_api + api | net_if_get_device(E)-> - driver_data + data ) And grep/sed rules for macros: git grep -rlz 'dev)->driver_data' | xargs -0 sed -i 's/dev)->driver_data/dev)->data/g' git grep -rlz 'dev->driver_data' | xargs -0 sed -i 's/dev->driver_data/dev->data/g' git grep -rlz 'device->driver_data' | xargs -0 sed -i 's/device->driver_data/device->data/g' Fixes #27397 Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
40 lines
957 B
C
40 lines
957 B
C
/*
|
|
* Copyright (c) 2020 Markus Fuchs <markus.fuchs@de.sauter-bc.com>
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*
|
|
*/
|
|
|
|
#ifndef ZEPHYR_DRIVERS_CRYPTO_CRYPTO_STM32_PRIV_H_
|
|
#define ZEPHYR_DRIVERS_CRYPTO_CRYPTO_STM32_PRIV_H_
|
|
|
|
/* Maximum supported key length is 256 bits */
|
|
#define CRYPTO_STM32_AES_MAX_KEY_LEN (256 / 8)
|
|
|
|
struct crypto_stm32_config {
|
|
struct stm32_pclken pclken;
|
|
};
|
|
|
|
struct crypto_stm32_data {
|
|
CRYP_HandleTypeDef hcryp;
|
|
struct k_sem device_sem;
|
|
struct k_sem session_sem;
|
|
};
|
|
|
|
struct crypto_stm32_session {
|
|
CRYP_ConfigTypeDef config;
|
|
uint32_t key[CRYPTO_STM32_AES_MAX_KEY_LEN / sizeof(uint32_t)];
|
|
bool in_use;
|
|
};
|
|
|
|
#define CRYPTO_STM32_CFG(dev) \
|
|
((const struct crypto_stm32_config *const)(dev)->config)
|
|
|
|
#define CRYPTO_STM32_DATA(dev) \
|
|
((struct crypto_stm32_data *const)(dev)->data)
|
|
|
|
#define CRYPTO_STM32_SESSN(ctx) \
|
|
((struct crypto_stm32_session *const)(ctx)->drv_sessn_state)
|
|
|
|
#endif /* ZEPHYR_DRIVERS_CRYPTO_CRYPTO_STM32_PRIV_H_ */
|