1 /*
2 * Copyright (c) 2022 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 #include "hdf_device_desc.h"
10 #include "hdf_log.h"
11
12 #define HDF_LOG_TAG uevent_ut_driver
13
HdfUeventDriverDispatch(struct HdfDeviceIoClient * client,int cmd,struct HdfSBuf * data,struct HdfSBuf * reply)14 static int32_t HdfUeventDriverDispatch(
15 struct HdfDeviceIoClient *client, int cmd, struct HdfSBuf *data, struct HdfSBuf *reply)
16 {
17 (void)client;
18 (void)cmd;
19 (void)data;
20 (void)reply;
21
22 return HDF_SUCCESS;
23 }
24
HdfUeventDriverRelease(struct HdfDeviceObject * deviceObject)25 static void HdfUeventDriverRelease(struct HdfDeviceObject *deviceObject)
26 {
27 (void)deviceObject;
28
29 HDF_LOGD("%s enter", __func__);
30
31 return;
32 }
33
HdfUeventDriverBind(struct HdfDeviceObject * deviceObject)34 static int HdfUeventDriverBind(struct HdfDeviceObject *deviceObject)
35 {
36 if (deviceObject == NULL) {
37 return HDF_FAILURE;
38 }
39
40 HDF_LOGD("%s enter", __func__);
41 static struct IDeviceIoService testService = {
42 .Dispatch = HdfUeventDriverDispatch,
43 .Open = NULL,
44 .Release = NULL,
45 };
46
47 deviceObject->service = &testService;
48
49 return HDF_SUCCESS;
50 }
51
HdfUeventDriverInit(struct HdfDeviceObject * deviceObject)52 static int HdfUeventDriverInit(struct HdfDeviceObject *deviceObject)
53 {
54 (void)deviceObject;
55
56 HDF_LOGD("%s enter", __func__);
57
58 return HDF_SUCCESS;
59 }
60
61 struct HdfDriverEntry g_ueventDriverEntry = {
62 .moduleVersion = 1,
63 .moduleName = "uevent_ut_driver",
64 .Bind = HdfUeventDriverBind,
65 .Init = HdfUeventDriverInit,
66 .Release = HdfUeventDriverRelease,
67 };
68
69 HDF_INIT(g_ueventDriverEntry);
70