1 /* 2 * Copyright (c) 2021 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef WLAN_HDI_SERVICE_STUD_H 17 #define WLAN_HDI_SERVICE_STUD_H 18 19 #include <hdf_base.h> 20 #include <hdf_sbuf.h> 21 #include <hdf_log.h> 22 #include <hdf_remote_service.h> 23 #include <hdf_device_desc.h> 24 #include <osal_mem.h> 25 #include "osal_mutex.h" 26 #include "hdf_dlist.h" 27 #include "securec.h" 28 #include "wifi_hal_ap_feature.h" 29 #include "wifi_hal_base_feature.h" 30 #include "wifi_hal_sta_feature.h" 31 #include "wifi_hal.h" 32 #include "wifi_hal_cmd.h" 33 34 struct HdfDeviceObject; 35 struct HdfDeviceIoClient; 36 37 enum InterFacesCmd { 38 WLAN_SERVICE_CONSTRUCT = 0, 39 WLAN_SERVICE_DECONSTRUCT, 40 WLAN_SERVICE_START, 41 WLAN_SERVICE_STOP, 42 WLAN_SERVICE_GET_SUPPORT_FEATURE, 43 WLAN_SERVICE_GET_SUPPORT_COMBO, 44 WLAN_SERVICE_CREATE_FEATURE, 45 WLAN_SERVICE_GET_FEATURE_NAME, 46 WLAN_SERVICE_REGISTER_CALLBACK, 47 WLAN_SERVICE_UNREGISTER_CALLBACK, 48 WLAN_SERVICE_DESTROY_FEATURE, 49 WLAN_SERVICE_RESET_DRIVER, 50 WLAN_SERVICE_GET_ASSCOCIATE_STA, 51 WLAN_SERVICE_SET_COUNTRY_CODE, 52 WLAN_SERVICE_GET_NETWORK_NAME, 53 WLAN_SERVICE_GET_FEATURE_TYPE, 54 WLAN_SERVICE_SET_MAC_ADDR, 55 WLAN_SERVICE_GET_MAC_ADDR, 56 WLAN_SERVICE_GET_FREQ_WITHBAND, 57 WLAN_SERVICE_SET_TX_POWR, 58 WLAN_SERVICE_GET_CHIPID, 59 WLAN_SERVICE_GET_NAME_BYCHIPID, 60 WLAN_SERVICE_SET_SACN_MACADDR, 61 WLAN_SERVICE_GET_NETDEV_INFO, 62 WLAN_SERVICE_START_SCAN, 63 }; 64 65 struct WifiHdi { 66 int32_t (*callback)(struct HdfDeviceObject *device, struct HdfRemoteService *callback, uint32_t event, 67 void *data, const char *ifName); 68 }; 69 70 struct FeatureInfo { 71 char *ifName; 72 int32_t type; 73 }; 74 75 struct HdfWlanRemoteNode { 76 const struct HdfDeviceIoClient *client; 77 struct HdfRemoteService* callbackObj; 78 struct DListHead node; 79 }; 80 81 struct HdfWlanStubData { 82 struct DListHead remoteListHead; 83 struct OsalMutex mutex; 84 }; 85 86 struct HdfWlanStubData* HdfStubDriver(void); 87 88 int32_t WlanHdiServiceOnRemoteRequest(struct HdfDeviceIoClient *client, int cmdId, 89 struct HdfSBuf *data, struct HdfSBuf *reply); 90 91 #endif