1 /*
2  * Copyright (c) 2020-2021 Huawei Device Co., Ltd.
3  *
4  * HDF is dual licensed: you can use it either under the terms of
5  * the GPL, or the BSD license, at your option.
6  * See the LICENSE file in the root of this repository for complete details.
7  */
8 
9 #ifndef DEVHOST_SERVICE_CLNT_H
10 #define DEVHOST_SERVICE_CLNT_H
11 
12 #include "devhost_service_if.h"
13 #include "hdf_slist.h"
14 #include "hdf_map.h"
15 #include "osal_mutex.h"
16 
17 struct DevHostServiceClnt {
18     struct DListHead node;
19     struct HdfSList devices;
20     struct HdfSList unloadDevInfos;
21     struct HdfSList dynamicDevInfos;
22     Map *deviceHashMap;
23     struct IDevHostService *hostService;
24     struct OsalMutex hostLock;
25     uint16_t devCount;
26     uint16_t hostId;
27     int hostPid;
28     const char *hostName;
29     bool stopFlag;
30 };
31 
32 int DevHostServiceClntInstallDriver(struct DevHostServiceClnt *hostClnt);
33 struct DevHostServiceClnt *DevHostServiceClntNewInstance(uint16_t hostId, const char *hostName);
34 void DevHostServiceClntFreeInstance(struct DevHostServiceClnt *hostClnt);
35 void DevHostServiceClntDelete(struct DevHostServiceClnt *hostClnt);
36 
37 #endif /* DEVHOST_SERVICE_CLNT_H */
38