diff options
author | Jonathan Aillet <jonathan.aillet@iot.bzh> | 2019-06-14 18:15:32 +0200 |
---|---|---|
committer | Jonathan Aillet <jonathan.aillet@iot.bzh> | 2019-06-18 11:34:58 +0200 |
commit | 6a572877593e592dbaaba6f5649bc7744cd714c7 (patch) | |
tree | ee1582e411eac8a30913036efc3da0112a90de7c /lib/4a-hal-utilities/4a-hal-utilities-data.h | |
parent | 24046bfdb0568077a074b503d58a343a06f4234a (diff) |
Refactoring 'hal data' linked list
Refactoring 'hal data' linked list code using liburcu.
BUG-AGL: SPEC-2329
Change-Id: Ia51d362f96838f4b5bb77e8d1b85fa8d1ab4bed1
Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
Diffstat (limited to 'lib/4a-hal-utilities/4a-hal-utilities-data.h')
-rw-r--r-- | lib/4a-hal-utilities/4a-hal-utilities-data.h | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/4a-hal-utilities/4a-hal-utilities-data.h b/lib/4a-hal-utilities/4a-hal-utilities-data.h index 8bddbbb..48420cd 100644 --- a/lib/4a-hal-utilities/4a-hal-utilities-data.h +++ b/lib/4a-hal-utilities/4a-hal-utilities-data.h @@ -37,7 +37,8 @@ // Enum for linked list type enum LinkedListType { LINKED_LIST_FOR_DEPENDENCIES_DATA = 0, - LINKED_LIST_FOR_MIXER_DATA = 1 + LINKED_LIST_FOR_MIXER_DATA = 1, + LINKED_LIST_FOR_HAL_DATA = 2 }; // Enum for hal status @@ -138,7 +139,7 @@ struct HalData { struct InternalHalData *internalHalData; // Can be NULL if external api - struct HalData *next; + struct cds_list_head node; }; // Structure to store hal manager data @@ -148,7 +149,7 @@ struct HalMgrData { afb_api_t apiHandle; - struct HalData *halDataList; + struct cds_list_head halDataListHead; }; // Internal Hal - Probed devices structure handling functions @@ -190,12 +191,11 @@ json_object *HalUtlGetJsonArrayForSpecificMixerData(afb_api_t apiHandle, struct json_object *HalUtlGetJsonArrayForAllMixersData(afb_api_t apiHandle, struct cds_list_head *mixerDataListHead); // Hal data handling functions -struct HalData *HalUtlAddHalToHalList(struct HalData **halDataList); -int HalUtlRemoveSelectedHalFromList(struct HalData **halDataList, struct HalData *halToRemove); -int HalUtlRemoveAllHalFromList(struct HalData **halDataList); -int HalUtlGetNumberOfHalInList(struct HalData **halDataList); -struct HalData *HalUtlSearchHalDataByApiName(struct HalData **halDataList, char *apiName); -struct HalData *HalUtlSearchReadyHalDataByCardId(struct HalData **halDataList, int cardId); +struct HalData *HalUtlAddHalToHalList(struct cds_list_head *halDataListHead); +int HalUtlRemoveSelectedHalFromList(struct cds_list_head *halDataListHead, struct HalData *halToRemove); +int HalUtlRemoveAllHalFromList(struct cds_list_head *halDataListHead); +int HalUtlGetNumberOfHalInList(struct cds_list_head *halDataListHead); +struct HalData *HalUtlSearchHalDataByApiName(struct cds_list_head *halDataListHead, char *apiName); // Hal Manager data handling functions int HalUtlInitializeHalMgrData(afb_api_t apiHandle, struct HalMgrData *halMgrData, char *apiName, char *info); |