diff --git a/wlan/bundle.json b/wlan/bundle.json new file mode 100644 index 0000000000000000000000000000000000000000..cbb172aaae22bc821260c11ddd26a24c600c7911 --- /dev/null +++ b/wlan/bundle.json @@ -0,0 +1,42 @@ +{ + "name": "wlan_device_driver_interface", + "description": "wlan device driver interface", + "version": "3.2", + "license": "Apache License 2.0", + "component": { + "name": "wlan_device_driver_interface", + "subsystem": "hdf", + "syscap": [""], + "adapter_system_type": ["standard"], + "rom": "675KB", + "ram": "1024KB", + "deps": { + "components": [ + "ipc", + "device_driver_framework", + "hiviewdfx_hilog_native", + "utils_base" + ], + "third_part": [ + "bounds_checking_function" + ] + }, + "build": { + "sub_component": [ + "//drivers/interface/wlan/v1_0:libwlan_proxy_1.0" + ], + "test": [ + ], + "inner_kits": [ + { + "name": "//drivers/interface/wlan/v1_0:libwlan_proxy_1.0", + "header": { + "header_files": [ + ], + "header_base": "//drivers/interface/wlan" + } + } + ] + } + } + } \ No newline at end of file diff --git a/wlan/v1_0/BUILD.gn b/wlan/v1_0/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..d7e222220e4ab90eb8192a96fea2a46671a9d71c --- /dev/null +++ b/wlan/v1_0/BUILD.gn @@ -0,0 +1,34 @@ +# Copyright (c) 2022 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//drivers/adapter/uhdf2/hdi.gni") +if (defined(ohos_lite)) { + group("libwlan_proxy_1.0") { + deps = [] + public_configs = [] + } +} else { + hdi("wlan") { + module_name = "wlan_service" + + sources = [ + "IWlanCallback.idl", + "IWlanInterface.idl", + "WlanTypes.idl", + ] + + language = "c" + subsystem_name = "hdf" + part_name = "wlan_device_driver" + } +} diff --git a/wlan/v1_0/IWlanCallback.idl b/wlan/v1_0/IWlanCallback.idl new file mode 100644 index 0000000000000000000000000000000000000000..82960f312f648dfdcb3cc61f288c7d4df71197fc --- /dev/null +++ b/wlan/v1_0/IWlanCallback.idl @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.hdi.wlan.v1_0; + +import ohos.hdi.wlan.v1_0.WlanTypes; + +[callback] interface IWlanCallback { + ResetDriverResult([in] unsigned int event, [in] int code, [in] String ifName); + ScanResult([in] unsigned int event, [in] struct HdfWifiScanResult scanResult, [in] String ifName); +} \ No newline at end of file diff --git a/wlan/v1_0/IWlanInterface.idl b/wlan/v1_0/IWlanInterface.idl new file mode 100644 index 0000000000000000000000000000000000000000..f46c6ac34d7e8de136a1eddacc19ba93057689ec --- /dev/null +++ b/wlan/v1_0/IWlanInterface.idl @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.hdi.wlan.v1_0; + +import ohos.hdi.wlan.v1_0.WlanTypes; +import ohos.hdi.wlan.v1_0.IWlanCallback; + +interface IWlanInterface { + Start(); + Stop(); + CreateFeature([in] int type, [out] struct HdfFeatureInfo ifeature); + DestroyFeature([in] struct HdfFeatureInfo ifeature); + GetAsscociatedStas([in] struct HdfFeatureInfo ifeature, [out] struct HdfStaInfo[] staInfo, [out] unsigned int num); + GetChipId([in] struct HdfFeatureInfo ifeature, [out] unsigned char chipId); + GetDeviceMacAddress([in] struct HdfFeatureInfo ifeature, [out] unsigned char[] mac, [in] unsigned char len); + GetFeatureByIfName([in] String ifName, [out] struct HdfFeatureInfo ifeature); + GetFeatureType([in] struct HdfFeatureInfo ifeature, [out] int featureType); + GetFreqsWithBand([in] struct HdfFeatureInfo ifeature, [in] struct HdfWifiInfo wifiInfo, [out] int[] freq); + GetIfNamesByChipId([in] unsigned char chipId, [out] String ifName, [out] unsigned int num); + GetNetworkIfaceName([in] struct HdfFeatureInfo ifeature, [out] String ifName); + GetSupportCombo([out] unsigned long combo); + GetSupportFeature([out] unsigned char[] supType); + RegisterEventCallback([in] IWlanCallback cbFunc, [in] String ifName); + UnregisterEventCallback([in] IWlanCallback cbFunc, [in] String ifName); + ResetDriver([in] unsigned char chipId, [in] String ifName); + SetCountryCode([in] struct HdfFeatureInfo ifeature, [in] String code, [in] unsigned int len); + SetMacAddress([in] struct HdfFeatureInfo ifeature, [in] unsigned char[] mac); + SetScanningMacAddress([in] struct HdfFeatureInfo ifeature, [in] unsigned char[] scanMac); + SetTxPower([in] struct HdfFeatureInfo ifeature, [in] int power); + GetNetDevInfo([out] struct HdfNetDeviceInfoResult netDeviceInfoResult); + StartScan([in] struct HdfFeatureInfo ifeature, [in] struct HdfWifiScan scan); + GetPowerMode([in] struct HdfFeatureInfo ifeature, [out] unsigned char mode); + SetPowerMode([in] struct HdfFeatureInfo ifeature, [in] unsigned char mode); +} \ No newline at end of file diff --git a/wlan/v1_0/WlanTypes.idl b/wlan/v1_0/WlanTypes.idl new file mode 100644 index 0000000000000000000000000000000000000000..6cdb0dd9155ce247568c4310ad104ac7b4d2c54a --- /dev/null +++ b/wlan/v1_0/WlanTypes.idl @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.hdi.wlan.v1_0; + +struct HdfFeatureInfo { + String ifName; + int type; +}; + +struct HdfStaInfo { + unsigned char[] mac; +}; + +struct HdfWifiDriverScanSsid { + String ssid; + int ssidLen; +}; + +struct HdfWifiScan{ + struct HdfWifiDriverScanSsid[] ssids; + int[] freqs; + unsigned char[] extraIes; + unsigned char[] bssid; + unsigned char prefixSsidScanFlag; + unsigned char fastConnectFlag; +}; + +struct HdfNetDeviceInfo { + unsigned int index; + String ifName; + unsigned int ifNameLen; + unsigned char iftype; + unsigned char[] mac; +}; + +struct HdfNetDeviceInfoResult { + struct HdfNetDeviceInfo[] deviceInfos; +}; + +struct HdfWifiScanResult { + int flags; + unsigned char[] bssid; + short caps; + int freq; + short beaconInt; + int qual; + int level; + unsigned int age; + unsigned char[] variable; + unsigned char[] ie; + unsigned char[] beaconIe; +}; + +struct HdfWifiInfo { + int band; + unsigned int size; +}; \ No newline at end of file