add vs6621 support in android
Signed-off-by: lin <lin@kickpi.com>
18 files modified
77 files added
.. | .. |
---|
91 | 91 | |
---|
92 | 92 | # wifi and bt configuration |
---|
93 | 93 | # 1. Wifi Configuration |
---|
94 | | -BOARD_WIFI_VENDOR := aic |
---|
95 | | -BOARD_USR_WIFI := aic8800 |
---|
96 | | -WIFI_DRIVER_MODULE_PATH := "/vendor/modules/aic8800_fdrv.ko" |
---|
97 | | -WIFI_DRIVER_MODULE_NAME := "aic8800_fdrv" |
---|
98 | | -WIFI_DRIVER_MODULE_ARG := "" |
---|
| 94 | +BOARD_WIFI_VENDOR := common |
---|
| 95 | +BOARD_USR_WIFI := |
---|
| 96 | +WIFI_DRIVER_MODULE_PATH := |
---|
| 97 | +WIFI_DRIVER_MODULE_NAME := |
---|
| 98 | +WIFI_DRIVER_MODULE_ARG := |
---|
99 | 99 | |
---|
100 | 100 | # 2. Bluetooth Configuration |
---|
101 | | -BOARD_BLUETOOTH_VENDOR := aic |
---|
102 | | -BOARD_HAVE_BLUETOOTH_NAME := aic8800 |
---|
| 101 | +BOARD_BLUETOOTH_VENDOR := common |
---|
| 102 | +BOARD_HAVE_BLUETOOTH_NAME := |
---|
| 103 | +BOARD_BLUETOOTH_CONFIG_DIR := $(PRODUCT_PLATFORM_PATH)/common/wireless/bluetooth |
---|
103 | 104 | |
---|
104 | 105 | # wifi and bt configuration |
---|
105 | 106 | # 1. Wifi Configuration |
---|
.. | .. |
---|
35 | 35 | insmod /vendor/modules/aic8800_btlpm.ko |
---|
36 | 36 | setprop vendor.init.lpm.load 1 |
---|
37 | 37 | |
---|
| 38 | +on property:persist.vendor.bluetooth_vendor=seekwave |
---|
| 39 | + mkdir /data/local/skw 0777 system system |
---|
| 40 | + insmod /vendor/modules/skw_sdio.ko |
---|
| 41 | + insmod /vendor/modules/skw_bootcoms.ko log_path=/data/local/skw |
---|
| 42 | + setprop vendor.init.lpm.load 1 |
---|
| 43 | + |
---|
| 44 | +on property:persist.vendor.bluetooth_vendor=seekwave_lite |
---|
| 45 | + insmod /vendor/modules/skw_sdio_lite.ko |
---|
| 46 | + setprop vendor.init.lpm.load 1 |
---|
| 47 | + |
---|
38 | 48 | on property:vendor.driver.lpm.load=1 |
---|
39 | 49 | setprop vendor.init.lpm.load 1 |
---|
40 | 50 | |
---|
.. | .. |
---|
27 | 27 | |
---|
28 | 28 | WIRELESS_CONFIG_PATH := device/softwinner/common/config/wireless |
---|
29 | 29 | |
---|
30 | | -SUPPORTED_WIFI_VENDOR := broadcom realtek xradio sprd aic ssv common |
---|
31 | | -SUPPORTED_BLUETOOTH_VENDOR := broadcom realtek xradio sprd aic common |
---|
| 30 | +SUPPORTED_WIFI_VENDOR := broadcom realtek xradio sprd aic ssv seekwave common |
---|
| 31 | +SUPPORTED_BLUETOOTH_VENDOR := broadcom realtek xradio sprd aic seekwave common |
---|
32 | 32 | |
---|
33 | 33 | SAVED_PRODUCT_COPY_FILES := $(PRODUCT_COPY_FILES) |
---|
34 | 34 | PRODUCT_COPY_FILES := |
---|
.. | .. |
---|
100 | 100 | BOARD_HOSTAPD_PRIVATE_LIB := lib_driver_cmd_ssv |
---|
101 | 101 | BOARD_WIRELESS_PROPERTIES += wifi.direct.interface=p2p0 |
---|
102 | 102 | -include hardware/ssv/wlan/firmware/$(BOARD_USR_WIFI)/device-ssv.mk |
---|
| 103 | + else ifeq ($(BOARD_WIFI_VENDOR),seekwave) |
---|
| 104 | + BOARD_WLAN_DEVICE := seekwave |
---|
| 105 | + BOARD_WPA_SUPPLICANT_PRIVATE_LIB := lib_driver_cmd_seekwave |
---|
| 106 | + BOARD_HOSTAPD_PRIVATE_LIB := lib_driver_cmd_seekwave |
---|
| 107 | + # hostapd enable 802.11ax |
---|
| 108 | + #WIFI_FEATURE_HOSTAPD_11AX := true |
---|
| 109 | + PRODUCT_PROPERTY_OVERRIDES += wifi.direct.interface=p2p-dev-wlan0 |
---|
| 110 | + PRODUCT_CFI_INCLUDE_PATHS += hardware/seekwave/wlan/wpa_supplicant_8_lib |
---|
| 111 | + $(call inherit-product-if-exists, hardware/seekwave/wlan/configs/config-skw.mk) |
---|
103 | 112 | else ifeq ($(BOARD_WIFI_VENDOR),common) |
---|
104 | 113 | BOARD_WLAN_DEVICE := common |
---|
105 | 114 | BOARD_WPA_SUPPLICANT_PRIVATE_LIB := lib_driver_cmd_common |
---|
.. | .. |
---|
168 | 177 | BOARD_WIRELESS_FILES += $(TARGET_DEVICE_DIR)/configs/bluetooth/rtkbt.conf:$(TARGET_COPY_OUT_VENDOR)/etc/bluetooth/rtkbt.conf |
---|
169 | 178 | BOARD_WIRELESS_PACKAGES += libbt-package wireless_hwinfo |
---|
170 | 179 | -include hardware/aw/wireless/bluetooth/firmware/firmware.mk |
---|
| 180 | + else ifeq ($(BOARD_BLUETOOTH_VENDOR),seekwave) |
---|
| 181 | + BOARD_WIRELESS_FILES += hardware/seekwave/skwbt/vendor/etc/bluetooth/sv6160.nvbin:$(TARGET_COPY_OUT_VENDOR)/etc/bluetooth/sv6160.nvbin |
---|
| 182 | + BOARD_WIRELESS_FILES += hardware/seekwave/skwbt/vendor/etc/bluetooth/skwbt.conf:$(TARGET_COPY_OUT_VENDOR)/etc/bluetooth/skwbt.conf |
---|
| 183 | + BOARD_WIRELESS_PACKAGES += libbt-vendor-seekwave |
---|
171 | 184 | endif |
---|
172 | 185 | $(call soong_config_add,vendor,board_bluetooth_vendor,$(BOARD_BLUETOOTH_VENDOR)) |
---|
173 | 186 | else |
---|
.. | .. |
---|
118 | 118 | else ifeq ($(BOARD_WLAN_DEVICE), aic) |
---|
119 | 119 | # support AIC WIFI HAL |
---|
120 | 120 | LIB_WIFI_HAL := libwifi-hal-aic |
---|
| 121 | +else ifeq ($(BOARD_WLAN_DEVICE), seekwave) |
---|
| 122 | + # support seekwave WIFI HAL |
---|
| 123 | + LIB_WIFI_HAL := libwifi-hal-skw |
---|
121 | 124 | else ifeq ($(BOARD_WLAN_DEVICE), common) |
---|
122 | 125 | # support aw autodetct WIFI HAL |
---|
123 | 126 | LIB_WIFI_HAL := libwifi-hal-autodetect |
---|
.. | .. |
---|
119 | 119 | char driver_status[PROPERTY_VALUE_MAX]; |
---|
120 | 120 | #ifdef WIFI_DRIVER_MODULE_PATH |
---|
121 | 121 | FILE *proc; |
---|
122 | | - char line[sizeof(DRIVER_MODULE_TAG) + 10]; |
---|
| 122 | + char line[sizeof(DRIVER_MODULE_TAG) + 20]; |
---|
123 | 123 | #endif |
---|
124 | 124 | |
---|
125 | 125 | if (!property_get(DRIVER_PROP_NAME, driver_status, NULL)) { |
---|
.. | .. |
---|
35 | 35 | insmod /vendor/modules/aic8800_btlpm.ko |
---|
36 | 36 | setprop vendor.init.lpm.load 1 |
---|
37 | 37 | |
---|
| 38 | +on property:persist.vendor.overlay.bluetooth_vendor=seekwave |
---|
| 39 | + mkdir /data/local/skw 0777 system system |
---|
| 40 | + insmod /vendor/modules/skw_sdio.ko |
---|
| 41 | + insmod /vendor/modules/skw_bootcoms.ko log_path=/data/local/skw |
---|
| 42 | + setprop vendor.init.lpm.load 1 |
---|
| 43 | + |
---|
| 44 | +on property:persist.vendor.overlay.bluetooth_vendor=seekwave_lite |
---|
| 45 | + insmod /vendor/modules/skw_sdio_lite.ko |
---|
| 46 | + setprop vendor.init.lpm.load 1 |
---|
| 47 | + |
---|
| 48 | + |
---|
38 | 49 | on property:vendor.driver.lpm.load=1 |
---|
39 | 50 | setprop vendor.init.lpm.load 1 |
---|
40 | 51 | |
---|
.. | .. |
---|
3 | 3 | -include hardware/aw/wireless/bluetooth/firmware/broadcom/broadcom-bt.mk |
---|
4 | 4 | -include hardware/aw/wireless/bluetooth/firmware/sprd/sprd-bt.mk |
---|
5 | 5 | -include hardware/aw/wireless/bluetooth/firmware/aic/aic-bt.mk |
---|
| 6 | +-include hardware/aw/wireless/bluetooth/firmware/seekwave/seekwave-bt.mk |
---|
6 | 7 | |
---|
7 | 8 | # initrc for bluetooth |
---|
8 | 9 | PRODUCT_COPY_FILES += \ |
---|
.. | .. |
---|
| 1 | +# |
---|
| 2 | +# Copyright (C) 2008 The Android Open Source Project |
---|
| 3 | +# |
---|
| 4 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
---|
| 5 | +# you may not use this file except in compliance with the License. |
---|
| 6 | +# You may obtain a copy of the License at |
---|
| 7 | +# |
---|
| 8 | +# http://www.apache.org/licenses/LICENSE-2.0 |
---|
| 9 | +# |
---|
| 10 | +# Unless required by applicable law or agreed to in writing, software |
---|
| 11 | +# distributed under the License is distributed on an "AS IS" BASIS, |
---|
| 12 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
---|
| 13 | +# See the License for the specific language governing permissions and |
---|
| 14 | +# limitations under the License. |
---|
| 15 | +# |
---|
| 16 | + |
---|
| 17 | +CUR_PATH := hardware/seekwave/skwbt |
---|
| 18 | + |
---|
| 19 | +PRODUCT_COPY_FILES += $(CUR_PATH)/vendor/etc/bluetooth/skwbt.conf:vendor/etc/bluetooth/skwbt.conf |
---|
| 20 | +PRODUCT_COPY_FILES += $(CUR_PATH)/vendor/etc/bluetooth/sv6160.nvbin:vendor/etc/bluetooth/sv6160.nvbin |
---|
| 21 | +PRODUCT_COPY_FILES += $(CUR_PATH)/vendor/etc/bluetooth/sv6316.nvbin:vendor/etc/bluetooth/sv6316.nvbin |
---|
| 22 | +PRODUCT_COPY_FILES += $(CUR_PATH)/vendor/etc/bluetooth/sv6160lite.nvbin:vendor/etc/bluetooth/sv6160lite.nvbin |
---|
| 23 | +-include hardware/seekwave/firmware/device-skw.mk |
---|
.. | .. |
---|
37 | 37 | libbt-xradio \ |
---|
38 | 38 | libbt-broadcom \ |
---|
39 | 39 | libbt-realtek \ |
---|
40 | | - libbt-sprd |
---|
| 40 | + libbt-sprd \ |
---|
| 41 | + libbt-skw |
---|
41 | 42 | include $(BUILD_PHONY_PACKAGE) |
---|
.. | .. |
---|
| 1 | +LOCAL_PATH := hardware/seekwave/skwbt |
---|
| 2 | + |
---|
| 3 | +include $(CLEAR_VARS) |
---|
| 4 | + |
---|
| 5 | +BDROID_DIR := $(TOP_DIR)system/bt |
---|
| 6 | +ifeq ($(PLATFORM_VERSION),13) |
---|
| 7 | +BDROID_DIR := $(TOP_DIR)packages/modules/Bluetooth/system |
---|
| 8 | +else ifeq ($(PLATFORM_VERSION),14) |
---|
| 9 | +BDROID_DIR := $(TOP_DIR)packages/modules/Bluetooth/system |
---|
| 10 | +endif |
---|
| 11 | + |
---|
| 12 | +LOCAL_SRC_FILES := \ |
---|
| 13 | + src/skw_ext.c \ |
---|
| 14 | + src/bt_vendor_skw.c \ |
---|
| 15 | + src/scom_vendor.c \ |
---|
| 16 | + src/skw_log.c \ |
---|
| 17 | + src/skw_gen_addr.c \ |
---|
| 18 | + src/skw_btsnoop.c |
---|
| 19 | + |
---|
| 20 | +LOCAL_C_INCLUDES += \ |
---|
| 21 | + $(LOCAL_PATH)/include \ |
---|
| 22 | + $(BDROID_DIR)/hci/include |
---|
| 23 | + |
---|
| 24 | +LOCAL_C_INCLUDES += $(bdroid_C_INCLUDES) |
---|
| 25 | +LOCAL_CFLAGS += $(bdroid_CFLAGS) |
---|
| 26 | + |
---|
| 27 | +LOCAL_SHARED_LIBRARIES := \ |
---|
| 28 | + libcutils \ |
---|
| 29 | + libutils \ |
---|
| 30 | + liblog |
---|
| 31 | + |
---|
| 32 | +LOCAL_MODULE := libbt-skw |
---|
| 33 | +LOCAL_MODULE_TAGS := optional |
---|
| 34 | +LOCAL_MODULE_CLASS := SHARED_LIBRARIES |
---|
| 35 | +LOCAL_MODULE_OWNER := seekwave |
---|
| 36 | +LOCAL_PROPRIETARY_MODULE := true |
---|
| 37 | + |
---|
| 38 | +include $(BUILD_SHARED_LIBRARY) |
---|
.. | .. |
---|
4 | 4 | group system |
---|
5 | 5 | capabilities BLOCK_SUSPEND NET_ADMIN |
---|
6 | 6 | oneshot |
---|
| 7 | + |
---|
| 8 | +on boot |
---|
| 9 | + chmod 0660 /sys/class/rfkill/rfkill0/state |
---|
| 10 | + write /sys/class/rfkill/rfkill0/state 1 |
---|
| 11 | + |
---|
| 12 | +on property:init.svc.wl_info=stopped |
---|
| 13 | + write /sys/class/rfkill/rfkill0/state 0 |
---|
.. | .. |
---|
99 | 99 | {"ssv", {"libwifi-hal-ssv.so" }}, |
---|
100 | 100 | {"sprd", {"libwifi-hal-sprd.so" }}, |
---|
101 | 101 | {"aic", {"libwifi-hal-aic.so" }}, |
---|
| 102 | + {"seekwave", {"libwifi-hal-skw.so" }}, |
---|
| 103 | + {"seekwave_lite",{"libwifi-hal-skw.so" }}, |
---|
102 | 104 | }; |
---|
103 | 105 | |
---|
104 | 106 | static const struct info_t libbt_name[] = { |
---|
.. | .. |
---|
108 | 110 | {"qualcomm", {"libbt-qualcomm.so"}}, |
---|
109 | 111 | {"sprd", {"libbt-sprd.so" }}, |
---|
110 | 112 | {"aic", {"libbt-aic.so" }}, |
---|
| 113 | + {"seekwave", {"libbt-skw.so" }}, |
---|
| 114 | + {"seekwave_lite", {"libbt-skw.so" }}, |
---|
111 | 115 | }; |
---|
112 | 116 | |
---|
113 | 117 | static const struct info_t wifi_drv_para[] = { |
---|
.. | .. |
---|
155 | 159 | {0x13030, "ssv6x5x", "ssv6x5x", "ssv6x5x", "ssv", 0}, |
---|
156 | 160 | {0x10000, "uwe5622", "sprdwl_ng", "sprdwl_ng", "sprd", 1}, |
---|
157 | 161 | {0x10145, "aic8800", "aic8800_fdrv","aic8800_fdrv","aic", 1}, |
---|
| 162 | + {0x10000, "skw", "skw", "skw", "seekwave", 1}, |
---|
| 163 | + {0x16621, "skw6160_lite", "swt6621s_wifi", "swt6621s_wifi", "seekwave_lite", 1}, |
---|
158 | 164 | }; |
---|
159 | 165 | |
---|
160 | 166 | /* default select invalid if get wifi_hardware_info failed */ |
---|
.. | .. |
---|
35 | 35 | |
---|
36 | 36 | on property:persist.vendor.overlay.wlan_vendor=aic |
---|
37 | 37 | setprop wifi.direct.interface p2p-dev-wlan0 |
---|
| 38 | + |
---|
| 39 | +on property:persist.vendor.overlay.wlan_vendor=seekwave |
---|
| 40 | + setprop wifi.direct.interface p2p-dev-wlan0 |
---|
| 41 | + |
---|
| 42 | +on property:persist.vendor.overlay.wlan_vendor=seekwave_lite |
---|
| 43 | + setprop wifi.direct.interface p2p-dev-wlan0 |
---|
.. | .. |
---|
| 1 | +p2p_no_group_iface=1 |
---|
1 | 2 | disable_scan_offload=1 |
---|
2 | 3 | wowlan_triggers=any |
---|
3 | 4 | p2p_no_go_freq=5170-5740 |
---|
.. | .. |
---|
43 | 43 | libwifi-hal-ssv \ |
---|
44 | 44 | libwifi-hal-xradio \ |
---|
45 | 45 | libwifi-hal-rtk \ |
---|
46 | | - libwifi-hal-bcm |
---|
| 46 | + libwifi-hal-bcm \ |
---|
| 47 | + libwifi-hal-skw |
---|
| 48 | + |
---|
47 | 49 | include $(BUILD_PHONY_PACKAGE) |
---|
.. | .. |
---|
| 1 | +# Copyright (C) 2011 The Android Open Source Project |
---|
| 2 | +# |
---|
| 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 | +LOCAL_PATH := hardware/seekwave/wlan/wifi_hal |
---|
| 16 | + |
---|
| 17 | +# Make the HAL library |
---|
| 18 | +# ============================================================ |
---|
| 19 | +include $(CLEAR_VARS) |
---|
| 20 | + |
---|
| 21 | +LOCAL_CFLAGS := -Wall \ |
---|
| 22 | + -Werror \ |
---|
| 23 | + -Wno-format \ |
---|
| 24 | + -Wno-reorder \ |
---|
| 25 | + -Wno-unused-function \ |
---|
| 26 | + -Wno-unused-parameter \ |
---|
| 27 | + -Wno-unused-private-field \ |
---|
| 28 | + -Wno-unused-variable \ |
---|
| 29 | + -Wno-unused-parameter |
---|
| 30 | + |
---|
| 31 | +LOCAL_C_INCLUDES += external/libnl/include \ |
---|
| 32 | + $(call include-path-for, libhardware_legacy)/hardware_legacy \ |
---|
| 33 | + external/wpa_supplicant_8/src/drivers \ |
---|
| 34 | + external/boringssl/include \ |
---|
| 35 | + external/boringssl/src/crypto/digest \ |
---|
| 36 | + external/boringssl/src/crypto/evp/ |
---|
| 37 | + |
---|
| 38 | +LOCAL_HEADER_LIBRARIES := libutils_headers liblog_headers |
---|
| 39 | + |
---|
| 40 | +LOCAL_SRC_FILES := main.cpp \ |
---|
| 41 | + wifi_command.cpp |
---|
| 42 | + |
---|
| 43 | +LOCAL_SHARED_LIBRARIES := \ |
---|
| 44 | + libnl \ |
---|
| 45 | + libutils \ |
---|
| 46 | + liblog |
---|
| 47 | + |
---|
| 48 | +LOCAL_MODULE := libwifi-hal-skw |
---|
| 49 | +LOCAL_PROPRIETARY_MODULE := true |
---|
| 50 | +#LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0 |
---|
| 51 | +#LOCAL_LICENSE_CONDITIONS := notice |
---|
| 52 | +#LOCAL_NOTICE_FILE := $(LOCAL_PATH)/NOTICE |
---|
| 53 | + |
---|
| 54 | +include $(BUILD_SHARED_LIBRARY) |
---|
| 55 | + |
---|
| 56 | + |
---|
.. | .. |
---|
67 | 67 | LOCAL_WHOLE_STATIC_LIBRARIES += lib_driver_cmd_ssv |
---|
68 | 68 | LOCAL_WHOLE_STATIC_LIBRARIES += lib_driver_cmd_sprd |
---|
69 | 69 | LOCAL_WHOLE_STATIC_LIBRARIES += lib_driver_cmd_aic |
---|
| 70 | +LOCAL_WHOLE_STATIC_LIBRARIES += lib_driver_cmd_skw |
---|
| 71 | + |
---|
70 | 72 | LOCAL_CFLAGS := $(L_CFLAGS) |
---|
71 | 73 | LOCAL_SRC_FILES := $(WPA_SRC_FILE) |
---|
72 | 74 | LOCAL_C_INCLUDES := $(WPA_SUPPL_DIR_INCLUDE) |
---|
.. | .. |
---|
12 | 12 | extern driver_cmd_nl80211_cb ssv_nl80211_cb; |
---|
13 | 13 | extern driver_cmd_nl80211_cb sprd_nl80211_cb; |
---|
14 | 14 | extern driver_cmd_nl80211_cb aic_nl80211_cb; |
---|
| 15 | +extern driver_cmd_nl80211_cb seekwave_nl80211_cb; |
---|
15 | 16 | |
---|
16 | 17 | static driver_cmd_nl80211_cb *pcb = NULL; |
---|
17 | 18 | |
---|
.. | .. |
---|
38 | 39 | pcb = &sprd_nl80211_cb; |
---|
39 | 40 | else if (strcmp(vendor_name, "aic") == 0) |
---|
40 | 41 | pcb = &aic_nl80211_cb; |
---|
| 42 | + else if (strcmp(vendor_name, "seekwave") == 0) |
---|
| 43 | + pcb = &seekwave_nl80211_cb; |
---|
41 | 44 | else |
---|
42 | 45 | return -1; |
---|
43 | 46 | |
---|
.. | .. |
---|
11 | 11 | extern driver_cmd_wext_cb xr_wext_cb; |
---|
12 | 12 | extern driver_cmd_wext_cb ssv_wext_cb; |
---|
13 | 13 | extern driver_cmd_wext_cb aic_wext_cb; |
---|
| 14 | +extern driver_cmd_wext_cb seekwave_wext_cb; |
---|
14 | 15 | |
---|
15 | 16 | static driver_cmd_wext_cb *pcb = NULL; |
---|
16 | 17 | |
---|
.. | .. |
---|
35 | 36 | pcb = &ssv_wext_cb; |
---|
36 | 37 | else if (strcmp(vendor_name, "aic") == 0) |
---|
37 | 38 | pcb = &aic_wext_cb; |
---|
| 39 | + else if (strcmp(vendor_name, "seekwave") == 0) |
---|
| 40 | + pcb = &seekwave_wext_cb; |
---|
38 | 41 | else |
---|
39 | 42 | return -1; |
---|
40 | 43 | |
---|
.. | .. |
---|
| 1 | +# |
---|
| 2 | +# Copyright (C) 2008 The Android Open Source Project |
---|
| 3 | +# |
---|
| 4 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
---|
| 5 | +# you may not use this file except in compliance with the License. |
---|
| 6 | +# You may obtain a copy of the License at |
---|
| 7 | +# |
---|
| 8 | +# http://www.apache.org/licenses/LICENSE-2.0 |
---|
| 9 | +# |
---|
| 10 | +# Unless required by applicable law or agreed to in writing, software |
---|
| 11 | +# distributed under the License is distributed on an "AS IS" BASIS, |
---|
| 12 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
---|
| 13 | +# See the License for the specific language governing permissions and |
---|
| 14 | +# limitations under the License. |
---|
| 15 | +# |
---|
| 16 | +LOCAL_PATH := $(call my-dir) |
---|
| 17 | + |
---|
| 18 | +ifeq ($(WPA_SUPPLICANT_VERSION),VER_0_8_X) |
---|
| 19 | + |
---|
| 20 | +ifneq ($(BOARD_WPA_SUPPLICANT_DRIVER),) |
---|
| 21 | + CONFIG_DRIVER_$(BOARD_WPA_SUPPLICANT_DRIVER) := y |
---|
| 22 | +endif |
---|
| 23 | + |
---|
| 24 | +WPA_SUPPL_DIR = external/wpa_supplicant_8 |
---|
| 25 | +WPA_SRC_FILE := |
---|
| 26 | + |
---|
| 27 | +include $(WPA_SUPPL_DIR)/wpa_supplicant/android.config |
---|
| 28 | + |
---|
| 29 | +WPA_SUPPL_DIR_INCLUDE = $(WPA_SUPPL_DIR)/src \ |
---|
| 30 | + $(WPA_SUPPL_DIR)/src/common \ |
---|
| 31 | + $(WPA_SUPPL_DIR)/src/drivers \ |
---|
| 32 | + $(WPA_SUPPL_DIR)/src/l2_packet \ |
---|
| 33 | + $(WPA_SUPPL_DIR)/src/utils \ |
---|
| 34 | + $(WPA_SUPPL_DIR)/src/wps \ |
---|
| 35 | + $(WPA_SUPPL_DIR)/wpa_supplicant |
---|
| 36 | + |
---|
| 37 | +ifdef CONFIG_DRIVER_NL80211 |
---|
| 38 | +WPA_SUPPL_DIR_INCLUDE += external/libnl/include |
---|
| 39 | +WPA_SRC_FILE += driver_cmd_nl80211.c |
---|
| 40 | +endif |
---|
| 41 | + |
---|
| 42 | +ifdef CONFIG_DRIVER_WEXT |
---|
| 43 | +WPA_SRC_FILE += driver_cmd_wext.c |
---|
| 44 | +endif |
---|
| 45 | + |
---|
| 46 | +ifeq ($(TARGET_ARCH),arm) |
---|
| 47 | +# To force sizeof(enum) = 4 |
---|
| 48 | +L_CFLAGS += -mabi=aapcs-linux |
---|
| 49 | +endif |
---|
| 50 | + |
---|
| 51 | +ifdef CONFIG_ANDROID_LOG |
---|
| 52 | +L_CFLAGS += -DCONFIG_ANDROID_LOG |
---|
| 53 | +endif |
---|
| 54 | + |
---|
| 55 | +ifdef CONFIG_P2P |
---|
| 56 | +L_CFLAGS += -DCONFIG_P2P |
---|
| 57 | +endif |
---|
| 58 | +######################## |
---|
| 59 | + |
---|
| 60 | +include $(CLEAR_VARS) |
---|
| 61 | +LOCAL_MODULE := lib_driver_cmd_skw |
---|
| 62 | +LOCAL_SHARED_LIBRARIES := libc libcutils |
---|
| 63 | +LOCAL_CFLAGS := $(L_CFLAGS) |
---|
| 64 | +#LOCAL_SRC_FILES := $(WPA_SRC_FILE) |
---|
| 65 | +LOCAL_C_INCLUDES := $(WPA_SUPPL_DIR_INCLUDE) |
---|
| 66 | +LOCAL_PROPRIETARY_MODULE := true |
---|
| 67 | + |
---|
| 68 | +LOCAL_C_INCLUDES += hardware/aw/wireless/wlan/wpa_supplicant_8_lib/common |
---|
| 69 | +LOCAL_MODULE_CLASS := STATIC_LIBRARIES |
---|
| 70 | + |
---|
| 71 | +SCRIPT_PATH := hardware/aw/wireless/wlan/wpa_supplicant_8_lib/vendor |
---|
| 72 | +VENDOR_PATH := hardware/seekwave/wlan/wpa_supplicant_8_lib |
---|
| 73 | + |
---|
| 74 | +ifdef CONFIG_DRIVER_NL80211 |
---|
| 75 | +LOCAL_GENERATED_SOURCES := $(local-generated-sources-dir)/driver_cmd_nl80211.c |
---|
| 76 | +LOCAL_GENERATED_SOURCES += $(local-generated-sources-dir)/driver_cmd_nl80211.h |
---|
| 77 | +LOCAL_GENERATED_SOURCES += $(local-generated-sources-dir)/rtw_version.h |
---|
| 78 | +endif |
---|
| 79 | + |
---|
| 80 | +ifdef CONFIG_DRIVER_WEXT |
---|
| 81 | +LOCAL_GENERATED_SOURCES += $(local-generated-sources-dir)/driver_cmd_wext.c |
---|
| 82 | +LOCAL_GENERATED_SOURCES += $(local-generated-sources-dir)/driver_cmd_wext.h |
---|
| 83 | +endif |
---|
| 84 | + |
---|
| 85 | +$(LOCAL_GENERATED_SOURCES): $(SCRIPT_PATH)/auto-gen-source.sh $(VENDOR_PATH) |
---|
| 86 | + @echo "Generator: $@" |
---|
| 87 | + @./$< $^ seekwave $@ |
---|
| 88 | + |
---|
| 89 | +include $(BUILD_STATIC_LIBRARY) |
---|
| 90 | + |
---|
| 91 | +######################## |
---|
| 92 | + |
---|
| 93 | +endif |
---|
.. | .. |
---|
| 1 | +;******************************************************************************
|
---|
| 2 | +; Wifi Limit Setup file
|
---|
| 3 | +;******************************************************************************
|
---|
| 4 | +[VERSION]
|
---|
| 5 | +WT_VERSION = EA6521QF_20230728
|
---|
| 6 | +;优化TX EVM
|
---|
| 7 | +;-----------------------------------------------------------------------------
|
---|
| 8 | +[CAL_POWER_INFO]
|
---|
| 9 | +;-----------------------------------------------------------------------------
|
---|
| 10 | +;设置浮点数,工具会自动做浮点转定点数的处理txpower,s(8,2)
|
---|
| 11 | +;发送给DUT之后,DUT会进行 <<Qnum 的操作,这里的数据不要提前移位 赋值的数值必须是10进制,与DUT侧对应
|
---|
| 12 | +;注释:11b rate 1M,2M,5.5M,11M
|
---|
| 13 | +G_TXPWR11B_UQ2 = 17, 17, 17, 17
|
---|
| 14 | +;注释:non-ht 2g cbw40 rate 6M/9M,12M,18M,24M,36M,48M,54M
|
---|
| 15 | +G_TXPWRNONHTDUP2G_UQ2 = 17, 17, 17, 17, 17, 17, 17, 15
|
---|
| 16 | +;注释:non-ht 5g cbw40 rate 6M,9M,12M,18M,24M,36M,48M,54M; cbw80 rate 6M,9M,12M,18M,24M,36M,48M,54M
|
---|
| 17 | +G_TXPWRNONHTDUP5G_UQ2 = 16, 16, 16, 16, 16, 16, 16, 15, 16, 16, 16, 16, 16, 16, 16, 15
|
---|
| 18 | +;注释:non-ht/ht/vht/he cbw20 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 19 | +;ht/vht/he cbw40 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 20 | +G_TXPWRMCS2G_UQ2 = 17, 17, 17, 17, 17, 17, 17, 15, 15, 14, 14, 13, 13, 17, 17, 17, 17, 17, 17, 17, 15, 15, 13, 13, 12, 12
|
---|
| 21 | +;写注释non-ht/ht/vht/he cbw20 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 22 | +;ht/vht/he cbw40 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 23 | +;ht/vht/he cbw80 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 24 | +G_TXPWRMCS5G_UQ2 = 16, 16, 16, 16, 16, 16, 16, 15, 14, 13, 13, 12, 12, 16, 16, 16, 16, 16, 16, 16, 15, 14, 13, 12, 12, 12, 15, 15, 15, 15, 15, 15, 15, 14, 13, 13, 11, 11, 11
|
---|
| 25 | +;写注释he TB SMALL RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 26 | +;he TB BIG RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 27 | +;he TB BIG RU BIG POWER rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 28 | +TBMAXTXPWR5G_UQ3 = 16, 16, 16, 16, 16, 16, 16, 15, 14, 13, 13, 12, 12, 16, 16, 16, 16, 16, 16, 16, 15, 14, 13, 13, 12, 12, 16, 16, 16, 16, 16, 16, 16, 15, 14, 13, 13, 12, 12
|
---|
| 29 | +;写注释he TB SMALL RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 30 | +;he TB BIG RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 31 | +;he TB BIG RU BIG POWER rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 32 | +TBMAXTXPWR2G_UQ3 = 17, 17, 17, 17, 17, 17, 17, 15, 15, 14, 14, 13, 13, 17, 17, 17, 17, 17, 17, 17, 15, 15, 14, 14, 13, 13, 17, 17, 17, 17, 17, 17, 17, 15, 15, 14, 14, 13, 13
|
---|
| 33 | +;写注释 5G,2G MIN TX POWER
|
---|
| 34 | +TBMINTXPWR_SQ2 = 00, 00
|
---|
| 35 | +
|
---|
| 36 | +;注释:11b rate 1M,2M,5.5M,11M
|
---|
| 37 | +G_TXPWR11B_UQ2_DELTA = 00, 00, 00, 00
|
---|
| 38 | +;注释:non-ht 2g cbw40 rate 6M/9M,12M,18M,24M,36M,48M,54M
|
---|
| 39 | +G_TXPWRNONHTDUP2G_UQ2_DELTA = 00, 00, 00, 00, 00, 00, 00, 00
|
---|
| 40 | +;注释:non-ht 5g cbw40 rate 6M,9M,12M,18M,24M,36M,48M,54M; cbw80 rate 6M,9M,12M,18M,24M,36M,48M,54M
|
---|
| 41 | +G_TXPWRNONHTDUP5G_UQ2_DELTA = 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00
|
---|
| 42 | +;注释:non-ht/ht/vht/he cbw20 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 43 | +;ht/vht/he cbw40 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 44 | +G_TXPWRMCS2G_UQ2_DELTA = 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00
|
---|
| 45 | +;写注释non-ht/ht/vht/he cbw20 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 46 | +;ht/vht/he cbw40 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 47 | +;ht/vht/he cbw80 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 48 | +G_TXPWRMCS5G_UQ2_DELTA = 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00
|
---|
| 49 | +;写注释he TB SMALL RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 50 | +;he TB BIG RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 51 | +;he TB BIG RU BIG POWER rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 52 | +TBMAXTXPWR5G_UQ3_DELTA = 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00
|
---|
| 53 | +;写注释he TB SMALL RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 54 | +;he TB BIG RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 55 | +;he TB BIG RU BIG POWER rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 56 | +TBMAXTXPWR2G_UQ3_DELTA = 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00
|
---|
| 57 | +;写注释 5G,2G MIN TX POWER
|
---|
| 58 | +TBMINTXPWR_SQ2_DELTA = 00, 00
|
---|
| 59 | +;-----------------------------------------------------------------------------
|
---|
| 60 | +[CHAN_POWER_COMPINFO]
|
---|
| 61 | +;-----------------------------------------------------------------------------
|
---|
| 62 | +;设置浮点数,工具会自动做浮点转定点数的处理。按频点补偿txpower,s(8,2),正数表示加功率,负数表示减功率
|
---|
| 63 | +;cbw20,2g 14个channel 1,2,3,4,5,6,7,8,9,10,11,12,13,14
|
---|
| 64 | +G_COMPCHANTXPWR2G_CBW20_SQ2 = 0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
---|
| 65 | +;cbw40,2g 9个channel 3,4,5,6,7,8,9,10,11
|
---|
| 66 | +G_COMPCHANTXPWR2G_CBW40_SQ2 = 0,0,0,0,0,0,0,0,0
|
---|
| 67 | +;cbw20,5g low band 8个channel 36,40,44,48,52,56,60,64
|
---|
| 68 | +G_COMPCHANTXPWR5G_LOW_CBW20_SQ2 = 0,0,0,0,0,0,0,0
|
---|
| 69 | +;cbw20,5g mid band 12个 channel 100,104,108,112,116,120,124,128,132,136,140,144
|
---|
| 70 | +G_COMPCHANTXPWR5G_MID_CBW20_SQ2 = 0,0,0,0,0,0,0,0,0,0,0,0
|
---|
| 71 | +;cbw20,5g high band 8个 channel 149,153,157,161,165,169,173,177
|
---|
| 72 | +G_COMPCHANTXPWR5G_HIGH_CBW20_SQ2 = 0,0,0,0,0,0,0,0
|
---|
| 73 | +;cbw40,5g low band 4个channel 38,46,54,62
|
---|
| 74 | +G_COMPCHANTXPWR5G_LOW_CBW40_SQ2 = 0,0,0,0
|
---|
| 75 | +;cbw40,5g mid band 6个 channel 102,110,118,126,134,142
|
---|
| 76 | +G_COMPCHANTXPWR5G_MID_CBW40_SQ2 = 0,0,0,0,0,0
|
---|
| 77 | +;cbw40,5g high band 4个 channel 151,159,167,175
|
---|
| 78 | +G_COMPCHANTXPWR5G_HIGH_CBW40_SQ2 = 0,0,0,0
|
---|
| 79 | +;cbw80,5g low band 2个 channel 42,58
|
---|
| 80 | +G_COMPCHANTXPWR5G_LOW_CBW80_SQ2 = 0,0
|
---|
| 81 | +;cbw80,5g mid band 3个 channel 106,122,138
|
---|
| 82 | +G_COMPCHANTXPWR5G_MID_CBW80_SQ2 = 0,0,0
|
---|
| 83 | +;cbw80,5g high band 2个 channel 155,171
|
---|
| 84 | +G_COMPCHANTXPWR5G_HIGH_CBW80_SQ2 = 0,0
|
---|
| 85 | +
|
---|
| 86 | +;-----------------------------------------------------------------------------
|
---|
| 87 | +[RegAddr1]
|
---|
| 88 | +;-----------------------------------------------------------------------------
|
---|
| 89 | +;寄存器配置,RegAddr是寄存器地址,每个信道对应一个寄存器值
|
---|
| 90 | +;RegAddr1,start_bit, stop_bit = 0x401420C0,4,0
|
---|
| 91 | +RegAddr_Config = 0x401420C0,4,0
|
---|
| 92 | +;cbw20 2g 3个channel 3,7,11
|
---|
| 93 | +RegAddr_2G_CBW20 = 11,11,11
|
---|
| 94 | +;cbw40 2g 3个channel 3,7,11
|
---|
| 95 | +RegAddr_2G_CBW40 = 11,11,11
|
---|
| 96 | +;cbw20,5g low band 8个channel 36,40,44,48,52,56,60,64
|
---|
| 97 | +RegAddr_5G_LOW_CBW20 = 20, 20, 20, 19, 19, 19, 17, 17
|
---|
| 98 | +;cbw20,5g mid band 12个 channel 100,104,108,112,116,120,124,128,132,136,140,144
|
---|
| 99 | +RegAddr_5G_MID_CBW20 = 13, 13, 13, 13, 13, 13, 13, 13, 11, 11, 10, 10
|
---|
| 100 | +;cbw20,5g high band 8个 channel 149,153,157,161,165,169,173,177
|
---|
| 101 | +RegAddr_5G_HIGH_CBW20 = 10, 10, 10, 10, 10, 10, 10, 10
|
---|
| 102 | +;cbw40,5g low band 4个channel 38,46,54,62
|
---|
| 103 | +RegAddr_5G_LOW_CBW40 = 20, 19, 19, 17
|
---|
| 104 | +;cbw40,5g mid band 6个 channel 102,110,118,126,134,142
|
---|
| 105 | +RegAddr_5G_MID_CBW40 = 13, 13, 13, 13, 11, 10
|
---|
| 106 | +;cbw40,5g high band 4个 channel 151,159,167,175
|
---|
| 107 | +RegAddr_5G_HIGH_CBW40 = 10, 10, 10, 10
|
---|
| 108 | +;cbw80,5g low band 2个 channel 42,58
|
---|
| 109 | +RegAddr_5G_LOW_CBW80 = 20, 19
|
---|
| 110 | +;cbw80,5g mid band 3个 channel 106,122,138
|
---|
| 111 | +RegAddr_5G_MID_CBW80 = 13, 13, 10
|
---|
| 112 | +;cbw80,5g high band 2个 channel 155,171
|
---|
| 113 | +RegAddr_5G_HIGH_CBW80 = 10, 10
|
---|
| 114 | +
|
---|
| 115 | +;------------------------------------------------------------------------------
|
---|
| 116 | +[RegAddr2]
|
---|
| 117 | +;-----------------------------------------------------------------------------
|
---|
| 118 | +;RegAddr2,start_bit, stop_bit = 0x40142080,4,1
|
---|
| 119 | +RegAddr_Config = 0x40142080,4,1
|
---|
| 120 | +;cbw20 2g 3个channel 3,7,11
|
---|
| 121 | +RegAddr_2G_CBW20 = 7, 7, 7
|
---|
| 122 | +;cbw40 2g 3个channel 3,7,11
|
---|
| 123 | +RegAddr_2G_CBW40 = 7, 7, 7
|
---|
| 124 | +;cbw20,5g low band 8个channel 36,40,44,48,52,56,60,64
|
---|
| 125 | +RegAddr_5G_LOW_CBW20 = 6, 6, 6, 5, 5, 5, 6, 6
|
---|
| 126 | +;cbw20,5g mid band 12个 channel 100,104,108,112,116,120,124,128,132,136,140,144
|
---|
| 127 | +RegAddr_5G_MID_CBW20 = 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6
|
---|
| 128 | +;cbw20,5g high band 8个 channel 149,153,157,161,165,169,173,177
|
---|
| 129 | +RegAddr_5G_HIGH_CBW20 = 6, 6, 8, 8, 4, 4, 4, 4
|
---|
| 130 | +;cbw40,5g low band 4个channel 38,46,54,62
|
---|
| 131 | +RegAddr_5G_LOW_CBW40 = 6, 5, 5, 6
|
---|
| 132 | +;cbw40,5g mid band 6个 channel 102,110,118,126,134,142
|
---|
| 133 | +RegAddr_5G_MID_CBW40 = 5, 5, 5, 5, 6, 6
|
---|
| 134 | +;cbw40,5g high band 4个 channel 151,159,167,175
|
---|
| 135 | +RegAddr_5G_HIGH_CBW40 = 6, 8, 4, 4
|
---|
| 136 | +;cbw80,5g low band 2个 channel 42,58
|
---|
| 137 | +RegAddr_5G_LOW_CBW80 = 6, 5
|
---|
| 138 | +;cbw80,5g mid band 3个 channel 106,122,138
|
---|
| 139 | +RegAddr_5G_MID_CBW80 = 5, 5, 6
|
---|
| 140 | +;cbw80,5g high band 2个 channel 155,171
|
---|
| 141 | +RegAddr_5G_HIGH_CBW80 = 8, 4
|
---|
| 142 | +
|
---|
| 143 | +;------------------------------------------------------------------------------
|
---|
| 144 | +[RegAddr3]
|
---|
| 145 | +;-----------------------------------------------------------------------------
|
---|
| 146 | +;RegAddr3,start_bit, stop_bit = 0x40142080,16,12
|
---|
| 147 | +RegAddr_Config = 0x40142080,16,12
|
---|
| 148 | +;cbw20 2g 3个channel 3,7,11
|
---|
| 149 | +RegAddr_2G_CBW20 = 4, 4, 4
|
---|
| 150 | +;cbw40 2g 3个channel 3,7,11
|
---|
| 151 | +RegAddr_2G_CBW40 = 4, 4, 4
|
---|
| 152 | +;cbw20,5g low band 8个channel 36,40,44,48,52,56,60,64
|
---|
| 153 | +RegAddr_5G_LOW_CBW20 = 4, 4, 4, 4, 4, 4, 4, 4
|
---|
| 154 | +;cbw20,5g mid band 12个 channel 100,104,108,112,116,120,124,128,132,136,140,144
|
---|
| 155 | +RegAddr_5G_MID_CBW20 = 8, 8, 6, 6, 6, 6, 6, 6, 8, 8, 4, 4
|
---|
| 156 | +;cbw20,5g high band 8个 channel 149,153,157,161,165,169,173,177
|
---|
| 157 | +RegAddr_5G_HIGH_CBW20 = 7, 7, 4, 4, 6, 6, 6, 6
|
---|
| 158 | +;cbw40,5g low band 4个channel 38,46,54,62
|
---|
| 159 | +RegAddr_5G_LOW_CBW40 = 4, 4, 4, 4
|
---|
| 160 | +;cbw40,5g mid band 6个 channel 102,110,118,126,134,142
|
---|
| 161 | +RegAddr_5G_MID_CBW40 = 8, 6, 6, 6, 8, 4
|
---|
| 162 | +;cbw40,5g high band 4个 channel 151,159,167,175
|
---|
| 163 | +RegAddr_5G_HIGH_CBW40 = 7, 4, 6, 6
|
---|
| 164 | +;cbw80,5g low band 2个 channel 42,58
|
---|
| 165 | +RegAddr_5G_LOW_CBW80 = 4, 4
|
---|
| 166 | +;cbw80,5g mid band 3个 channel 106,122,138
|
---|
| 167 | +RegAddr_5G_MID_CBW80 = 8, 6, 4
|
---|
| 168 | +;cbw80,5g high band 2个 channel 155,171
|
---|
| 169 | +RegAddr_5G_HIGH_CBW80 = 4, 6
|
---|
| 170 | +;------------------------------------------------------------------------------
|
---|
| 171 | +
|
---|
| 172 | +
|
---|
| 173 | +;------------------------------------------------------------------------------
|
---|
| 174 | +
|
---|
| 175 | +
|
---|
| 176 | +
|
---|
| 177 | +
|
---|
| 178 | +
|
---|
| 179 | +
|
---|
| 180 | +
|
---|
| 181 | +
|
---|
.. | .. |
---|
| 1 | +;******************************************************************************
|
---|
| 2 | +; Wifi Limit Setup file
|
---|
| 3 | +;******************************************************************************
|
---|
| 4 | +[VERSION]
|
---|
| 5 | +WT_VERSION = EA6521QT_20230728
|
---|
| 6 | +;增加2.4G PA寄存器优化兼容配置
|
---|
| 7 | +;-----------------------------------------------------------------------------
|
---|
| 8 | +[CAL_POWER_INFO]
|
---|
| 9 | +;-----------------------------------------------------------------------------
|
---|
| 10 | +;设置浮点数,工具会自动做浮点转定点数的处理txpower,s(8,2)
|
---|
| 11 | +;发送给DUT之后,DUT会进行 <<Qnum 的操作,这里的数据不要提前移位 赋值的数值必须是10进制,与DUT侧对应
|
---|
| 12 | +;注释:11b rate 1M,2M,5.5M,11M
|
---|
| 13 | +G_TXPWR11B_UQ2 = 17, 17, 17, 17
|
---|
| 14 | +;注释:non-ht 2g cbw40 rate 6M/9M,12M,18M,24M,36M,48M,54M
|
---|
| 15 | +G_TXPWRNONHTDUP2G_UQ2 = 17, 17, 17, 17, 17, 17, 17, 15
|
---|
| 16 | +;注释:non-ht 5g cbw40 rate 6M,9M,12M,18M,24M,36M,48M,54M; cbw80 rate 6M,9M,12M,18M,24M,36M,48M,54M
|
---|
| 17 | +G_TXPWRNONHTDUP5G_UQ2 = 16, 16, 16, 16, 16, 16, 16, 15, 16, 16, 16, 16, 16, 16, 16, 15
|
---|
| 18 | +;注释:non-ht/ht/vht/he cbw20 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 19 | +;ht/vht/he cbw40 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 20 | +G_TXPWRMCS2G_UQ2 = 17, 17, 17, 17, 17, 17, 17, 15, 15, 14, 14, 13, 13, 17, 17, 17, 17, 17, 17, 17, 15, 15, 13, 13, 12, 12
|
---|
| 21 | +;写注释non-ht/ht/vht/he cbw20 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 22 | +;ht/vht/he cbw40 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 23 | +;ht/vht/he cbw80 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 24 | +G_TXPWRMCS5G_UQ2 = 16, 16, 16, 16, 16, 16, 16, 15, 14, 13, 13, 12, 12, 16, 16, 16, 16, 16, 16, 16, 15, 14, 13, 12, 12, 12, 15, 15, 15, 15, 15, 15, 15, 14, 13, 13, 11, 11, 11
|
---|
| 25 | +;写注释he TB SMALL RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 26 | +;he TB BIG RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 27 | +;he TB BIG RU BIG POWER rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 28 | +TBMAXTXPWR5G_UQ3 = 16, 16, 16, 16, 16, 16, 16, 15, 14, 13, 13, 12, 12, 16, 16, 16, 16, 16, 16, 16, 15, 14, 13, 13, 12, 12, 16, 16, 16, 16, 16, 16, 16, 15, 14, 13, 13, 12, 12
|
---|
| 29 | +;写注释he TB SMALL RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 30 | +;he TB BIG RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 31 | +;he TB BIG RU BIG POWER rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 32 | +TBMAXTXPWR2G_UQ3 = 17, 17, 17, 17, 17, 17, 17, 15, 15, 14, 14, 13, 13, 17, 17, 17, 17, 17, 17, 17, 15, 15, 14, 14, 13, 13, 17, 17, 17, 17, 17, 17, 17, 15, 15, 14, 14, 13, 13
|
---|
| 33 | +;写注释 5G,2G MIN TX POWER
|
---|
| 34 | +TBMINTXPWR_SQ2 = 00, 00
|
---|
| 35 | +
|
---|
| 36 | +;注释:11b rate 1M,2M,5.5M,11M
|
---|
| 37 | +G_TXPWR11B_UQ2_DELTA = 5.5, 5.5, 5.5, 4
|
---|
| 38 | +;注释:non-ht 2g cbw40 rate 6M/9M,12M,18M,24M,36M,48M,54M
|
---|
| 39 | +G_TXPWRNONHTDUP2G_UQ2_DELTA = 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5
|
---|
| 40 | +;注释:non-ht 5g cbw40 rate 6M,9M,12M,18M,24M,36M,48M,54M; cbw80 rate 6M,9M,12M,18M,24M,36M,48M,54M
|
---|
| 41 | +G_TXPWRNONHTDUP5G_UQ2_DELTA = 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00
|
---|
| 42 | +;注释:non-ht/ht/vht/he cbw20 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 43 | +;ht/vht/he cbw40 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 44 | +G_TXPWRMCS2G_UQ2_DELTA = 4.5, 5.5, 4.5, 4.5, 4.5, 4.5, 5, 4.5, 5.5, 5, 5, 4.5, 5.3, 4.5, 5.5, 4.5, 4.5, 4.5, 4.5, 5, 5, 5.5, 4.5, 5.5, 4.5, 5.5
|
---|
| 45 | +;写注释non-ht/ht/vht/he cbw20 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 46 | +;ht/vht/he cbw40 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 47 | +;ht/vht/he cbw80 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 48 | +G_TXPWRMCS5G_UQ2_DELTA = 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00
|
---|
| 49 | +;写注释he TB SMALL RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 50 | +;he TB BIG RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 51 | +;he TB BIG RU BIG POWER rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 52 | +TBMAXTXPWR5G_UQ3_DELTA = 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00
|
---|
| 53 | +;写注释he TB SMALL RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 54 | +;he TB BIG RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 55 | +;he TB BIG RU BIG POWER rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 56 | +TBMAXTXPWR2G_UQ3_DELTA = 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5
|
---|
| 57 | +;写注释 5G,2G MIN TX POWER
|
---|
| 58 | +TBMINTXPWR_SQ2_DELTA = 4.5, 4.5
|
---|
| 59 | +;-----------------------------------------------------------------------------
|
---|
| 60 | +[CHAN_POWER_COMPINFO]
|
---|
| 61 | +;-----------------------------------------------------------------------------
|
---|
| 62 | +;设置浮点数,工具会自动做浮点转定点数的处理。按频点补偿txpower,s(8,2),正数表示加功率,负数表示减功率
|
---|
| 63 | +;cbw20,2g 14个channel 1,2,3,4,5,6,7,8,9,10,11,12,13,14
|
---|
| 64 | +G_COMPCHANTXPWR2G_CBW20_SQ2 = 0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
---|
| 65 | +;cbw40,2g 9个channel 3,4,5,6,7,8,9,10,11
|
---|
| 66 | +G_COMPCHANTXPWR2G_CBW40_SQ2 = 0,0,0,0,0,0,0,0,0
|
---|
| 67 | +;cbw20,5g low band 8个channel 36,40,44,48,52,56,60,64
|
---|
| 68 | +G_COMPCHANTXPWR5G_LOW_CBW20_SQ2 = 0,0,0,0,0,0,0,0
|
---|
| 69 | +;cbw20,5g mid band 12个 channel 100,104,108,112,116,120,124,128,132,136,140,144
|
---|
| 70 | +G_COMPCHANTXPWR5G_MID_CBW20_SQ2 = 0,0,0,0,0,0,0,0,0,0,0,0
|
---|
| 71 | +;cbw20,5g high band 8个 channel 149,153,157,161,165,169,173,177
|
---|
| 72 | +G_COMPCHANTXPWR5G_HIGH_CBW20_SQ2 = 0,0,0,0,0,0,0,0
|
---|
| 73 | +;cbw40,5g low band 4个channel 38,46,54,62
|
---|
| 74 | +G_COMPCHANTXPWR5G_LOW_CBW40_SQ2 = 0,0,0,0
|
---|
| 75 | +;cbw40,5g mid band 6个 channel 102,110,118,126,134,142
|
---|
| 76 | +G_COMPCHANTXPWR5G_MID_CBW40_SQ2 = 0,0,0,0,0,0
|
---|
| 77 | +;cbw40,5g high band 4个 channel 151,159,167,175
|
---|
| 78 | +G_COMPCHANTXPWR5G_HIGH_CBW40_SQ2 = 0,0,0,0
|
---|
| 79 | +;cbw80,5g low band 2个 channel 42,58
|
---|
| 80 | +G_COMPCHANTXPWR5G_LOW_CBW80_SQ2 = 0,0
|
---|
| 81 | +;cbw80,5g mid band 3个 channel 106,122,138
|
---|
| 82 | +G_COMPCHANTXPWR5G_MID_CBW80_SQ2 = 0,0,0
|
---|
| 83 | +;cbw80,5g high band 2个 channel 155,171
|
---|
| 84 | +G_COMPCHANTXPWR5G_HIGH_CBW80_SQ2 = 0,0
|
---|
| 85 | +
|
---|
| 86 | +;-----------------------------------------------------------------------------
|
---|
| 87 | +[RegAddr1]
|
---|
| 88 | +;-----------------------------------------------------------------------------
|
---|
| 89 | +;寄存器配置,RegAddr是寄存器地址,每个信道对应一个寄存器值
|
---|
| 90 | +;RegAddr1,start_bit, stop_bit= 0x401420C0,4,0(5G RegAddr)
|
---|
| 91 | +RegAddr_Config = 0x401420C0,4,0
|
---|
| 92 | +;cbw20/cbw40 2g 3个channel 3,7,11
|
---|
| 93 | +;RegAddr1,start_bit, stop_bit= 0x401420C8,3,0(2G RegAddr)
|
---|
| 94 | +RegAddr_2G_CBW20 = 14,14,15
|
---|
| 95 | +;标志位,RegAddr_2G_CBW40 = version, reserved, reserved
|
---|
| 96 | +;version = 11:2G采用缺省配置; version = 20: 2G采用配置文件定义值
|
---|
| 97 | +RegAddr_2G_CBW40 = 20,11,11
|
---|
| 98 | +;cbw20,5g low band 8个channel 36, 40, 44, 48, 52, 56, 60, 64
|
---|
| 99 | +RegAddr_5G_LOW_CBW20 = 23, 24, 21, 21, 24, 22, 22, 20
|
---|
| 100 | +;cbw20,5g mid band 12个 channel 100,104,108,112,116,120,124,128,132,136,140,144
|
---|
| 101 | +RegAddr_5G_MID_CBW20 = 11, 13, 11, 13, 13, 13, 15, 15, 13, 13, 12, 12
|
---|
| 102 | +;cbw20,5g high band 8个 channel 149,153,157,161,165,169,173,177
|
---|
| 103 | +RegAddr_5G_HIGH_CBW20 = 12, 14, 12, 12, 11, 11, 11, 11
|
---|
| 104 | +;cbw40,5g low band 4个channel 38,46,54,62
|
---|
| 105 | +RegAddr_5G_LOW_CBW40 = 20, 17, 19, 17
|
---|
| 106 | +;cbw40,5g mid band 6个 channel 102,110,118,126,134,142
|
---|
| 107 | +RegAddr_5G_MID_CBW40 = 13, 11, 13, 14, 13, 12
|
---|
| 108 | +;cbw40,5g high band 4个 channel 151,159,167,175
|
---|
| 109 | +RegAddr_5G_HIGH_CBW40 = 13, 13, 10, 10
|
---|
| 110 | +;cbw80,5g low band 2个 channel 42,58
|
---|
| 111 | +RegAddr_5G_LOW_CBW80 = 19, 19
|
---|
| 112 | +;cbw80,5g mid band 3个 channel 106,122,138
|
---|
| 113 | +RegAddr_5G_MID_CBW80 = 11, 14, 11
|
---|
| 114 | +;cbw80,5g high band 2个 channel 155,171
|
---|
| 115 | +RegAddr_5G_HIGH_CBW80 = 12, 10
|
---|
| 116 | +
|
---|
| 117 | +;------------------------------------------------------------------------------
|
---|
| 118 | +[RegAddr2]
|
---|
| 119 | +;-----------------------------------------------------------------------------
|
---|
| 120 | +;RegAddr2,start_bit, stop_bit (5G RegAddr)
|
---|
| 121 | +RegAddr_Config = 0x40142080,4,1
|
---|
| 122 | +;cbw20/cbw40 2g 3个channel 3,7,11, RegAddr = 0x401420A8,4,1
|
---|
| 123 | +RegAddr_2G_CBW20 = 9, 9, 9
|
---|
| 124 | +;cbw40/cbw40 2g 3个channel 3,7,11, RegAddr = 0x401420AC,4,1
|
---|
| 125 | +RegAddr_2G_CBW40 = 9, 9, 9
|
---|
| 126 | +;cbw20,5g low band 8个channel 36,40,44,48,52,56,60,64
|
---|
| 127 | +RegAddr_5G_LOW_CBW20 = 6, 6, 6, 5, 5, 5, 6, 6
|
---|
| 128 | +;cbw20,5g mid band 12个 channel 100,104,108,112,116,120,124,128,132,136,140,144
|
---|
| 129 | +RegAddr_5G_MID_CBW20 = 7, 7, 7, 10, 10, 10, 10, 10, 8, 8, 8, 8
|
---|
| 130 | +;cbw20,5g high band 8个 channel 149,153,157,161,165,169,173,177
|
---|
| 131 | +RegAddr_5G_HIGH_CBW20 = 12, 12, 12, 12, 10, 10, 10, 10
|
---|
| 132 | +;cbw40,5g low band 4个channel 38,46,54,62
|
---|
| 133 | +RegAddr_5G_LOW_CBW40 = 6, 5, 5, 6
|
---|
| 134 | +;cbw40,5g mid band 6个 channel 102,110,118,126,134,142
|
---|
| 135 | +RegAddr_5G_MID_CBW40 = 7, 5, 5, 10, 8, 8
|
---|
| 136 | +;cbw40,5g high band 4个 channel 151,159,167,175
|
---|
| 137 | +RegAddr_5G_HIGH_CBW40 = 8, 8, 4, 4
|
---|
| 138 | +;cbw80,5g low band 2个 channel 42,58
|
---|
| 139 | +RegAddr_5G_LOW_CBW80 = 6, 5
|
---|
| 140 | +;cbw80,5g mid band 3个 channel 106,122,138
|
---|
| 141 | +RegAddr_5G_MID_CBW80 = 8, 10, 8
|
---|
| 142 | +;cbw80,5g high band 2个 channel 155,171
|
---|
| 143 | +RegAddr_5G_HIGH_CBW80 = 9, 4
|
---|
| 144 | +
|
---|
| 145 | +;------------------------------------------------------------------------------
|
---|
| 146 | +[RegAddr3]
|
---|
| 147 | +;-----------------------------------------------------------------------------
|
---|
| 148 | +;RegAddr3,start_bit, stop_bit (5G RegAddr)
|
---|
| 149 | +RegAddr_Config = 0x40142080,16,12
|
---|
| 150 | +;cbw20/cbw40 2g 3个channel 3,7,11, RegAddr = 0x401420A8,16,12
|
---|
| 151 | +RegAddr_2G_CBW20 = 18, 18, 18
|
---|
| 152 | +;cbw20/cbw40 2g 3个channel 3,7,11, RegAddr = 0x401420AC,16,12
|
---|
| 153 | +RegAddr_2G_CBW40 = 18, 18, 18
|
---|
| 154 | +;cbw20,5g low band 8个channel 36,40,44,48,52,56,60,64
|
---|
| 155 | +RegAddr_5G_LOW_CBW20 = 4, 4, 4, 4, 4, 4, 4, 4
|
---|
| 156 | +;cbw20,5g mid band 12个 channel 100,104,108,112,116,120,124,128,132,136,140,144
|
---|
| 157 | +RegAddr_5G_MID_CBW20 = 8, 8, 12, 10, 10, 10, 12, 12, 13, 13, 10, 10
|
---|
| 158 | +;cbw20,5g high band 8个 channel 149,153,157,161,165,169,173,177
|
---|
| 159 | +RegAddr_5G_HIGH_CBW20 = 16, 16, 12, 12, 12, 12, 12, 12
|
---|
| 160 | +;cbw40,5g low band 4个channel 38,46,54,62
|
---|
| 161 | +RegAddr_5G_LOW_CBW40 = 4, 4, 4, 4
|
---|
| 162 | +;cbw40,5g mid band 6个 channel 102,110,118,126,134,142
|
---|
| 163 | +RegAddr_5G_MID_CBW40 = 10, 10, 6, 13, 10, 10
|
---|
| 164 | +;cbw40,5g high band 4个 channel 151,159,167,175
|
---|
| 165 | +RegAddr_5G_HIGH_CBW40 = 11, 11, 6, 6
|
---|
| 166 | +;cbw80,5g low band 2个 channel 42,58
|
---|
| 167 | +RegAddr_5G_LOW_CBW80 = 4, 4
|
---|
| 168 | +;cbw80,5g mid band 3个 channel 106,122,138
|
---|
| 169 | +RegAddr_5G_MID_CBW80 = 10, 12, 12
|
---|
| 170 | +;cbw80,5g high band 2个 channel 155,171
|
---|
| 171 | +RegAddr_5G_HIGH_CBW80 = 13, 6
|
---|
| 172 | +;------------------------------------------------------------------------------
|
---|
| 173 | +
|
---|
| 174 | +
|
---|
| 175 | +;------------------------------------------------------------------------------
|
---|
| 176 | +
|
---|
| 177 | +
|
---|
| 178 | +
|
---|
| 179 | +
|
---|
| 180 | +
|
---|
| 181 | +
|
---|
| 182 | +
|
---|
| 183 | +
|
---|
.. | .. |
---|
| 1 | +;******************************************************************************
|
---|
| 2 | +; Wifi Limit Setup file
|
---|
| 3 | +;******************************************************************************
|
---|
| 4 | +[VERSION]
|
---|
| 5 | +WT_VERSION = EA6621QT_20230728
|
---|
| 6 | +;增加2.4G PA寄存器优化兼容配置
|
---|
| 7 | +;-----------------------------------------------------------------------------
|
---|
| 8 | +[CAL_POWER_INFO]
|
---|
| 9 | +;-----------------------------------------------------------------------------
|
---|
| 10 | +;设置浮点数,工具会自动做浮点转定点数的处理txpower,s(8,2)
|
---|
| 11 | +;发送给DUT之后,DUT会进行 <<Qnum 的操作,这里的数据不要提前移位 赋值的数值必须是10进制,与DUT侧对应
|
---|
| 12 | +;注释:11b rate 1M,2M,5.5M,11M
|
---|
| 13 | +G_TXPWR11B_UQ2 = 17, 17, 17, 17
|
---|
| 14 | +;注释:non-ht 2g cbw40 rate 6M/9M,12M,18M,24M,36M,48M,54M
|
---|
| 15 | +G_TXPWRNONHTDUP2G_UQ2 = 17, 17, 17, 17, 17, 17, 17, 15
|
---|
| 16 | +;注释:non-ht 5g cbw40 rate 6M,9M,12M,18M,24M,36M,48M,54M; cbw80 rate 6M,9M,12M,18M,24M,36M,48M,54M
|
---|
| 17 | +G_TXPWRNONHTDUP5G_UQ2 = 16, 16, 16, 16, 16, 16, 16, 15, 16, 16, 16, 16, 16, 16, 16, 15
|
---|
| 18 | +;注释:non-ht/ht/vht/he cbw20 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 19 | +;ht/vht/he cbw40 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 20 | +G_TXPWRMCS2G_UQ2 = 17, 17, 17, 17, 17, 17, 17, 15, 15, 14, 14, 13, 13, 17, 17, 17, 17, 17, 17, 17, 15, 15, 13, 13, 12, 12
|
---|
| 21 | +;写注释non-ht/ht/vht/he cbw20 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 22 | +;ht/vht/he cbw40 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 23 | +;ht/vht/he cbw80 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 24 | +G_TXPWRMCS5G_UQ2 = 16, 16, 16, 16, 16, 16, 16, 15, 14, 13, 13, 12, 12, 16, 16, 16, 16, 16, 16, 16, 15, 14, 13, 12, 12, 12, 15, 15, 15, 15, 15, 15, 15, 14, 13, 13, 11, 11, 11
|
---|
| 25 | +;写注释he TB SMALL RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 26 | +;he TB BIG RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 27 | +;he TB BIG RU BIG POWER rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 28 | +TBMAXTXPWR5G_UQ3 = 16, 16, 16, 16, 16, 16, 16, 15, 14, 13, 13, 12, 12, 16, 16, 16, 16, 16, 16, 16, 15, 14, 13, 13, 12, 12, 16, 16, 16, 16, 16, 16, 16, 15, 14, 13, 13, 12, 12
|
---|
| 29 | +;写注释he TB SMALL RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 30 | +;he TB BIG RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 31 | +;he TB BIG RU BIG POWER rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 32 | +TBMAXTXPWR2G_UQ3 = 17, 17, 17, 17, 17, 17, 17, 15, 15, 14, 14, 13, 13, 17, 17, 17, 17, 17, 17, 17, 15, 15, 14, 14, 13, 13, 17, 17, 17, 17, 17, 17, 17, 15, 15, 14, 14, 13, 13
|
---|
| 33 | +;写注释 5G,2G MIN TX POWER
|
---|
| 34 | +TBMINTXPWR_SQ2 = 00, 00
|
---|
| 35 | +
|
---|
| 36 | +;注释:11b rate 1M,2M,5.5M,11M
|
---|
| 37 | +G_TXPWR11B_UQ2_DELTA = 5.5, 5.5, 5.5, 4
|
---|
| 38 | +;注释:non-ht 2g cbw40 rate 6M/9M,12M,18M,24M,36M,48M,54M
|
---|
| 39 | +G_TXPWRNONHTDUP2G_UQ2_DELTA = 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5
|
---|
| 40 | +;注释:non-ht 5g cbw40 rate 6M,9M,12M,18M,24M,36M,48M,54M; cbw80 rate 6M,9M,12M,18M,24M,36M,48M,54M
|
---|
| 41 | +G_TXPWRNONHTDUP5G_UQ2_DELTA = 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00
|
---|
| 42 | +;注释:non-ht/ht/vht/he cbw20 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 43 | +;ht/vht/he cbw40 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 44 | +G_TXPWRMCS2G_UQ2_DELTA = 4.5, 5.5, 4.5, 4.5, 4.5, 4.5, 5, 4.5, 5.5, 5, 5, 4.5, 5.3, 4.5, 5.5, 4.5, 4.5, 4.5, 4.5, 5, 5, 5.5, 4.5, 5.5, 4.5, 5.5
|
---|
| 45 | +;写注释non-ht/ht/vht/he cbw20 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 46 | +;ht/vht/he cbw40 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 47 | +;ht/vht/he cbw80 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 48 | +G_TXPWRMCS5G_UQ2_DELTA = 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00
|
---|
| 49 | +;写注释he TB SMALL RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 50 | +;he TB BIG RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 51 | +;he TB BIG RU BIG POWER rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 52 | +TBMAXTXPWR5G_UQ3_DELTA = 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00
|
---|
| 53 | +;写注释he TB SMALL RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 54 | +;he TB BIG RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 55 | +;he TB BIG RU BIG POWER rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 56 | +TBMAXTXPWR2G_UQ3_DELTA = 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5
|
---|
| 57 | +;写注释 5G,2G MIN TX POWER
|
---|
| 58 | +TBMINTXPWR_SQ2_DELTA = 4.5, 4.5
|
---|
| 59 | +;-----------------------------------------------------------------------------
|
---|
| 60 | +[CHAN_POWER_COMPINFO]
|
---|
| 61 | +;-----------------------------------------------------------------------------
|
---|
| 62 | +;设置浮点数,工具会自动做浮点转定点数的处理。按频点补偿txpower,s(8,2),正数表示加功率,负数表示减功率
|
---|
| 63 | +;cbw20,2g 14个channel 1,2,3,4,5,6,7,8,9,10,11,12,13,14
|
---|
| 64 | +G_COMPCHANTXPWR2G_CBW20_SQ2 = 0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
---|
| 65 | +;cbw40,2g 9个channel 3,4,5,6,7,8,9,10,11
|
---|
| 66 | +G_COMPCHANTXPWR2G_CBW40_SQ2 = 0,0,0,0,0,0,0,0,0
|
---|
| 67 | +;cbw20,5g low band 8个channel 36,40,44,48,52,56,60,64
|
---|
| 68 | +G_COMPCHANTXPWR5G_LOW_CBW20_SQ2 = 0,0,0,0,0,0,0,0
|
---|
| 69 | +;cbw20,5g mid band 12个 channel 100,104,108,112,116,120,124,128,132,136,140,144
|
---|
| 70 | +G_COMPCHANTXPWR5G_MID_CBW20_SQ2 = 0,0,0,0,0,0,0,0,0,0,0,0
|
---|
| 71 | +;cbw20,5g high band 8个 channel 149,153,157,161,165,169,173,177
|
---|
| 72 | +G_COMPCHANTXPWR5G_HIGH_CBW20_SQ2 = 0,0,0,0,0,0,0,0
|
---|
| 73 | +;cbw40,5g low band 4个channel 38,46,54,62
|
---|
| 74 | +G_COMPCHANTXPWR5G_LOW_CBW40_SQ2 = 0,0,0,0
|
---|
| 75 | +;cbw40,5g mid band 6个 channel 102,110,118,126,134,142
|
---|
| 76 | +G_COMPCHANTXPWR5G_MID_CBW40_SQ2 = 0,0,0,0,0,0
|
---|
| 77 | +;cbw40,5g high band 4个 channel 151,159,167,175
|
---|
| 78 | +G_COMPCHANTXPWR5G_HIGH_CBW40_SQ2 = 0,0,0,0
|
---|
| 79 | +;cbw80,5g low band 2个 channel 42,58
|
---|
| 80 | +G_COMPCHANTXPWR5G_LOW_CBW80_SQ2 = 0,0
|
---|
| 81 | +;cbw80,5g mid band 3个 channel 106,122,138
|
---|
| 82 | +G_COMPCHANTXPWR5G_MID_CBW80_SQ2 = 0,0,0
|
---|
| 83 | +;cbw80,5g high band 2个 channel 155,171
|
---|
| 84 | +G_COMPCHANTXPWR5G_HIGH_CBW80_SQ2 = 0,0
|
---|
| 85 | +
|
---|
| 86 | +;-----------------------------------------------------------------------------
|
---|
| 87 | +[RegAddr1]
|
---|
| 88 | +;-----------------------------------------------------------------------------
|
---|
| 89 | +;寄存器配置,RegAddr是寄存器地址,每个信道对应一个寄存器值
|
---|
| 90 | +;RegAddr1,start_bit, stop_bit= 0x401420C0,4,0(5G RegAddr)
|
---|
| 91 | +RegAddr_Config = 0x401420C0,4,0
|
---|
| 92 | +;cbw20/cbw40 2g 3个channel 3,7,11
|
---|
| 93 | +;RegAddr1,start_bit, stop_bit= 0x401420C8,3,0(2G RegAddr)
|
---|
| 94 | +RegAddr_2G_CBW20 = 14,14,15
|
---|
| 95 | +;标志位,RegAddr_2G_CBW40 = version, reserved, reserved
|
---|
| 96 | +;version = 11:2G采用缺省配置; version = 20: 2G采用配置文件定义值
|
---|
| 97 | +RegAddr_2G_CBW40 = 20,11,11
|
---|
| 98 | +;cbw20,5g low band 8个channel 36, 40, 44, 48, 52, 56, 60, 64
|
---|
| 99 | +RegAddr_5G_LOW_CBW20 = 23, 24, 21, 21, 24, 22, 22, 20
|
---|
| 100 | +;cbw20,5g mid band 12个 channel 100,104,108,112,116,120,124,128,132,136,140,144
|
---|
| 101 | +RegAddr_5G_MID_CBW20 = 11, 13, 11, 13, 13, 13, 15, 15, 13, 13, 12, 12
|
---|
| 102 | +;cbw20,5g high band 8个 channel 149,153,157,161,165,169,173,177
|
---|
| 103 | +RegAddr_5G_HIGH_CBW20 = 12, 14, 12, 12, 11, 11, 11, 11
|
---|
| 104 | +;cbw40,5g low band 4个channel 38,46,54,62
|
---|
| 105 | +RegAddr_5G_LOW_CBW40 = 20, 17, 19, 17
|
---|
| 106 | +;cbw40,5g mid band 6个 channel 102,110,118,126,134,142
|
---|
| 107 | +RegAddr_5G_MID_CBW40 = 13, 11, 13, 14, 13, 12
|
---|
| 108 | +;cbw40,5g high band 4个 channel 151,159,167,175
|
---|
| 109 | +RegAddr_5G_HIGH_CBW40 = 13, 13, 10, 10
|
---|
| 110 | +;cbw80,5g low band 2个 channel 42,58
|
---|
| 111 | +RegAddr_5G_LOW_CBW80 = 19, 19
|
---|
| 112 | +;cbw80,5g mid band 3个 channel 106,122,138
|
---|
| 113 | +RegAddr_5G_MID_CBW80 = 11, 14, 11
|
---|
| 114 | +;cbw80,5g high band 2个 channel 155,171
|
---|
| 115 | +RegAddr_5G_HIGH_CBW80 = 12, 10
|
---|
| 116 | +
|
---|
| 117 | +;------------------------------------------------------------------------------
|
---|
| 118 | +[RegAddr2]
|
---|
| 119 | +;-----------------------------------------------------------------------------
|
---|
| 120 | +;RegAddr2,start_bit, stop_bit (5G RegAddr)
|
---|
| 121 | +RegAddr_Config = 0x40142080,4,1
|
---|
| 122 | +;cbw20/cbw40 2g 3个channel 3,7,11, RegAddr = 0x401420A8,4,1
|
---|
| 123 | +RegAddr_2G_CBW20 = 9, 9, 9
|
---|
| 124 | +;cbw40/cbw40 2g 3个channel 3,7,11, RegAddr = 0x401420AC,4,1
|
---|
| 125 | +RegAddr_2G_CBW40 = 9, 9, 9
|
---|
| 126 | +;cbw20,5g low band 8个channel 36,40,44,48,52,56,60,64
|
---|
| 127 | +RegAddr_5G_LOW_CBW20 = 6, 6, 6, 5, 5, 5, 6, 6
|
---|
| 128 | +;cbw20,5g mid band 12个 channel 100,104,108,112,116,120,124,128,132,136,140,144
|
---|
| 129 | +RegAddr_5G_MID_CBW20 = 7, 7, 7, 10, 10, 10, 10, 10, 8, 8, 8, 8
|
---|
| 130 | +;cbw20,5g high band 8个 channel 149,153,157,161,165,169,173,177
|
---|
| 131 | +RegAddr_5G_HIGH_CBW20 = 12, 12, 12, 12, 10, 10, 10, 10
|
---|
| 132 | +;cbw40,5g low band 4个channel 38,46,54,62
|
---|
| 133 | +RegAddr_5G_LOW_CBW40 = 6, 5, 5, 6
|
---|
| 134 | +;cbw40,5g mid band 6个 channel 102,110,118,126,134,142
|
---|
| 135 | +RegAddr_5G_MID_CBW40 = 7, 5, 5, 10, 8, 8
|
---|
| 136 | +;cbw40,5g high band 4个 channel 151,159,167,175
|
---|
| 137 | +RegAddr_5G_HIGH_CBW40 = 8, 8, 4, 4
|
---|
| 138 | +;cbw80,5g low band 2个 channel 42,58
|
---|
| 139 | +RegAddr_5G_LOW_CBW80 = 6, 5
|
---|
| 140 | +;cbw80,5g mid band 3个 channel 106,122,138
|
---|
| 141 | +RegAddr_5G_MID_CBW80 = 8, 10, 8
|
---|
| 142 | +;cbw80,5g high band 2个 channel 155,171
|
---|
| 143 | +RegAddr_5G_HIGH_CBW80 = 9, 4
|
---|
| 144 | +
|
---|
| 145 | +;------------------------------------------------------------------------------
|
---|
| 146 | +[RegAddr3]
|
---|
| 147 | +;-----------------------------------------------------------------------------
|
---|
| 148 | +;RegAddr3,start_bit, stop_bit (5G RegAddr)
|
---|
| 149 | +RegAddr_Config = 0x40142080,16,12
|
---|
| 150 | +;cbw20/cbw40 2g 3个channel 3,7,11, RegAddr = 0x401420A8,16,12
|
---|
| 151 | +RegAddr_2G_CBW20 = 18, 18, 18
|
---|
| 152 | +;cbw20/cbw40 2g 3个channel 3,7,11, RegAddr = 0x401420AC,16,12
|
---|
| 153 | +RegAddr_2G_CBW40 = 18, 18, 18
|
---|
| 154 | +;cbw20,5g low band 8个channel 36,40,44,48,52,56,60,64
|
---|
| 155 | +RegAddr_5G_LOW_CBW20 = 4, 4, 4, 4, 4, 4, 4, 4
|
---|
| 156 | +;cbw20,5g mid band 12个 channel 100,104,108,112,116,120,124,128,132,136,140,144
|
---|
| 157 | +RegAddr_5G_MID_CBW20 = 8, 8, 12, 10, 10, 10, 12, 12, 13, 13, 10, 10
|
---|
| 158 | +;cbw20,5g high band 8个 channel 149,153,157,161,165,169,173,177
|
---|
| 159 | +RegAddr_5G_HIGH_CBW20 = 16, 16, 12, 12, 12, 12, 12, 12
|
---|
| 160 | +;cbw40,5g low band 4个channel 38,46,54,62
|
---|
| 161 | +RegAddr_5G_LOW_CBW40 = 4, 4, 4, 4
|
---|
| 162 | +;cbw40,5g mid band 6个 channel 102,110,118,126,134,142
|
---|
| 163 | +RegAddr_5G_MID_CBW40 = 10, 10, 6, 13, 10, 10
|
---|
| 164 | +;cbw40,5g high band 4个 channel 151,159,167,175
|
---|
| 165 | +RegAddr_5G_HIGH_CBW40 = 11, 11, 6, 6
|
---|
| 166 | +;cbw80,5g low band 2个 channel 42,58
|
---|
| 167 | +RegAddr_5G_LOW_CBW80 = 4, 4
|
---|
| 168 | +;cbw80,5g mid band 3个 channel 106,122,138
|
---|
| 169 | +RegAddr_5G_MID_CBW80 = 10, 12, 12
|
---|
| 170 | +;cbw80,5g high band 2个 channel 155,171
|
---|
| 171 | +RegAddr_5G_HIGH_CBW80 = 13, 6
|
---|
| 172 | +;------------------------------------------------------------------------------
|
---|
| 173 | +
|
---|
| 174 | +
|
---|
| 175 | +;------------------------------------------------------------------------------
|
---|
| 176 | +
|
---|
| 177 | +
|
---|
| 178 | +
|
---|
| 179 | +
|
---|
| 180 | +
|
---|
| 181 | +
|
---|
| 182 | +
|
---|
| 183 | +
|
---|
.. | .. |
---|
| 1 | +;******************************************************************************
|
---|
| 2 | +; Wifi Limit Setup file
|
---|
| 3 | +;******************************************************************************
|
---|
| 4 | +[VERSION]
|
---|
| 5 | +WT_VERSION = EA6621QF_20230728
|
---|
| 6 | +;优化TX EVM
|
---|
| 7 | +;-----------------------------------------------------------------------------
|
---|
| 8 | +[CAL_POWER_INFO]
|
---|
| 9 | +;-----------------------------------------------------------------------------
|
---|
| 10 | +;设置浮点数,工具会自动做浮点转定点数的处理txpower,s(8,2)
|
---|
| 11 | +;发送给DUT之后,DUT会进行 <<Qnum 的操作,这里的数据不要提前移位 赋值的数值必须是10进制,与DUT侧对应
|
---|
| 12 | +;注释:11b rate 1M,2M,5.5M,11M
|
---|
| 13 | +G_TXPWR11B_UQ2 = 17, 17, 17, 17
|
---|
| 14 | +;注释:non-ht 2g cbw40 rate 6M/9M,12M,18M,24M,36M,48M,54M
|
---|
| 15 | +G_TXPWRNONHTDUP2G_UQ2 = 17, 17, 17, 17, 17, 17, 17, 15
|
---|
| 16 | +;注释:non-ht 5g cbw40 rate 6M,9M,12M,18M,24M,36M,48M,54M; cbw80 rate 6M,9M,12M,18M,24M,36M,48M,54M
|
---|
| 17 | +G_TXPWRNONHTDUP5G_UQ2 = 16, 16, 16, 16, 16, 16, 16, 15, 16, 16, 16, 16, 16, 16, 16, 15
|
---|
| 18 | +;注释:non-ht/ht/vht/he cbw20 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 19 | +;ht/vht/he cbw40 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 20 | +G_TXPWRMCS2G_UQ2 = 17, 17, 17, 17, 17, 17, 17, 15, 15, 14, 14, 13, 13, 17, 17, 17, 17, 17, 17, 17, 15, 15, 13, 13, 12, 12
|
---|
| 21 | +;写注释non-ht/ht/vht/he cbw20 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 22 | +;ht/vht/he cbw40 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 23 | +;ht/vht/he cbw80 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 24 | +G_TXPWRMCS5G_UQ2 = 16, 16, 16, 16, 16, 16, 16, 15, 14, 13, 13, 12, 12, 16, 16, 16, 16, 16, 16, 16, 15, 14, 13, 12, 12, 12, 15, 15, 15, 15, 15, 15, 15, 14, 13, 13, 11, 11, 11
|
---|
| 25 | +;写注释he TB SMALL RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 26 | +;he TB BIG RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 27 | +;he TB BIG RU BIG POWER rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 28 | +TBMAXTXPWR5G_UQ3 = 16, 16, 16, 16, 16, 16, 16, 15, 14, 13, 13, 12, 12, 16, 16, 16, 16, 16, 16, 16, 15, 14, 13, 13, 12, 12, 16, 16, 16, 16, 16, 16, 16, 15, 14, 13, 13, 12, 12
|
---|
| 29 | +;写注释he TB SMALL RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 30 | +;he TB BIG RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 31 | +;he TB BIG RU BIG POWER rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 32 | +TBMAXTXPWR2G_UQ3 = 17, 17, 17, 17, 17, 17, 17, 15, 15, 14, 14, 13, 13, 17, 17, 17, 17, 17, 17, 17, 15, 15, 14, 14, 13, 13, 17, 17, 17, 17, 17, 17, 17, 15, 15, 14, 14, 13, 13
|
---|
| 33 | +;写注释 5G,2G MIN TX POWER
|
---|
| 34 | +TBMINTXPWR_SQ2 = 00, 00
|
---|
| 35 | +
|
---|
| 36 | +;注释:11b rate 1M,2M,5.5M,11M
|
---|
| 37 | +G_TXPWR11B_UQ2_DELTA = 00, 00, 00, 00
|
---|
| 38 | +;注释:non-ht 2g cbw40 rate 6M/9M,12M,18M,24M,36M,48M,54M
|
---|
| 39 | +G_TXPWRNONHTDUP2G_UQ2_DELTA = 00, 00, 00, 00, 00, 00, 00, 00
|
---|
| 40 | +;注释:non-ht 5g cbw40 rate 6M,9M,12M,18M,24M,36M,48M,54M; cbw80 rate 6M,9M,12M,18M,24M,36M,48M,54M
|
---|
| 41 | +G_TXPWRNONHTDUP5G_UQ2_DELTA = 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00
|
---|
| 42 | +;注释:non-ht/ht/vht/he cbw20 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 43 | +;ht/vht/he cbw40 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 44 | +G_TXPWRMCS2G_UQ2_DELTA = 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00
|
---|
| 45 | +;写注释non-ht/ht/vht/he cbw20 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 46 | +;ht/vht/he cbw40 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 47 | +;ht/vht/he cbw80 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 48 | +G_TXPWRMCS5G_UQ2_DELTA = 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00
|
---|
| 49 | +;写注释he TB SMALL RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 50 | +;he TB BIG RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 51 | +;he TB BIG RU BIG POWER rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 52 | +TBMAXTXPWR5G_UQ3_DELTA = 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00
|
---|
| 53 | +;写注释he TB SMALL RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 54 | +;he TB BIG RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 55 | +;he TB BIG RU BIG POWER rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 56 | +TBMAXTXPWR2G_UQ3_DELTA = 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00
|
---|
| 57 | +;写注释 5G,2G MIN TX POWER
|
---|
| 58 | +TBMINTXPWR_SQ2_DELTA = 00, 00
|
---|
| 59 | +;-----------------------------------------------------------------------------
|
---|
| 60 | +[CHAN_POWER_COMPINFO]
|
---|
| 61 | +;-----------------------------------------------------------------------------
|
---|
| 62 | +;设置浮点数,工具会自动做浮点转定点数的处理。按频点补偿txpower,s(8,2),正数表示加功率,负数表示减功率
|
---|
| 63 | +;cbw20,2g 14个channel 1,2,3,4,5,6,7,8,9,10,11,12,13,14
|
---|
| 64 | +G_COMPCHANTXPWR2G_CBW20_SQ2 = 0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
---|
| 65 | +;cbw40,2g 9个channel 3,4,5,6,7,8,9,10,11
|
---|
| 66 | +G_COMPCHANTXPWR2G_CBW40_SQ2 = 0,0,0,0,0,0,0,0,0
|
---|
| 67 | +;cbw20,5g low band 8个channel 36,40,44,48,52,56,60,64
|
---|
| 68 | +G_COMPCHANTXPWR5G_LOW_CBW20_SQ2 = 0,0,0,0,0,0,0,0
|
---|
| 69 | +;cbw20,5g mid band 12个 channel 100,104,108,112,116,120,124,128,132,136,140,144
|
---|
| 70 | +G_COMPCHANTXPWR5G_MID_CBW20_SQ2 = 0,0,0,0,0,0,0,0,0,0,0,0
|
---|
| 71 | +;cbw20,5g high band 8个 channel 149,153,157,161,165,169,173,177
|
---|
| 72 | +G_COMPCHANTXPWR5G_HIGH_CBW20_SQ2 = 0,0,0,0,0,0,0,0
|
---|
| 73 | +;cbw40,5g low band 4个channel 38,46,54,62
|
---|
| 74 | +G_COMPCHANTXPWR5G_LOW_CBW40_SQ2 = 0,0,0,0
|
---|
| 75 | +;cbw40,5g mid band 6个 channel 102,110,118,126,134,142
|
---|
| 76 | +G_COMPCHANTXPWR5G_MID_CBW40_SQ2 = 0,0,0,0,0,0
|
---|
| 77 | +;cbw40,5g high band 4个 channel 151,159,167,175
|
---|
| 78 | +G_COMPCHANTXPWR5G_HIGH_CBW40_SQ2 = 0,0,0,0
|
---|
| 79 | +;cbw80,5g low band 2个 channel 42,58
|
---|
| 80 | +G_COMPCHANTXPWR5G_LOW_CBW80_SQ2 = 0,0
|
---|
| 81 | +;cbw80,5g mid band 3个 channel 106,122,138
|
---|
| 82 | +G_COMPCHANTXPWR5G_MID_CBW80_SQ2 = 0,0,0
|
---|
| 83 | +;cbw80,5g high band 2个 channel 155,171
|
---|
| 84 | +G_COMPCHANTXPWR5G_HIGH_CBW80_SQ2 = 0,0
|
---|
| 85 | +
|
---|
| 86 | +;-----------------------------------------------------------------------------
|
---|
| 87 | +[RegAddr1]
|
---|
| 88 | +;-----------------------------------------------------------------------------
|
---|
| 89 | +;寄存器配置,RegAddr是寄存器地址,每个信道对应一个寄存器值
|
---|
| 90 | +;RegAddr1,start_bit, stop_bit = 0x401420C0,4,0
|
---|
| 91 | +RegAddr_Config = 0x401420C0,4,0
|
---|
| 92 | +;cbw20 2g 3个channel 3,7,11
|
---|
| 93 | +RegAddr_2G_CBW20 = 11,11,11
|
---|
| 94 | +;cbw40 2g 3个channel 3,7,11
|
---|
| 95 | +RegAddr_2G_CBW40 = 11,11,11
|
---|
| 96 | +;cbw20,5g low band 8个channel 36,40,44,48,52,56,60,64
|
---|
| 97 | +RegAddr_5G_LOW_CBW20 = 20, 20, 20, 19, 19, 19, 17, 17
|
---|
| 98 | +;cbw20,5g mid band 12个 channel 100,104,108,112,116,120,124,128,132,136,140,144
|
---|
| 99 | +RegAddr_5G_MID_CBW20 = 13, 13, 13, 13, 13, 13, 13, 13, 11, 11, 10, 10
|
---|
| 100 | +;cbw20,5g high band 8个 channel 149,153,157,161,165,169,173,177
|
---|
| 101 | +RegAddr_5G_HIGH_CBW20 = 10, 10, 10, 10, 10, 10, 10, 10
|
---|
| 102 | +;cbw40,5g low band 4个channel 38,46,54,62
|
---|
| 103 | +RegAddr_5G_LOW_CBW40 = 20, 19, 19, 17
|
---|
| 104 | +;cbw40,5g mid band 6个 channel 102,110,118,126,134,142
|
---|
| 105 | +RegAddr_5G_MID_CBW40 = 13, 13, 13, 13, 11, 10
|
---|
| 106 | +;cbw40,5g high band 4个 channel 151,159,167,175
|
---|
| 107 | +RegAddr_5G_HIGH_CBW40 = 10, 10, 10, 10
|
---|
| 108 | +;cbw80,5g low band 2个 channel 42,58
|
---|
| 109 | +RegAddr_5G_LOW_CBW80 = 20, 19
|
---|
| 110 | +;cbw80,5g mid band 3个 channel 106,122,138
|
---|
| 111 | +RegAddr_5G_MID_CBW80 = 13, 13, 10
|
---|
| 112 | +;cbw80,5g high band 2个 channel 155,171
|
---|
| 113 | +RegAddr_5G_HIGH_CBW80 = 10, 10
|
---|
| 114 | +
|
---|
| 115 | +;------------------------------------------------------------------------------
|
---|
| 116 | +[RegAddr2]
|
---|
| 117 | +;-----------------------------------------------------------------------------
|
---|
| 118 | +;RegAddr2,start_bit, stop_bit = 0x40142080,4,1
|
---|
| 119 | +RegAddr_Config = 0x40142080,4,1
|
---|
| 120 | +;cbw20 2g 3个channel 3,7,11
|
---|
| 121 | +RegAddr_2G_CBW20 = 7, 7, 7
|
---|
| 122 | +;cbw40 2g 3个channel 3,7,11
|
---|
| 123 | +RegAddr_2G_CBW40 = 7, 7, 7
|
---|
| 124 | +;cbw20,5g low band 8个channel 36,40,44,48,52,56,60,64
|
---|
| 125 | +RegAddr_5G_LOW_CBW20 = 6, 6, 6, 5, 5, 5, 6, 6
|
---|
| 126 | +;cbw20,5g mid band 12个 channel 100,104,108,112,116,120,124,128,132,136,140,144
|
---|
| 127 | +RegAddr_5G_MID_CBW20 = 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6
|
---|
| 128 | +;cbw20,5g high band 8个 channel 149,153,157,161,165,169,173,177
|
---|
| 129 | +RegAddr_5G_HIGH_CBW20 = 6, 6, 8, 8, 4, 4, 4, 4
|
---|
| 130 | +;cbw40,5g low band 4个channel 38,46,54,62
|
---|
| 131 | +RegAddr_5G_LOW_CBW40 = 6, 5, 5, 6
|
---|
| 132 | +;cbw40,5g mid band 6个 channel 102,110,118,126,134,142
|
---|
| 133 | +RegAddr_5G_MID_CBW40 = 5, 5, 5, 5, 6, 6
|
---|
| 134 | +;cbw40,5g high band 4个 channel 151,159,167,175
|
---|
| 135 | +RegAddr_5G_HIGH_CBW40 = 6, 8, 4, 4
|
---|
| 136 | +;cbw80,5g low band 2个 channel 42,58
|
---|
| 137 | +RegAddr_5G_LOW_CBW80 = 6, 5
|
---|
| 138 | +;cbw80,5g mid band 3个 channel 106,122,138
|
---|
| 139 | +RegAddr_5G_MID_CBW80 = 5, 5, 6
|
---|
| 140 | +;cbw80,5g high band 2个 channel 155,171
|
---|
| 141 | +RegAddr_5G_HIGH_CBW80 = 8, 4
|
---|
| 142 | +
|
---|
| 143 | +;------------------------------------------------------------------------------
|
---|
| 144 | +[RegAddr3]
|
---|
| 145 | +;-----------------------------------------------------------------------------
|
---|
| 146 | +;RegAddr3,start_bit, stop_bit = 0x40142080,16,12
|
---|
| 147 | +RegAddr_Config = 0x40142080,16,12
|
---|
| 148 | +;cbw20 2g 3个channel 3,7,11
|
---|
| 149 | +RegAddr_2G_CBW20 = 4, 4, 4
|
---|
| 150 | +;cbw40 2g 3个channel 3,7,11
|
---|
| 151 | +RegAddr_2G_CBW40 = 4, 4, 4
|
---|
| 152 | +;cbw20,5g low band 8个channel 36,40,44,48,52,56,60,64
|
---|
| 153 | +RegAddr_5G_LOW_CBW20 = 4, 4, 4, 4, 4, 4, 4, 4
|
---|
| 154 | +;cbw20,5g mid band 12个 channel 100,104,108,112,116,120,124,128,132,136,140,144
|
---|
| 155 | +RegAddr_5G_MID_CBW20 = 8, 8, 6, 6, 6, 6, 6, 6, 8, 8, 4, 4
|
---|
| 156 | +;cbw20,5g high band 8个 channel 149,153,157,161,165,169,173,177
|
---|
| 157 | +RegAddr_5G_HIGH_CBW20 = 7, 7, 4, 4, 6, 6, 6, 6
|
---|
| 158 | +;cbw40,5g low band 4个channel 38,46,54,62
|
---|
| 159 | +RegAddr_5G_LOW_CBW40 = 4, 4, 4, 4
|
---|
| 160 | +;cbw40,5g mid band 6个 channel 102,110,118,126,134,142
|
---|
| 161 | +RegAddr_5G_MID_CBW40 = 8, 6, 6, 6, 8, 4
|
---|
| 162 | +;cbw40,5g high band 4个 channel 151,159,167,175
|
---|
| 163 | +RegAddr_5G_HIGH_CBW40 = 7, 4, 6, 6
|
---|
| 164 | +;cbw80,5g low band 2个 channel 42,58
|
---|
| 165 | +RegAddr_5G_LOW_CBW80 = 4, 4
|
---|
| 166 | +;cbw80,5g mid band 3个 channel 106,122,138
|
---|
| 167 | +RegAddr_5G_MID_CBW80 = 8, 6, 4
|
---|
| 168 | +;cbw80,5g high band 2个 channel 155,171
|
---|
| 169 | +RegAddr_5G_HIGH_CBW80 = 4, 6
|
---|
| 170 | +;------------------------------------------------------------------------------
|
---|
| 171 | +
|
---|
| 172 | +
|
---|
| 173 | +;------------------------------------------------------------------------------
|
---|
| 174 | +
|
---|
| 175 | +
|
---|
| 176 | +
|
---|
| 177 | +
|
---|
| 178 | +
|
---|
| 179 | +
|
---|
| 180 | +
|
---|
| 181 | +
|
---|
.. | .. |
---|
| 1 | +;******************************************************************************
|
---|
| 2 | +; Wifi Limit Setup file
|
---|
| 3 | +;******************************************************************************
|
---|
| 4 | +[VERSION]
|
---|
| 5 | +WT_VERSION = XW_SDIO_V3.0
|
---|
| 6 | +;优化TX EVM
|
---|
| 7 | +;-----------------------------------------------------------------------------
|
---|
| 8 | +
|
---|
| 9 | +[CAL_POWER_INFO]
|
---|
| 10 | +;-----------------------------------------------------------------------------
|
---|
| 11 | +;设置浮点数,工具会自动做浮点转定点数的处理txpower,s(8,2)
|
---|
| 12 | +;发送给DUT之后,DUT会进行 <<Qnum 的操作,这里的数据不要提前移位 赋值的数值必须是10进制,与DUT侧对应
|
---|
| 13 | +;注释:11b rate 1M,2M,5.5M,11M
|
---|
| 14 | +G_TXPWR11B_UQ2 = 22, 22, 22, 22
|
---|
| 15 | +;G_TXPWR11B_UQ2_DIV = 22, 22, 22, 22
|
---|
| 16 | +;注释:non-ht 2g cbw40 rate 6M/9M,12M,18M,24M,36M,48M,54M
|
---|
| 17 | +G_TXPWRNONHTDUP2G_UQ2 = 21, 21, 21, 21, 21, 21, 21, 19
|
---|
| 18 | +;G_TXPWRNONHTDUP2G_UQ2_DIV = 21, 21, 21, 21, 21, 21, 21, 19
|
---|
| 19 | +;注释:non-ht 5g cbw40 rate 6M,9M,12M,18M,24M,36M,48M,54M; cbw80 rate 6M,9M,12M,18M,24M,36M,48M,54M
|
---|
| 20 | +G_TXPWRNONHTDUP5G_UQ2 = 21, 21, 21, 21, 21, 21, 21, 19, 21, 21, 21, 21, 21, 21, 21, 19
|
---|
| 21 | +;G_TXPWRNONHTDUP5G_UQ2_DIV = 21, 21, 21, 21, 21, 21, 21, 19, 21, 21, 21, 21, 21, 21, 21, 19
|
---|
| 22 | +;注释:non-ht/ht/vht/he cbw20 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 23 | +;ht/vht/he cbw40 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 24 | +G_TXPWRMCS2G_UQ2 = 20, 20, 20, 20, 20, 20, 20, 18, 18, 15, 15, 12, 12, 20, 20, 20, 20, 20, 20, 20, 18, 18, 15, 15, 12, 12
|
---|
| 25 | +;G_TXPWRMCS2G_UQ2_DIV = 20, 20, 20, 20, 20, 20, 20, 18, 18, 15, 15, 12, 12, 20, 20, 20, 20, 20, 20, 20, 18, 18, 15, 15, 12, 12
|
---|
| 26 | +;写注释non-ht/ht/vht/he cbw20 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 27 | +;ht/vht/he cbw80 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 28 | +G_TXPWRMCS5G_UQ2 = 19, 19, 19, 19, 19, 19, 19, 17, 17, 14, 14, 12, 12, 19, 19, 19, 19, 19, 19, 19, 17, 17, 14, 14, 12, 12, 18, 18, 18, 18, 18, 18, 18, 16, 16, 13, 13, 11, 11
|
---|
| 29 | +;G_TXPWRMCS5G_UQ2_DIV = 19, 19, 19, 19, 19, 19, 19, 17, 17, 14, 14, 12, 12, 19, 19, 19, 19, 19, 19, 19, 17, 17, 14, 14, 12, 12, 18, 18, 18, 18, 18, 18, 18, 16, 16, 13, 13, 11, 11
|
---|
| 30 | +;写注释he TB SMALL RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 31 | +;he TB BIG RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 32 | +;he TB BIG RU BIG POWER rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 33 | +TBMAXTXPWR5G_UQ3 = 21, 21, 21, 21, 21, 21, 21, 21, 19, 19, 17, 16, 15, 21, 21, 21, 21, 21, 21, 21, 21, 19, 19, 17, 16, 15, 21, 21, 21, 21, 21, 21, 21, 21, 19, 19, 17, 16, 15
|
---|
| 34 | +;TBMAXTXPWR5G_UQ3_DIV = 21, 21, 21, 21, 21, 21, 21, 21, 19, 19, 17, 16, 15, 21, 21, 21, 21, 21, 21, 21, 21, 19, 19, 17, 16, 15, 21, 21, 21, 21, 21, 21, 21, 21, 19, 19, 17, 16, 15
|
---|
| 35 | +TBMAXTXPWR2G_UQ3 = 21, 21, 21, 21, 21, 21, 21, 21, 19, 19, 17, 16, 15, 21, 21, 21, 21, 21, 21, 21, 21, 19, 19, 17, 16, 15, 21, 21, 21, 21, 21, 21, 21, 21, 19, 19, 17, 16, 15
|
---|
| 36 | +;TBMAXTXPWR2G_UQ3_DIV = 21, 21, 21, 21, 21, 21, 21, 21, 19, 19, 17, 16, 15, 21, 21, 21, 21, 21, 21, 21, 21, 19, 19, 17, 16, 15, 21, 21, 21, 21, 21, 21, 21, 21, 19, 19, 17, 16, 15
|
---|
| 37 | +;写注释 5G,2G MIN TX POWER
|
---|
| 38 | +TBMINTXPWR_SQ2 = 00, 00
|
---|
| 39 | +;TBMINTXPWR_SQ2_DIV = 00, 00
|
---|
| 40 | +;注释:11b rate 1M,2M,5.5M,11M
|
---|
| 41 | +G_TXPWR11B_UQ2_DELTA = 00, 00, 00, 00
|
---|
| 42 | +;G_TXPWR11B_UQ2_DELTA_DIV = 00, 00, 00, 00
|
---|
| 43 | +G_TXPWRNONHTDUP2G_UQ2_DELTA = 00, 00, 00, 00, 00, 00, 00, 00
|
---|
| 44 | +;G_TXPWRNONHTDUP2G_UQ2_DELTA_DIV = 00, 00, 00, 00, 00, 00, 00, 00
|
---|
| 45 | +G_TXPWRNONHTDUP5G_UQ2_DELTA = 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00
|
---|
| 46 | +;G_TXPWRNONHTDUP5G_UQ2_DELTA_DIV = 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00
|
---|
| 47 | +G_TXPWRMCS2G_UQ2_DELTA = 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00
|
---|
| 48 | +;G_TXPWRMCS2G_UQ2_DELTA_DIV = 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00
|
---|
| 49 | +G_TXPWRMCS5G_UQ2_DELTA = 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00
|
---|
| 50 | +;G_TXPWRMCS5G_UQ2_DELTA_DIV = 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00
|
---|
| 51 | +TBMAXTXPWR5G_UQ3_DELTA = 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00
|
---|
| 52 | +;TBMAXTXPWR5G_UQ3_DELTA_DIV = 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00
|
---|
| 53 | +TBMAXTXPWR2G_UQ3_DELTA = 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00
|
---|
| 54 | +;TBMAXTXPWR2G_UQ3_DELTA_DIV = 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00
|
---|
| 55 | +TBMINTXPWR_SQ2_DELTA = 00, 00
|
---|
| 56 | +;TBMINTXPWR_SQ2_DELTA_DIV = 00, 00
|
---|
| 57 | +
|
---|
| 58 | +[CHAN_POWER_COMPINFO]
|
---|
| 59 | +;-----------------------------------------------------------------------------
|
---|
| 60 | +;---------------Primary-------------------------------------------------------
|
---|
| 61 | +;设置浮点数,工具会自动做浮点转定点数的处理。按频点补偿txpower,s(8,2),正数表示加功率,负数表示减功率
|
---|
| 62 | +;cbw20,2g 14个channel 1,2,3,4,5,6,7,8,9,10,11,12,13,14
|
---|
| 63 | +G_COMPCHANTXPWR2G_CBW20_SQ2 = 0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
---|
| 64 | +;cbw40,2g 9个channel 3,4,5,6,7,8,9,10,11
|
---|
| 65 | +G_COMPCHANTXPWR2G_CBW40_SQ2 = 0,0,0,0,0,0,0,0,0
|
---|
| 66 | +;cbw20,5g low band 8个channel 36,40,44,48,52,56,60,64
|
---|
| 67 | +G_COMPCHANTXPWR5G_LOW_CBW20_SQ2 = 0,0,0,0,0,0,0,0
|
---|
| 68 | +;cbw20,5g mid band 12个 channel 100,104,108,112,116,120,124,128,132,136,140,144
|
---|
| 69 | +G_COMPCHANTXPWR5G_MID_CBW20_SQ2 = 0,0,0,0,0,0,0,0,0,0,0,0
|
---|
| 70 | +;cbw20,5g high band 8个 channel 149,153,157,161,165,169,173,177
|
---|
| 71 | +G_COMPCHANTXPWR5G_HIGH_CBW20_SQ2 = 0,0,0,0,0,0,0,0
|
---|
| 72 | +;cbw40,5g low band 4个channel 38,46,54,62
|
---|
| 73 | +G_COMPCHANTXPWR5G_LOW_CBW40_SQ2 = 0,0,0,0
|
---|
| 74 | +;cbw40,5g mid band 6个 channel 102,110,118,126,134,142
|
---|
| 75 | +G_COMPCHANTXPWR5G_MID_CBW40_SQ2 = 0,0,0,0,0,0
|
---|
| 76 | +;cbw40,5g high band 4个 channel 151,159,167,175
|
---|
| 77 | +G_COMPCHANTXPWR5G_HIGH_CBW40_SQ2 = 0,0,0,0
|
---|
| 78 | +;cbw80,5g low band 2个 channel 42,58
|
---|
| 79 | +G_COMPCHANTXPWR5G_LOW_CBW80_SQ2 = 0,0
|
---|
| 80 | +;cbw80,5g mid band 3个 channel 106,122,138
|
---|
| 81 | +G_COMPCHANTXPWR5G_MID_CBW80_SQ2 = 0,0,0
|
---|
| 82 | +;cbw80,5g high band 2个 channel 155,171
|
---|
| 83 | +G_COMPCHANTXPWR5G_HIGH_CBW80_SQ2 = 0,0
|
---|
| 84 | +;cbw20,6g low band 20个channel 187,191,195,199,203,207,211,215,219,223,227,231,235,239,243,247,251,255,259,263,
|
---|
| 85 | +G_COMPCHANTXPWR6G_LOW_CBW20_SQ2 = 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
---|
| 86 | +;cbw20,6g mid band 20个 channel 267,271,275,279,283,287,291,295,299,303,307,311,315,319,323,327,331,335,339,343,
|
---|
| 87 | +G_COMPCHANTXPWR6G_MID_CBW20_SQ2 = 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
---|
| 88 | +;cbw20,6g high band 20个 channel 347,351,355,359,363,367,371,375,379,383,387,391,395,399,403,407,411,415,419,423,
|
---|
| 89 | +G_COMPCHANTXPWR6G_HIGH_CBW20_SQ2 = 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
---|
| 90 | +;cbw40,6g low band 20个channel 193,201,209,217,225,233,241,249,257,265,273,281,289,297,305,313,321,329,337,345,
|
---|
| 91 | +G_COMPCHANTXPWR6G_LOW_CBW40_SQ2 = 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
---|
| 92 | +;cbw40,6g mid band 9个 channel 353,361,369,377,385,393,401,409,417,
|
---|
| 93 | +G_COMPCHANTXPWR6G_MID_CBW40_SQ2 = 0,0,0,0,0,0,0,0,0
|
---|
| 94 | +;cbw80,6g low band 14个 channel 197,213,229,245,261,277,293,309,325,341,357,373,389,405,
|
---|
| 95 | +G_COMPCHANTXPWR6G_LOW_CBW80_SQ2 = 0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
---|
| 96 | +
|
---|
| 97 | +[CHAN_RSSI_COMPINFO]
|
---|
| 98 | +;-----------------------------------------------------------------------------
|
---|
| 99 | +;---------------Primary-------------------------------------------------------
|
---|
| 100 | +;设置浮点数,工具会自动做浮点转定点数的处理。按频点补偿RSSI,s(8,2),正数表示加功率,负数表示减功率
|
---|
| 101 | +;cbw20,2g 14个channel 1,2,3,4,5,6,7,8,9,10,11,12,13,14
|
---|
| 102 | +G_COMPCHANRSSI2G_CBW20_SQ2 = 0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
---|
| 103 | +;cbw40,2g 9个channel 3,4,5,6,7,8,9,10,11
|
---|
| 104 | +G_COMPCHANRSSI2G_CBW40_SQ2 = 0,0,0,0,0,0,0,0,0
|
---|
| 105 | +;cbw20,5g low band 8个channel 36,40,44,48,52,56,60,64
|
---|
| 106 | +G_COMPCHANRSSI5G_LOW_CBW20_SQ2 = 0,0,0,0,0,0,0,0
|
---|
| 107 | +;cbw20,5g mid band 12个 channel 100,104,108,112,116,120,124,128,132,136,140,144
|
---|
| 108 | +G_COMPCHANRSSI5G_MID_CBW20_SQ2 = 0,0,0,0,0,0,0,0,0,0,0,0
|
---|
| 109 | +;cbw20,5g high band 8个 channel 149,153,157,161,165,169,173,177
|
---|
| 110 | +G_COMPCHANRSSI5G_HIGH_CBW20_SQ2 = 0,0,0,0,0,0,0,0
|
---|
| 111 | +;cbw40,5g low band 4个channel 38,46,54,62
|
---|
| 112 | +G_COMPCHANRSSI5G_LOW_CBW40_SQ2 = 0,0,0,0
|
---|
| 113 | +;cbw40,5g mid band 6个 channel 102,110,118,126,134,142
|
---|
| 114 | +G_COMPCHANRSSI5G_MID_CBW40_SQ2 = 0,0,0,0,0,0
|
---|
| 115 | +;cbw40,5g high band 4个 channel 151,159,167,175
|
---|
| 116 | +G_COMPCHANRSSI5G_HIGH_CBW40_SQ2 = 0,0,0,0
|
---|
| 117 | +;cbw80,5g low band 2个 channel 42,58
|
---|
| 118 | +G_COMPCHANRSSI5G_LOW_CBW80_SQ2 = 0,0
|
---|
| 119 | +;cbw80,5g mid band 3个 channel 106,122,138
|
---|
| 120 | +G_COMPCHANRSSI5G_MID_CBW80_SQ2 = 0,0,0
|
---|
| 121 | +;cbw80,5g high band 2个 channel 155,171
|
---|
| 122 | +G_COMPCHANRSSI5G_HIGH_CBW80_SQ2 = 0,0
|
---|
| 123 | +;cbw20,6g low band 20个channel 187,191,195,199,203,207,211,215,219,223,227,231,235,239,243,247,251,255,259,263,
|
---|
| 124 | +G_COMPCHANRSSI6G_LOW_CBW20_SQ2 = 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
---|
| 125 | +;cbw20,6g mid band 20个 channel 267,271,275,279,283,287,291,295,299,303,307,311,315,319,323,327,331,335,339,343,
|
---|
| 126 | +G_COMPCHANRSSI6G_MID_CBW20_SQ2 = 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
---|
| 127 | +;cbw20,6g high band 20个 channel 347,351,355,359,363,367,371,375,379,383,387,391,395,399,403,407,411,415,419,423,
|
---|
| 128 | +G_COMPCHANRSSI6G_HIGH_CBW20_SQ2 = 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
---|
| 129 | +;cbw40,6g low band 20个channel 193,201,209,217,225,233,241,249,257,265,273,281,289,297,305,313,321,329,337,345,
|
---|
| 130 | +G_COMPCHANRSSI6G_LOW_CBW40_SQ2 = 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
---|
| 131 | +;cbw40,6g mid band 9个 channel 353,361,369,377,385,393,401,409,417,
|
---|
| 132 | +G_COMPCHANRSSI6G_MID_CBW40_SQ2 = 0,0,0,0,0,0,0,0,0
|
---|
| 133 | +;cbw80,6g low band 14个 channel 197,213,229,245,261,277,293,309,325,341,357,373,389,405,
|
---|
| 134 | +G_COMPCHANRSSI6G_LOW_CBW80_SQ2 = 0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
---|
| 135 | +
|
---|
| 136 | +[RegAddr1]
|
---|
| 137 | +;---------------------------PRI_5GTX_PAInMatchH1-------------------------------
|
---|
| 138 | +;寄存器配置,RegAddr是寄存器地址,每个信道对应一个寄存器值
|
---|
| 139 | +;PRI_5GTX_PAInMatchH1 -- 40148894 [21 = 17]
|
---|
| 140 | +RegAddr_Config = 0x40148894,21,17
|
---|
| 141 | +;cbw20,5g low band 8个channel 36,40,44,48,52,56,60,64
|
---|
| 142 | +RegAddr_5G_LOW_CBW20 = 22, 22, 22, 21, 21, 21, 20, 20
|
---|
| 143 | +;cbw20,5g mid band 12个 channel 100,104,108,112,116,120,124,128,132,136,140,144
|
---|
| 144 | +RegAddr_5G_MID_CBW20 = 18, 17, 17, 16, 16, 16, 15, 15, 15, 15, 14, 14
|
---|
| 145 | +;cbw20,5g high band 8个 channel 149,153,157,161,165,169,173,177
|
---|
| 146 | +RegAddr_5G_HIGH_CBW20 = 14, 13, 13, 13, 12, 13, 13, 13
|
---|
| 147 | +;cbw40,5g low band 4个channel 38,46,54,62
|
---|
| 148 | +RegAddr_5G_LOW_CBW40 = 22, 21, 21, 20
|
---|
| 149 | +;cbw40,5g mid band 6个 channel 102,110,118,126,134,142
|
---|
| 150 | +RegAddr_5G_MID_CBW40 = 17, 17, 16, 15, 15, 14
|
---|
| 151 | +;cbw40,5g high band 4个 channel 151,159,167,175
|
---|
| 152 | +RegAddr_5G_HIGH_CBW40 = 13, 13, 13, 13
|
---|
| 153 | +;cbw80,5g low band 2个 channel 42,58
|
---|
| 154 | +RegAddr_5G_LOW_CBW80 = 21, 20
|
---|
| 155 | +;cbw80,5g mid band 3个 channel 106,122,138
|
---|
| 156 | +RegAddr_5G_MID_CBW80 = 17, 16, 15
|
---|
| 157 | +;cbw80,5g high band 2个 channel 155,171
|
---|
| 158 | +RegAddr_5G_HIGH_CBW80 = 13, 13
|
---|
| 159 | +;cbw20,6g low band 20个channel 187,191,195,199,203,207,211,215,219,223,227,231,235,239,243,247,251,255,259,263,
|
---|
| 160 | +RegAddr_6G_LOW_CBW20 = 12, 12, 12, 12, 12, 12, 12, 12, 12, 11, 11, 11, 11, 11, 10, 10, 10, 10, 10, 9
|
---|
| 161 | +;cbw20,6g mid band 20个 channel 267,271,275,279,283,287,291,295,299,303,307,311,315,319,323,327,331,335,339,343,
|
---|
| 162 | +RegAddr_6G_MID_CBW20 = 9, 9, 9, 9, 8, 8, 8, 8, 8, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 5
|
---|
| 163 | +;cbw20,6g high band 20个 channel 347,351,355,359,363,367,371,375,379,383,387,391,395,399,403,407,411,415,419,423,
|
---|
| 164 | +RegAddr_6G_HIGH_CBW20 = 5, 5, 5, 5, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 2, 2, 2, 2, 1, 1
|
---|
| 165 | +;cbw40,6g low band 20个channel 193,201,209,217,225,233,241,249,257,265,273,281,289,297,305,313,321,329,337,345,
|
---|
| 166 | +RegAddr_6G_LOW_CBW40 = 12, 12, 12, 12, 11, 11, 10, 10, 10, 9, 9, 8, 8, 8, 7, 7, 6, 6, 6, 5
|
---|
| 167 | +;cbw40,6g mid band 9个 channel 353,361,369,377,385,393,401,409,417,
|
---|
| 168 | +RegAddr_6G_MID_CBW40 = 5, 4, 4, 4, 3, 3, 2, 2, 2
|
---|
| 169 | +;cbw80,6g low band 14个 channel 197,213,229,245,261,277,293,309,325,341,357,373,389,405,
|
---|
| 170 | +RegAddr_6G_LOW_CBW80 = 12, 12, 11, 10, 9, 9, 8, 7, 6, 5, 5, 4, 3, 2
|
---|
| 171 | +;-----------------------------------------------------------------------------
|
---|
| 172 | +
|
---|
| 173 | +[RegAddr2]
|
---|
| 174 | +;---------------------------PRI_5GTX_PAInMatchL1-------------------------------
|
---|
| 175 | +;寄存器配置,RegAddr是寄存器地址,每个信道对应一个寄存器值
|
---|
| 176 | +;PRI_5GTX_PAInMatchL1 -- 40144890 [26 = 22]
|
---|
| 177 | +RegAddr_Config = 0x40148890,21,17
|
---|
| 178 | +;cbw20,5g low band 8个channel 36,40,44,48,52,56,60,64
|
---|
| 179 | +RegAddr_5G_LOW_CBW20 = 22, 22, 22, 21, 21, 21, 20, 20
|
---|
| 180 | +;cbw20,5g mid band 12个 channel 100,104,108,112,116,120,124,128,132,136,140,144
|
---|
| 181 | +RegAddr_5G_MID_CBW20 = 18, 17, 17, 16, 16, 16, 15, 15, 15, 15, 14, 14
|
---|
| 182 | +;cbw20,5g high band 8个 channel 149,153,157,161,165,169,173,177
|
---|
| 183 | +RegAddr_5G_HIGH_CBW20 = 14, 13, 13, 13, 13, 13, 13, 13
|
---|
| 184 | +;cbw40,5g low band 4个channel 38,46,54,62
|
---|
| 185 | +RegAddr_5G_LOW_CBW40 = 22, 21, 21, 20
|
---|
| 186 | +;cbw40,5g mid band 6个 channel 102,110,118,126,134,142
|
---|
| 187 | +RegAddr_5G_MID_CBW40 = 17, 17, 16, 15, 15, 14
|
---|
| 188 | +;cbw40,5g high band 4个 channel 151,159,167,175
|
---|
| 189 | +RegAddr_5G_HIGH_CBW40 = 13, 13, 13, 13
|
---|
| 190 | +;cbw80,5g low band 2个 channel 42,58
|
---|
| 191 | +RegAddr_5G_LOW_CBW80 = 21, 20
|
---|
| 192 | +;cbw80,5g mid band 3个 channel 106,122,138
|
---|
| 193 | +RegAddr_5G_MID_CBW80 = 17, 16, 15
|
---|
| 194 | +;cbw80,5g high band 2个 channel 155,171
|
---|
| 195 | +RegAddr_5G_HIGH_CBW80 = 13, 13
|
---|
| 196 | +;cbw20,6g low band 20个channel 187,191,195,199,203,207,211,215,219,223,227,231,235,239,243,247,251,255,259,263,
|
---|
| 197 | +RegAddr_6G_LOW_CBW20 = 12, 12, 12, 12, 12, 12, 12, 12, 12, 11, 11, 11, 11, 11, 10, 10, 10, 10, 10, 9
|
---|
| 198 | +;cbw20,6g mid band 20个 channel 267,271,275,279,283,287,291,295,299,303,307,311,315,319,323,327,331,335,339,343,
|
---|
| 199 | +RegAddr_6G_MID_CBW20 = 9, 9, 9, 9, 8, 8, 8, 8, 8, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 5
|
---|
| 200 | +;cbw20,6g high band 20个 channel 347,351,355,359,363,367,371,375,379,383,387,391,395,399,403,407,411,415,419,423,
|
---|
| 201 | +RegAddr_6G_HIGH_CBW20 = 5, 5, 5, 5, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 2, 2, 2, 2, 1, 1
|
---|
| 202 | +;cbw40,6g low band 20个channel 193,201,209,217,225,233,241,249,257,265,273,281,289,297,305,313,321,329,337,345,
|
---|
| 203 | +RegAddr_6G_LOW_CBW40 = 12, 12, 12, 12, 11, 11, 10, 10, 10, 9, 9, 8, 8, 8, 7, 7, 6, 6, 6, 5
|
---|
| 204 | +;cbw40,6g mid band 9个 channel 353,361,369,377,385,393,401,409,417,
|
---|
| 205 | +RegAddr_6G_MID_CBW40 = 5, 4, 4, 4, 3, 3, 2, 2, 2
|
---|
| 206 | +;cbw80,6g low band 14个 channel 197,213,229,245,261,277,293,309,325,341,357,373,389,405,
|
---|
| 207 | +RegAddr_6G_LOW_CBW80 = 12, 12, 11, 10, 9, 9, 8, 7, 6, 5, 5, 4, 3, 2
|
---|
| 208 | +;-----------------------------------------------------------------------------
|
---|
| 209 | +
|
---|
| 210 | +[RegAddr3]
|
---|
| 211 | +;---------------------------PRI_5GTX_PABiasH1---------------------------------
|
---|
| 212 | +;寄存器配置,RegAddr是寄存器地址,每个信道对应一个寄存器值
|
---|
| 213 | +;PRI_5GTX_PABiasH1 -- 4014888C [11 = 7]
|
---|
| 214 | +RegAddr_Config = 0x4014888C,11,7
|
---|
| 215 | +;cbw20,5g low band 8个channel 36,40,44,48,52,56,60,64
|
---|
| 216 | +RegAddr_5G_LOW_CBW20 = 15, 16, 14, 15, 16, 14, 14, 16
|
---|
| 217 | +;cbw20,5g mid band 12个 channel 100,104,108,112,116,120,124,128,132,136,140,144
|
---|
| 218 | +RegAddr_5G_MID_CBW20 = 10, 10, 13, 10, 7, 9, 8, 5, 5, 6, 3, 2
|
---|
| 219 | +;cbw20,5g high band 8个 channel 149,153,157,161,165,169,173,177
|
---|
| 220 | +RegAddr_5G_HIGH_CBW20 = 3, 25, 0, 25, 1, 2, 2, 11
|
---|
| 221 | +;cbw40,5g low band 4个channel 38,46,54,62
|
---|
| 222 | +RegAddr_5G_LOW_CBW40 = 16, 14, 16, 15
|
---|
| 223 | +;cbw40,5g mid band 6个 channel 102,110,118,126,134,142
|
---|
| 224 | +RegAddr_5G_MID_CBW40 = 11, 12, 8, 7, 6, 3
|
---|
| 225 | +;cbw40,5g high band 4个 channel 151,159,167,175
|
---|
| 226 | +RegAddr_5G_HIGH_CBW40 = 2, 2, 11, 11
|
---|
| 227 | +;cbw80,5g low band 2个 channel 42,58
|
---|
| 228 | +RegAddr_5G_LOW_CBW80 = 15, 14
|
---|
| 229 | +;cbw80,5g mid band 3个 channel 106,122,138
|
---|
| 230 | +RegAddr_5G_MID_CBW80 = 11, 8, 5
|
---|
| 231 | +;cbw80,5g high band 2个 channel 155,171
|
---|
| 232 | +RegAddr_5G_HIGH_CBW80 = 25, 11
|
---|
| 233 | +;cbw20,6g low band 20个channel 187,191,195,199,203,207,211,215,219,223,227,231,235,239,243,247,251,255,259,263,
|
---|
| 234 | +RegAddr_6G_LOW_CBW20 = 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13
|
---|
| 235 | +;cbw20,6g mid band 20个 channel 267,271,275,279,283,287,291,295,299,303,307,311,315,319,323,327,331,335,339,343,
|
---|
| 236 | +RegAddr_6G_MID_CBW20 = 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 18, 18, 18, 18, 18, 18
|
---|
| 237 | +;cbw20,6g high band 20个 channel 347,351,355,359,363,367,371,375,379,383,387,391,395,399,403,407,411,415,419,423,
|
---|
| 238 | +RegAddr_6G_HIGH_CBW20 = 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18
|
---|
| 239 | +;cbw40,6g low band 20个channel 193,201,209,217,225,233,241,249,257,265,273,281,289,297,305,313,321,329,337,345,
|
---|
| 240 | +RegAddr_6G_LOW_CBW40 = 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 18, 18, 18, 18
|
---|
| 241 | +;cbw40,6g mid band 9个 channel 353,361,369,377,385,393,401,409,417,
|
---|
| 242 | +RegAddr_6G_MID_CBW40 = 18, 18, 18, 18, 18, 18, 18, 18, 18
|
---|
| 243 | +;cbw80,6g low band 14个 channel 197,213,229,245,261,277,293,309,325,341,357,373,389,405,
|
---|
| 244 | +RegAddr_6G_LOW_CBW80 = 13, 13, 13, 13, 13, 13, 13, 13, 18, 18, 18, 18, 18, 18
|
---|
| 245 | +;-----------------------------------------------------------------------------
|
---|
| 246 | +
|
---|
| 247 | +[RegAddr4]
|
---|
| 248 | +;-------------------------PRI_5GTX_PABiasH2-----------------------------------
|
---|
| 249 | +;寄存器配置,RegAddr是寄存器地址,每个信道对应一个寄存器值
|
---|
| 250 | +;PRI_5GTX_PABiasH2 -- 4014888C [23 = 20]
|
---|
| 251 | +RegAddr_Config = 0x4014888C,23,20
|
---|
| 252 | +;cbw20,5g low band 8个channel 36,40,44,48,52,56,60,64
|
---|
| 253 | +RegAddr_5G_LOW_CBW20 = 11, 11, 11, 11, 11, 10, 11, 12
|
---|
| 254 | +;cbw20,5g mid band 12个 channel 100,104,108,112,116,120,124,128,132,136,140,144
|
---|
| 255 | +RegAddr_5G_MID_CBW20 = 8, 8, 9, 6, 6, 8, 5, 4, 6, 6, 3, 4
|
---|
| 256 | +;cbw20,5g high band 8个 channel 149,153,157,161,165,169,173,177
|
---|
| 257 | +RegAddr_5G_HIGH_CBW20 = 5, 3, 3, 5, 4, 6, 6, 6
|
---|
| 258 | +;cbw40,5g low band 4个channel 38,46,54,62
|
---|
| 259 | +RegAddr_5G_LOW_CBW40 = 12, 11, 10, 11
|
---|
| 260 | +;cbw40,5g mid band 6个 channel 102,110,118,126,134,142
|
---|
| 261 | +RegAddr_5G_MID_CBW40 = 8, 8, 7, 5, 6, 3
|
---|
| 262 | +;cbw40,5g high band 4个 channel 151,159,167,175
|
---|
| 263 | +RegAddr_5G_HIGH_CBW40 = 5, 5, 6, 6
|
---|
| 264 | +;cbw80,5g low band 2个 channel 42,58
|
---|
| 265 | +RegAddr_5G_LOW_CBW80 = 10, 9
|
---|
| 266 | +;cbw80,5g mid band 3个 channel 106,122,138
|
---|
| 267 | +RegAddr_5G_MID_CBW80 = 8, 7, 5
|
---|
| 268 | +;cbw80,5g high band 2个 channel 155,171
|
---|
| 269 | +RegAddr_5G_HIGH_CBW80 = 4, 6
|
---|
| 270 | +;cbw20,6g low band 20个channel 187,191,195,199,203,207,211,215,219,223,227,231,235,239,243,247,251,255,259,263,
|
---|
| 271 | +RegAddr_6G_LOW_CBW20 = 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5
|
---|
| 272 | +;cbw20,6g mid band 20个 channel 267,271,275,279,283,287,291,295,299,303,307,311,315,319,323,327,331,335,339,343,
|
---|
| 273 | +RegAddr_6G_MID_CBW20 = 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 7, 7, 7, 7, 7, 7
|
---|
| 274 | +;cbw20,6g high band 20个 channel 347,351,355,359,363,367,371,375,379,383,387,391,395,399,403,407,411,415,419,423,
|
---|
| 275 | +RegAddr_6G_HIGH_CBW20 = 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
|
---|
| 276 | +;cbw40,6g low band 20个channel 193,201,209,217,225,233,241,249,257,265,273,281,289,297,305,313,321,329,337,345,
|
---|
| 277 | +RegAddr_6G_LOW_CBW40 = 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 7, 7, 7, 7
|
---|
| 278 | +;cbw40,6g mid band 9个 channel 353,361,369,377,385,393,401,409,417,
|
---|
| 279 | +RegAddr_6G_MID_CBW40 = 7, 7, 7, 7, 7, 7, 7, 7, 7
|
---|
| 280 | +;cbw80,6g low band 14个 channel 197,213,229,245,261,277,293,309,325,341,357,373,389,405,
|
---|
| 281 | +RegAddr_6G_LOW_CBW80 = 5, 5, 5, 5, 5, 5, 5, 5, 7, 7, 7, 7, 7, 7
|
---|
| 282 | +;-----------------------------------------------------------------------------
|
---|
| 283 | +
|
---|
| 284 | +[RegAddr5]
|
---|
| 285 | +;---------------------------PRI_5GTX_PABiasH3---------------------------------
|
---|
| 286 | +;寄存器配置,RegAddr是寄存器地址,每个信道对应一个寄存器值
|
---|
| 287 | +;PRI_5GTX_PABiasH3 -- 4014888C [30]
|
---|
| 288 | +RegAddr_Config = 0x4014888C,24,24
|
---|
| 289 | +;cbw20,5g low band 8个channel 36,40,44,48,52,56,60,64
|
---|
| 290 | +RegAddr_5G_LOW_CBW20 = 1, 1, 1, 1, 1, 1, 1, 1
|
---|
| 291 | +;cbw20,5g mid band 12个 channel 100,104,108,112,116,120,124,128,132,136,140,144
|
---|
| 292 | +RegAddr_5G_MID_CBW20 = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
|
---|
| 293 | +;cbw20,5g high band 8个 channel 149,153,157,161,165,169,173,177
|
---|
| 294 | +RegAddr_5G_HIGH_CBW20 = 1, 1, 1, 1, 1, 1, 1, 1
|
---|
| 295 | +;cbw40,5g low band 4个channel 38,46,54,62
|
---|
| 296 | +RegAddr_5G_LOW_CBW40 = 1, 1, 1, 1
|
---|
| 297 | +;cbw40,5g mid band 6个 channel 102,110,118,126,134,142
|
---|
| 298 | +RegAddr_5G_MID_CBW40 = 1, 1, 1, 1, 1, 1
|
---|
| 299 | +;cbw40,5g high band 4个 channel 151,159,167,175
|
---|
| 300 | +RegAddr_5G_HIGH_CBW40 = 1, 1, 1, 1
|
---|
| 301 | +;cbw80,5g low band 2个 channel 42,58
|
---|
| 302 | +RegAddr_5G_LOW_CBW80 = 1, 1
|
---|
| 303 | +;cbw80,5g mid band 3个 channel 106,122,138
|
---|
| 304 | +RegAddr_5G_MID_CBW80 = 1, 1, 1
|
---|
| 305 | +;cbw80,5g high band 2个 channel 155,171
|
---|
| 306 | +RegAddr_5G_HIGH_CBW80 = 1, 1
|
---|
| 307 | +;cbw20,6g low band 20个channel 187,191,195,199,203,207,211,215,219,223,227,231,235,239,243,247,251,255,259,263,
|
---|
| 308 | +RegAddr_6G_LOW_CBW20 = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
|
---|
| 309 | +;cbw20,6g mid band 20个 channel 267,271,275,279,283,287,291,295,299,303,307,311,315,319,323,327,331,335,339,343,
|
---|
| 310 | +RegAddr_6G_MID_CBW20 = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
|
---|
| 311 | +;cbw20,6g high band 20个 channel 347,351,355,359,363,367,371,375,379,383,387,391,395,399,403,407,411,415,419,423,
|
---|
| 312 | +RegAddr_6G_HIGH_CBW20 = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
|
---|
| 313 | +;cbw40,6g low band 20个channel 193,201,209,217,225,233,241,249,257,265,273,281,289,297,305,313,321,329,337,345,
|
---|
| 314 | +RegAddr_6G_LOW_CBW40 = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
|
---|
| 315 | +;cbw40,6g mid band 9个 channel 353,361,369,377,385,393,401,409,417,
|
---|
| 316 | +RegAddr_6G_MID_CBW40 = 1, 1, 1, 1, 1, 1, 1, 1, 1
|
---|
| 317 | +;cbw80,6g low band 14个 channel 197,213,229,245,261,277,293,309,325,341,357,373,389,405,
|
---|
| 318 | +RegAddr_6G_LOW_CBW80 = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
|
---|
| 319 | +;-----------------------------------------------------------------------------
|
---|
| 320 | +
|
---|
| 321 | +[RegAddr6]
|
---|
| 322 | +;--------------------------PRI_5GTX_PABiasH4----------------------------------
|
---|
| 323 | +;寄存器配置,RegAddr是寄存器地址,每个信道对应一个寄存器值
|
---|
| 324 | +;PRI_5GTX_PABiasH4 -- 4014888C [6 = 4]
|
---|
| 325 | +RegAddr_Config = 0x4014888C,6,4
|
---|
| 326 | +;cbw20,5g low band 8个channel 36,40,44,48,52,56,60,64
|
---|
| 327 | +RegAddr_5G_LOW_CBW20 = 3, 3, 3, 3, 3, 3, 3, 3
|
---|
| 328 | +;cbw20,5g mid band 12个 channel 100,104,108,112,116,120,124,128,132,136,140,144
|
---|
| 329 | +RegAddr_5G_MID_CBW20 = 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3
|
---|
| 330 | +;cbw20,5g high band 8个 channel 149,153,157,161,165,169,173,177
|
---|
| 331 | +RegAddr_5G_HIGH_CBW20 = 3, 1, 3, 1, 3, 2, 2, 2
|
---|
| 332 | +;cbw40,5g low band 4个channel 38,46,54,62
|
---|
| 333 | +RegAddr_5G_LOW_CBW40 = 3, 3, 3, 3
|
---|
| 334 | +;cbw40,5g mid band 6个 channel 102,110,118,126,134,142
|
---|
| 335 | +RegAddr_5G_MID_CBW40 = 3, 3, 3, 3, 3, 3
|
---|
| 336 | +;cbw40,5g high band 4个 channel 151,159,167,175
|
---|
| 337 | +RegAddr_5G_HIGH_CBW40 = 3, 3, 2, 2
|
---|
| 338 | +;cbw80,5g low band 2个 channel 42,58
|
---|
| 339 | +RegAddr_5G_LOW_CBW80 = 3, 3
|
---|
| 340 | +;cbw80,5g mid band 3个 channel 106,122,138
|
---|
| 341 | +RegAddr_5G_MID_CBW80 = 3, 3, 3
|
---|
| 342 | +;cbw80,5g high band 2个 channel 155,171
|
---|
| 343 | +RegAddr_5G_HIGH_CBW80 = 1, 2
|
---|
| 344 | +;cbw20,6g low band 20个channel 187,191,195,199,203,207,211,215,219,223,227,231,235,239,243,247,251,255,259,263,
|
---|
| 345 | +RegAddr_6G_LOW_CBW20 = 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2
|
---|
| 346 | +;cbw20,6g mid band 20个 channel 267,271,275,279,283,287,291,295,299,303,307,311,315,319,323,327,331,335,339,343,
|
---|
| 347 | +RegAddr_6G_MID_CBW20 = 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2
|
---|
| 348 | +;cbw20,6g high band 20个 channel 347,351,355,359,363,367,371,375,379,383,387,391,395,399,403,407,411,415,419,423,
|
---|
| 349 | +RegAddr_6G_HIGH_CBW20 = 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2
|
---|
| 350 | +;cbw40,6g low band 20个channel 193,201,209,217,225,233,241,249,257,265,273,281,289,297,305,313,321,329,337,345,
|
---|
| 351 | +RegAddr_6G_LOW_CBW40 = 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2
|
---|
| 352 | +;cbw40,6g mid band 9个 channel 353,361,369,377,385,393,401,409,417,
|
---|
| 353 | +RegAddr_6G_MID_CBW40 = 2, 2, 2, 2, 2, 2, 2, 2, 2
|
---|
| 354 | +;cbw80,6g low band 14个 channel 197,213,229,245,261,277,293,309,325,341,357,373,389,405,
|
---|
| 355 | +RegAddr_6G_LOW_CBW80 = 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2
|
---|
| 356 | +;-----------------------------------------------------------------------------
|
---|
| 357 | +
|
---|
| 358 | +[RegAddr7]
|
---|
| 359 | +;--------------------------PRI_5GTX_PABiasL1----------------------------------
|
---|
| 360 | +;寄存器配置,RegAddr是寄存器地址,每个信道对应一个寄存器值
|
---|
| 361 | +;PRI_5GTX_PABiasL1 -- 40144888 [11 = 7]
|
---|
| 362 | +RegAddr_Config = 0x40148888,11,7
|
---|
| 363 | +;cbw20,5g low band 8个channel 36,40,44,48,52,56,60,64
|
---|
| 364 | +RegAddr_5G_LOW_CBW20 = 15, 16, 14, 15, 16, 14, 14, 16
|
---|
| 365 | +;cbw20,5g mid band 12个 channel 100,104,108,112,116,120,124,128,132,136,140,144
|
---|
| 366 | +RegAddr_5G_MID_CBW20 = 10, 10, 13, 10, 7, 9, 8, 5, 5, 6, 3, 2
|
---|
| 367 | +;cbw20,5g high band 8个 channel 149,153,157,161,165,169,173,177
|
---|
| 368 | +RegAddr_5G_HIGH_CBW20 = 28, 25, 0, 1, 25, 11, 11, 11
|
---|
| 369 | +;cbw40,5g low band 4个channel 38,46,54,62
|
---|
| 370 | +RegAddr_5G_LOW_CBW40 = 16, 14, 16, 15
|
---|
| 371 | +;cbw40,5g mid band 6个 channel 102,110,118,126,134,142
|
---|
| 372 | +RegAddr_5G_MID_CBW40 = 11, 12, 8, 7, 6, 3
|
---|
| 373 | +;cbw40,5g high band 4个 channel 151,159,167,175
|
---|
| 374 | +RegAddr_5G_HIGH_CBW40 = 2, 2, 11, 11
|
---|
| 375 | +;cbw80,5g low band 2个 channel 42,58
|
---|
| 376 | +RegAddr_5G_LOW_CBW80 = 15, 14
|
---|
| 377 | +;cbw80,5g mid band 3个 channel 106,122,138
|
---|
| 378 | +RegAddr_5G_MID_CBW80 = 11, 8, 5
|
---|
| 379 | +;cbw80,5g high band 2个 channel 155,171
|
---|
| 380 | +RegAddr_5G_HIGH_CBW80 = 25, 11
|
---|
| 381 | +;cbw20,6g low band 20个channel 187,191,195,199,203,207,211,215,219,223,227,231,235,239,243,247,251,255,259,263,
|
---|
| 382 | +RegAddr_6G_LOW_CBW20 = 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13
|
---|
| 383 | +;cbw20,6g mid band 20个 channel 267,271,275,279,283,287,291,295,299,303,307,311,315,319,323,327,331,335,339,343,
|
---|
| 384 | +RegAddr_6G_MID_CBW20 = 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 18, 18, 18, 18, 18, 18
|
---|
| 385 | +;cbw20,6g high band 20个 channel 347,351,355,359,363,367,371,375,379,383,387,391,395,399,403,407,411,415,419,423,
|
---|
| 386 | +RegAddr_6G_HIGH_CBW20 = 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18
|
---|
| 387 | +;cbw40,6g low band 20个channel 193,201,209,217,225,233,241,249,257,265,273,281,289,297,305,313,321,329,337,345,
|
---|
| 388 | +RegAddr_6G_LOW_CBW40 = 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 18, 18, 18, 18
|
---|
| 389 | +;cbw40,6g mid band 9个 channel 353,361,369,377,385,393,401,409,417,
|
---|
| 390 | +RegAddr_6G_MID_CBW40 = 18, 18, 18, 18, 18, 18, 18, 18, 18
|
---|
| 391 | +;cbw80,6g low band 14个 channel 197,213,229,245,261,277,293,309,325,341,357,373,389,405,
|
---|
| 392 | +RegAddr_6G_LOW_CBW80 = 13, 13, 13, 13, 13, 13, 13, 13, 18, 18, 18, 18, 18, 18
|
---|
| 393 | +;-----------------------------------------------------------------------------
|
---|
| 394 | +
|
---|
| 395 | +[RegAddr8]
|
---|
| 396 | +;-------------------------PRI_5GTX_PABiasL2-----------------------------------
|
---|
| 397 | +;寄存器配置,RegAddr是寄存器地址,每个信道对应一个寄存器值
|
---|
| 398 | +;PRI_5GTX_PABiasL2 -- 40144888 [29 = 26]
|
---|
| 399 | +RegAddr_Config = 0x40148888,23,20
|
---|
| 400 | +;cbw20,5g low band 8个channel 36,40,44,48,52,56,60,64
|
---|
| 401 | +RegAddr_5G_LOW_CBW20 = 11, 11, 11, 11, 11, 10, 11, 12
|
---|
| 402 | +;cbw20,5g mid band 12个 channel 100,104,108,112,116,120,124,128,132,136,140,144
|
---|
| 403 | +RegAddr_5G_MID_CBW20 = 8, 8, 9, 6, 6, 8, 5, 4, 6, 6, 3, 4
|
---|
| 404 | +;cbw20,5g high band 8个 channel 149,153,157,161,165,169,173,177
|
---|
| 405 | +RegAddr_5G_HIGH_CBW20 = 5, 3, 3, 4, 4, 6, 6, 6
|
---|
| 406 | +;cbw40,5g low band 4个channel 38,46,54,62
|
---|
| 407 | +RegAddr_5G_LOW_CBW40 = 12, 11, 10, 11
|
---|
| 408 | +;cbw40,5g mid band 6个 channel 102,110,118,126,134,142
|
---|
| 409 | +RegAddr_5G_MID_CBW40 = 8, 8, 7, 5, 6, 3
|
---|
| 410 | +;cbw40,5g high band 4个 channel 151,159,167,175
|
---|
| 411 | +RegAddr_5G_HIGH_CBW40 = 5, 5, 6, 6
|
---|
| 412 | +;cbw80,5g low band 2个 channel 42,58
|
---|
| 413 | +RegAddr_5G_LOW_CBW80 = 10, 9
|
---|
| 414 | +;cbw80,5g mid band 3个 channel 106,122,138
|
---|
| 415 | +RegAddr_5G_MID_CBW80 = 8, 7, 5
|
---|
| 416 | +;cbw80,5g high band 2个 channel 155,171
|
---|
| 417 | +RegAddr_5G_HIGH_CBW80 = 4, 6
|
---|
| 418 | +;cbw20,6g low band 20个channel 187,191,195,199,203,207,211,215,219,223,227,231,235,239,243,247,251,255,259,263,
|
---|
| 419 | +RegAddr_6G_LOW_CBW20 = 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5
|
---|
| 420 | +;cbw20,6g mid band 20个 channel 267,271,275,279,283,287,291,295,299,303,307,311,315,319,323,327,331,335,339,343,
|
---|
| 421 | +RegAddr_6G_MID_CBW20 = 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 7, 7, 7, 7, 7, 7
|
---|
| 422 | +;cbw20,6g high band 20个 channel 347,351,355,359,363,367,371,375,379,383,387,391,395,399,403,407,411,415,419,423,
|
---|
| 423 | +RegAddr_6G_HIGH_CBW20 = 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
|
---|
| 424 | +;cbw40,6g low band 20个channel 193,201,209,217,225,233,241,249,257,265,273,281,289,297,305,313,321,329,337,345,
|
---|
| 425 | +RegAddr_6G_LOW_CBW40 = 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 7, 7, 7, 7
|
---|
| 426 | +;cbw40,6g mid band 9个 channel 353,361,369,377,385,393,401,409,417,
|
---|
| 427 | +RegAddr_6G_MID_CBW40 = 7, 7, 7, 7, 7, 7, 7, 7, 7
|
---|
| 428 | +;cbw80,6g low band 14个 channel 197,213,229,245,261,277,293,309,325,341,357,373,389,405,
|
---|
| 429 | +RegAddr_6G_LOW_CBW80 = 5, 5, 5, 5, 5, 5, 5, 5, 7, 7, 7, 7, 7, 7
|
---|
| 430 | +;-----------------------------------------------------------------------------
|
---|
| 431 | +
|
---|
| 432 | +[RegAddr9]
|
---|
| 433 | +;------------------------PRI_5GTX_PABiasL3-------------------------------------
|
---|
| 434 | +;寄存器配置,RegAddr是寄存器地址,每个信道对应一个寄存器值
|
---|
| 435 | +;PRI_5GTX_PABiasL3 -- 40144888 [30]
|
---|
| 436 | +RegAddr_Config = 0x40148888,24,24
|
---|
| 437 | +;cbw20,5g low band 8个channel 36,40,44,48,52,56,60,64
|
---|
| 438 | +RegAddr_5G_LOW_CBW20 = 1, 1, 1, 1, 1, 1, 1, 1
|
---|
| 439 | +;cbw20,5g mid band 12个 channel 100,104,108,112,116,120,124,128,132,136,140,144
|
---|
| 440 | +RegAddr_5G_MID_CBW20 = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
|
---|
| 441 | +;cbw20,5g high band 8个 channel 149,153,157,161,165,169,173,177
|
---|
| 442 | +RegAddr_5G_HIGH_CBW20 = 1, 1, 1, 1, 1, 1, 1, 1
|
---|
| 443 | +;cbw40,5g low band 4个channel 38,46,54,62
|
---|
| 444 | +RegAddr_5G_LOW_CBW40 = 1, 1, 1, 1
|
---|
| 445 | +;cbw40,5g mid band 6个 channel 102,110,118,126,134,142
|
---|
| 446 | +RegAddr_5G_MID_CBW40 = 1, 1, 1, 1, 1, 1
|
---|
| 447 | +;cbw40,5g high band 4个 channel 151,159,167,175
|
---|
| 448 | +RegAddr_5G_HIGH_CBW40 = 1, 1, 1, 1
|
---|
| 449 | +;cbw80,5g low band 2个 channel 42,58
|
---|
| 450 | +RegAddr_5G_LOW_CBW80 = 1, 1
|
---|
| 451 | +;cbw80,5g mid band 3个 channel 106,122,138
|
---|
| 452 | +RegAddr_5G_MID_CBW80 = 1, 1, 1
|
---|
| 453 | +;cbw80,5g high band 2个 channel 155,171
|
---|
| 454 | +RegAddr_5G_HIGH_CBW80 = 1, 1
|
---|
| 455 | +;cbw20,6g low band 20个channel 187,191,195,199,203,207,211,215,219,223,227,231,235,239,243,247,251,255,259,263,
|
---|
| 456 | +RegAddr_6G_LOW_CBW20 = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
|
---|
| 457 | +;cbw20,6g mid band 20个 channel 267,271,275,279,283,287,291,295,299,303,307,311,315,319,323,327,331,335,339,343,
|
---|
| 458 | +RegAddr_6G_MID_CBW20 = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
|
---|
| 459 | +;cbw20,6g high band 20个 channel 347,351,355,359,363,367,371,375,379,383,387,391,395,399,403,407,411,415,419,423,
|
---|
| 460 | +RegAddr_6G_HIGH_CBW20 = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
|
---|
| 461 | +;cbw40,6g low band 20个channel 193,201,209,217,225,233,241,249,257,265,273,281,289,297,305,313,321,329,337,345,
|
---|
| 462 | +RegAddr_6G_LOW_CBW40 = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
|
---|
| 463 | +;cbw40,6g mid band 9个 channel 353,361,369,377,385,393,401,409,417,
|
---|
| 464 | +RegAddr_6G_MID_CBW40 = 1, 1, 1, 1, 1, 1, 1, 1, 1
|
---|
| 465 | +;cbw80,6g low band 14个 channel 197,213,229,245,261,277,293,309,325,341,357,373,389,405,
|
---|
| 466 | +RegAddr_6G_LOW_CBW80 = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
|
---|
| 467 | +;-----------------------------------------------------------------------------
|
---|
| 468 | +
|
---|
| 469 | +[RegAddr10]
|
---|
| 470 | +;------------------------PRI_5GTX_PABiasL4------------------------------------
|
---|
| 471 | +;寄存器配置,RegAddr是寄存器地址,每个信道对应一个寄存器值
|
---|
| 472 | +;PRI_5GTX_PABiasL4 -- 40144888 [11 = 9]
|
---|
| 473 | +RegAddr_Config = 0x40148888,6,4
|
---|
| 474 | +;cbw20,5g low band 8个channel 36,40,44,48,52,56,60,64
|
---|
| 475 | +RegAddr_5G_LOW_CBW20 = 3, 3, 3, 3, 3, 3, 3, 3
|
---|
| 476 | +;cbw20,5g mid band 12个 channel 100,104,108,112,116,120,124,128,132,136,140,144
|
---|
| 477 | +RegAddr_5G_MID_CBW20 = 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3
|
---|
| 478 | +;cbw20,5g high band 8个 channel 149,153,157,161,165,169,173,177
|
---|
| 479 | +RegAddr_5G_HIGH_CBW20 = 1, 1, 3, 3, 1, 2, 2, 2
|
---|
| 480 | +;cbw40,5g low band 4个channel 38,46,54,62
|
---|
| 481 | +RegAddr_5G_LOW_CBW40 = 3, 3, 3, 3
|
---|
| 482 | +;cbw40,5g mid band 6个 channel 102,110,118,126,134,142
|
---|
| 483 | +RegAddr_5G_MID_CBW40 = 3, 3, 3, 3, 3, 3
|
---|
| 484 | +;cbw40,5g high band 4个 channel 151,159,167,175
|
---|
| 485 | +RegAddr_5G_HIGH_CBW40 = 3, 3, 2, 2
|
---|
| 486 | +;cbw80,5g low band 2个 channel 42,58
|
---|
| 487 | +RegAddr_5G_LOW_CBW80 = 3, 3
|
---|
| 488 | +;cbw80,5g mid band 3个 channel 106,122,138
|
---|
| 489 | +RegAddr_5G_MID_CBW80 = 3, 3, 3
|
---|
| 490 | +;cbw80,5g high band 2个 channel 155,171
|
---|
| 491 | +RegAddr_5G_HIGH_CBW80 = 1, 2
|
---|
| 492 | +;cbw20,6g low band 20个channel 187,191,195,199,203,207,211,215,219,223,227,231,235,239,243,247,251,255,259,263,
|
---|
| 493 | +RegAddr_6G_LOW_CBW20 = 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2
|
---|
| 494 | +;cbw20,6g mid band 20个 channel 267,271,275,279,283,287,291,295,299,303,307,311,315,319,323,327,331,335,339,343,
|
---|
| 495 | +RegAddr_6G_MID_CBW20 = 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2
|
---|
| 496 | +;cbw20,6g high band 20个 channel 347,351,355,359,363,367,371,375,379,383,387,391,395,399,403,407,411,415,419,423,
|
---|
| 497 | +RegAddr_6G_HIGH_CBW20 = 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2
|
---|
| 498 | +;cbw40,6g low band 20个channel 193,201,209,217,225,233,241,249,257,265,273,281,289,297,305,313,321,329,337,345,
|
---|
| 499 | +RegAddr_6G_LOW_CBW40 = 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2
|
---|
| 500 | +;cbw40,6g mid band 9个 channel 353,361,369,377,385,393,401,409,417,
|
---|
| 501 | +RegAddr_6G_MID_CBW40 = 2, 2, 2, 2, 2, 2, 2, 2, 2
|
---|
| 502 | +;cbw80,6g low band 14个 channel 197,213,229,245,261,277,293,309,325,341,357,373,389,405,
|
---|
| 503 | +RegAddr_6G_LOW_CBW80 = 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2
|
---|
| 504 | +;------------------------------------------------------------------------------
|
---|
| 505 | +;-----------------------------------------------------------------------------
|
---|
| 506 | +
|
---|
| 507 | +[RegAddr25]
|
---|
| 508 | +;------------------------PRI_2GTX_PAInMatch HP------------------------------------
|
---|
| 509 | +;寄存器配置,RegAddr是寄存器地址,每个信道对应一个寄存器值
|
---|
| 510 | +;PRI_2GTX_PAInMatch -- 401448BC [21 = 17]
|
---|
| 511 | +RegAddr_Config = 0x401488BC,21,17
|
---|
| 512 | +;cbw20 2g 3个channel段 1~4,5~9,10~13
|
---|
| 513 | +RegAddr_2G_CBW20 = 21, 20, 19
|
---|
| 514 | +;cbw40 2g 3个channel段 3~4,5~9,10~11
|
---|
| 515 | +RegAddr_2G_CBW40 = 21, 20, 19
|
---|
| 516 | +;-----------------------------------------------------------------------------
|
---|
| 517 | +
|
---|
| 518 | +[RegAddr26]
|
---|
| 519 | +;------------------------PRI_2GTX_HP_PABias1------------------------------------
|
---|
| 520 | +;寄存器配置,RegAddr是寄存器地址,每个信道对应一个寄存器值
|
---|
| 521 | +;PRI_2GTX_PABias1 -- 401448B4 [17 = 13]
|
---|
| 522 | +RegAddr_Config = 0x401488B4,11,7
|
---|
| 523 | +;cbw20 2g 3个channel段 1~4,5~9,10~13
|
---|
| 524 | +RegAddr_2G_CBW20 = 10, 11, 14
|
---|
| 525 | +;cbw40 2g 3个channel段 3~4,5~9,10~11
|
---|
| 526 | +RegAddr_2G_CBW40 = 10, 11, 14
|
---|
| 527 | +;-----------------------------------------------------------------------------
|
---|
| 528 | +
|
---|
| 529 | +[RegAddr27]
|
---|
| 530 | +;------------------------PRI_2GTX_HP_PABias2------------------------------------
|
---|
| 531 | +;寄存器配置,RegAddr是寄存器地址,每个信道对应一个寄存器值
|
---|
| 532 | +;PRI_2GTX_PABias2 -- 401448B4 [29 = 26]
|
---|
| 533 | +RegAddr_Config = 0x401488B4,23,20
|
---|
| 534 | +;cbw20 2g 3个channel段 1~4,5~9,10~13
|
---|
| 535 | +RegAddr_2G_CBW20 = 7, 7, 10
|
---|
| 536 | +;cbw40 2g 3个channel段 3~4,5~9,10~11
|
---|
| 537 | +RegAddr_2G_CBW40 = 7, 7, 10
|
---|
| 538 | +;-----------------------------------------------------------------------------
|
---|
| 539 | +
|
---|
| 540 | +[RegAddr28]
|
---|
| 541 | +;------------------------PRI_2GTX_HP_PABias3------------------------------------
|
---|
| 542 | +;寄存器配置,RegAddr是寄存器地址,每个信道对应一个寄存器值
|
---|
| 543 | +;PRI_2GTX_PABias2 -- 401448B4 [29 = 26]
|
---|
| 544 | +RegAddr_Config = 0x401488B4,24,24
|
---|
| 545 | +;cbw20 2g 3个channel段 1~4,5~9,10~13
|
---|
| 546 | +RegAddr_2G_CBW20 = 1, 1, 1
|
---|
| 547 | +;cbw40 2g 3个channel段 3~4,5~9,10~11
|
---|
| 548 | +RegAddr_2G_CBW40 = 1, 1, 1
|
---|
| 549 | +;-----------------------------------------------------------------------------
|
---|
| 550 | +
|
---|
| 551 | +[RegAddr29]
|
---|
| 552 | +;------------------------PRI_2GTX_HP_PABias4------------------------------------
|
---|
| 553 | +;寄存器配置,RegAddr是寄存器地址,每个信道对应一个寄存器值
|
---|
| 554 | +;PRI_2GTX_PABias2 -- 401448B4 [29 = 26]
|
---|
| 555 | +RegAddr_Config = 0x401488B4,6,4
|
---|
| 556 | +;cbw20 2g 3个channel段 1~4,5~9,10~13
|
---|
| 557 | +RegAddr_2G_CBW20 = 2, 2, 2
|
---|
| 558 | +;cbw40 2g 3个channel段 3~4,5~9,10~11
|
---|
| 559 | +RegAddr_2G_CBW40 = 2, 2, 2
|
---|
| 560 | +;-----------------------------------------------------------------------------
|
---|
| 561 | +;------------------------------------------------------------------------------
|
---|
| 562 | +
|
---|
| 563 | +[CAL_RESULT_INFO_EN]
|
---|
| 564 | +;-----------------------------------------------------------------------------
|
---|
| 565 | +;0:配置文件中[CAL_RESULT_INFO]参数不生效
|
---|
| 566 | +;1:配置文件中[CAL_RESULT_INFO]参数生效
|
---|
| 567 | +;uint8
|
---|
| 568 | +CAL_RESULT_INFO_EN = 0
|
---|
| 569 | +
|
---|
| 570 | +[CAL_RESULT_INFO]
|
---|
| 571 | +;-----------------------------------------------------------------------------
|
---|
| 572 | +;CAL_RESULT_BITMAP = FFFFFFFF bitmap是用于指示是否写入efuse以及如何写入的,第一次传递过去必须是0,表示不写入,后续校准结束后根据校准结果写入
|
---|
| 573 | +;赋值的数值必须是16进制,并且需要字符将所有位置填满,比如16位的0需要写成0000,32位的3需要写出00000003
|
---|
| 574 | +RSV0 = 00
|
---|
| 575 | +DCXO = 40
|
---|
| 576 | +TEMPTURE = 0000
|
---|
| 577 | +;2.4G
|
---|
| 578 | +B2_TX_DELTA_GAIN = 04, 01, 01, 01, FC, FD, F9, F9, F3, F8, F1, F0
|
---|
| 579 | +;B2_MIMO_TX_GAIN_DIFF = 04, 01, 01, 01
|
---|
| 580 | +B2_RX_LIMIT_DELTA_GAIN = 22, 20, 23, 21, 25, 21
|
---|
| 581 | +B2_RX_NORMAL_DELTA_GAIN = 20, 20, 20, 20, 23, 24, 22
|
---|
| 582 | +;B2_MIMO_RX_GAIN_DIFF = 04, 01, 01, 01, 20, 23, 21, 25, 21
|
---|
| 583 | +;5G&6G
|
---|
| 584 | +B5_TX_DELTA_GAIN = F9, F8, F8, FA, EF, EE, EE, F0, F4, F2, F3, F4, FA, F9, FA, FA, F8, F6, F6, F6, F4, F1, F0, F1, F7, F5, F5, F5, FB, F8, F7, F7, FA, F7, F7, F7, F7, F4, F4, F4, F6, F3, F4, F4, F9, F8, F8, FA, EF, EE, EE, F0, F4, F2, F3, F4, FA, F9, FA, FA, F8, F6, F6, F6, F4, F1, F0, F1, F7, F5, F5, F5, FB, F8, F7, F7, FA, F7, F7, F7, F7, F4, F4, F4, F6, F3, F4, F4
|
---|
| 585 | +;B5_MIMO_TX_GAIN_DIFF = 04, 01, 01, 01, 20, 20, 20, 23, 24, 22, 24, 22, 04, 01, 01, 01, 20, 20, 20, 23, 24, 22, 24, 22
|
---|
| 586 | +B5_RX_LIMIT_DELTA_GAIN = 0B, 12, 08, 12, 08, 12, 03, 0E, FC, 0B, FC, 09, FA, 09, F9, 06, F7, 04, F6, 03, F5, 00, 0B, 12, 08, 12, 08, 12, 03, 0E, FC, 0B, FC, 09, FA, 09, F9, 06, F7, 04, F6, 03, F5, 00
|
---|
| 587 | +B5_RX_NORMAL_DELTA_GAIN = 0E, 0D, 11, 0D, 0F, 1A, 18, 05, 05, 0C, 0F, 0E, 11, 10, FA, FA, 02, 09, 07, 04, 04, 0E, 0D, 11, 0D, 0F, 1A, 18, 05, 05, 0C, 0F, 0E, 11, 10, FA, FA, 02, 09, 07, 04, 04
|
---|
| 588 | +;B5_MIMO_RX_GAIN_DIFF = 0B, 12, 08, 12, 08, 12, 03, 0E, FC, 0B, FC, 09, FA, 09, F9, 06, F7, 04, F6, 03, F5, 00, 20, 20, 23, 24, 22, 0B, 12, 08, 12, 08, 12, 03, 0E, FC, 0B, FC, 09, FA, 09, F9, 06, F7, 04, F6, 03, F5, 00, 20, 20, 23, 24, 22
|
---|
| 589 | +RSV1 = 00, 00, 00,00,00
|
---|
| 590 | +;------------------------------------------------------------------------------
|
---|
| 591 | +
|
---|
.. | .. |
---|
| 1 | +324299e2905e6dcc7efdf845a0b9c74d RAM_RW_KERNEL_DRAM.bin |
---|
| 2 | +bfcf9d462a2082e9b75d1495a869b8b1 ROM_EXEC_KERNEL_IRAM.bin |
---|
.. | .. |
---|
| 1 | +;******************************************************************************
|
---|
| 2 | +; Wifi Limit Setup file
|
---|
| 3 | +;******************************************************************************
|
---|
| 4 | +[VERSION]
|
---|
| 5 | +WT_VERSION = EA6521QF_20230728
|
---|
| 6 | +;优化TX EVM
|
---|
| 7 | +;-----------------------------------------------------------------------------
|
---|
| 8 | +[CAL_POWER_INFO]
|
---|
| 9 | +;-----------------------------------------------------------------------------
|
---|
| 10 | +;设置浮点数,工具会自动做浮点转定点数的处理txpower,s(8,2)
|
---|
| 11 | +;发送给DUT之后,DUT会进行 <<Qnum 的操作,这里的数据不要提前移位 赋值的数值必须是10进制,与DUT侧对应
|
---|
| 12 | +;注释:11b rate 1M,2M,5.5M,11M
|
---|
| 13 | +G_TXPWR11B_UQ2 = 17, 17, 17, 17
|
---|
| 14 | +;注释:non-ht 2g cbw40 rate 6M/9M,12M,18M,24M,36M,48M,54M
|
---|
| 15 | +G_TXPWRNONHTDUP2G_UQ2 = 17, 17, 17, 17, 17, 17, 17, 15
|
---|
| 16 | +;注释:non-ht 5g cbw40 rate 6M,9M,12M,18M,24M,36M,48M,54M; cbw80 rate 6M,9M,12M,18M,24M,36M,48M,54M
|
---|
| 17 | +G_TXPWRNONHTDUP5G_UQ2 = 16, 16, 16, 16, 16, 16, 16, 15, 16, 16, 16, 16, 16, 16, 16, 15
|
---|
| 18 | +;注释:non-ht/ht/vht/he cbw20 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 19 | +;ht/vht/he cbw40 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 20 | +G_TXPWRMCS2G_UQ2 = 17, 17, 17, 17, 17, 17, 17, 15, 15, 14, 14, 13, 13, 17, 17, 17, 17, 17, 17, 17, 15, 15, 13, 13, 12, 12
|
---|
| 21 | +;写注释non-ht/ht/vht/he cbw20 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 22 | +;ht/vht/he cbw40 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 23 | +;ht/vht/he cbw80 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 24 | +G_TXPWRMCS5G_UQ2 = 16, 16, 16, 16, 16, 16, 16, 15, 14, 13, 13, 12, 12, 16, 16, 16, 16, 16, 16, 16, 15, 14, 13, 12, 12, 12, 15, 15, 15, 15, 15, 15, 15, 14, 13, 13, 11, 11, 11
|
---|
| 25 | +;写注释he TB SMALL RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 26 | +;he TB BIG RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 27 | +;he TB BIG RU BIG POWER rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 28 | +TBMAXTXPWR5G_UQ3 = 16, 16, 16, 16, 16, 16, 16, 15, 14, 13, 13, 12, 12, 16, 16, 16, 16, 16, 16, 16, 15, 14, 13, 13, 12, 12, 16, 16, 16, 16, 16, 16, 16, 15, 14, 13, 13, 12, 12
|
---|
| 29 | +;写注释he TB SMALL RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 30 | +;he TB BIG RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 31 | +;he TB BIG RU BIG POWER rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 32 | +TBMAXTXPWR2G_UQ3 = 17, 17, 17, 17, 17, 17, 17, 15, 15, 14, 14, 13, 13, 17, 17, 17, 17, 17, 17, 17, 15, 15, 14, 14, 13, 13, 17, 17, 17, 17, 17, 17, 17, 15, 15, 14, 14, 13, 13
|
---|
| 33 | +;写注释 5G,2G MIN TX POWER
|
---|
| 34 | +TBMINTXPWR_SQ2 = 00, 00
|
---|
| 35 | +
|
---|
| 36 | +;注释:11b rate 1M,2M,5.5M,11M
|
---|
| 37 | +G_TXPWR11B_UQ2_DELTA = 00, 00, 00, 00
|
---|
| 38 | +;注释:non-ht 2g cbw40 rate 6M/9M,12M,18M,24M,36M,48M,54M
|
---|
| 39 | +G_TXPWRNONHTDUP2G_UQ2_DELTA = 00, 00, 00, 00, 00, 00, 00, 00
|
---|
| 40 | +;注释:non-ht 5g cbw40 rate 6M,9M,12M,18M,24M,36M,48M,54M; cbw80 rate 6M,9M,12M,18M,24M,36M,48M,54M
|
---|
| 41 | +G_TXPWRNONHTDUP5G_UQ2_DELTA = 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00
|
---|
| 42 | +;注释:non-ht/ht/vht/he cbw20 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 43 | +;ht/vht/he cbw40 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 44 | +G_TXPWRMCS2G_UQ2_DELTA = 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00
|
---|
| 45 | +;写注释non-ht/ht/vht/he cbw20 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 46 | +;ht/vht/he cbw40 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 47 | +;ht/vht/he cbw80 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 48 | +G_TXPWRMCS5G_UQ2_DELTA = 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00
|
---|
| 49 | +;写注释he TB SMALL RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 50 | +;he TB BIG RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 51 | +;he TB BIG RU BIG POWER rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 52 | +TBMAXTXPWR5G_UQ3_DELTA = 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00
|
---|
| 53 | +;写注释he TB SMALL RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 54 | +;he TB BIG RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 55 | +;he TB BIG RU BIG POWER rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 56 | +TBMAXTXPWR2G_UQ3_DELTA = 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00
|
---|
| 57 | +;写注释 5G,2G MIN TX POWER
|
---|
| 58 | +TBMINTXPWR_SQ2_DELTA = 00, 00
|
---|
| 59 | +;-----------------------------------------------------------------------------
|
---|
| 60 | +[CHAN_POWER_COMPINFO]
|
---|
| 61 | +;-----------------------------------------------------------------------------
|
---|
| 62 | +;设置浮点数,工具会自动做浮点转定点数的处理。按频点补偿txpower,s(8,2),正数表示加功率,负数表示减功率
|
---|
| 63 | +;cbw20,2g 14个channel 1,2,3,4,5,6,7,8,9,10,11,12,13,14
|
---|
| 64 | +G_COMPCHANTXPWR2G_CBW20_SQ2 = 0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
---|
| 65 | +;cbw40,2g 9个channel 3,4,5,6,7,8,9,10,11
|
---|
| 66 | +G_COMPCHANTXPWR2G_CBW40_SQ2 = 0,0,0,0,0,0,0,0,0
|
---|
| 67 | +;cbw20,5g low band 8个channel 36,40,44,48,52,56,60,64
|
---|
| 68 | +G_COMPCHANTXPWR5G_LOW_CBW20_SQ2 = 0,0,0,0,0,0,0,0
|
---|
| 69 | +;cbw20,5g mid band 12个 channel 100,104,108,112,116,120,124,128,132,136,140,144
|
---|
| 70 | +G_COMPCHANTXPWR5G_MID_CBW20_SQ2 = 0,0,0,0,0,0,0,0,0,0,0,0
|
---|
| 71 | +;cbw20,5g high band 8个 channel 149,153,157,161,165,169,173,177
|
---|
| 72 | +G_COMPCHANTXPWR5G_HIGH_CBW20_SQ2 = 0,0,0,0,0,0,0,0
|
---|
| 73 | +;cbw40,5g low band 4个channel 38,46,54,62
|
---|
| 74 | +G_COMPCHANTXPWR5G_LOW_CBW40_SQ2 = 0,0,0,0
|
---|
| 75 | +;cbw40,5g mid band 6个 channel 102,110,118,126,134,142
|
---|
| 76 | +G_COMPCHANTXPWR5G_MID_CBW40_SQ2 = 0,0,0,0,0,0
|
---|
| 77 | +;cbw40,5g high band 4个 channel 151,159,167,175
|
---|
| 78 | +G_COMPCHANTXPWR5G_HIGH_CBW40_SQ2 = 0,0,0,0
|
---|
| 79 | +;cbw80,5g low band 2个 channel 42,58
|
---|
| 80 | +G_COMPCHANTXPWR5G_LOW_CBW80_SQ2 = 0,0
|
---|
| 81 | +;cbw80,5g mid band 3个 channel 106,122,138
|
---|
| 82 | +G_COMPCHANTXPWR5G_MID_CBW80_SQ2 = 0,0,0
|
---|
| 83 | +;cbw80,5g high band 2个 channel 155,171
|
---|
| 84 | +G_COMPCHANTXPWR5G_HIGH_CBW80_SQ2 = 0,0
|
---|
| 85 | +
|
---|
| 86 | +;-----------------------------------------------------------------------------
|
---|
| 87 | +[RegAddr1]
|
---|
| 88 | +;-----------------------------------------------------------------------------
|
---|
| 89 | +;寄存器配置,RegAddr是寄存器地址,每个信道对应一个寄存器值
|
---|
| 90 | +;RegAddr1,start_bit, stop_bit = 0x401420C0,4,0
|
---|
| 91 | +RegAddr_Config = 0x401420C0,4,0
|
---|
| 92 | +;cbw20 2g 3个channel 3,7,11
|
---|
| 93 | +RegAddr_2G_CBW20 = 11,11,11
|
---|
| 94 | +;cbw40 2g 3个channel 3,7,11
|
---|
| 95 | +RegAddr_2G_CBW40 = 11,11,11
|
---|
| 96 | +;cbw20,5g low band 8个channel 36,40,44,48,52,56,60,64
|
---|
| 97 | +RegAddr_5G_LOW_CBW20 = 20, 20, 20, 19, 19, 19, 17, 17
|
---|
| 98 | +;cbw20,5g mid band 12个 channel 100,104,108,112,116,120,124,128,132,136,140,144
|
---|
| 99 | +RegAddr_5G_MID_CBW20 = 13, 13, 13, 13, 13, 13, 13, 13, 11, 11, 10, 10
|
---|
| 100 | +;cbw20,5g high band 8个 channel 149,153,157,161,165,169,173,177
|
---|
| 101 | +RegAddr_5G_HIGH_CBW20 = 10, 10, 10, 10, 10, 10, 10, 10
|
---|
| 102 | +;cbw40,5g low band 4个channel 38,46,54,62
|
---|
| 103 | +RegAddr_5G_LOW_CBW40 = 20, 19, 19, 17
|
---|
| 104 | +;cbw40,5g mid band 6个 channel 102,110,118,126,134,142
|
---|
| 105 | +RegAddr_5G_MID_CBW40 = 13, 13, 13, 13, 11, 10
|
---|
| 106 | +;cbw40,5g high band 4个 channel 151,159,167,175
|
---|
| 107 | +RegAddr_5G_HIGH_CBW40 = 10, 10, 10, 10
|
---|
| 108 | +;cbw80,5g low band 2个 channel 42,58
|
---|
| 109 | +RegAddr_5G_LOW_CBW80 = 20, 19
|
---|
| 110 | +;cbw80,5g mid band 3个 channel 106,122,138
|
---|
| 111 | +RegAddr_5G_MID_CBW80 = 13, 13, 10
|
---|
| 112 | +;cbw80,5g high band 2个 channel 155,171
|
---|
| 113 | +RegAddr_5G_HIGH_CBW80 = 10, 10
|
---|
| 114 | +
|
---|
| 115 | +;------------------------------------------------------------------------------
|
---|
| 116 | +[RegAddr2]
|
---|
| 117 | +;-----------------------------------------------------------------------------
|
---|
| 118 | +;RegAddr2,start_bit, stop_bit = 0x40142080,4,1
|
---|
| 119 | +RegAddr_Config = 0x40142080,4,1
|
---|
| 120 | +;cbw20 2g 3个channel 3,7,11
|
---|
| 121 | +RegAddr_2G_CBW20 = 7, 7, 7
|
---|
| 122 | +;cbw40 2g 3个channel 3,7,11
|
---|
| 123 | +RegAddr_2G_CBW40 = 7, 7, 7
|
---|
| 124 | +;cbw20,5g low band 8个channel 36,40,44,48,52,56,60,64
|
---|
| 125 | +RegAddr_5G_LOW_CBW20 = 6, 6, 6, 5, 5, 5, 6, 6
|
---|
| 126 | +;cbw20,5g mid band 12个 channel 100,104,108,112,116,120,124,128,132,136,140,144
|
---|
| 127 | +RegAddr_5G_MID_CBW20 = 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6
|
---|
| 128 | +;cbw20,5g high band 8个 channel 149,153,157,161,165,169,173,177
|
---|
| 129 | +RegAddr_5G_HIGH_CBW20 = 6, 6, 8, 8, 4, 4, 4, 4
|
---|
| 130 | +;cbw40,5g low band 4个channel 38,46,54,62
|
---|
| 131 | +RegAddr_5G_LOW_CBW40 = 6, 5, 5, 6
|
---|
| 132 | +;cbw40,5g mid band 6个 channel 102,110,118,126,134,142
|
---|
| 133 | +RegAddr_5G_MID_CBW40 = 5, 5, 5, 5, 6, 6
|
---|
| 134 | +;cbw40,5g high band 4个 channel 151,159,167,175
|
---|
| 135 | +RegAddr_5G_HIGH_CBW40 = 6, 8, 4, 4
|
---|
| 136 | +;cbw80,5g low band 2个 channel 42,58
|
---|
| 137 | +RegAddr_5G_LOW_CBW80 = 6, 5
|
---|
| 138 | +;cbw80,5g mid band 3个 channel 106,122,138
|
---|
| 139 | +RegAddr_5G_MID_CBW80 = 5, 5, 6
|
---|
| 140 | +;cbw80,5g high band 2个 channel 155,171
|
---|
| 141 | +RegAddr_5G_HIGH_CBW80 = 8, 4
|
---|
| 142 | +
|
---|
| 143 | +;------------------------------------------------------------------------------
|
---|
| 144 | +[RegAddr3]
|
---|
| 145 | +;-----------------------------------------------------------------------------
|
---|
| 146 | +;RegAddr3,start_bit, stop_bit = 0x40142080,16,12
|
---|
| 147 | +RegAddr_Config = 0x40142080,16,12
|
---|
| 148 | +;cbw20 2g 3个channel 3,7,11
|
---|
| 149 | +RegAddr_2G_CBW20 = 4, 4, 4
|
---|
| 150 | +;cbw40 2g 3个channel 3,7,11
|
---|
| 151 | +RegAddr_2G_CBW40 = 4, 4, 4
|
---|
| 152 | +;cbw20,5g low band 8个channel 36,40,44,48,52,56,60,64
|
---|
| 153 | +RegAddr_5G_LOW_CBW20 = 4, 4, 4, 4, 4, 4, 4, 4
|
---|
| 154 | +;cbw20,5g mid band 12个 channel 100,104,108,112,116,120,124,128,132,136,140,144
|
---|
| 155 | +RegAddr_5G_MID_CBW20 = 8, 8, 6, 6, 6, 6, 6, 6, 8, 8, 4, 4
|
---|
| 156 | +;cbw20,5g high band 8个 channel 149,153,157,161,165,169,173,177
|
---|
| 157 | +RegAddr_5G_HIGH_CBW20 = 7, 7, 4, 4, 6, 6, 6, 6
|
---|
| 158 | +;cbw40,5g low band 4个channel 38,46,54,62
|
---|
| 159 | +RegAddr_5G_LOW_CBW40 = 4, 4, 4, 4
|
---|
| 160 | +;cbw40,5g mid band 6个 channel 102,110,118,126,134,142
|
---|
| 161 | +RegAddr_5G_MID_CBW40 = 8, 6, 6, 6, 8, 4
|
---|
| 162 | +;cbw40,5g high band 4个 channel 151,159,167,175
|
---|
| 163 | +RegAddr_5G_HIGH_CBW40 = 7, 4, 6, 6
|
---|
| 164 | +;cbw80,5g low band 2个 channel 42,58
|
---|
| 165 | +RegAddr_5G_LOW_CBW80 = 4, 4
|
---|
| 166 | +;cbw80,5g mid band 3个 channel 106,122,138
|
---|
| 167 | +RegAddr_5G_MID_CBW80 = 8, 6, 4
|
---|
| 168 | +;cbw80,5g high band 2个 channel 155,171
|
---|
| 169 | +RegAddr_5G_HIGH_CBW80 = 4, 6
|
---|
| 170 | +;------------------------------------------------------------------------------
|
---|
| 171 | +
|
---|
| 172 | +
|
---|
| 173 | +;------------------------------------------------------------------------------
|
---|
| 174 | +
|
---|
| 175 | +
|
---|
| 176 | +
|
---|
| 177 | +
|
---|
| 178 | +
|
---|
| 179 | +
|
---|
| 180 | +
|
---|
| 181 | +
|
---|
.. | .. |
---|
| 1 | +;******************************************************************************
|
---|
| 2 | +; Wifi Limit Setup file
|
---|
| 3 | +;******************************************************************************
|
---|
| 4 | +[VERSION]
|
---|
| 5 | +WT_VERSION = EA6521QT_20230728
|
---|
| 6 | +;增加2.4G PA寄存器优化兼容配置
|
---|
| 7 | +;-----------------------------------------------------------------------------
|
---|
| 8 | +[CAL_POWER_INFO]
|
---|
| 9 | +;-----------------------------------------------------------------------------
|
---|
| 10 | +;设置浮点数,工具会自动做浮点转定点数的处理txpower,s(8,2)
|
---|
| 11 | +;发送给DUT之后,DUT会进行 <<Qnum 的操作,这里的数据不要提前移位 赋值的数值必须是10进制,与DUT侧对应
|
---|
| 12 | +;注释:11b rate 1M,2M,5.5M,11M
|
---|
| 13 | +G_TXPWR11B_UQ2 = 17, 17, 17, 17
|
---|
| 14 | +;注释:non-ht 2g cbw40 rate 6M/9M,12M,18M,24M,36M,48M,54M
|
---|
| 15 | +G_TXPWRNONHTDUP2G_UQ2 = 17, 17, 17, 17, 17, 17, 17, 15
|
---|
| 16 | +;注释:non-ht 5g cbw40 rate 6M,9M,12M,18M,24M,36M,48M,54M; cbw80 rate 6M,9M,12M,18M,24M,36M,48M,54M
|
---|
| 17 | +G_TXPWRNONHTDUP5G_UQ2 = 16, 16, 16, 16, 16, 16, 16, 15, 16, 16, 16, 16, 16, 16, 16, 15
|
---|
| 18 | +;注释:non-ht/ht/vht/he cbw20 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 19 | +;ht/vht/he cbw40 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 20 | +G_TXPWRMCS2G_UQ2 = 17, 17, 17, 17, 17, 17, 17, 15, 15, 14, 14, 13, 13, 17, 17, 17, 17, 17, 17, 17, 15, 15, 13, 13, 12, 12
|
---|
| 21 | +;写注释non-ht/ht/vht/he cbw20 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 22 | +;ht/vht/he cbw40 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 23 | +;ht/vht/he cbw80 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 24 | +G_TXPWRMCS5G_UQ2 = 16, 16, 16, 16, 16, 16, 16, 15, 14, 13, 13, 12, 12, 16, 16, 16, 16, 16, 16, 16, 15, 14, 13, 12, 12, 12, 15, 15, 15, 15, 15, 15, 15, 14, 13, 13, 11, 11, 11
|
---|
| 25 | +;写注释he TB SMALL RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 26 | +;he TB BIG RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 27 | +;he TB BIG RU BIG POWER rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 28 | +TBMAXTXPWR5G_UQ3 = 16, 16, 16, 16, 16, 16, 16, 15, 14, 13, 13, 12, 12, 16, 16, 16, 16, 16, 16, 16, 15, 14, 13, 13, 12, 12, 16, 16, 16, 16, 16, 16, 16, 15, 14, 13, 13, 12, 12
|
---|
| 29 | +;写注释he TB SMALL RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 30 | +;he TB BIG RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 31 | +;he TB BIG RU BIG POWER rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 32 | +TBMAXTXPWR2G_UQ3 = 17, 17, 17, 17, 17, 17, 17, 15, 15, 14, 14, 13, 13, 17, 17, 17, 17, 17, 17, 17, 15, 15, 14, 14, 13, 13, 17, 17, 17, 17, 17, 17, 17, 15, 15, 14, 14, 13, 13
|
---|
| 33 | +;写注释 5G,2G MIN TX POWER
|
---|
| 34 | +TBMINTXPWR_SQ2 = 00, 00
|
---|
| 35 | +
|
---|
| 36 | +;注释:11b rate 1M,2M,5.5M,11M
|
---|
| 37 | +G_TXPWR11B_UQ2_DELTA = 5.5, 5.5, 5.5, 4
|
---|
| 38 | +;注释:non-ht 2g cbw40 rate 6M/9M,12M,18M,24M,36M,48M,54M
|
---|
| 39 | +G_TXPWRNONHTDUP2G_UQ2_DELTA = 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5
|
---|
| 40 | +;注释:non-ht 5g cbw40 rate 6M,9M,12M,18M,24M,36M,48M,54M; cbw80 rate 6M,9M,12M,18M,24M,36M,48M,54M
|
---|
| 41 | +G_TXPWRNONHTDUP5G_UQ2_DELTA = 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00
|
---|
| 42 | +;注释:non-ht/ht/vht/he cbw20 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 43 | +;ht/vht/he cbw40 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 44 | +G_TXPWRMCS2G_UQ2_DELTA = 4.5, 5.5, 4.5, 4.5, 4.5, 4.5, 5, 4.5, 5.5, 5, 5, 4.5, 5.3, 4.5, 5.5, 4.5, 4.5, 4.5, 4.5, 5, 5, 5.5, 4.5, 5.5, 4.5, 5.5
|
---|
| 45 | +;写注释non-ht/ht/vht/he cbw20 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 46 | +;ht/vht/he cbw40 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 47 | +;ht/vht/he cbw80 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 48 | +G_TXPWRMCS5G_UQ2_DELTA = 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00
|
---|
| 49 | +;写注释he TB SMALL RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 50 | +;he TB BIG RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 51 | +;he TB BIG RU BIG POWER rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 52 | +TBMAXTXPWR5G_UQ3_DELTA = 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00
|
---|
| 53 | +;写注释he TB SMALL RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 54 | +;he TB BIG RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 55 | +;he TB BIG RU BIG POWER rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 56 | +TBMAXTXPWR2G_UQ3_DELTA = 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5
|
---|
| 57 | +;写注释 5G,2G MIN TX POWER
|
---|
| 58 | +TBMINTXPWR_SQ2_DELTA = 4.5, 4.5
|
---|
| 59 | +;-----------------------------------------------------------------------------
|
---|
| 60 | +[CHAN_POWER_COMPINFO]
|
---|
| 61 | +;-----------------------------------------------------------------------------
|
---|
| 62 | +;设置浮点数,工具会自动做浮点转定点数的处理。按频点补偿txpower,s(8,2),正数表示加功率,负数表示减功率
|
---|
| 63 | +;cbw20,2g 14个channel 1,2,3,4,5,6,7,8,9,10,11,12,13,14
|
---|
| 64 | +G_COMPCHANTXPWR2G_CBW20_SQ2 = 0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
---|
| 65 | +;cbw40,2g 9个channel 3,4,5,6,7,8,9,10,11
|
---|
| 66 | +G_COMPCHANTXPWR2G_CBW40_SQ2 = 0,0,0,0,0,0,0,0,0
|
---|
| 67 | +;cbw20,5g low band 8个channel 36,40,44,48,52,56,60,64
|
---|
| 68 | +G_COMPCHANTXPWR5G_LOW_CBW20_SQ2 = 0,0,0,0,0,0,0,0
|
---|
| 69 | +;cbw20,5g mid band 12个 channel 100,104,108,112,116,120,124,128,132,136,140,144
|
---|
| 70 | +G_COMPCHANTXPWR5G_MID_CBW20_SQ2 = 0,0,0,0,0,0,0,0,0,0,0,0
|
---|
| 71 | +;cbw20,5g high band 8个 channel 149,153,157,161,165,169,173,177
|
---|
| 72 | +G_COMPCHANTXPWR5G_HIGH_CBW20_SQ2 = 0,0,0,0,0,0,0,0
|
---|
| 73 | +;cbw40,5g low band 4个channel 38,46,54,62
|
---|
| 74 | +G_COMPCHANTXPWR5G_LOW_CBW40_SQ2 = 0,0,0,0
|
---|
| 75 | +;cbw40,5g mid band 6个 channel 102,110,118,126,134,142
|
---|
| 76 | +G_COMPCHANTXPWR5G_MID_CBW40_SQ2 = 0,0,0,0,0,0
|
---|
| 77 | +;cbw40,5g high band 4个 channel 151,159,167,175
|
---|
| 78 | +G_COMPCHANTXPWR5G_HIGH_CBW40_SQ2 = 0,0,0,0
|
---|
| 79 | +;cbw80,5g low band 2个 channel 42,58
|
---|
| 80 | +G_COMPCHANTXPWR5G_LOW_CBW80_SQ2 = 0,0
|
---|
| 81 | +;cbw80,5g mid band 3个 channel 106,122,138
|
---|
| 82 | +G_COMPCHANTXPWR5G_MID_CBW80_SQ2 = 0,0,0
|
---|
| 83 | +;cbw80,5g high band 2个 channel 155,171
|
---|
| 84 | +G_COMPCHANTXPWR5G_HIGH_CBW80_SQ2 = 0,0
|
---|
| 85 | +
|
---|
| 86 | +;-----------------------------------------------------------------------------
|
---|
| 87 | +[RegAddr1]
|
---|
| 88 | +;-----------------------------------------------------------------------------
|
---|
| 89 | +;寄存器配置,RegAddr是寄存器地址,每个信道对应一个寄存器值
|
---|
| 90 | +;RegAddr1,start_bit, stop_bit= 0x401420C0,4,0(5G RegAddr)
|
---|
| 91 | +RegAddr_Config = 0x401420C0,4,0
|
---|
| 92 | +;cbw20/cbw40 2g 3个channel 3,7,11
|
---|
| 93 | +;RegAddr1,start_bit, stop_bit= 0x401420C8,3,0(2G RegAddr)
|
---|
| 94 | +RegAddr_2G_CBW20 = 14,14,15
|
---|
| 95 | +;标志位,RegAddr_2G_CBW40 = version, reserved, reserved
|
---|
| 96 | +;version = 11:2G采用缺省配置; version = 20: 2G采用配置文件定义值
|
---|
| 97 | +RegAddr_2G_CBW40 = 20,11,11
|
---|
| 98 | +;cbw20,5g low band 8个channel 36, 40, 44, 48, 52, 56, 60, 64
|
---|
| 99 | +RegAddr_5G_LOW_CBW20 = 23, 24, 21, 21, 24, 22, 22, 20
|
---|
| 100 | +;cbw20,5g mid band 12个 channel 100,104,108,112,116,120,124,128,132,136,140,144
|
---|
| 101 | +RegAddr_5G_MID_CBW20 = 11, 13, 11, 13, 13, 13, 15, 15, 13, 13, 12, 12
|
---|
| 102 | +;cbw20,5g high band 8个 channel 149,153,157,161,165,169,173,177
|
---|
| 103 | +RegAddr_5G_HIGH_CBW20 = 12, 14, 12, 12, 11, 11, 11, 11
|
---|
| 104 | +;cbw40,5g low band 4个channel 38,46,54,62
|
---|
| 105 | +RegAddr_5G_LOW_CBW40 = 20, 17, 19, 17
|
---|
| 106 | +;cbw40,5g mid band 6个 channel 102,110,118,126,134,142
|
---|
| 107 | +RegAddr_5G_MID_CBW40 = 13, 11, 13, 14, 13, 12
|
---|
| 108 | +;cbw40,5g high band 4个 channel 151,159,167,175
|
---|
| 109 | +RegAddr_5G_HIGH_CBW40 = 13, 13, 10, 10
|
---|
| 110 | +;cbw80,5g low band 2个 channel 42,58
|
---|
| 111 | +RegAddr_5G_LOW_CBW80 = 19, 19
|
---|
| 112 | +;cbw80,5g mid band 3个 channel 106,122,138
|
---|
| 113 | +RegAddr_5G_MID_CBW80 = 11, 14, 11
|
---|
| 114 | +;cbw80,5g high band 2个 channel 155,171
|
---|
| 115 | +RegAddr_5G_HIGH_CBW80 = 12, 10
|
---|
| 116 | +
|
---|
| 117 | +;------------------------------------------------------------------------------
|
---|
| 118 | +[RegAddr2]
|
---|
| 119 | +;-----------------------------------------------------------------------------
|
---|
| 120 | +;RegAddr2,start_bit, stop_bit (5G RegAddr)
|
---|
| 121 | +RegAddr_Config = 0x40142080,4,1
|
---|
| 122 | +;cbw20/cbw40 2g 3个channel 3,7,11, RegAddr = 0x401420A8,4,1
|
---|
| 123 | +RegAddr_2G_CBW20 = 9, 9, 9
|
---|
| 124 | +;cbw40/cbw40 2g 3个channel 3,7,11, RegAddr = 0x401420AC,4,1
|
---|
| 125 | +RegAddr_2G_CBW40 = 9, 9, 9
|
---|
| 126 | +;cbw20,5g low band 8个channel 36,40,44,48,52,56,60,64
|
---|
| 127 | +RegAddr_5G_LOW_CBW20 = 6, 6, 6, 5, 5, 5, 6, 6
|
---|
| 128 | +;cbw20,5g mid band 12个 channel 100,104,108,112,116,120,124,128,132,136,140,144
|
---|
| 129 | +RegAddr_5G_MID_CBW20 = 7, 7, 7, 10, 10, 10, 10, 10, 8, 8, 8, 8
|
---|
| 130 | +;cbw20,5g high band 8个 channel 149,153,157,161,165,169,173,177
|
---|
| 131 | +RegAddr_5G_HIGH_CBW20 = 12, 12, 12, 12, 10, 10, 10, 10
|
---|
| 132 | +;cbw40,5g low band 4个channel 38,46,54,62
|
---|
| 133 | +RegAddr_5G_LOW_CBW40 = 6, 5, 5, 6
|
---|
| 134 | +;cbw40,5g mid band 6个 channel 102,110,118,126,134,142
|
---|
| 135 | +RegAddr_5G_MID_CBW40 = 7, 5, 5, 10, 8, 8
|
---|
| 136 | +;cbw40,5g high band 4个 channel 151,159,167,175
|
---|
| 137 | +RegAddr_5G_HIGH_CBW40 = 8, 8, 4, 4
|
---|
| 138 | +;cbw80,5g low band 2个 channel 42,58
|
---|
| 139 | +RegAddr_5G_LOW_CBW80 = 6, 5
|
---|
| 140 | +;cbw80,5g mid band 3个 channel 106,122,138
|
---|
| 141 | +RegAddr_5G_MID_CBW80 = 8, 10, 8
|
---|
| 142 | +;cbw80,5g high band 2个 channel 155,171
|
---|
| 143 | +RegAddr_5G_HIGH_CBW80 = 9, 4
|
---|
| 144 | +
|
---|
| 145 | +;------------------------------------------------------------------------------
|
---|
| 146 | +[RegAddr3]
|
---|
| 147 | +;-----------------------------------------------------------------------------
|
---|
| 148 | +;RegAddr3,start_bit, stop_bit (5G RegAddr)
|
---|
| 149 | +RegAddr_Config = 0x40142080,16,12
|
---|
| 150 | +;cbw20/cbw40 2g 3个channel 3,7,11, RegAddr = 0x401420A8,16,12
|
---|
| 151 | +RegAddr_2G_CBW20 = 18, 18, 18
|
---|
| 152 | +;cbw20/cbw40 2g 3个channel 3,7,11, RegAddr = 0x401420AC,16,12
|
---|
| 153 | +RegAddr_2G_CBW40 = 18, 18, 18
|
---|
| 154 | +;cbw20,5g low band 8个channel 36,40,44,48,52,56,60,64
|
---|
| 155 | +RegAddr_5G_LOW_CBW20 = 4, 4, 4, 4, 4, 4, 4, 4
|
---|
| 156 | +;cbw20,5g mid band 12个 channel 100,104,108,112,116,120,124,128,132,136,140,144
|
---|
| 157 | +RegAddr_5G_MID_CBW20 = 8, 8, 12, 10, 10, 10, 12, 12, 13, 13, 10, 10
|
---|
| 158 | +;cbw20,5g high band 8个 channel 149,153,157,161,165,169,173,177
|
---|
| 159 | +RegAddr_5G_HIGH_CBW20 = 16, 16, 12, 12, 12, 12, 12, 12
|
---|
| 160 | +;cbw40,5g low band 4个channel 38,46,54,62
|
---|
| 161 | +RegAddr_5G_LOW_CBW40 = 4, 4, 4, 4
|
---|
| 162 | +;cbw40,5g mid band 6个 channel 102,110,118,126,134,142
|
---|
| 163 | +RegAddr_5G_MID_CBW40 = 10, 10, 6, 13, 10, 10
|
---|
| 164 | +;cbw40,5g high band 4个 channel 151,159,167,175
|
---|
| 165 | +RegAddr_5G_HIGH_CBW40 = 11, 11, 6, 6
|
---|
| 166 | +;cbw80,5g low band 2个 channel 42,58
|
---|
| 167 | +RegAddr_5G_LOW_CBW80 = 4, 4
|
---|
| 168 | +;cbw80,5g mid band 3个 channel 106,122,138
|
---|
| 169 | +RegAddr_5G_MID_CBW80 = 10, 12, 12
|
---|
| 170 | +;cbw80,5g high band 2个 channel 155,171
|
---|
| 171 | +RegAddr_5G_HIGH_CBW80 = 13, 6
|
---|
| 172 | +;------------------------------------------------------------------------------
|
---|
| 173 | +
|
---|
| 174 | +
|
---|
| 175 | +;------------------------------------------------------------------------------
|
---|
| 176 | +
|
---|
| 177 | +
|
---|
| 178 | +
|
---|
| 179 | +
|
---|
| 180 | +
|
---|
| 181 | +
|
---|
| 182 | +
|
---|
| 183 | +
|
---|
.. | .. |
---|
| 1 | +;******************************************************************************
|
---|
| 2 | +; Wifi Limit Setup file
|
---|
| 3 | +;******************************************************************************
|
---|
| 4 | +[VERSION]
|
---|
| 5 | +WT_VERSION = EA6621QT_20230728
|
---|
| 6 | +;增加2.4G PA寄存器优化兼容配置
|
---|
| 7 | +;-----------------------------------------------------------------------------
|
---|
| 8 | +[CAL_POWER_INFO]
|
---|
| 9 | +;-----------------------------------------------------------------------------
|
---|
| 10 | +;设置浮点数,工具会自动做浮点转定点数的处理txpower,s(8,2)
|
---|
| 11 | +;发送给DUT之后,DUT会进行 <<Qnum 的操作,这里的数据不要提前移位 赋值的数值必须是10进制,与DUT侧对应
|
---|
| 12 | +;注释:11b rate 1M,2M,5.5M,11M
|
---|
| 13 | +G_TXPWR11B_UQ2 = 17, 17, 17, 17
|
---|
| 14 | +;注释:non-ht 2g cbw40 rate 6M/9M,12M,18M,24M,36M,48M,54M
|
---|
| 15 | +G_TXPWRNONHTDUP2G_UQ2 = 17, 17, 17, 17, 17, 17, 17, 15
|
---|
| 16 | +;注释:non-ht 5g cbw40 rate 6M,9M,12M,18M,24M,36M,48M,54M; cbw80 rate 6M,9M,12M,18M,24M,36M,48M,54M
|
---|
| 17 | +G_TXPWRNONHTDUP5G_UQ2 = 16, 16, 16, 16, 16, 16, 16, 15, 16, 16, 16, 16, 16, 16, 16, 15
|
---|
| 18 | +;注释:non-ht/ht/vht/he cbw20 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 19 | +;ht/vht/he cbw40 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 20 | +G_TXPWRMCS2G_UQ2 = 17, 17, 17, 17, 17, 17, 17, 15, 15, 14, 14, 13, 13, 17, 17, 17, 17, 17, 17, 17, 15, 15, 13, 13, 12, 12
|
---|
| 21 | +;写注释non-ht/ht/vht/he cbw20 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 22 | +;ht/vht/he cbw40 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 23 | +;ht/vht/he cbw80 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 24 | +G_TXPWRMCS5G_UQ2 = 16, 16, 16, 16, 16, 16, 16, 15, 14, 13, 13, 12, 12, 16, 16, 16, 16, 16, 16, 16, 15, 14, 13, 12, 12, 12, 15, 15, 15, 15, 15, 15, 15, 14, 13, 13, 11, 11, 11
|
---|
| 25 | +;写注释he TB SMALL RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 26 | +;he TB BIG RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 27 | +;he TB BIG RU BIG POWER rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 28 | +TBMAXTXPWR5G_UQ3 = 16, 16, 16, 16, 16, 16, 16, 15, 14, 13, 13, 12, 12, 16, 16, 16, 16, 16, 16, 16, 15, 14, 13, 13, 12, 12, 16, 16, 16, 16, 16, 16, 16, 15, 14, 13, 13, 12, 12
|
---|
| 29 | +;写注释he TB SMALL RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 30 | +;he TB BIG RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 31 | +;he TB BIG RU BIG POWER rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 32 | +TBMAXTXPWR2G_UQ3 = 17, 17, 17, 17, 17, 17, 17, 15, 15, 14, 14, 13, 13, 17, 17, 17, 17, 17, 17, 17, 15, 15, 14, 14, 13, 13, 17, 17, 17, 17, 17, 17, 17, 15, 15, 14, 14, 13, 13
|
---|
| 33 | +;写注释 5G,2G MIN TX POWER
|
---|
| 34 | +TBMINTXPWR_SQ2 = 00, 00
|
---|
| 35 | +
|
---|
| 36 | +;注释:11b rate 1M,2M,5.5M,11M
|
---|
| 37 | +G_TXPWR11B_UQ2_DELTA = 5.5, 5.5, 5.5, 4
|
---|
| 38 | +;注释:non-ht 2g cbw40 rate 6M/9M,12M,18M,24M,36M,48M,54M
|
---|
| 39 | +G_TXPWRNONHTDUP2G_UQ2_DELTA = 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5
|
---|
| 40 | +;注释:non-ht 5g cbw40 rate 6M,9M,12M,18M,24M,36M,48M,54M; cbw80 rate 6M,9M,12M,18M,24M,36M,48M,54M
|
---|
| 41 | +G_TXPWRNONHTDUP5G_UQ2_DELTA = 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00
|
---|
| 42 | +;注释:non-ht/ht/vht/he cbw20 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 43 | +;ht/vht/he cbw40 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 44 | +G_TXPWRMCS2G_UQ2_DELTA = 4.5, 5.5, 4.5, 4.5, 4.5, 4.5, 5, 4.5, 5.5, 5, 5, 4.5, 5.3, 4.5, 5.5, 4.5, 4.5, 4.5, 4.5, 5, 5, 5.5, 4.5, 5.5, 4.5, 5.5
|
---|
| 45 | +;写注释non-ht/ht/vht/he cbw20 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 46 | +;ht/vht/he cbw40 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 47 | +;ht/vht/he cbw80 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 48 | +G_TXPWRMCS5G_UQ2_DELTA = 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00
|
---|
| 49 | +;写注释he TB SMALL RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 50 | +;he TB BIG RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 51 | +;he TB BIG RU BIG POWER rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 52 | +TBMAXTXPWR5G_UQ3_DELTA = 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00
|
---|
| 53 | +;写注释he TB SMALL RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 54 | +;he TB BIG RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 55 | +;he TB BIG RU BIG POWER rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 56 | +TBMAXTXPWR2G_UQ3_DELTA = 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5
|
---|
| 57 | +;写注释 5G,2G MIN TX POWER
|
---|
| 58 | +TBMINTXPWR_SQ2_DELTA = 4.5, 4.5
|
---|
| 59 | +;-----------------------------------------------------------------------------
|
---|
| 60 | +[CHAN_POWER_COMPINFO]
|
---|
| 61 | +;-----------------------------------------------------------------------------
|
---|
| 62 | +;设置浮点数,工具会自动做浮点转定点数的处理。按频点补偿txpower,s(8,2),正数表示加功率,负数表示减功率
|
---|
| 63 | +;cbw20,2g 14个channel 1,2,3,4,5,6,7,8,9,10,11,12,13,14
|
---|
| 64 | +G_COMPCHANTXPWR2G_CBW20_SQ2 = 0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
---|
| 65 | +;cbw40,2g 9个channel 3,4,5,6,7,8,9,10,11
|
---|
| 66 | +G_COMPCHANTXPWR2G_CBW40_SQ2 = 0,0,0,0,0,0,0,0,0
|
---|
| 67 | +;cbw20,5g low band 8个channel 36,40,44,48,52,56,60,64
|
---|
| 68 | +G_COMPCHANTXPWR5G_LOW_CBW20_SQ2 = 0,0,0,0,0,0,0,0
|
---|
| 69 | +;cbw20,5g mid band 12个 channel 100,104,108,112,116,120,124,128,132,136,140,144
|
---|
| 70 | +G_COMPCHANTXPWR5G_MID_CBW20_SQ2 = 0,0,0,0,0,0,0,0,0,0,0,0
|
---|
| 71 | +;cbw20,5g high band 8个 channel 149,153,157,161,165,169,173,177
|
---|
| 72 | +G_COMPCHANTXPWR5G_HIGH_CBW20_SQ2 = 0,0,0,0,0,0,0,0
|
---|
| 73 | +;cbw40,5g low band 4个channel 38,46,54,62
|
---|
| 74 | +G_COMPCHANTXPWR5G_LOW_CBW40_SQ2 = 0,0,0,0
|
---|
| 75 | +;cbw40,5g mid band 6个 channel 102,110,118,126,134,142
|
---|
| 76 | +G_COMPCHANTXPWR5G_MID_CBW40_SQ2 = 0,0,0,0,0,0
|
---|
| 77 | +;cbw40,5g high band 4个 channel 151,159,167,175
|
---|
| 78 | +G_COMPCHANTXPWR5G_HIGH_CBW40_SQ2 = 0,0,0,0
|
---|
| 79 | +;cbw80,5g low band 2个 channel 42,58
|
---|
| 80 | +G_COMPCHANTXPWR5G_LOW_CBW80_SQ2 = 0,0
|
---|
| 81 | +;cbw80,5g mid band 3个 channel 106,122,138
|
---|
| 82 | +G_COMPCHANTXPWR5G_MID_CBW80_SQ2 = 0,0,0
|
---|
| 83 | +;cbw80,5g high band 2个 channel 155,171
|
---|
| 84 | +G_COMPCHANTXPWR5G_HIGH_CBW80_SQ2 = 0,0
|
---|
| 85 | +
|
---|
| 86 | +;-----------------------------------------------------------------------------
|
---|
| 87 | +[RegAddr1]
|
---|
| 88 | +;-----------------------------------------------------------------------------
|
---|
| 89 | +;寄存器配置,RegAddr是寄存器地址,每个信道对应一个寄存器值
|
---|
| 90 | +;RegAddr1,start_bit, stop_bit= 0x401420C0,4,0(5G RegAddr)
|
---|
| 91 | +RegAddr_Config = 0x401420C0,4,0
|
---|
| 92 | +;cbw20/cbw40 2g 3个channel 3,7,11
|
---|
| 93 | +;RegAddr1,start_bit, stop_bit= 0x401420C8,3,0(2G RegAddr)
|
---|
| 94 | +RegAddr_2G_CBW20 = 14,14,15
|
---|
| 95 | +;标志位,RegAddr_2G_CBW40 = version, reserved, reserved
|
---|
| 96 | +;version = 11:2G采用缺省配置; version = 20: 2G采用配置文件定义值
|
---|
| 97 | +RegAddr_2G_CBW40 = 20,11,11
|
---|
| 98 | +;cbw20,5g low band 8个channel 36, 40, 44, 48, 52, 56, 60, 64
|
---|
| 99 | +RegAddr_5G_LOW_CBW20 = 23, 24, 21, 21, 24, 22, 22, 20
|
---|
| 100 | +;cbw20,5g mid band 12个 channel 100,104,108,112,116,120,124,128,132,136,140,144
|
---|
| 101 | +RegAddr_5G_MID_CBW20 = 11, 13, 11, 13, 13, 13, 15, 15, 13, 13, 12, 12
|
---|
| 102 | +;cbw20,5g high band 8个 channel 149,153,157,161,165,169,173,177
|
---|
| 103 | +RegAddr_5G_HIGH_CBW20 = 12, 14, 12, 12, 11, 11, 11, 11
|
---|
| 104 | +;cbw40,5g low band 4个channel 38,46,54,62
|
---|
| 105 | +RegAddr_5G_LOW_CBW40 = 20, 17, 19, 17
|
---|
| 106 | +;cbw40,5g mid band 6个 channel 102,110,118,126,134,142
|
---|
| 107 | +RegAddr_5G_MID_CBW40 = 13, 11, 13, 14, 13, 12
|
---|
| 108 | +;cbw40,5g high band 4个 channel 151,159,167,175
|
---|
| 109 | +RegAddr_5G_HIGH_CBW40 = 13, 13, 10, 10
|
---|
| 110 | +;cbw80,5g low band 2个 channel 42,58
|
---|
| 111 | +RegAddr_5G_LOW_CBW80 = 19, 19
|
---|
| 112 | +;cbw80,5g mid band 3个 channel 106,122,138
|
---|
| 113 | +RegAddr_5G_MID_CBW80 = 11, 14, 11
|
---|
| 114 | +;cbw80,5g high band 2个 channel 155,171
|
---|
| 115 | +RegAddr_5G_HIGH_CBW80 = 12, 10
|
---|
| 116 | +
|
---|
| 117 | +;------------------------------------------------------------------------------
|
---|
| 118 | +[RegAddr2]
|
---|
| 119 | +;-----------------------------------------------------------------------------
|
---|
| 120 | +;RegAddr2,start_bit, stop_bit (5G RegAddr)
|
---|
| 121 | +RegAddr_Config = 0x40142080,4,1
|
---|
| 122 | +;cbw20/cbw40 2g 3个channel 3,7,11, RegAddr = 0x401420A8,4,1
|
---|
| 123 | +RegAddr_2G_CBW20 = 9, 9, 9
|
---|
| 124 | +;cbw40/cbw40 2g 3个channel 3,7,11, RegAddr = 0x401420AC,4,1
|
---|
| 125 | +RegAddr_2G_CBW40 = 9, 9, 9
|
---|
| 126 | +;cbw20,5g low band 8个channel 36,40,44,48,52,56,60,64
|
---|
| 127 | +RegAddr_5G_LOW_CBW20 = 6, 6, 6, 5, 5, 5, 6, 6
|
---|
| 128 | +;cbw20,5g mid band 12个 channel 100,104,108,112,116,120,124,128,132,136,140,144
|
---|
| 129 | +RegAddr_5G_MID_CBW20 = 7, 7, 7, 10, 10, 10, 10, 10, 8, 8, 8, 8
|
---|
| 130 | +;cbw20,5g high band 8个 channel 149,153,157,161,165,169,173,177
|
---|
| 131 | +RegAddr_5G_HIGH_CBW20 = 12, 12, 12, 12, 10, 10, 10, 10
|
---|
| 132 | +;cbw40,5g low band 4个channel 38,46,54,62
|
---|
| 133 | +RegAddr_5G_LOW_CBW40 = 6, 5, 5, 6
|
---|
| 134 | +;cbw40,5g mid band 6个 channel 102,110,118,126,134,142
|
---|
| 135 | +RegAddr_5G_MID_CBW40 = 7, 5, 5, 10, 8, 8
|
---|
| 136 | +;cbw40,5g high band 4个 channel 151,159,167,175
|
---|
| 137 | +RegAddr_5G_HIGH_CBW40 = 8, 8, 4, 4
|
---|
| 138 | +;cbw80,5g low band 2个 channel 42,58
|
---|
| 139 | +RegAddr_5G_LOW_CBW80 = 6, 5
|
---|
| 140 | +;cbw80,5g mid band 3个 channel 106,122,138
|
---|
| 141 | +RegAddr_5G_MID_CBW80 = 8, 10, 8
|
---|
| 142 | +;cbw80,5g high band 2个 channel 155,171
|
---|
| 143 | +RegAddr_5G_HIGH_CBW80 = 9, 4
|
---|
| 144 | +
|
---|
| 145 | +;------------------------------------------------------------------------------
|
---|
| 146 | +[RegAddr3]
|
---|
| 147 | +;-----------------------------------------------------------------------------
|
---|
| 148 | +;RegAddr3,start_bit, stop_bit (5G RegAddr)
|
---|
| 149 | +RegAddr_Config = 0x40142080,16,12
|
---|
| 150 | +;cbw20/cbw40 2g 3个channel 3,7,11, RegAddr = 0x401420A8,16,12
|
---|
| 151 | +RegAddr_2G_CBW20 = 18, 18, 18
|
---|
| 152 | +;cbw20/cbw40 2g 3个channel 3,7,11, RegAddr = 0x401420AC,16,12
|
---|
| 153 | +RegAddr_2G_CBW40 = 18, 18, 18
|
---|
| 154 | +;cbw20,5g low band 8个channel 36,40,44,48,52,56,60,64
|
---|
| 155 | +RegAddr_5G_LOW_CBW20 = 4, 4, 4, 4, 4, 4, 4, 4
|
---|
| 156 | +;cbw20,5g mid band 12个 channel 100,104,108,112,116,120,124,128,132,136,140,144
|
---|
| 157 | +RegAddr_5G_MID_CBW20 = 8, 8, 12, 10, 10, 10, 12, 12, 13, 13, 10, 10
|
---|
| 158 | +;cbw20,5g high band 8个 channel 149,153,157,161,165,169,173,177
|
---|
| 159 | +RegAddr_5G_HIGH_CBW20 = 16, 16, 12, 12, 12, 12, 12, 12
|
---|
| 160 | +;cbw40,5g low band 4个channel 38,46,54,62
|
---|
| 161 | +RegAddr_5G_LOW_CBW40 = 4, 4, 4, 4
|
---|
| 162 | +;cbw40,5g mid band 6个 channel 102,110,118,126,134,142
|
---|
| 163 | +RegAddr_5G_MID_CBW40 = 10, 10, 6, 13, 10, 10
|
---|
| 164 | +;cbw40,5g high band 4个 channel 151,159,167,175
|
---|
| 165 | +RegAddr_5G_HIGH_CBW40 = 11, 11, 6, 6
|
---|
| 166 | +;cbw80,5g low band 2个 channel 42,58
|
---|
| 167 | +RegAddr_5G_LOW_CBW80 = 4, 4
|
---|
| 168 | +;cbw80,5g mid band 3个 channel 106,122,138
|
---|
| 169 | +RegAddr_5G_MID_CBW80 = 10, 12, 12
|
---|
| 170 | +;cbw80,5g high band 2个 channel 155,171
|
---|
| 171 | +RegAddr_5G_HIGH_CBW80 = 13, 6
|
---|
| 172 | +;------------------------------------------------------------------------------
|
---|
| 173 | +
|
---|
| 174 | +
|
---|
| 175 | +;------------------------------------------------------------------------------
|
---|
| 176 | +
|
---|
| 177 | +
|
---|
| 178 | +
|
---|
| 179 | +
|
---|
| 180 | +
|
---|
| 181 | +
|
---|
| 182 | +
|
---|
| 183 | +
|
---|
.. | .. |
---|
| 1 | +;******************************************************************************
|
---|
| 2 | +; Wifi Limit Setup file
|
---|
| 3 | +;******************************************************************************
|
---|
| 4 | +[VERSION]
|
---|
| 5 | +WT_VERSION = EA6621QF_20230728
|
---|
| 6 | +;优化TX EVM
|
---|
| 7 | +;-----------------------------------------------------------------------------
|
---|
| 8 | +[CAL_POWER_INFO]
|
---|
| 9 | +;-----------------------------------------------------------------------------
|
---|
| 10 | +;设置浮点数,工具会自动做浮点转定点数的处理txpower,s(8,2)
|
---|
| 11 | +;发送给DUT之后,DUT会进行 <<Qnum 的操作,这里的数据不要提前移位 赋值的数值必须是10进制,与DUT侧对应
|
---|
| 12 | +;注释:11b rate 1M,2M,5.5M,11M
|
---|
| 13 | +G_TXPWR11B_UQ2 = 17, 17, 17, 17
|
---|
| 14 | +;注释:non-ht 2g cbw40 rate 6M/9M,12M,18M,24M,36M,48M,54M
|
---|
| 15 | +G_TXPWRNONHTDUP2G_UQ2 = 17, 17, 17, 17, 17, 17, 17, 15
|
---|
| 16 | +;注释:non-ht 5g cbw40 rate 6M,9M,12M,18M,24M,36M,48M,54M; cbw80 rate 6M,9M,12M,18M,24M,36M,48M,54M
|
---|
| 17 | +G_TXPWRNONHTDUP5G_UQ2 = 16, 16, 16, 16, 16, 16, 16, 15, 16, 16, 16, 16, 16, 16, 16, 15
|
---|
| 18 | +;注释:non-ht/ht/vht/he cbw20 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 19 | +;ht/vht/he cbw40 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 20 | +G_TXPWRMCS2G_UQ2 = 17, 17, 17, 17, 17, 17, 17, 15, 15, 14, 14, 13, 13, 17, 17, 17, 17, 17, 17, 17, 15, 15, 13, 13, 12, 12
|
---|
| 21 | +;写注释non-ht/ht/vht/he cbw20 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 22 | +;ht/vht/he cbw40 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 23 | +;ht/vht/he cbw80 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 24 | +G_TXPWRMCS5G_UQ2 = 16, 16, 16, 16, 16, 16, 16, 15, 14, 13, 13, 12, 12, 16, 16, 16, 16, 16, 16, 16, 15, 14, 13, 12, 12, 12, 15, 15, 15, 15, 15, 15, 15, 14, 13, 13, 11, 11, 11
|
---|
| 25 | +;写注释he TB SMALL RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 26 | +;he TB BIG RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 27 | +;he TB BIG RU BIG POWER rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 28 | +TBMAXTXPWR5G_UQ3 = 16, 16, 16, 16, 16, 16, 16, 15, 14, 13, 13, 12, 12, 16, 16, 16, 16, 16, 16, 16, 15, 14, 13, 13, 12, 12, 16, 16, 16, 16, 16, 16, 16, 15, 14, 13, 13, 12, 12
|
---|
| 29 | +;写注释he TB SMALL RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 30 | +;he TB BIG RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 31 | +;he TB BIG RU BIG POWER rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 32 | +TBMAXTXPWR2G_UQ3 = 17, 17, 17, 17, 17, 17, 17, 15, 15, 14, 14, 13, 13, 17, 17, 17, 17, 17, 17, 17, 15, 15, 14, 14, 13, 13, 17, 17, 17, 17, 17, 17, 17, 15, 15, 14, 14, 13, 13
|
---|
| 33 | +;写注释 5G,2G MIN TX POWER
|
---|
| 34 | +TBMINTXPWR_SQ2 = 00, 00
|
---|
| 35 | +
|
---|
| 36 | +;注释:11b rate 1M,2M,5.5M,11M
|
---|
| 37 | +G_TXPWR11B_UQ2_DELTA = 00, 00, 00, 00
|
---|
| 38 | +;注释:non-ht 2g cbw40 rate 6M/9M,12M,18M,24M,36M,48M,54M
|
---|
| 39 | +G_TXPWRNONHTDUP2G_UQ2_DELTA = 00, 00, 00, 00, 00, 00, 00, 00
|
---|
| 40 | +;注释:non-ht 5g cbw40 rate 6M,9M,12M,18M,24M,36M,48M,54M; cbw80 rate 6M,9M,12M,18M,24M,36M,48M,54M
|
---|
| 41 | +G_TXPWRNONHTDUP5G_UQ2_DELTA = 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00
|
---|
| 42 | +;注释:non-ht/ht/vht/he cbw20 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 43 | +;ht/vht/he cbw40 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 44 | +G_TXPWRMCS2G_UQ2_DELTA = 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00
|
---|
| 45 | +;写注释non-ht/ht/vht/he cbw20 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 46 | +;ht/vht/he cbw40 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 47 | +;ht/vht/he cbw80 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 48 | +G_TXPWRMCS5G_UQ2_DELTA = 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00
|
---|
| 49 | +;写注释he TB SMALL RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 50 | +;he TB BIG RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 51 | +;he TB BIG RU BIG POWER rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 52 | +TBMAXTXPWR5G_UQ3_DELTA = 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00
|
---|
| 53 | +;写注释he TB SMALL RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 54 | +;he TB BIG RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 55 | +;he TB BIG RU BIG POWER rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 56 | +TBMAXTXPWR2G_UQ3_DELTA = 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00
|
---|
| 57 | +;写注释 5G,2G MIN TX POWER
|
---|
| 58 | +TBMINTXPWR_SQ2_DELTA = 00, 00
|
---|
| 59 | +;-----------------------------------------------------------------------------
|
---|
| 60 | +[CHAN_POWER_COMPINFO]
|
---|
| 61 | +;-----------------------------------------------------------------------------
|
---|
| 62 | +;设置浮点数,工具会自动做浮点转定点数的处理。按频点补偿txpower,s(8,2),正数表示加功率,负数表示减功率
|
---|
| 63 | +;cbw20,2g 14个channel 1,2,3,4,5,6,7,8,9,10,11,12,13,14
|
---|
| 64 | +G_COMPCHANTXPWR2G_CBW20_SQ2 = 0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
---|
| 65 | +;cbw40,2g 9个channel 3,4,5,6,7,8,9,10,11
|
---|
| 66 | +G_COMPCHANTXPWR2G_CBW40_SQ2 = 0,0,0,0,0,0,0,0,0
|
---|
| 67 | +;cbw20,5g low band 8个channel 36,40,44,48,52,56,60,64
|
---|
| 68 | +G_COMPCHANTXPWR5G_LOW_CBW20_SQ2 = 0,0,0,0,0,0,0,0
|
---|
| 69 | +;cbw20,5g mid band 12个 channel 100,104,108,112,116,120,124,128,132,136,140,144
|
---|
| 70 | +G_COMPCHANTXPWR5G_MID_CBW20_SQ2 = 0,0,0,0,0,0,0,0,0,0,0,0
|
---|
| 71 | +;cbw20,5g high band 8个 channel 149,153,157,161,165,169,173,177
|
---|
| 72 | +G_COMPCHANTXPWR5G_HIGH_CBW20_SQ2 = 0,0,0,0,0,0,0,0
|
---|
| 73 | +;cbw40,5g low band 4个channel 38,46,54,62
|
---|
| 74 | +G_COMPCHANTXPWR5G_LOW_CBW40_SQ2 = 0,0,0,0
|
---|
| 75 | +;cbw40,5g mid band 6个 channel 102,110,118,126,134,142
|
---|
| 76 | +G_COMPCHANTXPWR5G_MID_CBW40_SQ2 = 0,0,0,0,0,0
|
---|
| 77 | +;cbw40,5g high band 4个 channel 151,159,167,175
|
---|
| 78 | +G_COMPCHANTXPWR5G_HIGH_CBW40_SQ2 = 0,0,0,0
|
---|
| 79 | +;cbw80,5g low band 2个 channel 42,58
|
---|
| 80 | +G_COMPCHANTXPWR5G_LOW_CBW80_SQ2 = 0,0
|
---|
| 81 | +;cbw80,5g mid band 3个 channel 106,122,138
|
---|
| 82 | +G_COMPCHANTXPWR5G_MID_CBW80_SQ2 = 0,0,0
|
---|
| 83 | +;cbw80,5g high band 2个 channel 155,171
|
---|
| 84 | +G_COMPCHANTXPWR5G_HIGH_CBW80_SQ2 = 0,0
|
---|
| 85 | +
|
---|
| 86 | +;-----------------------------------------------------------------------------
|
---|
| 87 | +[RegAddr1]
|
---|
| 88 | +;-----------------------------------------------------------------------------
|
---|
| 89 | +;寄存器配置,RegAddr是寄存器地址,每个信道对应一个寄存器值
|
---|
| 90 | +;RegAddr1,start_bit, stop_bit = 0x401420C0,4,0
|
---|
| 91 | +RegAddr_Config = 0x401420C0,4,0
|
---|
| 92 | +;cbw20 2g 3个channel 3,7,11
|
---|
| 93 | +RegAddr_2G_CBW20 = 11,11,11
|
---|
| 94 | +;cbw40 2g 3个channel 3,7,11
|
---|
| 95 | +RegAddr_2G_CBW40 = 11,11,11
|
---|
| 96 | +;cbw20,5g low band 8个channel 36,40,44,48,52,56,60,64
|
---|
| 97 | +RegAddr_5G_LOW_CBW20 = 20, 20, 20, 19, 19, 19, 17, 17
|
---|
| 98 | +;cbw20,5g mid band 12个 channel 100,104,108,112,116,120,124,128,132,136,140,144
|
---|
| 99 | +RegAddr_5G_MID_CBW20 = 13, 13, 13, 13, 13, 13, 13, 13, 11, 11, 10, 10
|
---|
| 100 | +;cbw20,5g high band 8个 channel 149,153,157,161,165,169,173,177
|
---|
| 101 | +RegAddr_5G_HIGH_CBW20 = 10, 10, 10, 10, 10, 10, 10, 10
|
---|
| 102 | +;cbw40,5g low band 4个channel 38,46,54,62
|
---|
| 103 | +RegAddr_5G_LOW_CBW40 = 20, 19, 19, 17
|
---|
| 104 | +;cbw40,5g mid band 6个 channel 102,110,118,126,134,142
|
---|
| 105 | +RegAddr_5G_MID_CBW40 = 13, 13, 13, 13, 11, 10
|
---|
| 106 | +;cbw40,5g high band 4个 channel 151,159,167,175
|
---|
| 107 | +RegAddr_5G_HIGH_CBW40 = 10, 10, 10, 10
|
---|
| 108 | +;cbw80,5g low band 2个 channel 42,58
|
---|
| 109 | +RegAddr_5G_LOW_CBW80 = 20, 19
|
---|
| 110 | +;cbw80,5g mid band 3个 channel 106,122,138
|
---|
| 111 | +RegAddr_5G_MID_CBW80 = 13, 13, 10
|
---|
| 112 | +;cbw80,5g high band 2个 channel 155,171
|
---|
| 113 | +RegAddr_5G_HIGH_CBW80 = 10, 10
|
---|
| 114 | +
|
---|
| 115 | +;------------------------------------------------------------------------------
|
---|
| 116 | +[RegAddr2]
|
---|
| 117 | +;-----------------------------------------------------------------------------
|
---|
| 118 | +;RegAddr2,start_bit, stop_bit = 0x40142080,4,1
|
---|
| 119 | +RegAddr_Config = 0x40142080,4,1
|
---|
| 120 | +;cbw20 2g 3个channel 3,7,11
|
---|
| 121 | +RegAddr_2G_CBW20 = 7, 7, 7
|
---|
| 122 | +;cbw40 2g 3个channel 3,7,11
|
---|
| 123 | +RegAddr_2G_CBW40 = 7, 7, 7
|
---|
| 124 | +;cbw20,5g low band 8个channel 36,40,44,48,52,56,60,64
|
---|
| 125 | +RegAddr_5G_LOW_CBW20 = 6, 6, 6, 5, 5, 5, 6, 6
|
---|
| 126 | +;cbw20,5g mid band 12个 channel 100,104,108,112,116,120,124,128,132,136,140,144
|
---|
| 127 | +RegAddr_5G_MID_CBW20 = 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6
|
---|
| 128 | +;cbw20,5g high band 8个 channel 149,153,157,161,165,169,173,177
|
---|
| 129 | +RegAddr_5G_HIGH_CBW20 = 6, 6, 8, 8, 4, 4, 4, 4
|
---|
| 130 | +;cbw40,5g low band 4个channel 38,46,54,62
|
---|
| 131 | +RegAddr_5G_LOW_CBW40 = 6, 5, 5, 6
|
---|
| 132 | +;cbw40,5g mid band 6个 channel 102,110,118,126,134,142
|
---|
| 133 | +RegAddr_5G_MID_CBW40 = 5, 5, 5, 5, 6, 6
|
---|
| 134 | +;cbw40,5g high band 4个 channel 151,159,167,175
|
---|
| 135 | +RegAddr_5G_HIGH_CBW40 = 6, 8, 4, 4
|
---|
| 136 | +;cbw80,5g low band 2个 channel 42,58
|
---|
| 137 | +RegAddr_5G_LOW_CBW80 = 6, 5
|
---|
| 138 | +;cbw80,5g mid band 3个 channel 106,122,138
|
---|
| 139 | +RegAddr_5G_MID_CBW80 = 5, 5, 6
|
---|
| 140 | +;cbw80,5g high band 2个 channel 155,171
|
---|
| 141 | +RegAddr_5G_HIGH_CBW80 = 8, 4
|
---|
| 142 | +
|
---|
| 143 | +;------------------------------------------------------------------------------
|
---|
| 144 | +[RegAddr3]
|
---|
| 145 | +;-----------------------------------------------------------------------------
|
---|
| 146 | +;RegAddr3,start_bit, stop_bit = 0x40142080,16,12
|
---|
| 147 | +RegAddr_Config = 0x40142080,16,12
|
---|
| 148 | +;cbw20 2g 3个channel 3,7,11
|
---|
| 149 | +RegAddr_2G_CBW20 = 4, 4, 4
|
---|
| 150 | +;cbw40 2g 3个channel 3,7,11
|
---|
| 151 | +RegAddr_2G_CBW40 = 4, 4, 4
|
---|
| 152 | +;cbw20,5g low band 8个channel 36,40,44,48,52,56,60,64
|
---|
| 153 | +RegAddr_5G_LOW_CBW20 = 4, 4, 4, 4, 4, 4, 4, 4
|
---|
| 154 | +;cbw20,5g mid band 12个 channel 100,104,108,112,116,120,124,128,132,136,140,144
|
---|
| 155 | +RegAddr_5G_MID_CBW20 = 8, 8, 6, 6, 6, 6, 6, 6, 8, 8, 4, 4
|
---|
| 156 | +;cbw20,5g high band 8个 channel 149,153,157,161,165,169,173,177
|
---|
| 157 | +RegAddr_5G_HIGH_CBW20 = 7, 7, 4, 4, 6, 6, 6, 6
|
---|
| 158 | +;cbw40,5g low band 4个channel 38,46,54,62
|
---|
| 159 | +RegAddr_5G_LOW_CBW40 = 4, 4, 4, 4
|
---|
| 160 | +;cbw40,5g mid band 6个 channel 102,110,118,126,134,142
|
---|
| 161 | +RegAddr_5G_MID_CBW40 = 8, 6, 6, 6, 8, 4
|
---|
| 162 | +;cbw40,5g high band 4个 channel 151,159,167,175
|
---|
| 163 | +RegAddr_5G_HIGH_CBW40 = 7, 4, 6, 6
|
---|
| 164 | +;cbw80,5g low band 2个 channel 42,58
|
---|
| 165 | +RegAddr_5G_LOW_CBW80 = 4, 4
|
---|
| 166 | +;cbw80,5g mid band 3个 channel 106,122,138
|
---|
| 167 | +RegAddr_5G_MID_CBW80 = 8, 6, 4
|
---|
| 168 | +;cbw80,5g high band 2个 channel 155,171
|
---|
| 169 | +RegAddr_5G_HIGH_CBW80 = 4, 6
|
---|
| 170 | +;------------------------------------------------------------------------------
|
---|
| 171 | +
|
---|
| 172 | +
|
---|
| 173 | +;------------------------------------------------------------------------------
|
---|
| 174 | +
|
---|
| 175 | +
|
---|
| 176 | +
|
---|
| 177 | +
|
---|
| 178 | +
|
---|
| 179 | +
|
---|
| 180 | +
|
---|
| 181 | +
|
---|
.. | .. |
---|
| 1 | +03dc64c52e487c360615e221ea57ce9f RAM_RW_KERNEL_DRAM.bin |
---|
| 2 | +96b1e5009e1376d2bf9c7cc8a1b2ced1 ROM_EXEC_KERNEL_IRAM.bin |
---|
.. | .. |
---|
| 1 | +;******************************************************************************
|
---|
| 2 | +; Wifi Limit Setup file
|
---|
| 3 | +;******************************************************************************
|
---|
| 4 | +[VERSION]
|
---|
| 5 | +WT_VERSION = EA6521QF_20230728
|
---|
| 6 | +;优化TX EVM
|
---|
| 7 | +;-----------------------------------------------------------------------------
|
---|
| 8 | +[CAL_POWER_INFO]
|
---|
| 9 | +;-----------------------------------------------------------------------------
|
---|
| 10 | +;设置浮点数,工具会自动做浮点转定点数的处理txpower,s(8,2)
|
---|
| 11 | +;发送给DUT之后,DUT会进行 <<Qnum 的操作,这里的数据不要提前移位 赋值的数值必须是10进制,与DUT侧对应
|
---|
| 12 | +;注释:11b rate 1M,2M,5.5M,11M
|
---|
| 13 | +G_TXPWR11B_UQ2 = 17, 17, 17, 17
|
---|
| 14 | +;注释:non-ht 2g cbw40 rate 6M/9M,12M,18M,24M,36M,48M,54M
|
---|
| 15 | +G_TXPWRNONHTDUP2G_UQ2 = 17, 17, 17, 17, 17, 17, 17, 15
|
---|
| 16 | +;注释:non-ht 5g cbw40 rate 6M,9M,12M,18M,24M,36M,48M,54M; cbw80 rate 6M,9M,12M,18M,24M,36M,48M,54M
|
---|
| 17 | +G_TXPWRNONHTDUP5G_UQ2 = 16, 16, 16, 16, 16, 16, 16, 15, 16, 16, 16, 16, 16, 16, 16, 15
|
---|
| 18 | +;注释:non-ht/ht/vht/he cbw20 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 19 | +;ht/vht/he cbw40 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 20 | +G_TXPWRMCS2G_UQ2 = 17, 17, 17, 17, 17, 17, 17, 15, 15, 14, 14, 13, 13, 17, 17, 17, 17, 17, 17, 17, 15, 15, 13, 13, 12, 12
|
---|
| 21 | +;写注释non-ht/ht/vht/he cbw20 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 22 | +;ht/vht/he cbw40 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 23 | +;ht/vht/he cbw80 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 24 | +G_TXPWRMCS5G_UQ2 = 16, 16, 16, 16, 16, 16, 16, 15, 14, 13, 13, 12, 12, 16, 16, 16, 16, 16, 16, 16, 15, 14, 13, 12, 12, 12, 15, 15, 15, 15, 15, 15, 15, 14, 13, 13, 11, 11, 11
|
---|
| 25 | +;写注释he TB SMALL RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 26 | +;he TB BIG RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 27 | +;he TB BIG RU BIG POWER rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 28 | +TBMAXTXPWR5G_UQ3 = 16, 16, 16, 16, 16, 16, 16, 15, 14, 13, 13, 12, 12, 16, 16, 16, 16, 16, 16, 16, 15, 14, 13, 13, 12, 12, 16, 16, 16, 16, 16, 16, 16, 15, 14, 13, 13, 12, 12
|
---|
| 29 | +;写注释he TB SMALL RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 30 | +;he TB BIG RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 31 | +;he TB BIG RU BIG POWER rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 32 | +TBMAXTXPWR2G_UQ3 = 17, 17, 17, 17, 17, 17, 17, 15, 15, 14, 14, 13, 13, 17, 17, 17, 17, 17, 17, 17, 15, 15, 14, 14, 13, 13, 17, 17, 17, 17, 17, 17, 17, 15, 15, 14, 14, 13, 13
|
---|
| 33 | +;写注释 5G,2G MIN TX POWER
|
---|
| 34 | +TBMINTXPWR_SQ2 = 00, 00
|
---|
| 35 | +
|
---|
| 36 | +;注释:11b rate 1M,2M,5.5M,11M
|
---|
| 37 | +G_TXPWR11B_UQ2_DELTA = 00, 00, 00, 00
|
---|
| 38 | +;注释:non-ht 2g cbw40 rate 6M/9M,12M,18M,24M,36M,48M,54M
|
---|
| 39 | +G_TXPWRNONHTDUP2G_UQ2_DELTA = 00, 00, 00, 00, 00, 00, 00, 00
|
---|
| 40 | +;注释:non-ht 5g cbw40 rate 6M,9M,12M,18M,24M,36M,48M,54M; cbw80 rate 6M,9M,12M,18M,24M,36M,48M,54M
|
---|
| 41 | +G_TXPWRNONHTDUP5G_UQ2_DELTA = 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00
|
---|
| 42 | +;注释:non-ht/ht/vht/he cbw20 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 43 | +;ht/vht/he cbw40 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 44 | +G_TXPWRMCS2G_UQ2_DELTA = 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00
|
---|
| 45 | +;写注释non-ht/ht/vht/he cbw20 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 46 | +;ht/vht/he cbw40 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 47 | +;ht/vht/he cbw80 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 48 | +G_TXPWRMCS5G_UQ2_DELTA = 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00
|
---|
| 49 | +;写注释he TB SMALL RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 50 | +;he TB BIG RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 51 | +;he TB BIG RU BIG POWER rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 52 | +TBMAXTXPWR5G_UQ3_DELTA = 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00
|
---|
| 53 | +;写注释he TB SMALL RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 54 | +;he TB BIG RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 55 | +;he TB BIG RU BIG POWER rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 56 | +TBMAXTXPWR2G_UQ3_DELTA = 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00
|
---|
| 57 | +;写注释 5G,2G MIN TX POWER
|
---|
| 58 | +TBMINTXPWR_SQ2_DELTA = 00, 00
|
---|
| 59 | +;-----------------------------------------------------------------------------
|
---|
| 60 | +[CHAN_POWER_COMPINFO]
|
---|
| 61 | +;-----------------------------------------------------------------------------
|
---|
| 62 | +;设置浮点数,工具会自动做浮点转定点数的处理。按频点补偿txpower,s(8,2),正数表示加功率,负数表示减功率
|
---|
| 63 | +;cbw20,2g 14个channel 1,2,3,4,5,6,7,8,9,10,11,12,13,14
|
---|
| 64 | +G_COMPCHANTXPWR2G_CBW20_SQ2 = 0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
---|
| 65 | +;cbw40,2g 9个channel 3,4,5,6,7,8,9,10,11
|
---|
| 66 | +G_COMPCHANTXPWR2G_CBW40_SQ2 = 0,0,0,0,0,0,0,0,0
|
---|
| 67 | +;cbw20,5g low band 8个channel 36,40,44,48,52,56,60,64
|
---|
| 68 | +G_COMPCHANTXPWR5G_LOW_CBW20_SQ2 = 0,0,0,0,0,0,0,0
|
---|
| 69 | +;cbw20,5g mid band 12个 channel 100,104,108,112,116,120,124,128,132,136,140,144
|
---|
| 70 | +G_COMPCHANTXPWR5G_MID_CBW20_SQ2 = 0,0,0,0,0,0,0,0,0,0,0,0
|
---|
| 71 | +;cbw20,5g high band 8个 channel 149,153,157,161,165,169,173,177
|
---|
| 72 | +G_COMPCHANTXPWR5G_HIGH_CBW20_SQ2 = 0,0,0,0,0,0,0,0
|
---|
| 73 | +;cbw40,5g low band 4个channel 38,46,54,62
|
---|
| 74 | +G_COMPCHANTXPWR5G_LOW_CBW40_SQ2 = 0,0,0,0
|
---|
| 75 | +;cbw40,5g mid band 6个 channel 102,110,118,126,134,142
|
---|
| 76 | +G_COMPCHANTXPWR5G_MID_CBW40_SQ2 = 0,0,0,0,0,0
|
---|
| 77 | +;cbw40,5g high band 4个 channel 151,159,167,175
|
---|
| 78 | +G_COMPCHANTXPWR5G_HIGH_CBW40_SQ2 = 0,0,0,0
|
---|
| 79 | +;cbw80,5g low band 2个 channel 42,58
|
---|
| 80 | +G_COMPCHANTXPWR5G_LOW_CBW80_SQ2 = 0,0
|
---|
| 81 | +;cbw80,5g mid band 3个 channel 106,122,138
|
---|
| 82 | +G_COMPCHANTXPWR5G_MID_CBW80_SQ2 = 0,0,0
|
---|
| 83 | +;cbw80,5g high band 2个 channel 155,171
|
---|
| 84 | +G_COMPCHANTXPWR5G_HIGH_CBW80_SQ2 = 0,0
|
---|
| 85 | +
|
---|
| 86 | +;-----------------------------------------------------------------------------
|
---|
| 87 | +[RegAddr1]
|
---|
| 88 | +;-----------------------------------------------------------------------------
|
---|
| 89 | +;寄存器配置,RegAddr是寄存器地址,每个信道对应一个寄存器值
|
---|
| 90 | +;RegAddr1,start_bit, stop_bit = 0x401420C0,4,0
|
---|
| 91 | +RegAddr_Config = 0x401420C0,4,0
|
---|
| 92 | +;cbw20 2g 3个channel 3,7,11
|
---|
| 93 | +RegAddr_2G_CBW20 = 11,11,11
|
---|
| 94 | +;cbw40 2g 3个channel 3,7,11
|
---|
| 95 | +RegAddr_2G_CBW40 = 11,11,11
|
---|
| 96 | +;cbw20,5g low band 8个channel 36,40,44,48,52,56,60,64
|
---|
| 97 | +RegAddr_5G_LOW_CBW20 = 20, 20, 20, 19, 19, 19, 17, 17
|
---|
| 98 | +;cbw20,5g mid band 12个 channel 100,104,108,112,116,120,124,128,132,136,140,144
|
---|
| 99 | +RegAddr_5G_MID_CBW20 = 13, 13, 13, 13, 13, 13, 13, 13, 11, 11, 10, 10
|
---|
| 100 | +;cbw20,5g high band 8个 channel 149,153,157,161,165,169,173,177
|
---|
| 101 | +RegAddr_5G_HIGH_CBW20 = 10, 10, 10, 10, 10, 10, 10, 10
|
---|
| 102 | +;cbw40,5g low band 4个channel 38,46,54,62
|
---|
| 103 | +RegAddr_5G_LOW_CBW40 = 20, 19, 19, 17
|
---|
| 104 | +;cbw40,5g mid band 6个 channel 102,110,118,126,134,142
|
---|
| 105 | +RegAddr_5G_MID_CBW40 = 13, 13, 13, 13, 11, 10
|
---|
| 106 | +;cbw40,5g high band 4个 channel 151,159,167,175
|
---|
| 107 | +RegAddr_5G_HIGH_CBW40 = 10, 10, 10, 10
|
---|
| 108 | +;cbw80,5g low band 2个 channel 42,58
|
---|
| 109 | +RegAddr_5G_LOW_CBW80 = 20, 19
|
---|
| 110 | +;cbw80,5g mid band 3个 channel 106,122,138
|
---|
| 111 | +RegAddr_5G_MID_CBW80 = 13, 13, 10
|
---|
| 112 | +;cbw80,5g high band 2个 channel 155,171
|
---|
| 113 | +RegAddr_5G_HIGH_CBW80 = 10, 10
|
---|
| 114 | +
|
---|
| 115 | +;------------------------------------------------------------------------------
|
---|
| 116 | +[RegAddr2]
|
---|
| 117 | +;-----------------------------------------------------------------------------
|
---|
| 118 | +;RegAddr2,start_bit, stop_bit = 0x40142080,4,1
|
---|
| 119 | +RegAddr_Config = 0x40142080,4,1
|
---|
| 120 | +;cbw20 2g 3个channel 3,7,11
|
---|
| 121 | +RegAddr_2G_CBW20 = 7, 7, 7
|
---|
| 122 | +;cbw40 2g 3个channel 3,7,11
|
---|
| 123 | +RegAddr_2G_CBW40 = 7, 7, 7
|
---|
| 124 | +;cbw20,5g low band 8个channel 36,40,44,48,52,56,60,64
|
---|
| 125 | +RegAddr_5G_LOW_CBW20 = 6, 6, 6, 5, 5, 5, 6, 6
|
---|
| 126 | +;cbw20,5g mid band 12个 channel 100,104,108,112,116,120,124,128,132,136,140,144
|
---|
| 127 | +RegAddr_5G_MID_CBW20 = 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6
|
---|
| 128 | +;cbw20,5g high band 8个 channel 149,153,157,161,165,169,173,177
|
---|
| 129 | +RegAddr_5G_HIGH_CBW20 = 6, 6, 8, 8, 4, 4, 4, 4
|
---|
| 130 | +;cbw40,5g low band 4个channel 38,46,54,62
|
---|
| 131 | +RegAddr_5G_LOW_CBW40 = 6, 5, 5, 6
|
---|
| 132 | +;cbw40,5g mid band 6个 channel 102,110,118,126,134,142
|
---|
| 133 | +RegAddr_5G_MID_CBW40 = 5, 5, 5, 5, 6, 6
|
---|
| 134 | +;cbw40,5g high band 4个 channel 151,159,167,175
|
---|
| 135 | +RegAddr_5G_HIGH_CBW40 = 6, 8, 4, 4
|
---|
| 136 | +;cbw80,5g low band 2个 channel 42,58
|
---|
| 137 | +RegAddr_5G_LOW_CBW80 = 6, 5
|
---|
| 138 | +;cbw80,5g mid band 3个 channel 106,122,138
|
---|
| 139 | +RegAddr_5G_MID_CBW80 = 5, 5, 6
|
---|
| 140 | +;cbw80,5g high band 2个 channel 155,171
|
---|
| 141 | +RegAddr_5G_HIGH_CBW80 = 8, 4
|
---|
| 142 | +
|
---|
| 143 | +;------------------------------------------------------------------------------
|
---|
| 144 | +[RegAddr3]
|
---|
| 145 | +;-----------------------------------------------------------------------------
|
---|
| 146 | +;RegAddr3,start_bit, stop_bit = 0x40142080,16,12
|
---|
| 147 | +RegAddr_Config = 0x40142080,16,12
|
---|
| 148 | +;cbw20 2g 3个channel 3,7,11
|
---|
| 149 | +RegAddr_2G_CBW20 = 4, 4, 4
|
---|
| 150 | +;cbw40 2g 3个channel 3,7,11
|
---|
| 151 | +RegAddr_2G_CBW40 = 4, 4, 4
|
---|
| 152 | +;cbw20,5g low band 8个channel 36,40,44,48,52,56,60,64
|
---|
| 153 | +RegAddr_5G_LOW_CBW20 = 4, 4, 4, 4, 4, 4, 4, 4
|
---|
| 154 | +;cbw20,5g mid band 12个 channel 100,104,108,112,116,120,124,128,132,136,140,144
|
---|
| 155 | +RegAddr_5G_MID_CBW20 = 8, 8, 6, 6, 6, 6, 6, 6, 8, 8, 4, 4
|
---|
| 156 | +;cbw20,5g high band 8个 channel 149,153,157,161,165,169,173,177
|
---|
| 157 | +RegAddr_5G_HIGH_CBW20 = 7, 7, 4, 4, 6, 6, 6, 6
|
---|
| 158 | +;cbw40,5g low band 4个channel 38,46,54,62
|
---|
| 159 | +RegAddr_5G_LOW_CBW40 = 4, 4, 4, 4
|
---|
| 160 | +;cbw40,5g mid band 6个 channel 102,110,118,126,134,142
|
---|
| 161 | +RegAddr_5G_MID_CBW40 = 8, 6, 6, 6, 8, 4
|
---|
| 162 | +;cbw40,5g high band 4个 channel 151,159,167,175
|
---|
| 163 | +RegAddr_5G_HIGH_CBW40 = 7, 4, 6, 6
|
---|
| 164 | +;cbw80,5g low band 2个 channel 42,58
|
---|
| 165 | +RegAddr_5G_LOW_CBW80 = 4, 4
|
---|
| 166 | +;cbw80,5g mid band 3个 channel 106,122,138
|
---|
| 167 | +RegAddr_5G_MID_CBW80 = 8, 6, 4
|
---|
| 168 | +;cbw80,5g high band 2个 channel 155,171
|
---|
| 169 | +RegAddr_5G_HIGH_CBW80 = 4, 6
|
---|
| 170 | +;------------------------------------------------------------------------------
|
---|
| 171 | +
|
---|
| 172 | +
|
---|
| 173 | +;------------------------------------------------------------------------------
|
---|
| 174 | +
|
---|
| 175 | +
|
---|
| 176 | +
|
---|
| 177 | +
|
---|
| 178 | +
|
---|
| 179 | +
|
---|
| 180 | +
|
---|
| 181 | +
|
---|
.. | .. |
---|
| 1 | +;******************************************************************************
|
---|
| 2 | +; Wifi Limit Setup file
|
---|
| 3 | +;******************************************************************************
|
---|
| 4 | +[VERSION]
|
---|
| 5 | +WT_VERSION = EA6521QT_20230728
|
---|
| 6 | +;增加2.4G PA寄存器优化兼容配置
|
---|
| 7 | +;-----------------------------------------------------------------------------
|
---|
| 8 | +[CAL_POWER_INFO]
|
---|
| 9 | +;-----------------------------------------------------------------------------
|
---|
| 10 | +;设置浮点数,工具会自动做浮点转定点数的处理txpower,s(8,2)
|
---|
| 11 | +;发送给DUT之后,DUT会进行 <<Qnum 的操作,这里的数据不要提前移位 赋值的数值必须是10进制,与DUT侧对应
|
---|
| 12 | +;注释:11b rate 1M,2M,5.5M,11M
|
---|
| 13 | +G_TXPWR11B_UQ2 = 17, 17, 17, 17
|
---|
| 14 | +;注释:non-ht 2g cbw40 rate 6M/9M,12M,18M,24M,36M,48M,54M
|
---|
| 15 | +G_TXPWRNONHTDUP2G_UQ2 = 17, 17, 17, 17, 17, 17, 17, 15
|
---|
| 16 | +;注释:non-ht 5g cbw40 rate 6M,9M,12M,18M,24M,36M,48M,54M; cbw80 rate 6M,9M,12M,18M,24M,36M,48M,54M
|
---|
| 17 | +G_TXPWRNONHTDUP5G_UQ2 = 16, 16, 16, 16, 16, 16, 16, 15, 16, 16, 16, 16, 16, 16, 16, 15
|
---|
| 18 | +;注释:non-ht/ht/vht/he cbw20 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 19 | +;ht/vht/he cbw40 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 20 | +G_TXPWRMCS2G_UQ2 = 17, 17, 17, 17, 17, 17, 17, 15, 15, 14, 14, 13, 13, 17, 17, 17, 17, 17, 17, 17, 15, 15, 13, 13, 12, 12
|
---|
| 21 | +;写注释non-ht/ht/vht/he cbw20 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 22 | +;ht/vht/he cbw40 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 23 | +;ht/vht/he cbw80 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 24 | +G_TXPWRMCS5G_UQ2 = 16, 16, 16, 16, 16, 16, 16, 15, 14, 13, 13, 12, 12, 16, 16, 16, 16, 16, 16, 16, 15, 14, 13, 12, 12, 12, 15, 15, 15, 15, 15, 15, 15, 14, 13, 13, 11, 11, 11
|
---|
| 25 | +;写注释he TB SMALL RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 26 | +;he TB BIG RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 27 | +;he TB BIG RU BIG POWER rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 28 | +TBMAXTXPWR5G_UQ3 = 16, 16, 16, 16, 16, 16, 16, 15, 14, 13, 13, 12, 12, 16, 16, 16, 16, 16, 16, 16, 15, 14, 13, 13, 12, 12, 16, 16, 16, 16, 16, 16, 16, 15, 14, 13, 13, 12, 12
|
---|
| 29 | +;写注释he TB SMALL RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 30 | +;he TB BIG RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 31 | +;he TB BIG RU BIG POWER rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 32 | +TBMAXTXPWR2G_UQ3 = 17, 17, 17, 17, 17, 17, 17, 15, 15, 14, 14, 13, 13, 17, 17, 17, 17, 17, 17, 17, 15, 15, 14, 14, 13, 13, 17, 17, 17, 17, 17, 17, 17, 15, 15, 14, 14, 13, 13
|
---|
| 33 | +;写注释 5G,2G MIN TX POWER
|
---|
| 34 | +TBMINTXPWR_SQ2 = 00, 00
|
---|
| 35 | +
|
---|
| 36 | +;注释:11b rate 1M,2M,5.5M,11M
|
---|
| 37 | +G_TXPWR11B_UQ2_DELTA = 5.5, 5.5, 5.5, 4
|
---|
| 38 | +;注释:non-ht 2g cbw40 rate 6M/9M,12M,18M,24M,36M,48M,54M
|
---|
| 39 | +G_TXPWRNONHTDUP2G_UQ2_DELTA = 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5
|
---|
| 40 | +;注释:non-ht 5g cbw40 rate 6M,9M,12M,18M,24M,36M,48M,54M; cbw80 rate 6M,9M,12M,18M,24M,36M,48M,54M
|
---|
| 41 | +G_TXPWRNONHTDUP5G_UQ2_DELTA = 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00
|
---|
| 42 | +;注释:non-ht/ht/vht/he cbw20 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 43 | +;ht/vht/he cbw40 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 44 | +G_TXPWRMCS2G_UQ2_DELTA = 4.5, 5.5, 4.5, 4.5, 4.5, 4.5, 5, 4.5, 5.5, 5, 5, 4.5, 5.3, 4.5, 5.5, 4.5, 4.5, 4.5, 4.5, 5, 5, 5.5, 4.5, 5.5, 4.5, 5.5
|
---|
| 45 | +;写注释non-ht/ht/vht/he cbw20 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 46 | +;ht/vht/he cbw40 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 47 | +;ht/vht/he cbw80 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 48 | +G_TXPWRMCS5G_UQ2_DELTA = 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00
|
---|
| 49 | +;写注释he TB SMALL RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 50 | +;he TB BIG RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 51 | +;he TB BIG RU BIG POWER rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 52 | +TBMAXTXPWR5G_UQ3_DELTA = 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00
|
---|
| 53 | +;写注释he TB SMALL RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 54 | +;he TB BIG RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 55 | +;he TB BIG RU BIG POWER rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 56 | +TBMAXTXPWR2G_UQ3_DELTA = 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5
|
---|
| 57 | +;写注释 5G,2G MIN TX POWER
|
---|
| 58 | +TBMINTXPWR_SQ2_DELTA = 4.5, 4.5
|
---|
| 59 | +;-----------------------------------------------------------------------------
|
---|
| 60 | +[CHAN_POWER_COMPINFO]
|
---|
| 61 | +;-----------------------------------------------------------------------------
|
---|
| 62 | +;设置浮点数,工具会自动做浮点转定点数的处理。按频点补偿txpower,s(8,2),正数表示加功率,负数表示减功率
|
---|
| 63 | +;cbw20,2g 14个channel 1,2,3,4,5,6,7,8,9,10,11,12,13,14
|
---|
| 64 | +G_COMPCHANTXPWR2G_CBW20_SQ2 = 0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
---|
| 65 | +;cbw40,2g 9个channel 3,4,5,6,7,8,9,10,11
|
---|
| 66 | +G_COMPCHANTXPWR2G_CBW40_SQ2 = 0,0,0,0,0,0,0,0,0
|
---|
| 67 | +;cbw20,5g low band 8个channel 36,40,44,48,52,56,60,64
|
---|
| 68 | +G_COMPCHANTXPWR5G_LOW_CBW20_SQ2 = 0,0,0,0,0,0,0,0
|
---|
| 69 | +;cbw20,5g mid band 12个 channel 100,104,108,112,116,120,124,128,132,136,140,144
|
---|
| 70 | +G_COMPCHANTXPWR5G_MID_CBW20_SQ2 = 0,0,0,0,0,0,0,0,0,0,0,0
|
---|
| 71 | +;cbw20,5g high band 8个 channel 149,153,157,161,165,169,173,177
|
---|
| 72 | +G_COMPCHANTXPWR5G_HIGH_CBW20_SQ2 = 0,0,0,0,0,0,0,0
|
---|
| 73 | +;cbw40,5g low band 4个channel 38,46,54,62
|
---|
| 74 | +G_COMPCHANTXPWR5G_LOW_CBW40_SQ2 = 0,0,0,0
|
---|
| 75 | +;cbw40,5g mid band 6个 channel 102,110,118,126,134,142
|
---|
| 76 | +G_COMPCHANTXPWR5G_MID_CBW40_SQ2 = 0,0,0,0,0,0
|
---|
| 77 | +;cbw40,5g high band 4个 channel 151,159,167,175
|
---|
| 78 | +G_COMPCHANTXPWR5G_HIGH_CBW40_SQ2 = 0,0,0,0
|
---|
| 79 | +;cbw80,5g low band 2个 channel 42,58
|
---|
| 80 | +G_COMPCHANTXPWR5G_LOW_CBW80_SQ2 = 0,0
|
---|
| 81 | +;cbw80,5g mid band 3个 channel 106,122,138
|
---|
| 82 | +G_COMPCHANTXPWR5G_MID_CBW80_SQ2 = 0,0,0
|
---|
| 83 | +;cbw80,5g high band 2个 channel 155,171
|
---|
| 84 | +G_COMPCHANTXPWR5G_HIGH_CBW80_SQ2 = 0,0
|
---|
| 85 | +
|
---|
| 86 | +;-----------------------------------------------------------------------------
|
---|
| 87 | +[RegAddr1]
|
---|
| 88 | +;-----------------------------------------------------------------------------
|
---|
| 89 | +;寄存器配置,RegAddr是寄存器地址,每个信道对应一个寄存器值
|
---|
| 90 | +;RegAddr1,start_bit, stop_bit= 0x401420C0,4,0(5G RegAddr)
|
---|
| 91 | +RegAddr_Config = 0x401420C0,4,0
|
---|
| 92 | +;cbw20/cbw40 2g 3个channel 3,7,11
|
---|
| 93 | +;RegAddr1,start_bit, stop_bit= 0x401420C8,3,0(2G RegAddr)
|
---|
| 94 | +RegAddr_2G_CBW20 = 14,14,15
|
---|
| 95 | +;标志位,RegAddr_2G_CBW40 = version, reserved, reserved
|
---|
| 96 | +;version = 11:2G采用缺省配置; version = 20: 2G采用配置文件定义值
|
---|
| 97 | +RegAddr_2G_CBW40 = 20,11,11
|
---|
| 98 | +;cbw20,5g low band 8个channel 36, 40, 44, 48, 52, 56, 60, 64
|
---|
| 99 | +RegAddr_5G_LOW_CBW20 = 23, 24, 21, 21, 24, 22, 22, 20
|
---|
| 100 | +;cbw20,5g mid band 12个 channel 100,104,108,112,116,120,124,128,132,136,140,144
|
---|
| 101 | +RegAddr_5G_MID_CBW20 = 11, 13, 11, 13, 13, 13, 15, 15, 13, 13, 12, 12
|
---|
| 102 | +;cbw20,5g high band 8个 channel 149,153,157,161,165,169,173,177
|
---|
| 103 | +RegAddr_5G_HIGH_CBW20 = 12, 14, 12, 12, 11, 11, 11, 11
|
---|
| 104 | +;cbw40,5g low band 4个channel 38,46,54,62
|
---|
| 105 | +RegAddr_5G_LOW_CBW40 = 20, 17, 19, 17
|
---|
| 106 | +;cbw40,5g mid band 6个 channel 102,110,118,126,134,142
|
---|
| 107 | +RegAddr_5G_MID_CBW40 = 13, 11, 13, 14, 13, 12
|
---|
| 108 | +;cbw40,5g high band 4个 channel 151,159,167,175
|
---|
| 109 | +RegAddr_5G_HIGH_CBW40 = 13, 13, 10, 10
|
---|
| 110 | +;cbw80,5g low band 2个 channel 42,58
|
---|
| 111 | +RegAddr_5G_LOW_CBW80 = 19, 19
|
---|
| 112 | +;cbw80,5g mid band 3个 channel 106,122,138
|
---|
| 113 | +RegAddr_5G_MID_CBW80 = 11, 14, 11
|
---|
| 114 | +;cbw80,5g high band 2个 channel 155,171
|
---|
| 115 | +RegAddr_5G_HIGH_CBW80 = 12, 10
|
---|
| 116 | +
|
---|
| 117 | +;------------------------------------------------------------------------------
|
---|
| 118 | +[RegAddr2]
|
---|
| 119 | +;-----------------------------------------------------------------------------
|
---|
| 120 | +;RegAddr2,start_bit, stop_bit (5G RegAddr)
|
---|
| 121 | +RegAddr_Config = 0x40142080,4,1
|
---|
| 122 | +;cbw20/cbw40 2g 3个channel 3,7,11, RegAddr = 0x401420A8,4,1
|
---|
| 123 | +RegAddr_2G_CBW20 = 9, 9, 9
|
---|
| 124 | +;cbw40/cbw40 2g 3个channel 3,7,11, RegAddr = 0x401420AC,4,1
|
---|
| 125 | +RegAddr_2G_CBW40 = 9, 9, 9
|
---|
| 126 | +;cbw20,5g low band 8个channel 36,40,44,48,52,56,60,64
|
---|
| 127 | +RegAddr_5G_LOW_CBW20 = 6, 6, 6, 5, 5, 5, 6, 6
|
---|
| 128 | +;cbw20,5g mid band 12个 channel 100,104,108,112,116,120,124,128,132,136,140,144
|
---|
| 129 | +RegAddr_5G_MID_CBW20 = 7, 7, 7, 10, 10, 10, 10, 10, 8, 8, 8, 8
|
---|
| 130 | +;cbw20,5g high band 8个 channel 149,153,157,161,165,169,173,177
|
---|
| 131 | +RegAddr_5G_HIGH_CBW20 = 12, 12, 12, 12, 10, 10, 10, 10
|
---|
| 132 | +;cbw40,5g low band 4个channel 38,46,54,62
|
---|
| 133 | +RegAddr_5G_LOW_CBW40 = 6, 5, 5, 6
|
---|
| 134 | +;cbw40,5g mid band 6个 channel 102,110,118,126,134,142
|
---|
| 135 | +RegAddr_5G_MID_CBW40 = 7, 5, 5, 10, 8, 8
|
---|
| 136 | +;cbw40,5g high band 4个 channel 151,159,167,175
|
---|
| 137 | +RegAddr_5G_HIGH_CBW40 = 8, 8, 4, 4
|
---|
| 138 | +;cbw80,5g low band 2个 channel 42,58
|
---|
| 139 | +RegAddr_5G_LOW_CBW80 = 6, 5
|
---|
| 140 | +;cbw80,5g mid band 3个 channel 106,122,138
|
---|
| 141 | +RegAddr_5G_MID_CBW80 = 8, 10, 8
|
---|
| 142 | +;cbw80,5g high band 2个 channel 155,171
|
---|
| 143 | +RegAddr_5G_HIGH_CBW80 = 9, 4
|
---|
| 144 | +
|
---|
| 145 | +;------------------------------------------------------------------------------
|
---|
| 146 | +[RegAddr3]
|
---|
| 147 | +;-----------------------------------------------------------------------------
|
---|
| 148 | +;RegAddr3,start_bit, stop_bit (5G RegAddr)
|
---|
| 149 | +RegAddr_Config = 0x40142080,16,12
|
---|
| 150 | +;cbw20/cbw40 2g 3个channel 3,7,11, RegAddr = 0x401420A8,16,12
|
---|
| 151 | +RegAddr_2G_CBW20 = 18, 18, 18
|
---|
| 152 | +;cbw20/cbw40 2g 3个channel 3,7,11, RegAddr = 0x401420AC,16,12
|
---|
| 153 | +RegAddr_2G_CBW40 = 18, 18, 18
|
---|
| 154 | +;cbw20,5g low band 8个channel 36,40,44,48,52,56,60,64
|
---|
| 155 | +RegAddr_5G_LOW_CBW20 = 4, 4, 4, 4, 4, 4, 4, 4
|
---|
| 156 | +;cbw20,5g mid band 12个 channel 100,104,108,112,116,120,124,128,132,136,140,144
|
---|
| 157 | +RegAddr_5G_MID_CBW20 = 8, 8, 12, 10, 10, 10, 12, 12, 13, 13, 10, 10
|
---|
| 158 | +;cbw20,5g high band 8个 channel 149,153,157,161,165,169,173,177
|
---|
| 159 | +RegAddr_5G_HIGH_CBW20 = 16, 16, 12, 12, 12, 12, 12, 12
|
---|
| 160 | +;cbw40,5g low band 4个channel 38,46,54,62
|
---|
| 161 | +RegAddr_5G_LOW_CBW40 = 4, 4, 4, 4
|
---|
| 162 | +;cbw40,5g mid band 6个 channel 102,110,118,126,134,142
|
---|
| 163 | +RegAddr_5G_MID_CBW40 = 10, 10, 6, 13, 10, 10
|
---|
| 164 | +;cbw40,5g high band 4个 channel 151,159,167,175
|
---|
| 165 | +RegAddr_5G_HIGH_CBW40 = 11, 11, 6, 6
|
---|
| 166 | +;cbw80,5g low band 2个 channel 42,58
|
---|
| 167 | +RegAddr_5G_LOW_CBW80 = 4, 4
|
---|
| 168 | +;cbw80,5g mid band 3个 channel 106,122,138
|
---|
| 169 | +RegAddr_5G_MID_CBW80 = 10, 12, 12
|
---|
| 170 | +;cbw80,5g high band 2个 channel 155,171
|
---|
| 171 | +RegAddr_5G_HIGH_CBW80 = 13, 6
|
---|
| 172 | +;------------------------------------------------------------------------------
|
---|
| 173 | +
|
---|
| 174 | +
|
---|
| 175 | +;------------------------------------------------------------------------------
|
---|
| 176 | +
|
---|
| 177 | +
|
---|
| 178 | +
|
---|
| 179 | +
|
---|
| 180 | +
|
---|
| 181 | +
|
---|
| 182 | +
|
---|
| 183 | +
|
---|
.. | .. |
---|
| 1 | +;******************************************************************************
|
---|
| 2 | +; Wifi Limit Setup file
|
---|
| 3 | +;******************************************************************************
|
---|
| 4 | +[VERSION]
|
---|
| 5 | +WT_VERSION = EA6621QT_20230728
|
---|
| 6 | +;增加2.4G PA寄存器优化兼容配置
|
---|
| 7 | +;-----------------------------------------------------------------------------
|
---|
| 8 | +[CAL_POWER_INFO]
|
---|
| 9 | +;-----------------------------------------------------------------------------
|
---|
| 10 | +;设置浮点数,工具会自动做浮点转定点数的处理txpower,s(8,2)
|
---|
| 11 | +;发送给DUT之后,DUT会进行 <<Qnum 的操作,这里的数据不要提前移位 赋值的数值必须是10进制,与DUT侧对应
|
---|
| 12 | +;注释:11b rate 1M,2M,5.5M,11M
|
---|
| 13 | +G_TXPWR11B_UQ2 = 17, 17, 17, 17
|
---|
| 14 | +;注释:non-ht 2g cbw40 rate 6M/9M,12M,18M,24M,36M,48M,54M
|
---|
| 15 | +G_TXPWRNONHTDUP2G_UQ2 = 17, 17, 17, 17, 17, 17, 17, 15
|
---|
| 16 | +;注释:non-ht 5g cbw40 rate 6M,9M,12M,18M,24M,36M,48M,54M; cbw80 rate 6M,9M,12M,18M,24M,36M,48M,54M
|
---|
| 17 | +G_TXPWRNONHTDUP5G_UQ2 = 16, 16, 16, 16, 16, 16, 16, 15, 16, 16, 16, 16, 16, 16, 16, 15
|
---|
| 18 | +;注释:non-ht/ht/vht/he cbw20 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 19 | +;ht/vht/he cbw40 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 20 | +G_TXPWRMCS2G_UQ2 = 17, 17, 17, 17, 17, 17, 17, 15, 15, 14, 14, 13, 13, 17, 17, 17, 17, 17, 17, 17, 15, 15, 13, 13, 12, 12
|
---|
| 21 | +;写注释non-ht/ht/vht/he cbw20 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 22 | +;ht/vht/he cbw40 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 23 | +;ht/vht/he cbw80 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 24 | +G_TXPWRMCS5G_UQ2 = 16, 16, 16, 16, 16, 16, 16, 15, 14, 13, 13, 12, 12, 16, 16, 16, 16, 16, 16, 16, 15, 14, 13, 12, 12, 12, 15, 15, 15, 15, 15, 15, 15, 14, 13, 13, 11, 11, 11
|
---|
| 25 | +;写注释he TB SMALL RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 26 | +;he TB BIG RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 27 | +;he TB BIG RU BIG POWER rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 28 | +TBMAXTXPWR5G_UQ3 = 16, 16, 16, 16, 16, 16, 16, 15, 14, 13, 13, 12, 12, 16, 16, 16, 16, 16, 16, 16, 15, 14, 13, 13, 12, 12, 16, 16, 16, 16, 16, 16, 16, 15, 14, 13, 13, 12, 12
|
---|
| 29 | +;写注释he TB SMALL RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 30 | +;he TB BIG RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 31 | +;he TB BIG RU BIG POWER rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 32 | +TBMAXTXPWR2G_UQ3 = 17, 17, 17, 17, 17, 17, 17, 15, 15, 14, 14, 13, 13, 17, 17, 17, 17, 17, 17, 17, 15, 15, 14, 14, 13, 13, 17, 17, 17, 17, 17, 17, 17, 15, 15, 14, 14, 13, 13
|
---|
| 33 | +;写注释 5G,2G MIN TX POWER
|
---|
| 34 | +TBMINTXPWR_SQ2 = 00, 00
|
---|
| 35 | +
|
---|
| 36 | +;注释:11b rate 1M,2M,5.5M,11M
|
---|
| 37 | +G_TXPWR11B_UQ2_DELTA = 5.5, 5.5, 5.5, 4
|
---|
| 38 | +;注释:non-ht 2g cbw40 rate 6M/9M,12M,18M,24M,36M,48M,54M
|
---|
| 39 | +G_TXPWRNONHTDUP2G_UQ2_DELTA = 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5
|
---|
| 40 | +;注释:non-ht 5g cbw40 rate 6M,9M,12M,18M,24M,36M,48M,54M; cbw80 rate 6M,9M,12M,18M,24M,36M,48M,54M
|
---|
| 41 | +G_TXPWRNONHTDUP5G_UQ2_DELTA = 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00
|
---|
| 42 | +;注释:non-ht/ht/vht/he cbw20 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 43 | +;ht/vht/he cbw40 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 44 | +G_TXPWRMCS2G_UQ2_DELTA = 4.5, 5.5, 4.5, 4.5, 4.5, 4.5, 5, 4.5, 5.5, 5, 5, 4.5, 5.3, 4.5, 5.5, 4.5, 4.5, 4.5, 4.5, 5, 5, 5.5, 4.5, 5.5, 4.5, 5.5
|
---|
| 45 | +;写注释non-ht/ht/vht/he cbw20 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 46 | +;ht/vht/he cbw40 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 47 | +;ht/vht/he cbw80 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 48 | +G_TXPWRMCS5G_UQ2_DELTA = 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00
|
---|
| 49 | +;写注释he TB SMALL RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 50 | +;he TB BIG RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 51 | +;he TB BIG RU BIG POWER rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 52 | +TBMAXTXPWR5G_UQ3_DELTA = 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00
|
---|
| 53 | +;写注释he TB SMALL RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 54 | +;he TB BIG RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 55 | +;he TB BIG RU BIG POWER rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 56 | +TBMAXTXPWR2G_UQ3_DELTA = 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5
|
---|
| 57 | +;写注释 5G,2G MIN TX POWER
|
---|
| 58 | +TBMINTXPWR_SQ2_DELTA = 4.5, 4.5
|
---|
| 59 | +;-----------------------------------------------------------------------------
|
---|
| 60 | +[CHAN_POWER_COMPINFO]
|
---|
| 61 | +;-----------------------------------------------------------------------------
|
---|
| 62 | +;设置浮点数,工具会自动做浮点转定点数的处理。按频点补偿txpower,s(8,2),正数表示加功率,负数表示减功率
|
---|
| 63 | +;cbw20,2g 14个channel 1,2,3,4,5,6,7,8,9,10,11,12,13,14
|
---|
| 64 | +G_COMPCHANTXPWR2G_CBW20_SQ2 = 0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
---|
| 65 | +;cbw40,2g 9个channel 3,4,5,6,7,8,9,10,11
|
---|
| 66 | +G_COMPCHANTXPWR2G_CBW40_SQ2 = 0,0,0,0,0,0,0,0,0
|
---|
| 67 | +;cbw20,5g low band 8个channel 36,40,44,48,52,56,60,64
|
---|
| 68 | +G_COMPCHANTXPWR5G_LOW_CBW20_SQ2 = 0,0,0,0,0,0,0,0
|
---|
| 69 | +;cbw20,5g mid band 12个 channel 100,104,108,112,116,120,124,128,132,136,140,144
|
---|
| 70 | +G_COMPCHANTXPWR5G_MID_CBW20_SQ2 = 0,0,0,0,0,0,0,0,0,0,0,0
|
---|
| 71 | +;cbw20,5g high band 8个 channel 149,153,157,161,165,169,173,177
|
---|
| 72 | +G_COMPCHANTXPWR5G_HIGH_CBW20_SQ2 = 0,0,0,0,0,0,0,0
|
---|
| 73 | +;cbw40,5g low band 4个channel 38,46,54,62
|
---|
| 74 | +G_COMPCHANTXPWR5G_LOW_CBW40_SQ2 = 0,0,0,0
|
---|
| 75 | +;cbw40,5g mid band 6个 channel 102,110,118,126,134,142
|
---|
| 76 | +G_COMPCHANTXPWR5G_MID_CBW40_SQ2 = 0,0,0,0,0,0
|
---|
| 77 | +;cbw40,5g high band 4个 channel 151,159,167,175
|
---|
| 78 | +G_COMPCHANTXPWR5G_HIGH_CBW40_SQ2 = 0,0,0,0
|
---|
| 79 | +;cbw80,5g low band 2个 channel 42,58
|
---|
| 80 | +G_COMPCHANTXPWR5G_LOW_CBW80_SQ2 = 0,0
|
---|
| 81 | +;cbw80,5g mid band 3个 channel 106,122,138
|
---|
| 82 | +G_COMPCHANTXPWR5G_MID_CBW80_SQ2 = 0,0,0
|
---|
| 83 | +;cbw80,5g high band 2个 channel 155,171
|
---|
| 84 | +G_COMPCHANTXPWR5G_HIGH_CBW80_SQ2 = 0,0
|
---|
| 85 | +
|
---|
| 86 | +;-----------------------------------------------------------------------------
|
---|
| 87 | +[RegAddr1]
|
---|
| 88 | +;-----------------------------------------------------------------------------
|
---|
| 89 | +;寄存器配置,RegAddr是寄存器地址,每个信道对应一个寄存器值
|
---|
| 90 | +;RegAddr1,start_bit, stop_bit= 0x401420C0,4,0(5G RegAddr)
|
---|
| 91 | +RegAddr_Config = 0x401420C0,4,0
|
---|
| 92 | +;cbw20/cbw40 2g 3个channel 3,7,11
|
---|
| 93 | +;RegAddr1,start_bit, stop_bit= 0x401420C8,3,0(2G RegAddr)
|
---|
| 94 | +RegAddr_2G_CBW20 = 14,14,15
|
---|
| 95 | +;标志位,RegAddr_2G_CBW40 = version, reserved, reserved
|
---|
| 96 | +;version = 11:2G采用缺省配置; version = 20: 2G采用配置文件定义值
|
---|
| 97 | +RegAddr_2G_CBW40 = 20,11,11
|
---|
| 98 | +;cbw20,5g low band 8个channel 36, 40, 44, 48, 52, 56, 60, 64
|
---|
| 99 | +RegAddr_5G_LOW_CBW20 = 23, 24, 21, 21, 24, 22, 22, 20
|
---|
| 100 | +;cbw20,5g mid band 12个 channel 100,104,108,112,116,120,124,128,132,136,140,144
|
---|
| 101 | +RegAddr_5G_MID_CBW20 = 11, 13, 11, 13, 13, 13, 15, 15, 13, 13, 12, 12
|
---|
| 102 | +;cbw20,5g high band 8个 channel 149,153,157,161,165,169,173,177
|
---|
| 103 | +RegAddr_5G_HIGH_CBW20 = 12, 14, 12, 12, 11, 11, 11, 11
|
---|
| 104 | +;cbw40,5g low band 4个channel 38,46,54,62
|
---|
| 105 | +RegAddr_5G_LOW_CBW40 = 20, 17, 19, 17
|
---|
| 106 | +;cbw40,5g mid band 6个 channel 102,110,118,126,134,142
|
---|
| 107 | +RegAddr_5G_MID_CBW40 = 13, 11, 13, 14, 13, 12
|
---|
| 108 | +;cbw40,5g high band 4个 channel 151,159,167,175
|
---|
| 109 | +RegAddr_5G_HIGH_CBW40 = 13, 13, 10, 10
|
---|
| 110 | +;cbw80,5g low band 2个 channel 42,58
|
---|
| 111 | +RegAddr_5G_LOW_CBW80 = 19, 19
|
---|
| 112 | +;cbw80,5g mid band 3个 channel 106,122,138
|
---|
| 113 | +RegAddr_5G_MID_CBW80 = 11, 14, 11
|
---|
| 114 | +;cbw80,5g high band 2个 channel 155,171
|
---|
| 115 | +RegAddr_5G_HIGH_CBW80 = 12, 10
|
---|
| 116 | +
|
---|
| 117 | +;------------------------------------------------------------------------------
|
---|
| 118 | +[RegAddr2]
|
---|
| 119 | +;-----------------------------------------------------------------------------
|
---|
| 120 | +;RegAddr2,start_bit, stop_bit (5G RegAddr)
|
---|
| 121 | +RegAddr_Config = 0x40142080,4,1
|
---|
| 122 | +;cbw20/cbw40 2g 3个channel 3,7,11, RegAddr = 0x401420A8,4,1
|
---|
| 123 | +RegAddr_2G_CBW20 = 9, 9, 9
|
---|
| 124 | +;cbw40/cbw40 2g 3个channel 3,7,11, RegAddr = 0x401420AC,4,1
|
---|
| 125 | +RegAddr_2G_CBW40 = 9, 9, 9
|
---|
| 126 | +;cbw20,5g low band 8个channel 36,40,44,48,52,56,60,64
|
---|
| 127 | +RegAddr_5G_LOW_CBW20 = 6, 6, 6, 5, 5, 5, 6, 6
|
---|
| 128 | +;cbw20,5g mid band 12个 channel 100,104,108,112,116,120,124,128,132,136,140,144
|
---|
| 129 | +RegAddr_5G_MID_CBW20 = 7, 7, 7, 10, 10, 10, 10, 10, 8, 8, 8, 8
|
---|
| 130 | +;cbw20,5g high band 8个 channel 149,153,157,161,165,169,173,177
|
---|
| 131 | +RegAddr_5G_HIGH_CBW20 = 12, 12, 12, 12, 10, 10, 10, 10
|
---|
| 132 | +;cbw40,5g low band 4个channel 38,46,54,62
|
---|
| 133 | +RegAddr_5G_LOW_CBW40 = 6, 5, 5, 6
|
---|
| 134 | +;cbw40,5g mid band 6个 channel 102,110,118,126,134,142
|
---|
| 135 | +RegAddr_5G_MID_CBW40 = 7, 5, 5, 10, 8, 8
|
---|
| 136 | +;cbw40,5g high band 4个 channel 151,159,167,175
|
---|
| 137 | +RegAddr_5G_HIGH_CBW40 = 8, 8, 4, 4
|
---|
| 138 | +;cbw80,5g low band 2个 channel 42,58
|
---|
| 139 | +RegAddr_5G_LOW_CBW80 = 6, 5
|
---|
| 140 | +;cbw80,5g mid band 3个 channel 106,122,138
|
---|
| 141 | +RegAddr_5G_MID_CBW80 = 8, 10, 8
|
---|
| 142 | +;cbw80,5g high band 2个 channel 155,171
|
---|
| 143 | +RegAddr_5G_HIGH_CBW80 = 9, 4
|
---|
| 144 | +
|
---|
| 145 | +;------------------------------------------------------------------------------
|
---|
| 146 | +[RegAddr3]
|
---|
| 147 | +;-----------------------------------------------------------------------------
|
---|
| 148 | +;RegAddr3,start_bit, stop_bit (5G RegAddr)
|
---|
| 149 | +RegAddr_Config = 0x40142080,16,12
|
---|
| 150 | +;cbw20/cbw40 2g 3个channel 3,7,11, RegAddr = 0x401420A8,16,12
|
---|
| 151 | +RegAddr_2G_CBW20 = 18, 18, 18
|
---|
| 152 | +;cbw20/cbw40 2g 3个channel 3,7,11, RegAddr = 0x401420AC,16,12
|
---|
| 153 | +RegAddr_2G_CBW40 = 18, 18, 18
|
---|
| 154 | +;cbw20,5g low band 8个channel 36,40,44,48,52,56,60,64
|
---|
| 155 | +RegAddr_5G_LOW_CBW20 = 4, 4, 4, 4, 4, 4, 4, 4
|
---|
| 156 | +;cbw20,5g mid band 12个 channel 100,104,108,112,116,120,124,128,132,136,140,144
|
---|
| 157 | +RegAddr_5G_MID_CBW20 = 8, 8, 12, 10, 10, 10, 12, 12, 13, 13, 10, 10
|
---|
| 158 | +;cbw20,5g high band 8个 channel 149,153,157,161,165,169,173,177
|
---|
| 159 | +RegAddr_5G_HIGH_CBW20 = 16, 16, 12, 12, 12, 12, 12, 12
|
---|
| 160 | +;cbw40,5g low band 4个channel 38,46,54,62
|
---|
| 161 | +RegAddr_5G_LOW_CBW40 = 4, 4, 4, 4
|
---|
| 162 | +;cbw40,5g mid band 6个 channel 102,110,118,126,134,142
|
---|
| 163 | +RegAddr_5G_MID_CBW40 = 10, 10, 6, 13, 10, 10
|
---|
| 164 | +;cbw40,5g high band 4个 channel 151,159,167,175
|
---|
| 165 | +RegAddr_5G_HIGH_CBW40 = 11, 11, 6, 6
|
---|
| 166 | +;cbw80,5g low band 2个 channel 42,58
|
---|
| 167 | +RegAddr_5G_LOW_CBW80 = 4, 4
|
---|
| 168 | +;cbw80,5g mid band 3个 channel 106,122,138
|
---|
| 169 | +RegAddr_5G_MID_CBW80 = 10, 12, 12
|
---|
| 170 | +;cbw80,5g high band 2个 channel 155,171
|
---|
| 171 | +RegAddr_5G_HIGH_CBW80 = 13, 6
|
---|
| 172 | +;------------------------------------------------------------------------------
|
---|
| 173 | +
|
---|
| 174 | +
|
---|
| 175 | +;------------------------------------------------------------------------------
|
---|
| 176 | +
|
---|
| 177 | +
|
---|
| 178 | +
|
---|
| 179 | +
|
---|
| 180 | +
|
---|
| 181 | +
|
---|
| 182 | +
|
---|
| 183 | +
|
---|
.. | .. |
---|
| 1 | +;******************************************************************************
|
---|
| 2 | +; Wifi Limit Setup file
|
---|
| 3 | +;******************************************************************************
|
---|
| 4 | +[VERSION]
|
---|
| 5 | +WT_VERSION = EA6621QF_20230728
|
---|
| 6 | +;优化TX EVM
|
---|
| 7 | +;-----------------------------------------------------------------------------
|
---|
| 8 | +[CAL_POWER_INFO]
|
---|
| 9 | +;-----------------------------------------------------------------------------
|
---|
| 10 | +;设置浮点数,工具会自动做浮点转定点数的处理txpower,s(8,2)
|
---|
| 11 | +;发送给DUT之后,DUT会进行 <<Qnum 的操作,这里的数据不要提前移位 赋值的数值必须是10进制,与DUT侧对应
|
---|
| 12 | +;注释:11b rate 1M,2M,5.5M,11M
|
---|
| 13 | +G_TXPWR11B_UQ2 = 17, 17, 17, 17
|
---|
| 14 | +;注释:non-ht 2g cbw40 rate 6M/9M,12M,18M,24M,36M,48M,54M
|
---|
| 15 | +G_TXPWRNONHTDUP2G_UQ2 = 17, 17, 17, 17, 17, 17, 17, 15
|
---|
| 16 | +;注释:non-ht 5g cbw40 rate 6M,9M,12M,18M,24M,36M,48M,54M; cbw80 rate 6M,9M,12M,18M,24M,36M,48M,54M
|
---|
| 17 | +G_TXPWRNONHTDUP5G_UQ2 = 16, 16, 16, 16, 16, 16, 16, 15, 16, 16, 16, 16, 16, 16, 16, 15
|
---|
| 18 | +;注释:non-ht/ht/vht/he cbw20 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 19 | +;ht/vht/he cbw40 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 20 | +G_TXPWRMCS2G_UQ2 = 17, 17, 17, 17, 17, 17, 17, 15, 15, 14, 14, 13, 13, 17, 17, 17, 17, 17, 17, 17, 15, 15, 13, 13, 12, 12
|
---|
| 21 | +;写注释non-ht/ht/vht/he cbw20 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 22 | +;ht/vht/he cbw40 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 23 | +;ht/vht/he cbw80 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 24 | +G_TXPWRMCS5G_UQ2 = 16, 16, 16, 16, 16, 16, 16, 15, 14, 13, 13, 12, 12, 16, 16, 16, 16, 16, 16, 16, 15, 14, 13, 12, 12, 12, 15, 15, 15, 15, 15, 15, 15, 14, 13, 13, 11, 11, 11
|
---|
| 25 | +;写注释he TB SMALL RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 26 | +;he TB BIG RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 27 | +;he TB BIG RU BIG POWER rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 28 | +TBMAXTXPWR5G_UQ3 = 16, 16, 16, 16, 16, 16, 16, 15, 14, 13, 13, 12, 12, 16, 16, 16, 16, 16, 16, 16, 15, 14, 13, 13, 12, 12, 16, 16, 16, 16, 16, 16, 16, 15, 14, 13, 13, 12, 12
|
---|
| 29 | +;写注释he TB SMALL RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 30 | +;he TB BIG RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 31 | +;he TB BIG RU BIG POWER rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 32 | +TBMAXTXPWR2G_UQ3 = 17, 17, 17, 17, 17, 17, 17, 15, 15, 14, 14, 13, 13, 17, 17, 17, 17, 17, 17, 17, 15, 15, 14, 14, 13, 13, 17, 17, 17, 17, 17, 17, 17, 15, 15, 14, 14, 13, 13
|
---|
| 33 | +;写注释 5G,2G MIN TX POWER
|
---|
| 34 | +TBMINTXPWR_SQ2 = 00, 00
|
---|
| 35 | +
|
---|
| 36 | +;注释:11b rate 1M,2M,5.5M,11M
|
---|
| 37 | +G_TXPWR11B_UQ2_DELTA = 00, 00, 00, 00
|
---|
| 38 | +;注释:non-ht 2g cbw40 rate 6M/9M,12M,18M,24M,36M,48M,54M
|
---|
| 39 | +G_TXPWRNONHTDUP2G_UQ2_DELTA = 00, 00, 00, 00, 00, 00, 00, 00
|
---|
| 40 | +;注释:non-ht 5g cbw40 rate 6M,9M,12M,18M,24M,36M,48M,54M; cbw80 rate 6M,9M,12M,18M,24M,36M,48M,54M
|
---|
| 41 | +G_TXPWRNONHTDUP5G_UQ2_DELTA = 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00
|
---|
| 42 | +;注释:non-ht/ht/vht/he cbw20 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 43 | +;ht/vht/he cbw40 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 44 | +G_TXPWRMCS2G_UQ2_DELTA = 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00
|
---|
| 45 | +;写注释non-ht/ht/vht/he cbw20 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 46 | +;ht/vht/he cbw40 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 47 | +;ht/vht/he cbw80 rate dcmMCS0,DCMMCS1/mcs0/6m/9m,DCMMCS3/12M/mcs1,DCMMCS4/18M/mcs2,24M/mcs3,36M/mcs4,48M/mcs5,54M/mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 48 | +G_TXPWRMCS5G_UQ2_DELTA = 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00
|
---|
| 49 | +;写注释he TB SMALL RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 50 | +;he TB BIG RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 51 | +;he TB BIG RU BIG POWER rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 52 | +TBMAXTXPWR5G_UQ3_DELTA = 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00
|
---|
| 53 | +;写注释he TB SMALL RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 54 | +;he TB BIG RU rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 55 | +;he TB BIG RU BIG POWER rate dcmMCS0,DCMMCS1/mcs0,DCMMCS3/mcs1,DCMMCS4/mcs2,mcs3,mcs4,mcs5,mcs6,mcs7,mcs8,mcs9,mcs10,mcs11,
|
---|
| 56 | +TBMAXTXPWR2G_UQ3_DELTA = 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00
|
---|
| 57 | +;写注释 5G,2G MIN TX POWER
|
---|
| 58 | +TBMINTXPWR_SQ2_DELTA = 00, 00
|
---|
| 59 | +;-----------------------------------------------------------------------------
|
---|
| 60 | +[CHAN_POWER_COMPINFO]
|
---|
| 61 | +;-----------------------------------------------------------------------------
|
---|
| 62 | +;设置浮点数,工具会自动做浮点转定点数的处理。按频点补偿txpower,s(8,2),正数表示加功率,负数表示减功率
|
---|
| 63 | +;cbw20,2g 14个channel 1,2,3,4,5,6,7,8,9,10,11,12,13,14
|
---|
| 64 | +G_COMPCHANTXPWR2G_CBW20_SQ2 = 0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
---|
| 65 | +;cbw40,2g 9个channel 3,4,5,6,7,8,9,10,11
|
---|
| 66 | +G_COMPCHANTXPWR2G_CBW40_SQ2 = 0,0,0,0,0,0,0,0,0
|
---|
| 67 | +;cbw20,5g low band 8个channel 36,40,44,48,52,56,60,64
|
---|
| 68 | +G_COMPCHANTXPWR5G_LOW_CBW20_SQ2 = 0,0,0,0,0,0,0,0
|
---|
| 69 | +;cbw20,5g mid band 12个 channel 100,104,108,112,116,120,124,128,132,136,140,144
|
---|
| 70 | +G_COMPCHANTXPWR5G_MID_CBW20_SQ2 = 0,0,0,0,0,0,0,0,0,0,0,0
|
---|
| 71 | +;cbw20,5g high band 8个 channel 149,153,157,161,165,169,173,177
|
---|
| 72 | +G_COMPCHANTXPWR5G_HIGH_CBW20_SQ2 = 0,0,0,0,0,0,0,0
|
---|
| 73 | +;cbw40,5g low band 4个channel 38,46,54,62
|
---|
| 74 | +G_COMPCHANTXPWR5G_LOW_CBW40_SQ2 = 0,0,0,0
|
---|
| 75 | +;cbw40,5g mid band 6个 channel 102,110,118,126,134,142
|
---|
| 76 | +G_COMPCHANTXPWR5G_MID_CBW40_SQ2 = 0,0,0,0,0,0
|
---|
| 77 | +;cbw40,5g high band 4个 channel 151,159,167,175
|
---|
| 78 | +G_COMPCHANTXPWR5G_HIGH_CBW40_SQ2 = 0,0,0,0
|
---|
| 79 | +;cbw80,5g low band 2个 channel 42,58
|
---|
| 80 | +G_COMPCHANTXPWR5G_LOW_CBW80_SQ2 = 0,0
|
---|
| 81 | +;cbw80,5g mid band 3个 channel 106,122,138
|
---|
| 82 | +G_COMPCHANTXPWR5G_MID_CBW80_SQ2 = 0,0,0
|
---|
| 83 | +;cbw80,5g high band 2个 channel 155,171
|
---|
| 84 | +G_COMPCHANTXPWR5G_HIGH_CBW80_SQ2 = 0,0
|
---|
| 85 | +
|
---|
| 86 | +;-----------------------------------------------------------------------------
|
---|
| 87 | +[RegAddr1]
|
---|
| 88 | +;-----------------------------------------------------------------------------
|
---|
| 89 | +;寄存器配置,RegAddr是寄存器地址,每个信道对应一个寄存器值
|
---|
| 90 | +;RegAddr1,start_bit, stop_bit = 0x401420C0,4,0
|
---|
| 91 | +RegAddr_Config = 0x401420C0,4,0
|
---|
| 92 | +;cbw20 2g 3个channel 3,7,11
|
---|
| 93 | +RegAddr_2G_CBW20 = 11,11,11
|
---|
| 94 | +;cbw40 2g 3个channel 3,7,11
|
---|
| 95 | +RegAddr_2G_CBW40 = 11,11,11
|
---|
| 96 | +;cbw20,5g low band 8个channel 36,40,44,48,52,56,60,64
|
---|
| 97 | +RegAddr_5G_LOW_CBW20 = 20, 20, 20, 19, 19, 19, 17, 17
|
---|
| 98 | +;cbw20,5g mid band 12个 channel 100,104,108,112,116,120,124,128,132,136,140,144
|
---|
| 99 | +RegAddr_5G_MID_CBW20 = 13, 13, 13, 13, 13, 13, 13, 13, 11, 11, 10, 10
|
---|
| 100 | +;cbw20,5g high band 8个 channel 149,153,157,161,165,169,173,177
|
---|
| 101 | +RegAddr_5G_HIGH_CBW20 = 10, 10, 10, 10, 10, 10, 10, 10
|
---|
| 102 | +;cbw40,5g low band 4个channel 38,46,54,62
|
---|
| 103 | +RegAddr_5G_LOW_CBW40 = 20, 19, 19, 17
|
---|
| 104 | +;cbw40,5g mid band 6个 channel 102,110,118,126,134,142
|
---|
| 105 | +RegAddr_5G_MID_CBW40 = 13, 13, 13, 13, 11, 10
|
---|
| 106 | +;cbw40,5g high band 4个 channel 151,159,167,175
|
---|
| 107 | +RegAddr_5G_HIGH_CBW40 = 10, 10, 10, 10
|
---|
| 108 | +;cbw80,5g low band 2个 channel 42,58
|
---|
| 109 | +RegAddr_5G_LOW_CBW80 = 20, 19
|
---|
| 110 | +;cbw80,5g mid band 3个 channel 106,122,138
|
---|
| 111 | +RegAddr_5G_MID_CBW80 = 13, 13, 10
|
---|
| 112 | +;cbw80,5g high band 2个 channel 155,171
|
---|
| 113 | +RegAddr_5G_HIGH_CBW80 = 10, 10
|
---|
| 114 | +
|
---|
| 115 | +;------------------------------------------------------------------------------
|
---|
| 116 | +[RegAddr2]
|
---|
| 117 | +;-----------------------------------------------------------------------------
|
---|
| 118 | +;RegAddr2,start_bit, stop_bit = 0x40142080,4,1
|
---|
| 119 | +RegAddr_Config = 0x40142080,4,1
|
---|
| 120 | +;cbw20 2g 3个channel 3,7,11
|
---|
| 121 | +RegAddr_2G_CBW20 = 7, 7, 7
|
---|
| 122 | +;cbw40 2g 3个channel 3,7,11
|
---|
| 123 | +RegAddr_2G_CBW40 = 7, 7, 7
|
---|
| 124 | +;cbw20,5g low band 8个channel 36,40,44,48,52,56,60,64
|
---|
| 125 | +RegAddr_5G_LOW_CBW20 = 6, 6, 6, 5, 5, 5, 6, 6
|
---|
| 126 | +;cbw20,5g mid band 12个 channel 100,104,108,112,116,120,124,128,132,136,140,144
|
---|
| 127 | +RegAddr_5G_MID_CBW20 = 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6
|
---|
| 128 | +;cbw20,5g high band 8个 channel 149,153,157,161,165,169,173,177
|
---|
| 129 | +RegAddr_5G_HIGH_CBW20 = 6, 6, 8, 8, 4, 4, 4, 4
|
---|
| 130 | +;cbw40,5g low band 4个channel 38,46,54,62
|
---|
| 131 | +RegAddr_5G_LOW_CBW40 = 6, 5, 5, 6
|
---|
| 132 | +;cbw40,5g mid band 6个 channel 102,110,118,126,134,142
|
---|
| 133 | +RegAddr_5G_MID_CBW40 = 5, 5, 5, 5, 6, 6
|
---|
| 134 | +;cbw40,5g high band 4个 channel 151,159,167,175
|
---|
| 135 | +RegAddr_5G_HIGH_CBW40 = 6, 8, 4, 4
|
---|
| 136 | +;cbw80,5g low band 2个 channel 42,58
|
---|
| 137 | +RegAddr_5G_LOW_CBW80 = 6, 5
|
---|
| 138 | +;cbw80,5g mid band 3个 channel 106,122,138
|
---|
| 139 | +RegAddr_5G_MID_CBW80 = 5, 5, 6
|
---|
| 140 | +;cbw80,5g high band 2个 channel 155,171
|
---|
| 141 | +RegAddr_5G_HIGH_CBW80 = 8, 4
|
---|
| 142 | +
|
---|
| 143 | +;------------------------------------------------------------------------------
|
---|
| 144 | +[RegAddr3]
|
---|
| 145 | +;-----------------------------------------------------------------------------
|
---|
| 146 | +;RegAddr3,start_bit, stop_bit = 0x40142080,16,12
|
---|
| 147 | +RegAddr_Config = 0x40142080,16,12
|
---|
| 148 | +;cbw20 2g 3个channel 3,7,11
|
---|
| 149 | +RegAddr_2G_CBW20 = 4, 4, 4
|
---|
| 150 | +;cbw40 2g 3个channel 3,7,11
|
---|
| 151 | +RegAddr_2G_CBW40 = 4, 4, 4
|
---|
| 152 | +;cbw20,5g low band 8个channel 36,40,44,48,52,56,60,64
|
---|
| 153 | +RegAddr_5G_LOW_CBW20 = 4, 4, 4, 4, 4, 4, 4, 4
|
---|
| 154 | +;cbw20,5g mid band 12个 channel 100,104,108,112,116,120,124,128,132,136,140,144
|
---|
| 155 | +RegAddr_5G_MID_CBW20 = 8, 8, 6, 6, 6, 6, 6, 6, 8, 8, 4, 4
|
---|
| 156 | +;cbw20,5g high band 8个 channel 149,153,157,161,165,169,173,177
|
---|
| 157 | +RegAddr_5G_HIGH_CBW20 = 7, 7, 4, 4, 6, 6, 6, 6
|
---|
| 158 | +;cbw40,5g low band 4个channel 38,46,54,62
|
---|
| 159 | +RegAddr_5G_LOW_CBW40 = 4, 4, 4, 4
|
---|
| 160 | +;cbw40,5g mid band 6个 channel 102,110,118,126,134,142
|
---|
| 161 | +RegAddr_5G_MID_CBW40 = 8, 6, 6, 6, 8, 4
|
---|
| 162 | +;cbw40,5g high band 4个 channel 151,159,167,175
|
---|
| 163 | +RegAddr_5G_HIGH_CBW40 = 7, 4, 6, 6
|
---|
| 164 | +;cbw80,5g low band 2个 channel 42,58
|
---|
| 165 | +RegAddr_5G_LOW_CBW80 = 4, 4
|
---|
| 166 | +;cbw80,5g mid band 3个 channel 106,122,138
|
---|
| 167 | +RegAddr_5G_MID_CBW80 = 8, 6, 4
|
---|
| 168 | +;cbw80,5g high band 2个 channel 155,171
|
---|
| 169 | +RegAddr_5G_HIGH_CBW80 = 4, 6
|
---|
| 170 | +;------------------------------------------------------------------------------
|
---|
| 171 | +
|
---|
| 172 | +
|
---|
| 173 | +;------------------------------------------------------------------------------
|
---|
| 174 | +
|
---|
| 175 | +
|
---|
| 176 | +
|
---|
| 177 | +
|
---|
| 178 | +
|
---|
| 179 | +
|
---|
| 180 | +
|
---|
| 181 | +
|
---|
.. | .. |
---|
| 1 | +# |
---|
| 2 | +# Copyright (C) 2008 The Android Open Source Project |
---|
| 3 | +# |
---|
| 4 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
---|
| 5 | +# you may not use this file except in compliance with the License. |
---|
| 6 | +# You may obtain a copy of the License at |
---|
| 7 | +# |
---|
| 8 | +# http://www.apache.org/licenses/LICENSE-2.0 |
---|
| 9 | +# |
---|
| 10 | +# Unless required by applicable law or agreed to in writing, software |
---|
| 11 | +# distributed under the License is distributed on an "AS IS" BASIS, |
---|
| 12 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
---|
| 13 | +# See the License for the specific language governing permissions and |
---|
| 14 | +# limitations under the License. |
---|
| 15 | +# |
---|
| 16 | + |
---|
| 17 | +######################## |
---|
| 18 | + |
---|
| 19 | +PRODUCT_COPY_FILES += \ |
---|
| 20 | + #hardware/seekwave/firmware/SDIO-Fimware/SWT6621S_IRAM_SDIO.bin:$(TARGET_COPY_OUT_VENDOR)/etc/firmware/SWT6621S_IRAM_SDIO.bin \ |
---|
| 21 | + #hardware/seekwave/firmware/SDIO-Fimware/SWT6621S_DRAM_SDIO.bin:$(TARGET_COPY_OUT_VENDOR)/etc/firmware/SWT6621S_DRAM_SDIO.bin \ |
---|
| 22 | + #hardware/seekwave/firmware/SDIO-Fimware/SWT6621S_SEEKWAVE_R00001.bin:$(TARGET_COPY_OUT_VENDOR)/etc/firmware/SWT6621S_SEEKWAVE_R00001.bin |
---|
| 23 | +PRODUCT_COPY_FILES += $(call find-copy-subdir-files,*,hardware/seekwave/firmware/SDIO-Fimware,$(TARGET_COPY_OUT_VENDOR)/etc/firmware) |
---|
| 24 | +######################## |
---|
.. | .. |
---|
| 1 | + |
---|
| 2 | +LOCAL_PATH := $(call my-dir) |
---|
| 3 | + |
---|
| 4 | +ifneq ($(BOARD_HAVE_BLUETOOTH_SEEKWAVE),) |
---|
| 5 | + |
---|
| 6 | +include $(CLEAR_VARS) |
---|
| 7 | + |
---|
| 8 | +BDROID_DIR := $(TOP_DIR)system/bt |
---|
| 9 | +ifeq ($(PLATFORM_VERSION),13) |
---|
| 10 | +BDROID_DIR := $(TOP_DIR)packages/modules/Bluetooth/system |
---|
| 11 | +else ifeq ($(PLATFORM_VERSION),14) |
---|
| 12 | +BDROID_DIR := $(TOP_DIR)packages/modules/Bluetooth/system |
---|
| 13 | +endif |
---|
| 14 | + |
---|
| 15 | +LOCAL_SRC_FILES := \ |
---|
| 16 | + src/bt_vendor_skw.c \ |
---|
| 17 | + src/scom_vendor.c \ |
---|
| 18 | + src/skw_log.c \ |
---|
| 19 | + src/skw_gen_addr.c \ |
---|
| 20 | + src/skw_ext.c \ |
---|
| 21 | + src/skw_btsnoop.c |
---|
| 22 | + |
---|
| 23 | +LOCAL_C_INCLUDES += \ |
---|
| 24 | + $(LOCAL_PATH)/include \ |
---|
| 25 | + $(BDROID_DIR)/hci/include |
---|
| 26 | + |
---|
| 27 | +LOCAL_C_INCLUDES += $(bdroid_C_INCLUDES) |
---|
| 28 | +LOCAL_CFLAGS += $(bdroid_CFLAGS) |
---|
| 29 | + |
---|
| 30 | +LOCAL_SHARED_LIBRARIES := \ |
---|
| 31 | + libcutils \ |
---|
| 32 | + libutils \ |
---|
| 33 | + liblog |
---|
| 34 | + |
---|
| 35 | +LOCAL_MODULE := libbt-vendor |
---|
| 36 | +LOCAL_MODULE_TAGS := optional |
---|
| 37 | +LOCAL_MODULE_CLASS := SHARED_LIBRARIES |
---|
| 38 | +LOCAL_MODULE_OWNER := seekwave |
---|
| 39 | +LOCAL_PROPRIETARY_MODULE := true |
---|
| 40 | + |
---|
| 41 | +include $(BUILD_SHARED_LIBRARY) |
---|
| 42 | + |
---|
| 43 | +endif #BOARD_HAVE_BLUETOOTH_SEEKWAVE |
---|
.. | .. |
---|
| 1 | +/****************************************************************************** |
---|
| 2 | + * |
---|
| 3 | + * Copyright (C) 2020-2021 SeekWave Technology |
---|
| 4 | + * |
---|
| 5 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
---|
| 6 | + * |
---|
| 7 | + ******************************************************************************/ |
---|
| 8 | + |
---|
| 9 | +#ifndef __BT_VENDOR_SKW_H__ |
---|
| 10 | +#define __BT_VENDOR_SKW_H__ |
---|
| 11 | + |
---|
| 12 | + |
---|
| 13 | +#include "bt_vendor_lib.h" |
---|
| 14 | +#include <string.h> |
---|
| 15 | +#include <fcntl.h> |
---|
| 16 | +#include <errno.h> |
---|
| 17 | +#include <stdio.h> |
---|
| 18 | +#include <stdlib.h> |
---|
| 19 | +#include <dirent.h> |
---|
| 20 | +#include <sys/stat.h> |
---|
| 21 | +#include <unistd.h> |
---|
| 22 | +#include <sys/types.h> |
---|
| 23 | +#include <sys/socket.h> |
---|
| 24 | +#include <sys/ioctl.h> |
---|
| 25 | +#include <sys/epoll.h> |
---|
| 26 | +#include <sys/eventfd.h> |
---|
| 27 | +#include <unistd.h> |
---|
| 28 | +#include <ctype.h> |
---|
| 29 | +#include <cutils/properties.h> |
---|
| 30 | + |
---|
| 31 | + |
---|
| 32 | +#define SKW_LIBBT_VERSION "0.2" |
---|
| 33 | + |
---|
| 34 | +#define SKWBT_TRANS_TYPE_H4 0x01 |
---|
| 35 | +#define SKWBT_TRANS_TYPE_UART 0x10 |
---|
| 36 | +#define SKWBT_TRANS_TYPE_SDIO 0x20 |
---|
| 37 | +#define SKWBT_TRANS_TYPE_USB 0x40 |
---|
| 38 | + |
---|
| 39 | + |
---|
| 40 | +#define SKW_CHIPID_6316 0x5301 |
---|
| 41 | +#define SKW_CHIPID_6160 0x0017 |
---|
| 42 | +#define SKW_CHIPID_6160_LITE 0x5302 |
---|
| 43 | + |
---|
| 44 | + |
---|
| 45 | +//#define IOCTL_CMD_WAKEUP_ADV_EN 0x01 |
---|
| 46 | +#define IOCTL_CMD_LOG_EN_GET _IOWR('S', 2, uint8_t *) |
---|
| 47 | + |
---|
| 48 | +#ifndef FALSE |
---|
| 49 | +#define FALSE 0 |
---|
| 50 | +#endif |
---|
| 51 | + |
---|
| 52 | +#ifndef TRUE |
---|
| 53 | +#define TRUE 1 |
---|
| 54 | +#endif |
---|
| 55 | + |
---|
| 56 | + |
---|
| 57 | +extern bt_vendor_callbacks_t *bt_vendor_cbacks; |
---|
| 58 | +extern char skwbt_transtype; |
---|
| 59 | +extern char skwbtuartonly; |
---|
| 60 | +extern char skwbtNoSleep; |
---|
| 61 | +extern int btboot_fp; |
---|
| 62 | +extern int btpw_fp; |
---|
| 63 | + |
---|
| 64 | +#endif /*BT_UNUSED_H*/ |
---|
.. | .. |
---|
| 1 | +/****************************************************************************** |
---|
| 2 | + * |
---|
| 3 | + * Copyright (C) 2020-2021 SeekWave Technology |
---|
| 4 | + * |
---|
| 5 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
---|
| 6 | + * |
---|
| 7 | + ******************************************************************************/ |
---|
| 8 | + |
---|
| 9 | +#ifndef __SCOM_VENDOR_H__ |
---|
| 10 | +#define __SCOM_VENDOR_H__ |
---|
| 11 | + |
---|
| 12 | +#include <sys/types.h> |
---|
| 13 | + |
---|
| 14 | + |
---|
| 15 | +/* Structure used to configure serial port during open */ |
---|
| 16 | +typedef struct |
---|
| 17 | +{ |
---|
| 18 | + uint16_t fmt; /* Data format */ |
---|
| 19 | + uint8_t baud; /* Baud rate */ |
---|
| 20 | + uint8_t hw_fctrl; /*hardware flowcontrol*/ |
---|
| 21 | +} tUSERIAL_CFG; |
---|
| 22 | + |
---|
| 23 | + |
---|
| 24 | +/* Hardware Configuration State */ |
---|
| 25 | +enum { |
---|
| 26 | + HW_CFG_INIT = 0x00, |
---|
| 27 | + HW_CFG_START, |
---|
| 28 | + HW_CFG_WRITE_OS_TYPE, |
---|
| 29 | + HW_CFG_READ_HCI_VERSION, |
---|
| 30 | + HW_CFG_NV_SEND, |
---|
| 31 | + HW_CFG_NV_SEND_CMPL, |
---|
| 32 | + HW_CFG_WRITE_BD_ADDR, |
---|
| 33 | + HW_CFG_WRITE_WAKEUP_ADV_DATA, |
---|
| 34 | + HW_RESET_CONTROLLER, |
---|
| 35 | + HARDWARE_INIT_COMPLETE |
---|
| 36 | +}; |
---|
| 37 | + |
---|
| 38 | +#define HCI_CMD_MAX_LEN 258 |
---|
| 39 | + |
---|
| 40 | +#define NV_FILE_RD_BLOCK_SIZE 252 |
---|
| 41 | +#define DEVICE_NODE_MAX_LEN 64 |
---|
| 42 | + |
---|
| 43 | +#define NV_TAG_BD_ADDR 0x01 |
---|
| 44 | +#define NV_TAG_DSP_LOG_SETTING 0x05 |
---|
| 45 | + |
---|
| 46 | +#define SCOM_READ_BUFFER_LEN 2056 |
---|
| 47 | + |
---|
| 48 | +enum{ |
---|
| 49 | + BT_COM_PORT_CMDEVT = 0x0,//CMD/Evet, in case of UART:ACL + AUDIO |
---|
| 50 | + BT_COM_PORT_ACL,//ACL IN/OUT |
---|
| 51 | + BT_COM_PORT_AUDIO,//AUDIO IN/OUT |
---|
| 52 | + BT_COM_PORT_ISO, |
---|
| 53 | + BT_COM_PORT_SIZE |
---|
| 54 | +}; |
---|
| 55 | + |
---|
| 56 | + |
---|
| 57 | +typedef struct |
---|
| 58 | +{ |
---|
| 59 | + uint32_t baudrate; //for UART |
---|
| 60 | + uint8_t state; /* Hardware configuration state mechine*/ |
---|
| 61 | + uint8_t file_offset;//for nv |
---|
| 62 | + FILE * nv_fp; |
---|
| 63 | +} bt_hw_cfg_cb_st; |
---|
| 64 | + |
---|
| 65 | +typedef struct |
---|
| 66 | +{ |
---|
| 67 | + int fd; // |
---|
| 68 | + int socket_fd[2]; |
---|
| 69 | + int signal_fd[2]; |
---|
| 70 | + int epoll_fd; |
---|
| 71 | + struct termios termios; /* serial terminal of BT port */ |
---|
| 72 | + char port_name[DEVICE_NODE_MAX_LEN]; |
---|
| 73 | + pthread_t thread_socket_id; |
---|
| 74 | + pthread_t thread_uart_id; |
---|
| 75 | + char thread_running; |
---|
| 76 | + char recv_comm_thread_running; |
---|
| 77 | + char is_busying; |
---|
| 78 | + char read_retry; |
---|
| 79 | + |
---|
| 80 | + volatile char driver_state; |
---|
| 81 | + int mode; |
---|
| 82 | +} scomm_vnd_st; |
---|
| 83 | + |
---|
| 84 | +typedef struct{ |
---|
| 85 | + int fd; // the file descriptor to monitor for events. |
---|
| 86 | + void *context; // a context that's passed back to the *_ready functions.. |
---|
| 87 | + pthread_mutex_t lock; // protects the lifetime of this object and all variables. |
---|
| 88 | + |
---|
| 89 | + void (*read_ready)(void *context); // function to call when the file descriptor becomes readable. |
---|
| 90 | + void (*write_ready)(void *context); // function to call when the file descriptor becomes writeable. |
---|
| 91 | +}skw_socket_object_st; |
---|
| 92 | + |
---|
| 93 | + |
---|
| 94 | + |
---|
| 95 | +#define HCI_CMD_PREAMBLE_SIZE 3 |
---|
| 96 | +#define HCI_EVT_CMD_CMPL_OPCODE_OFFSET 3 //opcode's offset in HCI_Command_Complete Event |
---|
| 97 | +#define HCI_EVT_CMD_CMPL_STATUS_OFFSET 5 //status's offset in HCI_Command_Complete Event |
---|
| 98 | + |
---|
| 99 | + |
---|
| 100 | + |
---|
| 101 | +/* |
---|
| 102 | + * Definitions for HCI groups |
---|
| 103 | +*/ |
---|
| 104 | +#define HCI_GRP_LINK_CONTROL_CMDS (0x01 << 10) /* 0x0400 */ |
---|
| 105 | +#define HCI_GRP_LINK_POLICY_CMDS (0x02 << 10) /* 0x0800 */ |
---|
| 106 | +#define HCI_GRP_HOST_CONT_BASEBAND_CMDS (0x03 << 10) /* 0x0C00 */ |
---|
| 107 | +#define HCI_GRP_INFORMATIONAL_PARAMS (0x04 << 10) /* 0x1000 */ |
---|
| 108 | +#define HCI_GRP_STATUS_PARAMS (0x05 << 10) /* 0x1400 */ |
---|
| 109 | +#define HCI_GRP_TESTING_CMDS (0x06 << 10) /* 0x1800 */ |
---|
| 110 | +#define HCI_GRP_BLE_CMDS (0x08 << 10) /* 0x2000 (LE Commands) */ |
---|
| 111 | + |
---|
| 112 | +#define HCI_GRP_VENDOR_SPECIFIC (0x3F << 10) /* 0xFC00 */ |
---|
| 113 | + |
---|
| 114 | +/* Group occupies high 6 bits of the HCI command rest is opcode itself */ |
---|
| 115 | +#define HCI_OGF(p) (uint8_t)((0xFC00 & (p)) >> 10) |
---|
| 116 | +#define HCI_OCF(p) (0x3FF & (p)) |
---|
| 117 | + |
---|
| 118 | + |
---|
| 119 | +#define HCI_RESET (0x0003 | HCI_GRP_HOST_CONT_BASEBAND_CMDS) |
---|
| 120 | +#define HCI_READ_LOCAL_VERSION_INFO (0x0001 | HCI_GRP_INFORMATIONAL_PARAMS) |
---|
| 121 | + |
---|
| 122 | +#define HCI_CMD_SKW_BT_NVDS 0xFC80 |
---|
| 123 | +#define HCI_CMD_WRITE_BD_ADDR 0xFC82 |
---|
| 124 | +#define HCI_CMD_WRITE_OS_TYPE 0xFC83 |
---|
| 125 | +#define HCI_CMD_WRITE_WAKEUP_ADV_DATA 0xFC84 |
---|
| 126 | +#define HCI_CMD_WRITE_WAKEUP_ADV_ENABLE 0xFC85 |
---|
| 127 | + |
---|
| 128 | + |
---|
| 129 | +#define HCI_COMMAND_COMPLETE_EVENT 0x0E |
---|
| 130 | +#define HCI_COMMAND_STATUS_EVENT 0x0F |
---|
| 131 | +#define HCI_HARDWARE_ERROR_EVENT 0x10 |
---|
| 132 | + |
---|
| 133 | +#define HWERR_CODE_CP_ERROR 0x10 |
---|
| 134 | + |
---|
| 135 | +#define CP_ERR_ENOTCONN -107 //Transport endpoint |
---|
| 136 | + |
---|
| 137 | + |
---|
| 138 | +#define HCI_COMMAND_PKT_PREAMBLE_SIZE 0x03 |
---|
| 139 | +#define HCI_ACLDATA_PKT_PREAMBLE_SIZE 0x04 |
---|
| 140 | +#define HCI_SCODATA_PKT_PREAMBLE_SIZE 0x03 |
---|
| 141 | +#define HCI_EVENT_PKT_PREAMBLE_SIZE 0x02 |
---|
| 142 | +#define HCI_ISODATA_PKT_PREAMBLE_SIZE 0x04 |
---|
| 143 | +#define HCI_EVENT_SKWLOG_PREAMBLE_SIZE 0x03 |
---|
| 144 | + |
---|
| 145 | +#define HCI_COMMON_DATA_LENGTH_INDEX 0x03 |
---|
| 146 | +#define HCI_EVENT_DATA_LENGTH_INDEX 0x02 |
---|
| 147 | +#define HCI_SKWLOG_DATA_LENGTH_INDEX 0x02 |
---|
| 148 | + |
---|
| 149 | + |
---|
| 150 | + |
---|
| 151 | +//---------------------UART Para Start-------------------------// |
---|
| 152 | + |
---|
| 153 | +/**** baud rates ****/ |
---|
| 154 | +#define USERIAL_BAUD_300 0 |
---|
| 155 | +#define USERIAL_BAUD_600 1 |
---|
| 156 | +#define USERIAL_BAUD_1200 2 |
---|
| 157 | +#define USERIAL_BAUD_2400 3 |
---|
| 158 | +#define USERIAL_BAUD_9600 4 |
---|
| 159 | +#define USERIAL_BAUD_19200 5 |
---|
| 160 | +#define USERIAL_BAUD_57600 6 |
---|
| 161 | +#define USERIAL_BAUD_115200 7 |
---|
| 162 | +#define USERIAL_BAUD_230400 8 |
---|
| 163 | +#define USERIAL_BAUD_460800 9 |
---|
| 164 | +#define USERIAL_BAUD_921600 10 |
---|
| 165 | +#define USERIAL_BAUD_1M 11 |
---|
| 166 | +#define USERIAL_BAUD_1_5M 12 |
---|
| 167 | +#define USERIAL_BAUD_2M 13 |
---|
| 168 | +#define USERIAL_BAUD_3M 14 |
---|
| 169 | +#define USERIAL_BAUD_4M 15 |
---|
| 170 | +#define USERIAL_BAUD_AUTO 16 |
---|
| 171 | + |
---|
| 172 | +/**** Data Format ****/ |
---|
| 173 | +/* Stop Bits */ |
---|
| 174 | +#define USERIAL_STOPBITS_1 1 |
---|
| 175 | +#define USERIAL_STOPBITS_1_5 (1<<1) |
---|
| 176 | +#define USERIAL_STOPBITS_2 (1<<2) |
---|
| 177 | + |
---|
| 178 | +/* Parity Bits */ |
---|
| 179 | +#define USERIAL_PARITY_NONE (1<<3) |
---|
| 180 | +#define USERIAL_PARITY_EVEN (1<<4) |
---|
| 181 | +#define USERIAL_PARITY_ODD (1<<5) |
---|
| 182 | + |
---|
| 183 | +/* Data Bits */ |
---|
| 184 | +#define USERIAL_DATABITS_5 (1<<6) |
---|
| 185 | +#define USERIAL_DATABITS_6 (1<<7) |
---|
| 186 | +#define USERIAL_DATABITS_7 (1<<8) |
---|
| 187 | +#define USERIAL_DATABITS_8 (1<<9) |
---|
| 188 | + |
---|
| 189 | + |
---|
| 190 | +#define USERIAL_HW_FLOW_CTRL_OFF 0 |
---|
| 191 | +#define USERIAL_HW_FLOW_CTRL_ON 1 |
---|
| 192 | + |
---|
| 193 | + |
---|
| 194 | +//---------------------UART Para End-------------------------// |
---|
| 195 | + |
---|
| 196 | + |
---|
| 197 | + |
---|
| 198 | +void scomm_vendor_init(); |
---|
| 199 | + |
---|
| 200 | +void scomm_vendor_set_port_name(uint8_t port_index, char *port_name, int mode); |
---|
| 201 | + |
---|
| 202 | +uint8_t scomm_vendor_check_port_valid(uint8_t port_index); |
---|
| 203 | + |
---|
| 204 | +int scomm_vendor_uart_open(uint8_t port_index); |
---|
| 205 | + |
---|
| 206 | +int scomm_vendor_usbsdio_open(uint8_t port_index); |
---|
| 207 | + |
---|
| 208 | +int scomm_vendor_socket_open(uint8_t port_index); |
---|
| 209 | + |
---|
| 210 | +void scomm_vendor_close(); |
---|
| 211 | + |
---|
| 212 | +void scomm_vendor_config_start(); |
---|
| 213 | + |
---|
| 214 | +void scomm_vendor_write_bt_state(); |
---|
| 215 | + |
---|
| 216 | +void scomm_vendor_parse_wakeup_adv_conf(char *data_str); |
---|
| 217 | + |
---|
| 218 | + |
---|
| 219 | +#endif |
---|
.. | .. |
---|
| 1 | +/****************************************************************************** |
---|
| 2 | + * |
---|
| 3 | + * Copyright (C) 2020-2021 SeekWave Technology |
---|
| 4 | + * |
---|
| 5 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
---|
| 6 | + * |
---|
| 7 | + ******************************************************************************/ |
---|
| 8 | + |
---|
| 9 | + |
---|
| 10 | +#ifndef __SKW_BTSNOOP_H__ |
---|
| 11 | +#define __SKW_BTSNOOP_H__ |
---|
| 12 | + |
---|
| 13 | + |
---|
| 14 | +#include <assert.h> |
---|
| 15 | +#include <errno.h> |
---|
| 16 | +#include <netinet/in.h> |
---|
| 17 | +#include <pthread.h> |
---|
| 18 | +#include <stdbool.h> |
---|
| 19 | +#include <string.h> |
---|
| 20 | +#include <sys/prctl.h> |
---|
| 21 | +#include <sys/socket.h> |
---|
| 22 | +#include <sys/types.h> |
---|
| 23 | +#include <time.h> |
---|
| 24 | +#include <utils/Log.h> |
---|
| 25 | +#include <sys/stat.h> |
---|
| 26 | +#include <stdio.h> |
---|
| 27 | +#include <stdlib.h> |
---|
| 28 | +#include <fcntl.h> |
---|
| 29 | + |
---|
| 30 | + |
---|
| 31 | + |
---|
| 32 | + |
---|
| 33 | +/* HCI Packet types */ |
---|
| 34 | +#define HCI_COMMAND_PKT 0x01 |
---|
| 35 | +#define HCI_ACLDATA_PKT 0x02 |
---|
| 36 | +#define HCI_SCODATA_PKT 0x03 |
---|
| 37 | +#define HCI_EVENT_PKT 0x04 |
---|
| 38 | +#define HCI_ISO_PKT 0x05 |
---|
| 39 | +#define HCI_EVENT_SKWLOG 0x07 |
---|
| 40 | + |
---|
| 41 | + |
---|
| 42 | +void skw_btsnoop_init(); |
---|
| 43 | +void skw_btsnoop_close(void); |
---|
| 44 | +void skw_btsnoop_capture(const uint8_t *packet, char is_received); |
---|
| 45 | + |
---|
| 46 | + |
---|
| 47 | + |
---|
| 48 | + |
---|
| 49 | +#endif |
---|
.. | .. |
---|
| 1 | +/****************************************************************************** |
---|
| 2 | + * |
---|
| 3 | + * Copyright (C) 2020-2021 SeekWave Technology |
---|
| 4 | + * |
---|
| 5 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
---|
| 6 | + * |
---|
| 7 | + ******************************************************************************/ |
---|
| 8 | + |
---|
| 9 | +#ifndef __SKW_COMMON_H__ |
---|
| 10 | +#define __SKW_COMMON_H__ |
---|
| 11 | + |
---|
| 12 | +#define SKW_UNUSED(x) (void)(x) |
---|
| 13 | +//#define SKW_UNUSED(x) (x = x) |
---|
| 14 | + |
---|
| 15 | +#ifndef TRUE |
---|
| 16 | +#define TRUE 1 |
---|
| 17 | +#endif |
---|
| 18 | + |
---|
| 19 | +#ifndef FALSE |
---|
| 20 | +#define FALSE 0 |
---|
| 21 | +#endif |
---|
| 22 | + |
---|
| 23 | + |
---|
| 24 | +#ifndef UINT8_TO_STREAM |
---|
| 25 | +#define UINT8_TO_STREAM(p, u8) {*(p)++ = (uint8_t)(u8);} |
---|
| 26 | +#endif |
---|
| 27 | + |
---|
| 28 | + |
---|
| 29 | +#ifndef UINT16_TO_STREAM |
---|
| 30 | +#define UINT16_TO_STREAM(p, u16) {*(p)++ = (uint8_t)(u16); *(p)++ = (uint8_t)((u16) >> 8);} |
---|
| 31 | +#endif |
---|
| 32 | + |
---|
| 33 | +#ifndef STREAM_TO_UINT16 |
---|
| 34 | +#define STREAM_TO_UINT16(u16, p) {u16 = ((uint16_t)(*(p)) + (((uint16_t)(*((p) + 1))) << 8)); (p) += 2;} |
---|
| 35 | +#endif |
---|
| 36 | + |
---|
| 37 | + |
---|
| 38 | +#define RW_NO_INTR(func) do {} while (((func) == -1) && (errno == EINTR)) |
---|
| 39 | + |
---|
| 40 | + |
---|
| 41 | +extern char skwdriverlog_en; |
---|
| 42 | +#define SKWBT_LOG(fmt, args...) do{if(skwdriverlog_en){ALOGD("[SKWBT]:" fmt, ## args);}}while(0) |
---|
| 43 | + |
---|
| 44 | +#define SKW_LOG_DEFAULT_SIZE (100 * 1024 * 1024)//300M |
---|
| 45 | + |
---|
| 46 | + |
---|
| 47 | +#endif |
---|
.. | .. |
---|
| 1 | +/****************************************************************************** |
---|
| 2 | + * |
---|
| 3 | + * Copyright (C) 2020-2021 SeekWave Technology |
---|
| 4 | + * |
---|
| 5 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
---|
| 6 | + * |
---|
| 7 | + ******************************************************************************/ |
---|
| 8 | +#ifndef __SKW_EXT_H__ |
---|
| 9 | +#define __SKW_EXT_H__ |
---|
| 10 | + |
---|
| 11 | +#define BLE_ADV_WAKEUP_ENABLE 1 |
---|
| 12 | + |
---|
| 13 | + |
---|
| 14 | + |
---|
| 15 | +#define BLE_ADV_WAKEUP_GRP_NUMS 3 |
---|
| 16 | + |
---|
| 17 | +typedef struct |
---|
| 18 | +{ |
---|
| 19 | + uint8_t grp_len; |
---|
| 20 | + uint8_t addr_offset; |
---|
| 21 | + uint8_t data[32]; |
---|
| 22 | + uint8_t mask[32]; |
---|
| 23 | +} Wakeup_ADV_Grp_St; |
---|
| 24 | + |
---|
| 25 | +typedef struct |
---|
| 26 | +{ |
---|
| 27 | + uint8_t gpio_no; |
---|
| 28 | + uint8_t level; |
---|
| 29 | + uint8_t data_len;//total len |
---|
| 30 | + uint8_t grp_nums; |
---|
| 31 | + Wakeup_ADV_Grp_St adv_group[BLE_ADV_WAKEUP_GRP_NUMS]; |
---|
| 32 | +} Wakeup_ADV_Info_St; |
---|
| 33 | + |
---|
| 34 | + |
---|
| 35 | +void skw_ext_inotify_thread_init(void); |
---|
| 36 | + |
---|
| 37 | +void skw_ext_inotify_thread_exit(void); |
---|
| 38 | + |
---|
| 39 | + |
---|
| 40 | + |
---|
| 41 | +#endif |
---|
.. | .. |
---|
| 1 | +/****************************************************************************** |
---|
| 2 | + * |
---|
| 3 | + * Copyright (C) 2020-2021 SeekWave Technology |
---|
| 4 | + * |
---|
| 5 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
---|
| 6 | + * |
---|
| 7 | + ******************************************************************************/ |
---|
| 8 | + |
---|
| 9 | +#ifndef __SKW_GEN_ADDR_H__ |
---|
| 10 | +#define __SKW_GEN_ADDR_H__ |
---|
| 11 | + |
---|
| 12 | +void skw_addr_gen_init(); |
---|
| 13 | + |
---|
| 14 | +void skw_addr_get(unsigned char *buffer); |
---|
| 15 | + |
---|
| 16 | +char skw_addr_from_ap(unsigned char *bd_addr); |
---|
| 17 | + |
---|
| 18 | + |
---|
| 19 | +#endif |
---|
.. | .. |
---|
| 1 | +/****************************************************************************** |
---|
| 2 | + * |
---|
| 3 | + * Copyright (C) 2020-2021 SeekWave Technology |
---|
| 4 | + * |
---|
| 5 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
---|
| 6 | + * |
---|
| 7 | + ******************************************************************************/ |
---|
| 8 | + |
---|
| 9 | +#ifndef __SKW_LOG_H__ |
---|
| 10 | +#define __SKW_LOG_H__ |
---|
| 11 | + |
---|
| 12 | +void skwlog_init(); |
---|
| 13 | + |
---|
| 14 | +void skwlog_reopen(char new_file); |
---|
| 15 | + |
---|
| 16 | +void skwlog_print_current_time(); |
---|
| 17 | + |
---|
| 18 | +void skwlog_write(unsigned char *buffer, unsigned int length); |
---|
| 19 | + |
---|
| 20 | +void skwlog_close(); |
---|
| 21 | + |
---|
| 22 | + |
---|
| 23 | +#endif |
---|
.. | .. |
---|
| 1 | + |
---|
| 2 | +CUR_PATH := hardware/seekwave/skwbt |
---|
| 3 | + |
---|
| 4 | + |
---|
| 5 | +PRODUCT_COPY_FILES += $(call find-copy-subdir-files,*,$(CUR_PATH)/vendor/etc/bluetooth,vendor/etc/bluetooth) |
---|
| 6 | + |
---|
| 7 | + |
---|
| 8 | +$(call inherit-product, hardware/seekwave/firmware/device-skw.mk) |
---|
.. | .. |
---|
| 1 | +/****************************************************************************** |
---|
| 2 | + * |
---|
| 3 | + * Copyright (C) 2020-2021 SeekWave Technology |
---|
| 4 | + * |
---|
| 5 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
---|
| 6 | + * |
---|
| 7 | + ******************************************************************************/ |
---|
| 8 | + |
---|
| 9 | +/****************************************************************************** |
---|
| 10 | + * |
---|
| 11 | + * Filename: bt_vendor_skw.c |
---|
| 12 | + * |
---|
| 13 | + * Description: SeekWave vendor specific library implementation |
---|
| 14 | + * |
---|
| 15 | + ******************************************************************************/ |
---|
| 16 | + |
---|
| 17 | +#undef NDEBUG |
---|
| 18 | +#define LOG_TAG "libbt_vendor" |
---|
| 19 | + |
---|
| 20 | + |
---|
| 21 | +#include <utils/Log.h> |
---|
| 22 | +#include "bt_vendor_skw.h" |
---|
| 23 | +#include "scom_vendor.h" |
---|
| 24 | +#include "skw_btsnoop.h" |
---|
| 25 | +#include "skw_log.h" |
---|
| 26 | +#include "skw_gen_addr.h" |
---|
| 27 | +#include "skw_common.h" |
---|
| 28 | +#include <cutils/properties.h> |
---|
| 29 | +#include "skw_ext.h" |
---|
| 30 | + |
---|
| 31 | +#define SKWBT_CONFIG_FILE "/vendor/etc/bluetooth/skwbt.conf" |
---|
| 32 | + |
---|
| 33 | +bt_vendor_callbacks_t *bt_vendor_cbacks = NULL; |
---|
| 34 | +uint8_t vnd_local_bd_addr[6] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; |
---|
| 35 | +uint8_t port_cnts = 0; |
---|
| 36 | + |
---|
| 37 | +char skwbt_transtype = 0; |
---|
| 38 | +static char skwbt_device_node[BT_COM_PORT_SIZE][DEVICE_NODE_MAX_LEN + 1]; |
---|
| 39 | + |
---|
| 40 | +int btboot_fp = -1; |
---|
| 41 | +int btpw_fp = -1; |
---|
| 42 | +char btsnoop_log_en = FALSE; |
---|
| 43 | +char btcp_log_en = FALSE; |
---|
| 44 | +char skwlog_slice = FALSE; |
---|
| 45 | +char skwdriverlog_en = TRUE; |
---|
| 46 | +char skwbtuartonly = TRUE; |
---|
| 47 | +char skwbtNoSleep = FALSE; //No Sleep |
---|
| 48 | + |
---|
| 49 | +extern char skw_btsnoop_path[]; |
---|
| 50 | +extern char btsnoop_save_log; |
---|
| 51 | +extern Wakeup_ADV_Info_St wakeup_ADV_Info; |
---|
| 52 | + |
---|
| 53 | +static char *trim(char *str) |
---|
| 54 | +{ |
---|
| 55 | + while (isspace(*str)) |
---|
| 56 | + { |
---|
| 57 | + ++str; |
---|
| 58 | + } |
---|
| 59 | + |
---|
| 60 | + if (!*str) |
---|
| 61 | + { |
---|
| 62 | + return str; |
---|
| 63 | + } |
---|
| 64 | + |
---|
| 65 | + char *end_str = str + strlen(str) - 1; |
---|
| 66 | + while (end_str > str && isspace(*end_str)) |
---|
| 67 | + { |
---|
| 68 | + --end_str; |
---|
| 69 | + } |
---|
| 70 | + |
---|
| 71 | + end_str[1] = '\0'; |
---|
| 72 | + return str; |
---|
| 73 | +} |
---|
| 74 | + |
---|
| 75 | + |
---|
| 76 | +static void load_skwbt_conf() |
---|
| 77 | +{ |
---|
| 78 | + memset(skwbt_device_node, 0, sizeof(skwbt_device_node)); |
---|
| 79 | + FILE *fp = fopen(SKWBT_CONFIG_FILE, "rt"); |
---|
| 80 | + if (!fp) |
---|
| 81 | + { |
---|
| 82 | + //ALOGE("%s unable to open file '%s': %s", __func__, SKWBT_CONFIG_FILE, strerror(errno)); |
---|
| 83 | + strcpy(skwbt_device_node[0], "/dev/ttyS0"); |
---|
| 84 | + return ; |
---|
| 85 | + } |
---|
| 86 | + |
---|
| 87 | + char *split; |
---|
| 88 | + char line[1024]; |
---|
| 89 | + int port_index = BT_COM_PORT_CMDEVT; |
---|
| 90 | + |
---|
| 91 | + while (fgets(line, sizeof(line), fp)) |
---|
| 92 | + { |
---|
| 93 | + char *line_ptr = trim(line); |
---|
| 94 | + |
---|
| 95 | + // Skip blank and comment lines. |
---|
| 96 | + if (*line_ptr == '\0' || *line_ptr == '#' || *line_ptr == '[') |
---|
| 97 | + { |
---|
| 98 | + continue; |
---|
| 99 | + } |
---|
| 100 | + |
---|
| 101 | + split = strchr(line_ptr, '='); |
---|
| 102 | + if (!split) |
---|
| 103 | + { |
---|
| 104 | + ALOGE("%s no key/value separator found", __func__); |
---|
| 105 | + fclose(fp); |
---|
| 106 | + return; |
---|
| 107 | + } |
---|
| 108 | + |
---|
| 109 | + *split = '\0'; |
---|
| 110 | + split ++; |
---|
| 111 | + if((!strcmp(trim(line_ptr), "BtDeviceNode")) && (port_index < BT_COM_PORT_SIZE)) |
---|
| 112 | + { |
---|
| 113 | + int mode = O_RDWR; |
---|
| 114 | + char *str_ptr = trim(split); |
---|
| 115 | + int len = strlen(str_ptr); |
---|
| 116 | +#if 0 |
---|
| 117 | + if(strstr(split, "BTDATA")) |
---|
| 118 | + { |
---|
| 119 | + port_index = BT_COM_PORT_ACL; |
---|
| 120 | + } |
---|
| 121 | + else if(strstr(split, "BTAUDIO")) |
---|
| 122 | + { |
---|
| 123 | + port_index = BT_COM_PORT_AUDIO; |
---|
| 124 | + } |
---|
| 125 | + else if(strstr(split, "BTISOC")) |
---|
| 126 | + { |
---|
| 127 | + port_index = BT_COM_PORT_ISO; |
---|
| 128 | + } |
---|
| 129 | +#endif |
---|
| 130 | + if(len > DEVICE_NODE_MAX_LEN) |
---|
| 131 | + { |
---|
| 132 | + len = DEVICE_NODE_MAX_LEN; |
---|
| 133 | + str_ptr[DEVICE_NODE_MAX_LEN] = 0x00; |
---|
| 134 | + } |
---|
| 135 | + memcpy(skwbt_device_node[port_index], str_ptr, len); |
---|
| 136 | + scomm_vendor_set_port_name(port_index, skwbt_device_node[port_index], mode); |
---|
| 137 | + |
---|
| 138 | + port_index ++; |
---|
| 139 | + } |
---|
| 140 | + } |
---|
| 141 | + |
---|
| 142 | + |
---|
| 143 | + fclose(fp); |
---|
| 144 | + |
---|
| 145 | + skwbt_transtype = SKWBT_TRANS_TYPE_H4; |
---|
| 146 | + if(skwbt_device_node[0][0] == '?') |
---|
| 147 | + { |
---|
| 148 | + int i = 0; |
---|
| 149 | + while(skwbt_device_node[0][i] != '\0') |
---|
| 150 | + { |
---|
| 151 | + skwbt_device_node[0][i] = skwbt_device_node[0][i + 1]; |
---|
| 152 | + i++; |
---|
| 153 | + } |
---|
| 154 | + scomm_vendor_set_port_name(0, skwbt_device_node[0], O_RDWR); |
---|
| 155 | + skwbt_transtype |= SKWBT_TRANS_TYPE_UART; |
---|
| 156 | + } |
---|
| 157 | +} |
---|
| 158 | + |
---|
| 159 | +char skwbt_boot_open() |
---|
| 160 | +{ |
---|
| 161 | + btboot_fp = open("/dev/BTBOOT", O_RDWR); |
---|
| 162 | + if (btboot_fp < 0) |
---|
| 163 | + { |
---|
| 164 | + ALOGE("%s: unable to open : %s", __func__, strerror(errno)); |
---|
| 165 | + return FALSE; |
---|
| 166 | + } |
---|
| 167 | + return TRUE; |
---|
| 168 | +} |
---|
| 169 | + |
---|
| 170 | + |
---|
| 171 | +static void load_skwbt_stack_conf() |
---|
| 172 | +{ |
---|
| 173 | + FILE *fp = fopen(SKWBT_CONFIG_FILE, "rt"); |
---|
| 174 | + if (!fp) |
---|
| 175 | + { |
---|
| 176 | + ALOGE("%s unable to open file '%s': %s", __func__, SKWBT_CONFIG_FILE, strerror(errno)); |
---|
| 177 | + return; |
---|
| 178 | + } |
---|
| 179 | + char *split; |
---|
| 180 | + int line_num = 0; |
---|
| 181 | + char line[1024]; |
---|
| 182 | + while (fgets(line, sizeof(line), fp)) |
---|
| 183 | + { |
---|
| 184 | + char *line_ptr = trim(line); |
---|
| 185 | + ++line_num; |
---|
| 186 | + |
---|
| 187 | + // Skip blank and comment lines. |
---|
| 188 | + if (*line_ptr == '\0' || *line_ptr == '#' || *line_ptr == '[') |
---|
| 189 | + { |
---|
| 190 | + continue; |
---|
| 191 | + } |
---|
| 192 | + |
---|
| 193 | + split = strchr(line_ptr, '='); |
---|
| 194 | + if (!split) |
---|
| 195 | + { |
---|
| 196 | + ALOGE("%s no key/value separator found on line %d.", __func__, line_num); |
---|
| 197 | + continue; |
---|
| 198 | + } |
---|
| 199 | + |
---|
| 200 | + *split = '\0'; |
---|
| 201 | + |
---|
| 202 | + if(!strcmp(trim(line_ptr), "SkwBtsnoopDump")) |
---|
| 203 | + { |
---|
| 204 | + if(!strcmp(trim(split + 1), "true")) |
---|
| 205 | + { |
---|
| 206 | + btsnoop_log_en = TRUE; |
---|
| 207 | + } |
---|
| 208 | + else |
---|
| 209 | + { |
---|
| 210 | + btsnoop_log_en = FALSE; |
---|
| 211 | + } |
---|
| 212 | + } |
---|
| 213 | + else if(!strcmp(trim(line_ptr), "BtSnoopFileName")) |
---|
| 214 | + { |
---|
| 215 | + sprintf(skw_btsnoop_path, "%s", trim(split + 1)); |
---|
| 216 | + } |
---|
| 217 | + else if(!strcmp(trim(line_ptr), "BtSnoopSaveLog")) |
---|
| 218 | + { |
---|
| 219 | + if(!strcmp(trim(split + 1), "true")) |
---|
| 220 | + { |
---|
| 221 | + btsnoop_save_log = TRUE; |
---|
| 222 | + } |
---|
| 223 | + else |
---|
| 224 | + { |
---|
| 225 | + btsnoop_save_log = FALSE; |
---|
| 226 | + } |
---|
| 227 | + } |
---|
| 228 | + else if(!strcmp(trim(line_ptr), "SkwBtcplog")) |
---|
| 229 | + { |
---|
| 230 | + if(!strcmp(trim(split + 1), "true")) |
---|
| 231 | + { |
---|
| 232 | + btcp_log_en = TRUE; |
---|
| 233 | + } |
---|
| 234 | + else |
---|
| 235 | + { |
---|
| 236 | + btcp_log_en = FALSE; |
---|
| 237 | + } |
---|
| 238 | + } |
---|
| 239 | + else if(!strcmp(trim(line_ptr), "SkwLogSlice")) |
---|
| 240 | + { |
---|
| 241 | + if(!strcmp(trim(split + 1), "true")) |
---|
| 242 | + { |
---|
| 243 | + skwlog_slice = TRUE; |
---|
| 244 | + } |
---|
| 245 | + else |
---|
| 246 | + { |
---|
| 247 | + skwlog_slice = FALSE; |
---|
| 248 | + } |
---|
| 249 | + } |
---|
| 250 | + else if(!strcmp(trim(line_ptr), "SkwBtDrvlog")) |
---|
| 251 | + { |
---|
| 252 | + if(!strcmp(trim(split + 1), "false")) |
---|
| 253 | + { |
---|
| 254 | + skwdriverlog_en = FALSE; |
---|
| 255 | + } |
---|
| 256 | + } |
---|
| 257 | + else if(!strcmp(trim(line_ptr), "SkwBtUartOnly")) |
---|
| 258 | + { |
---|
| 259 | + if(!strcmp(trim(split + 1), "false"))//SkwBtUartOnly is false |
---|
| 260 | + { |
---|
| 261 | + skwbtuartonly = FALSE; |
---|
| 262 | + } |
---|
| 263 | + } |
---|
| 264 | + else if(!strcmp(trim(line_ptr), "SkwBtNoSleep")) |
---|
| 265 | + { |
---|
| 266 | + if(strcmp(trim(split + 1), "true") == 0)//SkwBtNoSleep is true |
---|
| 267 | + { |
---|
| 268 | + skwbtNoSleep = TRUE; |
---|
| 269 | + } |
---|
| 270 | + } |
---|
| 271 | + else if(!strcmp(trim(line_ptr), "WakeupADVData")) |
---|
| 272 | + { |
---|
| 273 | + char *data_str = trim(split + 1); |
---|
| 274 | + if(data_str) |
---|
| 275 | + { |
---|
| 276 | + scomm_vendor_parse_wakeup_adv_conf(data_str); |
---|
| 277 | + } |
---|
| 278 | + } |
---|
| 279 | + |
---|
| 280 | + |
---|
| 281 | + } |
---|
| 282 | + |
---|
| 283 | + fclose(fp); |
---|
| 284 | +} |
---|
| 285 | + |
---|
| 286 | + |
---|
| 287 | + |
---|
| 288 | + |
---|
| 289 | +/***************************************************************************** |
---|
| 290 | +** |
---|
| 291 | +** BLUETOOTH VENDOR INTERFACE LIBRARY FUNCTIONS |
---|
| 292 | +** |
---|
| 293 | +*****************************************************************************/ |
---|
| 294 | + |
---|
| 295 | + |
---|
| 296 | + |
---|
| 297 | +/** initialise **/ |
---|
| 298 | +static int init(const bt_vendor_callbacks_t *p_cb, unsigned char *local_bdaddr) |
---|
| 299 | +{ |
---|
| 300 | + ALOGI("SeekWave BlueTooth Version: %s", SKW_LIBBT_VERSION); |
---|
| 301 | + if (p_cb == NULL) |
---|
| 302 | + { |
---|
| 303 | + ALOGE("init failed with no user callbacks!"); |
---|
| 304 | + return -1; |
---|
| 305 | + } |
---|
| 306 | + |
---|
| 307 | + scomm_vendor_init(); |
---|
| 308 | + |
---|
| 309 | + load_skwbt_conf(); |
---|
| 310 | + load_skwbt_stack_conf(); |
---|
| 311 | + skwlog_init(); |
---|
| 312 | + |
---|
| 313 | + |
---|
| 314 | + bt_vendor_cbacks = (bt_vendor_callbacks_t *) p_cb;//save callback |
---|
| 315 | + memcpy(vnd_local_bd_addr, local_bdaddr, 6); |
---|
| 316 | + |
---|
| 317 | + if(btsnoop_log_en) |
---|
| 318 | + { |
---|
| 319 | + //enable btsnoop log |
---|
| 320 | + skw_btsnoop_init(); |
---|
| 321 | + } |
---|
| 322 | + skw_addr_gen_init(); |
---|
| 323 | + |
---|
| 324 | + return 0; |
---|
| 325 | +} |
---|
| 326 | + |
---|
| 327 | +/** operations **/ |
---|
| 328 | +static int op(bt_vendor_opcode_t opcode, void *param) |
---|
| 329 | +{ |
---|
| 330 | + int retval = 0; |
---|
| 331 | + |
---|
| 332 | + ALOGD("op for %d", opcode); |
---|
| 333 | + |
---|
| 334 | + switch(opcode) |
---|
| 335 | + { |
---|
| 336 | + case BT_VND_OP_POWER_CTRL: |
---|
| 337 | + { |
---|
| 338 | + if(skwbt_transtype & SKWBT_TRANS_TYPE_UART) |
---|
| 339 | + { |
---|
| 340 | + int *state = (int *) param; |
---|
| 341 | + if (*state == BT_VND_PWR_OFF) |
---|
| 342 | + { |
---|
| 343 | + usleep(200000); |
---|
| 344 | + ALOGD("set power off and delay 200ms"); |
---|
| 345 | + } |
---|
| 346 | + else if (*state == BT_VND_PWR_ON) |
---|
| 347 | + { |
---|
| 348 | + usleep(200000); |
---|
| 349 | + ALOGD("set power on and delay 200ms"); |
---|
| 350 | + } |
---|
| 351 | + } |
---|
| 352 | + } |
---|
| 353 | + break; |
---|
| 354 | + |
---|
| 355 | + case BT_VND_OP_FW_CFG: |
---|
| 356 | + { |
---|
| 357 | + scomm_vendor_config_start(); |
---|
| 358 | + } |
---|
| 359 | + break; |
---|
| 360 | + |
---|
| 361 | + case BT_VND_OP_SCO_CFG: |
---|
| 362 | + { |
---|
| 363 | + retval = -1; |
---|
| 364 | + } |
---|
| 365 | + break; |
---|
| 366 | + |
---|
| 367 | + case BT_VND_OP_USERIAL_OPEN: |
---|
| 368 | + { |
---|
| 369 | + int fd = -1, idx = 0; |
---|
| 370 | + int (*fd_array)[] = (int (*)[]) param; |
---|
| 371 | + |
---|
| 372 | + |
---|
| 373 | + if(skwbt_transtype & SKWBT_TRANS_TYPE_UART) |
---|
| 374 | + { |
---|
| 375 | + if(skwbtuartonly == FALSE) |
---|
| 376 | + { |
---|
| 377 | + SKWBT_LOG("open boot"); |
---|
| 378 | + if(!skwbt_boot_open()) |
---|
| 379 | + { |
---|
| 380 | + retval = 0; |
---|
| 381 | + break; |
---|
| 382 | + } |
---|
| 383 | + btpw_fp = open("/dev/BTDATA", O_RDWR); |
---|
| 384 | + } |
---|
| 385 | + if(scomm_vendor_uart_open(0) != -1) |
---|
| 386 | + { |
---|
| 387 | + retval = 1; |
---|
| 388 | + fd = scomm_vendor_socket_open(0); |
---|
| 389 | + } |
---|
| 390 | + } |
---|
| 391 | + else |
---|
| 392 | + { |
---|
| 393 | + int tFd = -1; |
---|
| 394 | + //uint8_t log_enable = 0; |
---|
| 395 | + if(!skwbt_boot_open()) |
---|
| 396 | + { |
---|
| 397 | + retval = 0; |
---|
| 398 | + break; |
---|
| 399 | + } |
---|
| 400 | +#if 0 |
---|
| 401 | + if(ioctl(btboot_fp, IOCTL_CMD_LOG_EN_GET, &log_enable) == 0) |
---|
| 402 | + { |
---|
| 403 | + ALOGD("SKWBT log_enable res:%d, btcp_log_en:%d, btsnoop_log_en:%d", log_enable, btcp_log_en, btsnoop_log_en); |
---|
| 404 | + if(btcp_log_en && log_enable)//0:default, 1:release version; 2:debug version |
---|
| 405 | + { |
---|
| 406 | + btcp_log_en = log_enable == 2; |
---|
| 407 | + } |
---|
| 408 | + if(btsnoop_log_en && log_enable) |
---|
| 409 | + { |
---|
| 410 | + btsnoop_log_en = log_enable == 2; |
---|
| 411 | + } |
---|
| 412 | + } |
---|
| 413 | +#endif |
---|
| 414 | + |
---|
| 415 | +#ifdef IOCTL_CMD_WAKEUP_ADV_EN |
---|
| 416 | + if(wakeup_ADV_Info.grp_nums > 0) |
---|
| 417 | + { |
---|
| 418 | + int res = ioctl(btboot_fp, IOCTL_CMD_WAKEUP_ADV_EN); |
---|
| 419 | + ALOGD("%s, wakeup adv en res:%d", __func__, res); |
---|
| 420 | + } |
---|
| 421 | +#endif |
---|
| 422 | + for (idx = 0; idx < BT_COM_PORT_SIZE; idx++) |
---|
| 423 | + { |
---|
| 424 | + if(scomm_vendor_check_port_valid(idx) == FALSE) |
---|
| 425 | + { |
---|
| 426 | + continue; |
---|
| 427 | + } |
---|
| 428 | + if(scomm_vendor_usbsdio_open(idx) != -1) |
---|
| 429 | + { |
---|
| 430 | + tFd = scomm_vendor_socket_open(idx); |
---|
| 431 | + |
---|
| 432 | + ALOGD("idx:%d, tFd:%d, fd:%d", idx, tFd, fd); |
---|
| 433 | + if((tFd != -1) && (fd == -1)) |
---|
| 434 | + { |
---|
| 435 | + fd = tFd; |
---|
| 436 | + } |
---|
| 437 | + } |
---|
| 438 | + else |
---|
| 439 | + { |
---|
| 440 | + break; |
---|
| 441 | + } |
---|
| 442 | + } |
---|
| 443 | + |
---|
| 444 | + if(idx <= BT_COM_PORT_ACL) |
---|
| 445 | + { |
---|
| 446 | + skwbt_transtype |= SKWBT_TRANS_TYPE_USB; |
---|
| 447 | + } |
---|
| 448 | + else |
---|
| 449 | + { |
---|
| 450 | + skwbt_transtype |= SKWBT_TRANS_TYPE_SDIO; |
---|
| 451 | + } |
---|
| 452 | + } |
---|
| 453 | + ALOGD("retval:%d, fd:%d, idx:%d", retval, fd, idx); |
---|
| 454 | + |
---|
| 455 | + if (fd != -1) |
---|
| 456 | + { |
---|
| 457 | + retval = 1; |
---|
| 458 | + for (idx = 0; idx < CH_MAX; idx++) |
---|
| 459 | + { |
---|
| 460 | + (*fd_array)[idx] = fd; |
---|
| 461 | + } |
---|
| 462 | + skw_ext_inotify_thread_init(); |
---|
| 463 | + property_set("SKWBT.OPEN.STATE", "1"); |
---|
| 464 | + } |
---|
| 465 | + else |
---|
| 466 | + { |
---|
| 467 | + retval = 0; |
---|
| 468 | + } |
---|
| 469 | + } |
---|
| 470 | + break; |
---|
| 471 | + |
---|
| 472 | + case BT_VND_OP_USERIAL_CLOSE: |
---|
| 473 | + { |
---|
| 474 | + if(btboot_fp > 0) |
---|
| 475 | + { |
---|
| 476 | + scomm_vendor_write_bt_state(); |
---|
| 477 | + close(btboot_fp); |
---|
| 478 | + btboot_fp = -1; |
---|
| 479 | + } |
---|
| 480 | + scomm_vendor_close(); |
---|
| 481 | + skw_ext_inotify_thread_exit(); |
---|
| 482 | + property_set("SKWBT.OPEN.STATE", "0"); |
---|
| 483 | + } |
---|
| 484 | + break; |
---|
| 485 | + |
---|
| 486 | + case BT_VND_OP_GET_LPM_IDLE_TIMEOUT: |
---|
| 487 | + { |
---|
| 488 | + |
---|
| 489 | + } |
---|
| 490 | + break; |
---|
| 491 | + |
---|
| 492 | + case BT_VND_OP_LPM_SET_MODE: |
---|
| 493 | + { |
---|
| 494 | + |
---|
| 495 | + } |
---|
| 496 | + break; |
---|
| 497 | + |
---|
| 498 | + case BT_VND_OP_LPM_WAKE_SET_STATE: |
---|
| 499 | + { |
---|
| 500 | + |
---|
| 501 | + } |
---|
| 502 | + break; |
---|
| 503 | + case BT_VND_OP_EPILOG: |
---|
| 504 | + { |
---|
| 505 | + if(bt_vendor_cbacks) |
---|
| 506 | + { |
---|
| 507 | + bt_vendor_cbacks->epilog_cb(BT_VND_OP_RESULT_SUCCESS); |
---|
| 508 | + } |
---|
| 509 | + } |
---|
| 510 | + break; |
---|
| 511 | + |
---|
| 512 | + default: |
---|
| 513 | + break; |
---|
| 514 | + } |
---|
| 515 | + |
---|
| 516 | + return retval; |
---|
| 517 | +} |
---|
| 518 | + |
---|
| 519 | + |
---|
| 520 | +/** Close **/ |
---|
| 521 | +static void cleanup( void ) |
---|
| 522 | +{ |
---|
| 523 | + ALOGD("bt_vendor_skw.c cleanup"); |
---|
| 524 | + |
---|
| 525 | + if(btsnoop_log_en) |
---|
| 526 | + { |
---|
| 527 | + skw_btsnoop_close(); |
---|
| 528 | + } |
---|
| 529 | + skwlog_close(); |
---|
| 530 | + |
---|
| 531 | + btsnoop_log_en = FALSE; |
---|
| 532 | + bt_vendor_cbacks = NULL; |
---|
| 533 | + skwbt_transtype = 0; |
---|
| 534 | +} |
---|
| 535 | + |
---|
| 536 | + |
---|
| 537 | + |
---|
| 538 | +// Entry point |
---|
| 539 | +const bt_vendor_interface_t BLUETOOTH_VENDOR_LIB_INTERFACE = {sizeof(bt_vendor_interface_t), |
---|
| 540 | + init, |
---|
| 541 | + op, |
---|
| 542 | + cleanup |
---|
| 543 | + }; |
---|
| 544 | + |
---|
| 545 | + |
---|
.. | .. |
---|
| 1 | +/****************************************************************************** |
---|
| 2 | + * |
---|
| 3 | + * Copyright (C) 2020-2021 SeekWave Technology |
---|
| 4 | + * |
---|
| 5 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
---|
| 6 | + * |
---|
| 7 | + ******************************************************************************/ |
---|
| 8 | + |
---|
| 9 | +/****************************************************************************** |
---|
| 10 | + * |
---|
| 11 | + * Filename: scom_vendor.c |
---|
| 12 | + * |
---|
| 13 | + * Description: serials communication operation |
---|
| 14 | + * |
---|
| 15 | + ******************************************************************************/ |
---|
| 16 | + |
---|
| 17 | +#include <pthread.h> |
---|
| 18 | +#include <utils/Log.h> |
---|
| 19 | +#include <termios.h> |
---|
| 20 | +#include <fcntl.h> |
---|
| 21 | +#include <errno.h> |
---|
| 22 | +#include <stdio.h> |
---|
| 23 | +#include <sys/eventfd.h> |
---|
| 24 | +#include <cutils/sockets.h> |
---|
| 25 | +#include <sys/poll.h> |
---|
| 26 | +#include <assert.h> |
---|
| 27 | +#include "scom_vendor.h" |
---|
| 28 | +#include "bt_hci_bdroid.h" |
---|
| 29 | +#include "skw_common.h" |
---|
| 30 | +#include "bt_vendor_skw.h" |
---|
| 31 | +#include "skw_btsnoop.h" |
---|
| 32 | +#include "skw_log.h" |
---|
| 33 | +#include "skw_gen_addr.h" |
---|
| 34 | +#include "skw_ext.h" |
---|
| 35 | + |
---|
| 36 | + |
---|
| 37 | + |
---|
| 38 | +bt_hw_cfg_cb_st hw_cfg_cb; |
---|
| 39 | +scomm_vnd_st scomm_vnd[BT_COM_PORT_SIZE]; |
---|
| 40 | +skw_socket_object_st skw_socket_object; |
---|
| 41 | +uint8_t recvSocketBuf[4096]; |
---|
| 42 | +static pthread_mutex_t write2host_lock; |
---|
| 43 | +uint16_t chip_version = 0; |
---|
| 44 | +Wakeup_ADV_Info_St wakeup_ADV_Info = {0}; |
---|
| 45 | +extern char btcp_log_en; |
---|
| 46 | + |
---|
| 47 | + |
---|
| 48 | +#define SKWBT_NV_FILE_PATH "/vendor/etc/bluetooth" |
---|
| 49 | + |
---|
| 50 | + |
---|
| 51 | +static const uint8_t hci_preamble_sizes[] = |
---|
| 52 | +{ |
---|
| 53 | + 0, |
---|
| 54 | + HCI_COMMAND_PKT_PREAMBLE_SIZE, |
---|
| 55 | + HCI_ACLDATA_PKT_PREAMBLE_SIZE, |
---|
| 56 | + HCI_SCODATA_PKT_PREAMBLE_SIZE, |
---|
| 57 | + HCI_EVENT_PKT_PREAMBLE_SIZE, |
---|
| 58 | + HCI_ISODATA_PKT_PREAMBLE_SIZE, |
---|
| 59 | + 0, |
---|
| 60 | + HCI_EVENT_SKWLOG_PREAMBLE_SIZE |
---|
| 61 | +}; |
---|
| 62 | + |
---|
| 63 | + |
---|
| 64 | +static tUSERIAL_CFG userial_H4_cfg = |
---|
| 65 | +{ |
---|
| 66 | + (USERIAL_DATABITS_8 | USERIAL_PARITY_NONE | USERIAL_STOPBITS_1), |
---|
| 67 | + //USERIAL_BAUD_115200, |
---|
| 68 | + USERIAL_BAUD_3M, |
---|
| 69 | + //USERIAL_BAUD_1_5M, |
---|
| 70 | + USERIAL_HW_FLOW_CTRL_ON |
---|
| 71 | +}; |
---|
| 72 | + |
---|
| 73 | + |
---|
| 74 | +char hex2char(int num) |
---|
| 75 | +{ |
---|
| 76 | + char ch; |
---|
| 77 | + if(num >= 0 && num <= 9) |
---|
| 78 | + { |
---|
| 79 | + ch = num + 48; |
---|
| 80 | + } |
---|
| 81 | + else if(num > 9 && num <= 15) |
---|
| 82 | + { |
---|
| 83 | + ch = (num - 10) + 65; |
---|
| 84 | + } |
---|
| 85 | + else |
---|
| 86 | + { |
---|
| 87 | + ch = '\0'; |
---|
| 88 | + } |
---|
| 89 | + return ch; |
---|
| 90 | +} |
---|
| 91 | + |
---|
| 92 | +void hex2String(unsigned char hex[], unsigned char str[], int N) |
---|
| 93 | +{ |
---|
| 94 | + int i = 0, j; |
---|
| 95 | + for(i = 0, j = 0; i < N; i++, j += 2) |
---|
| 96 | + { |
---|
| 97 | + str[j] = hex2char((hex[i] & 0xF0) >> 4); |
---|
| 98 | + str[j + 1] = hex2char(hex[i] & 0x0F); |
---|
| 99 | + } |
---|
| 100 | + str[N << 1] = 0; |
---|
| 101 | +} |
---|
| 102 | + |
---|
| 103 | +unsigned char char2hex(char ch) |
---|
| 104 | +{ |
---|
| 105 | + unsigned char num = 0; |
---|
| 106 | + if(ch >= '0' && ch <= '9') |
---|
| 107 | + { |
---|
| 108 | + num = ch - 48;//0:48 |
---|
| 109 | + } |
---|
| 110 | + else if(ch >= 'a' && ch <= 'f') |
---|
| 111 | + { |
---|
| 112 | + num = ch + 10 - 97;//a:97 |
---|
| 113 | + } |
---|
| 114 | + else if(ch >= 'A' && ch <= 'F') |
---|
| 115 | + { |
---|
| 116 | + num = ch + 10 - 65;//A:65 |
---|
| 117 | + } |
---|
| 118 | + return num; |
---|
| 119 | +} |
---|
| 120 | + |
---|
| 121 | +void scomm_vendor_init() |
---|
| 122 | +{ |
---|
| 123 | + uint8_t i; |
---|
| 124 | + for(i = 0; i < BT_COM_PORT_SIZE; i++) |
---|
| 125 | + { |
---|
| 126 | + memset(&scomm_vnd[i], 0, sizeof(scomm_vnd_st)); |
---|
| 127 | + scomm_vnd[i].fd = -1; |
---|
| 128 | + scomm_vnd[i].driver_state = FALSE; |
---|
| 129 | + scomm_vnd[i].mode = O_RDWR; |
---|
| 130 | + } |
---|
| 131 | + |
---|
| 132 | + pthread_mutex_init(&write2host_lock, NULL); |
---|
| 133 | +} |
---|
| 134 | + |
---|
| 135 | +void scomm_vendor_set_port_name(uint8_t port_index, char *port_name, int mode) |
---|
| 136 | +{ |
---|
| 137 | + int len = strlen(port_name); |
---|
| 138 | + memset(scomm_vnd[port_index].port_name, 0, DEVICE_NODE_MAX_LEN); |
---|
| 139 | + if(len < DEVICE_NODE_MAX_LEN) |
---|
| 140 | + { |
---|
| 141 | + memcpy(scomm_vnd[port_index].port_name, port_name, len); |
---|
| 142 | + } |
---|
| 143 | + scomm_vnd[port_index].mode = mode; |
---|
| 144 | + |
---|
| 145 | + ALOGD("skwbt_device_node:%s, port:%d", port_name, port_index); |
---|
| 146 | +} |
---|
| 147 | + |
---|
| 148 | + |
---|
| 149 | +/******************************************************************************* |
---|
| 150 | +** |
---|
| 151 | +** Function scomm_vendor_tcio_baud |
---|
| 152 | +** |
---|
| 153 | +** Description helper function converts USERIAL baud rates into TCIO |
---|
| 154 | +** conforming baud rates |
---|
| 155 | +** |
---|
| 156 | +** Returns TRUE/FALSE |
---|
| 157 | +** |
---|
| 158 | +*******************************************************************************/ |
---|
| 159 | +uint8_t scomm_vendor_tcio_baud(uint8_t cfg_baud, uint32_t *baud) |
---|
| 160 | +{ |
---|
| 161 | + if (cfg_baud == USERIAL_BAUD_115200) |
---|
| 162 | + { |
---|
| 163 | + *baud = B115200; |
---|
| 164 | + } |
---|
| 165 | + else if (cfg_baud == USERIAL_BAUD_4M) |
---|
| 166 | + { |
---|
| 167 | + *baud = B4000000; |
---|
| 168 | + } |
---|
| 169 | + else if (cfg_baud == USERIAL_BAUD_3M) |
---|
| 170 | + { |
---|
| 171 | + *baud = B3000000; |
---|
| 172 | + } |
---|
| 173 | + else if (cfg_baud == USERIAL_BAUD_2M) |
---|
| 174 | + { |
---|
| 175 | + *baud = B2000000; |
---|
| 176 | + } |
---|
| 177 | + else if (cfg_baud == USERIAL_BAUD_1M) |
---|
| 178 | + { |
---|
| 179 | + *baud = B1000000; |
---|
| 180 | + } |
---|
| 181 | + else if (cfg_baud == USERIAL_BAUD_1_5M) |
---|
| 182 | + { |
---|
| 183 | + *baud = B1500000; |
---|
| 184 | + } |
---|
| 185 | + else if (cfg_baud == USERIAL_BAUD_921600) |
---|
| 186 | + { |
---|
| 187 | + *baud = B921600; |
---|
| 188 | + } |
---|
| 189 | + else if (cfg_baud == USERIAL_BAUD_460800) |
---|
| 190 | + { |
---|
| 191 | + *baud = B460800; |
---|
| 192 | + } |
---|
| 193 | + else if (cfg_baud == USERIAL_BAUD_230400) |
---|
| 194 | + { |
---|
| 195 | + *baud = B230400; |
---|
| 196 | + } |
---|
| 197 | + else if (cfg_baud == USERIAL_BAUD_57600) |
---|
| 198 | + { |
---|
| 199 | + *baud = B57600; |
---|
| 200 | + } |
---|
| 201 | + else if (cfg_baud == USERIAL_BAUD_19200) |
---|
| 202 | + { |
---|
| 203 | + *baud = B19200; |
---|
| 204 | + } |
---|
| 205 | + else if (cfg_baud == USERIAL_BAUD_9600) |
---|
| 206 | + { |
---|
| 207 | + *baud = B9600; |
---|
| 208 | + } |
---|
| 209 | + else if (cfg_baud == USERIAL_BAUD_1200) |
---|
| 210 | + { |
---|
| 211 | + *baud = B1200; |
---|
| 212 | + } |
---|
| 213 | + else if (cfg_baud == USERIAL_BAUD_600) |
---|
| 214 | + { |
---|
| 215 | + *baud = B600; |
---|
| 216 | + } |
---|
| 217 | + else |
---|
| 218 | + { |
---|
| 219 | + ALOGE( "userial vendor open: unsupported baud idx %i", cfg_baud); |
---|
| 220 | + *baud = B115200; |
---|
| 221 | + return FALSE; |
---|
| 222 | + } |
---|
| 223 | + |
---|
| 224 | + return TRUE; |
---|
| 225 | +} |
---|
| 226 | + |
---|
| 227 | + |
---|
| 228 | +/******************************************************************************* |
---|
| 229 | +** |
---|
| 230 | +** Function scomm_vendor_uart_open |
---|
| 231 | +** |
---|
| 232 | +** Description Uart Open |
---|
| 233 | +** |
---|
| 234 | +** Returns None |
---|
| 235 | +** |
---|
| 236 | +*******************************************************************************/ |
---|
| 237 | +int scomm_vendor_uart_open(uint8_t port_index) |
---|
| 238 | +{ |
---|
| 239 | + tUSERIAL_CFG *p_cfg = &userial_H4_cfg; |
---|
| 240 | + uint32_t baud; |
---|
| 241 | + uint8_t data_bits; |
---|
| 242 | + uint16_t parity; |
---|
| 243 | + uint8_t stop_bits; |
---|
| 244 | + |
---|
| 245 | + scomm_vnd[port_index].fd = -1; |
---|
| 246 | + |
---|
| 247 | + if (!scomm_vendor_tcio_baud(p_cfg->baud, &baud)) |
---|
| 248 | + { |
---|
| 249 | + return -1; |
---|
| 250 | + } |
---|
| 251 | + |
---|
| 252 | + if(p_cfg->fmt & USERIAL_DATABITS_8) |
---|
| 253 | + { |
---|
| 254 | + data_bits = CS8; |
---|
| 255 | + } |
---|
| 256 | + else if(p_cfg->fmt & USERIAL_DATABITS_7) |
---|
| 257 | + { |
---|
| 258 | + data_bits = CS7; |
---|
| 259 | + } |
---|
| 260 | + else if(p_cfg->fmt & USERIAL_DATABITS_6) |
---|
| 261 | + { |
---|
| 262 | + data_bits = CS6; |
---|
| 263 | + } |
---|
| 264 | + else if(p_cfg->fmt & USERIAL_DATABITS_5) |
---|
| 265 | + { |
---|
| 266 | + data_bits = CS5; |
---|
| 267 | + } |
---|
| 268 | + else |
---|
| 269 | + { |
---|
| 270 | + ALOGE("userial vendor open: unsupported data bits"); |
---|
| 271 | + return -1; |
---|
| 272 | + } |
---|
| 273 | + |
---|
| 274 | + if(p_cfg->fmt & USERIAL_PARITY_NONE) |
---|
| 275 | + { |
---|
| 276 | + parity = 0; |
---|
| 277 | + } |
---|
| 278 | + else if(p_cfg->fmt & USERIAL_PARITY_EVEN) |
---|
| 279 | + { |
---|
| 280 | + parity = PARENB; |
---|
| 281 | + } |
---|
| 282 | + else if(p_cfg->fmt & USERIAL_PARITY_ODD) |
---|
| 283 | + { |
---|
| 284 | + parity = (PARENB | PARODD); |
---|
| 285 | + } |
---|
| 286 | + else |
---|
| 287 | + { |
---|
| 288 | + ALOGE("userial vendor open: unsupported parity bit mode"); |
---|
| 289 | + return -1; |
---|
| 290 | + } |
---|
| 291 | + |
---|
| 292 | + if(p_cfg->fmt & USERIAL_STOPBITS_1) |
---|
| 293 | + { |
---|
| 294 | + stop_bits = 0; |
---|
| 295 | + } |
---|
| 296 | + else if(p_cfg->fmt & USERIAL_STOPBITS_2) |
---|
| 297 | + { |
---|
| 298 | + stop_bits = CSTOPB; |
---|
| 299 | + } |
---|
| 300 | + else |
---|
| 301 | + { |
---|
| 302 | + ALOGE("userial vendor open: unsupported stop bits"); |
---|
| 303 | + return -1; |
---|
| 304 | + } |
---|
| 305 | + |
---|
| 306 | + ALOGI("userial vendor open: opening %s,baud:%d", scomm_vnd[port_index].port_name, p_cfg->baud); |
---|
| 307 | + |
---|
| 308 | + if ((scomm_vnd[port_index].fd = open(scomm_vnd[port_index].port_name, O_RDWR)) == -1) |
---|
| 309 | + { |
---|
| 310 | + ALOGE("userial vendor open: unable to open %s, %s", scomm_vnd[port_index].port_name, strerror(errno)); |
---|
| 311 | + return -1; |
---|
| 312 | + } |
---|
| 313 | + |
---|
| 314 | + tcflush(scomm_vnd[port_index].fd, TCIOFLUSH); |
---|
| 315 | + |
---|
| 316 | + tcgetattr(scomm_vnd[port_index].fd, &scomm_vnd[port_index].termios); |
---|
| 317 | + cfmakeraw(&scomm_vnd[port_index].termios); |
---|
| 318 | + |
---|
| 319 | + if(p_cfg->hw_fctrl == USERIAL_HW_FLOW_CTRL_ON) |
---|
| 320 | + { |
---|
| 321 | + ALOGI("userial vendor open: with HW flowctrl ON"); |
---|
| 322 | + scomm_vnd[port_index].termios.c_cflag |= (CRTSCTS | stop_bits | parity); |
---|
| 323 | + } |
---|
| 324 | + else |
---|
| 325 | + { |
---|
| 326 | + ALOGI("userial vendor open: with HW flowctrl OFF"); |
---|
| 327 | + scomm_vnd[port_index].termios.c_cflag &= ~CRTSCTS; |
---|
| 328 | + scomm_vnd[port_index].termios.c_cflag |= (stop_bits | parity); |
---|
| 329 | + |
---|
| 330 | + } |
---|
| 331 | + |
---|
| 332 | + tcsetattr(scomm_vnd[port_index].fd, TCSANOW, &scomm_vnd[port_index].termios); |
---|
| 333 | + tcflush(scomm_vnd[port_index].fd, TCIOFLUSH); |
---|
| 334 | + |
---|
| 335 | + tcsetattr(scomm_vnd[port_index].fd, TCSANOW, &scomm_vnd[port_index].termios); |
---|
| 336 | + tcflush(scomm_vnd[port_index].fd, TCIOFLUSH); |
---|
| 337 | + tcflush(scomm_vnd[port_index].fd, TCIOFLUSH); |
---|
| 338 | + |
---|
| 339 | + /* set input/output baudrate */ |
---|
| 340 | + cfsetospeed(&scomm_vnd[port_index].termios, baud); |
---|
| 341 | + cfsetispeed(&scomm_vnd[port_index].termios, baud); |
---|
| 342 | + tcsetattr(scomm_vnd[port_index].fd, TCSANOW, &scomm_vnd[port_index].termios); |
---|
| 343 | + |
---|
| 344 | + |
---|
| 345 | + ALOGE("UART device fd = %d Open", scomm_vnd[port_index].fd); |
---|
| 346 | + |
---|
| 347 | + |
---|
| 348 | + return scomm_vnd[port_index].fd; |
---|
| 349 | + |
---|
| 350 | +} |
---|
| 351 | + |
---|
| 352 | + |
---|
| 353 | +/******************************************************************************* |
---|
| 354 | +** |
---|
| 355 | +** Function scomm_vendor_usbsdio_open |
---|
| 356 | +** |
---|
| 357 | +** Description check port name valid |
---|
| 358 | +** |
---|
| 359 | +** Returns None |
---|
| 360 | +** |
---|
| 361 | +*******************************************************************************/ |
---|
| 362 | +uint8_t scomm_vendor_check_port_valid(uint8_t port_index) |
---|
| 363 | +{ |
---|
| 364 | + if(scomm_vnd[port_index].port_name[0] == 0) |
---|
| 365 | + { |
---|
| 366 | + return FALSE; |
---|
| 367 | + } |
---|
| 368 | + return TRUE; |
---|
| 369 | +} |
---|
| 370 | + |
---|
| 371 | + |
---|
| 372 | + |
---|
| 373 | +/******************************************************************************* |
---|
| 374 | +** |
---|
| 375 | +** Function scomm_vendor_usbsdio_open |
---|
| 376 | +** |
---|
| 377 | +** Description USB/SDIO Open |
---|
| 378 | +** |
---|
| 379 | +** Returns None |
---|
| 380 | +** |
---|
| 381 | +*******************************************************************************/ |
---|
| 382 | +int scomm_vendor_usbsdio_open(uint8_t port_index) |
---|
| 383 | +{ |
---|
| 384 | + if ((scomm_vnd[port_index].fd = open(scomm_vnd[port_index].port_name, O_RDWR)) == -1) |
---|
| 385 | + { |
---|
| 386 | + ALOGE("%s: unable to open %s: %s", __func__, scomm_vnd[port_index].port_name, strerror(errno)); |
---|
| 387 | + return -1; |
---|
| 388 | + } |
---|
| 389 | + ALOGD("USB/SDIO device[%d], %s fd = %d open", port_index, scomm_vnd[port_index].port_name, scomm_vnd[port_index].fd); |
---|
| 390 | + |
---|
| 391 | + return scomm_vnd[port_index].fd; |
---|
| 392 | +} |
---|
| 393 | + |
---|
| 394 | + |
---|
| 395 | +/******************************************************************************* |
---|
| 396 | +** |
---|
| 397 | +** Function scomm_vendor_recv_rawdata |
---|
| 398 | +** |
---|
| 399 | +** Description recv data from host and process |
---|
| 400 | +** |
---|
| 401 | +** Returns None |
---|
| 402 | +** |
---|
| 403 | +*******************************************************************************/ |
---|
| 404 | +uint8_t pkt_cnts = 0; |
---|
| 405 | +static void scomm_vendor_recv_rawdata(void *context) |
---|
| 406 | +{ |
---|
| 407 | + SKW_UNUSED(context); |
---|
| 408 | + uint8_t port_index = 0;//(uint8_t)context; |
---|
| 409 | + ssize_t bytes_read = 0; |
---|
| 410 | + uint8_t pkt_type = 0, offset = 1; |
---|
| 411 | + uint16_t need_read_lens = 0, total_len = 0; |
---|
| 412 | + int16_t rev_len = 0; |
---|
| 413 | + |
---|
| 414 | + //SKWBT_LOG("%s [%d] start", __func__, port_index); |
---|
| 415 | + |
---|
| 416 | + //do{ |
---|
| 417 | + |
---|
| 418 | + //-----------type-------------// |
---|
| 419 | + //do |
---|
| 420 | + { |
---|
| 421 | + rev_len = read(scomm_vnd[port_index].socket_fd[1], recvSocketBuf, 1); |
---|
| 422 | + if(rev_len <= 0) |
---|
| 423 | + { |
---|
| 424 | + ALOGE("%s type read err, rev_len:%d", __func__, rev_len); |
---|
| 425 | + return ; |
---|
| 426 | + } |
---|
| 427 | + bytes_read += rev_len; |
---|
| 428 | + } |
---|
| 429 | + //while (bytes_read < 1); |
---|
| 430 | + |
---|
| 431 | + total_len = 1; |
---|
| 432 | + pkt_type = recvSocketBuf[0]; |
---|
| 433 | + if((pkt_type == HCI_COMMAND_PKT) || (pkt_type == HCI_ACLDATA_PKT) || (pkt_type == HCI_SCODATA_PKT) || (pkt_type == HCI_ISO_PKT)) |
---|
| 434 | + { |
---|
| 435 | + need_read_lens = hci_preamble_sizes[pkt_type]; |
---|
| 436 | + } |
---|
| 437 | + else |
---|
| 438 | + { |
---|
| 439 | + ALOGE("%s invalid data type: %d", __func__, pkt_type); |
---|
| 440 | + assert(0); |
---|
| 441 | + } |
---|
| 442 | + offset += need_read_lens; |
---|
| 443 | + |
---|
| 444 | + //SKWBT_LOG("pkt_type:%d, bytes_read:%zd, offset:%d", pkt_type, bytes_read, offset); |
---|
| 445 | + |
---|
| 446 | + //-----------header-------------// |
---|
| 447 | + bytes_read = 0; |
---|
| 448 | + offset = 1; |
---|
| 449 | + do |
---|
| 450 | + { |
---|
| 451 | + rev_len = read(scomm_vnd[port_index].socket_fd[1], recvSocketBuf + offset + bytes_read, need_read_lens); |
---|
| 452 | + if(rev_len < 0) |
---|
| 453 | + { |
---|
| 454 | + ALOGE("%s header read err, rev_len:%d", __func__, rev_len); |
---|
| 455 | + return ; |
---|
| 456 | + } |
---|
| 457 | + bytes_read += rev_len; |
---|
| 458 | + //SKWBT_LOG("header bytes_read:%zd, need_read_lens:%d", bytes_read, need_read_lens); |
---|
| 459 | + } while (bytes_read < need_read_lens); |
---|
| 460 | + offset += need_read_lens; |
---|
| 461 | + |
---|
| 462 | + total_len += need_read_lens; |
---|
| 463 | + //get payload length |
---|
| 464 | + if((pkt_type == HCI_ACLDATA_PKT) || (pkt_type == HCI_ISO_PKT)) |
---|
| 465 | + { |
---|
| 466 | + need_read_lens = *(uint16_t *)&recvSocketBuf[HCI_COMMON_DATA_LENGTH_INDEX]; |
---|
| 467 | + } |
---|
| 468 | + else if((pkt_type == HCI_EVENT_PKT) || (pkt_type == HCI_EVENT_SKWLOG)) |
---|
| 469 | + { |
---|
| 470 | + need_read_lens = recvSocketBuf[HCI_EVENT_DATA_LENGTH_INDEX]; |
---|
| 471 | + } |
---|
| 472 | + else//cmd/sco |
---|
| 473 | + { |
---|
| 474 | + need_read_lens = recvSocketBuf[HCI_COMMON_DATA_LENGTH_INDEX]; |
---|
| 475 | + } |
---|
| 476 | + //-----------payload-------------// |
---|
| 477 | + bytes_read = 0; |
---|
| 478 | + if(need_read_lens > 0) |
---|
| 479 | + { |
---|
| 480 | + do |
---|
| 481 | + { |
---|
| 482 | + rev_len = read(scomm_vnd[port_index].socket_fd[1], recvSocketBuf + offset + bytes_read, need_read_lens); |
---|
| 483 | + if(rev_len < 0) |
---|
| 484 | + { |
---|
| 485 | + ALOGE("%s header read err, rev_len:%d", __func__, rev_len); |
---|
| 486 | + return ; |
---|
| 487 | + } |
---|
| 488 | + bytes_read += rev_len; |
---|
| 489 | + //SKWBT_LOG("payload bytes_read:%zd, need_read_lens:%d", bytes_read, need_read_lens); |
---|
| 490 | + } while (bytes_read < need_read_lens); |
---|
| 491 | + total_len += need_read_lens; |
---|
| 492 | + } |
---|
| 493 | + |
---|
| 494 | + |
---|
| 495 | + uint8_t str_buffer[200] = {0}; |
---|
| 496 | + hex2String(recvSocketBuf, str_buffer, (total_len > 64) ? 64 : total_len); |
---|
| 497 | + |
---|
| 498 | + if((skwbt_transtype & SKWBT_TRANS_TYPE_UART) && (skwbtuartonly == FALSE) && (skwbtNoSleep == FALSE) && (btpw_fp > 0))//uart |
---|
| 499 | + { |
---|
| 500 | + char tmp_buf[6] = {0}; |
---|
| 501 | + int r_len; |
---|
| 502 | + |
---|
| 503 | + tmp_buf[0] = pkt_cnts ++; |
---|
| 504 | + r_len = write(btpw_fp, tmp_buf, 1); |
---|
| 505 | + SKWBT_LOG("r_len:%d, btpw_fp:%d, pkt_cnts:%d", r_len, btpw_fp, pkt_cnts); |
---|
| 506 | + } |
---|
| 507 | + |
---|
| 508 | + uint16_t length = total_len; |
---|
| 509 | + uint16_t transmitted_length = 0; |
---|
| 510 | + uint8_t send_port = BT_COM_PORT_CMDEVT; |
---|
| 511 | + if(skwbt_transtype & SKWBT_TRANS_TYPE_SDIO) |
---|
| 512 | + { |
---|
| 513 | + switch(recvSocketBuf[0]) |
---|
| 514 | + { |
---|
| 515 | + case HCI_ACLDATA_PKT: |
---|
| 516 | + send_port = BT_COM_PORT_ACL; |
---|
| 517 | + break; |
---|
| 518 | + case HCI_SCODATA_PKT: |
---|
| 519 | + send_port = BT_COM_PORT_AUDIO; |
---|
| 520 | + break; |
---|
| 521 | + case HCI_ISO_PKT: |
---|
| 522 | + send_port = BT_COM_PORT_ISO; |
---|
| 523 | + break; |
---|
| 524 | + default: |
---|
| 525 | + send_port = BT_COM_PORT_CMDEVT; |
---|
| 526 | + break; |
---|
| 527 | + } |
---|
| 528 | + } |
---|
| 529 | + |
---|
| 530 | + |
---|
| 531 | + SKWBT_LOG("total_len:%d, port:%d, %s", total_len, send_port, str_buffer); |
---|
| 532 | + |
---|
| 533 | + skw_btsnoop_capture(recvSocketBuf, FALSE); |
---|
| 534 | + |
---|
| 535 | + |
---|
| 536 | + |
---|
| 537 | + while((length > 0) && scomm_vnd[send_port].driver_state) |
---|
| 538 | + { |
---|
| 539 | + ssize_t ret = write(scomm_vnd[send_port].fd, recvSocketBuf + transmitted_length, length); |
---|
| 540 | + |
---|
| 541 | + switch (ret) |
---|
| 542 | + { |
---|
| 543 | + case -1: |
---|
| 544 | + ALOGE("In %s, error writing to the scomm: %s", __func__, strerror(errno)); |
---|
| 545 | + return ; |
---|
| 546 | + //break; |
---|
| 547 | + case 0: |
---|
| 548 | + ALOGE("%s, ret %zd", __func__, ret); |
---|
| 549 | + break; |
---|
| 550 | + default: |
---|
| 551 | + transmitted_length += ret; |
---|
| 552 | + length -= ret; |
---|
| 553 | + //break; |
---|
| 554 | + } |
---|
| 555 | + } |
---|
| 556 | + |
---|
| 557 | + //SKWBT_LOG("%s [%d] end", __func__, port_index); |
---|
| 558 | +} |
---|
| 559 | + |
---|
| 560 | +static void *scomm_vendor_recv_socket_thread(void *arg) |
---|
| 561 | +{ |
---|
| 562 | + //SKW_UNUSED(arg); |
---|
| 563 | + int port_index = (int)((long)arg);//for error: cast from pointer to integer of different size |
---|
| 564 | + struct epoll_event events[32]; |
---|
| 565 | + scomm_vnd_st *scomm = &scomm_vnd[0]; |
---|
| 566 | + int j, ret; |
---|
| 567 | + |
---|
| 568 | + ALOGD("%s [%d] start", __func__, port_index); |
---|
| 569 | + |
---|
| 570 | + while(scomm->thread_running) |
---|
| 571 | + { |
---|
| 572 | + do |
---|
| 573 | + { |
---|
| 574 | + ret = epoll_wait(scomm->epoll_fd, events, 32, 500); |
---|
| 575 | + |
---|
| 576 | + //ALOGE("recv_socket_thread ret:%d, state:%d", ret, scomm->thread_running); |
---|
| 577 | + |
---|
| 578 | + } while(scomm->thread_running && (ret == -1) && (errno == EINTR)); |
---|
| 579 | + |
---|
| 580 | + if (ret < 0) |
---|
| 581 | + { |
---|
| 582 | + ALOGE("%s error in epoll_wait:%d, %s", __func__, ret, strerror(errno)); |
---|
| 583 | + break; |
---|
| 584 | + } |
---|
| 585 | + for (j = 0; (j < ret) && (scomm->thread_running); ++j) |
---|
| 586 | + { |
---|
| 587 | + skw_socket_object_st *object = (skw_socket_object_st *)events[j].data.ptr; |
---|
| 588 | + if (object == NULL) |
---|
| 589 | + { |
---|
| 590 | + continue; |
---|
| 591 | + } |
---|
| 592 | + else |
---|
| 593 | + { |
---|
| 594 | + if (events[j].events & (EPOLLIN | EPOLLHUP | EPOLLRDHUP | EPOLLERR) && object->read_ready) |
---|
| 595 | + { |
---|
| 596 | + object->read_ready(object->context); |
---|
| 597 | + //object->read_ready(port_index); |
---|
| 598 | + } |
---|
| 599 | + } |
---|
| 600 | + } |
---|
| 601 | + } |
---|
| 602 | + //scomm_vnd[port_index].thread_socket_id = -1; |
---|
| 603 | + |
---|
| 604 | + ALOGD("%s [%d] exit", __func__, port_index); |
---|
| 605 | + return NULL; |
---|
| 606 | +} |
---|
| 607 | + |
---|
| 608 | + |
---|
| 609 | +/******************************************************************************* |
---|
| 610 | +** |
---|
| 611 | +** Function scomm_vendor_send_to_host |
---|
| 612 | +** |
---|
| 613 | +** Description send data to host |
---|
| 614 | +** |
---|
| 615 | +** Returns None |
---|
| 616 | +** |
---|
| 617 | +*******************************************************************************/ |
---|
| 618 | +static void scomm_vendor_send_to_host(uint8_t port_index, unsigned char *buffer, unsigned int total_length) |
---|
| 619 | +{ |
---|
| 620 | + unsigned int length = total_length; |
---|
| 621 | + uint16_t transmitted_length = 0; |
---|
| 622 | + ssize_t ret; |
---|
| 623 | + |
---|
| 624 | + |
---|
| 625 | + pthread_mutex_lock(&write2host_lock); |
---|
| 626 | + while ((length > 0) && scomm_vnd[port_index].thread_running) |
---|
| 627 | + { |
---|
| 628 | + RW_NO_INTR(ret = write(scomm_vnd[port_index].socket_fd[1], buffer + transmitted_length, length)); |
---|
| 629 | + |
---|
| 630 | + //SKWBT_LOG("write to host ret:%zd", ret); |
---|
| 631 | + switch (ret) |
---|
| 632 | + { |
---|
| 633 | + case -1: |
---|
| 634 | + ALOGE("In %s, error writing to socket: %s", __func__, strerror(errno)); |
---|
| 635 | + break; |
---|
| 636 | + case 0: |
---|
| 637 | + break; |
---|
| 638 | + default: |
---|
| 639 | + transmitted_length += ret; |
---|
| 640 | + length -= ret; |
---|
| 641 | + break; |
---|
| 642 | + } |
---|
| 643 | + } |
---|
| 644 | + pthread_mutex_unlock(&write2host_lock); |
---|
| 645 | + |
---|
| 646 | + SKWBT_LOG("write to host[%d] total_length:%d, ret:%zd", port_index, total_length, ret); |
---|
| 647 | +} |
---|
| 648 | + |
---|
| 649 | + |
---|
| 650 | +/******************************************************************************* |
---|
| 651 | +** |
---|
| 652 | +** Function scomm_vendor_send_hw_error |
---|
| 653 | +** |
---|
| 654 | +** Description send HCI_HW_ERR command to hsot |
---|
| 655 | +** |
---|
| 656 | +** Returns None |
---|
| 657 | +** |
---|
| 658 | +*******************************************************************************/ |
---|
| 659 | + |
---|
| 660 | +void scomm_vendor_send_hw_error() |
---|
| 661 | +{ |
---|
| 662 | + unsigned char p_buf[10]; |
---|
| 663 | + |
---|
| 664 | + ALOGE("%s, CP Error", __func__); |
---|
| 665 | + |
---|
| 666 | + p_buf[0] = HCI_EVENT_PKT;//event |
---|
| 667 | + p_buf[1] = HCI_HARDWARE_ERROR_EVENT;//hardware error |
---|
| 668 | + p_buf[2] = 0x01;//len |
---|
| 669 | + p_buf[3] = HWERR_CODE_CP_ERROR;//userial error code |
---|
| 670 | + scomm_vendor_send_to_host(0, p_buf, 4); |
---|
| 671 | +} |
---|
| 672 | + |
---|
| 673 | +/******************************************************************************* |
---|
| 674 | +** |
---|
| 675 | +** Function scomm_vendor_find_valid_type |
---|
| 676 | +** |
---|
| 677 | +** Description find the index of valid packet type |
---|
| 678 | +** |
---|
| 679 | +** Returns None |
---|
| 680 | +** |
---|
| 681 | +*******************************************************************************/ |
---|
| 682 | +int scomm_vendor_find_valid_type(uint8_t *buffer, uint16_t len) |
---|
| 683 | +{ |
---|
| 684 | + int i; |
---|
| 685 | + for(i = 0; i < len; i++) |
---|
| 686 | + { |
---|
| 687 | + switch(buffer[i]) |
---|
| 688 | + { |
---|
| 689 | + case HCI_EVENT_PKT: |
---|
| 690 | + case HCI_ACLDATA_PKT: |
---|
| 691 | + case HCI_SCODATA_PKT: |
---|
| 692 | + //case HCI_COMMAND_PKT: |
---|
| 693 | + case HCI_EVENT_SKWLOG: |
---|
| 694 | + return i; |
---|
| 695 | + default: |
---|
| 696 | + break; |
---|
| 697 | + } |
---|
| 698 | +#if 0 |
---|
| 699 | + if((HCI_EVENT_PKT == buffer[i]) || (HCI_ACLDATA_PKT == buffer[i]) || (HCI_SCODATA_PKT == buffer[i]) || (HCI_COMMAND_PKT == buffer[i]) |
---|
| 700 | + || (HCI_EVENT_SKWLOG == buffer[i])) |
---|
| 701 | + { |
---|
| 702 | + return i; |
---|
| 703 | + } |
---|
| 704 | +#endif |
---|
| 705 | + } |
---|
| 706 | + return len; |
---|
| 707 | +} |
---|
| 708 | + |
---|
| 709 | + |
---|
| 710 | +/******************************************************************************* |
---|
| 711 | +** |
---|
| 712 | +** Function scomm_vendor_recv_scomm_thread |
---|
| 713 | +** |
---|
| 714 | +** Description recv data from UART/USB/SDIO and process |
---|
| 715 | +** |
---|
| 716 | +** Returns None |
---|
| 717 | +** |
---|
| 718 | +*******************************************************************************/ |
---|
| 719 | +static void *scomm_vendor_recv_scomm_thread(void *arg) |
---|
| 720 | +{ |
---|
| 721 | + //SKW_UNUSED(arg); |
---|
| 722 | + int port_index = (int)((long)arg); |
---|
| 723 | + struct pollfd pfd[2]; |
---|
| 724 | + scomm_vnd_st *scomm = &scomm_vnd[port_index]; |
---|
| 725 | + pfd[0].events = POLLIN | POLLHUP | POLLERR | POLLRDHUP; |
---|
| 726 | + pfd[0].fd = scomm->signal_fd[1]; |
---|
| 727 | + pfd[1].events = POLLIN | POLLHUP | POLLERR | POLLRDHUP; |
---|
| 728 | + pfd[1].fd = scomm->fd; |
---|
| 729 | + |
---|
| 730 | + uint8_t read_buffer[SCOM_READ_BUFFER_LEN + 1] = {0}; |
---|
| 731 | + uint8_t str_buffer[SCOM_READ_BUFFER_LEN + 1] = {0}; |
---|
| 732 | + ssize_t bytes_read; |
---|
| 733 | + uint16_t last_len = 0, rev_len = 0; |
---|
| 734 | + int ret, is_uart = (skwbt_transtype & SKWBT_TRANS_TYPE_UART); |
---|
| 735 | + |
---|
| 736 | + scomm->recv_comm_thread_running = TRUE; |
---|
| 737 | + scomm->read_retry = 0; |
---|
| 738 | + ALOGD("%s [%d] start, is_uart:%d", __func__, port_index, is_uart); |
---|
| 739 | + |
---|
| 740 | + while(scomm->thread_running) |
---|
| 741 | + { |
---|
| 742 | + if(is_uart) |
---|
| 743 | + { |
---|
| 744 | + do |
---|
| 745 | + { |
---|
| 746 | + ret = poll(pfd, 2, 500); |
---|
| 747 | + } while(ret == -1 && errno == EINTR && scomm->thread_running); |
---|
| 748 | + //exit signal is always at first index |
---|
| 749 | + if(pfd[0].revents && !scomm->thread_running) |
---|
| 750 | + { |
---|
| 751 | + ALOGE("receive exit signal and stop thread "); |
---|
| 752 | + break; |
---|
| 753 | + } |
---|
| 754 | + if (pfd[1].revents & (POLLERR | POLLHUP)) |
---|
| 755 | + { |
---|
| 756 | + ALOGE("%s poll error, fd : %d", __func__, scomm->fd); |
---|
| 757 | + scomm->driver_state = FALSE; |
---|
| 758 | + close(scomm->fd); |
---|
| 759 | + break; |
---|
| 760 | + } |
---|
| 761 | + if(!(pfd[1].revents & POLLIN)) |
---|
| 762 | + { |
---|
| 763 | + continue; |
---|
| 764 | + } |
---|
| 765 | + } |
---|
| 766 | + |
---|
| 767 | + |
---|
| 768 | + scomm->is_busying = FALSE; |
---|
| 769 | + bytes_read = read(scomm->fd, read_buffer + last_len, SCOM_READ_BUFFER_LEN - last_len); |
---|
| 770 | + scomm->is_busying = TRUE; |
---|
| 771 | + |
---|
| 772 | + if(bytes_read == 0) |
---|
| 773 | + { |
---|
| 774 | + if(scomm->thread_running) |
---|
| 775 | + { |
---|
| 776 | + continue; |
---|
| 777 | + } |
---|
| 778 | + break; |
---|
| 779 | + } |
---|
| 780 | + if(bytes_read < 0) |
---|
| 781 | + { |
---|
| 782 | + ALOGE("%s, read fail, thread[%d] state:%d, error code:%zd, %s, read_retry:%d", __func__, port_index, (scomm->thread_running), bytes_read, strerror(errno), scomm->read_retry); |
---|
| 783 | + if((scomm->thread_running) && (0 == port_index)) |
---|
| 784 | + { |
---|
| 785 | + if(scomm->read_retry == 0) |
---|
| 786 | + { |
---|
| 787 | + scomm->read_retry = 1; |
---|
| 788 | + usleep(200000); |
---|
| 789 | + continue; |
---|
| 790 | + } |
---|
| 791 | + scomm_vendor_send_hw_error(); |
---|
| 792 | + } |
---|
| 793 | + break; |
---|
| 794 | + } |
---|
| 795 | + if(read_buffer[0] != HCI_EVENT_SKWLOG) |
---|
| 796 | + { |
---|
| 797 | + hex2String(read_buffer + last_len, str_buffer, (bytes_read > 64) ? 64 : bytes_read); |
---|
| 798 | + SKWBT_LOG("scomm[%d] read:%zd, last_len:%d, %s", port_index, bytes_read, last_len, str_buffer); |
---|
| 799 | + } |
---|
| 800 | + |
---|
| 801 | + //data parse for get a commplete packet and capture the snoop log |
---|
| 802 | + rev_len = bytes_read + last_len; |
---|
| 803 | + do |
---|
| 804 | + { |
---|
| 805 | + uint8_t pkt_type = read_buffer[0]; |
---|
| 806 | + if((pkt_type == HCI_EVENT_PKT) || (pkt_type == HCI_ACLDATA_PKT) || (pkt_type == HCI_SCODATA_PKT) || (pkt_type == HCI_EVENT_SKWLOG) || (pkt_type == HCI_ISO_PKT)) |
---|
| 807 | + { |
---|
| 808 | + uint16_t hdr_lens = hci_preamble_sizes[pkt_type] + 1; |
---|
| 809 | + if(rev_len >= hdr_lens) |
---|
| 810 | + { |
---|
| 811 | + uint16_t pkt_len = 0; |
---|
| 812 | + //get payload length |
---|
| 813 | + if((pkt_type == HCI_ACLDATA_PKT) || (pkt_type == HCI_ISO_PKT)) |
---|
| 814 | + { |
---|
| 815 | + pkt_len = *(uint16_t *)&read_buffer[HCI_COMMON_DATA_LENGTH_INDEX]; |
---|
| 816 | + } |
---|
| 817 | + else if(pkt_type == HCI_EVENT_PKT) |
---|
| 818 | + { |
---|
| 819 | + pkt_len = read_buffer[HCI_EVENT_DATA_LENGTH_INDEX]; |
---|
| 820 | + } |
---|
| 821 | + else if(pkt_type == HCI_EVENT_SKWLOG) |
---|
| 822 | + { |
---|
| 823 | + pkt_len = *(uint16_t *)&read_buffer[HCI_SKWLOG_DATA_LENGTH_INDEX]; |
---|
| 824 | + } |
---|
| 825 | + else//cmd/sco |
---|
| 826 | + { |
---|
| 827 | + pkt_len = read_buffer[HCI_COMMON_DATA_LENGTH_INDEX]; |
---|
| 828 | + } |
---|
| 829 | + |
---|
| 830 | + SKWBT_LOG("rev_len:%d, pkt_type:%d, hdr_lens:%d, pkt_len:%d", rev_len, pkt_type, hdr_lens, pkt_len); |
---|
| 831 | + |
---|
| 832 | + pkt_len += hdr_lens; |
---|
| 833 | + if(rev_len >= pkt_len) |
---|
| 834 | + { |
---|
| 835 | + if(pkt_type == HCI_EVENT_SKWLOG) |
---|
| 836 | + { |
---|
| 837 | + skwlog_write(read_buffer, pkt_len); |
---|
| 838 | + } |
---|
| 839 | + else// |
---|
| 840 | + { |
---|
| 841 | + |
---|
| 842 | + skw_btsnoop_capture(read_buffer, TRUE); |
---|
| 843 | + scomm_vendor_send_to_host(0, read_buffer, pkt_len); |
---|
| 844 | + } |
---|
| 845 | + last_len = rev_len - pkt_len; |
---|
| 846 | + if((pkt_len + last_len) <= SCOM_READ_BUFFER_LEN) |
---|
| 847 | + { |
---|
| 848 | + memcpy(read_buffer, read_buffer + pkt_len, last_len); |
---|
| 849 | + } |
---|
| 850 | + else |
---|
| 851 | + { |
---|
| 852 | + ALOGE("%s, err packet, pkt_len:%d, last_len:%d", __func__, pkt_len, last_len); |
---|
| 853 | + } |
---|
| 854 | + if(last_len >= 4) |
---|
| 855 | + { |
---|
| 856 | + rev_len = last_len; |
---|
| 857 | + SKWBT_LOG(" more packet, rev_len:%d ", rev_len); |
---|
| 858 | + continue; |
---|
| 859 | + } |
---|
| 860 | + |
---|
| 861 | + } |
---|
| 862 | + else |
---|
| 863 | + { |
---|
| 864 | + last_len = rev_len; |
---|
| 865 | + SKWBT_LOG("need more, rev_len:%d, pkt_len:%d, last_len:%d", rev_len, pkt_len, last_len); |
---|
| 866 | + } |
---|
| 867 | + } |
---|
| 868 | + else |
---|
| 869 | + { |
---|
| 870 | + last_len = rev_len; |
---|
| 871 | + } |
---|
| 872 | + } |
---|
| 873 | + else//invalid data, discard |
---|
| 874 | + { |
---|
| 875 | + int vLen = scomm_vendor_find_valid_type(read_buffer, rev_len); |
---|
| 876 | + ALOGE("invalid type:%02X, vLen:%d", pkt_type, vLen); |
---|
| 877 | + |
---|
| 878 | + last_len = rev_len - vLen; |
---|
| 879 | + if(vLen < rev_len) |
---|
| 880 | + { |
---|
| 881 | + memcpy(read_buffer, read_buffer + vLen, last_len); |
---|
| 882 | + } |
---|
| 883 | + } |
---|
| 884 | + |
---|
| 885 | + break; |
---|
| 886 | + } while (1); |
---|
| 887 | + } |
---|
| 888 | + |
---|
| 889 | + |
---|
| 890 | + scomm->is_busying = FALSE; |
---|
| 891 | + scomm->thread_uart_id = -1; |
---|
| 892 | + |
---|
| 893 | + ALOGD("%s [%d] exit", __func__, port_index); |
---|
| 894 | + return NULL; |
---|
| 895 | +} |
---|
| 896 | + |
---|
| 897 | + |
---|
| 898 | +/******************************************************************************* |
---|
| 899 | +** |
---|
| 900 | +** Function scomm_vendor_socket_open |
---|
| 901 | +** |
---|
| 902 | +** Description USB/SDIO Open |
---|
| 903 | +** |
---|
| 904 | +** Returns None |
---|
| 905 | +** |
---|
| 906 | +*******************************************************************************/ |
---|
| 907 | +int scomm_vendor_socket_open(uint8_t port_index) |
---|
| 908 | +{ |
---|
| 909 | + int ret = 0; |
---|
| 910 | + struct epoll_event event; |
---|
| 911 | + if((ret = socketpair(AF_UNIX, SOCK_STREAM, 0, scomm_vnd[port_index].socket_fd)) < 0) |
---|
| 912 | + { |
---|
| 913 | + ALOGE("%s, errno : %s", __func__, strerror(errno)); |
---|
| 914 | + return ret; |
---|
| 915 | + } |
---|
| 916 | + |
---|
| 917 | + if((ret = socketpair(AF_UNIX, SOCK_STREAM, 0, scomm_vnd[port_index].signal_fd)) < 0) |
---|
| 918 | + { |
---|
| 919 | + ALOGE("%s, errno : %s", __func__, strerror(errno)); |
---|
| 920 | + return ret; |
---|
| 921 | + } |
---|
| 922 | + |
---|
| 923 | + scomm_vnd[port_index].epoll_fd = epoll_create(4); |
---|
| 924 | + if (scomm_vnd[port_index].epoll_fd == -1) |
---|
| 925 | + { |
---|
| 926 | + ALOGE("%s unable to create epoll instance: %s", __func__, strerror(errno)); |
---|
| 927 | + return -1; |
---|
| 928 | + } |
---|
| 929 | + |
---|
| 930 | + scomm_vnd[port_index].thread_running = TRUE; |
---|
| 931 | + scomm_vnd[port_index].recv_comm_thread_running = FALSE; |
---|
| 932 | + scomm_vnd[port_index].thread_socket_id = -1; |
---|
| 933 | + |
---|
| 934 | + pthread_attr_t thread_attr; |
---|
| 935 | + pthread_attr_init(&thread_attr); |
---|
| 936 | + pthread_attr_setdetachstate(&thread_attr, PTHREAD_CREATE_JOINABLE); |
---|
| 937 | + |
---|
| 938 | + memset(&event, 0, sizeof(event)); |
---|
| 939 | + event.events = EPOLLIN | EPOLLHUP | EPOLLRDHUP | EPOLLERR; |
---|
| 940 | + event.data.ptr = (void *)&skw_socket_object; |
---|
| 941 | + if (epoll_ctl(scomm_vnd[port_index].epoll_fd, EPOLL_CTL_ADD, scomm_vnd[port_index].socket_fd[1], &event) == -1) |
---|
| 942 | + { |
---|
| 943 | + ALOGE("%s unable to register fd %d to epoll set: %s", __func__, scomm_vnd[port_index].socket_fd[1], strerror(errno)); |
---|
| 944 | + close(scomm_vnd[port_index].epoll_fd); |
---|
| 945 | + scomm_vnd[port_index].epoll_fd = -1; |
---|
| 946 | + scomm_vnd[port_index].thread_running = FALSE; |
---|
| 947 | + return -1; |
---|
| 948 | + } |
---|
| 949 | + |
---|
| 950 | + event.data.ptr = NULL; |
---|
| 951 | + if (epoll_ctl(scomm_vnd[port_index].epoll_fd, EPOLL_CTL_ADD, scomm_vnd[port_index].signal_fd[0], &event) == -1) |
---|
| 952 | + { |
---|
| 953 | + ALOGE("%s unable to register signal0 fd %d to epoll set: %s", __func__, scomm_vnd[port_index].signal_fd[0], strerror(errno)); |
---|
| 954 | + close(scomm_vnd[port_index].epoll_fd); |
---|
| 955 | + scomm_vnd[port_index].epoll_fd = -1; |
---|
| 956 | + scomm_vnd[port_index].thread_running = FALSE; |
---|
| 957 | + return -1; |
---|
| 958 | + } |
---|
| 959 | + |
---|
| 960 | + |
---|
| 961 | + if(port_index == 0) |
---|
| 962 | + { |
---|
| 963 | + skw_socket_object.fd = scomm_vnd[port_index].socket_fd[1]; |
---|
| 964 | + skw_socket_object.read_ready = scomm_vendor_recv_rawdata; |
---|
| 965 | + skw_socket_object.write_ready = NULL; |
---|
| 966 | + |
---|
| 967 | + if (pthread_create(&scomm_vnd[port_index].thread_socket_id, &thread_attr, scomm_vendor_recv_socket_thread, (void *)(long)port_index) != 0 ) |
---|
| 968 | + { |
---|
| 969 | + ALOGE("pthread_create : %s", strerror(errno)); |
---|
| 970 | + close(scomm_vnd[port_index].epoll_fd); |
---|
| 971 | + scomm_vnd[port_index].epoll_fd = -1; |
---|
| 972 | + scomm_vnd[port_index].thread_socket_id = -1; |
---|
| 973 | + scomm_vnd[port_index].thread_running = FALSE; |
---|
| 974 | + return -1; |
---|
| 975 | + } |
---|
| 976 | + } |
---|
| 977 | + |
---|
| 978 | + |
---|
| 979 | + if (pthread_create(&scomm_vnd[port_index].thread_uart_id, &thread_attr, scomm_vendor_recv_scomm_thread, (void *)(long)port_index) != 0 ) |
---|
| 980 | + { |
---|
| 981 | + ALOGE("pthread_create : %s", strerror(errno)); |
---|
| 982 | + close(scomm_vnd[port_index].epoll_fd); |
---|
| 983 | + scomm_vnd[port_index].thread_running = FALSE; |
---|
| 984 | + pthread_join(scomm_vnd[port_index].thread_socket_id, NULL); |
---|
| 985 | + scomm_vnd[port_index].thread_socket_id = -1; |
---|
| 986 | + return -1; |
---|
| 987 | + } |
---|
| 988 | + while(!scomm_vnd[port_index].recv_comm_thread_running) |
---|
| 989 | + { |
---|
| 990 | + usleep(20); |
---|
| 991 | + } |
---|
| 992 | + |
---|
| 993 | + scomm_vnd[port_index].driver_state = TRUE; |
---|
| 994 | + |
---|
| 995 | + ret = scomm_vnd[port_index].socket_fd[0]; |
---|
| 996 | + |
---|
| 997 | + ALOGD("%s socket_fd:%d", __func__, ret); |
---|
| 998 | + return ret; |
---|
| 999 | +} |
---|
| 1000 | + |
---|
| 1001 | + |
---|
| 1002 | +/******************************************************************************* |
---|
| 1003 | +** |
---|
| 1004 | +** Function scomm_vendor_socket_close |
---|
| 1005 | +** |
---|
| 1006 | +** Description socket close |
---|
| 1007 | +** |
---|
| 1008 | +** Returns None |
---|
| 1009 | +** |
---|
| 1010 | +*******************************************************************************/ |
---|
| 1011 | +static void scomm_vendor_socket_close(uint8_t port_index) |
---|
| 1012 | +{ |
---|
| 1013 | + int result; |
---|
| 1014 | + |
---|
| 1015 | + ALOGE( "%s [%d], thread_socket_id:0x%X", __func__, port_index, (int)scomm_vnd[port_index].thread_socket_id); |
---|
| 1016 | + |
---|
| 1017 | + if ((scomm_vnd[port_index].socket_fd[0] > 0) && (result = close(scomm_vnd[port_index].socket_fd[0])) < 0) |
---|
| 1018 | + { |
---|
| 1019 | + ALOGE( "%s (fd:%d) FAILED result:%d", __func__, scomm_vnd[port_index].socket_fd[0], result); |
---|
| 1020 | + } |
---|
| 1021 | + |
---|
| 1022 | + if (epoll_ctl(scomm_vnd[port_index].epoll_fd, EPOLL_CTL_DEL, scomm_vnd[port_index].socket_fd[1], NULL) == -1) |
---|
| 1023 | + { |
---|
| 1024 | + ALOGE("%s unable to unregister fd %d from epoll set: %s", __func__, scomm_vnd[port_index].socket_fd[1], strerror(errno)); |
---|
| 1025 | + } |
---|
| 1026 | + if (epoll_ctl(scomm_vnd[port_index].epoll_fd, EPOLL_CTL_DEL, scomm_vnd[port_index].signal_fd[0], NULL) == -1) |
---|
| 1027 | + { |
---|
| 1028 | + ALOGE("%s unable to unregister signal0 fd %d from epoll set: %s", __func__, scomm_vnd[port_index].signal_fd[0], strerror(errno)); |
---|
| 1029 | + } |
---|
| 1030 | + |
---|
| 1031 | + if(scomm_vnd[port_index].epoll_fd > 0) |
---|
| 1032 | + { |
---|
| 1033 | + close(scomm_vnd[port_index].epoll_fd); |
---|
| 1034 | + } |
---|
| 1035 | + |
---|
| 1036 | + if(scomm_vnd[port_index].thread_socket_id != -1) |
---|
| 1037 | + { |
---|
| 1038 | + if ((result = pthread_join(scomm_vnd[port_index].thread_socket_id, NULL)) < 0) |
---|
| 1039 | + { |
---|
| 1040 | + ALOGE( "data thread pthread_join() scomm_vnd[port_index].thread_socket_id failed result:%d", result); |
---|
| 1041 | + } |
---|
| 1042 | + else |
---|
| 1043 | + { |
---|
| 1044 | + scomm_vnd[port_index].thread_socket_id = -1; |
---|
| 1045 | + ALOGE( "data thread pthread_join() scomm_vnd[port_index].thread_socket_id pthread_join_success result:%d", result); |
---|
| 1046 | + } |
---|
| 1047 | + } |
---|
| 1048 | + |
---|
| 1049 | + if ((scomm_vnd[port_index].socket_fd[1] > 0) && (result = close(scomm_vnd[port_index].socket_fd[1])) < 0) |
---|
| 1050 | + { |
---|
| 1051 | + ALOGE( "%s (fd:%d) FAILED result:%d", __func__, scomm_vnd[port_index].socket_fd[1], result); |
---|
| 1052 | + } |
---|
| 1053 | + |
---|
| 1054 | + if ((scomm_vnd[port_index].signal_fd[0] > 0) && (result = close(scomm_vnd[port_index].signal_fd[0])) < 0) |
---|
| 1055 | + { |
---|
| 1056 | + ALOGE( "%s (signal fd[0]:%d) FAILED result:%d", __func__, scomm_vnd[port_index].signal_fd[0], result); |
---|
| 1057 | + } |
---|
| 1058 | + if ((scomm_vnd[port_index].signal_fd[1] > 0) && (result = close(scomm_vnd[port_index].signal_fd[1])) < 0) |
---|
| 1059 | + { |
---|
| 1060 | + ALOGE( "%s (signal fd[1]:%d) FAILED result:%d", __func__, scomm_vnd[port_index].signal_fd[1], result); |
---|
| 1061 | + } |
---|
| 1062 | + |
---|
| 1063 | + scomm_vnd[port_index].epoll_fd = -1; |
---|
| 1064 | + scomm_vnd[port_index].socket_fd[0] = -1; |
---|
| 1065 | + scomm_vnd[port_index].socket_fd[1] = -1; |
---|
| 1066 | + scomm_vnd[port_index].signal_fd[0] = -1; |
---|
| 1067 | + scomm_vnd[port_index].signal_fd[1] = -1; |
---|
| 1068 | + ALOGE( "%s [%d] end", __func__, port_index); |
---|
| 1069 | +} |
---|
| 1070 | + |
---|
| 1071 | + |
---|
| 1072 | +void scomm_vendor_write_bt_state() |
---|
| 1073 | +{ |
---|
| 1074 | + //if(skwbt_transtype & SKWBT_TRANS_TYPE_USB) |
---|
| 1075 | + if(chip_version == SKW_CHIPID_6160) |
---|
| 1076 | + { |
---|
| 1077 | + char buffer[10] = {0x01, 0x80, 0xFE, 0x01, 0x00}; |
---|
| 1078 | + scomm_vnd_st *scomm = &scomm_vnd[0]; |
---|
| 1079 | + write(scomm->fd, buffer, 5); |
---|
| 1080 | + usleep(15000); |
---|
| 1081 | + } |
---|
| 1082 | +} |
---|
| 1083 | + |
---|
| 1084 | +/******************************************************************************* |
---|
| 1085 | +** |
---|
| 1086 | +** Function scomm_vendor_port_close |
---|
| 1087 | +** |
---|
| 1088 | +** Description Conduct vendor-specific close works |
---|
| 1089 | +** |
---|
| 1090 | +** Returns None |
---|
| 1091 | +** |
---|
| 1092 | +*******************************************************************************/ |
---|
| 1093 | +void scomm_vendor_port_close(uint8_t port_index) |
---|
| 1094 | +{ |
---|
| 1095 | + //send close signal |
---|
| 1096 | + unsigned char close_signal = 1; |
---|
| 1097 | + ssize_t ret; |
---|
| 1098 | + int res, i; |
---|
| 1099 | + scomm_vnd_st *scomm = &scomm_vnd[port_index]; |
---|
| 1100 | + ALOGD( "%s [%d] start, fd:%d, busy:%d", __func__, port_index, scomm->fd, scomm->is_busying); |
---|
| 1101 | + |
---|
| 1102 | + if(scomm->fd == -1) |
---|
| 1103 | + { |
---|
| 1104 | + return; |
---|
| 1105 | + } |
---|
| 1106 | + |
---|
| 1107 | + scomm->thread_running = FALSE; |
---|
| 1108 | + scomm->driver_state = FALSE; |
---|
| 1109 | + |
---|
| 1110 | + while(scomm->is_busying) |
---|
| 1111 | + { |
---|
| 1112 | + usleep(20); |
---|
| 1113 | + } |
---|
| 1114 | + |
---|
| 1115 | + res = ioctl(scomm->fd, 0); |
---|
| 1116 | + //ALOGE("res:%d, %s", res, strerror(errno)); |
---|
| 1117 | + |
---|
| 1118 | + ALOGE("%s signal_fd:%d", __func__, scomm->signal_fd[1]); |
---|
| 1119 | + RW_NO_INTR(ret = write(scomm->signal_fd[1], &close_signal, 1)); |
---|
| 1120 | + |
---|
| 1121 | + usleep(300);//wait |
---|
| 1122 | + for(i = 0; (skwbt_transtype & SKWBT_TRANS_TYPE_SDIO) && (i < 2) && (scomm->thread_uart_id != -1); i++) |
---|
| 1123 | + { |
---|
| 1124 | + res = ioctl(scomm->fd, 0);//try again |
---|
| 1125 | + usleep(200); |
---|
| 1126 | + ALOGD("%s,%d times:%d, res:%d, %s", __func__, port_index, i, res, strerror(errno)); |
---|
| 1127 | + } |
---|
| 1128 | + |
---|
| 1129 | + //scomm close |
---|
| 1130 | + if ((scomm->fd > 0) && (res = close(scomm->fd)) < 0) |
---|
| 1131 | + { |
---|
| 1132 | + ALOGE( "%s (fd:%d) FAILED result:%d", __func__, scomm->fd, res); |
---|
| 1133 | + } |
---|
| 1134 | + |
---|
| 1135 | + ALOGD("Run Here"); |
---|
| 1136 | + |
---|
| 1137 | + if(scomm->thread_uart_id != -1) |
---|
| 1138 | + { |
---|
| 1139 | + pthread_join(scomm->thread_uart_id, NULL); |
---|
| 1140 | + scomm->thread_uart_id = -1; |
---|
| 1141 | + } |
---|
| 1142 | + |
---|
| 1143 | + scomm_vendor_socket_close(port_index); |
---|
| 1144 | + |
---|
| 1145 | + //close(scomm_vnd[port_index].fd); |
---|
| 1146 | + scomm->fd = -1; |
---|
| 1147 | + |
---|
| 1148 | + |
---|
| 1149 | + ALOGD( "%s [%d] finish", __func__, port_index); |
---|
| 1150 | + |
---|
| 1151 | +} |
---|
| 1152 | + |
---|
| 1153 | +/******************************************************************************* |
---|
| 1154 | +** |
---|
| 1155 | +** Function scomm_vendor_close |
---|
| 1156 | +** |
---|
| 1157 | +** Description Conduct vendor-specific close works |
---|
| 1158 | +** |
---|
| 1159 | +** Returns None |
---|
| 1160 | +** |
---|
| 1161 | +*******************************************************************************/ |
---|
| 1162 | +void scomm_vendor_close() |
---|
| 1163 | +{ |
---|
| 1164 | + int idx = 0; |
---|
| 1165 | + for(idx = 0; idx < BT_COM_PORT_SIZE; idx++) |
---|
| 1166 | + { |
---|
| 1167 | + scomm_vendor_port_close(idx); |
---|
| 1168 | + } |
---|
| 1169 | + if(btpw_fp > 0) |
---|
| 1170 | + { |
---|
| 1171 | + close(btpw_fp); |
---|
| 1172 | + } |
---|
| 1173 | +} |
---|
| 1174 | + |
---|
| 1175 | +/******************************************************************************* |
---|
| 1176 | +** |
---|
| 1177 | +** Function scomm_vendor_init_err |
---|
| 1178 | +** |
---|
| 1179 | +** Description init err |
---|
| 1180 | +** |
---|
| 1181 | +** Returns None |
---|
| 1182 | +** |
---|
| 1183 | +*******************************************************************************/ |
---|
| 1184 | +void scomm_vendor_init_err(HC_BT_HDR *p_buf) |
---|
| 1185 | +{ |
---|
| 1186 | + hw_cfg_cb.state = HW_CFG_INIT; |
---|
| 1187 | + bt_vendor_cbacks->dealloc(p_buf); |
---|
| 1188 | + fclose(hw_cfg_cb.nv_fp); |
---|
| 1189 | + hw_cfg_cb.nv_fp = NULL; |
---|
| 1190 | + |
---|
| 1191 | +} |
---|
| 1192 | + |
---|
| 1193 | +/******************************************************************************* |
---|
| 1194 | +** |
---|
| 1195 | +** Function scomm_vendor_config_callback |
---|
| 1196 | +** |
---|
| 1197 | +** Description Callback function for controller configuration |
---|
| 1198 | +** |
---|
| 1199 | +** Returns None |
---|
| 1200 | +** |
---|
| 1201 | +*******************************************************************************/ |
---|
| 1202 | +void scomm_vendor_config_callback(void *p_mem) |
---|
| 1203 | +{ |
---|
| 1204 | + uint8_t status = 0; |
---|
| 1205 | + uint16_t opcode = 0; |
---|
| 1206 | + HC_BT_HDR *p_buf = NULL; |
---|
| 1207 | + HC_BT_HDR *p_evt_buf = NULL; |
---|
| 1208 | + |
---|
| 1209 | + |
---|
| 1210 | + if(p_mem != NULL) |
---|
| 1211 | + { |
---|
| 1212 | + p_evt_buf = (HC_BT_HDR *) p_mem; |
---|
| 1213 | + status = *((uint8_t *)(p_evt_buf + 1) + HCI_EVT_CMD_CMPL_STATUS_OFFSET); |
---|
| 1214 | + uint8_t *p = (uint8_t *)(p_evt_buf + 1) + HCI_EVT_CMD_CMPL_OPCODE_OFFSET; |
---|
| 1215 | + STREAM_TO_UINT16(opcode, p); |
---|
| 1216 | + } |
---|
| 1217 | + |
---|
| 1218 | + |
---|
| 1219 | + ALOGD("%s status:%d ,opcode:%04X", __func__, status, opcode); |
---|
| 1220 | + if((status == 0) && bt_vendor_cbacks) |
---|
| 1221 | + { |
---|
| 1222 | + p_buf = (HC_BT_HDR *)bt_vendor_cbacks->alloc(BT_HC_HDR_SIZE + HCI_CMD_MAX_LEN); |
---|
| 1223 | + } |
---|
| 1224 | + |
---|
| 1225 | + if(p_buf) |
---|
| 1226 | + { |
---|
| 1227 | + p_buf->event = MSG_STACK_TO_HC_HCI_CMD; |
---|
| 1228 | + p_buf->offset = 0; |
---|
| 1229 | + p_buf->len = 0; |
---|
| 1230 | + p_buf->layer_specific = 0; |
---|
| 1231 | + |
---|
| 1232 | + ALOGD("hw_cfg_cb.state = %d", hw_cfg_cb.state); |
---|
| 1233 | + |
---|
| 1234 | + switch (hw_cfg_cb.state) |
---|
| 1235 | + { |
---|
| 1236 | + case HW_CFG_START: |
---|
| 1237 | + { |
---|
| 1238 | + uint8_t *ptr = (uint8_t *) (p_buf + 1); |
---|
| 1239 | + UINT16_TO_STREAM(ptr, HCI_READ_LOCAL_VERSION_INFO); |
---|
| 1240 | + UINT8_TO_STREAM(ptr, 0); |
---|
| 1241 | + |
---|
| 1242 | + p_buf->len = 3;//packet len |
---|
| 1243 | + bt_vendor_cbacks->xmit_cb(HCI_READ_LOCAL_VERSION_INFO, p_buf, scomm_vendor_config_callback); |
---|
| 1244 | + hw_cfg_cb.state = HW_CFG_READ_HCI_VERSION; |
---|
| 1245 | + break; |
---|
| 1246 | + } |
---|
| 1247 | + case HW_CFG_READ_HCI_VERSION: |
---|
| 1248 | + { |
---|
| 1249 | + char file_name[128] = {0}; |
---|
| 1250 | + uint8_t skip_header = 0; |
---|
| 1251 | + uint8_t *p = (uint8_t *)(p_evt_buf + 1) + 7; |
---|
| 1252 | + if(p == NULL) |
---|
| 1253 | + { |
---|
| 1254 | + ALOGE("%s invalid ptr", __func__); |
---|
| 1255 | + bt_vendor_cbacks->fwcfg_cb(BT_VND_OP_RESULT_FAIL); |
---|
| 1256 | + hw_cfg_cb.state = HW_CFG_INIT; |
---|
| 1257 | + return ; |
---|
| 1258 | + } |
---|
| 1259 | + STREAM_TO_UINT16(chip_version, p); |
---|
| 1260 | + |
---|
| 1261 | + ALOGD("chip_version:0x%04X", chip_version); |
---|
| 1262 | + |
---|
| 1263 | + switch(chip_version) |
---|
| 1264 | + { |
---|
| 1265 | + case SKW_CHIPID_6316://0x6316 |
---|
| 1266 | + { |
---|
| 1267 | + skip_header = 1; |
---|
| 1268 | + sprintf(file_name, "%s/sv6316.nvbin", SKWBT_NV_FILE_PATH); |
---|
| 1269 | + break; |
---|
| 1270 | + } |
---|
| 1271 | + case SKW_CHIPID_6160_LITE: |
---|
| 1272 | + { |
---|
| 1273 | + skip_header = 1; |
---|
| 1274 | + sprintf(file_name, "%s/sv6160lite.nvbin", SKWBT_NV_FILE_PATH); |
---|
| 1275 | + break; |
---|
| 1276 | + } |
---|
| 1277 | + default: |
---|
| 1278 | + { |
---|
| 1279 | + sprintf(file_name, "%s/sv6160.nvbin", SKWBT_NV_FILE_PATH); |
---|
| 1280 | + chip_version = SKW_CHIPID_6160; |
---|
| 1281 | + break; |
---|
| 1282 | + } |
---|
| 1283 | + } |
---|
| 1284 | + |
---|
| 1285 | + hw_cfg_cb.nv_fp = fopen(file_name, "rb"); |
---|
| 1286 | + if(!hw_cfg_cb.nv_fp) |
---|
| 1287 | + { |
---|
| 1288 | + ALOGE("%s unable to open nv file:%s: %s", __func__, file_name, strerror(errno)); |
---|
| 1289 | + bt_vendor_cbacks->fwcfg_cb(BT_VND_OP_RESULT_FAIL); |
---|
| 1290 | + hw_cfg_cb.state = HW_CFG_INIT; |
---|
| 1291 | + return; |
---|
| 1292 | + } |
---|
| 1293 | + hw_cfg_cb.file_offset = 0; |
---|
| 1294 | + hw_cfg_cb.state = HW_CFG_NV_SEND; |
---|
| 1295 | + if(skip_header)//skip header |
---|
| 1296 | + { |
---|
| 1297 | + char buffer[6]; |
---|
| 1298 | + fread(buffer, 1, 4, hw_cfg_cb.nv_fp); |
---|
| 1299 | + } |
---|
| 1300 | + } |
---|
| 1301 | + case HW_CFG_NV_SEND: |
---|
| 1302 | + { |
---|
| 1303 | + uint8_t len = 0, res = 0; |
---|
| 1304 | + uint8_t *ptr = (uint8_t *) (p_buf + 1);//skip header |
---|
| 1305 | + UINT16_TO_STREAM(ptr, HCI_CMD_SKW_BT_NVDS); |
---|
| 1306 | + |
---|
| 1307 | + if((chip_version == SKW_CHIPID_6316) || (chip_version == SKW_CHIPID_6160_LITE))//0x6316 |
---|
| 1308 | + { |
---|
| 1309 | + uint8_t tmp_buffer[10] = {0}; |
---|
| 1310 | + uint8_t *param_buf = ptr + 3; |
---|
| 1311 | + uint8_t nv_tag = 0; |
---|
| 1312 | + int nv_param_len = 0; |
---|
| 1313 | + int total_len = 0; |
---|
| 1314 | + char file_end = 0; |
---|
| 1315 | + int file_ptr; |
---|
| 1316 | + while(1) |
---|
| 1317 | + { |
---|
| 1318 | + file_ptr = ftell(hw_cfg_cb.nv_fp); |
---|
| 1319 | + if(file_ptr < 0) |
---|
| 1320 | + { |
---|
| 1321 | + ALOGE("%s invalid file_ptr:%d", __func__, file_ptr); |
---|
| 1322 | + bt_vendor_cbacks->fwcfg_cb(BT_VND_OP_RESULT_FAIL); |
---|
| 1323 | + hw_cfg_cb.state = HW_CFG_INIT; |
---|
| 1324 | + return ; |
---|
| 1325 | + } |
---|
| 1326 | + len = fread(tmp_buffer, 1, 3, hw_cfg_cb.nv_fp); |
---|
| 1327 | + if((len < 3) || feof(hw_cfg_cb.nv_fp)) |
---|
| 1328 | + { |
---|
| 1329 | + file_end = 1; |
---|
| 1330 | + break; |
---|
| 1331 | + } |
---|
| 1332 | + memcpy(param_buf + total_len, tmp_buffer, 3); |
---|
| 1333 | + nv_param_len = tmp_buffer[2]; |
---|
| 1334 | + nv_tag = tmp_buffer[0]; |
---|
| 1335 | + ALOGD("tag:%d, nv_param_len:%d, file_ptr:%d", tmp_buffer[0], nv_param_len, file_ptr); |
---|
| 1336 | + |
---|
| 1337 | + if((nv_param_len + total_len + 3) > 252)//252 + 3 |
---|
| 1338 | + { |
---|
| 1339 | + fseek(hw_cfg_cb.nv_fp, file_ptr, SEEK_SET); |
---|
| 1340 | + break; |
---|
| 1341 | + } |
---|
| 1342 | + total_len += 3; |
---|
| 1343 | + if((nv_param_len > 0) && ((total_len + nv_param_len) < HCI_CMD_MAX_LEN)) |
---|
| 1344 | + { |
---|
| 1345 | + len = fread(param_buf + total_len, 1, nv_param_len, hw_cfg_cb.nv_fp); |
---|
| 1346 | + if(len < nv_param_len) |
---|
| 1347 | + { |
---|
| 1348 | + ALOGE("%s, len:%d, nv_param_len:%d", __func__, len, nv_param_len); |
---|
| 1349 | + scomm_vendor_init_err(p_buf); |
---|
| 1350 | + break; |
---|
| 1351 | + } |
---|
| 1352 | + if(nv_tag == NV_TAG_BD_ADDR) |
---|
| 1353 | + { |
---|
| 1354 | + skw_addr_get(param_buf + total_len + 3); |
---|
| 1355 | + } |
---|
| 1356 | + else if(nv_tag == NV_TAG_DSP_LOG_SETTING) |
---|
| 1357 | + { |
---|
| 1358 | + *(param_buf + total_len) = btcp_log_en ? 0 : 1; |
---|
| 1359 | + } |
---|
| 1360 | + total_len += len; |
---|
| 1361 | + } |
---|
| 1362 | + } |
---|
| 1363 | + if(total_len > 0) |
---|
| 1364 | + { |
---|
| 1365 | + ptr[0] = (total_len + 2);//payload len |
---|
| 1366 | + ptr[1] = hw_cfg_cb.file_offset; |
---|
| 1367 | + ptr[2] = total_len;//para len |
---|
| 1368 | + p_buf->len = total_len + 2 + 3;//packet len |
---|
| 1369 | + res = bt_vendor_cbacks->xmit_cb(HCI_CMD_SKW_BT_NVDS, p_buf, scomm_vendor_config_callback); |
---|
| 1370 | + hw_cfg_cb.file_offset ++; |
---|
| 1371 | + if(res == FALSE)//send error |
---|
| 1372 | + { |
---|
| 1373 | + scomm_vendor_init_err(p_buf); |
---|
| 1374 | + break; |
---|
| 1375 | + } |
---|
| 1376 | + } |
---|
| 1377 | + if(file_end) |
---|
| 1378 | + { |
---|
| 1379 | + hw_cfg_cb.state = HW_CFG_WRITE_OS_TYPE; |
---|
| 1380 | + fclose(hw_cfg_cb.nv_fp); |
---|
| 1381 | + hw_cfg_cb.nv_fp = NULL; |
---|
| 1382 | + } |
---|
| 1383 | + } |
---|
| 1384 | + else |
---|
| 1385 | + { |
---|
| 1386 | + len = fread(ptr + 3, 1, NV_FILE_RD_BLOCK_SIZE, hw_cfg_cb.nv_fp); |
---|
| 1387 | + ptr[0] = (len + 2);//payload len |
---|
| 1388 | + ptr[1] = hw_cfg_cb.file_offset; |
---|
| 1389 | + ptr[2] = len;//para len |
---|
| 1390 | + p_buf->len = len + 2 + 3;//packet len |
---|
| 1391 | + if(0 == hw_cfg_cb.file_offset) |
---|
| 1392 | + { |
---|
| 1393 | + //*(ptr + 3 + 3) = 'A'; |
---|
| 1394 | + //byte7 |
---|
| 1395 | + skw_addr_get(ptr + 3 + 7); |
---|
| 1396 | + } |
---|
| 1397 | + else if(1 == hw_cfg_cb.file_offset) |
---|
| 1398 | + { |
---|
| 1399 | + *(ptr + 3 + 62) |= 0x80; |
---|
| 1400 | + *(ptr + 3 + 53) = btcp_log_en ? 0 : 1; |
---|
| 1401 | + } |
---|
| 1402 | + |
---|
| 1403 | + res = bt_vendor_cbacks->xmit_cb(HCI_CMD_SKW_BT_NVDS, p_buf, scomm_vendor_config_callback); |
---|
| 1404 | + |
---|
| 1405 | + ALOGD("len:%d, file_offset:%d, plen:%d,%d res:%d", len, hw_cfg_cb.file_offset, p_buf->len, ptr[0], res); |
---|
| 1406 | + |
---|
| 1407 | + hw_cfg_cb.file_offset ++; |
---|
| 1408 | + |
---|
| 1409 | + if((len < NV_FILE_RD_BLOCK_SIZE) || (len == 0) || feof(hw_cfg_cb.nv_fp))//end of file |
---|
| 1410 | + { |
---|
| 1411 | + hw_cfg_cb.state = HW_CFG_WRITE_BD_ADDR; |
---|
| 1412 | + fclose(hw_cfg_cb.nv_fp); |
---|
| 1413 | + hw_cfg_cb.nv_fp = NULL; |
---|
| 1414 | + } |
---|
| 1415 | + if(res == FALSE)//send error |
---|
| 1416 | + { |
---|
| 1417 | + scomm_vendor_init_err(p_buf); |
---|
| 1418 | + } |
---|
| 1419 | + |
---|
| 1420 | + } |
---|
| 1421 | + break; |
---|
| 1422 | + } |
---|
| 1423 | + case HW_CFG_WRITE_OS_TYPE: |
---|
| 1424 | + { |
---|
| 1425 | + if(chip_version != SKW_CHIPID_6160) |
---|
| 1426 | + { |
---|
| 1427 | + uint8_t *ptr = (uint8_t *) (p_buf + 1); |
---|
| 1428 | + UINT16_TO_STREAM(ptr, HCI_CMD_WRITE_OS_TYPE); |
---|
| 1429 | + UINT8_TO_STREAM(ptr, 1); |
---|
| 1430 | + UINT8_TO_STREAM(ptr, 1); |
---|
| 1431 | + |
---|
| 1432 | + p_buf->len = 3 + 1;//packet len |
---|
| 1433 | + bt_vendor_cbacks->xmit_cb(HCI_CMD_WRITE_OS_TYPE, p_buf, scomm_vendor_config_callback); |
---|
| 1434 | + hw_cfg_cb.state = HW_CFG_WRITE_BD_ADDR; |
---|
| 1435 | + break; |
---|
| 1436 | + } |
---|
| 1437 | + } |
---|
| 1438 | + case HW_CFG_WRITE_BD_ADDR: |
---|
| 1439 | + { |
---|
| 1440 | + uint8_t *ptr = (uint8_t *) (p_buf + 1); |
---|
| 1441 | + UINT16_TO_STREAM(ptr, HCI_CMD_WRITE_BD_ADDR); |
---|
| 1442 | + UINT8_TO_STREAM(ptr, 6); |
---|
| 1443 | + |
---|
| 1444 | + p_buf->len = 3 + 6;//packet len |
---|
| 1445 | + if(skw_addr_from_ap(ptr)) |
---|
| 1446 | + { |
---|
| 1447 | + bt_vendor_cbacks->xmit_cb(HCI_CMD_WRITE_BD_ADDR, p_buf, scomm_vendor_config_callback); |
---|
| 1448 | +#if BLE_ADV_WAKEUP_ENABLE |
---|
| 1449 | + hw_cfg_cb.state = HW_CFG_WRITE_WAKEUP_ADV_DATA; |
---|
| 1450 | +#else |
---|
| 1451 | + hw_cfg_cb.state = HW_CFG_NV_SEND_CMPL; |
---|
| 1452 | +#endif |
---|
| 1453 | + break; |
---|
| 1454 | + } |
---|
| 1455 | + } |
---|
| 1456 | +#if BLE_ADV_WAKEUP_ENABLE |
---|
| 1457 | + case HW_CFG_WRITE_WAKEUP_ADV_DATA: |
---|
| 1458 | + { |
---|
| 1459 | + uint8_t adv_data_len = wakeup_ADV_Info.data_len; |
---|
| 1460 | + if(adv_data_len > 0) |
---|
| 1461 | + { |
---|
| 1462 | + uint8_t *ptr = (uint8_t *) (p_buf + 1); |
---|
| 1463 | + uint8_t i, adv_len; |
---|
| 1464 | + uint8_t pld_len = adv_data_len + 4;//add the length of gpio & level & grp nums & total len |
---|
| 1465 | + Wakeup_ADV_Grp_St *adv_grp; |
---|
| 1466 | + UINT16_TO_STREAM(ptr, HCI_CMD_WRITE_WAKEUP_ADV_DATA); |
---|
| 1467 | + UINT8_TO_STREAM(ptr, pld_len); |
---|
| 1468 | + UINT8_TO_STREAM(ptr, wakeup_ADV_Info.gpio_no); |
---|
| 1469 | + UINT8_TO_STREAM(ptr, wakeup_ADV_Info.level); |
---|
| 1470 | + UINT8_TO_STREAM(ptr, wakeup_ADV_Info.grp_nums); |
---|
| 1471 | + UINT8_TO_STREAM(ptr, adv_data_len); |
---|
| 1472 | + for(i = 0; i < wakeup_ADV_Info.grp_nums; i++) |
---|
| 1473 | + { |
---|
| 1474 | + adv_grp = &wakeup_ADV_Info.adv_group[i]; |
---|
| 1475 | + UINT8_TO_STREAM(ptr, adv_grp->grp_len); |
---|
| 1476 | + UINT8_TO_STREAM(ptr, adv_grp->addr_offset); |
---|
| 1477 | + adv_len = (adv_grp->grp_len - 2) >> 1; |
---|
| 1478 | + |
---|
| 1479 | + SKWBT_LOG("grp len:%d, adv_len:%d", adv_grp->grp_len, adv_len); |
---|
| 1480 | + |
---|
| 1481 | + memcpy(ptr, adv_grp->data, adv_len); |
---|
| 1482 | + ptr += adv_len; |
---|
| 1483 | + memcpy(ptr, adv_grp->mask, adv_len); |
---|
| 1484 | + ptr += adv_len; |
---|
| 1485 | + } |
---|
| 1486 | + |
---|
| 1487 | + p_buf->len = 3 + pld_len;//packet len |
---|
| 1488 | + bt_vendor_cbacks->xmit_cb(HCI_CMD_WRITE_WAKEUP_ADV_DATA, p_buf, scomm_vendor_config_callback); |
---|
| 1489 | + hw_cfg_cb.state = HW_CFG_NV_SEND_CMPL; |
---|
| 1490 | + break; |
---|
| 1491 | + } |
---|
| 1492 | + } |
---|
| 1493 | +#endif |
---|
| 1494 | + case HW_CFG_NV_SEND_CMPL: |
---|
| 1495 | + { |
---|
| 1496 | + bt_vendor_cbacks->fwcfg_cb(BT_VND_OP_RESULT_SUCCESS); |
---|
| 1497 | + bt_vendor_cbacks->dealloc(p_buf);//free buffer |
---|
| 1498 | + hw_cfg_cb.state = HW_CFG_INIT; |
---|
| 1499 | + break; |
---|
| 1500 | + } |
---|
| 1501 | + } |
---|
| 1502 | + } |
---|
| 1503 | + |
---|
| 1504 | + |
---|
| 1505 | + /* Free the RX event buffer */ |
---|
| 1506 | + if ((bt_vendor_cbacks) && (p_evt_buf != NULL)) |
---|
| 1507 | + { |
---|
| 1508 | + bt_vendor_cbacks->dealloc(p_evt_buf); |
---|
| 1509 | + } |
---|
| 1510 | + |
---|
| 1511 | + |
---|
| 1512 | +} |
---|
| 1513 | + |
---|
| 1514 | +/******************************************************************************* |
---|
| 1515 | +** |
---|
| 1516 | +** Function scomm_vendor_config_start |
---|
| 1517 | +** |
---|
| 1518 | +** Description Kick off controller initialization process |
---|
| 1519 | +** |
---|
| 1520 | +** Returns None |
---|
| 1521 | +** |
---|
| 1522 | +*******************************************************************************/ |
---|
| 1523 | +void scomm_vendor_config_start() |
---|
| 1524 | +{ |
---|
| 1525 | + memset(&hw_cfg_cb, 0, sizeof(bt_hw_cfg_cb_st)); |
---|
| 1526 | + |
---|
| 1527 | + HC_BT_HDR *p_buf = NULL; |
---|
| 1528 | + uint8_t *p; |
---|
| 1529 | + |
---|
| 1530 | + hw_cfg_cb.state = HW_CFG_INIT; |
---|
| 1531 | + |
---|
| 1532 | + if (bt_vendor_cbacks) |
---|
| 1533 | + { |
---|
| 1534 | + p_buf = (HC_BT_HDR *) bt_vendor_cbacks->alloc(BT_HC_HDR_SIZE + HCI_CMD_PREAMBLE_SIZE); |
---|
| 1535 | + if (p_buf) |
---|
| 1536 | + { |
---|
| 1537 | + p_buf->event = MSG_STACK_TO_HC_HCI_CMD; |
---|
| 1538 | + p_buf->offset = 0; |
---|
| 1539 | + p_buf->layer_specific = 0; |
---|
| 1540 | + p_buf->len = HCI_CMD_PREAMBLE_SIZE; |
---|
| 1541 | + |
---|
| 1542 | + p = (uint8_t *) (p_buf + 1); |
---|
| 1543 | + UINT16_TO_STREAM(p, HCI_RESET); |
---|
| 1544 | + *p = 0; /* parameter length */ |
---|
| 1545 | + |
---|
| 1546 | + hw_cfg_cb.state = HW_CFG_START; |
---|
| 1547 | + |
---|
| 1548 | + bt_vendor_cbacks->xmit_cb(HCI_RESET, p_buf, scomm_vendor_config_callback); |
---|
| 1549 | + } |
---|
| 1550 | + else |
---|
| 1551 | + { |
---|
| 1552 | + ALOGE("%s buffer alloc fail", __func__); |
---|
| 1553 | + } |
---|
| 1554 | + } |
---|
| 1555 | + else |
---|
| 1556 | + { |
---|
| 1557 | + ALOGE("%s call back func is null", __func__); |
---|
| 1558 | + } |
---|
| 1559 | +} |
---|
| 1560 | + |
---|
| 1561 | +/******************************************************************************* |
---|
| 1562 | +** |
---|
| 1563 | +** Function scomm_vendor_write_wakeup_adv_data_callback |
---|
| 1564 | +** |
---|
| 1565 | +** Description send wakeup adv data callback |
---|
| 1566 | +** |
---|
| 1567 | +** Returns None |
---|
| 1568 | +** |
---|
| 1569 | +*******************************************************************************/ |
---|
| 1570 | +void scomm_vendor_write_wakeup_adv_data_callback(void *p_mem) |
---|
| 1571 | +{ |
---|
| 1572 | + uint8_t status = 0; |
---|
| 1573 | + uint16_t opcode = 0; |
---|
| 1574 | + HC_BT_HDR *p_evt_buf = NULL; |
---|
| 1575 | + if(p_mem != NULL) |
---|
| 1576 | + { |
---|
| 1577 | + uint8_t *p; |
---|
| 1578 | + p_evt_buf = (HC_BT_HDR *) p_mem; |
---|
| 1579 | + status = *((uint8_t *)(p_evt_buf + 1) + HCI_EVT_CMD_CMPL_STATUS_OFFSET); |
---|
| 1580 | + p = (uint8_t *)(p_evt_buf + 1) + HCI_EVT_CMD_CMPL_OPCODE_OFFSET; |
---|
| 1581 | + STREAM_TO_UINT16(opcode, p); |
---|
| 1582 | + |
---|
| 1583 | + ALOGD("%s status:%d ,opcode:%04X", __func__, status, opcode); |
---|
| 1584 | + |
---|
| 1585 | + if(bt_vendor_cbacks) |
---|
| 1586 | + { |
---|
| 1587 | + bt_vendor_cbacks->dealloc(p_evt_buf); |
---|
| 1588 | + } |
---|
| 1589 | + } |
---|
| 1590 | + else |
---|
| 1591 | + { |
---|
| 1592 | + ALOGE("%s pram is null", __func__); |
---|
| 1593 | + } |
---|
| 1594 | +} |
---|
| 1595 | + |
---|
| 1596 | +/******************************************************************************* |
---|
| 1597 | +** |
---|
| 1598 | +** Function scomm_vendor_write_wakeup_adv_enable |
---|
| 1599 | +** |
---|
| 1600 | +** Description send wakeup adv enable |
---|
| 1601 | +** |
---|
| 1602 | +** Returns None |
---|
| 1603 | +** |
---|
| 1604 | +*******************************************************************************/ |
---|
| 1605 | +void scomm_vendor_write_wakeup_adv_enable() |
---|
| 1606 | +{ |
---|
| 1607 | + HC_BT_HDR *p_buf = (HC_BT_HDR *)bt_vendor_cbacks->alloc(HCI_CMD_MAX_LEN); |
---|
| 1608 | + uint8_t *p; |
---|
| 1609 | + |
---|
| 1610 | + if(p_buf) |
---|
| 1611 | + { |
---|
| 1612 | + uint8_t param_len = 1; |
---|
| 1613 | + p_buf->event = MSG_STACK_TO_HC_HCI_CMD; |
---|
| 1614 | + p_buf->offset = 0; |
---|
| 1615 | + p_buf->len = 0; |
---|
| 1616 | + p_buf->layer_specific = 0; |
---|
| 1617 | + |
---|
| 1618 | + p = (uint8_t *) (p_buf + 1); |
---|
| 1619 | + UINT16_TO_STREAM(p, HCI_CMD_WRITE_WAKEUP_ADV_ENABLE); |
---|
| 1620 | + UINT8_TO_STREAM(p, param_len); |
---|
| 1621 | + UINT8_TO_STREAM(p, 0x01); |
---|
| 1622 | + |
---|
| 1623 | + p_buf->len = 3 + param_len;//packet len |
---|
| 1624 | + |
---|
| 1625 | + bt_vendor_cbacks->xmit_cb(HCI_CMD_WRITE_WAKEUP_ADV_ENABLE, p_buf, scomm_vendor_write_wakeup_adv_data_callback); |
---|
| 1626 | + } |
---|
| 1627 | + else |
---|
| 1628 | + { |
---|
| 1629 | + ALOGE("%s buffer alloc fail", __func__); |
---|
| 1630 | + } |
---|
| 1631 | + |
---|
| 1632 | + |
---|
| 1633 | +} |
---|
| 1634 | + |
---|
| 1635 | + |
---|
| 1636 | +/* |
---|
| 1637 | + data_str = "xxxx;...." |
---|
| 1638 | +*/ |
---|
| 1639 | +char *scomm_vendor_config_get_uint8(char *data_str, uint8_t *value) |
---|
| 1640 | +{ |
---|
| 1641 | + char *split0 = strchr(data_str, ';'); |
---|
| 1642 | + uint8_t len = 0; |
---|
| 1643 | + char buffer[8] = {0}; |
---|
| 1644 | + if((split0 == NULL) || (split0 == data_str)) |
---|
| 1645 | + { |
---|
| 1646 | + return NULL; |
---|
| 1647 | + } |
---|
| 1648 | + len = split0 - data_str; |
---|
| 1649 | + if(len > 4)//invalid |
---|
| 1650 | + { |
---|
| 1651 | + SKWBT_LOG("%s, invalid str , %s", __func__, data_str); |
---|
| 1652 | + return NULL; |
---|
| 1653 | + } |
---|
| 1654 | + memcpy(buffer, data_str, len); |
---|
| 1655 | + *value = atoi(buffer); |
---|
| 1656 | + return split0 + 1;//skip ; |
---|
| 1657 | +} |
---|
| 1658 | + |
---|
| 1659 | +void scomm_vendor_parse_wakeup_adv_conf(char *data_str) |
---|
| 1660 | +{ |
---|
| 1661 | + //WakeupADVData=GPIO_No(decimal);Level(decimal);addr offset(decimal);ADVData(Hex);Mask(Hex) |
---|
| 1662 | + int str_len = strlen(data_str); |
---|
| 1663 | + char *base_ptr = data_str; |
---|
| 1664 | + char *split0, *split1; |
---|
| 1665 | + uint8_t adv_grp_nums = 0, adv_len = 0, mask_len; |
---|
| 1666 | + uint8_t gpio_no = 0, level = 0, addr_offset; |
---|
| 1667 | + uint8_t i = 0, j = 0, k; |
---|
| 1668 | + Wakeup_ADV_Grp_St *adv_grp; |
---|
| 1669 | + int total_len = 0; |
---|
| 1670 | + |
---|
| 1671 | + wakeup_ADV_Info.data_len = 0; |
---|
| 1672 | + if(str_len > 512) |
---|
| 1673 | + { |
---|
| 1674 | + SKWBT_LOG("%s, invalid config str, %s", __func__, data_str); |
---|
| 1675 | + return ; |
---|
| 1676 | + } |
---|
| 1677 | + if((base_ptr = scomm_vendor_config_get_uint8(base_ptr, &gpio_no)) == NULL) |
---|
| 1678 | + { |
---|
| 1679 | + return ; |
---|
| 1680 | + } |
---|
| 1681 | + if((base_ptr = scomm_vendor_config_get_uint8(base_ptr, &level)) == NULL) |
---|
| 1682 | + { |
---|
| 1683 | + return ; |
---|
| 1684 | + } |
---|
| 1685 | + for(k = 0; k < BLE_ADV_WAKEUP_GRP_NUMS; k++) |
---|
| 1686 | + { |
---|
| 1687 | + //addr offset(decimal);ADVData(Hex);Mask(Hex) |
---|
| 1688 | + if((base_ptr = scomm_vendor_config_get_uint8(base_ptr, &addr_offset)) == NULL) |
---|
| 1689 | + { |
---|
| 1690 | + break; |
---|
| 1691 | + } |
---|
| 1692 | + if((addr_offset == 1) || (addr_offset > 26)) |
---|
| 1693 | + { |
---|
| 1694 | + SKWBT_LOG("%s, invalid addr_offset , %s", __func__, data_str); |
---|
| 1695 | + return ; |
---|
| 1696 | + } |
---|
| 1697 | + adv_grp = &wakeup_ADV_Info.adv_group[k]; |
---|
| 1698 | + split0 = strchr(base_ptr, ';'); |
---|
| 1699 | + if(split0 == NULL) |
---|
| 1700 | + { |
---|
| 1701 | + SKWBT_LOG("%s, invalid config , %s", __func__, data_str); |
---|
| 1702 | + return ; |
---|
| 1703 | + } |
---|
| 1704 | + split1 = strchr(split0 + 1, ';'); |
---|
| 1705 | + |
---|
| 1706 | + adv_len = split0 - base_ptr; |
---|
| 1707 | + adv_grp->addr_offset = addr_offset; |
---|
| 1708 | + adv_grp->grp_len = adv_len + 2;//add addr_offset & self length |
---|
| 1709 | + |
---|
| 1710 | + split0 ++;//skip ; |
---|
| 1711 | + if(split1 == NULL) |
---|
| 1712 | + { |
---|
| 1713 | + mask_len = data_str + str_len - split0; |
---|
| 1714 | + } |
---|
| 1715 | + else |
---|
| 1716 | + { |
---|
| 1717 | + mask_len = split1 - split0; |
---|
| 1718 | + } |
---|
| 1719 | + if(mask_len != adv_len) |
---|
| 1720 | + { |
---|
| 1721 | + SKWBT_LOG("%s, mask_len != adv_len , %s", __func__, data_str); |
---|
| 1722 | + return ; |
---|
| 1723 | + } |
---|
| 1724 | + SKWBT_LOG("grp len:%d, adv_len:%d", adv_grp->grp_len, adv_len); |
---|
| 1725 | + for(i = 0, j = 0; i < adv_len; j ++, i += 2) |
---|
| 1726 | + { |
---|
| 1727 | + adv_grp->data[j] = (char2hex(base_ptr[i]) << 4) | char2hex(base_ptr[i + 1]); |
---|
| 1728 | + adv_grp->mask[j] = (char2hex(split0[i]) << 4) | char2hex(split0[i + 1]); |
---|
| 1729 | + } |
---|
| 1730 | + total_len += adv_grp->grp_len; |
---|
| 1731 | + adv_grp_nums ++; |
---|
| 1732 | + if(split1 == NULL) |
---|
| 1733 | + { |
---|
| 1734 | + break; |
---|
| 1735 | + } |
---|
| 1736 | + base_ptr = split1 + 1; |
---|
| 1737 | + } |
---|
| 1738 | + wakeup_ADV_Info.data_len = total_len;//not contain gpio & level |
---|
| 1739 | + wakeup_ADV_Info.grp_nums = adv_grp_nums; |
---|
| 1740 | + wakeup_ADV_Info.gpio_no = gpio_no; |
---|
| 1741 | + wakeup_ADV_Info.level = level; |
---|
| 1742 | + |
---|
| 1743 | + SKWBT_LOG("ADV str len:%d, gpio:%d, level:%d, adv_grp_nums:%d, total_len:%d, Data:%s", str_len, gpio_no, level, adv_grp_nums, total_len, data_str); |
---|
| 1744 | +} |
---|
| 1745 | + |
---|
| 1746 | + |
---|
| 1747 | + |
---|
.. | .. |
---|
| 1 | +/****************************************************************************** |
---|
| 2 | + * |
---|
| 3 | + * Copyright (C) 2020-2021 SeekWave Technology |
---|
| 4 | + * |
---|
| 5 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
---|
| 6 | + * |
---|
| 7 | + ******************************************************************************/ |
---|
| 8 | + |
---|
| 9 | +#define LOG_TAG "skw_btsnoop" |
---|
| 10 | + |
---|
| 11 | +#include "skw_btsnoop.h" |
---|
| 12 | +#include <unistd.h> |
---|
| 13 | +#include <sys/stat.h> |
---|
| 14 | +#include "skw_log.h" |
---|
| 15 | +#include "skw_common.h" |
---|
| 16 | + |
---|
| 17 | + |
---|
| 18 | + |
---|
| 19 | +char skw_btsnoop_path[1024] = {'\0'}; |
---|
| 20 | +static pthread_mutex_t btsnoop_log_lock; |
---|
| 21 | + |
---|
| 22 | +char btsnoop_save_log = FALSE; |
---|
| 23 | +static int hci_btsnoop_fd = -1; |
---|
| 24 | +static const uint64_t BTSNOOP_EPOCH_DELTA = 0x00dcddb30f2f8000ULL; |
---|
| 25 | +unsigned int btsnoop_cnts = 0; |
---|
| 26 | +unsigned int btsnoop_rev_length = 0; |
---|
| 27 | +extern char skwlog_slice; |
---|
| 28 | +extern char btsnoop_log_en; |
---|
| 29 | + |
---|
| 30 | +static uint64_t skw_btsnoop_timestamp(void) |
---|
| 31 | +{ |
---|
| 32 | + struct timeval tv; |
---|
| 33 | + gettimeofday(&tv, NULL); |
---|
| 34 | + |
---|
| 35 | + uint64_t timestamp = (tv.tv_sec * 1000LL * 1000LL) + tv.tv_usec + BTSNOOP_EPOCH_DELTA; |
---|
| 36 | + return timestamp; |
---|
| 37 | +} |
---|
| 38 | + |
---|
| 39 | +void skw_btsnoop_open() |
---|
| 40 | +{ |
---|
| 41 | + char last_log_path[PATH_MAX]; |
---|
| 42 | + uint64_t timestamp; |
---|
| 43 | + uint32_t usec; |
---|
| 44 | + char new_file = TRUE; |
---|
| 45 | + btsnoop_rev_length = 0; |
---|
| 46 | + |
---|
| 47 | + |
---|
| 48 | + if((hci_btsnoop_fd != -1) || (!btsnoop_log_en) || (strlen(skw_btsnoop_path) <= 0)) |
---|
| 49 | + { |
---|
| 50 | + ALOGE("%s btsnoop log file is already open. log_en:%d", __func__, btsnoop_log_en); |
---|
| 51 | + return; |
---|
| 52 | + } |
---|
| 53 | + |
---|
| 54 | + if(btsnoop_save_log) |
---|
| 55 | + { |
---|
| 56 | + struct stat buf; |
---|
| 57 | + int fd = -1; |
---|
| 58 | + if(stat(skw_btsnoop_path, &buf) == 0) |
---|
| 59 | + { |
---|
| 60 | + fd = open(skw_btsnoop_path, O_RDONLY); |
---|
| 61 | + } |
---|
| 62 | + |
---|
| 63 | + if(fd >= 0) |
---|
| 64 | + { |
---|
| 65 | + fstat(fd, &buf); |
---|
| 66 | + int file_zie = (int)buf.st_size; |
---|
| 67 | + close(fd); |
---|
| 68 | + ALOGD("%s btsnoop log file size:%d", __func__, file_zie); |
---|
| 69 | + if(skwlog_slice) |
---|
| 70 | + { |
---|
| 71 | + if(file_zie > SKW_LOG_DEFAULT_SIZE) |
---|
| 72 | + { |
---|
| 73 | + snprintf(last_log_path, PATH_MAX, "%s.last", skw_btsnoop_path); |
---|
| 74 | + remove(last_log_path); |
---|
| 75 | + if (!rename(skw_btsnoop_path, last_log_path) && (errno != ENOENT)) |
---|
| 76 | + { |
---|
| 77 | + ALOGE("%s unable to rename '%s' to btsnoop_hci: %s", __func__, skw_btsnoop_path, strerror(errno)); |
---|
| 78 | + return ; |
---|
| 79 | + } |
---|
| 80 | + skwlog_reopen(TRUE); |
---|
| 81 | + } |
---|
| 82 | + else |
---|
| 83 | + { |
---|
| 84 | + btsnoop_rev_length = file_zie; |
---|
| 85 | + if(file_zie < 16) |
---|
| 86 | + { |
---|
| 87 | + new_file = TRUE; |
---|
| 88 | + } |
---|
| 89 | + else |
---|
| 90 | + { |
---|
| 91 | + new_file = FALSE; |
---|
| 92 | + } |
---|
| 93 | + skwlog_reopen(new_file); |
---|
| 94 | + } |
---|
| 95 | + } |
---|
| 96 | + else |
---|
| 97 | + { |
---|
| 98 | + if(file_zie > 16) |
---|
| 99 | + { |
---|
| 100 | + time_t current_time = time(NULL); |
---|
| 101 | + struct tm *time_created = localtime(¤t_time); |
---|
| 102 | + char config_time_created[sizeof("YYYY-MM-DD-HHMMSS") + 1]; |
---|
| 103 | + strftime(config_time_created, sizeof("YYYY-MM-DD-HHMMSS"), "%Y-%m-%d-%H%M%S", time_created); |
---|
| 104 | + timestamp = skw_btsnoop_timestamp() - BTSNOOP_EPOCH_DELTA; |
---|
| 105 | + usec = (uint32_t)(timestamp % 1000000LL); |
---|
| 106 | + snprintf(last_log_path, PATH_MAX, "%s.%s_%d-%02d", skw_btsnoop_path, config_time_created, (int)usec, (int)btsnoop_cnts); |
---|
| 107 | + btsnoop_cnts ++; |
---|
| 108 | + if (!rename(skw_btsnoop_path, last_log_path) && (errno != ENOENT)) |
---|
| 109 | + { |
---|
| 110 | + ALOGE("%s unable to rename '%s' to '%s': %s", __func__, skw_btsnoop_path, last_log_path, strerror(errno)); |
---|
| 111 | + } |
---|
| 112 | + |
---|
| 113 | + } |
---|
| 114 | + } |
---|
| 115 | + |
---|
| 116 | + } |
---|
| 117 | + else if(skwlog_slice) |
---|
| 118 | + { |
---|
| 119 | + ALOGD("%s btsnoop log file not exist", __func__); |
---|
| 120 | + skwlog_reopen(TRUE); |
---|
| 121 | + } |
---|
| 122 | + |
---|
| 123 | + } |
---|
| 124 | + else |
---|
| 125 | + { |
---|
| 126 | + snprintf(last_log_path, PATH_MAX, "%s.last", skw_btsnoop_path); |
---|
| 127 | + if (!rename(skw_btsnoop_path, last_log_path) && errno != ENOENT) |
---|
| 128 | + { |
---|
| 129 | + ALOGE("%s unable to rename '%s' to '%s': %s", __func__, skw_btsnoop_path, last_log_path, strerror(errno)); |
---|
| 130 | + } |
---|
| 131 | + } |
---|
| 132 | + |
---|
| 133 | + hci_btsnoop_fd = open(skw_btsnoop_path, O_WRONLY | O_CREAT | O_APPEND, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH); |
---|
| 134 | + |
---|
| 135 | + if (hci_btsnoop_fd < 0) |
---|
| 136 | + { |
---|
| 137 | + ALOGE("%s unable to open '%s': %s", __func__, skw_btsnoop_path, strerror(errno)); |
---|
| 138 | + return; |
---|
| 139 | + } |
---|
| 140 | + |
---|
| 141 | + ALOGD("%s open '%s', fd:%d, is new:%d", __func__, skw_btsnoop_path, hci_btsnoop_fd, new_file); |
---|
| 142 | + //lseek(hci_btsnoop_fd, 0, SEEK_END); |
---|
| 143 | + if(new_file) |
---|
| 144 | + { |
---|
| 145 | + write(hci_btsnoop_fd, "btsnoop\0\0\0\0\1\0\0\x3\xea", 16); |
---|
| 146 | + |
---|
| 147 | + ALOGD("%s write header", __func__); |
---|
| 148 | + } |
---|
| 149 | +} |
---|
| 150 | + |
---|
| 151 | +void skw_btsnoop_init() |
---|
| 152 | +{ |
---|
| 153 | + pthread_mutex_init(&btsnoop_log_lock, NULL); |
---|
| 154 | + btsnoop_cnts = 0; |
---|
| 155 | + //ALOGD("%s btsnoop log file path:%s", __func__,skw_btsnoop_path); |
---|
| 156 | + skw_btsnoop_open(); |
---|
| 157 | +} |
---|
| 158 | + |
---|
| 159 | +void skw_btsnoop_close(void) |
---|
| 160 | +{ |
---|
| 161 | + pthread_mutex_destroy(&btsnoop_log_lock); |
---|
| 162 | + if (hci_btsnoop_fd != -1) |
---|
| 163 | + { |
---|
| 164 | + close(hci_btsnoop_fd); |
---|
| 165 | + } |
---|
| 166 | + hci_btsnoop_fd = -1; |
---|
| 167 | +} |
---|
| 168 | + |
---|
| 169 | +static void skw_btsnoop_write(const void *data, size_t length) |
---|
| 170 | +{ |
---|
| 171 | + if (hci_btsnoop_fd != -1) |
---|
| 172 | + { |
---|
| 173 | + write(hci_btsnoop_fd, data, length); |
---|
| 174 | + } |
---|
| 175 | +} |
---|
| 176 | + |
---|
| 177 | +void skw_btsnoop_capture(const uint8_t *packet, char is_received) |
---|
| 178 | +{ |
---|
| 179 | + int length_he = 0; |
---|
| 180 | + int length = 0; |
---|
| 181 | + int flags = 0; |
---|
| 182 | + int drops = 0; |
---|
| 183 | + if((!btsnoop_log_en) || (hci_btsnoop_fd == -1)) |
---|
| 184 | + { |
---|
| 185 | + return ; |
---|
| 186 | + } |
---|
| 187 | + |
---|
| 188 | + pthread_mutex_lock(&btsnoop_log_lock); |
---|
| 189 | + |
---|
| 190 | + uint8_t type = packet[0]; |
---|
| 191 | + switch (type) |
---|
| 192 | + { |
---|
| 193 | + case HCI_COMMAND_PKT: |
---|
| 194 | + length_he = packet[3] + 4; |
---|
| 195 | + flags = 2; |
---|
| 196 | + break; |
---|
| 197 | + case HCI_ACLDATA_PKT: |
---|
| 198 | + case HCI_ISO_PKT: |
---|
| 199 | + length_he = (packet[4] << 8) + packet[3] + 5; |
---|
| 200 | + flags = is_received; |
---|
| 201 | + break; |
---|
| 202 | + case HCI_SCODATA_PKT: |
---|
| 203 | + length_he = packet[3] + 4; |
---|
| 204 | + flags = is_received; |
---|
| 205 | + break; |
---|
| 206 | + case HCI_EVENT_PKT: |
---|
| 207 | + case HCI_EVENT_SKWLOG: |
---|
| 208 | + length_he = packet[2] + 3; |
---|
| 209 | + flags = 3; |
---|
| 210 | + break; |
---|
| 211 | + default: |
---|
| 212 | + pthread_mutex_unlock(&btsnoop_log_lock); |
---|
| 213 | + return; |
---|
| 214 | + //break; |
---|
| 215 | + } |
---|
| 216 | + |
---|
| 217 | + btsnoop_rev_length += length_he; |
---|
| 218 | + |
---|
| 219 | + //SKWBT_LOG("btsnoop_capture type:%d, len:%d", type, length_he); |
---|
| 220 | + |
---|
| 221 | + uint64_t timestamp = skw_btsnoop_timestamp(); |
---|
| 222 | + uint32_t time_hi = timestamp >> 32ul; |
---|
| 223 | + uint32_t time_lo = timestamp & 0xFFFFFFFF; |
---|
| 224 | + |
---|
| 225 | + length = htonl(length_he); |
---|
| 226 | + flags = htonl(flags); |
---|
| 227 | + drops = htonl(drops); |
---|
| 228 | + time_hi = htonl(time_hi); |
---|
| 229 | + time_lo = htonl(time_lo); |
---|
| 230 | + |
---|
| 231 | + skw_btsnoop_write(&length, 4); |
---|
| 232 | + skw_btsnoop_write(&length, 4); |
---|
| 233 | + skw_btsnoop_write(&flags, 4); |
---|
| 234 | + skw_btsnoop_write(&drops, 4); |
---|
| 235 | + skw_btsnoop_write(&time_hi, 4); |
---|
| 236 | + skw_btsnoop_write(&time_lo, 4); |
---|
| 237 | + |
---|
| 238 | + skw_btsnoop_write(packet, length_he); |
---|
| 239 | + |
---|
| 240 | + if(btsnoop_rev_length >= SKW_LOG_DEFAULT_SIZE) |
---|
| 241 | + { |
---|
| 242 | + close(hci_btsnoop_fd); |
---|
| 243 | + hci_btsnoop_fd = -1; |
---|
| 244 | + skw_btsnoop_open(); |
---|
| 245 | + //skwlog_reopen(TRUE); |
---|
| 246 | + } |
---|
| 247 | + |
---|
| 248 | + pthread_mutex_unlock(&btsnoop_log_lock); |
---|
| 249 | +} |
---|
| 250 | + |
---|
| 251 | + |
---|
| 252 | + |
---|
.. | .. |
---|
| 1 | +/****************************************************************************** |
---|
| 2 | + * |
---|
| 3 | + * Copyright (C) 2020-2021 SeekWave Technology |
---|
| 4 | + * |
---|
| 5 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
---|
| 6 | + * |
---|
| 7 | + ******************************************************************************/ |
---|
| 8 | + |
---|
| 9 | +#include <pthread.h> |
---|
| 10 | +#include <errno.h> |
---|
| 11 | +#include <utils/Log.h> |
---|
| 12 | +#include <sys/inotify.h> |
---|
| 13 | +#include <sys/epoll.h> |
---|
| 14 | +#include <sys/socket.h> |
---|
| 15 | + |
---|
| 16 | +#include <string.h> |
---|
| 17 | +#include <unistd.h> |
---|
| 18 | +#include "skw_common.h" |
---|
| 19 | +#include "skw_ext.h" |
---|
| 20 | + |
---|
| 21 | +#define SKW_EXT_BUF_SIZE 2048 |
---|
| 22 | + |
---|
| 23 | +typedef struct |
---|
| 24 | +{ |
---|
| 25 | + pthread_t thread_id; |
---|
| 26 | + char thread_running; |
---|
| 27 | + int epoll_fd; |
---|
| 28 | + int signal_fd[2]; |
---|
| 29 | +} skw_inotify_thread_info_st; |
---|
| 30 | + |
---|
| 31 | +skw_inotify_thread_info_st skw_inotify_thread_info; |
---|
| 32 | + |
---|
| 33 | + |
---|
| 34 | +extern void scomm_vendor_write_wakeup_adv_enable(); |
---|
| 35 | + |
---|
| 36 | + |
---|
| 37 | +/* |
---|
| 38 | +struct inotify_event { |
---|
| 39 | + int wd; // Watch descriptor |
---|
| 40 | + uint32_t mask; // Mask of events |
---|
| 41 | + uint32_t cookie; // Unique cookie associating related events (for rename(2)) |
---|
| 42 | + uint32_t len; // Size of name field |
---|
| 43 | + char name[]; // Optional null-terminated name |
---|
| 44 | +}; |
---|
| 45 | +*/ |
---|
| 46 | + |
---|
| 47 | +/******************************************************************************* |
---|
| 48 | +** |
---|
| 49 | +** Function skw_ext_inotify_thread |
---|
| 50 | +** |
---|
| 51 | +** Description inotify thread function |
---|
| 52 | +** |
---|
| 53 | +** Returns void * |
---|
| 54 | +** |
---|
| 55 | +*******************************************************************************/ |
---|
| 56 | +static void *skw_ext_inotify_thread(void *arg) |
---|
| 57 | +{ |
---|
| 58 | + int fd = -1; |
---|
| 59 | + int wd = -1; |
---|
| 60 | + int read_len = 0; |
---|
| 61 | + int event_pos = 0; |
---|
| 62 | + int event_size = 0; |
---|
| 63 | + char buffer[SKW_EXT_BUF_SIZE + 1] = {0}; |
---|
| 64 | + struct inotify_event *event = NULL; |
---|
| 65 | + skw_inotify_thread_info_st *thread_info = &skw_inotify_thread_info; |
---|
| 66 | + |
---|
| 67 | + int epfd = epoll_create(4); |
---|
| 68 | + struct epoll_event ev; |
---|
| 69 | + struct epoll_event events[20]; |
---|
| 70 | + |
---|
| 71 | + SKWBT_LOG("%s enter", __func__); |
---|
| 72 | + |
---|
| 73 | + SKW_UNUSED(arg); |
---|
| 74 | + fd = inotify_init1(IN_NONBLOCK); |
---|
| 75 | + if(fd < 0) |
---|
| 76 | + { |
---|
| 77 | + ALOGE("inotify_init1 failed: %s", strerror(errno)); |
---|
| 78 | + return NULL; |
---|
| 79 | + } |
---|
| 80 | + wd = inotify_add_watch(fd, "/dev", IN_CREATE); |
---|
| 81 | + if (wd < 0) |
---|
| 82 | + { |
---|
| 83 | + ALOGE("inotify_add_watch fail: %s\n", strerror(errno)); |
---|
| 84 | + return NULL; |
---|
| 85 | + } |
---|
| 86 | + if(socketpair(AF_UNIX, SOCK_STREAM, 0, thread_info->signal_fd) == -1) |
---|
| 87 | + { |
---|
| 88 | + ALOGE("signal socket creare fail: %s\n", strerror(errno)); |
---|
| 89 | + return NULL; |
---|
| 90 | + } |
---|
| 91 | + thread_info->epoll_fd = epfd; |
---|
| 92 | + |
---|
| 93 | + memset(&ev, 0, sizeof(ev)); |
---|
| 94 | + ev.data.fd = fd; |
---|
| 95 | + ev.events = EPOLLIN | EPOLLET; |
---|
| 96 | + epoll_ctl(epfd, EPOLL_CTL_ADD, fd, &ev); |
---|
| 97 | + |
---|
| 98 | + |
---|
| 99 | + ev.events = EPOLLIN | EPOLLHUP | EPOLLRDHUP | EPOLLERR; |
---|
| 100 | + ev.data.fd = thread_info->signal_fd[0]; |
---|
| 101 | + if (epoll_ctl(epfd, EPOLL_CTL_ADD, ev.data.fd, &ev) == -1) |
---|
| 102 | + { |
---|
| 103 | + ALOGE("%s unable to register signal fd %d to epoll set: %s", __func__, ev.data.fd, strerror(errno)); |
---|
| 104 | + return NULL; |
---|
| 105 | + } |
---|
| 106 | + |
---|
| 107 | + while(thread_info->thread_running) |
---|
| 108 | + { |
---|
| 109 | + int nfds = epoll_wait(epfd, events, 20, 500); |
---|
| 110 | + for (int i = 0; i < nfds; ++i) |
---|
| 111 | + { |
---|
| 112 | + if(thread_info->thread_running == 0) |
---|
| 113 | + { |
---|
| 114 | + goto thread_exit; |
---|
| 115 | + } |
---|
| 116 | + if ((events[i].data.fd != fd) || (!(events[i].events & EPOLLIN))) |
---|
| 117 | + { |
---|
| 118 | + continue; |
---|
| 119 | + } |
---|
| 120 | + read_len = read(fd, buffer, SKW_EXT_BUF_SIZE); |
---|
| 121 | + |
---|
| 122 | + //SKWBT_LOG("select read_len:%d, nfds:%d", read_len, nfds); |
---|
| 123 | + |
---|
| 124 | + if(read_len <= 0) |
---|
| 125 | + { |
---|
| 126 | + continue; |
---|
| 127 | + } |
---|
| 128 | + event_pos = 0; |
---|
| 129 | + |
---|
| 130 | + while((read_len >= (int)sizeof(struct inotify_event)) && (event_pos < SKW_EXT_BUF_SIZE))//may receive multiple events |
---|
| 131 | + { |
---|
| 132 | + event = (struct inotify_event *)(buffer + event_pos); |
---|
| 133 | + if(event->len) |
---|
| 134 | + { |
---|
| 135 | + if(event->mask & IN_CREATE) |
---|
| 136 | + { |
---|
| 137 | + SKWBT_LOG("recv command msg mask:0x%X name:%s", event->mask, event->name); |
---|
| 138 | + if (((event->mask & IN_ISDIR) == 0) && (memcmp(event->name, "shutdown", 8) == 0)) |
---|
| 139 | + { |
---|
| 140 | + scomm_vendor_write_wakeup_adv_enable(); |
---|
| 141 | + |
---|
| 142 | + SKWBT_LOG("received shutdown command"); |
---|
| 143 | + goto thread_exit; |
---|
| 144 | + } |
---|
| 145 | + } |
---|
| 146 | + else |
---|
| 147 | + { |
---|
| 148 | + SKWBT_LOG("othre event, mask:0x%X, name: %s", event->mask, event->name); |
---|
| 149 | + } |
---|
| 150 | + } |
---|
| 151 | + |
---|
| 152 | + event_size = sizeof(struct inotify_event) + event->len; |
---|
| 153 | + read_len -= event_size; |
---|
| 154 | + event_pos += event_size; |
---|
| 155 | + } |
---|
| 156 | + |
---|
| 157 | + } |
---|
| 158 | + } |
---|
| 159 | + |
---|
| 160 | +thread_exit: |
---|
| 161 | + SKWBT_LOG("%s exit", __func__); |
---|
| 162 | + inotify_rm_watch(fd, wd); |
---|
| 163 | + close(fd); |
---|
| 164 | + thread_info->thread_running = FALSE; |
---|
| 165 | + return NULL; |
---|
| 166 | +} |
---|
| 167 | + |
---|
| 168 | +/******************************************************************************* |
---|
| 169 | +** |
---|
| 170 | +** Function skw_ext_inotify_thread_init |
---|
| 171 | +** |
---|
| 172 | +** Description inotify thread init |
---|
| 173 | +** |
---|
| 174 | +** Returns None |
---|
| 175 | +** |
---|
| 176 | +*******************************************************************************/ |
---|
| 177 | +void skw_ext_inotify_thread_init(void) |
---|
| 178 | +{ |
---|
| 179 | +#if BLE_ADV_WAKEUP_ENABLE |
---|
| 180 | + skw_inotify_thread_info_st *thread_info = &skw_inotify_thread_info; |
---|
| 181 | + pthread_attr_t thread_attr; |
---|
| 182 | + pthread_attr_init(&thread_attr); |
---|
| 183 | + pthread_attr_setdetachstate(&thread_attr, PTHREAD_CREATE_JOINABLE); |
---|
| 184 | + |
---|
| 185 | + memset(thread_info, 0, sizeof(skw_inotify_thread_info_st)); |
---|
| 186 | + SKWBT_LOG("%s enter", __func__); |
---|
| 187 | + |
---|
| 188 | + thread_info->signal_fd[0] = -1; |
---|
| 189 | + thread_info->signal_fd[1] = -1; |
---|
| 190 | + if(pthread_create(&thread_info->thread_id, &thread_attr, skw_ext_inotify_thread, NULL) != 0) |
---|
| 191 | + { |
---|
| 192 | + ALOGE("%s pthread_create : %s", __func__, strerror(errno)); |
---|
| 193 | + thread_info->thread_id = -1; |
---|
| 194 | + return ; |
---|
| 195 | + } |
---|
| 196 | + thread_info->thread_running = TRUE; |
---|
| 197 | +#else |
---|
| 198 | + SKW_UNUSED(skw_ext_inotify_thread); |
---|
| 199 | +#endif |
---|
| 200 | +} |
---|
| 201 | + |
---|
| 202 | +/******************************************************************************* |
---|
| 203 | +** |
---|
| 204 | +** Function skw_ext_inotify_thread_exit |
---|
| 205 | +** |
---|
| 206 | +** Description inotify thread exit |
---|
| 207 | +** |
---|
| 208 | +** Returns None |
---|
| 209 | +** |
---|
| 210 | +*******************************************************************************/ |
---|
| 211 | +void skw_ext_inotify_thread_exit(void) |
---|
| 212 | +{ |
---|
| 213 | +#if BLE_ADV_WAKEUP_ENABLE |
---|
| 214 | + char is_closed = 0; |
---|
| 215 | + skw_inotify_thread_info_st *thread_info = &skw_inotify_thread_info; |
---|
| 216 | + |
---|
| 217 | + if(thread_info->thread_running && (thread_info->thread_id != -1)) |
---|
| 218 | + { |
---|
| 219 | + unsigned char close_signal = 1; |
---|
| 220 | + thread_info->thread_running = FALSE; |
---|
| 221 | + if(thread_info->epoll_fd >= 0) |
---|
| 222 | + { |
---|
| 223 | + ssize_t ret; |
---|
| 224 | + RW_NO_INTR(ret = write(thread_info->signal_fd[1], &close_signal, 1)); |
---|
| 225 | + SKWBT_LOG("%s signal_fd:%d, ret:%d", __func__, thread_info->epoll_fd, (int)ret); |
---|
| 226 | + |
---|
| 227 | + epoll_ctl(thread_info->epoll_fd, EPOLL_CTL_DEL, thread_info->signal_fd[0], NULL); |
---|
| 228 | + close(thread_info->signal_fd[0]); |
---|
| 229 | + close(thread_info->signal_fd[1]); |
---|
| 230 | + |
---|
| 231 | + is_closed = 1; |
---|
| 232 | + } |
---|
| 233 | + pthread_join(thread_info->thread_id, NULL); |
---|
| 234 | + } |
---|
| 235 | + |
---|
| 236 | + if(is_closed == 0)//The thread may have exited |
---|
| 237 | + { |
---|
| 238 | + if(thread_info->signal_fd[0] != -1) |
---|
| 239 | + { |
---|
| 240 | + close(thread_info->signal_fd[0]); |
---|
| 241 | + } |
---|
| 242 | + if(thread_info->signal_fd[1] != -1) |
---|
| 243 | + { |
---|
| 244 | + close(thread_info->signal_fd[1]); |
---|
| 245 | + } |
---|
| 246 | + } |
---|
| 247 | + if(thread_info->epoll_fd >= 0) |
---|
| 248 | + { |
---|
| 249 | + if(is_closed == 0) |
---|
| 250 | + { |
---|
| 251 | + epoll_ctl(thread_info->epoll_fd, EPOLL_CTL_DEL, thread_info->signal_fd[0], NULL); |
---|
| 252 | + } |
---|
| 253 | + close(thread_info->epoll_fd); |
---|
| 254 | + } |
---|
| 255 | + thread_info->signal_fd[0] = -1; |
---|
| 256 | + thread_info->signal_fd[1] = -1; |
---|
| 257 | + thread_info->epoll_fd = -1; |
---|
| 258 | + |
---|
| 259 | + |
---|
| 260 | + SKWBT_LOG("%s exit", __func__); |
---|
| 261 | +#endif |
---|
| 262 | + |
---|
| 263 | +} |
---|
.. | .. |
---|
| 1 | +/****************************************************************************** |
---|
| 2 | + * |
---|
| 3 | + * Copyright (C) 2020-2021 SeekWave Technology |
---|
| 4 | + * |
---|
| 5 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
---|
| 6 | + * |
---|
| 7 | + ******************************************************************************/ |
---|
| 8 | +#include <stdio.h> |
---|
| 9 | +#include <stdlib.h> |
---|
| 10 | +#include <time.h> |
---|
| 11 | +#include <string.h> |
---|
| 12 | +#include <utils/Log.h> |
---|
| 13 | +#include <fcntl.h> |
---|
| 14 | +#include <unistd.h> |
---|
| 15 | +#include <sys/ioctl.h> |
---|
| 16 | + |
---|
| 17 | +#define MACDEF_FOR_INCAR 1 |
---|
| 18 | + |
---|
| 19 | +#define BD_ADDR_LEN 6 |
---|
| 20 | + |
---|
| 21 | +unsigned char bdaddr_lap[3] = {0x12, 0x24, 0x56}; |
---|
| 22 | +char bdaddr_valid = 1; |
---|
| 23 | +extern char skw_btsnoop_path[]; |
---|
| 24 | + |
---|
| 25 | +extern void hex2String(unsigned char hex[], unsigned char str[], int N); |
---|
| 26 | + |
---|
| 27 | +void skw_addr_gen_init() |
---|
| 28 | +{ |
---|
| 29 | + char basepath[PATH_MAX] = {0}; |
---|
| 30 | + char filepath[PATH_MAX] = {0}; |
---|
| 31 | + int size = strlen(skw_btsnoop_path); |
---|
| 32 | + int i; |
---|
| 33 | + for(i = size - 1; i > 0; i--)//get log dir |
---|
| 34 | + { |
---|
| 35 | + char ch = skw_btsnoop_path[i]; |
---|
| 36 | + if((ch == '/') || (ch == '\\')) |
---|
| 37 | + { |
---|
| 38 | + memcpy(basepath, skw_btsnoop_path, i); |
---|
| 39 | + //ALOGD("cp:%d", i); |
---|
| 40 | + break; |
---|
| 41 | + } |
---|
| 42 | + } |
---|
| 43 | + snprintf(filepath, PATH_MAX, "%s/skwbdaddr.txt", basepath); |
---|
| 44 | + |
---|
| 45 | + ALOGD("%s, %s", __func__, filepath); |
---|
| 46 | + |
---|
| 47 | + FILE *fp = fopen(filepath, "r"); //read only |
---|
| 48 | + if(fp == NULL)//file not exist |
---|
| 49 | + { |
---|
| 50 | + fp = fopen(filepath, "w"); //file not exist, create it |
---|
| 51 | + srand(time(NULL)); |
---|
| 52 | + if(fp) |
---|
| 53 | + { |
---|
| 54 | + bdaddr_lap[0] = (unsigned char)(rand() & 0xFF); |
---|
| 55 | + bdaddr_lap[1] = (unsigned char)(rand() & 0xFF); |
---|
| 56 | + bdaddr_lap[2] = (unsigned char)(rand() & 0xFF); |
---|
| 57 | + fwrite(bdaddr_lap, 3, 1, fp); |
---|
| 58 | + fflush(fp); |
---|
| 59 | + fclose(fp); |
---|
| 60 | + } |
---|
| 61 | + else |
---|
| 62 | + { |
---|
| 63 | + bdaddr_valid = 0; |
---|
| 64 | + } |
---|
| 65 | + //else use default addr |
---|
| 66 | + } |
---|
| 67 | + else |
---|
| 68 | + { |
---|
| 69 | + fread(bdaddr_lap, 3, 1, fp); |
---|
| 70 | + fclose(fp); |
---|
| 71 | + } |
---|
| 72 | + |
---|
| 73 | + ALOGD("%s, addr valid:%d, %02X %02X %02X", __func__, bdaddr_valid, bdaddr_lap[0], bdaddr_lap[1], bdaddr_lap[2]); |
---|
| 74 | +} |
---|
| 75 | + |
---|
| 76 | + |
---|
| 77 | +#if MACDEF_FOR_INCAR |
---|
| 78 | + |
---|
| 79 | +#define VENDOR_REQ_TAG 0x56524551 |
---|
| 80 | +#define VENDOR_READ_IO _IOW('v', 0x01, unsigned int) |
---|
| 81 | +#define VENDOR_WRITE_IO _IOW('v', 0x02, unsigned int) |
---|
| 82 | + |
---|
| 83 | +#define VENDOR_SN_ID 1 |
---|
| 84 | +#define VENDOR_WIFI_MAC_ID 2 |
---|
| 85 | +#define VENDOR_LAN_MAC_ID 3 |
---|
| 86 | +#define VENDOR_BLUETOOTH_ID 4 |
---|
| 87 | + |
---|
| 88 | +struct rk_vendor_req |
---|
| 89 | +{ |
---|
| 90 | + uint32_t tag; |
---|
| 91 | + uint16_t id; |
---|
| 92 | + uint16_t len; |
---|
| 93 | + uint8_t data[1]; |
---|
| 94 | +}; |
---|
| 95 | + |
---|
| 96 | +int m_get_mac_address(uint8_t *local_addr) |
---|
| 97 | +{ |
---|
| 98 | + int ret ; |
---|
| 99 | + uint8_t p_buf[64]; |
---|
| 100 | + struct rk_vendor_req *req; |
---|
| 101 | + |
---|
| 102 | + req = (struct rk_vendor_req *)p_buf; |
---|
| 103 | + int sys_fd = open("/dev/vendor_storage", O_RDWR, 0); |
---|
| 104 | + if(sys_fd < 0) |
---|
| 105 | + { |
---|
| 106 | + ALOGE("vendor_storage open fail\n"); |
---|
| 107 | + return -1; |
---|
| 108 | + } |
---|
| 109 | + |
---|
| 110 | + req->tag = VENDOR_REQ_TAG; |
---|
| 111 | + req->id = VENDOR_BLUETOOTH_ID; |
---|
| 112 | + |
---|
| 113 | + req->len = 6; |
---|
| 114 | + ret = ioctl(sys_fd, VENDOR_READ_IO, req); |
---|
| 115 | + if (!ret) |
---|
| 116 | + { |
---|
| 117 | + //uint8_t str_buffer[32] = {0}; |
---|
| 118 | + int i = 0, j = BD_ADDR_LEN - 1; |
---|
| 119 | + for(; i < BD_ADDR_LEN; i++, j--) |
---|
| 120 | + { |
---|
| 121 | + local_addr[i] = req->data[j]; |
---|
| 122 | + } |
---|
| 123 | + //memcpy(local_addr, req->data, BD_ADDR_LEN); |
---|
| 124 | + //hex2String(local_addr, str_buffer, BD_ADDR_LEN); |
---|
| 125 | + //ALOGE("bt addr get ok:%s", str_buffer); |
---|
| 126 | + } |
---|
| 127 | + |
---|
| 128 | + close(sys_fd); |
---|
| 129 | + return 0; |
---|
| 130 | +} |
---|
| 131 | + |
---|
| 132 | + |
---|
| 133 | +#endif |
---|
| 134 | + |
---|
| 135 | +char skw_addr_check_valid(unsigned char *bd_addr) |
---|
| 136 | +{ |
---|
| 137 | + uint32_t addr_check = 0; |
---|
| 138 | + int i ; |
---|
| 139 | + for( i = 0; i < BD_ADDR_LEN; i++) |
---|
| 140 | + { |
---|
| 141 | + addr_check += bd_addr[i]; |
---|
| 142 | + } |
---|
| 143 | + return (addr_check > 0); |
---|
| 144 | +} |
---|
| 145 | + |
---|
| 146 | +/* |
---|
| 147 | +Get bd addr from AP |
---|
| 148 | +if address exist, return 1, else 0 |
---|
| 149 | +*/ |
---|
| 150 | +char skw_addr_from_ap(unsigned char *bd_addr) |
---|
| 151 | +{ |
---|
| 152 | + memset(bd_addr, 0, BD_ADDR_LEN); |
---|
| 153 | +#if MACDEF_FOR_INCAR |
---|
| 154 | + if(m_get_mac_address(bd_addr) == 0) |
---|
| 155 | + { |
---|
| 156 | + return skw_addr_check_valid(bd_addr); |
---|
| 157 | + } |
---|
| 158 | +#endif |
---|
| 159 | + return 0; |
---|
| 160 | +} |
---|
| 161 | + |
---|
| 162 | +void skw_addr_get(unsigned char *buffer) |
---|
| 163 | +{ |
---|
| 164 | + if(bdaddr_valid > 0) |
---|
| 165 | + { |
---|
| 166 | + buffer[0] = bdaddr_lap[0]; |
---|
| 167 | + buffer[1] = bdaddr_lap[1]; |
---|
| 168 | + buffer[2] = bdaddr_lap[2]; |
---|
| 169 | + } |
---|
| 170 | +} |
---|
| 171 | + |
---|
.. | .. |
---|
| 1 | +/****************************************************************************** |
---|
| 2 | + * |
---|
| 3 | + * Copyright (C) 2020-2021 SeekWave Technology |
---|
| 4 | + * |
---|
| 5 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
---|
| 6 | + * |
---|
| 7 | + ******************************************************************************/ |
---|
| 8 | + |
---|
| 9 | +#include <time.h> |
---|
| 10 | +#include <stdio.h> |
---|
| 11 | +#include <pthread.h> |
---|
| 12 | +#include <fcntl.h> |
---|
| 13 | +#include <math.h> |
---|
| 14 | +#include <stdlib.h> |
---|
| 15 | +#include <unistd.h> |
---|
| 16 | +#include <string.h> |
---|
| 17 | +#include <utils/Log.h> |
---|
| 18 | +#include <errno.h> |
---|
| 19 | +#include <sys/stat.h> |
---|
| 20 | +#include "skw_log.h" |
---|
| 21 | +#include "skw_common.h" |
---|
| 22 | + |
---|
| 23 | + |
---|
| 24 | +static pthread_mutex_t skwlog_lock; |
---|
| 25 | + |
---|
| 26 | +static int skwlog_fp = -1; |
---|
| 27 | +unsigned int skwlog_rev_length = 0; |
---|
| 28 | +unsigned int skwlog_cnts = 0; |
---|
| 29 | + |
---|
| 30 | +extern char skw_btsnoop_path[]; |
---|
| 31 | +extern char btcp_log_en; |
---|
| 32 | +extern char skwlog_slice; |
---|
| 33 | +extern char btsnoop_save_log; |
---|
| 34 | + |
---|
| 35 | + |
---|
| 36 | +void skwlog_open(char new_file) |
---|
| 37 | +{ |
---|
| 38 | + char log_path[PATH_MAX]; |
---|
| 39 | + char basepath[PATH_MAX] = {0}; |
---|
| 40 | + char lastpath[PATH_MAX] = {0}; |
---|
| 41 | + int i; |
---|
| 42 | + int size = strlen(skw_btsnoop_path); |
---|
| 43 | + if((!btcp_log_en) || (size <= 0)) |
---|
| 44 | + { |
---|
| 45 | + return ; |
---|
| 46 | + } |
---|
| 47 | + |
---|
| 48 | + for( i = size - 1; i > 0; i--)//get log dir |
---|
| 49 | + { |
---|
| 50 | + char ch = skw_btsnoop_path[i]; |
---|
| 51 | + if((ch == '/') || (ch == '\\')) |
---|
| 52 | + { |
---|
| 53 | + memcpy(basepath, skw_btsnoop_path, i); |
---|
| 54 | + //ALOGD("cp:%d", i); |
---|
| 55 | + break; |
---|
| 56 | + } |
---|
| 57 | + } |
---|
| 58 | + snprintf(log_path, PATH_MAX, "%s/skwlog.log", basepath); |
---|
| 59 | + |
---|
| 60 | + struct stat buf; |
---|
| 61 | + int fd = -1; |
---|
| 62 | + if(stat(log_path, &buf) == 0) |
---|
| 63 | + { |
---|
| 64 | + fd = open(log_path, O_RDONLY); |
---|
| 65 | + } |
---|
| 66 | + if(fd > 0) |
---|
| 67 | + { |
---|
| 68 | + fstat(fd, &buf); |
---|
| 69 | + int file_zie = (int)buf.st_size; |
---|
| 70 | + close(fd); |
---|
| 71 | + ALOGD("%s cp log file size:%d", __func__, file_zie); |
---|
| 72 | + if(skwlog_slice) |
---|
| 73 | + { |
---|
| 74 | + if(new_file) |
---|
| 75 | + { |
---|
| 76 | + snprintf(lastpath, PATH_MAX, "%s/skwlog-last.log", basepath); |
---|
| 77 | + remove(lastpath); |
---|
| 78 | + if (!rename(log_path, lastpath) && (errno != ENOENT)) |
---|
| 79 | + { |
---|
| 80 | + ALOGE("%s unable to rename '%s' to '%s': %s", __func__, log_path, lastpath, strerror(errno)); |
---|
| 81 | + } |
---|
| 82 | + } |
---|
| 83 | + else |
---|
| 84 | + { |
---|
| 85 | + skwlog_rev_length = (unsigned int)file_zie; |
---|
| 86 | + } |
---|
| 87 | + } |
---|
| 88 | + else |
---|
| 89 | + { |
---|
| 90 | + if(file_zie > (16 + 12)) |
---|
| 91 | + { |
---|
| 92 | + time_t current_time = time(NULL); |
---|
| 93 | + struct tm *time_created = localtime(¤t_time); |
---|
| 94 | + char config_time_created[sizeof("YYYY-MM-DD-HHMMSS") + 1]; |
---|
| 95 | + strftime(config_time_created, sizeof("YYYY-MM-DD-HHMMSS"), "%Y-%m-%d-%H%M%S", time_created); |
---|
| 96 | + |
---|
| 97 | + snprintf(lastpath, PATH_MAX, "%s/skwlog-%s_%03d-%02d.log", basepath, config_time_created, rand() % 1000, (int)skwlog_cnts); |
---|
| 98 | + |
---|
| 99 | + if (!rename(log_path, lastpath) && (errno != ENOENT)) |
---|
| 100 | + { |
---|
| 101 | + ALOGE("%s unable to rename '%s' to '%s': %s", __func__, log_path, lastpath, strerror(errno)); |
---|
| 102 | + } |
---|
| 103 | + |
---|
| 104 | + } |
---|
| 105 | + } |
---|
| 106 | + if(0 == file_zie) |
---|
| 107 | + { |
---|
| 108 | + new_file = TRUE; |
---|
| 109 | + } |
---|
| 110 | + } |
---|
| 111 | + else |
---|
| 112 | + { |
---|
| 113 | + new_file = TRUE; |
---|
| 114 | + } |
---|
| 115 | + |
---|
| 116 | + //ALOGD("basepath:%d, %s,%s",size, basepath, skw_btsnoop_path); |
---|
| 117 | + |
---|
| 118 | + ALOGD("skwlog:%s, %s", log_path, lastpath); |
---|
| 119 | + |
---|
| 120 | + skwlog_fp = open(log_path, O_WRONLY | O_CREAT | O_APPEND, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH); |
---|
| 121 | + |
---|
| 122 | + ALOGD("%s open '%s', fd:%d, is new:%d", __func__, log_path, skwlog_fp, new_file); |
---|
| 123 | + //lseek(skwlog_fp, 0, SEEK_END); |
---|
| 124 | + if(skwlog_fp > 0) |
---|
| 125 | + { |
---|
| 126 | + if(new_file) |
---|
| 127 | + { |
---|
| 128 | + write(skwlog_fp, "skwcplog\0\1\0\2\0\0\x3\xEA", 16); |
---|
| 129 | + } |
---|
| 130 | + //skwlog_print_current_time(); |
---|
| 131 | + } |
---|
| 132 | + skwlog_cnts ++; |
---|
| 133 | +} |
---|
| 134 | + |
---|
| 135 | +void skwlog_reopen(char new_file) |
---|
| 136 | +{ |
---|
| 137 | + pthread_mutex_lock(&skwlog_lock); |
---|
| 138 | + skwlog_rev_length = 0; |
---|
| 139 | + if (skwlog_fp != -1) |
---|
| 140 | + { |
---|
| 141 | + close(skwlog_fp); |
---|
| 142 | + } |
---|
| 143 | + skwlog_open(new_file); |
---|
| 144 | + pthread_mutex_unlock(&skwlog_lock); |
---|
| 145 | + if(skwlog_fp > 0) |
---|
| 146 | + { |
---|
| 147 | + skwlog_print_current_time(); |
---|
| 148 | + } |
---|
| 149 | +} |
---|
| 150 | + |
---|
| 151 | + |
---|
| 152 | +void skwlog_print_current_time() |
---|
| 153 | +{ |
---|
| 154 | + time_t current_time = time(NULL); |
---|
| 155 | + struct tm *time_created = localtime(¤t_time); |
---|
| 156 | + |
---|
| 157 | + // |
---|
| 158 | + unsigned char buffer[16] = {0x07, 0xFF, 0x08, 0x00, 0x01, 0xD0, 0x55, 0x55}; |
---|
| 159 | + buffer[8] = time_created->tm_sec;//[0,59] |
---|
| 160 | + buffer[9] = time_created->tm_min;//[0,59] |
---|
| 161 | + buffer[10] = time_created->tm_hour;//[0,23] |
---|
| 162 | + buffer[11] = time_created->tm_mday;//[1,31] |
---|
| 163 | + |
---|
| 164 | + skwlog_write(buffer, 12); |
---|
| 165 | +} |
---|
| 166 | + |
---|
| 167 | +void skwlog_init() |
---|
| 168 | +{ |
---|
| 169 | + pthread_mutex_init(&skwlog_lock, NULL); |
---|
| 170 | + skwlog_fp = -1; |
---|
| 171 | + skwlog_rev_length = 0; |
---|
| 172 | + skwlog_cnts = 0; |
---|
| 173 | + if(btcp_log_en && ((!btsnoop_save_log) || (!skwlog_slice))) |
---|
| 174 | + { |
---|
| 175 | + skwlog_open(TRUE); |
---|
| 176 | + if(skwlog_fp > 0) |
---|
| 177 | + { |
---|
| 178 | + skwlog_print_current_time(); |
---|
| 179 | + } |
---|
| 180 | + } |
---|
| 181 | + ALOGD("skwlog_init,en:%d, slice:%d, fd:%d", btcp_log_en, skwlog_slice, skwlog_fp); |
---|
| 182 | +} |
---|
| 183 | + |
---|
| 184 | + |
---|
| 185 | +void skwlog_write(unsigned char *buffer, unsigned int length) |
---|
| 186 | +{ |
---|
| 187 | + if(skwlog_fp > 0) |
---|
| 188 | + { |
---|
| 189 | + pthread_mutex_lock(&skwlog_lock); |
---|
| 190 | + |
---|
| 191 | + write(skwlog_fp, buffer, length); |
---|
| 192 | + skwlog_rev_length += length; |
---|
| 193 | + |
---|
| 194 | + if(skwlog_rev_length >= SKW_LOG_DEFAULT_SIZE) |
---|
| 195 | + { |
---|
| 196 | + skwlog_rev_length = 0; |
---|
| 197 | + close(skwlog_fp); |
---|
| 198 | + skwlog_fp = -1; |
---|
| 199 | + skwlog_open(TRUE); |
---|
| 200 | + } |
---|
| 201 | + pthread_mutex_unlock(&skwlog_lock); |
---|
| 202 | + } |
---|
| 203 | +} |
---|
| 204 | + |
---|
| 205 | +void skwlog_close() |
---|
| 206 | +{ |
---|
| 207 | + pthread_mutex_destroy(&skwlog_lock); |
---|
| 208 | + if (skwlog_fp != -1) |
---|
| 209 | + { |
---|
| 210 | + close(skwlog_fp); |
---|
| 211 | + } |
---|
| 212 | + skwlog_fp = -1; |
---|
| 213 | + skwlog_rev_length = 0; |
---|
| 214 | + skwlog_cnts = 0; |
---|
| 215 | +} |
---|
| 216 | + |
---|
.. | .. |
---|
| 1 | +# RELEASE NAME: 20210721_BT_ANDROID_10.0 |
---|
| 2 | +# Bluetooth Device Name |
---|
| 3 | +#Name=SeekWave Bluetooth |
---|
| 4 | + |
---|
| 5 | +#Indicate USB/SDIO or UART driver bluetooth |
---|
| 6 | +BtDeviceNode=/dev/BTCMD |
---|
| 7 | +BtDeviceNode=/dev/BTDATA |
---|
| 8 | +BtDeviceNode=/dev/BTAUDIO |
---|
| 9 | +BtDeviceNode=/dev/BTISOC |
---|
| 10 | +#BtDeviceNode=?/dev/ttyS0 |
---|
| 11 | + |
---|
| 12 | +# Enable BtSnoop logging function |
---|
| 13 | +# valid value : true, false |
---|
| 14 | +SkwBtUartOnly=false |
---|
| 15 | +#SkwBtNoSleep:just for uart mode |
---|
| 16 | +SkwBtNoSleep=false |
---|
| 17 | +SkwBtsnoopDump=true |
---|
| 18 | +SkwBtcplog=false |
---|
| 19 | +SkwBtDrvlog=false |
---|
| 20 | + |
---|
| 21 | +#WakeupADVData=gpio No;effactive level;ADVData;Mask ### ADVData size must be equal Mask size |
---|
| 22 | +#WakeupADVData=4;1;0;020106031980010FFF00112233AABBCCDD;0000FF0000FFFFFF000000000000000000 |
---|
| 23 | +WakeupADVData=4;1;0;020105031980010FFF00112233AABBCCDDFFFFFFFFFFFF;000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF |
---|
| 24 | +# BtSnoop log output file |
---|
| 25 | +BtSnoopFileName=/data/misc/bluedroid/btsnoop_hci.cfa |
---|
| 26 | + |
---|
| 27 | + |
---|
| 28 | +# Preserve existing BtSnoop log before overwriting |
---|
| 29 | +BtSnoopSaveLog=true |
---|
| 30 | +SkwLogSlice=true |
---|
.. | .. |
---|
| 1 | +ifeq ($(BOARD_WLAN_DEVICE), seekwave) |
---|
| 2 | + include $(call all-subdir-makefiles) |
---|
| 3 | +endif |
---|
.. | .. |
---|
| 1 | +# Copyright (C) 2007 The Android Open Source Project |
---|
| 2 | +# |
---|
| 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 | +# If you don't need to do a full clean build but would like to touch |
---|
| 17 | +# a file or delete some intermediate files, add a clean step to the end |
---|
| 18 | +# of the list. These steps will only be run once, if they haven't been |
---|
| 19 | +# run before. |
---|
| 20 | +# |
---|
| 21 | +# E.g.: |
---|
| 22 | +# $(call add-clean-step, touch -c external/sqlite/sqlite3.h) |
---|
| 23 | +# $(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/STATIC_LIBRARIES/libz_intermediates) |
---|
| 24 | +# |
---|
| 25 | +# Always use "touch -c" and "rm -f" or "rm -rf" to gracefully deal with |
---|
| 26 | +# files that are missing or have been moved. |
---|
| 27 | +# |
---|
| 28 | +# Use $(PRODUCT_OUT) to get to the "out/target/product/blah/" directory. |
---|
| 29 | +# Use $(OUT_DIR) to refer to the "out" directory. |
---|
| 30 | +# |
---|
| 31 | +# If you need to re-do something that's already mentioned, just copy |
---|
| 32 | +# the command and add it to the bottom of the list. E.g., if a change |
---|
| 33 | +# that you made last week required touching a file and a change you |
---|
| 34 | +# made today requires touching the same file, just copy the old |
---|
| 35 | +# touch step and add it to the end of the list. |
---|
| 36 | +# |
---|
| 37 | +# ************************************************ |
---|
| 38 | +# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST |
---|
| 39 | +# ************************************************ |
---|
| 40 | + |
---|
| 41 | +# For example: |
---|
| 42 | +#$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/APPS/AndroidTests_intermediates) |
---|
| 43 | +#$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/JAVA_LIBRARIES/core_intermediates) |
---|
| 44 | +#$(call add-clean-step, find $(OUT_DIR) -type f -name "IGTalkSession*" -print0 | xargs -0 rm -f) |
---|
| 45 | +#$(call add-clean-step, rm -rf $(PRODUCT_OUT)/data/*) |
---|
| 46 | + |
---|
| 47 | +# ************************************************ |
---|
| 48 | +# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST |
---|
| 49 | +# ************************************************ |
---|
.. | .. |
---|
| 1 | +third_party { |
---|
| 2 | + license_type: NOTICE |
---|
| 3 | +} |
---|
.. | .. |
---|
| 1 | +# |
---|
| 2 | +# Copyright (C) 2008 The Android Open Source Project |
---|
| 3 | +# |
---|
| 4 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
---|
| 5 | +# you may not use this file except in compliance with the License. |
---|
| 6 | +# You may obtain a copy of the License at |
---|
| 7 | +# |
---|
| 8 | +# http://www.apache.org/licenses/LICENSE-2.0 |
---|
| 9 | +# |
---|
| 10 | +# Unless required by applicable law or agreed to in writing, software |
---|
| 11 | +# distributed under the License is distributed on an "AS IS" BASIS, |
---|
| 12 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
---|
| 13 | +# See the License for the specific language governing permissions and |
---|
| 14 | +# limitations under the License. |
---|
| 15 | +# |
---|
| 16 | +LOCAL_PATH := $(call my-dir) |
---|
| 17 | + |
---|
| 18 | +######################## |
---|
| 19 | + |
---|
| 20 | +WIFI_DRIVER_SOCKET_IFACE := wlan0 |
---|
| 21 | + |
---|
| 22 | +ifeq ($(strip $(WPA_SUPPLICANT_VERSION)),VER_0_8_X) |
---|
| 23 | + include external/wpa_supplicant_8/wpa_supplicant/wpa_supplicant_conf.mk |
---|
| 24 | +else |
---|
| 25 | +ifeq ($(strip $(WPA_SUPPLICANT_VERSION)),VER_0_6_X) |
---|
| 26 | + include external/wpa_supplicant_6/wpa_supplicant/wpa_supplicant_conf.mk |
---|
| 27 | +else |
---|
| 28 | + include external/wpa_supplicant/wpa_supplicant_conf.mk |
---|
| 29 | +endif |
---|
| 30 | +endif |
---|
| 31 | +####################### |
---|
.. | .. |
---|
| 1 | +# Copyright (C) 2008 The Android Open Source Project |
---|
| 2 | +# |
---|
| 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 | +######################## |
---|
| 17 | + |
---|
| 18 | +PRODUCT_COPY_FILES += \ |
---|
| 19 | + hardware/seekwave/wlan/configs/wpa_supplicant_overlay.conf:$(TARGET_COPY_OUT_VENDOR)/etc/wifi/skw_wpa_supplicant_overlay.conf |
---|
| 20 | +# hardware/seekwave/wlan/configs/p2p_supplicant_overlay.conf:$(TARGET_COPY_OUT_VENDOR)/etc/wifi/skw_p2p_supplicant_overlay.conf |
---|
| 21 | +######################## |
---|
.. | .. |
---|
| 1 | +disable_scan_offload=1 |
---|
| 2 | +wowlan_triggers=any |
---|
| 3 | +filter_rssi=-75 |
---|
| 4 | +p2p_disabled=1 |
---|
| 5 | +bgscan="simple:11:-70:105" |
---|
| 6 | +no_ctrl_interface= |
---|
.. | .. |
---|
| 1 | +LOCAL_PATH := $(call my-dir) |
---|
| 2 | + |
---|
| 3 | +# Make the HAL library |
---|
| 4 | +# ============================================================ |
---|
| 5 | +include $(CLEAR_VARS) |
---|
| 6 | + |
---|
| 7 | +LOCAL_CFLAGS := -Wall \ |
---|
| 8 | + -Werror \ |
---|
| 9 | + -Wno-format \ |
---|
| 10 | + -Wno-reorder \ |
---|
| 11 | + -Wno-unused-function \ |
---|
| 12 | + -Wno-unused-parameter \ |
---|
| 13 | + -Wno-unused-private-field \ |
---|
| 14 | + -Wno-unused-variable \ |
---|
| 15 | + -Wno-unused-parameter |
---|
| 16 | + |
---|
| 17 | +LOCAL_C_INCLUDES += external/libnl/include \ |
---|
| 18 | + $(call include-path-for, libhardware_legacy)/hardware_legacy \ |
---|
| 19 | + external/wpa_supplicant_8/src/drivers \ |
---|
| 20 | + external/boringssl/include \ |
---|
| 21 | + external/boringssl/src/crypto/digest \ |
---|
| 22 | + external/boringssl/src/crypto/evp/ |
---|
| 23 | + |
---|
| 24 | +LOCAL_HEADER_LIBRARIES := libutils_headers liblog_headers |
---|
| 25 | + |
---|
| 26 | +LOCAL_SRC_FILES := main.cpp \ |
---|
| 27 | + wifi_command.cpp |
---|
| 28 | + |
---|
| 29 | +LOCAL_MODULE := libwifi-hal-skw |
---|
| 30 | +LOCAL_PROPRIETARY_MODULE := true |
---|
| 31 | +#LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0 |
---|
| 32 | +#LOCAL_LICENSE_CONDITIONS := notice |
---|
| 33 | +#LOCAL_NOTICE_FILE := $(LOCAL_PATH)/NOTICE |
---|
| 34 | + |
---|
| 35 | +include $(BUILD_STATIC_LIBRARY) |
---|
| 36 | + |
---|
.. | .. |
---|
| 1 | + |
---|
| 2 | +Copyright (c) 2005-2010, The Android Open Source Project |
---|
| 3 | +All rights reserved. |
---|
| 4 | + |
---|
| 5 | +Redistribution and use in source and binary forms, with or without |
---|
| 6 | +modification, are permitted provided that the following conditions |
---|
| 7 | +are met: |
---|
| 8 | + * Redistributions of source code must retain the above copyright |
---|
| 9 | + notice, this list of conditions and the following disclaimer. |
---|
| 10 | + * Redistributions in binary form must reproduce the above copyright |
---|
| 11 | + notice, this list of conditions and the following disclaimer in |
---|
| 12 | + the documentation and/or other materials provided with the |
---|
| 13 | + distribution. |
---|
| 14 | + * Neither the name of The Android Open Source Project nor the names |
---|
| 15 | + of its contributors may be used to endorse or promote products |
---|
| 16 | + derived from this software without specific prior written |
---|
| 17 | + permission. |
---|
| 18 | + |
---|
| 19 | +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
---|
| 20 | +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
---|
| 21 | +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS |
---|
| 22 | +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE |
---|
| 23 | +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, |
---|
| 24 | +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, |
---|
| 25 | +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS |
---|
| 26 | +OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED |
---|
| 27 | +AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
---|
| 28 | +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT |
---|
| 29 | +OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
---|
| 30 | +SUCH DAMAGE. |
---|
| 31 | + |
---|
| 32 | + * Copyright (c) 2002-2010, Jouni Malinen <j@w1.fi> |
---|
| 33 | + * Copyright (c) 2003-2004, Instant802 Networks, Inc. |
---|
| 34 | + * Copyright (c) 2005-2006, Devicescape Software, Inc. |
---|
| 35 | + * Copyright (c) 2007, Johannes Berg <johannes@sipsolutions.net> |
---|
| 36 | + * Copyright (c) 2009-2010, Atheros Communications |
---|
| 37 | + * |
---|
| 38 | + * This program is free software; you can redistribute it and/or modify |
---|
| 39 | + * it under the terms of the GNU General Public License version 2 as |
---|
| 40 | + * published by the Free Software Foundation. |
---|
| 41 | + * |
---|
| 42 | + * Alternatively, this software may be distributed under the terms of BSD |
---|
| 43 | + * license. |
---|
.. | .. |
---|
| 1 | +/* |
---|
| 2 | + * Copyright (C) 2017 The Android Open Source Project |
---|
| 3 | + * |
---|
| 4 | + * Portions copyright (C) 2017 |
---|
| 5 | + * |
---|
| 6 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
---|
| 7 | + * you may not use this file except in compliance with the License. |
---|
| 8 | + * You may obtain a copy of the License at |
---|
| 9 | + * |
---|
| 10 | + * http://www.apache.org/licenses/LICENSE-2.0 |
---|
| 11 | + * |
---|
| 12 | + * Unless required by applicable law or agreed to in writing, software |
---|
| 13 | + * distributed under the License is distributed on an "AS IS" BASIS, |
---|
| 14 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
---|
| 15 | + * See the License for the specific language governing permissions and |
---|
| 16 | + * limitations under the License. |
---|
| 17 | + */ |
---|
| 18 | + |
---|
| 19 | +#include <errno.h> |
---|
| 20 | +#include <netlink/netlink.h> |
---|
| 21 | +#include <netlink/genl/genl.h> |
---|
| 22 | +#include <netlink/genl/ctrl.h> |
---|
| 23 | +#include <sys/types.h> |
---|
| 24 | +#include <unistd.h> |
---|
| 25 | + |
---|
| 26 | +#include "main.h" |
---|
| 27 | +#include "wifi_command.h" |
---|
| 28 | + |
---|
| 29 | +#define SKW_BUFF_SIZE 256 |
---|
| 30 | +#define WIFI_HAL_SOCK_DEFAULT_PORT 644 |
---|
| 31 | +#define WIFI_HAL_SOCK_EVENT_PORT 645 |
---|
| 32 | +#define SOCK_BUFF_SIZE 0x40000 |
---|
| 33 | + |
---|
| 34 | +struct nl_sock *getSock(wifi_interface_handle handle) |
---|
| 35 | +{ |
---|
| 36 | + interface_info *info = (interface_info *)handle; |
---|
| 37 | + |
---|
| 38 | + return ((hal_info *)info->hal_handle)->nl_hal; |
---|
| 39 | +} |
---|
| 40 | + |
---|
| 41 | +int getFamily(wifi_interface_handle handle) |
---|
| 42 | +{ |
---|
| 43 | + interface_info *info = (interface_info *)handle; |
---|
| 44 | + |
---|
| 45 | + return ((hal_info *)info->hal_handle)->family_nl80211; |
---|
| 46 | +} |
---|
| 47 | + |
---|
| 48 | +void skw_wifi_get_error_info(wifi_error error, const char **chr) |
---|
| 49 | +{ |
---|
| 50 | + ALOGD("%s", __func__); |
---|
| 51 | +} |
---|
| 52 | + |
---|
| 53 | +wifi_error skw_wifi_get_supported_feature_set(wifi_interface_handle handle, feature_set *feature) |
---|
| 54 | +{ |
---|
| 55 | + |
---|
| 56 | + ALOGD("%s, feature: 0x%x", __func__, *feature); |
---|
| 57 | + |
---|
| 58 | + *feature = 0; |
---|
| 59 | + |
---|
| 60 | + return WIFI_SUCCESS; |
---|
| 61 | +} |
---|
| 62 | + |
---|
| 63 | +wifi_error skw_wifi_get_concurrency_matrix(wifi_interface_handle handle, int count, |
---|
| 64 | + feature_set *feature, int *args) |
---|
| 65 | +{ |
---|
| 66 | + ALOGD("%s", __func__); |
---|
| 67 | + |
---|
| 68 | + return WIFI_SUCCESS; |
---|
| 69 | +} |
---|
| 70 | + |
---|
| 71 | +wifi_error skw_wifi_set_scanning_mac_oui(wifi_interface_handle handle, unsigned char *oui) |
---|
| 72 | +{ |
---|
| 73 | + ALOGD("%s", __func__); |
---|
| 74 | + |
---|
| 75 | + return WIFI_SUCCESS; |
---|
| 76 | +} |
---|
| 77 | + |
---|
| 78 | +wifi_error skw_wifi_get_supported_channels(wifi_handle handle, int *num, wifi_channel *channels) |
---|
| 79 | +{ |
---|
| 80 | + ALOGD("%s", __func__); |
---|
| 81 | + |
---|
| 82 | + return WIFI_SUCCESS; |
---|
| 83 | +} |
---|
| 84 | + |
---|
| 85 | +wifi_error skw_wifi_is_epr_supported(wifi_handle handle) |
---|
| 86 | +{ |
---|
| 87 | + ALOGD("%s", __func__); |
---|
| 88 | + |
---|
| 89 | + return WIFI_SUCCESS; |
---|
| 90 | +} |
---|
| 91 | + |
---|
| 92 | +class GetInterfacesCommand : public WifiCommand { |
---|
| 93 | +private: |
---|
| 94 | + int index; |
---|
| 95 | + interface_info ifaces[SKW_NR_IFACE]; |
---|
| 96 | + |
---|
| 97 | +public: |
---|
| 98 | + GetInterfacesCommand(struct nl_sock *sk, int family, int flags, int nl80211_cmd) |
---|
| 99 | + : WifiCommand(sk, family, flags, nl80211_cmd) |
---|
| 100 | + { |
---|
| 101 | + index = 0; |
---|
| 102 | + memset(ifaces, 0x0, sizeof(interface_info)); |
---|
| 103 | + } |
---|
| 104 | + |
---|
| 105 | + virtual wifi_error build(wifi_interface_handle handle, void *param) |
---|
| 106 | + { |
---|
| 107 | + return WIFI_SUCCESS; |
---|
| 108 | + } |
---|
| 109 | + |
---|
| 110 | + virtual wifi_error parser(struct nlattr *attr[NL80211_ATTR_MAX]) |
---|
| 111 | + { |
---|
| 112 | + if (attr[NL80211_ATTR_IFINDEX]) |
---|
| 113 | + ifaces[index].iface_idx = nla_get_u32(attr[NL80211_ATTR_IFINDEX]); |
---|
| 114 | + else |
---|
| 115 | + ifaces[index].wdev_idx = nla_get_u32(attr[NL80211_ATTR_WDEV]); |
---|
| 116 | + |
---|
| 117 | + if (attr[NL80211_ATTR_IFNAME]) |
---|
| 118 | + strcpy(ifaces[index].name, nla_get_string(attr[NL80211_ATTR_IFNAME])); |
---|
| 119 | + |
---|
| 120 | + index++; |
---|
| 121 | + |
---|
| 122 | + return WIFI_SUCCESS; |
---|
| 123 | + } |
---|
| 124 | + |
---|
| 125 | + int getIfaceNum() |
---|
| 126 | + { |
---|
| 127 | + return index; |
---|
| 128 | + } |
---|
| 129 | + |
---|
| 130 | + interface_info *iface(int idx) |
---|
| 131 | + { |
---|
| 132 | + return &ifaces[idx]; |
---|
| 133 | + } |
---|
| 134 | +}; |
---|
| 135 | + |
---|
| 136 | +wifi_error skw_wifi_get_ifaces(wifi_handle handle, int *num, wifi_interface_handle **iface_handle) |
---|
| 137 | +{ |
---|
| 138 | + int i; |
---|
| 139 | + hal_info *hal = (hal_info *)handle; |
---|
| 140 | + GetInterfacesCommand cmd(hal->nl_hal, hal->family_nl80211, NLM_F_DUMP, NL80211_CMD_GET_INTERFACE); |
---|
| 141 | + |
---|
| 142 | + memset(hal->interfaces, 0x0, sizeof(hal->interfaces)); |
---|
| 143 | + |
---|
| 144 | + cmd.build(NULL, NULL); |
---|
| 145 | + cmd.send(); |
---|
| 146 | + |
---|
| 147 | + if (cmd.getIfaceNum() == 0) |
---|
| 148 | + return WIFI_ERROR_UNKNOWN; |
---|
| 149 | + |
---|
| 150 | + hal->nr_interfaces = cmd.getIfaceNum(); |
---|
| 151 | + |
---|
| 152 | + for (i = 0; i < hal->nr_interfaces; i++) { |
---|
| 153 | + strcpy(hal->interfaces[i].name, cmd.iface(i)->name); |
---|
| 154 | + hal->interfaces[i].iface_idx = cmd.iface(i)->iface_idx; |
---|
| 155 | + hal->interfaces[i].wdev_idx = cmd.iface(i)->wdev_idx; |
---|
| 156 | + hal->interfaces[i].hal_handle = handle; |
---|
| 157 | + |
---|
| 158 | + hal->interface_handle[i] = (wifi_interface_handle)(&hal->interfaces[i]); |
---|
| 159 | + } |
---|
| 160 | + |
---|
| 161 | + *iface_handle = &hal->interface_handle[0]; |
---|
| 162 | + *num = hal->nr_interfaces; |
---|
| 163 | + |
---|
| 164 | + return WIFI_SUCCESS; |
---|
| 165 | +} |
---|
| 166 | + |
---|
| 167 | +wifi_error skw_wifi_get_iface_name(wifi_interface_handle handle, char *name, size_t size) |
---|
| 168 | +{ |
---|
| 169 | + interface_info *iface = (interface_info *)handle; |
---|
| 170 | + |
---|
| 171 | + ALOGD("%s: name: %s", __func__, iface->name); |
---|
| 172 | + |
---|
| 173 | + strncpy(name, iface->name, size); |
---|
| 174 | + |
---|
| 175 | + return WIFI_SUCCESS; |
---|
| 176 | +} |
---|
| 177 | + |
---|
| 178 | +wifi_error skw_wifi_set_iface_event_handler(wifi_request_id,wifi_interface_handle , |
---|
| 179 | + wifi_event_handler) |
---|
| 180 | +{ |
---|
| 181 | + ALOGD("%s", __func__); |
---|
| 182 | + |
---|
| 183 | + return WIFI_SUCCESS; |
---|
| 184 | +} |
---|
| 185 | + |
---|
| 186 | +wifi_error skw_wifi_reset_iface_event_handler(wifi_request_id, wifi_interface_handle) |
---|
| 187 | +{ |
---|
| 188 | + ALOGD("%s", __func__); |
---|
| 189 | + |
---|
| 190 | + return WIFI_SUCCESS; |
---|
| 191 | +} |
---|
| 192 | + |
---|
| 193 | +wifi_error skw_wifi_start_gscan(wifi_request_id id, wifi_interface_handle iface, |
---|
| 194 | + wifi_scan_cmd_params params, wifi_scan_result_handler handler) |
---|
| 195 | +{ |
---|
| 196 | + ALOGD("%s", __func__); |
---|
| 197 | + |
---|
| 198 | + return WIFI_SUCCESS; |
---|
| 199 | +} |
---|
| 200 | + |
---|
| 201 | +wifi_error skw_wifi_stop_gscan(wifi_request_id, wifi_interface_handle) |
---|
| 202 | +{ |
---|
| 203 | + ALOGD("%s", __func__); |
---|
| 204 | + |
---|
| 205 | + return WIFI_SUCCESS; |
---|
| 206 | +} |
---|
| 207 | + |
---|
| 208 | +wifi_error skw_wifi_get_cached_gscan_results(wifi_interface_handle, byte, int, |
---|
| 209 | + wifi_cached_scan_results *results, int *) |
---|
| 210 | +{ |
---|
| 211 | + ALOGD("%s", __func__); |
---|
| 212 | + |
---|
| 213 | + return WIFI_SUCCESS; |
---|
| 214 | +} |
---|
| 215 | + |
---|
| 216 | +wifi_error skw_wifi_set_bssid_hotlist(wifi_request_id, wifi_interface_handle, |
---|
| 217 | + wifi_bssid_hotlist_params, wifi_hotlist_ap_found_handler) |
---|
| 218 | +{ |
---|
| 219 | + ALOGD("%s", __func__); |
---|
| 220 | + |
---|
| 221 | + return WIFI_SUCCESS; |
---|
| 222 | +} |
---|
| 223 | + |
---|
| 224 | +wifi_error skw_wifi_reset_bssid_hotlist(wifi_request_id, wifi_interface_handle) |
---|
| 225 | +{ |
---|
| 226 | + ALOGD("%s", __func__); |
---|
| 227 | + |
---|
| 228 | + return WIFI_SUCCESS; |
---|
| 229 | +} |
---|
| 230 | + |
---|
| 231 | +wifi_error skw_wifi_set_significant_change_handler(wifi_request_id, wifi_interface_handle, |
---|
| 232 | + wifi_significant_change_params, wifi_significant_change_handler) |
---|
| 233 | +{ |
---|
| 234 | + ALOGD("%s", __func__); |
---|
| 235 | + |
---|
| 236 | + return WIFI_SUCCESS; |
---|
| 237 | +} |
---|
| 238 | + |
---|
| 239 | +wifi_error skw_wifi_reset_significant_change_handler(wifi_request_id id, wifi_interface_handle iface) |
---|
| 240 | +{ |
---|
| 241 | + ALOGD("%s", __func__); |
---|
| 242 | + |
---|
| 243 | + return WIFI_SUCCESS; |
---|
| 244 | +} |
---|
| 245 | + |
---|
| 246 | +wifi_error skw_wifi_get_gscan_capabilities(wifi_interface_handle iface, wifi_gscan_capabilities *capa) |
---|
| 247 | +{ |
---|
| 248 | + ALOGD("%s", __func__); |
---|
| 249 | + |
---|
| 250 | + return WIFI_SUCCESS; |
---|
| 251 | +} |
---|
| 252 | + |
---|
| 253 | +wifi_error skw_wifi_set_link_stats(wifi_interface_handle iface, wifi_link_layer_params params) |
---|
| 254 | +{ |
---|
| 255 | + ALOGD("%s", __func__); |
---|
| 256 | + |
---|
| 257 | + return WIFI_SUCCESS; |
---|
| 258 | +} |
---|
| 259 | + |
---|
| 260 | +wifi_error skw_wifi_get_link_stats(wifi_request_id id, wifi_interface_handle handle, |
---|
| 261 | + wifi_stats_result_handler result_handler) |
---|
| 262 | +{ |
---|
| 263 | + ALOGD("%s", __func__); |
---|
| 264 | + |
---|
| 265 | + return WIFI_SUCCESS; |
---|
| 266 | +} |
---|
| 267 | + |
---|
| 268 | +wifi_error skw_wifi_clear_link_stats(wifi_interface_handle,u32, u32 *, u8, u8 *) |
---|
| 269 | +{ |
---|
| 270 | + ALOGD("%s", __func__); |
---|
| 271 | + |
---|
| 272 | + return WIFI_SUCCESS; |
---|
| 273 | +} |
---|
| 274 | + |
---|
| 275 | +class GetValidChannelsCommand : public WifiCommand { |
---|
| 276 | +private: |
---|
| 277 | + wifi_channel *mChannels; |
---|
| 278 | + int max_channels, nr_channels; |
---|
| 279 | + |
---|
| 280 | +public: |
---|
| 281 | + GetValidChannelsCommand(struct nl_sock *sk, int family, int flags, int nl80211_cmd, |
---|
| 282 | + wifi_channel *channels, int max_chans) : WifiCommand(sk, family, flags, nl80211_cmd) |
---|
| 283 | + { |
---|
| 284 | + nr_channels = 0; |
---|
| 285 | + mChannels = channels; |
---|
| 286 | + max_channels = max_chans; |
---|
| 287 | + memset(channels, 0x0, max_chans * sizeof(*channels)); |
---|
| 288 | + } |
---|
| 289 | + |
---|
| 290 | + virtual wifi_error build(wifi_interface_handle handle, void *param) |
---|
| 291 | + { |
---|
| 292 | +#define SKW_ATTR_BAND 20 |
---|
| 293 | + struct nlattr *data; |
---|
| 294 | + interface_info *iface = (interface_info *)handle; |
---|
| 295 | + put_u32(NL80211_ATTR_VENDOR_ID, OUI_GOOGLE); |
---|
| 296 | + put_u32(NL80211_ATTR_VENDOR_SUBCMD, SKW_VCMD_GET_CHANNELS); |
---|
| 297 | + |
---|
| 298 | + if (iface->wdev_idx) |
---|
| 299 | + put_u32(NL80211_ATTR_WDEV, iface->wdev_idx); |
---|
| 300 | + else |
---|
| 301 | + put_u32(NL80211_ATTR_IFINDEX, iface->iface_idx); |
---|
| 302 | + |
---|
| 303 | + data =attr_start(); |
---|
| 304 | + |
---|
| 305 | + put_u32(SKW_ATTR_BAND, *(int *)param); |
---|
| 306 | + |
---|
| 307 | + attr_end(data); |
---|
| 308 | + |
---|
| 309 | + return WIFI_SUCCESS; |
---|
| 310 | + } |
---|
| 311 | + |
---|
| 312 | + virtual wifi_error parser(struct nlattr *attr[NL80211_ATTR_MAX]) |
---|
| 313 | + { |
---|
| 314 | +#define SKW_ATTR_NR_CAHNNELS 36 |
---|
| 315 | +#define SKW_ATTR_VALID_CHANNELS 37 |
---|
| 316 | + int left, type; |
---|
| 317 | + struct nlattr *nla; |
---|
| 318 | + struct nlattr *data = attr[NL80211_ATTR_VENDOR_DATA]; |
---|
| 319 | + |
---|
| 320 | + if (!data) |
---|
| 321 | + return WIFI_ERROR_NOT_AVAILABLE; |
---|
| 322 | + |
---|
| 323 | + nla_for_each_attr(nla, (struct nlattr *)nla_data(data), nla_len(data), left) { |
---|
| 324 | + type = nla_type(nla); |
---|
| 325 | + switch (type) { |
---|
| 326 | + case SKW_ATTR_NR_CAHNNELS: |
---|
| 327 | + nr_channels = nla_get_u32(nla); |
---|
| 328 | + break; |
---|
| 329 | + |
---|
| 330 | + case SKW_ATTR_VALID_CHANNELS: |
---|
| 331 | + memcpy(mChannels, nla_data(nla), nla_len(nla)); |
---|
| 332 | + break; |
---|
| 333 | + |
---|
| 334 | + default: |
---|
| 335 | + break; |
---|
| 336 | + } |
---|
| 337 | + } |
---|
| 338 | + |
---|
| 339 | + return WIFI_SUCCESS; |
---|
| 340 | + } |
---|
| 341 | + |
---|
| 342 | + int numChannels() |
---|
| 343 | + { |
---|
| 344 | + return nr_channels; |
---|
| 345 | + } |
---|
| 346 | +}; |
---|
| 347 | + |
---|
| 348 | +wifi_error skw_wifi_get_valid_channels(wifi_interface_handle iface, int band, |
---|
| 349 | + int max_channels, wifi_channel *channels, int *num_channels) |
---|
| 350 | +{ |
---|
| 351 | + int i; |
---|
| 352 | + wifi_error err = WIFI_ERROR_UNKNOWN; |
---|
| 353 | + |
---|
| 354 | + GetValidChannelsCommand cmd(getSock(iface), getFamily(iface), 0, NL80211_CMD_VENDOR, channels, max_channels); |
---|
| 355 | + |
---|
| 356 | + cmd.build(iface, &band); |
---|
| 357 | + err = cmd.send(); |
---|
| 358 | + |
---|
| 359 | + *num_channels = cmd.numChannels(); |
---|
| 360 | + |
---|
| 361 | + ALOGD("%s, BAND: %d, nr channels: %d", __func__, band, *num_channels); |
---|
| 362 | + |
---|
| 363 | + return err; |
---|
| 364 | +} |
---|
| 365 | + |
---|
| 366 | +wifi_error skw_wifi_rtt_range_request(wifi_request_id, wifi_interface_handle, unsigned, |
---|
| 367 | + wifi_rtt_config[], wifi_rtt_event_handler) |
---|
| 368 | +{ |
---|
| 369 | + ALOGD("%s", __func__); |
---|
| 370 | + |
---|
| 371 | + return WIFI_SUCCESS; |
---|
| 372 | +} |
---|
| 373 | + |
---|
| 374 | +wifi_error skw_wifi_rtt_range_cancel(wifi_request_id id, wifi_interface_handle iface, |
---|
| 375 | + unsigned range, mac_addr addr[]) |
---|
| 376 | +{ |
---|
| 377 | + ALOGD("%s", __func__); |
---|
| 378 | + |
---|
| 379 | + return WIFI_SUCCESS; |
---|
| 380 | +} |
---|
| 381 | + |
---|
| 382 | +wifi_error skw_wifi_get_rtt_capabilities(wifi_interface_handle handle, wifi_rtt_capabilities *capa) |
---|
| 383 | +{ |
---|
| 384 | + ALOGD("%s", __func__); |
---|
| 385 | + |
---|
| 386 | + return WIFI_SUCCESS; |
---|
| 387 | +} |
---|
| 388 | + |
---|
| 389 | +wifi_error skw_wifi_rtt_get_responder_info(wifi_interface_handle iface, |
---|
| 390 | + wifi_rtt_responder *responder_info) |
---|
| 391 | +{ |
---|
| 392 | + ALOGD("%s", __func__); |
---|
| 393 | + |
---|
| 394 | + return WIFI_SUCCESS; |
---|
| 395 | +} |
---|
| 396 | + |
---|
| 397 | +wifi_error skw_wifi_enable_responder(wifi_request_id id, wifi_interface_handle iface, |
---|
| 398 | + wifi_channel_info channel_hint, unsigned max_duration_seconds, |
---|
| 399 | + wifi_rtt_responder *responder_info) |
---|
| 400 | +{ |
---|
| 401 | + ALOGD("%s", __func__); |
---|
| 402 | + |
---|
| 403 | + return WIFI_SUCCESS; |
---|
| 404 | +} |
---|
| 405 | + |
---|
| 406 | +wifi_error skw_wifi_disable_responder(wifi_request_id id, wifi_interface_handle iface) |
---|
| 407 | +{ |
---|
| 408 | + ALOGD("%s", __func__); |
---|
| 409 | + |
---|
| 410 | + return WIFI_SUCCESS; |
---|
| 411 | +} |
---|
| 412 | + |
---|
| 413 | +wifi_error skw_wifi_set_nodfs_flag(wifi_interface_handle, u32) |
---|
| 414 | +{ |
---|
| 415 | + ALOGD("%s", __func__); |
---|
| 416 | + |
---|
| 417 | + return WIFI_SUCCESS; |
---|
| 418 | +} |
---|
| 419 | + |
---|
| 420 | +wifi_error skw_wifi_start_logging(wifi_interface_handle, u32, u32, u32, u32, char *) |
---|
| 421 | +{ |
---|
| 422 | + ALOGD("%s", __func__); |
---|
| 423 | + |
---|
| 424 | + return WIFI_SUCCESS; |
---|
| 425 | +} |
---|
| 426 | + |
---|
| 427 | +wifi_error skw_wifi_set_epno_list(wifi_request_id, wifi_interface_handle, |
---|
| 428 | + const wifi_epno_params *, wifi_epno_handler) |
---|
| 429 | +{ |
---|
| 430 | + ALOGD("%s", __func__); |
---|
| 431 | + |
---|
| 432 | + return WIFI_SUCCESS; |
---|
| 433 | +} |
---|
| 434 | + |
---|
| 435 | +wifi_error skw_wifi_reset_epno_list(wifi_request_id, wifi_interface_handle) |
---|
| 436 | +{ |
---|
| 437 | + ALOGD("%s", __func__); |
---|
| 438 | + |
---|
| 439 | + return WIFI_SUCCESS; |
---|
| 440 | +} |
---|
| 441 | + |
---|
| 442 | +class SetCountryCodeCommand : public WifiCommand { |
---|
| 443 | +public: |
---|
| 444 | + SetCountryCodeCommand(struct nl_sock *sk, int family, int flags, int nl80211_cmd) |
---|
| 445 | + : WifiCommand(sk, family, flags, nl80211_cmd) |
---|
| 446 | + { |
---|
| 447 | + } |
---|
| 448 | + |
---|
| 449 | + virtual wifi_error build(wifi_interface_handle handle, void *param) |
---|
| 450 | + { |
---|
| 451 | + struct nlattr *data; |
---|
| 452 | + interface_info *iface = (interface_info *)handle; |
---|
| 453 | + |
---|
| 454 | + put_u32(NL80211_ATTR_VENDOR_ID, OUI_GOOGLE); |
---|
| 455 | + put_u32(NL80211_ATTR_VENDOR_SUBCMD, SKW_VCMD_SET_COUNTRY); |
---|
| 456 | + |
---|
| 457 | + if (iface->wdev_idx) |
---|
| 458 | + put_u32(NL80211_ATTR_WDEV, iface->wdev_idx); |
---|
| 459 | + else |
---|
| 460 | + put_u32(NL80211_ATTR_IFINDEX, iface->iface_idx); |
---|
| 461 | + |
---|
| 462 | + data =attr_start(); |
---|
| 463 | + |
---|
| 464 | + put_string(5, (const char *)param); |
---|
| 465 | + |
---|
| 466 | + attr_end(data); |
---|
| 467 | + |
---|
| 468 | + return WIFI_SUCCESS; |
---|
| 469 | + } |
---|
| 470 | + |
---|
| 471 | + virtual wifi_error parser(struct nlattr *attr[NL80211_ATTR_MAX]) |
---|
| 472 | + { |
---|
| 473 | + return WIFI_SUCCESS; |
---|
| 474 | + } |
---|
| 475 | +}; |
---|
| 476 | + |
---|
| 477 | +static wifi_error skw_wifi_set_country_code(wifi_interface_handle handle, const char *country) |
---|
| 478 | +{ |
---|
| 479 | + SetCountryCodeCommand cmd(getSock(handle), getFamily(handle), 0, NL80211_CMD_VENDOR); |
---|
| 480 | + |
---|
| 481 | + ALOGD("%s, country: %s", __func__, country); |
---|
| 482 | + |
---|
| 483 | + cmd.build(handle, (void *)country); |
---|
| 484 | + |
---|
| 485 | + return cmd.send(); |
---|
| 486 | +} |
---|
| 487 | + |
---|
| 488 | +wifi_error skw_wifi_get_firmware_memory_dump( wifi_interface_handle iface, |
---|
| 489 | + wifi_firmware_memory_dump_handler handler) |
---|
| 490 | +{ |
---|
| 491 | + ALOGD("%s", __func__); |
---|
| 492 | + |
---|
| 493 | + return WIFI_ERROR_NOT_SUPPORTED; |
---|
| 494 | +} |
---|
| 495 | + |
---|
| 496 | +wifi_error skw_wifi_set_log_handler(wifi_request_id id, wifi_interface_handle iface, |
---|
| 497 | + wifi_ring_buffer_data_handler handler) |
---|
| 498 | +{ |
---|
| 499 | + ALOGD("%s", __func__); |
---|
| 500 | + |
---|
| 501 | + return WIFI_SUCCESS; |
---|
| 502 | +} |
---|
| 503 | + |
---|
| 504 | +wifi_error skw_wifi_reset_log_handler(wifi_request_id id, wifi_interface_handle iface) |
---|
| 505 | +{ |
---|
| 506 | + ALOGD("%s", __func__); |
---|
| 507 | + |
---|
| 508 | + return WIFI_SUCCESS; |
---|
| 509 | +} |
---|
| 510 | + |
---|
| 511 | +wifi_error skw_wifi_set_alert_handler(wifi_request_id id, wifi_interface_handle iface, |
---|
| 512 | + wifi_alert_handler handler) |
---|
| 513 | +{ |
---|
| 514 | + ALOGD("%s", __func__); |
---|
| 515 | + |
---|
| 516 | + return WIFI_SUCCESS; |
---|
| 517 | +} |
---|
| 518 | + |
---|
| 519 | +wifi_error skw_wifi_reset_alert_handler(wifi_request_id id, wifi_interface_handle iface) |
---|
| 520 | +{ |
---|
| 521 | + ALOGD("%s", __func__); |
---|
| 522 | + |
---|
| 523 | + return WIFI_SUCCESS; |
---|
| 524 | +} |
---|
| 525 | + |
---|
| 526 | +class GetVersionCommand : public WifiCommand { |
---|
| 527 | +private: |
---|
| 528 | + char buff[SKW_BUFF_SIZE]; |
---|
| 529 | + |
---|
| 530 | +public: |
---|
| 531 | + GetVersionCommand(struct nl_sock *sk, int family, int flags, int cmd) |
---|
| 532 | + : WifiCommand(sk, family, flags, cmd) |
---|
| 533 | + { |
---|
| 534 | + memset(buff, 0x0, sizeof(buff)); |
---|
| 535 | + } |
---|
| 536 | + |
---|
| 537 | + virtual wifi_error build(wifi_interface_handle handle, void *param) |
---|
| 538 | + { |
---|
| 539 | + struct nlattr *data; |
---|
| 540 | + interface_info *info = (interface_info *)handle; |
---|
| 541 | + |
---|
| 542 | + put_u32(NL80211_ATTR_VENDOR_ID, OUI_GOOGLE); |
---|
| 543 | + put_u32(NL80211_ATTR_VENDOR_SUBCMD, SKW_VCMD_GET_VERSION); |
---|
| 544 | + |
---|
| 545 | + if (info->wdev_idx) |
---|
| 546 | + put_u32(NL80211_ATTR_WDEV, info->wdev_idx); |
---|
| 547 | + else |
---|
| 548 | + put_u32(NL80211_ATTR_IFINDEX, info->iface_idx); |
---|
| 549 | + |
---|
| 550 | + data =attr_start(); |
---|
| 551 | + |
---|
| 552 | + put_u32(*(int *)param, 0); |
---|
| 553 | + |
---|
| 554 | + attr_end(data); |
---|
| 555 | + |
---|
| 556 | + return WIFI_SUCCESS; |
---|
| 557 | + } |
---|
| 558 | + |
---|
| 559 | + virtual wifi_error parser(struct nlattr *attr[NL80211_ATTR_MAX]) |
---|
| 560 | + { |
---|
| 561 | + if (attr[NL80211_ATTR_VENDOR_DATA]) |
---|
| 562 | + strncpy(buff, (char *)nla_data(attr[NL80211_ATTR_VENDOR_DATA]), sizeof(buff)); |
---|
| 563 | + |
---|
| 564 | + return WIFI_SUCCESS; |
---|
| 565 | + } |
---|
| 566 | + |
---|
| 567 | + char *getVersion() |
---|
| 568 | + { |
---|
| 569 | + return buff; |
---|
| 570 | + } |
---|
| 571 | +}; |
---|
| 572 | + |
---|
| 573 | + |
---|
| 574 | +wifi_error skw_wifi_get_firmware_version(wifi_interface_handle iface, |
---|
| 575 | + char *buffer, int buffer_size) |
---|
| 576 | +{ |
---|
| 577 | + int subcmd = SKW_FW_VERSION; |
---|
| 578 | + wifi_error err = WIFI_ERROR_UNKNOWN; |
---|
| 579 | + GetVersionCommand cmd(getSock(iface), getFamily(iface), 0, NL80211_CMD_VENDOR); |
---|
| 580 | + |
---|
| 581 | + cmd.build(iface, &subcmd); |
---|
| 582 | + err = cmd.send(); |
---|
| 583 | + |
---|
| 584 | + strncpy(buffer, cmd.getVersion(), buffer_size); |
---|
| 585 | + |
---|
| 586 | + ALOGD("%s: %s", __func__, buffer); |
---|
| 587 | + |
---|
| 588 | + return err; |
---|
| 589 | +} |
---|
| 590 | + |
---|
| 591 | +class GetRingBuffStatus : public WifiCommand |
---|
| 592 | +{ |
---|
| 593 | +private: |
---|
| 594 | + u32 *num; |
---|
| 595 | + wifi_ring_buffer_status *mStatus; |
---|
| 596 | + |
---|
| 597 | +public: |
---|
| 598 | + GetRingBuffStatus(struct nl_sock *sk, int family, int flags, |
---|
| 599 | + int nl80211_cmd, u32 *num_rings, wifi_ring_buffer_status *status) |
---|
| 600 | + : WifiCommand(sk, family, flags, nl80211_cmd) |
---|
| 601 | + { |
---|
| 602 | + *num_rings = 0; |
---|
| 603 | + num = num_rings; |
---|
| 604 | + mStatus = status; |
---|
| 605 | + } |
---|
| 606 | + |
---|
| 607 | + virtual wifi_error build(wifi_interface_handle handle, void *param) |
---|
| 608 | + { |
---|
| 609 | + interface_info *iface = (interface_info *)handle; |
---|
| 610 | + |
---|
| 611 | + put_u32(NL80211_ATTR_VENDOR_ID, OUI_GOOGLE); |
---|
| 612 | + put_u32(NL80211_ATTR_VENDOR_SUBCMD, SKW_VCMD_GET_RING_BUFFERS_STATUS); |
---|
| 613 | + |
---|
| 614 | + if (iface->wdev_idx) |
---|
| 615 | + put_u32(NL80211_ATTR_WDEV, iface->wdev_idx); |
---|
| 616 | + else |
---|
| 617 | + put_u32(NL80211_ATTR_IFINDEX, iface->iface_idx); |
---|
| 618 | + |
---|
| 619 | + return WIFI_SUCCESS; |
---|
| 620 | + |
---|
| 621 | + } |
---|
| 622 | + |
---|
| 623 | + virtual wifi_error parser(struct nlattr *attr[NL80211_ATTR_MAX]) |
---|
| 624 | + { |
---|
| 625 | + int type, left; |
---|
| 626 | + struct nlattr *nla, *data; |
---|
| 627 | + int i = 0, nr_buff = 0; |
---|
| 628 | +#define SKW_ATTR_RING_BUFFERS_STATUS 13 |
---|
| 629 | +#define SKW_ATTR_NUM_RING_BUFFERS 14 |
---|
| 630 | + |
---|
| 631 | + data = attr[NL80211_ATTR_VENDOR_DATA]; |
---|
| 632 | + if (!data) |
---|
| 633 | + return WIFI_ERROR_NOT_AVAILABLE; |
---|
| 634 | + |
---|
| 635 | + nla_for_each_attr(nla, (struct nlattr *)nla_data(data), nla_len(data), left) { |
---|
| 636 | + type = nla_type(nla); |
---|
| 637 | + switch (type) { |
---|
| 638 | + case SKW_ATTR_NUM_RING_BUFFERS: |
---|
| 639 | + nr_buff = nla_get_u32(nla); |
---|
| 640 | + break; |
---|
| 641 | + |
---|
| 642 | + case SKW_ATTR_RING_BUFFERS_STATUS: |
---|
| 643 | + if (nla_len(nla) == sizeof(wifi_ring_buffer_status)) { |
---|
| 644 | + memcpy(&mStatus[i++], nla_data(nla), nla_len(nla)); |
---|
| 645 | + *num = i; |
---|
| 646 | + } else { |
---|
| 647 | + ALOGE("wifi_ring_buffer_status not match"); |
---|
| 648 | + } |
---|
| 649 | + |
---|
| 650 | + break; |
---|
| 651 | + |
---|
| 652 | + default: |
---|
| 653 | + break; |
---|
| 654 | + } |
---|
| 655 | + } |
---|
| 656 | + |
---|
| 657 | + if (nr_buff != *(int *)num) |
---|
| 658 | + ALOGE("num of ring buffs not match, %d - %d", nr_buff, *num); |
---|
| 659 | + |
---|
| 660 | + return WIFI_SUCCESS; |
---|
| 661 | + } |
---|
| 662 | +}; |
---|
| 663 | + |
---|
| 664 | +// There are no flags for these 3 in the legacy feature set. Adding them to |
---|
| 665 | +// the set because all the current devices support it. |
---|
| 666 | +// *hidl_caps |= HidlChipCaps::DEBUG_RING_BUFFER_VENDOR_DATA; |
---|
| 667 | +// *hidl_caps |= HidlChipCaps::DEBUG_HOST_WAKE_REASON_STATS; |
---|
| 668 | +// *hidl_caps |= HidlChipCaps::DEBUG_ERROR_ALERTS; |
---|
| 669 | +wifi_error skw_wifi_get_ring_buffers_status(wifi_interface_handle iface, |
---|
| 670 | + u32 *num_rings, wifi_ring_buffer_status *status) |
---|
| 671 | +{ |
---|
| 672 | + GetRingBuffStatus cmd(getSock(iface), getFamily(iface), 0, |
---|
| 673 | + NL80211_CMD_VENDOR, num_rings, status); |
---|
| 674 | + cmd.build(iface, NULL); |
---|
| 675 | + cmd.send(); |
---|
| 676 | + |
---|
| 677 | + ALOGD("%s, num rings: %d", __func__, *num_rings); |
---|
| 678 | + |
---|
| 679 | + return WIFI_SUCCESS; |
---|
| 680 | +} |
---|
| 681 | + |
---|
| 682 | +class GetLoggerFeature : public WifiCommand |
---|
| 683 | +{ |
---|
| 684 | +private: |
---|
| 685 | + unsigned int mFeatures; |
---|
| 686 | + |
---|
| 687 | +public: |
---|
| 688 | + GetLoggerFeature(struct nl_sock *sk, int family, int flags, int nl80211_cmd) |
---|
| 689 | + : WifiCommand(sk, family, flags, nl80211_cmd) |
---|
| 690 | + { |
---|
| 691 | + mFeatures = 0; |
---|
| 692 | + } |
---|
| 693 | + |
---|
| 694 | + virtual wifi_error build(wifi_interface_handle handle, void *param) |
---|
| 695 | + { |
---|
| 696 | + interface_info *iface = (interface_info *)handle; |
---|
| 697 | + put_u32(NL80211_ATTR_VENDOR_ID, OUI_GOOGLE); |
---|
| 698 | + put_u32(NL80211_ATTR_VENDOR_SUBCMD, SKW_VCMD_GET_LOGGER_FEATURES); |
---|
| 699 | + |
---|
| 700 | + if (iface->wdev_idx) |
---|
| 701 | + put_u32(NL80211_ATTR_WDEV, iface->wdev_idx); |
---|
| 702 | + else |
---|
| 703 | + put_u32(NL80211_ATTR_IFINDEX, iface->iface_idx); |
---|
| 704 | + |
---|
| 705 | + return WIFI_SUCCESS; |
---|
| 706 | + } |
---|
| 707 | + |
---|
| 708 | + virtual wifi_error parser(struct nlattr *attr[NL80211_ATTR_MAX]) |
---|
| 709 | + { |
---|
| 710 | + struct nlattr *data = attr[NL80211_ATTR_VENDOR_DATA]; |
---|
| 711 | + |
---|
| 712 | + if (!data) |
---|
| 713 | + return WIFI_ERROR_NOT_AVAILABLE; |
---|
| 714 | + |
---|
| 715 | + mFeatures = nla_get_u32(data); |
---|
| 716 | + |
---|
| 717 | + return WIFI_SUCCESS; |
---|
| 718 | + } |
---|
| 719 | + |
---|
| 720 | + int features() |
---|
| 721 | + { |
---|
| 722 | + return mFeatures; |
---|
| 723 | + } |
---|
| 724 | +}; |
---|
| 725 | + |
---|
| 726 | +wifi_error skw_wifi_get_logger_supported_feature_set(wifi_interface_handle iface, |
---|
| 727 | + unsigned int *features) |
---|
| 728 | +{ |
---|
| 729 | + GetLoggerFeature cmd(getSock(iface), getFamily(iface), 0, NL80211_CMD_VENDOR); |
---|
| 730 | + cmd.build(iface, NULL); |
---|
| 731 | + cmd.send(); |
---|
| 732 | + |
---|
| 733 | + *features = cmd.features(); |
---|
| 734 | + |
---|
| 735 | + ALOGD("%s, features: 0x%x", __func__, *features); |
---|
| 736 | + |
---|
| 737 | + return WIFI_SUCCESS; |
---|
| 738 | +} |
---|
| 739 | + |
---|
| 740 | +wifi_error skw_wifi_get_ring_data(wifi_interface_handle iface, char *ring_name) |
---|
| 741 | +{ |
---|
| 742 | + ALOGD("%s", __func__); |
---|
| 743 | + |
---|
| 744 | + return WIFI_SUCCESS; |
---|
| 745 | +} |
---|
| 746 | + |
---|
| 747 | +wifi_error skw_wifi_enable_tdls(wifi_interface_handle, mac_addr, wifi_tdls_params *, |
---|
| 748 | + wifi_tdls_handler) |
---|
| 749 | +{ |
---|
| 750 | + ALOGD("%s", __func__); |
---|
| 751 | + |
---|
| 752 | + return WIFI_SUCCESS; |
---|
| 753 | +} |
---|
| 754 | + |
---|
| 755 | +wifi_error skw_wifi_disable_tdls(wifi_interface_handle, mac_addr) |
---|
| 756 | +{ |
---|
| 757 | + ALOGD("%s", __func__); |
---|
| 758 | + |
---|
| 759 | + return WIFI_SUCCESS; |
---|
| 760 | +} |
---|
| 761 | + |
---|
| 762 | +wifi_error skw_wifi_get_tdls_status(wifi_interface_handle, mac_addr, wifi_tdls_status *) |
---|
| 763 | +{ |
---|
| 764 | + ALOGD("%s", __func__); |
---|
| 765 | + |
---|
| 766 | + return WIFI_SUCCESS; |
---|
| 767 | +} |
---|
| 768 | + |
---|
| 769 | +wifi_error skw_wifi_get_tdls_capabilities(wifi_interface_handle iface, |
---|
| 770 | + wifi_tdls_capabilities *capabilities) |
---|
| 771 | +{ |
---|
| 772 | + ALOGD("%s", __func__); |
---|
| 773 | + |
---|
| 774 | + return WIFI_SUCCESS; |
---|
| 775 | +} |
---|
| 776 | + |
---|
| 777 | +wifi_error skw_wifi_get_driver_version(wifi_interface_handle handle, char *buffer, |
---|
| 778 | + int buffer_size) |
---|
| 779 | +{ |
---|
| 780 | + int subcmd = SKW_DRV_VERSION; |
---|
| 781 | + wifi_error err = WIFI_ERROR_UNKNOWN; |
---|
| 782 | + GetVersionCommand cmd(getSock(handle), getFamily(handle), 0, NL80211_CMD_VENDOR); |
---|
| 783 | + |
---|
| 784 | + if (cmd.build(handle, &subcmd) == WIFI_SUCCESS) |
---|
| 785 | + err = cmd.send(); |
---|
| 786 | + |
---|
| 787 | + if (err == WIFI_SUCCESS) |
---|
| 788 | + strncpy(buffer, cmd.getVersion(), buffer_size); |
---|
| 789 | + |
---|
| 790 | + ALOGD("%s: %s", __func__, buffer); |
---|
| 791 | + |
---|
| 792 | + return err; |
---|
| 793 | +} |
---|
| 794 | + |
---|
| 795 | +wifi_error skw_wifi_set_passpoint_list(wifi_request_id id, wifi_interface_handle iface, |
---|
| 796 | + int num, wifi_passpoint_network *networks, wifi_passpoint_event_handler handler) |
---|
| 797 | +{ |
---|
| 798 | + ALOGD("%s", __func__); |
---|
| 799 | + |
---|
| 800 | + return WIFI_SUCCESS; |
---|
| 801 | +} |
---|
| 802 | + |
---|
| 803 | +wifi_error skw_wifi_reset_passpoint_list(wifi_request_id id, wifi_interface_handle iface) |
---|
| 804 | +{ |
---|
| 805 | + ALOGD("%s", __func__); |
---|
| 806 | + |
---|
| 807 | + return WIFI_SUCCESS; |
---|
| 808 | +} |
---|
| 809 | + |
---|
| 810 | +wifi_error skw_wifi_set_lci(wifi_request_id id, wifi_interface_handle iface, |
---|
| 811 | + wifi_lci_information *lci) |
---|
| 812 | +{ |
---|
| 813 | + ALOGD("%s", __func__); |
---|
| 814 | + |
---|
| 815 | + return WIFI_SUCCESS; |
---|
| 816 | +} |
---|
| 817 | + |
---|
| 818 | +wifi_error skw_wifi_set_lcr(wifi_request_id id, wifi_interface_handle iface, |
---|
| 819 | + wifi_lcr_information *lcr) |
---|
| 820 | +{ |
---|
| 821 | + ALOGD("%s", __func__); |
---|
| 822 | + |
---|
| 823 | + return WIFI_SUCCESS; |
---|
| 824 | +} |
---|
| 825 | + |
---|
| 826 | +#if 0 |
---|
| 827 | +wifi_error skw_wifi_start_sending_offloaded_packet(wifi_request_id id, |
---|
| 828 | + wifi_interface_handle iface, u16 ether_type, u8 *ip_packet, |
---|
| 829 | + u16 ip_packet_len, u8 *src_mac_addr, u8 *dst_mac_addr, |
---|
| 830 | + u32 period_msec) |
---|
| 831 | +{ |
---|
| 832 | + ALOGD("%s", __func__); |
---|
| 833 | + |
---|
| 834 | + return WIFI_SUCCESS; |
---|
| 835 | +} |
---|
| 836 | +#endif |
---|
| 837 | + |
---|
| 838 | +wifi_error skw_wifi_stop_sending_offloaded_packet(wifi_request_id id, |
---|
| 839 | + wifi_interface_handle iface) |
---|
| 840 | +{ |
---|
| 841 | + ALOGD("%s", __func__); |
---|
| 842 | + |
---|
| 843 | + return WIFI_SUCCESS; |
---|
| 844 | +} |
---|
| 845 | + |
---|
| 846 | +wifi_error skw_wifi_start_rssi_monitoring(wifi_request_id id, wifi_interface_handle |
---|
| 847 | + iface, s8 max_rssi, s8 min_rssi, wifi_rssi_event_handler eh) |
---|
| 848 | +{ |
---|
| 849 | + ALOGD("%s", __func__); |
---|
| 850 | + return WIFI_SUCCESS; |
---|
| 851 | +} |
---|
| 852 | + |
---|
| 853 | +wifi_error skw_wifi_stop_rssi_monitoring(wifi_request_id id, wifi_interface_handle iface) |
---|
| 854 | +{ |
---|
| 855 | + ALOGD("%s", __func__); |
---|
| 856 | + |
---|
| 857 | + return WIFI_SUCCESS; |
---|
| 858 | +} |
---|
| 859 | + |
---|
| 860 | +wifi_error skw_wifi_get_wake_reason_stats(wifi_interface_handle iface, |
---|
| 861 | + WLAN_DRIVER_WAKE_REASON_CNT *wifi_wake_reason_cnt) |
---|
| 862 | +{ |
---|
| 863 | + ALOGD("%s", __func__); |
---|
| 864 | + |
---|
| 865 | + return WIFI_SUCCESS; |
---|
| 866 | +} |
---|
| 867 | + |
---|
| 868 | +wifi_error skw_wifi_configure_nd_offload(wifi_interface_handle iface, u8 enable) |
---|
| 869 | +{ |
---|
| 870 | + ALOGD("%s", __func__); |
---|
| 871 | + |
---|
| 872 | + return WIFI_SUCCESS; |
---|
| 873 | +} |
---|
| 874 | + |
---|
| 875 | +wifi_error skw_wifi_get_driver_memory_dump(wifi_interface_handle iface, |
---|
| 876 | + wifi_driver_memory_dump_callbacks callbacks) |
---|
| 877 | +{ |
---|
| 878 | + ALOGD("%s", __func__); |
---|
| 879 | + |
---|
| 880 | + return WIFI_SUCCESS; |
---|
| 881 | +} |
---|
| 882 | + |
---|
| 883 | +wifi_error skw_wifi_start_pkt_fate_monitoring(wifi_interface_handle iface) |
---|
| 884 | +{ |
---|
| 885 | + ALOGD("%s", __func__); |
---|
| 886 | + |
---|
| 887 | + return WIFI_SUCCESS; |
---|
| 888 | +} |
---|
| 889 | + |
---|
| 890 | +wifi_error skw_wifi_get_tx_pkt_fates(wifi_interface_handle handle, |
---|
| 891 | + wifi_tx_report *tx_report_bufs, size_t n_requested_fates, |
---|
| 892 | + size_t *n_provided_fates) |
---|
| 893 | +{ |
---|
| 894 | + ALOGD("%s", __func__); |
---|
| 895 | + |
---|
| 896 | + return WIFI_SUCCESS; |
---|
| 897 | +} |
---|
| 898 | + |
---|
| 899 | +wifi_error skw_wifi_get_rx_pkt_fates(wifi_interface_handle handle, |
---|
| 900 | + wifi_rx_report *rx_report_bufs, size_t n_requested_fates, |
---|
| 901 | + size_t *n_provided_fates) |
---|
| 902 | +{ |
---|
| 903 | + ALOGD("%s", __func__); |
---|
| 904 | + |
---|
| 905 | + return WIFI_SUCCESS; |
---|
| 906 | +} |
---|
| 907 | + |
---|
| 908 | +/* NAN functions */ |
---|
| 909 | +wifi_error skw_wifi_nan_enable_request(transaction_id id, |
---|
| 910 | + wifi_interface_handle iface, NanEnableRequest* msg) |
---|
| 911 | +{ |
---|
| 912 | + ALOGD("%s", __func__); |
---|
| 913 | + |
---|
| 914 | + return WIFI_SUCCESS; |
---|
| 915 | +} |
---|
| 916 | + |
---|
| 917 | +wifi_error skw_wifi_nan_disable_request(transaction_id id, |
---|
| 918 | + wifi_interface_handle iface) |
---|
| 919 | +{ |
---|
| 920 | + ALOGD("%s", __func__); |
---|
| 921 | + |
---|
| 922 | + return WIFI_SUCCESS; |
---|
| 923 | +} |
---|
| 924 | + |
---|
| 925 | +wifi_error skw_wifi_nan_publish_request(transaction_id id, |
---|
| 926 | + wifi_interface_handle iface, NanPublishRequest* msg) |
---|
| 927 | +{ |
---|
| 928 | + ALOGD("%s", __func__); |
---|
| 929 | + |
---|
| 930 | + return WIFI_SUCCESS; |
---|
| 931 | +} |
---|
| 932 | + |
---|
| 933 | +wifi_error skw_wifi_nan_publish_cancel_request(transaction_id id, |
---|
| 934 | + wifi_interface_handle iface, NanPublishCancelRequest* msg) |
---|
| 935 | +{ |
---|
| 936 | + ALOGD("%s", __func__); |
---|
| 937 | + |
---|
| 938 | + return WIFI_SUCCESS; |
---|
| 939 | +} |
---|
| 940 | + |
---|
| 941 | +wifi_error skw_wifi_nan_subscribe_request(transaction_id id, |
---|
| 942 | + wifi_interface_handle iface, NanSubscribeRequest* msg) |
---|
| 943 | +{ |
---|
| 944 | + ALOGD("%s", __func__); |
---|
| 945 | + |
---|
| 946 | + return WIFI_SUCCESS; |
---|
| 947 | +} |
---|
| 948 | + |
---|
| 949 | +wifi_error skw_wifi_nan_subscribe_cancel_request(transaction_id id, |
---|
| 950 | + wifi_interface_handle iface, NanSubscribeCancelRequest* msg) |
---|
| 951 | +{ |
---|
| 952 | + ALOGD("%s", __func__); |
---|
| 953 | + |
---|
| 954 | + return WIFI_SUCCESS; |
---|
| 955 | +} |
---|
| 956 | + |
---|
| 957 | +wifi_error skw_wifi_nan_transmit_followup_request(transaction_id id, |
---|
| 958 | + wifi_interface_handle iface, NanTransmitFollowupRequest* msg) |
---|
| 959 | +{ |
---|
| 960 | + ALOGD("%s", __func__); |
---|
| 961 | + |
---|
| 962 | + return WIFI_SUCCESS; |
---|
| 963 | +} |
---|
| 964 | + |
---|
| 965 | +wifi_error skw_wifi_nan_stats_request(transaction_id id, |
---|
| 966 | + wifi_interface_handle iface, NanStatsRequest* msg) |
---|
| 967 | +{ |
---|
| 968 | + ALOGD("%s", __func__); |
---|
| 969 | + |
---|
| 970 | + return WIFI_SUCCESS; |
---|
| 971 | +} |
---|
| 972 | + |
---|
| 973 | +wifi_error skw_wifi_nan_config_request(transaction_id id, |
---|
| 974 | + wifi_interface_handle iface, NanConfigRequest* msg) |
---|
| 975 | +{ |
---|
| 976 | + ALOGD("%s", __func__); |
---|
| 977 | + |
---|
| 978 | + return WIFI_SUCCESS; |
---|
| 979 | +} |
---|
| 980 | + |
---|
| 981 | +wifi_error skw_wifi_nan_tca_request(transaction_id id, |
---|
| 982 | + wifi_interface_handle iface, NanTCARequest* msg) |
---|
| 983 | +{ |
---|
| 984 | + ALOGD("%s", __func__); |
---|
| 985 | + |
---|
| 986 | + return WIFI_SUCCESS; |
---|
| 987 | +} |
---|
| 988 | + |
---|
| 989 | +wifi_error skw_wifi_nan_beacon_sdf_payload_request(transaction_id id, |
---|
| 990 | + wifi_interface_handle iface, NanBeaconSdfPayloadRequest* msg) |
---|
| 991 | +{ |
---|
| 992 | + ALOGD("%s", __func__); |
---|
| 993 | + |
---|
| 994 | + return WIFI_SUCCESS; |
---|
| 995 | +} |
---|
| 996 | + |
---|
| 997 | +wifi_error skw_wifi_nan_register_handler(wifi_interface_handle iface, |
---|
| 998 | + NanCallbackHandler handlers) |
---|
| 999 | +{ |
---|
| 1000 | + ALOGD("%s", __func__); |
---|
| 1001 | + |
---|
| 1002 | + return WIFI_SUCCESS; |
---|
| 1003 | +} |
---|
| 1004 | + |
---|
| 1005 | +wifi_error skw_wifi_nan_get_version(wifi_handle handle, |
---|
| 1006 | + NanVersion* version) |
---|
| 1007 | +{ |
---|
| 1008 | + ALOGD("%s", __func__); |
---|
| 1009 | + |
---|
| 1010 | + return WIFI_SUCCESS; |
---|
| 1011 | +} |
---|
| 1012 | + |
---|
| 1013 | +wifi_error skw_wifi_nan_get_capabilities(transaction_id id, |
---|
| 1014 | + wifi_interface_handle iface) |
---|
| 1015 | +{ |
---|
| 1016 | + ALOGD("%s", __func__); |
---|
| 1017 | + |
---|
| 1018 | + return WIFI_SUCCESS; |
---|
| 1019 | +} |
---|
| 1020 | + |
---|
| 1021 | +wifi_error skw_wifi_nan_data_interface_create(transaction_id id, |
---|
| 1022 | + wifi_interface_handle iface, |
---|
| 1023 | + char *iface_name) |
---|
| 1024 | +{ |
---|
| 1025 | + ALOGD("%s", __func__); |
---|
| 1026 | + |
---|
| 1027 | + return WIFI_SUCCESS; |
---|
| 1028 | +} |
---|
| 1029 | + |
---|
| 1030 | +wifi_error skw_wifi_nan_data_interface_delete(transaction_id id, |
---|
| 1031 | + wifi_interface_handle iface, char *iface_name) |
---|
| 1032 | +{ |
---|
| 1033 | + ALOGD("%s", __func__); |
---|
| 1034 | + |
---|
| 1035 | + return WIFI_SUCCESS; |
---|
| 1036 | +} |
---|
| 1037 | + |
---|
| 1038 | +wifi_error skw_wifi_nan_data_request_initiator( |
---|
| 1039 | + transaction_id id, wifi_interface_handle iface, |
---|
| 1040 | + NanDataPathInitiatorRequest *msg) |
---|
| 1041 | +{ |
---|
| 1042 | + ALOGD("%s", __func__); |
---|
| 1043 | + |
---|
| 1044 | + return WIFI_SUCCESS; |
---|
| 1045 | +} |
---|
| 1046 | + |
---|
| 1047 | +wifi_error skw_wifi_nan_data_indication_response( |
---|
| 1048 | + transaction_id id, wifi_interface_handle iface, |
---|
| 1049 | + NanDataPathIndicationResponse *msg) |
---|
| 1050 | +{ |
---|
| 1051 | + ALOGD("%s", __func__); |
---|
| 1052 | + |
---|
| 1053 | + return WIFI_SUCCESS; |
---|
| 1054 | +} |
---|
| 1055 | + |
---|
| 1056 | +wifi_error skw_wifi_nan_data_end(transaction_id id, |
---|
| 1057 | + wifi_interface_handle iface, |
---|
| 1058 | + NanDataPathEndRequest *msg) |
---|
| 1059 | +{ |
---|
| 1060 | + ALOGD("%s", __func__); |
---|
| 1061 | + |
---|
| 1062 | + return WIFI_SUCCESS; |
---|
| 1063 | +} |
---|
| 1064 | + |
---|
| 1065 | +wifi_error skw_wifi_select_tx_power_scenario(wifi_interface_handle iface, |
---|
| 1066 | + wifi_power_scenario scenario) |
---|
| 1067 | +{ |
---|
| 1068 | + ALOGD("%s", __func__); |
---|
| 1069 | + |
---|
| 1070 | + return WIFI_ERROR_NOT_SUPPORTED; |
---|
| 1071 | +} |
---|
| 1072 | + |
---|
| 1073 | +wifi_error skw_wifi_reset_tx_power_scenario(wifi_interface_handle iface) |
---|
| 1074 | +{ |
---|
| 1075 | + ALOGD("%s", __func__); |
---|
| 1076 | + |
---|
| 1077 | + return WIFI_ERROR_NOT_SUPPORTED; |
---|
| 1078 | +} |
---|
| 1079 | + |
---|
| 1080 | +/** |
---|
| 1081 | + * Returns the chipset's hardware filtering capabilities: |
---|
| 1082 | + * @param version pointer to version of the packet filter interpreter |
---|
| 1083 | + * supported, filled in upon return. 0 indicates no support. |
---|
| 1084 | + * @param max_len pointer to maximum size of the filter bytecode, filled in |
---|
| 1085 | + * upon return. |
---|
| 1086 | + */ |
---|
| 1087 | +wifi_error skw_wifi_get_packet_filter_capabilities(wifi_interface_handle handle, |
---|
| 1088 | + u32 *version, u32 *max_len) |
---|
| 1089 | +{ |
---|
| 1090 | + ALOGD("%s", __func__); |
---|
| 1091 | + |
---|
| 1092 | + return WIFI_SUCCESS; |
---|
| 1093 | +} |
---|
| 1094 | +/** |
---|
| 1095 | + * Programs the packet filter. |
---|
| 1096 | + * @param program pointer to the program byte-code. |
---|
| 1097 | + * @param len length of the program byte-code. |
---|
| 1098 | + */ |
---|
| 1099 | +wifi_error skw_wifi_set_packet_filter(wifi_interface_handle handle, |
---|
| 1100 | + const u8 *program, u32 len) |
---|
| 1101 | +{ |
---|
| 1102 | + ALOGD("%s", __func__); |
---|
| 1103 | + |
---|
| 1104 | + return WIFI_SUCCESS; |
---|
| 1105 | +} |
---|
| 1106 | + |
---|
| 1107 | +wifi_error skw_wifi_read_packet_filter(wifi_interface_handle handle, |
---|
| 1108 | + u32 src_offset, u8 *host_dst, |
---|
| 1109 | + u32 length) |
---|
| 1110 | +{ |
---|
| 1111 | + ALOGD("%s", __func__); |
---|
| 1112 | + |
---|
| 1113 | + return WIFI_SUCCESS; |
---|
| 1114 | +} |
---|
| 1115 | + |
---|
| 1116 | +wifi_error skw_wifi_get_roaming_capabilities(wifi_interface_handle handle, |
---|
| 1117 | + wifi_roaming_capabilities *caps) |
---|
| 1118 | +{ |
---|
| 1119 | + ALOGD("%s", __func__); |
---|
| 1120 | + |
---|
| 1121 | + return WIFI_SUCCESS; |
---|
| 1122 | +} |
---|
| 1123 | + |
---|
| 1124 | +wifi_error skw_wifi_enable_firmware_roaming(wifi_interface_handle handle, |
---|
| 1125 | + fw_roaming_state_t state) |
---|
| 1126 | +{ |
---|
| 1127 | + ALOGD("%s", __func__); |
---|
| 1128 | + |
---|
| 1129 | + return WIFI_SUCCESS; |
---|
| 1130 | +} |
---|
| 1131 | + |
---|
| 1132 | +wifi_error skw_wifi_configure_roaming(wifi_interface_handle handle, |
---|
| 1133 | + wifi_roaming_config *roaming_config) |
---|
| 1134 | +{ |
---|
| 1135 | + ALOGD("%s", __func__); |
---|
| 1136 | + |
---|
| 1137 | + return WIFI_SUCCESS; |
---|
| 1138 | +} |
---|
| 1139 | + |
---|
| 1140 | +wifi_error skw_wifi_set_radio_mode_change_handler(wifi_request_id id, wifi_interface_handle |
---|
| 1141 | + iface, wifi_radio_mode_change_handler eh) |
---|
| 1142 | +{ |
---|
| 1143 | + ALOGD("%s", __func__); |
---|
| 1144 | + |
---|
| 1145 | + return WIFI_SUCCESS; |
---|
| 1146 | +} |
---|
| 1147 | + |
---|
| 1148 | +#if __ANDROID_API__ > __ANDROID_API_Q__ |
---|
| 1149 | +wifi_error skw_wifi_set_latency_mode(wifi_interface_handle iface, |
---|
| 1150 | + wifi_latency_mode mode) |
---|
| 1151 | +{ |
---|
| 1152 | + ALOGD("%s", __func__); |
---|
| 1153 | + |
---|
| 1154 | + return WIFI_ERROR_NOT_SUPPORTED; |
---|
| 1155 | +} |
---|
| 1156 | + |
---|
| 1157 | +wifi_error skw_wifi_set_thermal_mitigation_mode(wifi_handle handle, |
---|
| 1158 | + wifi_thermal_mode mode, u32 completion_window) |
---|
| 1159 | +{ |
---|
| 1160 | + ALOGD("%s", __func__); |
---|
| 1161 | + |
---|
| 1162 | + return WIFI_SUCCESS; |
---|
| 1163 | +} |
---|
| 1164 | + |
---|
| 1165 | +wifi_error skw_wifi_map_dscp_access_category(wifi_handle handle, |
---|
| 1166 | + u32 start, u32 end, u32 access_category) |
---|
| 1167 | +{ |
---|
| 1168 | + ALOGD("%s", __func__); |
---|
| 1169 | + |
---|
| 1170 | + return WIFI_SUCCESS; |
---|
| 1171 | +} |
---|
| 1172 | + |
---|
| 1173 | +wifi_error skw_wifi_reset_dscp_mapping(wifi_handle handle) |
---|
| 1174 | +{ |
---|
| 1175 | + ALOGD("%s", __func__); |
---|
| 1176 | + |
---|
| 1177 | + return WIFI_SUCCESS; |
---|
| 1178 | +} |
---|
| 1179 | + |
---|
| 1180 | +wifi_error skw_wifi_virtual_interface_create(wifi_handle handle, const char* ifname, |
---|
| 1181 | + wifi_interface_type iface_type) |
---|
| 1182 | +{ |
---|
| 1183 | + ALOGD("%s: ifname: %s, type: 0x%x", __func__, ifname, iface_type); |
---|
| 1184 | + |
---|
| 1185 | + return WIFI_SUCCESS; |
---|
| 1186 | +} |
---|
| 1187 | + |
---|
| 1188 | +wifi_error skw_wifi_virtual_interface_delete(wifi_handle handle, const char* ifname) |
---|
| 1189 | +{ |
---|
| 1190 | + ALOGD("%s: ifname: %s", __func__, ifname); |
---|
| 1191 | + |
---|
| 1192 | + return WIFI_SUCCESS; |
---|
| 1193 | +} |
---|
| 1194 | + |
---|
| 1195 | +wifi_error skw_wifi_set_subsystem_restart_handler(wifi_handle handle, |
---|
| 1196 | + wifi_subsystem_restart_handler handler) |
---|
| 1197 | +{ |
---|
| 1198 | + ALOGD("%s", __func__); |
---|
| 1199 | + |
---|
| 1200 | + return WIFI_SUCCESS; |
---|
| 1201 | +} |
---|
| 1202 | + |
---|
| 1203 | +/** |
---|
| 1204 | + * Allow vendor HAL to choose interface name when creating |
---|
| 1205 | + * an interface. This can be implemented by chips with their |
---|
| 1206 | + * own interface naming policy. |
---|
| 1207 | + * If not implemented, the default naming will be used. |
---|
| 1208 | + */ |
---|
| 1209 | +wifi_error skw_wifi_get_supported_iface_name(wifi_handle handle, u32 iface_type, |
---|
| 1210 | + char *name, size_t len) |
---|
| 1211 | +{ |
---|
| 1212 | + return WIFI_ERROR_NOT_AVAILABLE; |
---|
| 1213 | +} |
---|
| 1214 | + |
---|
| 1215 | +/** |
---|
| 1216 | + * Perform early initialization steps that are needed when WIFI |
---|
| 1217 | + * is disabled. |
---|
| 1218 | + * If the function returns failure, it means the vendor HAL is unusable |
---|
| 1219 | + * (for example, if chip hardware is not installed) and no further |
---|
| 1220 | + * functions should be called. |
---|
| 1221 | + */ |
---|
| 1222 | +wifi_error skw_wifi_early_initialize(void) |
---|
| 1223 | +{ |
---|
| 1224 | + ALOGD("%s", __func__); |
---|
| 1225 | + |
---|
| 1226 | + return WIFI_SUCCESS; |
---|
| 1227 | +} |
---|
| 1228 | + |
---|
| 1229 | +/** |
---|
| 1230 | + * Get supported feature set which are chip-global, that is |
---|
| 1231 | + * not dependent on any created interface. |
---|
| 1232 | + */ |
---|
| 1233 | +wifi_error skw_wifi_get_chip_feature_set(wifi_handle handle, feature_set *set) |
---|
| 1234 | +{ |
---|
| 1235 | + ALOGD("%s: 0x%x", __func__, *set); |
---|
| 1236 | + |
---|
| 1237 | +#if 0 |
---|
| 1238 | + *set |= WIFI_FEATURE_INFRA; |
---|
| 1239 | + *set |= WIFI_FEATURE_INFRA_5G; |
---|
| 1240 | + *set |= WIFI_FEATURE_P2P; |
---|
| 1241 | + *set |= WIFI_FEATURE_SOFT_AP; |
---|
| 1242 | +#endif |
---|
| 1243 | + |
---|
| 1244 | + return WIFI_SUCCESS; |
---|
| 1245 | +} |
---|
| 1246 | + |
---|
| 1247 | +/** |
---|
| 1248 | + * Invoked to indicate that the provided iface is the primary STA iface when there are more |
---|
| 1249 | + * than 1 STA iface concurrently active. |
---|
| 1250 | + */ |
---|
| 1251 | +wifi_error skw_wifi_multi_sta_set_primary_connection(wifi_handle handle, |
---|
| 1252 | + wifi_interface_handle iface) |
---|
| 1253 | +{ |
---|
| 1254 | + ALOGD("%s", __func__); |
---|
| 1255 | + |
---|
| 1256 | + return WIFI_SUCCESS; |
---|
| 1257 | +} |
---|
| 1258 | + |
---|
| 1259 | +/** |
---|
| 1260 | + * When there are 2 simultaneous STA connections, this use case hint |
---|
| 1261 | + * indicates what STA + STA use-case is being enabled by the framework. |
---|
| 1262 | + */ |
---|
| 1263 | +wifi_error skw_wifi_multi_sta_set_use_case(wifi_handle handle, |
---|
| 1264 | + wifi_multi_sta_use_case use_case) |
---|
| 1265 | +{ |
---|
| 1266 | + ALOGD("%s", __func__); |
---|
| 1267 | + |
---|
| 1268 | + return WIFI_SUCCESS; |
---|
| 1269 | +} |
---|
| 1270 | + |
---|
| 1271 | +/** |
---|
| 1272 | + * Invoked to indicate that the following list of wifi_coex_unsafe_channel should be avoided |
---|
| 1273 | + * with the specified restrictions. |
---|
| 1274 | + * @param unsafeChannels list of current |wifi_coex_unsafe_channel| to avoid. |
---|
| 1275 | + * @param restrictions bitmask of |wifi_coex_restriction| indicating wifi interfaces to |
---|
| 1276 | + * restrict from the current unsafe channels. |
---|
| 1277 | + */ |
---|
| 1278 | +wifi_error skw_wifi_set_coex_unsafe_channels(wifi_handle handle, u32 num_channels, |
---|
| 1279 | + wifi_coex_unsafe_channel *unsafeChannels, u32 restrictions) |
---|
| 1280 | +{ |
---|
| 1281 | + ALOGD("%s", __func__); |
---|
| 1282 | + |
---|
| 1283 | + return WIFI_SUCCESS; |
---|
| 1284 | +} |
---|
| 1285 | + |
---|
| 1286 | +/** |
---|
| 1287 | + * Invoked to set voip optimization mode for the provided STA iface |
---|
| 1288 | + */ |
---|
| 1289 | +wifi_error skw_wifi_set_voip_mode(wifi_interface_handle iface, wifi_voip_mode mode) |
---|
| 1290 | +{ |
---|
| 1291 | + ALOGD("%s", __func__); |
---|
| 1292 | + |
---|
| 1293 | + return WIFI_SUCCESS; |
---|
| 1294 | +} |
---|
| 1295 | + |
---|
| 1296 | +/**@brief twt_register_handler |
---|
| 1297 | + * Request to register TWT callback before sending any TWT request |
---|
| 1298 | + * @param wifi_interface_handle: |
---|
| 1299 | + * @param TwtCallbackHandler: callback function pointers |
---|
| 1300 | + * @return Synchronous wifi_error |
---|
| 1301 | + */ |
---|
| 1302 | +wifi_error skw_wifi_twt_register_handler(wifi_interface_handle iface, |
---|
| 1303 | + TwtCallbackHandler handler) |
---|
| 1304 | +{ |
---|
| 1305 | + ALOGD("%s", __func__); |
---|
| 1306 | + |
---|
| 1307 | + return WIFI_SUCCESS; |
---|
| 1308 | +} |
---|
| 1309 | + |
---|
| 1310 | +/**@brief twt_get_capability |
---|
| 1311 | + * Request TWT capability |
---|
| 1312 | + * @param wifi_interface_handle: |
---|
| 1313 | + * @return Synchronous wifi_error and TwtCapabilitySet |
---|
| 1314 | + */ |
---|
| 1315 | +wifi_error skw_wifi_twt_get_capability(wifi_interface_handle iface, |
---|
| 1316 | + TwtCapabilitySet* twt_cap_set) |
---|
| 1317 | +{ |
---|
| 1318 | + ALOGD("%s", __func__); |
---|
| 1319 | + |
---|
| 1320 | + return WIFI_SUCCESS; |
---|
| 1321 | +} |
---|
| 1322 | + |
---|
| 1323 | +/**@brief twt_setup_request |
---|
| 1324 | + * Request to send TWT setup frame |
---|
| 1325 | + * @param wifi_interface_handle: |
---|
| 1326 | + * @param TwtSetupRequest: detailed parameters of setup request |
---|
| 1327 | + * @return Synchronous wifi_error |
---|
| 1328 | + * @return Asynchronous EventTwtSetupResponse CB return TwtSetupResponse |
---|
| 1329 | + */ |
---|
| 1330 | +wifi_error skw_wifi_twt_setup_request(wifi_interface_handle iface, |
---|
| 1331 | + TwtSetupRequest* msg) |
---|
| 1332 | +{ |
---|
| 1333 | + ALOGD("%s", __func__); |
---|
| 1334 | + |
---|
| 1335 | + return WIFI_SUCCESS; |
---|
| 1336 | +} |
---|
| 1337 | + |
---|
| 1338 | +/**@brief twt_teardown_request |
---|
| 1339 | + * Request to send TWT teardown frame |
---|
| 1340 | + * @param wifi_interface_handle: |
---|
| 1341 | + * @param TwtTeardownRequest: detailed parameters of teardown request |
---|
| 1342 | + * @return Synchronous wifi_error |
---|
| 1343 | + * @return Asynchronous EventTwtTeardownCompletion CB return TwtTeardownCompletion |
---|
| 1344 | + * TwtTeardownCompletion may also be received due to other events |
---|
| 1345 | + * like CSA, BTCX, TWT scheduler, MultiConnection, peer-initiated teardown, etc. |
---|
| 1346 | + */ |
---|
| 1347 | +wifi_error skw_wifi_twt_teardown_request(wifi_interface_handle iface, |
---|
| 1348 | + TwtTeardownRequest* msg) |
---|
| 1349 | +{ |
---|
| 1350 | + ALOGD("%s", __func__); |
---|
| 1351 | + |
---|
| 1352 | + return WIFI_SUCCESS; |
---|
| 1353 | +} |
---|
| 1354 | + |
---|
| 1355 | +/**@brief twt_info_frame_request |
---|
| 1356 | + * Request to send TWT info frame |
---|
| 1357 | + * @param wifi_interface_handle: |
---|
| 1358 | + * @param TwtInfoFrameRequest: detailed parameters in info frame |
---|
| 1359 | + * @return Synchronous wifi_error |
---|
| 1360 | + * @return Asynchronous EventTwtInfoFrameReceived CB return TwtInfoFrameReceived |
---|
| 1361 | + * Driver may also receive Peer-initiated TwtInfoFrame |
---|
| 1362 | + */ |
---|
| 1363 | +wifi_error skw_wifi_twt_info_frame_request(wifi_interface_handle iface, |
---|
| 1364 | + TwtInfoFrameRequest* msg) |
---|
| 1365 | +{ |
---|
| 1366 | + ALOGD("%s", __func__); |
---|
| 1367 | + |
---|
| 1368 | + return WIFI_SUCCESS; |
---|
| 1369 | +} |
---|
| 1370 | + |
---|
| 1371 | +/**@brief twt_get_stats |
---|
| 1372 | + * Request to get TWT stats |
---|
| 1373 | + * @param wifi_interface_handle: |
---|
| 1374 | + * @param config_id: configuration ID of TWT request |
---|
| 1375 | + * @return Synchronous wifi_error and TwtStats |
---|
| 1376 | + */ |
---|
| 1377 | +wifi_error skw_wifi_twt_get_stats(wifi_interface_handle iface, u8 config_id, |
---|
| 1378 | + TwtStats* stats) |
---|
| 1379 | +{ |
---|
| 1380 | + ALOGD("%s", __func__); |
---|
| 1381 | + |
---|
| 1382 | + return WIFI_SUCCESS; |
---|
| 1383 | +} |
---|
| 1384 | + |
---|
| 1385 | +/**@brief twt_clear_stats |
---|
| 1386 | + * Request to clear TWT stats |
---|
| 1387 | + * @param wifi_interface_handle: |
---|
| 1388 | + * @param config_id: configuration ID of TWT request |
---|
| 1389 | + * @return Synchronous wifi_error |
---|
| 1390 | + */ |
---|
| 1391 | +wifi_error skw_wifi_twt_clear_stats(wifi_interface_handle iface, u8 config_id) |
---|
| 1392 | +{ |
---|
| 1393 | + ALOGD("%s", __func__); |
---|
| 1394 | + |
---|
| 1395 | + return WIFI_SUCCESS; |
---|
| 1396 | +} |
---|
| 1397 | + |
---|
| 1398 | +/** |
---|
| 1399 | + * Invoked to set DTIM configuration when the host is in the suspend mode |
---|
| 1400 | + * @param wifi_interface_handle: |
---|
| 1401 | + * @param multiplier: when STA in the power saving mode, the wake up interval will be set to |
---|
| 1402 | + * 1) multiplier * DTIM period if multiplier > 0. |
---|
| 1403 | + * 2) the device default value if multiplier <=0 |
---|
| 1404 | + * Some implementations may apply an additional cap to wake up interval in the case of 1). |
---|
| 1405 | + */ |
---|
| 1406 | +wifi_error skw_wifi_set_dtim_config(wifi_interface_handle handle, u32 multiplier) |
---|
| 1407 | +{ |
---|
| 1408 | + ALOGD("%s", __func__); |
---|
| 1409 | + |
---|
| 1410 | + return WIFI_SUCCESS; |
---|
| 1411 | +} |
---|
| 1412 | + |
---|
| 1413 | +/**@brief wifi_get_usable_channels |
---|
| 1414 | + * Request list of usable channels for the requested bands and modes. Usable |
---|
| 1415 | + * implies channel is allowed as per regulatory for the current country code |
---|
| 1416 | + * and not restricted due to other hard limitations (e.g. DFS, Coex) In |
---|
| 1417 | + * certain modes (e.g. STA+SAP) there could be other hard restrictions |
---|
| 1418 | + * since MCC operation many not be supported by SAP. This API also allows |
---|
| 1419 | + * driver to return list of usable channels for each mode uniquely to |
---|
| 1420 | + * distinguish cases where only a limited set of modes are allowed on |
---|
| 1421 | + * a given channel e.g. srd channels may be supported for P2P but not |
---|
| 1422 | + * for SAP or P2P-Client may be allowed on an indoor channel but P2P-GO |
---|
| 1423 | + * may not be allowed. This API is not interface specific and will be |
---|
| 1424 | + * used to query capabilities of driver in terms of what modes (STA, SAP, |
---|
| 1425 | + * P2P_CLI, P2P_GO, NAN, TDLS) can be supported on each of the channels. |
---|
| 1426 | + * @param handle global wifi_handle |
---|
| 1427 | + * @param band_mask BIT MASK of WLAN_MAC* as represented by |wlan_mac_band| |
---|
| 1428 | + * @param iface_mode_mask BIT MASK of BIT(WIFI_INTERFACE_*) represented by |
---|
| 1429 | + * |wifi_interface_mode|. Bitmask respresents all the modes that the |
---|
| 1430 | + * caller is interested in (e.g. STA, SAP, WFD-CLI, WFD-GO, TDLS, NAN). |
---|
| 1431 | + * Note: Bitmask does not represent concurrency matrix. If the caller |
---|
| 1432 | + * is interested in CLI, GO modes, the iface_mode_mask would be set |
---|
| 1433 | + * to WIFI_INTERFACE_P2P_CLIENT|WIFI_INTERFACE_P2P_GO. |
---|
| 1434 | + * @param filter_mask BIT MASK of WIFI_USABLE_CHANNEL_FILTER_* represented by |
---|
| 1435 | + * |wifi_usable_channel_filter|. Indicates if the channel list should |
---|
| 1436 | + * be filtered based on additional criteria. If filter_mask is not |
---|
| 1437 | + * specified, driver should return list of usable channels purely |
---|
| 1438 | + * based on regulatory constraints. |
---|
| 1439 | + * @param max_size maximum number of |wifi_usable_channel| |
---|
| 1440 | + * @param size actual number of |wifi_usable_channel| entries returned by driver |
---|
| 1441 | + * @param channels list of usable channels represented by |wifi_usable_channel| |
---|
| 1442 | + */ |
---|
| 1443 | +wifi_error skw_wifi_get_usable_channels(wifi_handle handle, u32 band_mask, u32 iface_mode_mask, |
---|
| 1444 | + u32 filter_mask, u32 max_size, u32* size, |
---|
| 1445 | + wifi_usable_channel* channels) |
---|
| 1446 | +{ |
---|
| 1447 | + ALOGD("%s", __func__); |
---|
| 1448 | + |
---|
| 1449 | + return WIFI_SUCCESS; |
---|
| 1450 | +} |
---|
| 1451 | + |
---|
| 1452 | +/** |
---|
| 1453 | + * Trigger wifi subsystem restart to reload firmware |
---|
| 1454 | + */ |
---|
| 1455 | +wifi_error skw_wifi_trigger_subsystem_restart(wifi_handle handle) |
---|
| 1456 | +{ |
---|
| 1457 | + ALOGD("%s", __func__); |
---|
| 1458 | + |
---|
| 1459 | + return WIFI_SUCCESS; |
---|
| 1460 | +} |
---|
| 1461 | +#endif |
---|
| 1462 | + |
---|
| 1463 | +static nl_sock *skw_create_socket(int port) |
---|
| 1464 | +{ |
---|
| 1465 | + struct nl_sock * sock = NULL; |
---|
| 1466 | + uint32_t pid = getpid() & 0x3FFFFF; |
---|
| 1467 | + |
---|
| 1468 | + sock = nl_socket_alloc(); |
---|
| 1469 | + if (sock == NULL) { |
---|
| 1470 | + ALOGE("%s: socked alloc failed", __func__); |
---|
| 1471 | + |
---|
| 1472 | + return NULL; |
---|
| 1473 | + } |
---|
| 1474 | + |
---|
| 1475 | + nl_socket_set_local_port(sock, pid + (port << 22)); |
---|
| 1476 | + if (nl_connect(sock, NETLINK_GENERIC)) { |
---|
| 1477 | + ALOGE("%s: connect failed", __func__); |
---|
| 1478 | + |
---|
| 1479 | + nl_socket_free(sock); |
---|
| 1480 | + |
---|
| 1481 | + return NULL; |
---|
| 1482 | + } |
---|
| 1483 | + |
---|
| 1484 | + if (nl_socket_set_buffer_size(sock, SOCK_BUFF_SIZE, 0) < 0) |
---|
| 1485 | + ALOGE("cmd_sock: set RX buffer failed, %d", strerror(errno)); |
---|
| 1486 | + |
---|
| 1487 | + return sock; |
---|
| 1488 | +} |
---|
| 1489 | + |
---|
| 1490 | +class GetMulticastId : public WifiCommand { |
---|
| 1491 | +private: |
---|
| 1492 | + char *group; |
---|
| 1493 | + int mId; |
---|
| 1494 | + |
---|
| 1495 | +public: |
---|
| 1496 | + GetMulticastId(struct nl_sock *sk, int family, int flags, int nl80211_cmd) |
---|
| 1497 | + : WifiCommand(sk, family, flags, nl80211_cmd) |
---|
| 1498 | + { |
---|
| 1499 | + group = NULL; |
---|
| 1500 | + mId = -1; |
---|
| 1501 | + } |
---|
| 1502 | + |
---|
| 1503 | + virtual wifi_error build(wifi_interface_handle handle, void *param) |
---|
| 1504 | + { |
---|
| 1505 | + group = (char *)param; |
---|
| 1506 | + put_string(CTRL_ATTR_FAMILY_NAME, "nl80211"); |
---|
| 1507 | + |
---|
| 1508 | + return WIFI_SUCCESS; |
---|
| 1509 | + } |
---|
| 1510 | + |
---|
| 1511 | + virtual wifi_error parser(struct nlattr *attr[NL80211_ATTR_MAX]) |
---|
| 1512 | + { |
---|
| 1513 | + int i; |
---|
| 1514 | + struct nlattr *mcgrp; |
---|
| 1515 | + |
---|
| 1516 | + if (!attr[CTRL_ATTR_MCAST_GROUPS]) |
---|
| 1517 | + return WIFI_ERROR_UNKNOWN; |
---|
| 1518 | + |
---|
| 1519 | + skw_nla_for_each_nested(mcgrp, attr[CTRL_ATTR_MCAST_GROUPS], i) { |
---|
| 1520 | + struct nlattr *tb2[CTRL_ATTR_MCAST_GRP_MAX + 1]; |
---|
| 1521 | + |
---|
| 1522 | + nla_parse(tb2, CTRL_ATTR_MCAST_GRP_MAX, (struct nlattr *)nla_data(mcgrp), |
---|
| 1523 | + nla_len(mcgrp), NULL); |
---|
| 1524 | + |
---|
| 1525 | + if (!tb2[CTRL_ATTR_MCAST_GRP_NAME] || !tb2[CTRL_ATTR_MCAST_GRP_ID] || |
---|
| 1526 | + strncmp((const char *)nla_data(tb2[CTRL_ATTR_MCAST_GRP_NAME]), |
---|
| 1527 | + group, nla_len(tb2[CTRL_ATTR_MCAST_GRP_NAME])) != 0) |
---|
| 1528 | + continue; |
---|
| 1529 | + |
---|
| 1530 | + mId = nla_get_u32(tb2[CTRL_ATTR_MCAST_GRP_ID]); |
---|
| 1531 | + |
---|
| 1532 | + break; |
---|
| 1533 | + }; |
---|
| 1534 | + |
---|
| 1535 | + return WIFI_SUCCESS; |
---|
| 1536 | + } |
---|
| 1537 | + |
---|
| 1538 | + int id() |
---|
| 1539 | + { |
---|
| 1540 | + return mId; |
---|
| 1541 | + } |
---|
| 1542 | +}; |
---|
| 1543 | + |
---|
| 1544 | +static int skw_get_multicast_id(struct nl_sock *sk, const char *group) |
---|
| 1545 | +{ |
---|
| 1546 | + GetMulticastId cmd(sk, genl_ctrl_resolve(sk, "nlctrl"), 0, CTRL_CMD_GETFAMILY); |
---|
| 1547 | + if (cmd.build(NULL, (void *)group) == WIFI_SUCCESS) |
---|
| 1548 | + cmd.send(); |
---|
| 1549 | + |
---|
| 1550 | + return cmd.id(); |
---|
| 1551 | +} |
---|
| 1552 | + |
---|
| 1553 | +static int skw_add_membership(struct nl_sock *sk, const char *group) |
---|
| 1554 | +{ |
---|
| 1555 | + int id = skw_get_multicast_id(sk, group); |
---|
| 1556 | + if (id < 0) { |
---|
| 1557 | + ALOGE("Could not find group %s", group); |
---|
| 1558 | + return id; |
---|
| 1559 | + } |
---|
| 1560 | + |
---|
| 1561 | + int ret = nl_socket_add_membership(sk, id); |
---|
| 1562 | + if (ret < 0) |
---|
| 1563 | + ALOGE("Could not add membership to group %s", group); |
---|
| 1564 | + |
---|
| 1565 | + return ret; |
---|
| 1566 | +} |
---|
| 1567 | + |
---|
| 1568 | +static int evtHandler(struct nl_msg *msg, void *arg) |
---|
| 1569 | +{ |
---|
| 1570 | + ALOGD("%s", __func__); |
---|
| 1571 | + |
---|
| 1572 | + return NL_SKIP; |
---|
| 1573 | +} |
---|
| 1574 | + |
---|
| 1575 | +static wifi_error skw_wifi_event_init(hal_info *hal) |
---|
| 1576 | +{ |
---|
| 1577 | + int err; |
---|
| 1578 | + |
---|
| 1579 | + hal->nl_event = skw_create_socket(WIFI_HAL_SOCK_EVENT_PORT); |
---|
| 1580 | + if (hal->nl_event == NULL) { |
---|
| 1581 | + ALOGE("%s: create event socket failed", __func__); |
---|
| 1582 | + |
---|
| 1583 | + return WIFI_ERROR_UNKNOWN; |
---|
| 1584 | + } |
---|
| 1585 | + |
---|
| 1586 | + //nl_socket_modify_cb(hal->nl_event, NL_CB_SEQ_CHECK, no_seq_check, &err); |
---|
| 1587 | + nl_socket_modify_cb(hal->nl_event, NL_CB_VALID, NL_CB_CUSTOM, evtHandler, &err); |
---|
| 1588 | + |
---|
| 1589 | + skw_add_membership(hal->nl_event, "scan"); |
---|
| 1590 | + skw_add_membership(hal->nl_event, "mlme"); |
---|
| 1591 | + skw_add_membership(hal->nl_event, "vendor"); |
---|
| 1592 | + skw_add_membership(hal->nl_event, "regulatory"); |
---|
| 1593 | + |
---|
| 1594 | + return WIFI_SUCCESS; |
---|
| 1595 | +} |
---|
| 1596 | + |
---|
| 1597 | +static void skw_wifi_event_deinit(hal_info *hal) |
---|
| 1598 | +{ |
---|
| 1599 | + if (hal->nl_event) |
---|
| 1600 | + nl_socket_free(hal->nl_event); |
---|
| 1601 | +} |
---|
| 1602 | + |
---|
| 1603 | +static wifi_error skw_wifi_hal_init(hal_info *hal) |
---|
| 1604 | +{ |
---|
| 1605 | + hal->nl_hal = skw_create_socket(WIFI_HAL_SOCK_DEFAULT_PORT); |
---|
| 1606 | + if (hal->nl_hal == NULL) { |
---|
| 1607 | + ALOGE("%s: create command socket failed", __func__); |
---|
| 1608 | + |
---|
| 1609 | + return WIFI_ERROR_UNKNOWN; |
---|
| 1610 | + } |
---|
| 1611 | + |
---|
| 1612 | + hal->family_nl80211 = genl_ctrl_resolve(hal->nl_hal, "nl80211"); |
---|
| 1613 | + if (hal->family_nl80211 < 0) { |
---|
| 1614 | + nl_socket_free(hal->nl_hal); |
---|
| 1615 | + |
---|
| 1616 | + ALOGE("%s: resolve nl80211 id failed", __func__); |
---|
| 1617 | + |
---|
| 1618 | + return WIFI_ERROR_UNKNOWN; |
---|
| 1619 | + } |
---|
| 1620 | + |
---|
| 1621 | + return WIFI_SUCCESS; |
---|
| 1622 | +} |
---|
| 1623 | + |
---|
| 1624 | +static void skw_wifi_hal_deinit(hal_info *hal) |
---|
| 1625 | +{ |
---|
| 1626 | + if (hal->nl_hal) |
---|
| 1627 | + nl_socket_free(hal->nl_hal); |
---|
| 1628 | +} |
---|
| 1629 | + |
---|
| 1630 | +static wifi_error skw_wifi_initialize(wifi_handle *handle) |
---|
| 1631 | +{ |
---|
| 1632 | + wifi_error err; |
---|
| 1633 | + hal_info *hal = NULL; |
---|
| 1634 | + |
---|
| 1635 | + ALOGD("%s", __func__); |
---|
| 1636 | + |
---|
| 1637 | + hal = (hal_info *)malloc(sizeof(hal_info)); |
---|
| 1638 | + if (hal == NULL) { |
---|
| 1639 | + ALOGE("%s: alloc hal_info failed", __func__); |
---|
| 1640 | + |
---|
| 1641 | + return WIFI_ERROR_OUT_OF_MEMORY; |
---|
| 1642 | + } |
---|
| 1643 | + |
---|
| 1644 | + memset(hal, 0, sizeof(*hal)); |
---|
| 1645 | + |
---|
| 1646 | + if (socketpair(AF_UNIX, SOCK_STREAM, 0, hal->exit_socks) == -1) { |
---|
| 1647 | + ALOGE("socketpair failed"); |
---|
| 1648 | + |
---|
| 1649 | + free(hal); |
---|
| 1650 | + |
---|
| 1651 | + return WIFI_ERROR_UNKNOWN; |
---|
| 1652 | + } |
---|
| 1653 | + |
---|
| 1654 | + err = skw_wifi_hal_init(hal); |
---|
| 1655 | + if (err != WIFI_SUCCESS) { |
---|
| 1656 | + free(hal); |
---|
| 1657 | + return err; |
---|
| 1658 | + } |
---|
| 1659 | + |
---|
| 1660 | + err = skw_wifi_event_init(hal); |
---|
| 1661 | + if (err != WIFI_SUCCESS) { |
---|
| 1662 | + skw_wifi_hal_deinit(hal); |
---|
| 1663 | + free(hal); |
---|
| 1664 | + |
---|
| 1665 | + return err; |
---|
| 1666 | + } |
---|
| 1667 | + |
---|
| 1668 | + *handle = (wifi_handle)hal; |
---|
| 1669 | + |
---|
| 1670 | + return WIFI_SUCCESS; |
---|
| 1671 | +} |
---|
| 1672 | + |
---|
| 1673 | +static void skw_wifi_deinitialize(wifi_handle handle) |
---|
| 1674 | +{ |
---|
| 1675 | + hal_info *hal = (hal_info *)handle; |
---|
| 1676 | + |
---|
| 1677 | + if (hal->cleaned_up_handler) |
---|
| 1678 | + (*(hal->cleaned_up_handler))(handle); |
---|
| 1679 | + |
---|
| 1680 | + skw_wifi_hal_deinit(hal); |
---|
| 1681 | + skw_wifi_event_deinit(hal); |
---|
| 1682 | + |
---|
| 1683 | + if (hal->exit_socks[0]) |
---|
| 1684 | + close(hal->exit_socks[0]); |
---|
| 1685 | + |
---|
| 1686 | + if (hal->exit_socks[1]) |
---|
| 1687 | + close(hal->exit_socks[1]); |
---|
| 1688 | + |
---|
| 1689 | + free(hal); |
---|
| 1690 | +} |
---|
| 1691 | + |
---|
| 1692 | +void skw_wifi_cleanup(wifi_handle handle, wifi_cleaned_up_handler clean_handler) |
---|
| 1693 | +{ |
---|
| 1694 | + hal_info *hal = (hal_info *)handle; |
---|
| 1695 | + |
---|
| 1696 | + ALOGD("%s", __func__); |
---|
| 1697 | + |
---|
| 1698 | + hal->cleaned_up_handler = clean_handler; |
---|
| 1699 | + hal->exit = true; |
---|
| 1700 | + |
---|
| 1701 | + TEMP_FAILURE_RETRY(write(hal->exit_socks[0], "exit", 4)); |
---|
| 1702 | +} |
---|
| 1703 | + |
---|
| 1704 | +static int skw_socket_handler(hal_info *hal, int events, struct nl_sock *sk) |
---|
| 1705 | +{ |
---|
| 1706 | + int ret; |
---|
| 1707 | + struct nl_cb *cb = nl_socket_get_cb(sk); |
---|
| 1708 | + |
---|
| 1709 | + ret = nl_recvmsgs(sk, cb); |
---|
| 1710 | + |
---|
| 1711 | + nl_cb_put(cb); |
---|
| 1712 | + |
---|
| 1713 | + return ret; |
---|
| 1714 | +} |
---|
| 1715 | + |
---|
| 1716 | +static void skw_wifi_event_loop(wifi_handle handle) |
---|
| 1717 | +{ |
---|
| 1718 | + pollfd fd[2]; |
---|
| 1719 | + hal_info *hal = (hal_info *)handle; |
---|
| 1720 | + |
---|
| 1721 | + ALOGD("%s", __func__); |
---|
| 1722 | + |
---|
| 1723 | + memset(&fd[0], 0, sizeof(fd)); |
---|
| 1724 | + |
---|
| 1725 | + fd[0].fd = nl_socket_get_fd(hal->nl_event); |
---|
| 1726 | + fd[0].events = POLLIN; |
---|
| 1727 | + |
---|
| 1728 | + fd[1].fd = hal->exit_socks[1]; |
---|
| 1729 | + fd[1].events = POLLIN; |
---|
| 1730 | + |
---|
| 1731 | + do { |
---|
| 1732 | + fd[0].revents = 0; |
---|
| 1733 | + fd[1].revents = 0; |
---|
| 1734 | + |
---|
| 1735 | + if (poll(fd, 2, -1) > 0) { |
---|
| 1736 | + if (fd[0].revents & POLLIN) { |
---|
| 1737 | + skw_socket_handler(hal, fd[0].revents, hal->nl_event); |
---|
| 1738 | + } |
---|
| 1739 | + } |
---|
| 1740 | + |
---|
| 1741 | + } while (!hal->exit); |
---|
| 1742 | + |
---|
| 1743 | + skw_wifi_deinitialize(handle); |
---|
| 1744 | +} |
---|
| 1745 | + |
---|
| 1746 | +#define POLL_DRIVER_DURATION_US (100000) |
---|
| 1747 | +#define POLL_DRIVER_MAX_TIME_MS (10000) |
---|
| 1748 | +static wifi_error skw_wifi_wait_for_driver_ready(void) |
---|
| 1749 | +{ |
---|
| 1750 | + int count = (POLL_DRIVER_MAX_TIME_MS * 1000) / POLL_DRIVER_DURATION_US; |
---|
| 1751 | + |
---|
| 1752 | + ALOGD("%s", __func__); |
---|
| 1753 | + |
---|
| 1754 | + do { |
---|
| 1755 | + if ((access("/sys/class/net/wlan0", F_OK)) == 0) |
---|
| 1756 | + return WIFI_SUCCESS; |
---|
| 1757 | + |
---|
| 1758 | + usleep(POLL_DRIVER_DURATION_US); |
---|
| 1759 | + |
---|
| 1760 | + } while(--count > 0); |
---|
| 1761 | + |
---|
| 1762 | + ALOGE("Time out waiting on Driver ready ... "); |
---|
| 1763 | + |
---|
| 1764 | + return WIFI_ERROR_TIMED_OUT; |
---|
| 1765 | +} |
---|
| 1766 | + |
---|
| 1767 | +wifi_error init_wifi_vendor_hal_func_table(wifi_hal_fn *fn) |
---|
| 1768 | +{ |
---|
| 1769 | + if (!fn) { |
---|
| 1770 | + ALOGE("invalid parameter fn"); |
---|
| 1771 | + return WIFI_ERROR_UNINITIALIZED; |
---|
| 1772 | + } |
---|
| 1773 | + |
---|
| 1774 | + fn->wifi_initialize = skw_wifi_initialize; |
---|
| 1775 | + fn->wifi_wait_for_driver_ready = skw_wifi_wait_for_driver_ready; |
---|
| 1776 | + fn->wifi_cleanup = skw_wifi_cleanup; |
---|
| 1777 | + fn->wifi_event_loop = skw_wifi_event_loop; |
---|
| 1778 | + fn->wifi_get_error_info = skw_wifi_get_error_info; |
---|
| 1779 | + fn->wifi_get_supported_feature_set = skw_wifi_get_supported_feature_set; |
---|
| 1780 | + fn->wifi_get_concurrency_matrix = skw_wifi_get_concurrency_matrix; |
---|
| 1781 | + fn->wifi_set_scanning_mac_oui = skw_wifi_set_scanning_mac_oui; |
---|
| 1782 | + fn->wifi_get_supported_channels = skw_wifi_get_supported_channels; |
---|
| 1783 | + fn->wifi_is_epr_supported = skw_wifi_is_epr_supported; |
---|
| 1784 | + fn->wifi_get_ifaces = skw_wifi_get_ifaces; |
---|
| 1785 | + fn->wifi_get_iface_name = skw_wifi_get_iface_name; |
---|
| 1786 | + fn->wifi_set_iface_event_handler = skw_wifi_set_iface_event_handler; |
---|
| 1787 | + fn->wifi_reset_iface_event_handler = skw_wifi_reset_iface_event_handler; |
---|
| 1788 | + fn->wifi_start_gscan = skw_wifi_start_gscan; |
---|
| 1789 | + fn->wifi_stop_gscan = skw_wifi_stop_gscan; |
---|
| 1790 | + fn->wifi_get_cached_gscan_results = skw_wifi_get_cached_gscan_results; |
---|
| 1791 | + fn->wifi_set_bssid_hotlist = skw_wifi_set_bssid_hotlist; |
---|
| 1792 | + fn->wifi_reset_bssid_hotlist = skw_wifi_reset_bssid_hotlist; |
---|
| 1793 | + fn->wifi_set_significant_change_handler = skw_wifi_set_significant_change_handler; |
---|
| 1794 | + fn->wifi_reset_significant_change_handler = skw_wifi_reset_significant_change_handler; |
---|
| 1795 | + fn->wifi_get_gscan_capabilities = skw_wifi_get_gscan_capabilities; |
---|
| 1796 | + fn->wifi_set_link_stats = skw_wifi_set_link_stats; |
---|
| 1797 | + fn->wifi_get_link_stats = skw_wifi_get_link_stats; |
---|
| 1798 | + fn->wifi_clear_link_stats = skw_wifi_clear_link_stats; |
---|
| 1799 | + fn->wifi_get_valid_channels = skw_wifi_get_valid_channels; |
---|
| 1800 | + fn->wifi_rtt_range_request = skw_wifi_rtt_range_request; |
---|
| 1801 | + fn->wifi_rtt_range_cancel = skw_wifi_rtt_range_cancel; |
---|
| 1802 | + fn->wifi_get_rtt_capabilities = skw_wifi_get_rtt_capabilities; |
---|
| 1803 | + fn->wifi_rtt_get_responder_info = skw_wifi_rtt_get_responder_info; |
---|
| 1804 | + fn->wifi_enable_responder = skw_wifi_enable_responder; |
---|
| 1805 | + fn->wifi_disable_responder = skw_wifi_disable_responder; |
---|
| 1806 | + fn->wifi_set_nodfs_flag = skw_wifi_set_nodfs_flag; |
---|
| 1807 | + fn->wifi_start_logging = skw_wifi_start_logging; |
---|
| 1808 | + fn->wifi_set_epno_list = skw_wifi_set_epno_list; |
---|
| 1809 | + fn->wifi_reset_epno_list = skw_wifi_reset_epno_list; |
---|
| 1810 | + fn->wifi_set_country_code = skw_wifi_set_country_code; |
---|
| 1811 | + fn->wifi_get_firmware_memory_dump = skw_wifi_get_firmware_memory_dump; |
---|
| 1812 | + fn->wifi_set_log_handler = skw_wifi_set_log_handler; |
---|
| 1813 | + fn->wifi_reset_log_handler = skw_wifi_reset_log_handler; |
---|
| 1814 | + fn->wifi_set_alert_handler = skw_wifi_set_alert_handler; |
---|
| 1815 | + fn->wifi_reset_alert_handler = skw_wifi_reset_alert_handler; |
---|
| 1816 | + fn->wifi_get_firmware_version = skw_wifi_get_firmware_version; |
---|
| 1817 | + fn->wifi_get_ring_buffers_status = skw_wifi_get_ring_buffers_status; |
---|
| 1818 | + fn->wifi_get_logger_supported_feature_set = skw_wifi_get_logger_supported_feature_set; |
---|
| 1819 | + fn->wifi_get_ring_data = skw_wifi_get_ring_data; |
---|
| 1820 | + fn->wifi_enable_tdls = skw_wifi_enable_tdls; |
---|
| 1821 | + fn->wifi_disable_tdls = skw_wifi_disable_tdls; |
---|
| 1822 | + fn->wifi_get_tdls_status = skw_wifi_get_tdls_status; |
---|
| 1823 | + fn->wifi_get_tdls_capabilities = skw_wifi_get_tdls_capabilities; |
---|
| 1824 | + fn->wifi_get_driver_version = skw_wifi_get_driver_version; |
---|
| 1825 | + fn->wifi_set_passpoint_list = skw_wifi_set_passpoint_list; |
---|
| 1826 | + fn->wifi_reset_passpoint_list = skw_wifi_reset_passpoint_list; |
---|
| 1827 | + fn->wifi_set_lci = skw_wifi_set_lci; |
---|
| 1828 | + fn->wifi_set_lcr = skw_wifi_set_lcr; |
---|
| 1829 | + // fn->wifi_start_sending_offloaded_packet = skw_wifi_start_sending_offloaded_packet; |
---|
| 1830 | + fn->wifi_stop_sending_offloaded_packet = skw_wifi_stop_sending_offloaded_packet; |
---|
| 1831 | + fn->wifi_start_rssi_monitoring = skw_wifi_start_rssi_monitoring; |
---|
| 1832 | + fn->wifi_stop_rssi_monitoring = skw_wifi_stop_rssi_monitoring; |
---|
| 1833 | + fn->wifi_get_wake_reason_stats = skw_wifi_get_wake_reason_stats; |
---|
| 1834 | + fn->wifi_configure_nd_offload = skw_wifi_configure_nd_offload; |
---|
| 1835 | + fn->wifi_get_driver_memory_dump = skw_wifi_get_driver_memory_dump; |
---|
| 1836 | + fn->wifi_start_pkt_fate_monitoring = skw_wifi_start_pkt_fate_monitoring; |
---|
| 1837 | + fn->wifi_get_tx_pkt_fates = skw_wifi_get_tx_pkt_fates; |
---|
| 1838 | + fn->wifi_get_rx_pkt_fates = skw_wifi_get_rx_pkt_fates; |
---|
| 1839 | + fn->wifi_nan_enable_request = skw_wifi_nan_enable_request; |
---|
| 1840 | + fn->wifi_nan_disable_request = skw_wifi_nan_disable_request; |
---|
| 1841 | + fn->wifi_nan_publish_request = skw_wifi_nan_publish_request; |
---|
| 1842 | + fn->wifi_nan_publish_cancel_request = skw_wifi_nan_publish_cancel_request; |
---|
| 1843 | + fn->wifi_nan_subscribe_request = skw_wifi_nan_subscribe_request; |
---|
| 1844 | + fn->wifi_nan_subscribe_cancel_request = skw_wifi_nan_subscribe_cancel_request; |
---|
| 1845 | + fn->wifi_nan_transmit_followup_request = skw_wifi_nan_transmit_followup_request; |
---|
| 1846 | + fn->wifi_nan_stats_request = skw_wifi_nan_stats_request; |
---|
| 1847 | + fn->wifi_nan_config_request = skw_wifi_nan_config_request; |
---|
| 1848 | + fn->wifi_nan_tca_request = skw_wifi_nan_tca_request; |
---|
| 1849 | + fn->wifi_nan_beacon_sdf_payload_request = skw_wifi_nan_beacon_sdf_payload_request; |
---|
| 1850 | + fn->wifi_nan_register_handler = skw_wifi_nan_register_handler; |
---|
| 1851 | + fn->wifi_nan_get_version = skw_wifi_nan_get_version; |
---|
| 1852 | + fn->wifi_nan_get_capabilities = skw_wifi_nan_get_capabilities; |
---|
| 1853 | + fn->wifi_nan_data_interface_create = skw_wifi_nan_data_interface_create; |
---|
| 1854 | + fn->wifi_nan_data_interface_delete = skw_wifi_nan_data_interface_delete; |
---|
| 1855 | + fn->wifi_nan_data_request_initiator = skw_wifi_nan_data_request_initiator; |
---|
| 1856 | + fn->wifi_nan_data_indication_response = skw_wifi_nan_data_indication_response; |
---|
| 1857 | + fn->wifi_nan_data_end = skw_wifi_nan_data_end; |
---|
| 1858 | + fn->wifi_select_tx_power_scenario = skw_wifi_select_tx_power_scenario; |
---|
| 1859 | + fn->wifi_reset_tx_power_scenario = skw_wifi_reset_tx_power_scenario; |
---|
| 1860 | + fn->wifi_get_packet_filter_capabilities = skw_wifi_get_packet_filter_capabilities; |
---|
| 1861 | + fn->wifi_set_packet_filter = skw_wifi_set_packet_filter; |
---|
| 1862 | + fn->wifi_read_packet_filter = skw_wifi_read_packet_filter; |
---|
| 1863 | + fn->wifi_get_roaming_capabilities = skw_wifi_get_roaming_capabilities; |
---|
| 1864 | + fn->wifi_enable_firmware_roaming = skw_wifi_enable_firmware_roaming; |
---|
| 1865 | + fn->wifi_configure_roaming = skw_wifi_configure_roaming; |
---|
| 1866 | + fn->wifi_set_radio_mode_change_handler = skw_wifi_set_radio_mode_change_handler; |
---|
| 1867 | +#if __ANDROID_API__ > __ANDROID_API_Q__ |
---|
| 1868 | + fn->wifi_set_latency_mode = skw_wifi_set_latency_mode; |
---|
| 1869 | + fn->wifi_set_thermal_mitigation_mode = skw_wifi_set_thermal_mitigation_mode; |
---|
| 1870 | + fn->wifi_map_dscp_access_category = skw_wifi_map_dscp_access_category; |
---|
| 1871 | + fn->wifi_reset_dscp_mapping = skw_wifi_reset_dscp_mapping; |
---|
| 1872 | + fn->wifi_virtual_interface_create = skw_wifi_virtual_interface_create; |
---|
| 1873 | + fn->wifi_virtual_interface_delete = skw_wifi_virtual_interface_delete; |
---|
| 1874 | + fn->wifi_set_subsystem_restart_handler = skw_wifi_set_subsystem_restart_handler; |
---|
| 1875 | + fn->wifi_get_supported_iface_name = skw_wifi_get_supported_iface_name; |
---|
| 1876 | + fn->wifi_early_initialize = skw_wifi_early_initialize; |
---|
| 1877 | + fn->wifi_get_chip_feature_set = skw_wifi_get_chip_feature_set; |
---|
| 1878 | + fn->wifi_multi_sta_set_primary_connection = skw_wifi_multi_sta_set_primary_connection; |
---|
| 1879 | + fn->wifi_multi_sta_set_use_case = skw_wifi_multi_sta_set_use_case; |
---|
| 1880 | + fn->wifi_set_coex_unsafe_channels = skw_wifi_set_coex_unsafe_channels; |
---|
| 1881 | + fn->wifi_set_voip_mode = skw_wifi_set_voip_mode; |
---|
| 1882 | + fn->wifi_twt_register_handler = skw_wifi_twt_register_handler; |
---|
| 1883 | + fn->wifi_twt_get_capability = skw_wifi_twt_get_capability; |
---|
| 1884 | + fn->wifi_twt_setup_request = skw_wifi_twt_setup_request; |
---|
| 1885 | + fn->wifi_twt_teardown_request = skw_wifi_twt_teardown_request; |
---|
| 1886 | + fn->wifi_twt_info_frame_request = skw_wifi_twt_info_frame_request; |
---|
| 1887 | + fn->wifi_twt_get_stats = skw_wifi_twt_get_stats; |
---|
| 1888 | + fn->wifi_twt_clear_stats = skw_wifi_twt_clear_stats; |
---|
| 1889 | + fn->wifi_set_dtim_config = skw_wifi_set_dtim_config; |
---|
| 1890 | + fn->wifi_get_usable_channels = skw_wifi_get_usable_channels; |
---|
| 1891 | + fn->wifi_trigger_subsystem_restart = skw_wifi_trigger_subsystem_restart; |
---|
| 1892 | +#endif |
---|
| 1893 | + |
---|
| 1894 | + return WIFI_SUCCESS; |
---|
| 1895 | +} |
---|
.. | .. |
---|
| 1 | +#ifndef __MAIN_H__ |
---|
| 2 | +#define __MAIN_H__ |
---|
| 3 | + |
---|
| 4 | +#define LOG_TAG "SKW_WiFiHAL" |
---|
| 5 | +#include <log/log.h> |
---|
| 6 | + |
---|
| 7 | +#include "wifi_hal.h" |
---|
| 8 | + |
---|
| 9 | +#define OUI_GOOGLE 0x001A11 |
---|
| 10 | +#define SKW_NR_IFACE 8 |
---|
| 11 | + |
---|
| 12 | +#define skw_nla_for_each_nested(pos, nla, rem) \ |
---|
| 13 | + for (pos = (nlattr *)nla_data(nla), rem = nla_len(nla); \ |
---|
| 14 | + nla_ok(pos, rem); \ |
---|
| 15 | + pos = (nlattr *)nla_next(pos, &(rem))) |
---|
| 16 | + |
---|
| 17 | +typedef struct { |
---|
| 18 | + int iface_idx; // id to use when talking to driver |
---|
| 19 | + int wdev_idx; // id to use when talking to driver |
---|
| 20 | + wifi_handle hal_handle; // handle to wifi data |
---|
| 21 | + char name[IFNAMSIZ+1]; // interface name + trailing null |
---|
| 22 | +} interface_info; |
---|
| 23 | + |
---|
| 24 | +typedef struct { |
---|
| 25 | + struct nl_sock *nl_hal; // command socket object |
---|
| 26 | + struct nl_sock *nl_event; // event socket object |
---|
| 27 | + int family_nl80211; // family id for 80211 driver |
---|
| 28 | + |
---|
| 29 | + bool exit; // Indication to exit since cleanup has started |
---|
| 30 | + int exit_socks[2]; // sockets used to implement wifi_cleanup |
---|
| 31 | + wifi_cleaned_up_handler cleaned_up_handler; |
---|
| 32 | + |
---|
| 33 | + bool in_event_loop; // Indicates that event loop is active |
---|
| 34 | + |
---|
| 35 | + pthread_mutex_t cb_lock; // mutex for the event_cb access |
---|
| 36 | + |
---|
| 37 | + int num_cmd; // number of commands |
---|
| 38 | + int alloc_cmd; // number of commands allocated |
---|
| 39 | + |
---|
| 40 | + int nr_interfaces; |
---|
| 41 | + interface_info interfaces[SKW_NR_IFACE]; |
---|
| 42 | + wifi_interface_handle interface_handle[SKW_NR_IFACE]; |
---|
| 43 | + |
---|
| 44 | + int max_num_interfaces; // max number of interfaces |
---|
| 45 | + |
---|
| 46 | + // add other details |
---|
| 47 | +} hal_info; |
---|
| 48 | + |
---|
| 49 | +static inline hal_info *getHalInfo(wifi_interface_handle handle) |
---|
| 50 | +{ |
---|
| 51 | + return (hal_info *)(((interface_info *)handle)->hal_handle); |
---|
| 52 | +} |
---|
| 53 | +#endif |
---|
.. | .. |
---|
| 1 | +#include <netlink/genl/genl.h> |
---|
| 2 | + |
---|
| 3 | +#include "wifi_command.h" |
---|
| 4 | + |
---|
| 5 | +static int ackHandler(struct nl_msg *msg, void *arg) |
---|
| 6 | +{ |
---|
| 7 | + *((int *)arg) = 0; |
---|
| 8 | + |
---|
| 9 | + return NL_STOP; |
---|
| 10 | +} |
---|
| 11 | + |
---|
| 12 | +static int finishHandler(struct nl_msg *msg, void *arg) |
---|
| 13 | +{ |
---|
| 14 | + *((int *)arg) = 0; |
---|
| 15 | + |
---|
| 16 | + return NL_SKIP; |
---|
| 17 | +} |
---|
| 18 | + |
---|
| 19 | +static int errorHandler(struct sockaddr_nl *nla, struct nlmsgerr *err, void *arg) |
---|
| 20 | +{ |
---|
| 21 | + *((int *)arg) = 0; |
---|
| 22 | + |
---|
| 23 | + return NL_SKIP; |
---|
| 24 | +} |
---|
| 25 | + |
---|
| 26 | +static int msgHandler(struct nl_msg *msg, void *arg) |
---|
| 27 | +{ |
---|
| 28 | + struct nlattr *attr[NL80211_ATTR_MAX + 1]; |
---|
| 29 | + WifiCommand *cmd = (WifiCommand *)arg; |
---|
| 30 | + struct genlmsghdr *gnlh = (struct genlmsghdr *)nlmsg_data(nlmsg_hdr(msg)); |
---|
| 31 | + |
---|
| 32 | + nla_parse(attr, NL80211_ATTR_MAX, genlmsg_attrdata(gnlh, 0), |
---|
| 33 | + genlmsg_attrlen(gnlh, 0), NULL); |
---|
| 34 | + |
---|
| 35 | + cmd->parser(attr); |
---|
| 36 | + |
---|
| 37 | + return NL_SKIP; |
---|
| 38 | +} |
---|
| 39 | + |
---|
| 40 | +wifi_error sendMsg(struct nl_sock *sk, struct nl_msg *msg, void *arg) |
---|
| 41 | +{ |
---|
| 42 | + int err; |
---|
| 43 | + struct nl_cb *cb; |
---|
| 44 | + |
---|
| 45 | + cb = nl_cb_alloc(NL_CB_DEFAULT); |
---|
| 46 | + if (cb == NULL) { |
---|
| 47 | + ALOGE("%s: alloc cb failed"); |
---|
| 48 | + return WIFI_ERROR_OUT_OF_MEMORY; |
---|
| 49 | + } |
---|
| 50 | + |
---|
| 51 | + nl_cb_err(cb, NL_CB_CUSTOM, errorHandler, &err); |
---|
| 52 | + nl_cb_set(cb, NL_CB_FINISH, NL_CB_CUSTOM, finishHandler, &err); |
---|
| 53 | + nl_cb_set(cb, NL_CB_ACK, NL_CB_CUSTOM, ackHandler, &err); |
---|
| 54 | + nl_cb_set(cb, NL_CB_VALID, NL_CB_CUSTOM, msgHandler, arg); |
---|
| 55 | + |
---|
| 56 | + err = nl_send_auto_complete(sk, msg); |
---|
| 57 | + while (err > 0) { |
---|
| 58 | + int res = nl_recvmsgs(sk, cb); |
---|
| 59 | + if (res < 0) |
---|
| 60 | + ALOGE("%s: recv msg failed: %d", res); |
---|
| 61 | + } |
---|
| 62 | + |
---|
| 63 | + nl_cb_put(cb); |
---|
| 64 | + |
---|
| 65 | + return err ? WIFI_ERROR_UNKNOWN : WIFI_SUCCESS; |
---|
| 66 | +} |
---|
| 67 | + |
---|
| 68 | +wifi_error WifiCommand::send() |
---|
| 69 | +{ |
---|
| 70 | + return sendMsg(sock, nlmsg(), (void *)this); |
---|
| 71 | +} |
---|
| 72 | + |
---|
| 73 | +WifiCommand::~WifiCommand() |
---|
| 74 | +{ |
---|
| 75 | + nlmsg_free(msg); |
---|
| 76 | +} |
---|
| 77 | + |
---|
| 78 | +WifiCommand::WifiCommand(struct nl_sock *sk, int family_id, int flags, int nl80211_cmd) |
---|
| 79 | +{ |
---|
| 80 | + sock = sk; |
---|
| 81 | + |
---|
| 82 | + msg = nlmsg_alloc(); |
---|
| 83 | + if (msg) |
---|
| 84 | + genlmsg_put(msg, 0, 0, family_id, 0, flags, nl80211_cmd, 0); |
---|
| 85 | + else |
---|
| 86 | + ALOGE("nlmsg alloc failed, nl80211 cmd: %d", nl80211_cmd); |
---|
| 87 | +} |
---|
.. | .. |
---|
| 1 | +#ifndef __WIFI_COMMAND_H__ |
---|
| 2 | +#define __WIFI_COMMAND_H__ |
---|
| 3 | + |
---|
| 4 | +#include "main.h" |
---|
| 5 | +#include "nl80211_copy.h" |
---|
| 6 | + |
---|
| 7 | +#define SKW_VCMD_GET_CHANNELS 0x1009 |
---|
| 8 | +#define SKW_VCMD_SET_COUNTRY 0x100E |
---|
| 9 | +#define SKW_VCMD_GET_VERSION 0x1403 |
---|
| 10 | +#define SKW_VCMD_GET_RING_BUFFERS_STATUS 0x1404 |
---|
| 11 | +#define SKW_VCMD_GET_LOGGER_FEATURES 0x1406 |
---|
| 12 | +enum SKW_SUBCMD_GET_VERSION { |
---|
| 13 | + SKW_DRV_VERSION = 1, |
---|
| 14 | + SKW_FW_VERSION, |
---|
| 15 | +}; |
---|
| 16 | + |
---|
| 17 | +class WifiCommand { |
---|
| 18 | +private: |
---|
| 19 | + struct nl_msg *msg; |
---|
| 20 | + struct nl_sock *sock; |
---|
| 21 | + int id; |
---|
| 22 | + |
---|
| 23 | +public: |
---|
| 24 | + WifiCommand(struct nl_sock *sk, int family_id, int flags, int nl80211_cmd); |
---|
| 25 | + wifi_error send(); |
---|
| 26 | + |
---|
| 27 | + virtual ~WifiCommand(); |
---|
| 28 | + virtual wifi_error build(wifi_interface_handle handle, void *param) = 0; |
---|
| 29 | + // virtual wifi_error parser(struct nl_msg *msg) = 0; |
---|
| 30 | + virtual wifi_error parser(struct nlattr *attr[]) = 0; |
---|
| 31 | + // virtual wifi_error parser(struct nlattr *tb[CTRL_ATTR_MAX]) |
---|
| 32 | + |
---|
| 33 | + struct nl_msg *nlmsg() |
---|
| 34 | + { |
---|
| 35 | + return msg; |
---|
| 36 | + } |
---|
| 37 | + |
---|
| 38 | + int put_s8(int attribute, int8_t value) |
---|
| 39 | + { |
---|
| 40 | + return nla_put(nlmsg(), attribute, sizeof(int8_t), &value); |
---|
| 41 | + } |
---|
| 42 | + |
---|
| 43 | + int put_u8(int attribute, uint8_t value) |
---|
| 44 | + { |
---|
| 45 | + return nla_put(nlmsg(), attribute, sizeof(uint8_t), &value); |
---|
| 46 | + } |
---|
| 47 | + |
---|
| 48 | + int put_s16(int attribute, int16_t value) |
---|
| 49 | + { |
---|
| 50 | + return nla_put(nlmsg(), attribute, sizeof(int16_t), &value); |
---|
| 51 | + } |
---|
| 52 | + |
---|
| 53 | + int put_u16(int attribute, uint16_t value) |
---|
| 54 | + { |
---|
| 55 | + return nla_put(nlmsg(), attribute, sizeof(uint16_t), &value); |
---|
| 56 | + } |
---|
| 57 | + |
---|
| 58 | + int put_s32(int attribute, int32_t value) |
---|
| 59 | + { |
---|
| 60 | + return nla_put(nlmsg(), attribute, sizeof(int32_t), &value); |
---|
| 61 | + } |
---|
| 62 | + |
---|
| 63 | + int put_u32(int attribute, uint32_t value) |
---|
| 64 | + { |
---|
| 65 | + return nla_put(nlmsg(), attribute, sizeof(uint32_t), &value); |
---|
| 66 | + } |
---|
| 67 | + |
---|
| 68 | + int put_s64(int attribute, int64_t value) |
---|
| 69 | + { |
---|
| 70 | + return nla_put(nlmsg(), attribute, sizeof(int64_t), &value); |
---|
| 71 | + } |
---|
| 72 | + |
---|
| 73 | + int put_u64(int attribute, uint64_t value) |
---|
| 74 | + { |
---|
| 75 | + return nla_put(nlmsg(), attribute, sizeof(uint64_t), &value); |
---|
| 76 | + } |
---|
| 77 | + |
---|
| 78 | + int put_string(int attribute, const char *value) |
---|
| 79 | + { |
---|
| 80 | + return nla_put(nlmsg(), attribute, strlen(value) + 1, value); |
---|
| 81 | + } |
---|
| 82 | + |
---|
| 83 | + int put_addr(int attribute, mac_addr value) |
---|
| 84 | + { |
---|
| 85 | + return nla_put(nlmsg(), attribute, sizeof(mac_addr), value); |
---|
| 86 | + } |
---|
| 87 | + |
---|
| 88 | + struct nlattr *attr_start() |
---|
| 89 | + { |
---|
| 90 | + return nla_nest_start(nlmsg(), NL80211_ATTR_VENDOR_DATA); |
---|
| 91 | + } |
---|
| 92 | + |
---|
| 93 | + void attr_end(struct nlattr *attribute) |
---|
| 94 | + { |
---|
| 95 | + nla_nest_end(nlmsg(), attribute); |
---|
| 96 | + } |
---|
| 97 | +}; |
---|
| 98 | + |
---|
| 99 | +#endif |
---|
.. | .. |
---|
| 1 | +# Copyright (C) 2008 The Android Open Source Project |
---|
| 2 | +# |
---|
| 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 | +LOCAL_PATH := $(call my-dir) |
---|
| 16 | + |
---|
| 17 | +ifeq ($(BOARD_WLAN_DEVICE), seekwave) |
---|
| 18 | + |
---|
| 19 | +WPA_SRC_DIR = external/wpa_supplicant_8 |
---|
| 20 | + |
---|
| 21 | +SKW_LIB_INC = $(WPA_SRC_DIR)/src \ |
---|
| 22 | + $(WPA_SRC_DIR)/src/common \ |
---|
| 23 | + $(WPA_SRC_DIR)/src/drivers \ |
---|
| 24 | + $(WPA_SRC_DIR)/src/l2_packet \ |
---|
| 25 | + $(WPA_SRC_DIR)/src/utils \ |
---|
| 26 | + $(WPA_SRC_DIR)/src/wps \ |
---|
| 27 | + $(WPA_SRC_DIR)/wpa_supplicant |
---|
| 28 | + |
---|
| 29 | +SKW_LIB_INC += external/libnl/include |
---|
| 30 | +SKW_LIB_SRC = driver_cmd_nl80211.c |
---|
| 31 | + |
---|
| 32 | +include $(WPA_SRC_DIR)/wpa_supplicant/android.config |
---|
| 33 | +L_CFLAGS += -Wall -Werror -Wno-unused-parameter -Wno-macro-redefined |
---|
| 34 | + |
---|
| 35 | +ifeq ($(TARGET_ARCH),arm) |
---|
| 36 | +# To force sizeof(enum) = 4 |
---|
| 37 | +L_CFLAGS += -mabi=aapcs-linux |
---|
| 38 | +endif |
---|
| 39 | + |
---|
| 40 | +ifdef CONFIG_ANDROID_LOG |
---|
| 41 | +L_CFLAGS += -DCONFIG_ANDROID_LOG |
---|
| 42 | +endif |
---|
| 43 | + |
---|
| 44 | +ifdef CONFIG_P2P |
---|
| 45 | +L_CFLAGS += -DCONFIG_P2P |
---|
| 46 | +endif |
---|
| 47 | + |
---|
| 48 | +######################## |
---|
| 49 | + |
---|
| 50 | +include $(CLEAR_VARS) |
---|
| 51 | +LOCAL_MODULE := lib_driver_cmd_skw |
---|
| 52 | +LOCAL_LICENSE_KINDS := SPDX-license-identifier-BSD |
---|
| 53 | +LOCAL_LICENSE_CONDITIONS := notice |
---|
| 54 | +LOCAL_NOTICE_FILE := $(LOCAL_PATH)/NOTICE |
---|
| 55 | +LOCAL_SHARED_LIBRARIES := libc libcutils |
---|
| 56 | +LOCAL_CFLAGS := $(L_CFLAGS) |
---|
| 57 | +LOCAL_SRC_FILES := $(SKW_LIB_SRC) |
---|
| 58 | +LOCAL_C_INCLUDES := $(SKW_LIB_INC) |
---|
| 59 | +LOCAL_VENDOR_MODULE := true |
---|
| 60 | +include $(BUILD_STATIC_LIBRARY) |
---|
| 61 | + |
---|
| 62 | +######################## |
---|
| 63 | + |
---|
| 64 | +endif |
---|
.. | .. |
---|
| 1 | +Copyright (c) 2005-2010, The Android Open Source Project |
---|
| 2 | +All rights reserved. |
---|
| 3 | + |
---|
| 4 | +Redistribution and use in source and binary forms, with or without |
---|
| 5 | +modification, are permitted provided that the following conditions |
---|
| 6 | +are met: |
---|
| 7 | + * Redistributions of source code must retain the above copyright |
---|
| 8 | + notice, this list of conditions and the following disclaimer. |
---|
| 9 | + * Redistributions in binary form must reproduce the above copyright |
---|
| 10 | + notice, this list of conditions and the following disclaimer in |
---|
| 11 | + the documentation and/or other materials provided with the |
---|
| 12 | + distribution. |
---|
| 13 | + * Neither the name of The Android Open Source Project nor the names |
---|
| 14 | + of its contributors may be used to endorse or promote products |
---|
| 15 | + derived from this software without specific prior written |
---|
| 16 | + permission. |
---|
| 17 | + |
---|
| 18 | +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
---|
| 19 | +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
---|
| 20 | +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS |
---|
| 21 | +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE |
---|
| 22 | +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, |
---|
| 23 | +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, |
---|
| 24 | +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS |
---|
| 25 | +OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED |
---|
| 26 | +AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
---|
| 27 | +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT |
---|
| 28 | +OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
---|
| 29 | +SUCH DAMAGE. |
---|
| 30 | + |
---|
| 31 | + * Copyright (c) 2002-2010, Jouni Malinen <j@w1.fi> |
---|
| 32 | + * Copyright (c) 2003-2004, Instant802 Networks, Inc. |
---|
| 33 | + * Copyright (c) 2005-2006, Devicescape Software, Inc. |
---|
| 34 | + * Copyright (c) 2007, Johannes Berg <johannes@sipsolutions.net> |
---|
| 35 | + * Copyright (c) 2009-2010, Atheros Communications |
---|
| 36 | + * |
---|
| 37 | + * This program is free software; you can redistribute it and/or modify |
---|
| 38 | + * it under the terms of the GNU General Public License version 2 as |
---|
| 39 | + * published by the Free Software Foundation. |
---|
| 40 | + * |
---|
| 41 | + * Alternatively, this software may be distributed under the terms of BSD |
---|
| 42 | + * license. |
---|
.. | .. |
---|
| 1 | +/* |
---|
| 2 | + * Driver interaction with extended Linux CFG8021 |
---|
| 3 | + * |
---|
| 4 | + * This program is free software; you can redistribute it and/or modify |
---|
| 5 | + * it under the terms of the GNU General Public License version 2 as |
---|
| 6 | + * published by the Free Software Foundation. |
---|
| 7 | + * |
---|
| 8 | + * Alternatively, this software may be distributed under the terms of BSD |
---|
| 9 | + * license. |
---|
| 10 | + * |
---|
| 11 | + */ |
---|
| 12 | + |
---|
| 13 | +#include "includes.h" |
---|
| 14 | +#include <sys/types.h> |
---|
| 15 | +#include <fcntl.h> |
---|
| 16 | +#include <net/if.h> |
---|
| 17 | + |
---|
| 18 | +#include "common.h" |
---|
| 19 | +#include "linux_ioctl.h" |
---|
| 20 | +#include "driver_nl80211.h" |
---|
| 21 | +#include "wpa_supplicant_i.h" |
---|
| 22 | +#include "config.h" |
---|
| 23 | +#ifdef ANDROID |
---|
| 24 | +#include "android_drv.h" |
---|
| 25 | +#endif |
---|
| 26 | + |
---|
| 27 | +typedef struct android_wifi_priv_cmd { |
---|
| 28 | + char *bufaddr; |
---|
| 29 | + int used_len; |
---|
| 30 | + int total_len; |
---|
| 31 | +} android_wifi_priv_cmd; |
---|
| 32 | + |
---|
| 33 | +static int drv_errors = 0; |
---|
| 34 | + |
---|
| 35 | +static void wpa_driver_send_hang_msg(struct wpa_driver_nl80211_data *drv) |
---|
| 36 | +{ |
---|
| 37 | + drv_errors++; |
---|
| 38 | + if (drv_errors > DRV_NUMBER_SEQUENTIAL_ERRORS) { |
---|
| 39 | + drv_errors = 0; |
---|
| 40 | + wpa_msg(drv->ctx, MSG_INFO, WPA_EVENT_DRIVER_STATE "HANGED"); |
---|
| 41 | + } |
---|
| 42 | +} |
---|
| 43 | + |
---|
| 44 | +static void wpa_driver_notify_country_change(void *ctx, char *cmd) |
---|
| 45 | +{ |
---|
| 46 | + if ((os_strncasecmp(cmd, "COUNTRY", 7) == 0) || |
---|
| 47 | + (os_strncasecmp(cmd, "SETBAND", 7) == 0)) { |
---|
| 48 | + union wpa_event_data event; |
---|
| 49 | + |
---|
| 50 | + os_memset(&event, 0, sizeof(event)); |
---|
| 51 | + event.channel_list_changed.initiator = REGDOM_SET_BY_USER; |
---|
| 52 | + if (os_strncasecmp(cmd, "COUNTRY", 7) == 0) { |
---|
| 53 | + event.channel_list_changed.type = REGDOM_TYPE_COUNTRY; |
---|
| 54 | + if (os_strlen(cmd) > 9) { |
---|
| 55 | + event.channel_list_changed.alpha2[0] = cmd[8]; |
---|
| 56 | + event.channel_list_changed.alpha2[1] = cmd[9]; |
---|
| 57 | + } |
---|
| 58 | + } else { |
---|
| 59 | + event.channel_list_changed.type = REGDOM_TYPE_UNKNOWN; |
---|
| 60 | + } |
---|
| 61 | + wpa_supplicant_event(ctx, EVENT_CHANNEL_LIST_CHANGED, &event); |
---|
| 62 | + } |
---|
| 63 | +} |
---|
| 64 | + |
---|
| 65 | +int wpa_driver_nl80211_driver_cmd(void *priv, char *cmd, char *buf, |
---|
| 66 | + size_t buf_len ) |
---|
| 67 | +{ |
---|
| 68 | + struct i802_bss *bss = priv; |
---|
| 69 | + struct wpa_driver_nl80211_data *drv = bss->drv; |
---|
| 70 | + struct ifreq ifr; |
---|
| 71 | + android_wifi_priv_cmd priv_cmd; |
---|
| 72 | + int ret = 0; |
---|
| 73 | + |
---|
| 74 | + if (bss->ifindex <= 0 && bss->wdev_id > 0) { |
---|
| 75 | + /* DRIVER CMD received on the DEDICATED P2P Interface which doesn't |
---|
| 76 | + * have an NETDEVICE associated with it. So we have to re-route the |
---|
| 77 | + * command to the parent NETDEVICE |
---|
| 78 | + */ |
---|
| 79 | + struct wpa_supplicant *wpa_s = (struct wpa_supplicant *)(drv->ctx); |
---|
| 80 | + |
---|
| 81 | + wpa_printf(MSG_DEBUG, "Re-routing DRIVER cmd to parent iface"); |
---|
| 82 | + if (wpa_s && wpa_s->parent) { |
---|
| 83 | + /* Update the nl80211 pointers corresponding to parent iface */ |
---|
| 84 | + bss = wpa_s->parent->drv_priv; |
---|
| 85 | + if (bss) { |
---|
| 86 | + drv = bss->drv; |
---|
| 87 | + } else { |
---|
| 88 | + wpa_printf(MSG_DEBUG, "bss invalid, command : %s", cmd); |
---|
| 89 | + return -1; |
---|
| 90 | + } |
---|
| 91 | + |
---|
| 92 | + wpa_printf(MSG_DEBUG, "Re-routing command to iface: %s" |
---|
| 93 | + " cmd (%s)", bss->ifname, cmd); |
---|
| 94 | + } |
---|
| 95 | + } |
---|
| 96 | + |
---|
| 97 | + if (os_strcasecmp(cmd, "STOP") == 0) { |
---|
| 98 | + linux_set_iface_flags(drv->global->ioctl_sock, bss->ifname, 0); |
---|
| 99 | + wpa_msg(drv->ctx, MSG_INFO, WPA_EVENT_DRIVER_STATE "STOPPED"); |
---|
| 100 | + } else if (os_strcasecmp(cmd, "START") == 0) { |
---|
| 101 | + linux_set_iface_flags(drv->global->ioctl_sock, bss->ifname, 1); |
---|
| 102 | + wpa_msg(drv->ctx, MSG_INFO, WPA_EVENT_DRIVER_STATE "STARTED"); |
---|
| 103 | + } else if (os_strcasecmp(cmd, "MACADDR") == 0) { |
---|
| 104 | + u8 macaddr[ETH_ALEN] = {}; |
---|
| 105 | + |
---|
| 106 | + ret = linux_get_ifhwaddr(drv->global->ioctl_sock, bss->ifname, macaddr); |
---|
| 107 | + if (!ret) |
---|
| 108 | + ret = os_snprintf(buf, buf_len, |
---|
| 109 | + "Macaddr = " MACSTR "\n", MAC2STR(macaddr)); |
---|
| 110 | + } else { /* Use private command */ |
---|
| 111 | + os_memcpy(buf, cmd, strlen(cmd) + 1); |
---|
| 112 | + memset(&ifr, 0, sizeof(ifr)); |
---|
| 113 | + memset(&priv_cmd, 0, sizeof(priv_cmd)); |
---|
| 114 | + os_strlcpy(ifr.ifr_name, bss->ifname, IFNAMSIZ); |
---|
| 115 | + |
---|
| 116 | + priv_cmd.bufaddr = buf; |
---|
| 117 | + |
---|
| 118 | + priv_cmd.used_len = buf_len; |
---|
| 119 | + priv_cmd.total_len = buf_len; |
---|
| 120 | + ifr.ifr_data = &priv_cmd; |
---|
| 121 | + |
---|
| 122 | + if ((ret = ioctl(drv->global->ioctl_sock, SIOCDEVPRIVATE + 1, &ifr)) < 0) { |
---|
| 123 | + wpa_printf(MSG_ERROR, "%s: failed to issue private command: %s", __func__, cmd); |
---|
| 124 | + wpa_driver_send_hang_msg(drv); |
---|
| 125 | + } else { |
---|
| 126 | + drv_errors = 0; |
---|
| 127 | + ret = 0; |
---|
| 128 | + if ((os_strcasecmp(cmd, "LINKSPEED") == 0) || |
---|
| 129 | + (os_strcasecmp(cmd, "RSSI") == 0) || |
---|
| 130 | + (os_strcasecmp(cmd, "GETBAND") == 0) || |
---|
| 131 | + (os_strncasecmp(cmd, "WLS_BATCHING", 12) == 0)) |
---|
| 132 | + ret = strlen(buf); |
---|
| 133 | + wpa_driver_notify_country_change(drv->ctx, cmd); |
---|
| 134 | + wpa_printf(MSG_DEBUG, "%s %s len = %d, %zu", __func__, buf, ret, strlen(buf)); |
---|
| 135 | + } |
---|
| 136 | + } |
---|
| 137 | + return ret; |
---|
| 138 | +} |
---|
| 139 | + |
---|
| 140 | +int wpa_driver_set_p2p_noa(void *priv, u8 count, int start, int duration) |
---|
| 141 | +{ |
---|
| 142 | + wpa_printf(MSG_DEBUG, "%s: count: %d, start: %d, duration: %d", |
---|
| 143 | + __func__, count, start, duration); |
---|
| 144 | + |
---|
| 145 | + return 0; |
---|
| 146 | +} |
---|
| 147 | + |
---|
| 148 | +int wpa_driver_get_p2p_noa(void *priv __unused, u8 *buf __unused, size_t len __unused) |
---|
| 149 | +{ |
---|
| 150 | + wpa_printf(MSG_DEBUG, "%s: priv: 0x%p, buf: 0x%p, len: %zu", |
---|
| 151 | + __func__, priv, buf, len); |
---|
| 152 | + |
---|
| 153 | + return 0; |
---|
| 154 | +} |
---|
| 155 | + |
---|
| 156 | +int wpa_driver_set_p2p_ps(void *priv, int legacy_ps, int opp_ps, int ctwindow) |
---|
| 157 | +{ |
---|
| 158 | + wpa_printf(MSG_DEBUG, "%s: legacy_ps: %d, opp_ps: %d, ctw: %d", |
---|
| 159 | + __func__, legacy_ps, opp_ps, ctwindow); |
---|
| 160 | + |
---|
| 161 | + return 0; |
---|
| 162 | +} |
---|
| 163 | + |
---|
| 164 | +int wpa_driver_set_ap_wps_p2p_ie(void *priv, const struct wpabuf *beacon, |
---|
| 165 | + const struct wpabuf *proberesp, |
---|
| 166 | + const struct wpabuf *assocresp) |
---|
| 167 | +{ |
---|
| 168 | + return 0; |
---|
| 169 | +} |
---|
.. | .. |
---|
941 | 941 | /*sd-uhs-sdr25*/ |
---|
942 | 942 | sd-uhs-sdr50; |
---|
943 | 943 | sd-uhs-ddr50; |
---|
944 | | - sd-uhs-sdr104; |
---|
| 944 | + //sd-uhs-sdr104; |
---|
945 | 945 | // kickpi |
---|
946 | 946 | //sunxi-power-save-mode; |
---|
947 | 947 | /*sunxi-dis-signal-vol-sw;*/ |
---|
.. | .. |
---|
2605 | 2605 | struct sdio_func *func1 = skw_sdio->sdio_func[FUNC_1]; |
---|
2606 | 2606 | struct mmc_host *host = func1->card->host; |
---|
2607 | 2607 | |
---|
2608 | | - if ((SKW_SDIO_INBAND_IRQ == skw_sdio->irq_type) && (0 == (host->caps & MMC_CAP_SDIO_IRQ))) { |
---|
2609 | | - skw_sdio_err("Please add cap-sdio-irq to dts! irq_type=%d caps=0x%x\n", skw_sdio->irq_type, host->caps); |
---|
2610 | | - ret = -EPERM; |
---|
2611 | | - } else if ((host->ios.clock > 50000000UL) && (0 == (host->caps & MMC_CAP_UHS_SDR104))) { |
---|
2612 | | - skw_sdio_err("please add sd-uhs-sdr104 to dts! clock=%d cap=0x%x\n", host->ios.clock, host->caps); |
---|
2613 | | - ret = -EPERM; |
---|
2614 | | - } else if ((host->ios.clock <= 50000000UL) && (0 != (host->caps & MMC_CAP_UHS_SDR104))) { |
---|
2615 | | - skw_sdio_err("please remove sd-uhs-sdr104 from dts! clock=%d cap=0x%x\n", host->ios.clock, host->caps); |
---|
2616 | | - ret = -EPERM; |
---|
2617 | | - } else if (host->ios.clock != host->f_max) { |
---|
2618 | | - skw_sdio_err("actual clock is not equal to max clock! clock=%d f_max=%d\n", host->ios.clock, host->f_max); |
---|
2619 | | - ret = -EPERM; |
---|
2620 | | - } else if (host->ios.timing != MMC_TIMING_UHS_SDR104) { |
---|
2621 | | - skw_sdio_err("actual timing is not equal to max timing! timing=%d t_max=%d\n", host->ios.timing, MMC_TIMING_UHS_SDR104); |
---|
2622 | | - ret = -EPERM; |
---|
2623 | | - } |
---|
| 2608 | + // if ((SKW_SDIO_INBAND_IRQ == skw_sdio->irq_type) && (0 == (host->caps & MMC_CAP_SDIO_IRQ))) { |
---|
| 2609 | + // skw_sdio_err("Please add cap-sdio-irq to dts! irq_type=%d caps=0x%x\n", skw_sdio->irq_type, host->caps); |
---|
| 2610 | + // ret = -EPERM; |
---|
| 2611 | + // } else if ((host->ios.clock > 50000000UL) && (0 == (host->caps & MMC_CAP_UHS_SDR104))) { |
---|
| 2612 | + // skw_sdio_err("please add sd-uhs-sdr104 to dts! clock=%d cap=0x%x\n", host->ios.clock, host->caps); |
---|
| 2613 | + // ret = -EPERM; |
---|
| 2614 | + // } else if ((host->ios.clock <= 50000000UL) && (0 != (host->caps & MMC_CAP_UHS_SDR104))) { |
---|
| 2615 | + // skw_sdio_err("please remove sd-uhs-sdr104 from dts! clock=%d cap=0x%x\n", host->ios.clock, host->caps); |
---|
| 2616 | + // ret = -EPERM; |
---|
| 2617 | + // } else if (host->ios.clock != host->f_max) { |
---|
| 2618 | + // skw_sdio_err("actual clock is not equal to max clock! clock=%d f_max=%d\n", host->ios.clock, host->f_max); |
---|
| 2619 | + // ret = -EPERM; |
---|
| 2620 | + // } else if (host->ios.timing != MMC_TIMING_UHS_SDR104) { |
---|
| 2621 | + // skw_sdio_err("actual timing is not equal to max timing! timing=%d t_max=%d\n", host->ios.timing, MMC_TIMING_UHS_SDR104); |
---|
| 2622 | + // ret = -EPERM; |
---|
| 2623 | + // } |
---|
2624 | 2624 | |
---|
2625 | 2625 | return ret; |
---|
2626 | 2626 | } |
---|